Commit 583dccca authored by huyuchen's avatar huyuchen

huych-商险自动化逻辑调整

parent 553d9477
......@@ -573,6 +573,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
&& !employeeRegistrationPre.getExitInsuranceInfoList().isEmpty()) {
//判断带出的流程中或者已完结的商险数据是否准确
//商险是否存在判断
employeeRegistrationPre.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
boolean isTrue = checkInsuranceIsProcess(employeeRegistrationPre);
if (isTrue) {
return R.failed("带出的商险已购买数据状态或条数发生变更,请重新确认!");
......@@ -1425,36 +1426,34 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
EmployeeRegistrationPre pre = this.getById(id);
if (pre != null) {
//判断合同是否已签订 是的话展示商险明细 否的话查询商险待购买数据
if (CommonConstants.ZERO_STRING.equals(pre.getInsuranceIsBuy())) {
// 查已购买商险明细
R<EmployeePreInsuranceListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getExitInsuranceListByEmpPreId", id
, EmployeePreInsuranceListVo.class, SecurityConstants.FROM_IN);
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
!sdr.getData().getPreList().isEmpty()) {
pre.setExitInsuranceInfoList(sdr.getData().getPreList());
}
} else {
// 查原商险
R<EmployeePreLogListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class
, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList;
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
!sdr.getData().getPreList().isEmpty()) {
oldList = sdr.getData().getPreList();
for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
}
// 查已购买商险明细
R<EmployeePreInsuranceListVo> sdr = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getExitInsuranceListByEmpPreId", id
, EmployeePreInsuranceListVo.class, SecurityConstants.FROM_IN);
if (sdr != null && sdr.getData() != null && sdr.getData().getPreList() != null &&
!sdr.getData().getPreList().isEmpty()) {
pre.setExitInsuranceInfoList(sdr.getData().getPreList());
}
// 查原商险
R<EmployeePreLogListVo> sdrOld = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl()
, daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/getListByEmpPreId", id, EmployeePreLogListVo.class
, SecurityConstants.FROM_IN);
List<TEmployeeInsurancePre> oldList;
if (sdrOld != null && sdrOld.getData() != null && sdrOld.getData().getPreList() != null &&
!sdrOld.getData().getPreList().isEmpty()) {
oldList = sdrOld.getData().getPreList();
for (TEmployeeInsurancePre oldInsurance : oldList) {
if (Common.isNotNull(oldInsurance.getProcessStatus())
&& (CommonConstants.THREE_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.FOUR_STRING.equals(oldInsurance.getProcessStatus())
|| CommonConstants.SIX_STRING.equals(oldInsurance.getProcessStatus()))) {
oldInsurance.setModelType(CommonConstants.FOUR_STRING);
}
pre.setInsurancePreList(oldList);
}
pre.setInsurancePreList(oldList);
}
//获取合同待签订数据
TEmployeeContractPre contract = contractPreMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
......
......@@ -209,12 +209,18 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
newInfo.setAttaIdList(null);
oldInfo.setAttaList(null);
newInfo.setAttaList(null);
//商险是否已购买list不做比较
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
//比较记录不影响业务逻辑,用try套住
//记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy();
oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy());
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
List<TEmployeeInsurancePre> newList = newInfo.getInsurancePreList();
String diffTitle = null;
String logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
// 要保存的明细
......@@ -225,7 +231,6 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("exitInsuranceInfoList","");
diffTitle = "档案信息";
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
......@@ -244,12 +249,25 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
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);
}
for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null;
if (Common.isNotNull(newInsurance.getModelType())) {
// 1:新增
if (CommonConstants.ONE_STRING.equals(newInsurance.getModelType())) {
saveOrUpdateList.add(newInsurance);
detailInsuranceLog = new TEmployeePreLogDetail();
detailInsuranceLog.setModelType(newInsurance.getModelType());
......@@ -403,6 +421,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
newInfo.setAttaIdList(null);
oldInfo.setAttaList(null);
newInfo.setAttaList(null);
//记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy();
//商险是否已购买list不做比较
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy());
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
......@@ -419,7 +443,6 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("exitInsuranceInfoList","");
diffTitle = "档案信息二次确认";
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
......@@ -433,6 +456,20 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
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.setPreLogBaseInfo(empPreId, old, simNew, userId, nickName, differenceInsuranceKey, logId, detailInsuranceLog);
isModifyInsurance = true;
detailList.add(detailInsuranceLog);
}
for (TEmployeeInsurancePre newInsurance : newList) {
differenceInsuranceKey = null;
if (CommonConstants.THREE_STRING.equals(newInsurance.getModelType())) {
......
......@@ -626,6 +626,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
//判断带出的流程中或者已完结的商险数据是否准确
//商险是否存在判断
preVo.setEmpIdcard(registration.getEmpIdcard());
preVo.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
boolean isTrue = checkInsuranceIsProcess(preVo);
if (isTrue) {
return R.other(CommonConstants.TWO_INT,null,"带出的商险已购买数据状态或条数发生变更,请重新确认接收!");
......@@ -1121,6 +1123,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (preVo.getServerItem().contains("商险") && Common.isNotNull(preVo.getInsuranceIsBuy())
&& preVo.getInsuranceIsBuy().equals(CommonConstants.ZERO_STRING)
&& !preVo.getExitInsuranceInfoList().isEmpty()) {
preVo.getExitInsuranceInfoList().forEach(e -> e.setCreateTime(null));
preVo.getExitInsuranceInfoList().forEach(insurancePreVo -> insurancePreVo.setRegisterId(domainR.getData()));
//生成入职确认信息商险明细数据
insuranceDaprUtil.saveInsurancePreInfo(preVo);
......
......@@ -2,8 +2,10 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -96,6 +98,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单开始时间", isDate = true)
@ExcelProperty("保单开始时间")
@Schema(description = "保单开始时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyStart;
/**
* 保单结束时间
......@@ -103,6 +106,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单结束时间", isDate = true)
@ExcelProperty("保单结束时间")
@Schema(description = "保单结束时间")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyEnd;
/**
* 保单生效日期
......@@ -110,6 +114,7 @@ public class TInsurancePreDetail extends BaseEntity {
@ExcelAttribute(name = "保单生效日期", isDate = true)
@ExcelProperty("保单生效日期")
@Schema(description = "保单生效日期")
@JsonFormat(shape= JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
private Date policyEffect;
/**
* 投保类型, 1新增、3批增、4替换
......@@ -166,4 +171,25 @@ public class TInsurancePreDetail extends BaseEntity {
@Schema(description = "入离职登记id")
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;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -18,6 +16,6 @@ import java.util.List;
@Schema(description = "商险自动化已购买商险明细VO")
public class EmployeePreInsuranceListVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
private List<TInsurancePreDetail> preList = new ArrayList<>();
private List<TInsurancePreDetail> preList;
}
......@@ -159,8 +159,8 @@ public class TEmployeeInsurancePreController {
**/
@Operation(description = "商险派单信息单个/批量派单")
@PostMapping("/batchDispatcherInsurance")
public R batchDispatcherInsurance(@RequestBody List<String> idList) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, null, false);
public R batchDispatcherInsurance(@RequestBody List<String> idList,@RequestParam(required = false) String isExit) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, isExit, false);
}
/**
......
......@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
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.common.core.constant.ClientNameConstants;
......@@ -644,7 +643,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.or().eq(TInsuranceDetail::getBuyHandleStatus, CommonConstants.ONE_INT)));
return count == preVo.getExitInsuranceInfoList().size();
}
return false;
return true;
}
@Override
......@@ -901,6 +900,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
EmployeePreInsuranceListVo vo = new EmployeePreInsuranceListVo();
List<TInsurancePreDetail> preList = preDetailService.list(Wrappers.<TInsurancePreDetail>query().lambda()
.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);
return vo;
}
......
......@@ -614,7 +614,9 @@
a.CREATE_NAME as createName,
a.UNIT_NAME as unitName,
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
t_insurance_detail a
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