Commit 33293e8d authored by zhaji's avatar zhaji

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

parent 24a6de34
......@@ -130,9 +130,22 @@ public class EKPUtil {
}
}
/**
* 将类转换成EKP要求的格式
*
* @author zhaji
* @param param 转换类
* @return {@link TInsuranceSettlePushParam}
*/
public static TInsuranceSettlePushParam InsuranceDetail2PushParam(EKPInteractiveParam param){
String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
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()){
pushParam.setFd_3adfe6af71a1cc(param.getSettleType());
......
......@@ -26,6 +26,13 @@ public class EKPInteractiveParam implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 结算id
*/
@Schema(description = "结算id")
private String defaultSettleId;
/**
* 单据类型 (0、与薪资合并结算 1、单独结算)
*/
......
......@@ -147,5 +147,11 @@ public class TInsuranceSettlePushParam{
@Schema(description = "交易类型 1新增结算单,2作废结算信息,3更新保单信息")
private Integer fd_3af9197b31071c;
/**
* 商险ID 200
*/
@Schema(description = "商险ID(商险id_结算id)")
private String fd_3afa8a70006bea;
}
......@@ -3039,11 +3039,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
if(CollectionUtils.isNotEmpty(successList)){
//当前保单结算信息不为空且已推送的情况下,推送EKP进行变更
List<EKPInteractiveParam> deptDetail = getDeptDetail(successList);
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
threadPool.execute(() -> {
String settleMonth = ekpInteractiveParam.getSettleMonth();
TInsuranceDetail byId = getById(ekpInteractiveParam.getId());
String defaultSettleId = byId.getDefaultSettleId();
if(StringUtils.isNotBlank(defaultSettleId)){
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
Integer isActualPush = settle.getIsActualPush();
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);
......@@ -3062,7 +3069,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate);
System.out.println("返回的id为:"+body);
}else{
System.out.println("更新EKP结算月份失败");
for (SettleMonthChangeCheckParam success: successList ){
......@@ -3072,6 +3078,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}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<>();
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);
}
});
}
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