Commit 828aa563 authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent 9e262da2
......@@ -33,10 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceExitCheckVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
......@@ -1427,21 +1424,37 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
public EmployeeRegistrationPre getEmployeeRegistrationPreById(String id) {
EmployeeRegistrationPre pre = this.getById(id);
if (pre != null) {
// 查原商险,来对比
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList;
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null && !sdr.getData().getPreList().isEmpty()) {
oldList = sdr.getData().getPreList();
for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()) )) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
//判断合同是否已签订 是的话展示商险明细 否的话查询商险待购买数据
if (CommonConstants.ZERO_STRING.equals(pre.getInsuranceIsBuy())) {
// 查已购买商险明细
R<EmployeePreInsuranceListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getExitInsuranceListByEmpPreId", id
, EmployeePreInsuranceListVo.class, SecurityConstants.FROM_IN);
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
!sdr.getData().getPreList().isEmpty()) {
pre.setExitInsuranceInfoList(sdr.getData().getPreList());
}
} else {
// 查原商险
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class
, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList;
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
!sdr.getData().getPreList().isEmpty()) {
oldList = sdr.getData().getPreList();
for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
}
}
pre.setInsurancePreList(oldList);
}
pre.setInsurancePreList(oldList);
}
//获取合同待签订数据
TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @author huych
* @description 商险自动化已购买商险明细VO
* @date 2025-8-7 10:20:26
*/
@Data
@Schema(description = "商险自动化已购买商险明细VO")
public class EmployeePreInsuranceListVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
private List<TInsurancePreDetail> preList = new ArrayList<>();
}
......@@ -12,10 +12,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -277,4 +274,17 @@ public class TEmployeeInsurancePreController {
return tEmployeeInsurancePreService.deleteInsuranceByPreId(preId);
}
/**
* @param empPreId 入职确认信息表ID
* @Description: 获取商险已购买信息
* @Author: huych
* @Date: 2025/8/7 10:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail>>
**/
@Inner
@PostMapping("/inner/getExitInsuranceListByEmpPreId")
public EmployeePreInsuranceListVo getExitInsuranceListByEmpPreId(@RequestBody String empPreId){
return tEmployeeInsurancePreService.getExitInsuranceListByEmpPreId(empPreId);
}
}
......@@ -7,10 +7,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EmployeePreLogListVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -104,4 +101,12 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
**/
boolean deleteInsuranceByPreId(String preId);
/**
* @param empPreId 入职确认信息表ID
* @Description: 获取商险已购买信息
* @Author: huych
* @Date: 2025/8/7 10:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail>>
**/
EmployeePreInsuranceListVo getExitInsuranceListByEmpPreId(String empPreId);
}
......@@ -419,7 +419,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
wrapper -> wrapper.eq(TInsuranceDetail::getIsEffect, CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getIsOverdue, CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.THREE_INT)
.or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.TWO_INT)));
.or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.TWO_INT)
.or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.ONE_INT)));
return count == preVo.getExitInsuranceInfoList().size();
}
return false;
......@@ -674,4 +675,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return true;
}
@Override
public EmployeePreInsuranceListVo getExitInsuranceListByEmpPreId(String empPreId) {
EmployeePreInsuranceListVo vo = new EmployeePreInsuranceListVo();
List<TInsurancePreDetail> preList = preDetailService.list(Wrappers.<TInsurancePreDetail>query().lambda()
.eq(TInsurancePreDetail::getRegisterId, empPreId));
vo.setPreList(preList);
return vo;
}
}
......@@ -619,7 +619,7 @@
t_insurance_detail a
where
a.DELETE_FLAG = 0
and (a.BUY_HANDLE_STATUS = 2 or (a.BUY_HANDLE_STATUS = 3 and a.isEffect = 0 and a.isOverdue = 0))
and (a.BUY_HANDLE_STATUS in (1,2) or (a.BUY_HANDLE_STATUS = 3 and a.isEffect = 0 and a.isOverdue = 0))
AND EMP_IDCARD_NO = #{empIdCard}
</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