Commit 142c8928 authored by 李灿灿's avatar 李灿灿

20221108 被替换人增加被替换成功记录

parent a58de574
......@@ -28,9 +28,9 @@ public class InsurancesConstants {
*/
public static final String REPLACE = "“替换”提交申请";
/**
* 被替换
* 被替换成功
*/
public static final String SOURCE_REPLACE = "被替换";
public static final String SOURCE_REPLACE = "被替换成功";
/**
* 删除
*/
......
......@@ -419,7 +419,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceReplaceParam> listResult = map.get("listResult");
//保存到数据库中的结果
List<InsuranceReplaceParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> sourceList = new ArrayList<>();
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceReplaceParam success : listSuccess) {
......@@ -504,12 +503,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setCreateTime(LocalDateTime.now());
tInsuranceReplaceService.save(replace);
}
sourceList.add(detail);
detailList.add(newDetail);
}
}
//操作记录
addOperate(sourceList,user,InsurancesConstants.SOURCE_REPLACE,null,CommonConstants.ONE_INT);
addOperate(detailList,user,InsurancesConstants.REPLACE,null,CommonConstants.ONE_INT);
return R.ok(listResult,InsurancesConstants.REPLACE_SUCCESS);
}
......@@ -1290,6 +1287,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceListVO> errorList = new ArrayList<>();
//后端处理的数据
List<TInsuranceDetail> successList = new ArrayList<>();
//被替换人标记被替换成功
List<TInsuranceDetail> sourceList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) {
//先判断投保状态是不是投保中,如果不是不给标记办理成功,防止重复推数据
......@@ -1314,6 +1313,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//替换类型,保单生效日期:T + 1
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
successList.add(detail);
//查找被替换人信息
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()) {
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()) {
sourceList.add(byId);
}
}
}else{
//根据结算类型判断是否需要计算预估保费
//预估
......@@ -1439,6 +1449,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
addOperate(operateList,user,InsurancesConstants.SUCCESSFUL);
addOperate(sourceList,user,InsurancesConstants.SOURCE_REPLACE,null,CommonConstants.ONE_INT);
return R.ok(errorList, InsurancesConstants.OPERATE_SUCCESS);
}
......
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