Commit ab2d26fd authored by huyuchen's avatar huyuchen

商险优化修改

parent 6e9c0083
...@@ -1292,7 +1292,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1292,7 +1292,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
//获取成功数据的remark //获取成功数据的remark
paramList.stream().forEach(e ->{ paramList.forEach(e ->{
if (detail.getId().equals(e.getId())){ if (detail.getId().equals(e.getId())){
operateList.add(e); operateList.add(e);
} }
...@@ -1334,7 +1334,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1334,7 +1334,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保成功 //投保成功
if (CollectionUtils.isNotEmpty(collectSuccess)){ if (CollectionUtils.isNotEmpty(collectSuccess)){
List<InsuranceHandleParam> list = new ArrayList<>(); List<InsuranceHandleParam> list = new ArrayList<>();
collectSuccess.stream().forEach(e ->{ collectSuccess.forEach(e ->{
InsuranceHandleParam handleParam = new InsuranceHandleParam(); InsuranceHandleParam handleParam = new InsuranceHandleParam();
handleParam.setId(e.getId()); handleParam.setId(e.getId());
handleParam.setRemark(e.getRemark()); handleParam.setRemark(e.getRemark());
...@@ -1347,7 +1347,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1347,7 +1347,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保退回 //投保退回
if (CollectionUtils.isNotEmpty(collectRollBack)){ if (CollectionUtils.isNotEmpty(collectRollBack)){
List<InsuranceHandleParam> list = new ArrayList<>(); List<InsuranceHandleParam> list = new ArrayList<>();
collectRollBack.stream().forEach(e ->{ collectRollBack.forEach(e ->{
InsuranceHandleParam handleParam = new InsuranceHandleParam(); InsuranceHandleParam handleParam = new InsuranceHandleParam();
handleParam.setId(e.getId()); handleParam.setId(e.getId());
handleParam.setRemark(e.getRemark()); handleParam.setRemark(e.getRemark());
...@@ -1376,7 +1376,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1376,7 +1376,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
public R<List<InsuranceListVO>> successfulInsurance(YifuUser user, List<InsuranceHandleParam> paramList) { public R<List<InsuranceListVO>> successfulInsurance(YifuUser user, List<InsuranceHandleParam> paramList) {
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10)); ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
//解析参数里的商险id //解析参数里的商险id
List<String> idList = paramList.stream().map(e -> e.getId()).distinct().collect(Collectors.toList()); List<String> idList = paramList.stream().map(InsuranceHandleParam::getId).distinct().collect(Collectors.toList());
//操作日志对象 //操作日志对象
List<InsuranceHandleParam> operateList = new ArrayList<>(); List<InsuranceHandleParam> operateList = new ArrayList<>();
...@@ -1552,7 +1552,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1552,7 +1552,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(successList)){ if (CollectionUtils.isNotEmpty(successList)){
for (TInsuranceDetail detail : successList) { for (TInsuranceDetail detail : successList) {
//获取成功数据的remark //获取成功数据的remark
paramList.stream().forEach(e ->{ paramList.forEach(e ->{
if (detail.getId().equals(e.getId())){ if (detail.getId().equals(e.getId())){
operateList.add(e); operateList.add(e);
} }
...@@ -6150,11 +6150,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6150,11 +6150,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private List<InsuranceHandleImportParam> insuranceChangeCheck(List<InsuranceHandleImportParam> checkList, boolean flag) { private List<InsuranceHandleImportParam> insuranceChangeCheck(List<InsuranceHandleImportParam> checkList, boolean flag) {
List<InsuranceHandleImportParam> distinctList = checkList.stream().distinct().collect(Collectors.toList()); List<InsuranceHandleImportParam> distinctList = checkList.stream().distinct().collect(Collectors.toList());
//定义外层循环标识,方便去重的时候跳出 //定义外层循环标识,方便去重的时候跳出
outer: Map<String,String> map = new HashMap<>();
InsuranceHandleImportParam param;
String handType;
String remark;
TInsuranceDetail insuranceDetail;
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceHandleImportParam param = distinctList.get(i); param = distinctList.get(i);
//办理结果 //办理结果
String handType = param.getHandType(); handType = param.getHandType();
if(StringUtils.isBlank(handType)){ if(StringUtils.isBlank(handType)){
param.setErrorMessage(InsurancesConstants.HAND_RESULT_IS_EMPTY); param.setErrorMessage(InsurancesConstants.HAND_RESULT_IS_EMPTY);
continue; continue;
...@@ -6164,7 +6168,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6164,7 +6168,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//办理意见 //办理意见
String remark = param.getRemark(); remark = param.getRemark();
if(InsurancesConstants.FAILED.equals(handType) && StringUtils.isBlank(remark)){ if(InsurancesConstants.FAILED.equals(handType) && StringUtils.isBlank(remark)){
param.setErrorMessage(InsurancesConstants.ROLLBACK_MESSAGE_IS_EMPTY); param.setErrorMessage(InsurancesConstants.ROLLBACK_MESSAGE_IS_EMPTY);
continue; continue;
...@@ -6174,44 +6178,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6174,44 +6178,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//员工姓名 //员工姓名
String empName = param.getEmpName(); if(StringUtils.isBlank(param.getEmpName())){
if(StringUtils.isBlank(empName)){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
continue; continue;
} }
//员工身份证 //员工身份证
String empIdCardNo = param.getEmpIdcardNo(); if(StringUtils.isBlank(param.getEmpIdcardNo())){
if(StringUtils.isBlank(empIdCardNo)){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_EMPTY);
continue; continue;
} }
//保险公司名称 //保险公司名称
String insuranceCompanyName = param.getInsuranceCompanyName(); if(StringUtils.isBlank(param.getInsuranceCompanyName())){
if(StringUtils.isBlank(insuranceCompanyName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
continue; continue;
} }
//险种名称 //险种名称
String insuranceTypeName = param.getInsuranceTypeName(); if(StringUtils.isBlank(param.getInsuranceTypeName())){
if(StringUtils.isBlank(insuranceTypeName)){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EMPTY);
continue; continue;
} }
//购买标准 //购买标准
String buyStandard = param.getBuyStandard(); if(StringUtils.isBlank(param.getBuyStandard())){
if(StringUtils.isBlank(buyStandard)){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY);
continue; continue;
} }
//保单开始日期 //保单开始日期
String policyStart = param.getPolicyStart(); if(StringUtils.isBlank(param.getPolicyStart())){
if(StringUtils.isBlank(policyStart)){
param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.POLICY_START_NOT_EMPTY);
continue; continue;
} }
//保单结束日期 //保单结束日期
String policyEnd = param.getPolicyEnd(); if(StringUtils.isBlank(param.getPolicyEnd())){
if(StringUtils.isBlank(policyEnd)){
param.setErrorMessage(InsurancesConstants.POLICY_END_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.POLICY_END_NOT_EMPTY);
continue; continue;
} }
...@@ -6221,50 +6218,55 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6221,50 +6218,55 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
// 保单开始日期格式校验 // 保单开始日期格式校验
if(!LocalDateUtil.isDate(policyStart,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);
continue; continue;
} }
// 保单结束日期格式校验 // 保单结束日期格式校验
if(!LocalDateUtil.isDate(policyEnd,LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){
param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR); param.setErrorMessage(InsurancesConstants.POLICY_END_PARSE_ERROR);
continue; continue;
} }
//表内数据重复 员工姓名、员工身份证号码、保险公司名称、险种名称、保单开始日期、保单结束日期、购买标准 去重 //表内数据重复 员工姓名、员工身份证号码、保险公司名称、险种名称、保单开始日期、保单结束日期、购买标准 去重
for (int j = 0; j < distinctList.size(); j++) { StringBuilder errorTemp = new StringBuilder();
InsuranceHandleImportParam repeat = distinctList.get(j); errorTemp.append(param.getEmpName());
if (param.getEmpName().equals(repeat.getEmpName()) errorTemp.append("_");
&& param.getEmpIdcardNo().equals(repeat.getEmpIdcardNo()) errorTemp.append(param.getEmpIdcardNo());
&& param.getInsuranceCompanyName().equals(repeat.getInsuranceCompanyName()) errorTemp.append("_");
&& param.getInsuranceTypeName().equals(repeat.getInsuranceTypeName()) errorTemp.append(param.getInsuranceCompanyName());
&& param.getPolicyStart().equals(repeat.getPolicyStart()) errorTemp.append("_");
&& param.getPolicyEnd().equals(repeat.getPolicyEnd()) errorTemp.append(param.getInsuranceTypeName());
&& param.getBuyStandard().equals(repeat.getBuyStandard()) errorTemp.append("_");
&& i != j){ errorTemp.append(param.getPolicyStart());
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR); errorTemp.append("_");
continue outer; errorTemp.append(param.getPolicyEnd());
} errorTemp.append("_");
errorTemp.append(param.getBuyStandard());
if (null == map.get(errorTemp.toString())) {
map.put(errorTemp.toString(),"1");
} else {
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
continue;
} }
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT) queryWrapper.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getEmpName,empName) .eq(TInsuranceDetail::getEmpName,param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo,empIdCardNo) .eq(TInsuranceDetail::getEmpIdcardNo,param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail::getInsuranceTypeName,param.getInsuranceTypeName())
.eq(TInsuranceDetail::getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail::getInsuranceCompanyName,param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getBuyStandard,buyStandard) .eq(TInsuranceDetail::getBuyStandard,param.getBuyStandard())
.eq(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ) .eq(TInsuranceDetail::getPolicyStart,LocalDateUtil.parseLocalDate(param.getPolicyStart()) )
.eq(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)) .eq(TInsuranceDetail::getPolicyEnd,LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL); .last(CommonConstants.LAST_ONE_SQL);
TInsuranceDetail insuranceDetail = getOne(queryWrapper); insuranceDetail = getOne(queryWrapper);
//如果保单信息为空 //如果保单信息为空
if (Common.isEmpty(insuranceDetail)){ if (Common.isEmpty(insuranceDetail)){
param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST); param.setErrorMessage(InsurancesConstants.USER_DATA_IS_NOT_EXIST);
continue; continue;
} }
String detailId = insuranceDetail.getId();
if (flag){ if (flag){
//减员办理 //减员办理
//投保办理状态 //投保办理状态
...@@ -6317,7 +6319,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6317,7 +6319,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
} }
param.setId(detailId); param.setId(insuranceDetail.getId());
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS); param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
} }
return distinctList; 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