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 b7281d6..3991486 100644 --- a/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java +++ b/users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java @@ -1,16 +1,12 @@ package com.huoran.users.controller; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.users.config.AliRealNameAuthenticationConfig; import com.huoran.users.entity.EnterpriseCertification; import com.huoran.users.entity.UserAuthenticationInformation; -import com.huoran.users.entity.req.EnterpriseCertificationReq; import com.huoran.users.entity.res.BusinessLicenseOCRResp; import com.huoran.users.entity.res.CreditCodeResp; import com.huoran.users.entity.res.IdCardOCRResp; @@ -48,29 +44,6 @@ public class AliRealNameAuthenticationController { @Autowired public EnterpriseCertificationService enterpriseCertificationService; - /* @ApiOperation(value = "身份证图片验证(对象)") - @PostMapping("/faceAuthenticationByObject") - public R faceAuthenticationByObject(HttpServletRequest request, @RequestBody IdCardOCRReq req) throws IOException { - //正面身份证信息返回 - String positiveIDReturnsInformation = FaceRecognitionAidUtil.IdCardOCRRecognition(req.getTheFrontOfIDCard(),"face"); - - //反面身份证信息返回 - String reverseIDInformationReturned = FaceRecognitionAidUtil.IdCardOCRRecognition(req.getReverseOfIDCard(),"back"); - - *//*if (ObjectUtils.isEmpty(positiveIDReturnsInformation)&&ObjectUtils.isEmpty(reverseIDInformationReturned)){ - throw new RuntimeException("身份证图片验证失败,请重新再试!"); - }*//* - Optional.ofNullable(positiveIDReturnsInformation) - .orElseThrow(() -> new RuntimeException("身份证图片验证失败,请重新再试!")); - Optional.ofNullable(reverseIDInformationReturned) - .orElseThrow(() -> new RuntimeException("身份证图片验证失败,请重新再试!")); - - IdCardOCRResp front = new Gson().fromJson(positiveIDReturnsInformation, IdCardOCRResp.class); - - IdCardOCRResp reverseSide = new Gson().fromJson(reverseIDInformationReturned, IdCardOCRResp.class); - - return R.ok().put("front", front).put("reverseSide", reverseSide); - }*/ @ApiOperation(value = "身份证图片验证") @PostMapping("/faceAuthentication") @@ -115,7 +88,7 @@ public class AliRealNameAuthenticationController { @PostMapping("/authenticationOrNot") - @ApiOperation(value = "是否认证", response = UserAuthenticationInformation.class) + @ApiOperation(value = "个人是否认证", response = UserAuthenticationInformation.class) public R authenticationOrNot(HttpServletRequest request) { String accountId = TokenUtils.getIdByJwtToken(request); @@ -127,19 +100,6 @@ public class AliRealNameAuthenticationController { } return R.ok().put("data", true).put("authenticationInformation", userAuthenticationInformation); } - /*@ApiOperation(value = "输入身份证号码、姓名进行实名认证") - @PostMapping("/realNameAuthentication") - public R realNameAuthentication(@RequestParam(name = "idCardNo", required = true) @ApiParam(value = "身份证号码") String idCardNo, @RequestParam(name = "userName", required = true) @ApiParam(value = "用户姓名") String userName, HttpServletRequest request) throws IOException { - String accountId = TokenUtils.getIdByJwtToken(request); - String json = FaceRecognitionAidUtil.postData(AliRealNameAuthenticationConfig.ALI_API_APPCODE, AliRealNameAuthenticationConfig.GET_APP_CODE_LINK, userName, idCardNo); - RealNameAuthenticationResp info = new Gson().fromJson(json, RealNameAuthenticationResp.class); - - if (!info.getRespCode().equals("0000")) { - throw new RuntimeException(info.getRespMessage()); - } - return R.ok().put("data", info); - - }*/ @ApiOperation(value = "营业执照图片验证") @@ -168,7 +128,7 @@ public class AliRealNameAuthenticationController { } - @ApiOperation(value = "统一社会信用代码认证",response = CreditCodeResp.class) + @ApiOperation(value = "统一社会信用代码认证", response = CreditCodeResp.class) @PostMapping("/creditCodeAuthentication") public R creditCodeAuthentication(@RequestBody EnterpriseCertification enterpriseCertification, HttpServletRequest request) throws IOException { @@ -193,11 +153,11 @@ 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()))){ + if (!ObjectUtils.isEmpty(enterpriseCertificationService.checkWhetherItExists(enterpriseCertification.getCompanyName()))) { errorMsg = "企业名称已存在"; throw new RuntimeException(errorMsg); } - enterpriseCertificationService.save(enterpriseCertification); + enterpriseCertificationService.updateById(enterpriseCertification); return R.ok("提交成功,请等待审核!"); } else { errorMsg = info.getReason(); @@ -212,6 +172,4 @@ public class AliRealNameAuthenticationController { } - - } \ No newline at end of file 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 ade8f4b..fb2fe26 100644 --- a/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java +++ b/users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java @@ -1,5 +1,6 @@ package com.huoran.users.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.huoran.common.response.R; import com.huoran.common.utils.TokenUtils; import com.huoran.users.entity.EnterpriseCertification; @@ -54,6 +55,17 @@ public class EnterpriseCertificationController { } + @PostMapping("/enterpriseCertificationStatus") + @ApiOperation(value = "查询企业当前认证状态", response = EnterpriseCertification.class) + public R enterpriseCertificationStatus(HttpServletRequest request) { + String accountId = TokenUtils.getIdByJwtToken(request); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("account_id",accountId); + EnterpriseCertification enterpriseCertification = service.getOne(queryWrapper); + return R.ok().put("data", enterpriseCertification); + } + + @PostMapping("/save") @ApiOperation(value = "新增", response = EnterpriseCertification.class) public R save(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { diff --git a/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java b/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java index 406d091..2c14525 100644 --- a/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java +++ b/users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java @@ -74,7 +74,7 @@ public class EnterpriseCertification implements Serializable { @ApiModelProperty(value = "提交时间") private Date submitTime; - @ApiModelProperty(value = "审核状态(0默认待审核,1通过,2驳回)") + @ApiModelProperty(value = "审核状态(0默认未提交 1.待审核,2.已通过,3.已驳回)") private Integer auditStatus; @ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") @@ -93,5 +93,15 @@ public class EnterpriseCertification implements Serializable { @TableField(exist = false) private String contactInformation; + @ApiModelProperty(value = "省") + @TableField(exist = false) + private String province; + + @ApiModelProperty(value = "市") + @TableField(exist = false) + private String city; + + + } diff --git a/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java b/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java index b26e3fe..c6f16d7 100644 --- a/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java +++ b/users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java @@ -17,7 +17,7 @@ import lombok.Data; public class EnterpriseCertificationLIstReq { - @ApiModelProperty(value = "关键字") + @ApiModelProperty(value = "关键字") private String keyWord; @ApiModelProperty(value = "开始提交时间") @@ -36,6 +36,13 @@ public class EnterpriseCertificationLIstReq { @ApiModelProperty(value = "账号") private String account; + + @ApiModelProperty(value = "省") + private String province; + + @ApiModelProperty(value = "市") + private String city; + @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) private Integer pageNum; @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) 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 243e558..b602c97 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 @@ -9,19 +9,27 @@ FROM ( SELECT - IFNULL( info.real_name, u.user_name ) proposer, + IFNULL( info.company_name, u.user_name ) proposer, a.phone AS contactInformation, a.account, - c.* + c.*, + IFNULL( cla.province, '未完善' ) AS province, + IFNULL( cla.city, '未完善' ) AS city FROM hr_enterprise_certification c INNER JOIN hr_user_account a ON a.id = c.account_id INNER JOIN hr_user_info u ON u.user_id = a.user_id - LEFT JOIN hr_user_authentication_information info ON info.account_id = a.id + LEFT JOIN hr_enterprise_certification info ON info.account_id = a.id + LEFT JOIN k_platform_team_account ta ON ta.account_id = a.id + LEFT JOIN k_platform_team t ON ta.manage_id = t.manage_id + LEFT JOIN k_platform_team_classification cla ON cla.id = t.classification_id + AND cla.is_del = 0 WHERE a.is_del = 0 AND u.is_del = 0 - ) t WHERE t.platform_source = #{req.platformSource} + ) t + WHERE + t.platform_source = #{req.platformSource} @@ -42,5 +50,14 @@ or contactInformation like concat('%' #{req.keyWord} '%') or company_name like concat('%' #{req.keyWord} '%')) + + + + and t.province=#{req.province,jdbcType=VARCHAR} + + + + and t.city=#{req.province,jdbcType=VARCHAR} +