Commit 13796aaa authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent 744ee557
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; 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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
...@@ -129,6 +130,10 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -129,6 +130,10 @@ public class EmployeeRegistrationPre extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private TEmployeeContractPre employeeContractPre; private TEmployeeContractPre employeeContractPre;
@Schema(description = "商险流程中信息集合")
@TableField(exist = false)
private List<TInsurancePreDetail> exitInsuranceInfoList;
@Schema(description = "附件集合") @Schema(description = "附件集合")
@TableField(exist = false) @TableField(exist = false)
private List<TAttaInfo> attaList; private List<TAttaInfo> attaList;
......
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -125,10 +126,17 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -125,10 +126,17 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "商险待派单信息集合") @Schema(description = "商险待派单信息集合")
private List<TEmployeeInsurancePreVo> employeeInsurancePreVos; private List<TEmployeeInsurancePreVo> employeeInsurancePreVos;
@Schema(description = "商险流程中信息集合")
private List<TInsurancePreDetail> exitInsuranceInfoList;
@Schema(description = "合同待派单信息") @Schema(description = "合同待派单信息")
private TEmployeeContractPreVo employeeContractPreVos; private TEmployeeContractPreVo employeeContractPreVos;
@Schema(description = "附件集合") @Schema(description = "附件集合")
private List<TAttaInfoSaveVo> attaList; private List<TAttaInfoSaveVo> attaList;
@TableField(exist = false)
@Schema(description = "修改类型:1新增;2修改;3删除;4状态346为不可编辑")
private String modelType;
} }
...@@ -225,6 +225,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -225,6 +225,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) { && !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList",""); differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre",""); differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("exitInsuranceInfoList","");
diffTitle = "档案信息"; diffTitle = "档案信息";
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING); detailEmpLog.setModelType(CommonConstants.TWO_STRING);
...@@ -418,6 +419,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -418,6 +419,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) { && !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList",""); differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre",""); differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("exitInsuranceInfoList","");
diffTitle = "档案信息二次确认"; diffTitle = "档案信息二次确认";
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING); detailEmpLog.setModelType(CommonConstants.TWO_STRING);
...@@ -433,6 +435,16 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -433,6 +435,16 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
TEmployeePreLogDetail detailInsuranceLog; TEmployeePreLogDetail detailInsuranceLog;
for (TEmployeeInsurancePre newInsurance : newList) { for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null; differenceInsuranceKey = null;
if (CommonConstants.THREE_STRING.equals(newInsurance.getModelType())) {
// 3:删除
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(newInsurance.getModelType());
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
this.setPreLogBaseInfo(empPreId, newInsurance, null, userId, nickName, differenceInsuranceKey, logId, detailInsuranceLog);
isModifyInsurance = true;
detailList.add(detailInsuranceLog);
continue;
}
// 2:修改有老ID // 2:修改有老ID
if (Common.isNotNull(newInsurance.getId())) { if (Common.isNotNull(newInsurance.getId())) {
oldInsurance = oldMap.get(newInsurance.getId()); oldInsurance = oldMap.get(newInsurance.getId());
......
...@@ -638,7 +638,7 @@ public interface CommonConstants { ...@@ -638,7 +638,7 @@ public interface CommonConstants {
List<String> processStatus = Stream.of("0","1").collect(Collectors.toList()); List<String> processStatus = Stream.of("0","1").collect(Collectors.toList());
List<String> processStatusEnd = Stream.of("3","4").collect(Collectors.toList()); List<String> insuranceAutoProcessStatus = Stream.of("0","1","2","5").collect(Collectors.toList());
List<String> processPreStatus = Stream.of("1").collect(Collectors.toList()); List<String> processPreStatus = Stream.of("1").collect(Collectors.toList());
......
...@@ -85,4 +85,9 @@ public class InsuranceDaprUtil { ...@@ -85,4 +85,9 @@ public class InsuranceDaprUtil {
, daprInsurancesProperties.getAppId(),"/temployeeinsurancepre/inner/updateInsurancePreCustomerName" , updateVo , daprInsurancesProperties.getAppId(),"/temployeeinsurancepre/inner/updateInsurancePreCustomerName" , updateVo
, Object.class, SecurityConstants.FROM_IN); , Object.class, SecurityConstants.FROM_IN);
} }
public R<Boolean> checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo) {
return HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),
"/temployeeinsurancepre/inner/checkExitInsuanceIsProcess", JSON.toJSONString(preVo), Boolean.class, SecurityConstants.FROM_IN);
}
} }
...@@ -569,7 +569,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -569,7 +569,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
!CommonConstants.ONE_STRING.equals(registration.getProcessStatus()))) { !CommonConstants.ONE_STRING.equals(registration.getProcessStatus()))) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE); return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} }
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) { if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()
&& Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ONE_STRING)) {
List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>(); List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>();
TEmployeeAutoRegistCheckVo checkVo; TEmployeeAutoRegistCheckVo checkVo;
String key; String key;
...@@ -619,6 +621,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -619,6 +621,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
} }
if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
//判断带出的流程中或者已完结的商险数据是否准确
//商险是否存在判断
boolean isTrue = checkInsuranceIsProcess(preVo);
if (isTrue) {
return R.other(CommonConstants.TWO_INT,null,"带出的商险已购买数据状态或条数发生变更,请重新确认接收!");
}
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项, //点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项 //状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
EmpProjectStatusVo vo = new EmpProjectStatusVo(); EmpProjectStatusVo vo = new EmpProjectStatusVo();
...@@ -645,7 +658,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -645,7 +658,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING); initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo); R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo);
if (Common.isNotNull(domainR) && Common.isNotNull(domainR.getData())) { if (Common.isNotNull(domainR) && Common.isNotNull(domainR.getData())) {
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) { //是否存在商险为是时生成入职确认信息商险明细数据
if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo);
} else if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据 //生成商险待购买的数据
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) { for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData()); initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData());
...@@ -1097,7 +1117,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1097,7 +1117,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
initRegistPreInfo(registrationNow, preVo, user, CommonConstants.FOUR_STRING); initRegistPreInfo(registrationNow, preVo, user, CommonConstants.FOUR_STRING);
R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo); R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo);
if (Common.isNotNull(domainR) && Common.isNotNull(domainR.getData())){ if (Common.isNotNull(domainR) && Common.isNotNull(domainR.getData())){
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) { //是否存在商险为是时生成入职确认信息商险明细数据
if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo);
} else if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据 //生成商险待购买的数据
for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) { for (TEmployeeInsurancePreVo insurancePreVo : preVo.getEmployeeInsurancePreVos()) {
initInsruancePreInfo(registrationNow, insurancePreVo, user, domainR.getData()); initInsruancePreInfo(registrationNow, insurancePreVo, user, domainR.getData());
...@@ -1602,6 +1629,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1602,6 +1629,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE)); preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
} }
//商险状态是否正常判断
private boolean checkInsuranceIsProcess(EmployeeRegistrationPreVo preVo) {
R<Boolean> flag = insuranceDaprUtil.checkExitInsuanceIsProcess(preVo);
//是否已签署为是需要判断合同是否在用或者流程中
return Common.isEmpty(flag) || Boolean.TRUE.equals(!flag.getData());
}
//商险是否存在判断 //商险是否存在判断
private TEmployeeAutoRegistCheckVo checkInsuranceExit(TEmployeeInsurancePreVo preVo,EmployeeRegistration registration) { private TEmployeeAutoRegistCheckVo checkInsuranceExit(TEmployeeInsurancePreVo preVo,EmployeeRegistration registration) {
//查询入职确认信息数据 //查询入职确认信息数据
......
...@@ -112,11 +112,11 @@ public class TInsurancePreDetail extends BaseEntity { ...@@ -112,11 +112,11 @@ public class TInsurancePreDetail extends BaseEntity {
@Schema(description = "保单生效日期") @Schema(description = "保单生效日期")
private Date policyEffect; private Date policyEffect;
/** /**
* 购买类型, 1新增、3批增、4替换 * 投保类型, 1新增、3批增、4替换
*/ */
@ExcelAttribute(name = "购买类型, 1新增、3批增、4替换") @ExcelAttribute(name = "购买类型, 1新增、3批增、4替换")
@ExcelProperty("购买类型, 1新增、3批增、4替换") @ExcelProperty("投保类型, 1新增、3批增、4替换")
@Schema(description = "购买类型, 1新增、3批增、4替换") @Schema(description = "投保类型, 1新增、3批增、4替换")
private Integer buyType; private Integer buyType;
/** /**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员 * 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
......
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -222,5 +223,5 @@ public class InsuranceAddParam implements Serializable { ...@@ -222,5 +223,5 @@ public class InsuranceAddParam implements Serializable {
@Schema(description = "是否已有参保明细标识") @Schema(description = "是否已有参保明细标识")
private String isExit; private String isExit;
private List<InsuredListVo> inProgressList; private List<TInsurancePreDetail> inProgressList;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -164,5 +165,5 @@ public class InsuranceAutoParam implements Serializable { ...@@ -164,5 +165,5 @@ public class InsuranceAutoParam implements Serializable {
@Schema(description = "是否已有参保明细标识") @Schema(description = "是否已有参保明细标识")
private String isExit; private String isExit;
private List<InsuredListVo> inProgressList; private List<TInsurancePreDetail> inProgressList;
} }
...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo; ...@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -229,5 +230,5 @@ public class InsuranceBatchParam implements Serializable { ...@@ -229,5 +230,5 @@ public class InsuranceBatchParam implements Serializable {
@Schema(description = "是否已有参保明细标识") @Schema(description = "是否已有参保明细标识")
private String isExit; private String isExit;
private List<InsuredListVo> inProgressList; private List<TInsurancePreDetail> inProgressList;
} }
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -164,6 +165,6 @@ public class InsuranceReplaceParam implements Serializable { ...@@ -164,6 +165,6 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "是否已有参保明细标识") @Schema(description = "是否已有参保明细标识")
private String isExit; private String isExit;
private List<InsuredListVo> inProgressList; private List<TInsurancePreDetail> inProgressList;
} }
...@@ -190,6 +190,18 @@ public class TEmployeeInsurancePreController { ...@@ -190,6 +190,18 @@ public class TEmployeeInsurancePreController {
return tEmployeeInsurancePreService.saveInsurancePreInfo(preVo); return tEmployeeInsurancePreService.saveInsurancePreInfo(preVo);
} }
/**
* 商险状态是否正常判断
* @author huych
* @date 2025-08-05 16:26:38
**/
@Operation(description = "商险状态是否正常判断")
@Inner
@PostMapping("/inner/checkExitInsuanceIsProcess")
public Boolean checkExitInsuanceIsProcess(@RequestBody EmployeeRegistrationPreVo preVo) {
return tEmployeeInsurancePreService.checkExitInsuanceIsProcess(preVo);
}
/** /**
* 更新商险待购买的前端客服姓名 * 更新商险待购买的前端客服姓名
* @author huych * @author huych
......
...@@ -14,6 +14,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; ...@@ -14,6 +14,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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants; import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
...@@ -881,7 +882,7 @@ public class TInsuranceDetailController { ...@@ -881,7 +882,7 @@ public class TInsuranceDetailController {
*/ */
@Operation(description = "查询在用或者在途的商险数据") @Operation(description = "查询在用或者在途的商险数据")
@GetMapping("/getOnProcessInsurancesInfo") @GetMapping("/getOnProcessInsurancesInfo")
public R<List<InsuredListVo>> getInProcessInsurancesInfo(@RequestParam String empIdcard) { public R<List<TInsurancePreDetail>> getInProcessInsurancesInfo(@RequestParam String empIdcard) {
return R.ok(tInsuranceDetailService.getOnProcessInsurancesInfo(empIdcard)); return R.ok(tInsuranceDetailService.getOnProcessInsurancesInfo(empIdcard));
} }
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainSelectVo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -337,6 +338,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -337,6 +338,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
/** /**
* 派单前系统已有在途/在保数据的人员明细 * 派单前系统已有在途/在保数据的人员明细
*/ */
List<InsuredListVo> getOnProcessInsuredList(@Param("empIdCard") String empIdCard); List<TInsurancePreDetail> getOnProcessInsuredList(@Param("empIdCard") String empIdCard);
} }
...@@ -71,6 +71,8 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -71,6 +71,8 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
*/ */
Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo preVo); Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo preVo);
Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo);
TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo); TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo);
void updateInsurancePreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo); void updateInsurancePreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo);
......
...@@ -9,6 +9,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -9,6 +9,7 @@ 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.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskListVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskListVo;
...@@ -575,7 +576,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -575,7 +576,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, InsuredParam param, String mId); IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, InsuredParam param, String mId);
List<InsuredListVo> getOnProcessInsurancesInfo(String empIdCard); List<TInsurancePreDetail> getOnProcessInsurancesInfo(String empIdCard);
} }
...@@ -25,10 +25,12 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; ...@@ -25,10 +25,12 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; 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.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.ScheduleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -64,10 +66,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -64,10 +66,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired @Autowired
@Lazy @Lazy
private TInsuranceDetailService detailService; private TInsuranceDetailService detailService;
//
@Autowired // @Autowired
@Lazy // @Lazy
private ScheduleService scheduleService; // private ScheduleService scheduleService;
@Autowired @Autowired
private WxConfig wxConfig; private WxConfig wxConfig;
...@@ -75,6 +77,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -75,6 +77,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired @Autowired
private UpmsDaprUtils upmsDaprUtils; private UpmsDaprUtils upmsDaprUtils;
@Autowired
private TInsurancePreDetailService preDetailService;
/** /**
* 商险待办任务表简单分页查询 * 商险待办任务表简单分页查询
* *
...@@ -327,33 +332,48 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -327,33 +332,48 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Override @Override
@Transactional @Transactional
public Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo registrationPreVo) { public Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo registrationPreVo) {
List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos(); if (Common.isNotNull(registrationPreVo.getInsuranceIsBuy())
TEmployeeInsurancePre preExit; && registrationPreVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) { && !registrationPreVo.getExitInsuranceInfoList().isEmpty()) {
try { //删除已存在的入职确认信息对应的商险明细
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) { preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
//判断是否存在商险待购买信息 .eq(TInsurancePreDetail::getRegisterId, registrationPreVo.getExitInsuranceInfoList()
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda() .get(0).getRegisterId()));
.eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId()) //批量新增
.eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard()) preDetailService.saveBatch(registrationPreVo.getExitInsuranceInfoList());
.eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard()) //批量删除商险待购买列表中的待确认、待派单、派单失败、投保退回的数据
.eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName()) baseMapper.delete(Wrappers.<TEmployeeInsurancePre>query().lambda().in(
.eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName()) TEmployeeInsurancePre::getProcessStatus,CommonConstants.insuranceAutoProcessStatus)
.eq(TEmployeeInsurancePre::getPolicyStart, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyStart()), DateUtil.ISO_EXPANDED_DATE_FORMAT)) .eq(TEmployeeInsurancePre::getRegisterId,registrationPreVo.getExitInsuranceInfoList()
.eq(TEmployeeInsurancePre::getPolicyEnd, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyEnd()), DateUtil.ISO_EXPANDED_DATE_FORMAT)) .get(0).getRegisterId()));
.last(CommonConstants.LAST_ONE_SQL)); } else {
TEmployeeInsurancePre pre = new TEmployeeInsurancePre(); List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos();
BeanUtils.copyProperties(preVo, pre); TEmployeeInsurancePre preExit;
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime())); try {
} for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
if (Common.isNotNull(preExit)) { //判断是否存在商险待购买信息
pre.setId(preExit.getId()); preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
baseMapper.deleteById(preExit); .eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId())
baseMapper.insert(pre); .eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard())
} else { .eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard())
baseMapper.insert(pre); .eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName())
//暂时不需要,先注释,后续可能会需要 .eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName())
.eq(TEmployeeInsurancePre::getPolicyStart, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyStart()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
.eq(TEmployeeInsurancePre::getPolicyEnd, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyEnd()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
.last(CommonConstants.LAST_ONE_SQL));
TEmployeeInsurancePre pre = new TEmployeeInsurancePre();
BeanUtils.copyProperties(preVo, pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
baseMapper.insert(pre);
} else {
baseMapper.insert(pre);
//暂时不需要,先注释,后续可能会需要
// if (Common.isNotNull(pre.getExpectedCollectionTime())) { // if (Common.isNotNull(pre.getExpectedCollectionTime())) {
// // 事务提交后触发调度 // // 事务提交后触发调度
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { // TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
...@@ -368,16 +388,43 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -368,16 +388,43 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
// } // }
// }); // });
// } // }
}
} }
} catch (Exception e) {
log.error("执行异常", e);
return null;
} }
}catch (Exception e){
log.error("执行异常" ,e);
return null;
} }
} }
return true; return true;
} }
@Override
public Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo) {
//如果状态有变动就会拦截
if (Common.isNotNull(preVo) && Common.isNotNull(preVo.getExitInsuranceInfoList())
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
for (TInsurancePreDetail preDetail: preVo.getExitInsuranceInfoList()) {
TInsuranceDetail insuranceDetail = detailService.getById(preDetail.getId());
if (Common.isEmpty(insuranceDetail) || !insuranceDetail.getBuyHandleStatus().equals(preDetail.getBuyHandleStatus())) {
return false;
}
}
//如果有数据新增也要拦截
long count = detailService.count(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpIdcardNo, preVo.getEmpIdcard())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//流程中或者已完结
.and(
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)));
return count == preVo.getExitInsuranceInfoList().size();
}
return false;
}
@Override @Override
public TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo) { public TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo) {
TEmployeeInsuranceSelectVo selectVo = new TEmployeeInsuranceSelectVo(); TEmployeeInsuranceSelectVo selectVo = new TEmployeeInsuranceSelectVo();
......
...@@ -3071,7 +3071,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3071,7 +3071,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//本次派单人员系统已有参保明细 如果是二次派单则无需校验 //本次派单人员系统已有参保明细 如果是二次派单则无需校验
if (Common.isEmpty(param.getIsExit())) { if (Common.isEmpty(param.getIsExit())) {
List<InsuredListVo> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo()); List<TInsurancePreDetail> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo());
if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) { if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) {
param.setIsExit(CommonConstants.ONE_STRING); param.setIsExit(CommonConstants.ONE_STRING);
param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST); param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST);
...@@ -3478,7 +3478,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3478,7 +3478,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//本次派单人员系统已有参保明细 如果是二次派单则无需校验 //本次派单人员系统已有参保明细 如果是二次派单则无需校验
if (Common.isEmpty(param.getIsExit())) { if (Common.isEmpty(param.getIsExit())) {
List<InsuredListVo> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo()); List<TInsurancePreDetail> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo());
if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) { if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) {
param.setIsExit(CommonConstants.ONE_STRING); param.setIsExit(CommonConstants.ONE_STRING);
param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST); param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST);
...@@ -3877,7 +3877,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3877,7 +3877,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//本次派单人员系统已有参保明细 如果是二次派单则无需校验 //本次派单人员系统已有参保明细 如果是二次派单则无需校验
if (Common.isEmpty(param.getIsExit())) { if (Common.isEmpty(param.getIsExit())) {
List<InsuredListVo> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo()); List<TInsurancePreDetail> listInsured = baseMapper.getOnProcessInsuredList(param.getEmpIdcardNo());
if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) { if (Common.isNotNull(listInsured) && !listInsured.isEmpty()) {
param.setIsExit(CommonConstants.ONE_STRING); param.setIsExit(CommonConstants.ONE_STRING);
param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST); param.setErrorMessage(InsurancesConstants.DIS_PERSON_DATA_IS_EXIST);
...@@ -8534,7 +8534,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8534,7 +8534,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
@Override @Override
public List<InsuredListVo> getOnProcessInsurancesInfo(String empIdCard) { public List<TInsurancePreDetail> getOnProcessInsurancesInfo(String empIdCard) {
return baseMapper.getOnProcessInsuredList(empIdCard); return baseMapper.getOnProcessInsuredList(empIdCard);
} }
......
...@@ -594,14 +594,14 @@ ...@@ -594,14 +594,14 @@
</update> </update>
<!-- 派单人员系统已有参保明细查询--> <!-- 派单人员系统已有参保明细查询-->
<select id="getOnProcessInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo"> <select id="getOnProcessInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail">
select select
a.id as id, a.id as id,
a.EMP_NAME as empName, a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo, a.EMP_IDCARD_NO as empIdcardNo,
a.BUY_TYPE as buyType, a.BUY_TYPE as buyType,
a.DEPT_NO as deptNo, a.DEPT_NO as deptNo,
a.DEPT_NAME as projectName, a.DEPT_NAME as deptName,
a.POST as post, a.POST as post,
a.POLICY_START as policyStart, a.POLICY_START as policyStart,
a.POLICY_END as policyEnd, a.POLICY_END as policyEnd,
......
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