Merge remote-tracking branch 'origin/main'

main
cheney 12 months ago
commit 7e2f7b8e25
  1. 46
      users/src/main/java/com/huoran/users/controller/AliRealNameAuthenticationController.java
  2. 12
      users/src/main/java/com/huoran/users/controller/EnterpriseCertificationController.java
  3. 12
      users/src/main/java/com/huoran/users/entity/EnterpriseCertification.java
  4. 7
      users/src/main/java/com/huoran/users/entity/req/EnterpriseCertificationLIstReq.java
  5. 25
      users/src/main/java/com/huoran/users/mapper/xml/EnterpriseCertificationMapper.xml

@ -1,16 +1,12 @@
package com.huoran.users.controller; package com.huoran.users.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.google.gson.Gson;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.users.config.AliRealNameAuthenticationConfig; import com.huoran.users.config.AliRealNameAuthenticationConfig;
import com.huoran.users.entity.EnterpriseCertification; import com.huoran.users.entity.EnterpriseCertification;
import com.huoran.users.entity.UserAuthenticationInformation; 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.BusinessLicenseOCRResp;
import com.huoran.users.entity.res.CreditCodeResp; import com.huoran.users.entity.res.CreditCodeResp;
import com.huoran.users.entity.res.IdCardOCRResp; import com.huoran.users.entity.res.IdCardOCRResp;
@ -48,29 +44,6 @@ public class AliRealNameAuthenticationController {
@Autowired @Autowired
public EnterpriseCertificationService enterpriseCertificationService; 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 = "身份证图片验证") @ApiOperation(value = "身份证图片验证")
@PostMapping("/faceAuthentication") @PostMapping("/faceAuthentication")
@ -115,7 +88,7 @@ public class AliRealNameAuthenticationController {
@PostMapping("/authenticationOrNot") @PostMapping("/authenticationOrNot")
@ApiOperation(value = "是否认证", response = UserAuthenticationInformation.class) @ApiOperation(value = "个人是否认证", response = UserAuthenticationInformation.class)
public R authenticationOrNot(HttpServletRequest request) { public R authenticationOrNot(HttpServletRequest request) {
String accountId = TokenUtils.getIdByJwtToken(request); String accountId = TokenUtils.getIdByJwtToken(request);
@ -127,19 +100,6 @@ public class AliRealNameAuthenticationController {
} }
return R.ok().put("data", true).put("authenticationInformation", userAuthenticationInformation); 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 = "营业执照图片验证") @ApiOperation(value = "营业执照图片验证")
@ -197,7 +157,7 @@ public class AliRealNameAuthenticationController {
errorMsg = "企业名称已存在"; errorMsg = "企业名称已存在";
throw new RuntimeException(errorMsg); throw new RuntimeException(errorMsg);
} }
enterpriseCertificationService.save(enterpriseCertification); enterpriseCertificationService.updateById(enterpriseCertification);
return R.ok("提交成功,请等待审核!"); return R.ok("提交成功,请等待审核!");
} else { } else {
errorMsg = info.getReason(); errorMsg = info.getReason();
@ -212,6 +172,4 @@ public class AliRealNameAuthenticationController {
} }
} }

@ -1,5 +1,6 @@
package com.huoran.users.controller; package com.huoran.users.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huoran.common.response.R; import com.huoran.common.response.R;
import com.huoran.common.utils.TokenUtils; import com.huoran.common.utils.TokenUtils;
import com.huoran.users.entity.EnterpriseCertification; 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<EnterpriseCertification> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("account_id",accountId);
EnterpriseCertification enterpriseCertification = service.getOne(queryWrapper);
return R.ok().put("data", enterpriseCertification);
}
@PostMapping("/save") @PostMapping("/save")
@ApiOperation(value = "新增", response = EnterpriseCertification.class) @ApiOperation(value = "新增", response = EnterpriseCertification.class)
public R save(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) { public R save(@RequestBody @ApiParam(name = "企业实名认证信息记录对象", value = "传入json格式", required = true) EnterpriseCertification enterpriseCertification, HttpServletRequest request) {

@ -74,7 +74,7 @@ public class EnterpriseCertification implements Serializable {
@ApiModelProperty(value = "提交时间") @ApiModelProperty(value = "提交时间")
private Date submitTime; private Date submitTime;
@ApiModelProperty(value = "审核状态(0默认待审核,1通过,2驳回)") @ApiModelProperty(value = "审核状态(0默认未提交 1.待审核,2.已通过,3.已驳回)")
private Integer auditStatus; private Integer auditStatus;
@ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)") @ApiModelProperty(value = "来源区分(5:幼儿园,6:供应商)")
@ -93,5 +93,15 @@ public class EnterpriseCertification implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String contactInformation; private String contactInformation;
@ApiModelProperty(value = "省")
@TableField(exist = false)
private String province;
@ApiModelProperty(value = "市")
@TableField(exist = false)
private String city;
} }

@ -36,6 +36,13 @@ public class EnterpriseCertificationLIstReq {
@ApiModelProperty(value = "账号") @ApiModelProperty(value = "账号")
private String account; private String account;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "市")
private String city;
@ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true) @ApiModelProperty(value = "当前页数", name = "pageNum", example = "1", required = true)
private Integer pageNum; private Integer pageNum;
@ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true) @ApiModelProperty(value = "当前页需要显示的数量", name = "pageSize", example = "10", required = true)

@ -9,19 +9,27 @@
FROM FROM
( (
SELECT SELECT
IFNULL( info.real_name, u.user_name ) proposer, IFNULL( info.company_name, u.user_name ) proposer,
a.phone AS contactInformation, a.phone AS contactInformation,
a.account, a.account,
c.* c.*,
IFNULL( cla.province, '未完善' ) AS province,
IFNULL( cla.city, '未完善' ) AS city
FROM FROM
hr_enterprise_certification c hr_enterprise_certification c
INNER JOIN hr_user_account a ON a.id = c.account_id 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 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 WHERE
a.is_del = 0 a.is_del = 0
AND u.is_del = 0 AND u.is_del = 0
) t WHERE t.platform_source = #{req.platformSource} ) t
WHERE
t.platform_source = #{req.platformSource}
<if test=" req.auditStatus!= null and req.auditStatus!= ''"> <if test=" req.auditStatus!= null and req.auditStatus!= ''">
@ -42,5 +50,14 @@
or contactInformation like concat('%' #{req.keyWord} '%') or contactInformation like concat('%' #{req.keyWord} '%')
or company_name like concat('%' #{req.keyWord} '%')) or company_name like concat('%' #{req.keyWord} '%'))
</if> </if>
<if test="req.province!=null and req.province!='' ">
and t.province=#{req.province,jdbcType=VARCHAR}
</if>
<if test="req.city!=null and req.city!='' ">
and t.city=#{req.province,jdbcType=VARCHAR}
</if>
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save