Commit cd3f18ac authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

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

See merge request fangxinjiang/yifu!38
parents 8de79ad6 6147e9ec
...@@ -116,6 +116,14 @@ public class InsurancesConstants { ...@@ -116,6 +116,14 @@ public class InsurancesConstants {
* 员工身份证号格式有误 * 员工身份证号格式有误
*/ */
public static final String EMP_IDCARD_NO_NOT_LEGITIMATE = "员工身份证号格式有误"; 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 @@ ...@@ -65,7 +65,12 @@
<artifactId>commons-collections</artifactId> <artifactId>commons-collections</artifactId>
<version>3.2.2</version> <version>3.2.2</version>
</dependency> </dependency>
</dependencies> <dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-check-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets; 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.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -707,7 +709,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -707,7 +709,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; 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())); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
...@@ -718,14 +729,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -718,14 +729,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
ProjectSetInfoVo jsonObject = data.get(param.getDeptNo()); ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == jsonObject){ if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 //结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getInsuranceSettleType(); String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param); listResult.add(param);
...@@ -947,7 +958,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -947,7 +958,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; 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())); R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
...@@ -958,14 +978,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -958,14 +978,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
ProjectSetInfoVo jsonObject = data.get(param.getDeptNo()); ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == jsonObject){ if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//结算类型,根据项目编码获取,并冗余到明细记录中 //结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = jsonObject.getInsuranceSettleType(); String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param); listResult.add(param);
...@@ -1176,7 +1196,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1176,7 +1196,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; 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)){ if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_START_PARSE_ERROR);
listResult.add(param); 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