Commit 700047ec authored by huyuchen's avatar huyuchen

商险购买标准修改

parent 9991dbb0
......@@ -37,6 +37,12 @@ public class InsuranceInsuredDetailParam implements Serializable {
@Schema(description = "变更后投保类型 1新增 3批增")
private Integer buyType;
/**
* 变更后的购买标准
*/
@Schema(description = "变更后的购买标准")
private String buyStandard;
/**
* 变更原因
*/
......
......@@ -57,6 +57,12 @@ public class InsuranceInsuredParam implements Serializable {
@Schema(description = "购买标准")
private String buyStandard;
/**
* 变更后的购买标准
*/
@Schema(description = "变更后的购买标准")
private String buyStandardNew;
/**
* 变更后保单开始时间
*/
......
......@@ -2198,8 +2198,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceInsuredParam> listSuccess = operateList.stream().filter(e-> e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS)).collect(Collectors.toList());
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
TInsuranceDetail detail;
for (InsuranceInsuredParam success : listSuccess) {
TInsuranceDetail detail = success.getDetail();
detail = success.getDetail();
if (Optional.ofNullable(detail).isPresent()){
TInsuranceDetail oldDetail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,oldDetail);
......@@ -2212,6 +2213,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Objects.nonNull(success.getBuyType())){
detail.setBuyType(success.getBuyType());
}
if (Common.isNotNull(success.getBuyStandardNew())) {
detail.setBuyStandard(success.getBuyStandardNew());
}
detailList.add(detail);
//变更记录
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,detail,success.getReason());
......@@ -2233,6 +2237,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!oldDetail.getBuyType().equals(detail.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(oldDetail.getBuyType()) + ";变更后投保类型:" + getBuyType(detail.getBuyType()));
}
if (!oldDetail.getBuyStandard().equals(detail.getBuyStandard())) {
sb.append(";变更前购买标准:" + oldDetail.getBuyStandard() + ";变更后购买标准:" + detail.getBuyStandard());
}
if (StringUtils.isNotBlank(success.getReason())){
sb.append(";变更原因:" + success.getReason());
}
......@@ -2258,7 +2265,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//操作记录
//addOperate(detailList,user,InsurancesConstants.UPDATE_INSURED,null,CommonConstants.ONE_INT);
if (operateList.stream().allMatch(e->e.getErrorMessage().equals(CommonConstants.RESULT_DATA_SUCESS))) {
operateList = null;
}
......@@ -2326,6 +2332,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Objects.nonNull(param.getBuyType())){
byId.setBuyType(param.getBuyType());
}
if (Objects.nonNull(param.getBuyStandard())){
byId.setBuyStandard(param.getBuyStandard());
}
//变更记录
tBusinessOperateService.saveModificationRecord(byId.getId(),old,byId,param.getReason());
......@@ -2346,6 +2355,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (!old.getBuyType().equals(param.getBuyType())) {
sb.append(";变更前投保类型:" + getBuyType(old.getBuyType()) + ";变更后投保类型:" + getBuyType(param.getBuyType()));
}
if (!old.getBuyStandard().equals(param.getBuyStandard())) {
sb.append(";变更前购买标准:" + old.getBuyStandard() + ";变更后购买标准:" + param.getBuyStandard());
}
if (StringUtils.isNotBlank(param.getReason())){
sb.append(";变更原因:" + param.getReason());
}
......@@ -3793,6 +3805,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
private List<InsuranceInsuredParam> updateInsuranceInsuredCheck(List<InsuranceInsuredParam> paramList, List<TInsuranceAreaRes> insuranceAreaResList){
List<InsuranceInsuredParam> collect = paramList.stream().distinct().collect(Collectors.toList());
TInsuranceDetail detail;
for (InsuranceInsuredParam param : collect) {
param.setFlag(CommonConstants.ONE_STRING);
// 必填校验
......@@ -3876,7 +3889,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//查数据是否存在:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
......@@ -3899,8 +3912,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//商险办理地权限校验
boolean b = insuranceAreaResList.stream().anyMatch(s -> detail.getInsuranceHandleCity().equals(s.getCity()) && detail.getInsuranceHandleProvince().equals(s.getProvince()));
if(!b){
String insuranceHandleCity = detail.getInsuranceHandleCity().toString();
String insuranceHandleProvince = detail.getInsuranceHandleProvince().toString();
if(insuranceAreaResList.stream().noneMatch(s -> insuranceHandleCity.equals(s.getCity()) && insuranceHandleProvince.equals(s.getProvince()))){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
continue;
}
......
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