Commit a896514d authored by fangxinjiang's avatar fangxinjiang

商险BUG修复

parent 79ab3f37
......@@ -3382,7 +3382,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link Map<String, List<InsuranceRegisterParam>>}
*/
private List<InsuranceRegisterParam> registeredPolicyPremiumCheck(List<InsuranceRegisterParam> paramList,List<TInsuranceAreaRes> insuranceAreaResList){
for (InsuranceRegisterParam param : paramList.stream().distinct().collect(Collectors.toList())) {
List<InsuranceRegisterParam> distinctList = paramList.stream().distinct().collect(Collectors.toList());
//定义外层循环标识,方便去重的时候跳出
outer:
for (int i = 0; i < distinctList.size(); i++) {
InsuranceRegisterParam param = distinctList.get(i);
// 必填校验
if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
......@@ -3438,6 +3442,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
}
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种、起止时间、购买标准
for (int j = 0; j < distinctList.size(); j++) {
InsuranceRegisterParam repeat = distinctList.get(j);
if (param.getEmpName().equals(repeat.getEmpName())
&& param.getEmpIdcardNo().equals(repeat.getEmpIdcardNo())
&& param.getInsuranceCompanyName().equals(repeat.getInsuranceCompanyName())
&& param.getInsuranceTypeName().equals(repeat.getInsuranceTypeName())
&& param.getPolicyStart().equals(repeat.getPolicyStart()) && param.getPolicyEnd().equals(repeat.getPolicyEnd())
&& param.getBuyStandard().equals(repeat.getBuyStandard())
&& i != j){
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
continue outer;
}
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
......@@ -3618,7 +3638,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//所有校验通过后设置查到的结果
param.setDetail(detail);
}
return paramList.stream().distinct().collect(Collectors.toList());
return distinctList;
}
/**
......
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