Commit 78f7b04a authored by zhaji's avatar zhaji

"feature-zhaJi:新增变更项目与EKP交互流程(调试中)"

parent 13529104
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -271,5 +273,17 @@ public class TInsuranceDetail extends BaseEntity { ...@@ -271,5 +273,17 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "是否删除 0否/1是") @Schema(description = "是否删除 0否/1是")
private Integer deleteFlag; private Integer deleteFlag;
/**
* 商险办理人
*/
@Schema(description = "商险办理人")
private String handledBy;
/**
* 商险办理时间
*/
@Schema(description = "商险办理时间")
private LocalDateTime handledTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -95,8 +95,8 @@ public class EKPUtil { ...@@ -95,8 +95,8 @@ public class EKPUtil {
String loginData = new ObjectMapper().writeValueAsString(loginName); String loginData = new ObjectMapper().writeValueAsString(loginName);
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>(); MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") ); wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
//wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}"); wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docCreator", loginData); //wholeForm.add("docCreator", loginData);
wholeForm.add("docStatus", docStatus); wholeForm.add("docStatus", docStatus);
wholeForm.add("fdModelId", fdModelId); wholeForm.add("fdModelId", fdModelId);
wholeForm.add("fdFlowId", fdFlowId); wholeForm.add("fdFlowId", fdFlowId);
......
...@@ -122,5 +122,29 @@ public class DeptChangeCheckParam implements Serializable { ...@@ -122,5 +122,29 @@ public class DeptChangeCheckParam implements Serializable {
@Schema(description = "实际保费") @Schema(description = "实际保费")
private BigDecimal actualPremium; private BigDecimal actualPremium;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String newCustomerName;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String newCustomerCode;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String oldCustomerName;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String oldCustomerCode;
} }
...@@ -149,7 +149,7 @@ public class EKPInteractiveParam implements Serializable { ...@@ -149,7 +149,7 @@ public class EKPInteractiveParam implements Serializable {
/** /**
* 单据状态 * 单据状态
*/ */
@Schema(description = "状态:1新增结算单,2作废结算信息,3更新保单信息") @Schema(description = "状态:1新增结算单,2更新保单信息,3作废结算信息")
private Integer interactiveType; private Integer interactiveType;
} }
...@@ -837,6 +837,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -837,6 +837,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日 // if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT)); detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
} }
detail.setHandledBy(user.getId());
detail.setHandledTime(LocalDateTime.now());
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detailList.add(detail); detailList.add(detail);
...@@ -953,11 +955,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -953,11 +955,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
// 记录状态置为「退回」 // 记录状态置为「退回」
detail.setBuyHandleStatus(CommonConstants.FOUR_INT); detail.setBuyHandleStatus(CommonConstants.FOUR_INT);
//投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空 //投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空
if (detail.getSignFlag() == CommonConstants.ONE_INT){ if (detail.getSignFlag() == CommonConstants.ONE_INT){
detail.setHandledTime(null);
detail.setHandledBy(null);
detail.setPolicyEffect(null); detail.setPolicyEffect(null);
detail.setIsEffect(null); detail.setIsEffect(null);
detail.setIsOverdue(null); detail.setIsOverdue(null);
...@@ -1048,6 +1051,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1048,6 +1051,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
successList.add(detail); successList.add(detail);
}else{ }else{
//根据结算类型判断是否需要计算预估保费 //根据结算类型判断是否需要计算预估保费
...@@ -2159,18 +2163,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2159,18 +2163,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getDeptNo()))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getReplaceDeptNo()))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
//原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 //原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName()) .eq(TInsuranceDetail::getEmpName, param.getEmpName())
...@@ -2189,6 +2182,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2189,6 +2182,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
}else { }else {
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getDeptNo()))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(param.getReplaceDeptNo()))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
listResult.add(param);
continue;
}
// 投保状态 待投保 不能替换 // 投保状态 待投保 不能替换
if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){ if (detail.getBuyHandleStatus() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.ONE_REPLACE_IS_NOT_ALLOW); param.setErrorMessage(InsurancesConstants.ONE_REPLACE_IS_NOT_ALLOW);
...@@ -2904,6 +2909,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2904,6 +2909,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceRefund refund = new TInsuranceRefund(); TInsuranceRefund refund = new TInsuranceRefund();
detail.setId(record.getId()); detail.setId(record.getId());
//update状态由「待减员」置为「减员中」 //update状态由「待减员」置为「减员中」
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setReduceHandleStatus(CommonConstants.TWO_INT); detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detailList.add(detail); detailList.add(detail);
...@@ -2981,6 +2987,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2981,6 +2987,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
} }
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setUpdateTime(LocalDateTime.now()); tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail); successList.add(tInsuranceDetail);
//更新减员记录 //更新减员记录
...@@ -3026,15 +3033,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3026,15 +3033,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user); Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user);
//todo 生成EKP通知,通知ekp变更结算月份 //todo 生成EKP通知,通知ekp变更结算月份
List<TInsuranceOperate> operateList = new ArrayList<>(); List<TInsuranceOperate> operateList = new ArrayList<>(16);
List<SettleMonthChangeCheckParam> successList = map.get("successList"); List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList"); List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
if(CollectionUtils.isNotEmpty(successList)){ if(CollectionUtils.isNotEmpty(successList)){
List<EKPInteractiveParam> deptDetail = getDeptDetail(successList); List<EKPInteractiveParam> deptDetail = getDeptDetail(successList);
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) { for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
threadPool.execute(() -> { threadPool.execute(() -> {
String settleMonth = ekpInteractiveParam.getSettleMonth();
TInsuranceDetail byId = getById(ekpInteractiveParam.getId()); TInsuranceDetail byId = getById(ekpInteractiveParam.getId());
BeanCopyUtils.copyProperties(byId,ekpInteractiveParam); BeanCopyUtils.copyProperties(byId,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
String body = EKPUtil.sendToEKP(ekpInteractiveParam); String body = EKPUtil.sendToEKP(ekpInteractiveParam);
System.out.println("变更成功后的id为:"+body); System.out.println("变更成功后的id为:"+body);
if (!StringUtils.isBlank(body)){ if (!StringUtils.isBlank(body)){
...@@ -3063,9 +3072,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3063,9 +3072,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
}); });
} }
tInsuranceOperateService.saveBatch(operateList);
return R.ok(errorList,"导入成功");
} }
tInsuranceOperateService.saveBatch(operateList); return R.ok();
return R.ok(errorList,"导入成功");
} }
/** /**
...@@ -3078,6 +3088,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3078,6 +3088,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public R deptChange(List<DeptChangeCheckParam> deptChangeCheckList) { public R deptChange(List<DeptChangeCheckParam> deptChangeCheckList) {
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(deptChangeCheckList)){ if(!Common.isNotEmpty(deptChangeCheckList)){
return R.failed("当前变更所属项目列表为空"); return R.failed("当前变更所属项目列表为空");
...@@ -3086,76 +3098,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3086,76 +3098,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//todo 生成EKP通知,通知ekp变更结算所属项目 //todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList"); List<DeptChangeCheckParam> successList = stringListMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>(16); List<TInsuranceOperate> operateList = new ArrayList<>(16);
List<TInsuranceDetail> detailList = new ArrayList<>(16);
if(CollectionUtils.isNotEmpty(successList)){ if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) { for (DeptChangeCheckParam success : successList) {
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId())); threadPool.execute(() -> {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); EKPInteractiveParam interactiveParam = new EKPInteractiveParam();
Integer oldSettleType = success.getOldSettleType(); TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
Integer newSettleType = success.getNewSettleType(); BeanCopyUtils.copyProperties(one,interactiveParam);
updateWrapper.eq(TInsuranceDetail ::getId,success.getId()) //更新新的客户,项目信息
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo()) LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType()) Integer oldSettleType = success.getOldSettleType();
.set(TInsuranceDetail :: getUpdateBy,user.getId()) Integer newSettleType = success.getNewSettleType();
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
String insuranceDetailId = success.getId(); .set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
//结算信息id .set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
String defaultSettleId = success.getDefaultSettleId(); .set(TInsuranceDetail :: getUpdateBy,user.getId())
//实际保费 .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
BigDecimal actualPremium = success.getActualPremium(); String insuranceDetailId = success.getId();
//如果变更前为单独结算 //结算信息id
if(CommonConstants.ONE_INT == oldSettleType){ String defaultSettleId = success.getDefaultSettleId();
//登记了保单保费 //实际保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)){ BigDecimal actualPremium = success.getActualPremium();
//变更后为单独结算 //如果变更前为单独结算
if(CommonConstants.ONE_INT == newSettleType){ if(CommonConstants.ONE_INT == oldSettleType){
//登记了保单保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)) {
//根据旧的结算id获取旧的结算信息 //根据旧的结算id获取旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId); TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//如果已经推送过实际保费,则先作废,再推送新的实际保费
if (byId.getIsActualPush() ==CommonConstants.ONE_INT){
//作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//推送至EKP执行作废操作
//TODO: 2022/8/2
//推送成功更新推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//生成新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的结算信息id
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的
// TODO: 2022/8/2
//推送成功更新推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}
//如果没有推送过实际保费
if(byId.getIsActualPush() ==CommonConstants.ZERO_INT){
//推送新的至EKP
}
}
//变更后为合并结算
if(CommonConstants.ZERO_INT == newSettleType){
//作废旧的数据,生成作废结算信息记录 //作废旧的数据,生成作废结算信息记录
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo()); cancel.setDeptNo(success.getOldDeptNo());
...@@ -3166,120 +3134,162 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3166,120 +3134,162 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setDeptName(success.getOldDeptName()); cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT); cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
//查询旧的结算信息 //如果已经推送过实际保费,则先作废,再推送新的实际保费
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId); if (byId.getIsActualPush() == CommonConstants.ONE_INT) {
//推送EKP //TODO: 2022/8/2
// TODO: 2022/8/2 //推送至EKP执行作废操作
//推送成功更新作废推送状态 interactiveParam.setActualPremium(one.getActualPremium());
cancel.setIsCancelPush(CommonConstants.ONE_INT); interactiveParam.setCustomerCode(success.getOldCustomerCode());
tInsuranceSettleCancelService.updateById(cancel); interactiveParam.setCustomerName(success.getOldCustomerName());
//新增新的结算信息 interactiveParam.setDeptNo(success.getOldDeptNo());
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); interactiveParam.setDeptName(success.getOldDeptName());
newInsuranceSettle.setInsDetailId(insuranceDetailId); interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
newInsuranceSettle.setSettleType(newSettleType); String deleteBody = EKPUtil.sendToEKP(interactiveParam);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); if (StringUtils.isBlank(deleteBody)) {
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); //推送成功更新作废推送状态
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); cancel.setIsCancelPush(CommonConstants.ONE_INT);
newInsuranceSettle.setCreateTime(LocalDateTime.now()); tInsuranceSettleCancelService.updateById(cancel);
newInsuranceSettle.setActualPremium(success.getActualPremium()); //变更后为单独结算
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium()); if (CommonConstants.ONE_INT == newSettleType) {
//生成新的结算信息 //生成新的结算信息
tInsuranceSettleService.save(newInsuranceSettle); TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
//赋值新的预估费用和新的结算信息 newInsuranceSettle.setInsDetailId(insuranceDetailId);
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); newInsuranceSettle.setSettleType(newSettleType);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
update(updateWrapper); newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
//推送EKP newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
// TODO: 2022/8/2 newInsuranceSettle.setCreateTime(LocalDateTime.now());
//推送成功后更新本地推送状态 newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setActualPushTime(LocalDateTime.now()); tInsuranceSettleService.save(newInsuranceSettle);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); //赋值新的结算信息id
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT); updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); update(updateWrapper);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); // TODO: 2022/8/2
tInsuranceSettleService.updateById(newInsuranceSettle); //推送新的结算信息至EKP
} interactiveParam.setSettleType(CommonConstants.ONE_INT);
} interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//未登记保单保费 interactiveParam.setCustomerCode(success.getNewCustomerCode());
if(BigDecimalUtils.isNullOrZero(actualPremium)){ interactiveParam.setCustomerName(success.getNewCustomerName());
//变更后为单独结算 interactiveParam.setDeptNo(success.getNewDeptNo());
if (CommonConstants.ONE_INT == newSettleType){ interactiveParam.setDeptName(success.getNewDeptName());
//变更项目且不做处理 interactiveParam.setActualPremium(success.getActualPremium());
update(updateWrapper); String addBody = EKPUtil.sendToEKP(interactiveParam);
if (StringUtils.isNotBlank(addBody)){
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else {
//异常处理 // TODO: 2022/8/9
}
}
//变更后为合并结算
if (CommonConstants.ZERO_INT == newSettleType) {
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
//生成新的结算信息
tInsuranceSettleService.save(newInsuranceSettle);
//赋值新的预估费用和新的结算信息
updateWrapper.set(TInsuranceDetail::getEstimatePremium, success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail::getDefaultSettleId, newInsuranceSettle.getId());
update(updateWrapper);
//推送EKP
// TODO: 2022/8/2
//先推送预估,再推送实际
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送预估单
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if (!StringUtils.isBlank(estimateBody)) {
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
//推送实缴单
interactiveParam.setSettleType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
String actualBody = EKPUtil.sendToEKP(interactiveParam);
if (!StringUtils.isBlank(actualBody)) {
//推送成功后更新本地推送状态
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
}
}
}else{
//异常处理 // TODO: 2022/8/9
}
} }
//变更后为合并结算 //未登记保单保费
if (CommonConstants.ZERO_INT == newSettleType){ if(BigDecimalUtils.isNullOrZero(actualPremium)){
//生成预估结算信息 //变更后为单独结算
TInsuranceSettle tInsuranceSettle = new TInsuranceSettle(); if (CommonConstants.ONE_INT == newSettleType){
tInsuranceSettle.setInsDetailId(success.getId()); //变更项目且不做处理
tInsuranceSettle.setSettleType(success.getNewSettleType()); update(updateWrapper);
tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); }
tInsuranceSettle.setEstimatePremium(success.getEstimatePremium()); //变更后为合并结算
tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); if (CommonConstants.ZERO_INT == newSettleType){
tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); //生成预估结算信息
tInsuranceSettle.setCreateTime(LocalDateTime.now()); TInsuranceSettle tInsuranceSettle = new TInsuranceSettle();
tInsuranceSettleService.save(tInsuranceSettle); tInsuranceSettle.setInsDetailId(success.getId());
//将结算id赋值给保单信息,并新增预估费用 tInsuranceSettle.setSettleType(success.getNewSettleType());
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()) tInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId()); tInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
update(updateWrapper); tInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
//推送结算信息至EKP tInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
// TODO: 2022/8/2 tInsuranceSettle.setCreateTime(LocalDateTime.now());
//推送成功后更新本地推送状态 tInsuranceSettleService.save(tInsuranceSettle);
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); //将结算id赋值给保单信息,并新增预估费用
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium())
tInsuranceSettle.setUpdateTime(LocalDateTime.now()); .set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
tInsuranceSettleService.updateById(tInsuranceSettle); update(updateWrapper);
//推送结算信息至EKP
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(success.getEstimatePremium());
interactiveParam.setActualPremium(null);
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String estimateBody = EKPUtil.sendToEKP(interactiveParam);
if(!StringUtils.isBlank(estimateBody)){
//推送成功后更新本地推送状态
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
} }
} }
//变更前为合并结算
} if(CommonConstants.ZERO_INT == oldSettleType){
//变更前为合并结算 //如果已经登记保费
if(CommonConstants.ZERO_INT == oldSettleType){ if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//如果已经登记保费
if (!BigDecimalUtils.isNullOrZero(actualPremium)){
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo());
cancel.setInsDetailId(success.getId());
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送EKP
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为0.00
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP
// TODO: 2022/8/2
//推送成功,更新推送状态
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//作废旧的结算信息 //作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo()); cancel.setDeptNo(success.getOldDeptNo());
...@@ -3290,42 +3300,105 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3290,42 +3300,105 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setDeptName(success.getOldDeptName()); cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT); cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId); //推送作废结算信息至EKP
//推送EKP
// TODO: 2022/8/2
//推送成功更新作废推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为新的预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息
// TODO: 2022/8/2 // TODO: 2022/8/2
//推送成功,更新预估和实际保费的推送状态 interactiveParam.setCustomerCode(success.getOldCustomerCode());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); interactiveParam.setCustomerName(success.getOldCustomerName());
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); interactiveParam.setDeptNo(success.getOldDeptNo());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT); interactiveParam.setDeptName(success.getOldDeptName());
newInsuranceSettle.setActualPushTime(LocalDateTime.now()); interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); interactiveParam.setEstimatePremium(one.getEstimatePremium());
tInsuranceSettleService.updateById(newInsuranceSettle); interactiveParam.setActualPremium(one.getActualPremium());
interactiveParam.setSettleType(CommonConstants.ZERO_INT);
String deleteBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(deleteBody)){
//推送成功更新作废推送状态
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为0.00
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息至EKP,先推预估单,再推实际保费
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(CommonConstants.ONE_INT);
String actualBody = EKPUtil.sendToEKP(interactiveParam);
if(StringUtils.isNotBlank(actualBody)){
//推送成功,更新推送状态
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
//变更为合并结算
if (CommonConstants.ZERO_INT == newSettleType){
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
newInsuranceSettle.setSettleType(newSettleType);
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setActualPremium(success.getActualPremium());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
tInsuranceSettleService.save(newInsuranceSettle);
//更新预估费用为新的预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
update(updateWrapper);
//推送新的结算信息
// TODO: 2022/8/2
interactiveParam.setCustomerCode(success.getNewCustomerCode());
interactiveParam.setCustomerName(success.getNewCustomerName());
interactiveParam.setDeptNo(success.getNewDeptNo());
interactiveParam.setDeptName(success.getNewDeptName());
interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
interactiveParam.setEstimatePremium(null);
interactiveParam.setActualPremium(success.getActualPremium());
interactiveParam.setSettleType(CommonConstants.ONE_INT);
String actualBody = EKPUtil.sendToEKP(interactiveParam);
//推送成功,更新预估和实际保费的推送状态
if(StringUtils.isNotBlank(actualBody)){
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setIsActualPush(CommonConstants.ONE_INT);
newInsuranceSettle.setActualPushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
}else{
//异常处理 // TODO: 2022/8/9
}
} }
} //如果没有登记保费
//如果没有登记保费 if (BigDecimalUtils.isNullOrZero(actualPremium)){
if (BigDecimalUtils.isNullOrZero(actualPremium)){
//变更为单独结算
if (CommonConstants.ONE_INT == newSettleType){
//作废旧的结算信息 //作废旧的结算信息
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); TInsuranceSettleCancel cancel = new TInsuranceSettleCancel();
cancel.setDeptNo(success.getOldDeptNo()); cancel.setDeptNo(success.getOldDeptNo());
...@@ -3338,56 +3411,69 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3338,56 +3411,69 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettleCancelService.save(cancel); tInsuranceSettleCancelService.save(cancel);
//推送至EKP //推送至EKP
// TODO: 2022/8/2 // TODO: 2022/8/2
//推送成功后更新作废信息推送状态 interactiveParam.setCustomerCode(success.getOldCustomerCode());
cancel.setIsCancelPush(CommonConstants.ONE_INT); interactiveParam.setCustomerName(success.getOldCustomerName());
tInsuranceSettleCancelService.updateById(cancel); interactiveParam.setDeptNo(success.getOldDeptNo());
//删除预估费用和结算id interactiveParam.setDeptName(success.getOldDeptName());
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00")); interactiveParam.setInteractiveType(CommonConstants.THREE_INT);
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null); interactiveParam.setEstimatePremium(one.getEstimatePremium());
update(updateWrapper); interactiveParam.setSettleType(CommonConstants.ZERO_INT);
} String deleteBody = EKPUtil.sendToEKP(interactiveParam);
//变更为合并结算 if (StringUtils.isNotBlank(deleteBody)){
if (CommonConstants.ZERO_INT == newSettleType){ //推送成功后更新作废信息推送状态
//作废旧的结算信息 cancel.setIsCancelPush(CommonConstants.ONE_INT);
TInsuranceSettleCancel cancel = new TInsuranceSettleCancel(); tInsuranceSettleCancelService.updateById(cancel);
cancel.setDeptNo(success.getOldDeptNo()); //变更为单独结算
cancel.setInsDetailId(success.getId()); if (CommonConstants.ONE_INT == newSettleType){
cancel.setSettleId(defaultSettleId); //删除预估费用和结算id
cancel.setCreateUesr(user.getId()); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
cancel.setCreateTime(LocalDateTime.now()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null);
cancel.setDeptName(success.getOldDeptName()); update(updateWrapper);
cancel.setIsCancelPush(CommonConstants.ZERO_INT); }
tInsuranceSettleCancelService.save(cancel); //变更为合并结算
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId); if (CommonConstants.ZERO_INT == newSettleType){
//推送至EKP作废 //新增新的结算信息
// TODO: 2022/8/2 TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
//推送成功更新作废推送状态 newInsuranceSettle.setInsDetailId(insuranceDetailId);
cancel.setIsCancelPush(CommonConstants.ONE_INT); newInsuranceSettle.setSettleType(newSettleType);
tInsuranceSettleCancelService.updateById(cancel); newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT);
//新增新的结算信息 newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT);
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle(); newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING);
newInsuranceSettle.setInsDetailId(insuranceDetailId); newInsuranceSettle.setCreateTime(LocalDateTime.now());
newInsuranceSettle.setSettleType(newSettleType); newInsuranceSettle.setEstimatePremium(success.getEstimatePremium());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ZERO_INT); tInsuranceSettleService.save(newInsuranceSettle);
newInsuranceSettle.setIsActualPush(CommonConstants.ZERO_INT); //更新预估费用
newInsuranceSettle.setSettleHandleStatus(CommonConstants.ONE_STRING); updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
newInsuranceSettle.setCreateTime(LocalDateTime.now()); updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId());
newInsuranceSettle.setEstimatePremium(success.getEstimatePremium()); update(updateWrapper);
tInsuranceSettleService.save(newInsuranceSettle); //推送新的结算信息至EKP
//更新预估费用 // TODO: 2022/8/2
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium()); interactiveParam.setCustomerCode(success.getNewCustomerCode());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,newInsuranceSettle.getId()); interactiveParam.setCustomerName(success.getNewCustomerName());
update(updateWrapper); interactiveParam.setDeptNo(success.getNewDeptNo());
//推送新的结算信息至EKP interactiveParam.setDeptName(success.getNewDeptName());
// TODO: 2022/8/2 interactiveParam.setInteractiveType(CommonConstants.ONE_INT);
//推送成功更新预估推送状态 interactiveParam.setEstimatePremium(success.getEstimatePremium());
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT); interactiveParam.setActualPremium(null);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now()); interactiveParam.setSettleType(CommonConstants.ONE_INT);
newInsuranceSettle.setUpdateTime(LocalDateTime.now()); String estimateBody = EKPUtil.sendToEKP(interactiveParam);
tInsuranceSettleService.updateById(newInsuranceSettle); if(StringUtils.isNotBlank(estimateBody)){
//推送成功更新预估推送状态
newInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
newInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
newInsuranceSettle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(newInsuranceSettle);
}else{
//异常处理 // TODO: 2022/8/9
}
}
}else{
//异常处理 // TODO: 2022/8/9
}
} }
} }
} });
//新增操作信息 //新增操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate(); TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId()); insuranceOperate.setInsuranceDetailId(success.getId());
...@@ -3396,12 +3482,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3396,12 +3482,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now()); insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE); insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate); operateList.add(insuranceOperate);
detailList.add(one);
} }
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList"); List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
//EKPUtil.testAddNewsInRestTemplate(detailList);
return R.ok(errorList,"导入成功"); return R.ok(errorList,"导入成功");
} }
...@@ -3892,7 +3976,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3892,7 +3976,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail ::getEmpName,empName ) .eq(TInsuranceDetail ::getEmpName,empName )
.eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo ) .eq(TInsuranceDetail ::getEmpIdcardNo,empIdCardNo )
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName ) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName )
.eq(TInsuranceDetail :: getDeptNo,deptNo).eq(TInsuranceDetail :: getBuyStandard,buyStandard) .eq(TInsuranceDetail :: getDeptNo,deptNo)
.eq(TInsuranceDetail :: getBuyStandard,buyStandard)
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ) .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)) .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
...@@ -3953,7 +4038,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3953,7 +4038,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(StringUtils.isNotEmpty(defaultSettleId)){ if(StringUtils.isNotEmpty(defaultSettleId)){
//查询结算状态 //查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getInsDetailId,insuranceDetail.getId()); insuranceSettleQuery.eq(TInsuranceSettle :: getId,defaultSettleId);
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery); TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
if (!Common.isEmpty(insuranceSettle)){ if (!Common.isEmpty(insuranceSettle)){
//当前结算状态为结算中时,不能变更结算月 //当前结算状态为结算中时,不能变更结算月
...@@ -4115,7 +4200,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4115,7 +4200,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
param.setOldDeptName(oldJsonObject.getDepartName()); param.setOldDeptName(oldJsonObject.getDepartName());
param.setOldCustomerCode(oldJsonObject.getCustomerCode());
param.setOldCustomerName(oldJsonObject.getCustomerName());
param.setNewDeptName(jsonObject.getDepartName()); param.setNewDeptName(jsonObject.getDepartName());
param.setNewCustomerName(jsonObject.getCustomerName());
param.setOldCustomerCode(jsonObject.getCustomerCode());
String settleType = jsonObject.getInsuranceSettleType(); String settleType = jsonObject.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){ if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE); param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
...@@ -4164,6 +4253,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4164,6 +4253,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//旧项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(oldDeptNo))){
param.setErrorMessage(InsurancesConstants.OLD_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
}
//新项目ID不在当前权限范围内
if(!deptNoList.stream().anyMatch(u ->u.equals(newDeptNo))){
param.setErrorMessage(InsurancesConstants.NEW_DEPT_NO_NOT_IN_DEPT_LIST);
errorList.add(param);
continue;
}
//替换类型的保单不能变更所属项目 //替换类型的保单不能变更所属项目
Integer buyType = insuranceDetail.getBuyType(); Integer buyType = insuranceDetail.getBuyType();
if (CommonConstants.FOUR_INT == buyType){ if (CommonConstants.FOUR_INT == buyType){
...@@ -4444,6 +4545,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4444,6 +4545,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (SettleMonthChangeCheckParam param : list) { for (SettleMonthChangeCheckParam param : list) {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo()); ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
ekpInteractiveParam.setId(param.getId()); ekpInteractiveParam.setId(param.getId());
ekpInteractiveParam.setSettleMonth(param.getSettleMonth());
ekpInteractiveParam.setDeptName(projectSetInfoVo.getDepartName()); ekpInteractiveParam.setDeptName(projectSetInfoVo.getDepartName());
ekpInteractiveParam.setCustomerName(projectSetInfoVo.getCustomerName()); ekpInteractiveParam.setCustomerName(projectSetInfoVo.getCustomerName());
ekpInteractiveParam.setCustomerCode(projectSetInfoVo.getCustomerCode()); ekpInteractiveParam.setCustomerCode(projectSetInfoVo.getCustomerCode());
......
...@@ -51,7 +51,9 @@ ...@@ -51,7 +51,9 @@
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/> <result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/> <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/> <result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
</resultMap> <result property="handledBy" column="HANDLED_BY" jdbcType="VARCHAR"/>
<result property="handledTime" column="HANDLED_TIME" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
ID,EMP_NAME, ID,EMP_NAME,
...@@ -65,8 +67,8 @@ ...@@ -65,8 +67,8 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS, BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK, IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME, CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME
</sql> </sql>
<!--投保办理分页查询--> <!--投保办理分页查询-->
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO"> <select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id, select detail.id as id,
...@@ -167,7 +169,7 @@ ...@@ -167,7 +169,7 @@
and ${param.regionSql} and ${param.regionSql}
</if> </if>
<if test="param.updateBy != null and param.updateBy.trim() != ''"> <if test="param.updateBy != null and param.updateBy.trim() != ''">
and detail.UPDATE_BY = #{param.updateBy} and detail.HANDLED_BY = #{param.updateBy}
</if> </if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
......
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