Commit 33293e8d authored by zhaji's avatar zhaji

"feature-zhaJi:优化EKP交互流程,新增商险id字段"

parent 24a6de34
...@@ -130,9 +130,22 @@ public class EKPUtil { ...@@ -130,9 +130,22 @@ public class EKPUtil {
} }
} }
/**
* 将类转换成EKP要求的格式
*
* @author zhaji
* @param param 转换类
* @return {@link TInsuranceSettlePushParam}
*/
public static TInsuranceSettlePushParam InsuranceDetail2PushParam(EKPInteractiveParam param){ public static TInsuranceSettlePushParam InsuranceDetail2PushParam(EKPInteractiveParam param){
String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
TInsuranceSettlePushParam pushParam = new TInsuranceSettlePushParam(); TInsuranceSettlePushParam pushParam = new TInsuranceSettlePushParam();
//ekpId
if(null != param.getId() && null != param.getDefaultSettleId()){
pushParam.setFd_3afa8a70006bea(param.getId()+CommonConstants.DOWN_LINE_STRING+param.getDefaultSettleId());
}else{
pushParam.setFd_3afa8a70006bea(CommonConstants.EMPTY_STRING);
}
//单据类型 //单据类型
if(null != param.getSettleType()){ if(null != param.getSettleType()){
pushParam.setFd_3adfe6af71a1cc(param.getSettleType()); pushParam.setFd_3adfe6af71a1cc(param.getSettleType());
......
...@@ -26,6 +26,13 @@ public class EKPInteractiveParam implements Serializable { ...@@ -26,6 +26,13 @@ public class EKPInteractiveParam implements Serializable {
@Schema(description = "主键") @Schema(description = "主键")
private String id; private String id;
/**
* 结算id
*/
@Schema(description = "结算id")
private String defaultSettleId;
/** /**
* 单据类型 (0、与薪资合并结算 1、单独结算) * 单据类型 (0、与薪资合并结算 1、单独结算)
*/ */
......
...@@ -147,5 +147,11 @@ public class TInsuranceSettlePushParam{ ...@@ -147,5 +147,11 @@ public class TInsuranceSettlePushParam{
@Schema(description = "交易类型 1新增结算单,2作废结算信息,3更新保单信息") @Schema(description = "交易类型 1新增结算单,2作废结算信息,3更新保单信息")
private Integer fd_3af9197b31071c; private Integer fd_3af9197b31071c;
/**
* 商险ID 200
*/
@Schema(description = "商险ID(商险id_结算id)")
private String fd_3afa8a70006bea;
} }
...@@ -3039,16 +3039,61 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3039,16 +3039,61 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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)){
//当前保单结算信息不为空且已推送的情况下,推送EKP进行变更
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(); String settleMonth = ekpInteractiveParam.getSettleMonth();
TInsuranceDetail byId = getById(ekpInteractiveParam.getId()); TInsuranceDetail byId = getById(ekpInteractiveParam.getId());
BeanCopyUtils.copyProperties(byId,ekpInteractiveParam); String defaultSettleId = byId.getDefaultSettleId();
ekpInteractiveParam.setSettleMonth(settleMonth); if(StringUtils.isNotBlank(defaultSettleId)){
String body = EKPUtil.sendToEKP(ekpInteractiveParam); TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
System.out.println("变更成功后的id为:"+body); Integer isActualPush = settle.getIsActualPush();
if (!StringUtils.isBlank(body)){ Integer isEstimatePush = settle.getIsEstimatePush();
if(isEstimatePush == CommonConstants.ONE_INT || isActualPush == CommonConstants.ONE_INT){
BeanCopyUtils.copyProperties(byId,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
String body = EKPUtil.sendToEKP(ekpInteractiveParam);
System.out.println("变更成功后的id为:"+body);
if (!StringUtils.isBlank(body)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate);
}else{
System.out.println("更新EKP结算月份失败");
for (SettleMonthChangeCheckParam success: successList ){
if(success.getId().equals(ekpInteractiveParam.getId())){
success.setErrorMessage("更新EKP结算月份失败");
errorList.add(success);
}
}
}
}else{
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate);
}
}else{
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId()) updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth()) .set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
...@@ -3062,16 +3107,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3062,16 +3107,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now()); insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE); insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate); operateList.add(insuranceOperate);
System.out.println("返回的id为:"+body);
}else{
System.out.println("更新EKP结算月份失败");
for (SettleMonthChangeCheckParam success: successList ){
if(success.getId().equals(ekpInteractiveParam.getId())){
success.setErrorMessage("更新EKP结算月份失败");
errorList.add(success);
}
}
} }
}); });
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
......
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