master:档口认证调优;

pull/1121/head
liujiang 2025-11-21 21:36:30 +08:00
parent acee401913
commit 31a1f3b601
4 changed files with 47 additions and 26 deletions

View File

@ -70,17 +70,21 @@ public class StoreCertCreateVO {
@Data
@ApiModel
public static class SCStoreCertVO {
@ApiModelProperty(value = "真实姓名", required = true)
@NotBlank(message = "真实姓名不能为空")
@Size(min = 0, max = 30, message = "真实姓名长度必须在1到30个字之间")
@ApiModelProperty(value = "法人真实姓名", required = true)
@NotBlank(message = "法人真实姓名不能为空")
@Size(min = 0, max = 30, message = "法人真实姓名长度必须在1到30个字之间")
private String realName;
@ApiModelProperty(value = "联系电话", required = true)
@NotBlank(message = "联系电话不能为空")
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确,请输入有效的中国大陆手机号")
@ApiModelProperty(value = "法人联系电话", required = true)
@NotBlank(message = "法人联系电话不能为空")
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "法人联系电话格式不正确,请输入有效的中国大陆手机号")
private String phone;
@ApiModelProperty(value = "身份证号", required = true)
@NotBlank(message = "身份证号不能为空")
@Pattern(regexp = "(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)", message = "身份证号格式不正确请输入有效的15位或18位身份证号")
@NotBlank(message = "短信验证码不能为空!")
@ApiModelProperty(value = "短信验证码", required = true)
@Size(min = 0, max = 6, message = "短信验证码长度必须在0到6个字之间")
private String code;
@ApiModelProperty(value = "法人身份证号", required = true)
@NotBlank(message = "法人身份证号不能为空")
@Pattern(regexp = "(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)", message = "法人身份证号格式不正确请输入有效的15位或18位身份证号")
private String idCard;
@Valid
@ApiModelProperty(value = "认证文件列表", required = true)

View File

@ -37,33 +37,33 @@ public class StoreCertificate extends XktBaseEntity {
private Long storeId;
/**
*
*
*/
@Excel(name = "真实姓名")
@Excel(name = "法人真实姓名")
private String realName;
/**
*
*
*/
@Excel(name = "联系电话")
@Excel(name = "法人联系电话")
private String phone;
/**
*
*
*/
@Excel(name = "身份证号")
@Excel(name = "法人身份证号")
private String idCard;
/**
* ID
* ID
*/
@Excel(name = "身份证人脸文件ID")
@Excel(name = "法人身份证人脸文件ID")
private Long idCardFaceFileId;
/**
* ID
* ID
*/
@Excel(name = "身份证国徽文件ID")
@Excel(name = "法人身份证国徽文件ID")
private Long idCardEmblemFileId;
/**

View File

@ -54,12 +54,14 @@ public class StoreCertDTO {
@Data
public static class SCStoreCertDTO {
@ApiModelProperty(value = "真实姓名", required = true)
@ApiModelProperty(value = "法人真实姓名", required = true)
private String realName;
@ApiModelProperty(value = "联系电话", required = true)
@ApiModelProperty(value = "法人联系电话", required = true)
private String phone;
@ApiModelProperty(value = "身份证号", required = true)
@ApiModelProperty(value = "法人身份证号", required = true)
private String idCard;
@ApiModelProperty(value = "短信验证码")
private String code;
@ApiModelProperty(value = "认证文件列表", required = true)
private List<SCStoreFileDTO> fileList;
@ApiModelProperty(value = "统一社会信用代码", required = true)

View File

@ -23,6 +23,7 @@ import com.ruoyi.xkt.enums.StoreStatus;
import com.ruoyi.xkt.mapper.*;
import com.ruoyi.xkt.service.IAssetService;
import com.ruoyi.xkt.service.IStoreCertificateService;
import com.ruoyi.xkt.thirdpart.lfv2.Lfv2Client;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
@ -52,6 +53,7 @@ public class StoreCertificateServiceImpl implements IStoreCertificateService {
final StoreProductMapper storeProdMapper;
final ISysUserService userService;
final SmsClientWrapper smsClient;
final Lfv2Client lfv2Client;
/**
@ -63,13 +65,26 @@ public class StoreCertificateServiceImpl implements IStoreCertificateService {
@Override
@Transactional
public Integer create(StoreCertDTO certDTO) {
final StoreCertDTO.SCStoreCertDTO storeCert = certDTO.getStoreCert();
// 1. 校验短信验证码
this.validateSmsVerificationCode(storeCert.getPhone(), storeCert.getCode());
// 2. 校验法人身份信息是否通过 手机号 姓名 身份证号
boolean phoneCheck = this.lfv2Client.checkPhone(storeCert.getPhone().trim(), storeCert.getRealName().trim(), storeCert.getIdCard().trim());
if (!phoneCheck) {
throw new ServiceException("法人身份信息验证未通过可能原因1. 法人姓名或身份证号输入有误 2. 当前手机号非法人本人实名办理!", HttpStatus.ERROR);
}
// 3. 校验工商信息是否通过 社会统一信用代码 企业名 法人名称 法人身份证号
boolean bizCheck = this.lfv2Client.checkEnterprise(storeCert.getSocialCreditCode().trim(),
storeCert.getLicenseName().trim(), storeCert.getRealName().trim(), storeCert.getIdCard().trim());
if (!bizCheck) {
throw new ServiceException("工商信息验证未通过!请核对您的企业名称、统一社会信用代码、法人姓名及身份证号是否与营业执照完全一致!", HttpStatus.ERROR);
}
// 新增档口
Store store = this.createStore(certDTO);
StoreCertificate storeCert = BeanUtil.toBean(certDTO.getStoreCert(), StoreCertificate.class)
.setStoreId(store.getId());
StoreCertificate storeCertCreate = BeanUtil.toBean(certDTO.getStoreCert(), StoreCertificate.class).setStoreId(store.getId());
// 新增档口认证的文件列表
storeCert = this.handleStoreCertFileList(certDTO, storeCert);
return this.storeCertMapper.insert(storeCert);
storeCertCreate = this.handleStoreCertFileList(certDTO, storeCertCreate);
return this.storeCertMapper.insert(storeCertCreate);
}