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

fix:登记保单保费,校验表内数据重复

parent f0bb0dfe
......@@ -3379,7 +3379,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);
......@@ -3435,6 +3439,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())
......
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