Commit 099726a9 authored by huyuchen's avatar huyuchen

商险优化修改

parent f499bdf4
package com.yifu.cloud.plus.v1.yifu.insurances.util;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpIdCardAndDeptVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SalaryDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
......@@ -30,6 +34,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -69,7 +74,11 @@ public class DoJointInsuranceTask {
@Autowired
private TUpdateStatusErrorMapper updateStatusErrorMapper;
/**
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
/**
* @Description: 商险明细推送
* @Author: huyc
* @Date: 2022-11-30
......@@ -470,4 +479,54 @@ public class DoJointInsuranceTask {
log.error("薪资结算状态更新异常", e);
}
}
/**
* @param sourceList
* @Description: // 同步操作档案的 商险状态为:3失效(0无2正常3失效4处理中)
* @Author: hgw
* @Date: 2022/11/23 15:46
* @return: void
**/
@Async
public void updateEmpInfp(List<TInsuranceDetail> sourceList, String status) {
EmpStatusVo empStatusVo = new EmpStatusVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo;
List<EmpIdCardAndDeptVo> voList = new ArrayList<>();
for (TInsuranceDetail d : sourceList) {
empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
empIdCardAndDeptVo.setIdCard(d.getEmpIdcardNo());
empIdCardAndDeptVo.setDeptNo(d.getDeptNo());
empIdCardAndDeptVo.setStatus(status);
voList.add(empIdCardAndDeptVo);
}
empStatusVo.setEmpInfo(voList);
archivesDaprUtil.updateEmployeeInsuranceStatus(empStatusVo);
archivesDaprUtil.updateEmployeeInfoInsuranceStatus(empStatusVo);
}
/**
* @Description: 商险明细推送
* @Author: huyc
* @Date: 2022-11-30
* @return: void
**/
@Async
public void pushEstime(List<TInsuranceDetail> successList) {
//根据结算类型是合并结算,推送预估保费到ekp(上面已经算好,这里直接判断有预估保费的就推送)
for (TInsuranceDetail tInsuranceDetail : successList) {
//如果是合并计算则推送至EKP
if (CommonConstants.ZERO_INT == tInsuranceDetail.getSettleType()) {
//存储成功后发送给EKP
String s = pushEstimate(tInsuranceDetail, CommonConstants.ONE_INT);
if (StringUtils.isNotBlank(s)) {
LambdaUpdateWrapper<TInsuranceSettle> settleWrapper = new LambdaUpdateWrapper<>();
settleWrapper.eq(TInsuranceSettle::getId, tInsuranceDetail.getDefaultSettleId())
.set(TInsuranceSettle::getIsEstimatePush, CommonConstants.ONE_INT)
.set(TInsuranceSettle::getEstimatePushTime, LocalDateTime.now());
//更新结算信息表
tInsuranceSettleService.update(settleWrapper);
}
}
}
}
}
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