Commit bf5c1781 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.14' into MVP1.7.14

parents e56ab73c 2141d2a8
...@@ -567,12 +567,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -567,12 +567,13 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
// 1:存在商险,判断合规性+日期+五个不同等: // 1:存在商险,判断合规性+日期+五个不同等:
if (Common.isNotNull(employeeRegistrationPre.getServerItem()) && employeeRegistrationPre.getServerItem().contains("商险")) { if (Common.isNotNull(employeeRegistrationPre.getServerItem()) && employeeRegistrationPre.getServerItem().contains("商险")) {
//商险是否购买为时增加校验 //商险是否购买为时增加校验
if (Common.isNotNull(employeeRegistrationPre.getInsuranceIsBuy()) if (Common.isNotNull(employeeRegistrationPre.getInsuranceIsBuy())
&& employeeRegistrationPre.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING) && employeeRegistrationPre.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !employeeRegistrationPre.getExitInsuranceInfoList().isEmpty()) { && !employeeRegistrationPre.getExitInsuranceInfoList().isEmpty()) {
//判断带出的流程中或者已完结的商险数据是否准确 //判断带出的流程中或者已完结的商险数据是否准确
//商险是否存在判断 //商险是否存在判断
employeeRegistrationPre.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
boolean isTrue = checkInsuranceIsProcess(employeeRegistrationPre); boolean isTrue = checkInsuranceIsProcess(employeeRegistrationPre);
if (isTrue) { if (isTrue) {
return R.failed("带出的商险已购买数据状态或条数发生变更,请重新确认!"); return R.failed("带出的商险已购买数据状态或条数发生变更,请重新确认!");
...@@ -1425,36 +1426,34 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1425,36 +1426,34 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
EmployeeRegistrationPre pre = this.getById(id); EmployeeRegistrationPre pre = this.getById(id);
if (pre != null) { if (pre != null) {
//判断合同是否已签订 是的话展示商险明细 否的话查询商险待购买数据 //判断合同是否已签订 是的话展示商险明细 否的话查询商险待购买数据
if (CommonConstants.ZERO_STRING.equals(pre.getInsuranceIsBuy())) { // 查已购买商险明细
// 查已购买商险明细 R<EmployeePreInsuranceListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
R<EmployeePreInsuranceListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl() , daprInsurancesProperties.getAppId()
, daprInsurancesProperties.getAppId() , "/temployeeinsurancepre/inner/getExitInsuranceListByEmpPreId", id
, "/temployeeinsurancepre/inner/getExitInsuranceListByEmpPreId", id , EmployeePreInsuranceListVo.class, SecurityConstants.FROM_IN);
, EmployeePreInsuranceListVo.class, SecurityConstants.FROM_IN); if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null && !sdr.getData().getPreList().isEmpty()) {
!sdr.getData().getPreList().isEmpty()) { pre.setExitInsuranceInfoList(sdr.getData().getPreList());
pre.setExitInsuranceInfoList(sdr.getData().getPreList()); }
}
} else { // 查原商险
// 查原商险 R<EmployeePreLogListVo> sdrOld = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl() , daprInsurancesProperties.getAppId()
, daprInsurancesProperties.getAppId() , "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class , SecurityConstants.FROM_IN);
, SecurityConstants.FROM_IN); List<TEmployeeInsurancePre> oldList;
List<TEmployeeInsurancePre> oldList; if (sdrOld != null && sdrOld.getData() != null && sdrOld.getData().getPreList() != null &&
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null && !sdrOld.getData().getPreList().isEmpty()) {
!sdr.getData().getPreList().isEmpty()) { oldList = sdrOld.getData().getPreList();
oldList = sdr.getData().getPreList(); for (TEmployeeInsurancePre oldInsurance : oldList) {
for (TEmployeeInsurancePre oldInsurance : oldList) { if (Common.isNotNull(oldInsurance.getProcessStatus())
if (Common.isNotNull(oldInsurance.getProcessStatus()) && (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus()) || CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus()) || CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) {
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) { oldInsurance.setModelType(CommonConstants.FOUR_STRING);
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
}
} }
pre.setInsurancePreList(oldList);
} }
pre.setInsurancePreList(oldList);
} }
//获取合同待签订数据 //获取合同待签订数据
TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
......
...@@ -209,12 +209,18 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -209,12 +209,18 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
newInfo.setAttaIdList(null); newInfo.setAttaIdList(null);
oldInfo.setAttaList(null); oldInfo.setAttaList(null);
newInfo.setAttaList(null); newInfo.setAttaList(null);
//商险是否已购买list不做比较
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
//比较记录不影响业务逻辑,用try套住 //比较记录不影响业务逻辑,用try套住
//记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy();
oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy());
//比较差异 //比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异 //如果有差异保存差异
List<TEmployeeInsurancePre> newList = newInfo.getInsurancePreList(); List<TEmployeeInsurancePre> newList = newInfo.getInsurancePreList();
String diffTitle = null; String diffTitle = null;
String logId = String.valueOf(UUID.randomUUID()).replaceAll("-", ""); String logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
// 要保存的明细 // 要保存的明细
...@@ -225,7 +231,6 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -225,7 +231,6 @@ 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);
...@@ -238,18 +243,41 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -238,18 +243,41 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
oldMap = new HashMap<>(); oldMap = new HashMap<>();
} }
List<TEmployeeInsurancePre> saveOrUpdateList = new ArrayList<>(); List<TEmployeeInsurancePre> saveOrUpdateList = new ArrayList<>();
// 是否修改了商险
boolean isModifyInsurance = false;
TEmployeeInsurancePre oldInsurance;
String differenceInsuranceKey;
TEmployeePreLogDetail detailInsuranceLog;
if (Common.isEmpty(isBuyOld) || (Common.isNotNull(isBuyOld) && !isBuyOld.equals(isBuyNew))) {
//单独记录是否已购买商险的变更记录
differenceInsuranceKey = "insuranceIsBuy";
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(CommonConstants.TWO_STRING);
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
Map<String, Object> old = new HashMap<>();
old.put("insuranceIsBuy", isBuyOld);
Map<String, Object> simNew = new HashMap<>();
simNew.put("insuranceIsBuy", isBuyNew);
this.setLogBaseInfo(empPreId, old, simNew, user, differenceInsuranceKey, logId, detailInsuranceLog);
isModifyInsurance = true;
detailList.add(detailInsuranceLog);
}
//如果服务类型包含商险处理商险明细数据
if (Common.isNotNull(newInfo.getServerItem()) && newInfo.getServerItem().contains("商险")) {
newInfo.setId(empPreId);
if (!newInfo.getExitInsuranceInfoList().isEmpty()) {
newInfo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(empPreId));
}
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/updateInfoSaveInsurancePreInfo"
, newInfo, Boolean.class, SecurityConstants.FROM_IN);
}
if (newList != null && !newList.isEmpty()) { if (newList != null && !newList.isEmpty()) {
// 是否修改了商险
boolean isModifyInsurance = false;
TEmployeeInsurancePre oldInsurance;
String differenceInsuranceKey;
TEmployeePreLogDetail detailInsuranceLog;
for (TEmployeeInsurancePre newInsurance : newList) { for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null; differenceInsuranceKey = null;
if (Common.isNotNull(newInsurance.getModelType())) { if (Common.isNotNull(newInsurance.getModelType())) {
// 1:新增 // 1:新增
if (CommonConstants.ONE_STRING.equals(newInsurance.getModelType())) { if (CommonConstants.ONE_STRING.equals(newInsurance.getModelType())) {
saveOrUpdateList.add(newInsurance); saveOrUpdateList.add(newInsurance);
detailInsuranceLog = new TEmployeePreLogDetail(); detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(newInsurance.getModelType()); detailInsuranceLog.setModelType(newInsurance.getModelType());
...@@ -403,6 +431,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -403,6 +431,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
newInfo.setAttaIdList(null); newInfo.setAttaIdList(null);
oldInfo.setAttaList(null); oldInfo.setAttaList(null);
newInfo.setAttaList(null); newInfo.setAttaList(null);
//记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy();
//商险是否已购买list不做比较
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy());
//比较记录不影响业务逻辑,用try套住 //比较记录不影响业务逻辑,用try套住
//比较差异 //比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
...@@ -419,7 +453,6 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -419,7 +453,6 @@ 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 +466,20 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -433,6 +466,20 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
TEmployeeInsurancePre oldInsurance; TEmployeeInsurancePre oldInsurance;
String differenceInsuranceKey; String differenceInsuranceKey;
TEmployeePreLogDetail detailInsuranceLog; TEmployeePreLogDetail detailInsuranceLog;
if (Common.isEmpty(isBuyOld) ||(Common.isNotNull(isBuyOld) && !isBuyOld.equals(isBuyNew))) {
//单独记录是否已购买商险的变更记录
differenceInsuranceKey = "insuranceIsBuy";
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(CommonConstants.TWO_STRING);
detailInsuranceLog.setType(CommonConstants.TWO_STRING);
Map<String,Object> old = new HashMap<>();
old.put("insuranceIsBuy", isBuyOld);
Map<String,Object> simNew = new HashMap<>();
simNew.put("insuranceIsBuy", isBuyNew);
this.setPreLogBaseInfo(empPreId, old, simNew, userId, nickName, differenceInsuranceKey, logId, detailInsuranceLog);
isModifyInsurance = true;
detailList.add(detailInsuranceLog);
}
for (TEmployeeInsurancePre newInsurance : newList) { for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null; differenceInsuranceKey = null;
if (CommonConstants.THREE_STRING.equals(newInsurance.getModelType())) { if (CommonConstants.THREE_STRING.equals(newInsurance.getModelType())) {
......
...@@ -626,6 +626,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -626,6 +626,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
&& !preVo.getExitInsuranceInfoList().isEmpty()) { && !preVo.getExitInsuranceInfoList().isEmpty()) {
//判断带出的流程中或者已完结的商险数据是否准确 //判断带出的流程中或者已完结的商险数据是否准确
//商险是否存在判断 //商险是否存在判断
preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
boolean isTrue = checkInsuranceIsProcess(preVo); boolean isTrue = checkInsuranceIsProcess(preVo);
if (isTrue) { if (isTrue) {
return R.other(CommonConstants.TWO_INT,null,"带出的商险已购买数据状态或条数发生变更,请重新确认接收!"); return R.other(CommonConstants.TWO_INT,null,"带出的商险已购买数据状态或条数发生变更,请重新确认接收!");
...@@ -665,7 +667,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -665,7 +667,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData())); preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据 //生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo); insuranceDaprUtil.saveInsurancePreInfo(preVo);
} else if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) { } else if (preVo.getServerItem().contains("商险")
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ONE_STRING)
&& !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());
...@@ -978,6 +982,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -978,6 +982,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) { if (preVo.getServerItem().contains("商险") && !preVo.getEmployeeInsurancePreVos().isEmpty()) {
//生成商险待购买的数据 //生成商险待购买的数据
TEmployeeInsurancePreVo insurancePreVo = preVo.getEmployeeInsurancePreVos().get(0); TEmployeeInsurancePreVo insurancePreVo = preVo.getEmployeeInsurancePreVos().get(0);
//批量的商险是否已购买默认为否
preVo.setInsuranceIsBuy(CommonConstants.ONE_STRING);
initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData()); initInsruancePreInfo(registration, insurancePreVo, user, domainR.getData());
insuranceDaprUtil.saveInsurancePreInfo(preVo); insuranceDaprUtil.saveInsurancePreInfo(preVo);
} }
...@@ -1121,6 +1127,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1121,6 +1127,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy()) if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING) && preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !preVo.getExitInsuranceInfoList().isEmpty()) { && !preVo.getExitInsuranceInfoList().isEmpty()) {
preVo.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData())); preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据 //生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo); insuranceDaprUtil.saveInsurancePreInfo(preVo);
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
...@@ -151,6 +152,8 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -151,6 +152,8 @@ public class TEmployeeInsurancePre extends BaseEntity {
private String errorInfo; private String errorInfo;
@Schema(description = "发起失败时间") @Schema(description = "发起失败时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@JsonIgnore
private LocalDateTime errorTime; private LocalDateTime errorTime;
@TableField(exist = false) @TableField(exist = false)
......
...@@ -2,8 +2,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity; ...@@ -2,8 +2,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -96,6 +98,7 @@ public class TInsurancePreDetail extends BaseEntity { ...@@ -96,6 +98,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单开始时间", isDate = true) @ExcelAttribute(name = "保单开始时间", isDate = true)
@ExcelProperty("保单开始时间") @ExcelProperty("保单开始时间")
@Schema(description = "保单开始时间") @Schema(description = "保单开始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyStart; private Date policyStart;
/** /**
* 保单结束时间 * 保单结束时间
...@@ -103,6 +106,7 @@ public class TInsurancePreDetail extends BaseEntity { ...@@ -103,6 +106,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单结束时间", isDate = true) @ExcelAttribute(name = "保单结束时间", isDate = true)
@ExcelProperty("保单结束时间") @ExcelProperty("保单结束时间")
@Schema(description = "保单结束时间") @Schema(description = "保单结束时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyEnd; private Date policyEnd;
/** /**
* 保单生效日期 * 保单生效日期
...@@ -110,6 +114,7 @@ public class TInsurancePreDetail extends BaseEntity { ...@@ -110,6 +114,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单生效日期", isDate = true) @ExcelAttribute(name = "保单生效日期", isDate = true)
@ExcelProperty("保单生效日期") @ExcelProperty("保单生效日期")
@Schema(description = "保单生效日期") @Schema(description = "保单生效日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyEffect; private Date policyEffect;
/** /**
* 投保类型, 1新增、3批增、4替换 * 投保类型, 1新增、3批增、4替换
...@@ -166,4 +171,25 @@ public class TInsurancePreDetail extends BaseEntity { ...@@ -166,4 +171,25 @@ public class TInsurancePreDetail extends BaseEntity {
@Schema(description = "入离职登记id") @Schema(description = "入离职登记id")
private String registerId; private String registerId;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 派单时间
*/
@ExcelAttribute(name = "派单时间", isDate = true)
@ExcelProperty("派单时间")
@Schema(description = "派单时间")
@TableField(exist = false)
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date disTime;
} }
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.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail; 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 java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -18,6 +16,6 @@ import java.util.List; ...@@ -18,6 +16,6 @@ import java.util.List;
@Schema(description = "商险自动化已购买商险明细VO") @Schema(description = "商险自动化已购买商险明细VO")
public class EmployeePreInsuranceListVo implements Serializable { public class EmployeePreInsuranceListVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L; private static final long serialVersionUID = 628032758008497542L;
private List<TInsurancePreDetail> preList = new ArrayList<>(); private List<TInsurancePreDetail> preList;
} }
...@@ -202,6 +202,9 @@ public class InsuranceAddParam implements Serializable { ...@@ -202,6 +202,9 @@ public class InsuranceAddParam implements Serializable {
@Schema(description = "项目名称") @Schema(description = "项目名称")
private String deptName; private String deptName;
@Schema(description = "投标类型")
private Integer buyType;
@Schema(description ="客户id") @Schema(description ="客户id")
private String unitId; private String unitId;
......
...@@ -27,6 +27,16 @@ public class InsuranceAutoParam implements Serializable { ...@@ -27,6 +27,16 @@ public class InsuranceAutoParam implements Serializable {
*/ */
@Schema(description = "项目编码") @Schema(description = "项目编码")
private String deptNo; private String deptNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 投标类型
*/
@Schema(description = "投标类型")
private Integer buyType;
/** /**
* 员工姓名 * 员工姓名
......
...@@ -190,15 +190,19 @@ public class InsuranceBatchParam implements Serializable { ...@@ -190,15 +190,19 @@ public class InsuranceBatchParam implements Serializable {
/** /**
* 保单开始时间 * 保单开始时间
*/ */
@JsonIgnore
private LocalDate policyStart; private LocalDate policyStart;
/** /**
* 保单结束时间 * 保单结束时间
*/ */
@JsonIgnore
private LocalDate policyEnd; private LocalDate policyEnd;
@Schema(description = "项目名称")
private String deptName;
@Schema(description = "投标类型")
private Integer buyType;
/** /**
* EKP的 是否BPO: 是 否 * EKP的 是否BPO: 是 否
*/ */
...@@ -206,9 +210,6 @@ public class InsuranceBatchParam implements Serializable { ...@@ -206,9 +210,6 @@ public class InsuranceBatchParam implements Serializable {
@ExcelIgnore @ExcelIgnore
private String bpoFlag; private String bpoFlag;
@Schema(description = "项目名称")
private String deptName;
@Schema(description ="客户id") @Schema(description ="客户id")
private String unitId; private String unitId;
......
...@@ -138,6 +138,9 @@ public class InsuranceReplaceParam implements Serializable { ...@@ -138,6 +138,9 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "项目名称") @Schema(description = "项目名称")
private String deptName; private String deptName;
@Schema(description = "投标类型")
private Integer buyType;
@Schema(description ="客户id") @Schema(description ="客户id")
private String unitId; private String unitId;
......
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; 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.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;
...@@ -159,8 +160,8 @@ public class TEmployeeInsurancePreController { ...@@ -159,8 +160,8 @@ public class TEmployeeInsurancePreController {
**/ **/
@Operation(description = "商险派单信息单个/批量派单") @Operation(description = "商险派单信息单个/批量派单")
@PostMapping("/batchDispatcherInsurance") @PostMapping("/batchDispatcherInsurance")
public R batchDispatcherInsurance(@RequestBody List<String> idList) { public R batchDispatcherInsurance(@RequestBody List<String> idList,@RequestParam(required = false) String isExit) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, null); return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, isExit, false);
} }
/** /**
...@@ -187,6 +188,18 @@ public class TEmployeeInsurancePreController { ...@@ -187,6 +188,18 @@ public class TEmployeeInsurancePreController {
return tEmployeeInsurancePreService.saveInsurancePreInfo(preVo); return tEmployeeInsurancePreService.saveInsurancePreInfo(preVo);
} }
/**
* 信息修改入口新增商险已购买明细
* @author huych
* @date 2025-08-14 11:46:16
**/
@Operation(description = "信息修改入口新增商险已购买明细")
@Inner
@PostMapping("/inner/updateInfoSaveInsurancePreInfo")
public Boolean updateInfoSaveInsurancePreInfo(@RequestBody EmployeeRegistrationPre pre) {
return tEmployeeInsurancePreService.updateInfoSaveInsurancePreInfo(pre);
}
/** /**
* 商险状态是否正常判断 * 商险状态是否正常判断
* @author huych * @author huych
......
...@@ -19,6 +19,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -19,6 +19,8 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.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.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwDetailService;
...@@ -54,6 +56,12 @@ public class TEmployeeInsurancePreQwDetailController { ...@@ -54,6 +56,12 @@ public class TEmployeeInsurancePreQwDetailController {
@Operation(description = "简单分页查询") @Operation(description = "简单分页查询")
@GetMapping("/page") @GetMapping("/page")
public R<IPage<TEmployeeInsurancePreQwDetail>> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail) { public R<IPage<TEmployeeInsurancePreQwDetail>> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail) {
if (tEmployeeInsurancePreQwDetail == null) {
tEmployeeInsurancePreQwDetail = new TEmployeeInsurancePreQwDetail();
}
if (Common.isEmpty(tEmployeeInsurancePreQwDetail.getMainId())) {
tEmployeeInsurancePreQwDetail.setMainId(CommonConstants.ZERO_STRING);
}
return new R<>(tEmployeeInsurancePreQwDetailService.getTEmployeeInsurancePreQwDetailPage(page, tEmployeeInsurancePreQwDetail)); return new R<>(tEmployeeInsurancePreQwDetailService.getTEmployeeInsurancePreQwDetailPage(page, tEmployeeInsurancePreQwDetail));
} }
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,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.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; 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.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
...@@ -59,7 +60,7 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -59,7 +60,7 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
* @param sameFlag 是否要做重复人员明细校验的标识 1 不需要 空需要 * @param sameFlag 是否要做重复人员明细校验的标识 1 不需要 空需要
* @return * @return
*/ */
R batchDispatcherInsurance(List<String> idList,String sameFlag); R batchDispatcherInsurance(List<String> idList,String sameFlag, boolean pushQiWeiFlag);
/** /**
* 新增商险待购买信息 * 新增商险待购买信息
...@@ -68,6 +69,13 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -68,6 +69,13 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
*/ */
Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo preVo); Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo preVo);
/**
* 信息修改入口新增商险待购买信息
* @param pre
* @return
*/
Boolean updateInfoSaveInsurancePreInfo(EmployeeRegistrationPre pre);
Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo); Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo);
TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo); TEmployeeInsuranceSelectVo selectInsurancePreInfoList(TEmployeeInsurancePreVo preVo);
......
...@@ -53,7 +53,7 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -53,7 +53,7 @@ public class ScheduleServiceImpl implements ScheduleService {
transactionTemplate.execute(status -> { transactionTemplate.execute(status -> {
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
idList.add(aId); idList.add(aId);
insurancePreService.batchDispatcherInsurance(idList,CommonConstants.ONE_STRING); insurancePreService.batchDispatcherInsurance(idList,CommonConstants.ONE_STRING, false);
return null; return null;
}); });
} }
......
...@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
...@@ -187,8 +187,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -187,8 +187,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return R.ok(); return R.ok();
} }
// pushQiWeiFlag : 是否推送企微 true:推送(当前仅下午3点与3点20的定时任务,需要推送企微),false:不推送
@Override @Override
public R batchDispatcherInsurance(List<String> idList, String sameFlag) { public R batchDispatcherInsurance(List<String> idList, String sameFlag, boolean pushQiWeiFlag) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query() List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query()
.lambda().in(TEmployeeInsurancePre::getId, idList) .lambda().in(TEmployeeInsurancePre::getId, idList)
.in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus)); .in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus));
...@@ -409,7 +410,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -409,7 +410,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
updateList.add(updatePre); updateList.add(updatePre);
} }
} }
if (!preQwMap.isEmpty()) { if (!updateList.isEmpty()) {
this.updateBatchById(updateList);
}
// pushQiWeiFlag 推送企微的flag,true表示推送企微
if (pushQiWeiFlag && !preQwMap.isEmpty()) {
List<TEmployeeInsurancePreQw> qwList = new ArrayList<>(); List<TEmployeeInsurancePreQw> qwList = new ArrayList<>();
int deptNum; int deptNum;
int allNum; int allNum;
...@@ -419,9 +424,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -419,9 +424,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
for (Map.Entry<String, TEmployeeInsurancePreQw> entry : preQwMap.entrySet()) { for (Map.Entry<String, TEmployeeInsurancePreQw> entry : preQwMap.entrySet()) {
customerUserLoginname = entry.getKey(); customerUserLoginname = entry.getKey();
if (Common.isNotNull(userLoginNames)) { if (Common.isNotNull(userLoginNames)) {
userLoginNames += ","; userLoginNames += "," + customerUserLoginname;
} else {
userLoginNames = customerUserLoginname;
} }
userLoginNames += customerUserLoginname;
qw = entry.getValue(); qw = entry.getValue();
tempSet = deptNumMap.get(customerUserLoginname); tempSet = deptNumMap.get(customerUserLoginname);
if (Common.isNotNull(tempSet)) { if (Common.isNotNull(tempSet)) {
...@@ -438,24 +444,21 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -438,24 +444,21 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
failNum = 0; failNum = 0;
} }
description = new StringBuilder("项目数:").append(deptNum).append("个;自动化派单人数:") description = new StringBuilder("项目数:").append(deptNum).append("个;自动化派单人数:")
.append(allNum).append("个,<span style='color:red'>失败人数:").append(failNum).append("个</span><br>请及时至HRO系统处理,以免人员漏保!"); .append(allNum).append("个,【失败人数:").append(failNum).append("个】<br>请及时至HRO系统处理,以免人员漏保!");
qw.setDescription(description.toString()); qw.setDescription(description.toString());
qwList.add(qw); qwList.add(qw);
} }
if(!qwDetalList.isEmpty()) { if(!qwDetalList.isEmpty() && !qwList.isEmpty()) {
tEmployeeInsurancePreQwDetailService.saveBatch(qwDetalList); tEmployeeInsurancePreQwDetailService.saveBatch(qwDetalList);
}
// TODO-加一个定时任务再推送企微的flag
if (!qwList.isEmpty()) {
tEmployeeInsurancePreQwService.saveBatch(qwList); tEmployeeInsurancePreQwService.saveBatch(qwList);
if (Common.isNotNull(userLoginNames)) { if (Common.isNotNull(userLoginNames)) {
Map<String, String> sysUserMap = getUserQiWeiInfo(userLoginNames); Map<String, String> sysUserMap = getUserQiWeiInfo(userLoginNames);
String qwInfo; String qwInfo;
if (sysUserMap != null) { if (!sysUserMap.isEmpty()) {
for (TEmployeeInsurancePreQw sendQw : qwList) { for (TEmployeeInsurancePreQw sendQw : qwList) {
qwInfo = sysUserMap.get(sendQw.getCustomerUserLoginname()); qwInfo = sysUserMap.get(sendQw.getCustomerUserLoginname());
if (Common.isNotNull(qwInfo)) { if (Common.isNotNull(qwInfo)) {
sendMessageToWx(qwInfo, sendQw.getDescription()); sendMessageToWx(qwInfo, sendQw.getDescription(), sendQw.getId());
} }
} }
} }
...@@ -463,9 +466,6 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -463,9 +466,6 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
} }
} }
if (!updateList.isEmpty()) {
this.updateBatchById(updateList);
}
// 找出 insurancePreList 中在 autoAddParamList 中存在的数据 // 找出 insurancePreList 中在 autoAddParamList 中存在的数据
...@@ -497,7 +497,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -497,7 +497,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
} }
//发送企业微信待办 //发送企业微信待办
private void sendMessageToWx(String useruserWx, String content) { private void sendMessageToWx(String useruserWx, String content, String mainId) {
if (Common.isEmpty(useruserWx) || Common.isEmpty(content)) { if (Common.isEmpty(useruserWx) || Common.isEmpty(content)) {
return; return;
} }
...@@ -509,8 +509,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -509,8 +509,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
textcard.put("title", "<span style='color:red'>商险自动化派单——失败提醒</span>"); textcard.put("title", "【商险自动化派单——失败提醒】");
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "66" )); textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "66"+mainId ));
textcard.put("description", content); textcard.put("description", content);
requestMap.put("touser", sendUser); requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid()); requestMap.put("agentid", wxConfig.getAgentid());
...@@ -531,7 +531,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -531,7 +531,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
* @return: java.util.Map<java.lang.String, java.lang.String> * @return: java.util.Map<java.lang.String, java.lang.String>
**/ **/
private Map<String, String> getUserQiWeiInfo(String userLoginNames) { private Map<String, String> getUserQiWeiInfo(String userLoginNames) {
Map<String, String> sysUserMap = null; Map<String, String> sysUserMap = new HashMap<>();
// 获取项目对应的前端客服用户信息--客服账号需要正常 // 获取项目对应的前端客服用户信息--客服账号需要正常
if (Common.isNotKong(userLoginNames)) { if (Common.isNotKong(userLoginNames)) {
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(userLoginNames); R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(userLoginNames);
...@@ -572,6 +572,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -572,6 +572,10 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
TEmployeeInsurancePre preExit; TEmployeeInsurancePre preExit;
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) { if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
try { try {
//删除已存在的入职确认信息对应的商险明细
preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
.eq(TInsurancePreDetail::getRegisterId, registrationPreVo.getExitInsuranceInfoList()
.get(0).getRegisterId()));
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) { for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
//判断是否存在商险待购买信息 //判断是否存在商险待购买信息
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda() preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
...@@ -620,6 +624,27 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -620,6 +624,27 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return true; return true;
} }
@Override
public Boolean updateInfoSaveInsurancePreInfo(EmployeeRegistrationPre registrationPre) {
if (Common.isNotNull(registrationPre.getInsuranceIsBuy())
&& registrationPre.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !registrationPre.getExitInsuranceInfoList().isEmpty()) {
//删除已存在的入职确认信息对应的商险明细
preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
.eq(TInsurancePreDetail::getRegisterId, registrationPre.getId()));
//批量新增
preDetailService.saveBatch(registrationPre.getExitInsuranceInfoList());
}
//如果商险是否已购买为否,删除商险已购买明细
if (Common.isNotNull(registrationPre.getInsuranceIsBuy())
&& registrationPre.getInsuranceIsBuy().equals(CommonConstants.ONE_STRING)) {
//删除已存在的入职确认信息对应的商险明细
preDetailService.remove(Wrappers.<TInsurancePreDetail>lambdaQuery()
.eq(TInsurancePreDetail::getRegisterId, registrationPre.getId()));
}
return true;
}
@Override @Override
public Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo) { public Boolean checkExitInsuanceIsProcess(EmployeeRegistrationPreVo preVo) {
//如果状态有变动就会拦截 //如果状态有变动就会拦截
...@@ -644,7 +669,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -644,7 +669,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.ONE_INT))); .or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.ONE_INT)));
return count == preVo.getExitInsuranceInfoList().size(); return count == preVo.getExitInsuranceInfoList().size();
} }
return false; return true;
} }
@Override @Override
...@@ -705,7 +730,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -705,7 +730,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING); .set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING);
this.update(updateWrapper); this.update(updateWrapper);
try { try {
this.batchDispatcherInsurance(unConfirmList,CommonConstants.ONE_STRING); this.batchDispatcherInsurance(unConfirmList,CommonConstants.ONE_STRING, true);
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
} }
...@@ -768,6 +793,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -768,6 +793,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setInsurancePreId(addParam.getInsurancePreId()); autoParam.setInsurancePreId(addParam.getInsurancePreId());
autoParam.setCustomerUserName(addParam.getCustomerUserName()); autoParam.setCustomerUserName(addParam.getCustomerUserName());
autoParam.setIsExit(addParam.getIsExit()); autoParam.setIsExit(addParam.getIsExit());
autoParam.setDeptName(addParam.getDeptName());
autoParam.setBuyType(addParam.getBuyType());
autoParam.setInProgressList(addParam.getInProgressList()); autoParam.setInProgressList(addParam.getInProgressList());
return autoParam; return autoParam;
} }
...@@ -791,7 +818,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -791,7 +818,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setInsurancePreId(batchParam.getInsurancePreId()); autoParam.setInsurancePreId(batchParam.getInsurancePreId());
autoParam.setCustomerUserName(batchParam.getCustomerUserName()); autoParam.setCustomerUserName(batchParam.getCustomerUserName());
autoParam.setIsExit(batchParam.getIsExit()); autoParam.setIsExit(batchParam.getIsExit());
autoParam.setDeptName(batchParam.getDeptName());
autoParam.setBuyType(batchParam.getBuyType());
autoParam.setInProgressList(batchParam.getInProgressList()); autoParam.setInProgressList(batchParam.getInProgressList());
autoParam.setPolicyEnd(LocalDateUtil.getDateSrt(batchParam.getPolicyEnd()));
autoParam.setPolicyStart(LocalDateUtil.getDateSrt(batchParam.getPolicyStart()));
return autoParam; return autoParam;
} }
...@@ -814,6 +845,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -814,6 +845,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setInsurancePreId(replaceParam.getInsurancePreId()); autoParam.setInsurancePreId(replaceParam.getInsurancePreId());
autoParam.setCustomerUserName(replaceParam.getCustomerUserName()); autoParam.setCustomerUserName(replaceParam.getCustomerUserName());
autoParam.setIsExit(replaceParam.getIsExit()); autoParam.setIsExit(replaceParam.getIsExit());
autoParam.setDeptName(replaceParam.getDeptName());
autoParam.setBuyType(replaceParam.getBuyType());
autoParam.setInProgressList(replaceParam.getInProgressList()); autoParam.setInProgressList(replaceParam.getInProgressList());
return autoParam; return autoParam;
} }
...@@ -867,6 +900,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -867,6 +900,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
public EmployeePreLogListVo getListByEmpPreId(String empPreId) { public EmployeePreLogListVo getListByEmpPreId(String empPreId) {
EmployeePreLogListVo vo = new EmployeePreLogListVo(); EmployeePreLogListVo vo = new EmployeePreLogListVo();
List<TEmployeeInsurancePre> preList = baseMapper.getListByEmpPreId(empPreId); List<TEmployeeInsurancePre> preList = baseMapper.getListByEmpPreId(empPreId);
if (Common.isNotNull(preList) && !preList.isEmpty()) {
preList.forEach(e->e.setErrorTime(null));
}
vo.setPreList(preList); vo.setPreList(preList);
return vo; return vo;
} }
...@@ -901,6 +937,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -901,6 +937,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
EmployeePreInsuranceListVo vo = new EmployeePreInsuranceListVo(); EmployeePreInsuranceListVo vo = new EmployeePreInsuranceListVo();
List<TInsurancePreDetail> preList = preDetailService.list(Wrappers.<TInsurancePreDetail>query().lambda() List<TInsurancePreDetail> preList = preDetailService.list(Wrappers.<TInsurancePreDetail>query().lambda()
.eq(TInsurancePreDetail::getRegisterId, empPreId)); .eq(TInsurancePreDetail::getRegisterId, empPreId));
if (Common.isNotNull(preList) && !preList.isEmpty()) {
preList.forEach(e -> {
e.setDisTime(DateUtil.convertToDateByLocalDateTime(e.getCreateTime()));
e.setCreateTime(null);
e.setUpdateTime(null);
});
}
vo.setPreList(preList); vo.setPreList(preList);
return vo; return vo;
} }
......
...@@ -2704,6 +2704,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2704,6 +2704,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
outer: outer:
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceAddParam param = distinctList.get(i); InsuranceAddParam param = distinctList.get(i);
param.setBuyType(CommonConstants.ONE_INT);
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getEmpName())) { if (StringUtils.isBlank(param.getEmpName())) {
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
...@@ -2725,6 +2726,83 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2725,6 +2726,83 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
//根据项目编码查询项目是否存在
try {
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
} else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
} else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())) {
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())) {
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)) {
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
} else {
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setSettleType(Integer.parseInt(settleType));
}
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptId(projectSetInfoVo.getId());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
} catch (Exception e) {
log.error(InsurancesConstants.GET_DEPT_DETAIL_ERROR + e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
//1.9.11超管无需校验项目权限
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
if (CollectionUtils.isEmpty(deptNoList)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
}
if (StringUtils.isBlank(param.getInsuranceCompanyName())) { if (StringUtils.isBlank(param.getInsuranceCompanyName())) {
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -2846,83 +2924,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2846,83 +2924,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
//根据项目编码查询项目是否存在
try {
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
} else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
} else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())) {
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())) {
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)) {
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
} else {
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setSettleType(Integer.parseInt(settleType));
}
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptId(projectSetInfoVo.getId());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
} catch (Exception e) {
log.error(InsurancesConstants.GET_DEPT_DETAIL_ERROR + e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
//1.9.11超管无需校验项目权限
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
if (CollectionUtils.isEmpty(deptNoList)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
}
//省市区域校验是否正确并设置对应id //省市区域校验是否正确并设置对应id
String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName()); String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName());
if (Common.isEmpty(redisProvinceName)) { if (Common.isEmpty(redisProvinceName)) {
...@@ -3109,12 +3110,88 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3109,12 +3110,88 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
outer: outer:
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceBatchParam param = distinctList.get(i); InsuranceBatchParam param = distinctList.get(i);
param.setBuyType(CommonConstants.THREE_INT);
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getDeptNo())){ if (StringUtils.isBlank(param.getDeptNo())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_EMPTY);
listResult.add(param); listResult.add(param);
continue; continue;
} }
//根据项目编码查询项目是否存在
try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
}
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptId(projectSetInfoVo.getId());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
}catch (Exception e){
log.error("查询项目信息出错:"+e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
//1.9.11超管无需校验项目权限
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
if (CollectionUtils.isEmpty(deptNoList)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
}
if (StringUtils.isBlank(param.getEmpName())){ if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -3177,6 +3254,50 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3177,6 +3254,50 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
} }
//非自动化派单才需要进行这些校验
if (Common.isEmpty(param.getPolicyStart()) && Common.isEmpty(param.getPolicyEnd())) {
//保单开始日期、结束日期,根据保单号到t_insurance_policy表查询的 1128需求调整改造
TInsurancePolicy limitOne = tInsurancePolicyService.getOne(Wrappers.<TInsurancePolicy>query().lambda()
.eq(TInsurancePolicy::getPolicyNo, param.getPolicyNo())
.eq(TInsurancePolicy::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (!Optional.ofNullable(limitOne).isPresent()) {
param.setErrorMessage(InsurancesConstants.POLICY_NO_EXIST);
listResult.add(param);
continue;
} else {
//自动化派单的取自动化派单的起止日期
if (Common.isEmpty(param.getPolicyStart()) && Common.isEmpty(param.getPolicyEnd())) {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
if (limitOne.getEnableFlag() == CommonConstants.ONE_INT) {
param.setErrorMessage(InsurancesConstants.POLICY_NO_FORBIDDEN);
listResult.add(param);
continue;
}
if (!limitOne.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())) {
param.setErrorMessage(InsurancesConstants.POLICY_NO_COMPANY_NAME_NOT_SAME);
listResult.add(param);
continue;
}
if (!limitOne.getInsuranceTypeName().equals(param.getInsuranceTypeName())) {
param.setErrorMessage(InsurancesConstants.POLICY_NO_TYPE_NAME_NOT_SAME);
listResult.add(param);
continue;
}
if (!LocalDateUtil.isFutureDate(limitOne.getPolicyEnd().toString())) {
param.setErrorMessage(InsurancesConstants.POLICY_END_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
}
if (!LocalDateUtil.compareDate(limitOne.getPolicyStart().toString(), limitOne.getPolicyEnd().toString())) {
param.setErrorMessage(InsurancesConstants.POLICY_START_SHOULD_LESS_THAN_POLICY_END);
listResult.add(param);
continue;
}
}
}
// 身份证号位数校验(18 位合法) // 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){ if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE); param.setErrorMessage(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
...@@ -3213,82 +3334,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3213,82 +3334,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
} }
//根据项目编码查询项目是否存在
try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
}
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptId(projectSetInfoVo.getId());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
}catch (Exception e){
log.error("查询项目信息出错:"+e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
//校验当前项目是否在权限范围内
//1.9.11超管无需校验项目权限
if (Common.isNotNull(user) && !CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
if (CollectionUtils.isEmpty(deptNoList)) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
if (!deptNoList.stream().anyMatch(u -> u.equals(param.getDeptNo()))) {
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
listResult.add(param);
continue;
}
}
//省市区域校验是否正确并设置对应id //省市区域校验是否正确并设置对应id
String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName()); String redisProvinceName = getRedisAreaValue(param.getInsuranceProvinceName());
if (Common.isEmpty(redisProvinceName)){ if (Common.isEmpty(redisProvinceName)){
...@@ -3306,47 +3351,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3306,47 +3351,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
param.setInsuranceCity(Integer.parseInt(redisCityName)); param.setInsuranceCity(Integer.parseInt(redisCityName));
} }
//保单开始日期、结束日期,根据保单号到t_insurance_policy表查询的 1128需求调整改造
TInsurancePolicy limitOne = tInsurancePolicyService.getOne(Wrappers.<TInsurancePolicy>query().lambda()
.eq(TInsurancePolicy::getPolicyNo, param.getPolicyNo())
.eq(TInsurancePolicy::getDeleteFlag,CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (!Optional.ofNullable(limitOne).isPresent()){
param.setErrorMessage(InsurancesConstants.POLICY_NO_EXIST);
listResult.add(param);
continue;
}else {
if(limitOne.getEnableFlag() == CommonConstants.ONE_INT){
param.setErrorMessage(InsurancesConstants.POLICY_NO_FORBIDDEN);
listResult.add(param);
continue;
}
if(!limitOne.getInsuranceCompanyName().equals(param.getInsuranceCompanyName())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_COMPANY_NAME_NOT_SAME);
listResult.add(param);
continue;
}
if (!limitOne.getInsuranceTypeName().equals(param.getInsuranceTypeName())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_TYPE_NAME_NOT_SAME);
listResult.add(param);
continue;
}
if(!LocalDateUtil.isFutureDate(limitOne.getPolicyEnd().toString())){
param.setErrorMessage(InsurancesConstants.POLICY_END_SHOULD_IS_FUTURE);
listResult.add(param);
continue;
}
if (!LocalDateUtil.compareDate(limitOne.getPolicyStart().toString(),limitOne.getPolicyEnd().toString())){
param.setErrorMessage(InsurancesConstants.POLICY_START_SHOULD_LESS_THAN_POLICY_END);
listResult.add(param);
continue;
}
//自动化派单的取自动化派单的起止日期
if (Common.isEmpty(param.getPolicyStart()) && Common.isEmpty(param.getPolicyEnd())) {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
}
// 保险公司-险种-购买标准 是否存在 // 保险公司-险种-购买标准 是否存在
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda() TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
...@@ -3517,6 +3521,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3517,6 +3521,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
outer: outer:
for (int i = 0; i < distinctList.size(); i++) { for (int i = 0; i < distinctList.size(); i++) {
InsuranceReplaceParam param = distinctList.get(i); InsuranceReplaceParam param = distinctList.get(i);
param.setBuyType(CommonConstants.FOUR_INT);
// 必填校验 // 必填校验
if (StringUtils.isBlank(param.getEmpName())){ if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
...@@ -3533,6 +3538,68 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3533,6 +3538,68 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
//根据项目编码查询项目是否存在
try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getReplaceDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getReplaceDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的替换员工项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_REPALCE_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.REPLACE_PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
param.setDeptId(projectSetInfoVo.getId());
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
}
}catch (Exception e){
log.error("查询项目信息出错:"+e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
if (StringUtils.isBlank(param.getInsuranceCompanyName())){ if (StringUtils.isBlank(param.getInsuranceCompanyName())){
param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY); param.setErrorMessage(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EMPTY);
listResult.add(param); listResult.add(param);
...@@ -3682,68 +3749,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3682,68 +3749,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
//根据项目编码查询项目是否存在
try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getReplaceDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getReplaceDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
// MVP1.7.11:校验户是否在服务项里
// 获取项目的服务项
if (Common.isEmpty(projectSetInfoVo.getServerItem())){
param.setErrorMessage("项目未维护服务项目,请联系管理员");
listResult.add(param);
continue;
}
String[] serverItemArr = projectSetInfoVo.getServerItem().split("、");
// 服务项校验
if (!ArrayUtils.contains(serverItemArr, "商险")) {
param.setErrorMessage("该项目未勾选 商险 服务项,请至EKP系统-项目查询与变更处勾选后,再次尝试");
listResult.add(param);
continue;
}
//对应的替换员工项目编码已停止合作
if (CommonConstants.ONE_STRING.equals(projectSetInfoVo.getStopFlag()) ||
CommonConstants.TWO_STRING.equals(projectSetInfoVo.getStopFlag())){
param.setErrorMessage(InsurancesConstants.EMP_DISPATCH_REPALCE_SETTLEDOMAIN_STOP);
listResult.add(param);
continue;
}
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.REPLACE_PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
param.setSettleType(Integer.parseInt(settleType));
param.setDeptId(projectSetInfoVo.getId());
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
}
}catch (Exception e){
log.error("查询项目信息出错:"+e);
param.setErrorMessage(InsurancesConstants.GET_DEPT_DETAIL_ERROR);
listResult.add(param);
continue;
}
//原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准 + 有效 //原数据查重校验:姓名 + 身份证号 + 项目编码 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准 + 有效
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName()) .eq(TInsuranceDetail::getEmpName, param.getEmpName())
......
...@@ -40,6 +40,7 @@ security: ...@@ -40,6 +40,7 @@ security:
- /actuator/** - /actuator/**
- /swagger-ui/** - /swagger-ui/**
- /insuranceDetail/urgentUpdateIsUse - /insuranceDetail/urgentUpdateIsUse
- /temployeeinsurancepreqwdetail/page
# 文件上传相关 支持阿里云、华为云、腾讯、minio # 文件上传相关 支持阿里云、华为云、腾讯、minio
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="registTime" column="regist_time"/> <result property="registTime" column="regist_time"/>
<result property="registUser" column="regist_user"/> <result property="registUser" column="regist_user"/>
<result property="errorInfo" column="error_info"/>
<result property="errorTime" column="error_time"/>
</resultMap> </resultMap>
<resultMap id="tEmployeeInsurancePreExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreExportVo"> <resultMap id="tEmployeeInsurancePreExportMap" type="com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreExportVo">
...@@ -101,7 +103,7 @@ ...@@ -101,7 +103,7 @@
a.create_name, a.create_name,
a.create_time, a.create_time,
a.update_by, a.update_by,
a.update_time,a.policy_no,a.config_name,a.policy_effect,a.insurances_id,a.regist_time,a.regist_user,a.config_id a.update_time,a.policy_no,a.config_name,a.policy_effect,a.insurances_id,a.regist_time,a.regist_user,a.config_id,a.error_info,a.error_time
</sql> </sql>
<sql id="tEmployeeInsurancePre_where"> <sql id="tEmployeeInsurancePre_where">
<if test="tEmployeeInsurancePre != null"> <if test="tEmployeeInsurancePre != null">
......
...@@ -75,5 +75,6 @@ ...@@ -75,5 +75,6 @@
1=1 1=1
<include refid="tEmployeeInsurancePreQwDetail_where"/> <include refid="tEmployeeInsurancePreQwDetail_where"/>
</where> </where>
order by a.id
</select> </select>
</mapper> </mapper>
...@@ -614,7 +614,9 @@ ...@@ -614,7 +614,9 @@
a.CREATE_NAME as createName, a.CREATE_NAME as createName,
a.UNIT_NAME as unitName, a.UNIT_NAME as unitName,
a.UNIT_NO as unitNo, a.UNIT_NO as unitNo,
a.IS_ADRESS as isAdress a.IS_ADRESS as isAdress,
a.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
a.INSURANCE_CITY_NAME as insuranceCityName
from from
t_insurance_detail a t_insurance_detail a
where where
......
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