diff --git a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java index 4214b51..6d22189 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; @Api(value = "小程序-实名认证", tags = "小程序-实名认证") @@ -44,6 +45,24 @@ public class AliRealNameAuthenticationController { @Autowired public EnterpriseCertificationService enterpriseCertificationService; + @ApiOperation(value = "删除平台全部认证信息") + @PostMapping("/deletePlatformAuthenticationInformation") + public R deletePlatformAuthenticationInformation(@ApiParam(name = "openIds", value = "微信openId", required = true) @RequestBody List openIds) { + + openIds.forEach(openId ->{ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("open_id", openId); + service.remove(queryWrapper); + + + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.eq("open_id", openId); + enterpriseCertificationService.remove(queryWrapper1); + }); + + return R.ok(); + } + @ApiOperation(value = "身份证图片验证") @PostMapping("/faceAuthentication") @@ -157,7 +176,7 @@ public class AliRealNameAuthenticationController { HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); if (info.getStatus()) { - if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId(),enterpriseCertification.getOpenId()))) { + if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), certification.getId(), enterpriseCertification.getOpenId()))) { errorMsg = "企业名称已存在"; throw new RuntimeException(errorMsg); } @@ -201,7 +220,7 @@ public class AliRealNameAuthenticationController { HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); CreditCodeResp info = new Gson().fromJson(EntityUtils.toString(response.getEntity()), CreditCodeResp.class); if (info.getStatus()) { - if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(),null, enterpriseCertification.getOpenId()))) { + if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName(), null, enterpriseCertification.getOpenId()))) { errorMsg = "企业名称已存在"; throw new RuntimeException(errorMsg); } diff --git a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java index 3c0fe4a..be1bb4d 100644 --- a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java +++ b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java @@ -46,6 +46,12 @@ public class EnterpriseCertificationController { } + @PostMapping("/enterpriseCertificationDetails") + @ApiOperation(value = "企业认证详情", response = EnterpriseCertification.class) + public R enterpriseCertificationDetails(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { + return service.enterpriseCertificationDetails(id); + } + @PostMapping("/findById") @ApiOperation(value = "查询详情", response = EnterpriseCertification.class) public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { @@ -56,7 +62,7 @@ public class EnterpriseCertificationController { @PostMapping("/enterpriseCertificationStatus") @ApiOperation(value = "查询企业当前认证状态", response = EnterpriseCertification.class) - public R enterpriseCertificationStatus(@ApiParam(name = "openId", value = "微信openId", required = true) Integer openId) { + public R enterpriseCertificationStatus(@ApiParam(name = "openId", value = "微信openId", required = true)@RequestParam String openId) { /*String accountId = TokenUtils.getIdByJwtToken(request);*/ QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("open_id", openId); @@ -87,12 +93,14 @@ public class EnterpriseCertificationController { @PostMapping("/informationAudit") @ApiOperation(value = "信息审核", response = EnterpriseCertification.class) - public R informationAudit(@ApiParam(name = "auditStatus", value = "审核状态(2.通过,3.不通过)", required = true) Integer auditStatus, @ApiParam(name = "id", value = "主键", required = true) Integer id, HttpServletRequest request) { + public R informationAudit(@ApiParam(name = "auditStatus", value = "审核状态(2.通过,3.不通过)", required = true)@RequestParam Integer auditStatus, + @ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id, HttpServletRequest request) { String accountId = TokenUtils.getIdByJwtToken(request); EnterpriseCertification enterpriseCertification = new EnterpriseCertification(); enterpriseCertification.setAccountId(Integer.valueOf(accountId)); enterpriseCertification.setAuditStatus(auditStatus); + enterpriseCertification.setId(id); switch (auditStatus) { case 2: //通过:更改认证状态 认证状态(0默认未认证 1.认证中2.已认证) diff --git a/users/src/main/java/com/huoran/users/mapper/EnterpriseCertificationMapper.java b/users/src/main/java/com/huoran/users/mapper/EnterpriseCertificationMapper.java index 1b99c74..857aeda 100644 --- a/users/src/main/java/com/huoran/users/mapper/EnterpriseCertificationMapper.java +++ b/users/src/main/java/com/huoran/users/mapper/EnterpriseCertificationMapper.java @@ -19,4 +19,7 @@ import org.apache.ibatis.annotations.Param; public interface EnterpriseCertificationMapper extends BaseMapper { IPage selectEnterpriseCertificationList(IPage page, @Param("req")EnterpriseCertificationLIstReq req); + + EnterpriseCertification enterpriseCertificationDetails(@Param("id")Integer id); + } diff --git a/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml b/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml index 4844d70..7dd0ad3 100644 --- a/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml +++ b/users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml @@ -64,4 +64,32 @@ and t.city=#{req.province,jdbcType=VARCHAR} + diff --git a/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java b/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java index cb30fc7..c89bb89 100644 --- a/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java +++ b/users/src/main/java/com/huoran/users/service/EnterpriseCertificationService.java @@ -17,4 +17,6 @@ public interface EnterpriseCertificationService extends IService