Commit ab2d26fd authored by huyuchen's avatar huyuchen

商险优化修改

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