Commit 6147e9ec authored by 李灿灿's avatar 李灿灿

商险校验姓名和身份证号是否正确

parent 8de79ad6
......@@ -116,6 +116,14 @@ public class InsurancesConstants {
* 员工身份证号格式有误
*/
public static final String EMP_IDCARD_NO_NOT_LEGITIMATE = "员工身份证号格式有误";
/**
* 员工姓名、身份证号不一致
*/
public static final String EMP_ID_CARD_NO_NOT_FIT = "员工姓名、身份证号不一致";
/**
* 替换员工姓名、身份证号不一致
*/
public static final String REPLACE_EMP_ID_CARD_NO_NOT_FIT = "替换员工姓名、身份证号不一致";
/**
* 替换员工身份证号格式有误
*/
......
......@@ -65,7 +65,12 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-check-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.check.utils.ChecksUtil;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -707,7 +709,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
// todo 校验身份合法
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
ChecksUtil.checkIdCard(checkIdCard,true);
if (CommonConstants.ONE_INT != checkIdCard.getIsTrue()){
param.setErrorMessage(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
listResult.add(param);
continue;
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -718,14 +729,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
ProjectSetInfoVo jsonObject = data.get(param.getDeptNo());
if (null == jsonObject){
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getInsuranceSettleType();
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
......@@ -947,7 +958,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//todo 检验身份合法
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
ChecksUtil.checkIdCard(checkIdCard,true);
if (CommonConstants.ONE_INT != checkIdCard.getIsTrue()){
param.setErrorMessage(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
listResult.add(param);
continue;
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -958,14 +978,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}else {
ProjectSetInfoVo jsonObject = data.get(param.getDeptNo());
if (null == jsonObject){
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getInsuranceSettleType();
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
......@@ -1176,7 +1196,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
// todo 校验身份合法
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getReplaceEmpName());
checkIdCard.setIdCard(param.getReplaceEmpIdcardNo());
ChecksUtil.checkIdCard(checkIdCard,true);
if (CommonConstants.ONE_INT != checkIdCard.getIsTrue()){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_ID_CARD_NO_NOT_FIT);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment