Commit fbb2630d authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-派单暂存

parent ccb11151
......@@ -375,6 +375,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//保存到数据库中的结果
List<InsuranceAddParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
boolean isAuto = false;
List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
List<String> sourceIdCardList = new ArrayList<>();
for (InsuranceAddParam success : listSuccess) {
......@@ -401,6 +403,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
baseMapper.insert(detail);
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.THREE_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
if (isAuto || Common.isNotNull(success.getCustomerUserName())) {
isAuto = true;
operateList.add(addOperateNewUserName(detail.getId(), "自动化派单-" + success.getCustomerUserName()
,InsurancesConstants.ADD,null,CommonConstants.ONE_INT));
}
}
List<String> replaceIdList = new ArrayList<>();
for (TInsuranceDetail d : detailList) {
......@@ -410,7 +418,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.doFailInfo(detailList, sourceIdCardList, replaceIdList, CommonConstants.FOUR_STRING);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.ADD,null,CommonConstants.ONE_INT);
if (!isAuto) {
addOperate(detailList, user, InsurancesConstants.ADD, null, CommonConstants.ONE_INT);
} else {
if (operateList != null && !operateList.isEmpty()) {
tInsuranceOperateService.saveBatch(operateList);
}
}
//派单失败更新商险待购买数据
if (CollectionUtils.isNotEmpty(listResult)){
List<InsuranceAddParam> listUpdateResult = listResult.stream().filter(e -> e.getIsExit() == null)
......@@ -463,6 +477,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//保存到数据库中的结果
List<InsuranceBatchParam> listSuccess = map.get("listSuccess");
List<TInsuranceDetail> detailList = new ArrayList<>();
boolean isAuto = false;
List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
TInsuranceDetail detail;
List<String> sourceIdCardList = new ArrayList<>();
......@@ -490,12 +506,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
baseMapper.insert(detail);
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.THREE_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.THREE_STRING);
if (isAuto || Common.isNotNull(success.getCustomerUserName())) {
isAuto = true;
operateList.add(addOperateNewUserName(detail.getId(), "自动化派单-" + success.getCustomerUserName()
,InsurancesConstants.BATCH,null,CommonConstants.ONE_INT));
}
}
// 同步操作档案的 商险状态为:2正常(0无2正常3失效4处理中)
this.doFailInfo(detailList, sourceIdCardList, replaceIdList, CommonConstants.FOUR_STRING);
}
//操作记录
addOperate(detailList,user,InsurancesConstants.BATCH,null,CommonConstants.ONE_INT);
if (!isAuto) {
addOperate(detailList, user, InsurancesConstants.BATCH, null, CommonConstants.ONE_INT);
} else {
if (operateList != null && !operateList.isEmpty()) {
tInsuranceOperateService.saveBatch(operateList);
}
}
//派单失败更新商险待购买数据
if (CollectionUtils.isNotEmpty(listResult)){
List<InsuranceBatchParam> listUpdateResult = listResult.stream().filter(e -> e.getIsExit() == null)
......@@ -550,6 +578,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> detailList = new ArrayList<>();
TInsuranceType insuranceType;
TInsuranceCompany insuranceCompany;
boolean isAuto = false;
List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceReplaceParam success : listSuccess) {
//替换
......@@ -644,10 +674,22 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),newDetail,CommonConstants.THREE_STRING);
}
detailList.add(newDetail);
if (isAuto || Common.isNotNull(success.getCustomerUserName())) {
isAuto = true;
operateList.add(addOperateNewUserName(detail.getId(), "自动化派单-" + success.getCustomerUserName()
,InsurancesConstants.REPLACE,null,CommonConstants.ONE_INT));
}
}
}
//操作记录
addOperate(detailList,user,InsurancesConstants.REPLACE,null,CommonConstants.ONE_INT);
if (!isAuto) {
addOperate(detailList, user, InsurancesConstants.REPLACE, null, CommonConstants.ONE_INT);
} else {
if (operateList != null && !operateList.isEmpty()) {
tInsuranceOperateService.saveBatch(operateList);
}
}
//派单失败更新商险待购买数据
if (CollectionUtils.isNotEmpty(listResult)){
List<InsuranceReplaceParam> listUpdateResult = listResult.stream().filter(e -> e.getIsExit() == null)
......@@ -4633,6 +4675,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + areaString));
}
private TInsuranceOperate addOperateNewUserName(String detailId, String userName, String operateDesc, String remark, Integer displayFlag){
TInsuranceOperate operate = new TInsuranceOperate();
operate.setRemark(remark);
operate.setDisplayFlag(displayFlag);
operate.setInsuranceDetailId(detailId);
operate.setOperateDesc(operateDesc);
operate.setCreateBy(CommonConstants.ONE_STRING);
operate.setCreateName(userName);
operate.setCreateTime(LocalDateTime.now());
return operate;
}
/**
* 操作记录(无审批remark)
*
......
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