Commit d4ac2931 authored by huyuchen's avatar huyuchen

huych-社保自动化相关提价

parent b5d6e282
...@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TDispatchInfoPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSocialPreDetailVo;
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 com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
...@@ -104,6 +106,9 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -104,6 +106,9 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "商险是否已购买 0 是 1 否") @Schema(description = "商险是否已购买 0 是 1 否")
private String insuranceIsBuy; private String insuranceIsBuy;
@Schema(description = "商险是否已购买 0 是 1 否")
private String socialIsBuy;
@Schema(description = "档案所在地-县编号") @Schema(description = "档案所在地-县编号")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private String townCode; private String townCode;
...@@ -134,6 +139,14 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -134,6 +139,14 @@ public class EmployeeRegistrationPre extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private List<TInsurancePreDetail> exitInsuranceInfoList; private List<TInsurancePreDetail> exitInsuranceInfoList;
@Schema(description = "社保待购买信息")
@TableField(exist = false)
private TDispatchInfoPreVo dispatchInfoPreVo;
@Schema(description = "社保流程中信息集合")
@TableField(exist = false)
private List<TSocialPreDetailVo> exitSocialInfoList;
@Schema(description = "附件集合") @Schema(description = "附件集合")
@TableField(exist = false) @TableField(exist = false)
private List<TAttaInfo> attaList; private List<TAttaInfo> attaList;
......
...@@ -52,10 +52,10 @@ public class TEmployeePreLogDetail extends BaseEntity { ...@@ -52,10 +52,10 @@ public class TEmployeePreLogDetail extends BaseEntity {
/** /**
* 类型:1档案;2商险 * 类型:1档案;2商险
*/ */
@ExcelAttribute(name = "类型:1档案;2商险3合同", maxLength = 1) @ExcelAttribute(name = "类型:1档案;2商险3合同4社保", maxLength = 1)
@Length(max = 1, message = "类型:1档案;2商险3合同不能超过1个字符") @Length(max = 1, message = "类型:1档案;2商险3合同4社保不能超过1个字符")
@ExcelProperty("类型:1档案;2商险3合同") @ExcelProperty("类型:1档案;2商险3合同4社保")
@Schema(description = "类型:1档案;2商险 3合同") @Schema(description = "类型:1档案;2商险 3合同 4社保")
private String type; private String type;
/** /**
* 入职确认信息表ID * 入职确认信息表ID
......
package com.yifu.cloud.plus.v1.yifu.archives.vo;
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.List;
/**
* @author huych
* @description 社保自动化自动化社保明细VO
* @date 2025-10-10 15:44:26
*/
@Data
@Schema(description = "社保自动化自动化社保明细VO")
public class EmployeePreSocialListVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
@Schema(description = "社保待购买信息")
private TDispatchInfoPreVo dispatchInfoPreVo;
@Schema(description = "社保流程中信息集合")
private List<TSocialPreDetailVo> exitSocialInfoList;
}
...@@ -138,6 +138,11 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -138,6 +138,11 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "0社保1公积金") @Schema(description = "0社保1公积金")
@ExcelProperty("0社保1公积金") @ExcelProperty("0社保1公积金")
private String typeSub; private String typeSub;
/**
* 接收方式
*/
@Schema(description = "接收方式 0项目配置 1自定义")
private String receiveType;
/** /**
* 备案基数 * 备案基数
*/ */
...@@ -180,6 +185,11 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -180,6 +185,11 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "预计派单时间") @Schema(description = "预计派单时间")
@ExcelProperty("预计派单时间") @ExcelProperty("预计派单时间")
private Date expectedCollectionTime; private Date expectedCollectionTime;
/**
* 预计派单时间
*/
@Schema(description = "预计派单类型 入职日期当天 0 入职一个月 1 ...")
private String expectedCollectionType;
/** /**
* 派单确认时间 * 派单确认时间
*/ */
...@@ -208,6 +218,13 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -208,6 +218,13 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "配置名称") @Schema(description = "配置名称")
@ExcelProperty("配置名称") @ExcelProperty("配置名称")
private String configName; private String configName;
/**
* 配置id
*/
@ExcelAttribute(name = "配置id")
@Schema(description = "配置id")
@ExcelProperty("配置id")
private String configId;
/** /**
* 入职确认信息主表id * 入职确认信息主表id
*/ */
...@@ -215,6 +232,13 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable { ...@@ -215,6 +232,13 @@ public class TDispatchInfoPreVo extends RowIndex implements Serializable {
@Schema(description = "入职确认信息主表id") @Schema(description = "入职确认信息主表id")
@ExcelProperty("入职确认信息主表id") @ExcelProperty("入职确认信息主表id")
private String registerId; private String registerId;
/**
* 起缴日期
*/
@ExcelAttribute(name = "起缴日期", isDate = true)
@Schema(description = "起缴日期")
@ExcelProperty("起缴日期")
private Date socialStartDate;
/** /**
* 养老起缴日期 * 养老起缴日期
*/ */
......
...@@ -26,10 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil; ...@@ -26,10 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.alisms.YiFuSmsUtil;
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.common.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
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.TInsuranceDetail;
...@@ -74,6 +71,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -74,6 +71,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Autowired @Autowired
private CspDaprUtils cspDaprUtils; private CspDaprUtils cspDaprUtils;
@Autowired
private SocialDaprUtils socialDaprUtils;
@Autowired @Autowired
private OSSUtil ossUtil; private OSSUtil ossUtil;
...@@ -762,6 +762,41 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -762,6 +762,41 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
//1.9.16社保自动化校验逻辑
if (employeeRegistrationPre.getServerItem().contains("社保购买")) {
//根据身份证号码和项目编号查询合同
TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo();
cardVo.setEmpIdcard(employeeRegistrationPre.getEmpIdcard());
R<Boolean> socialFlag = socialDaprUtils.selectExitEmpSocial(cardVo);
//是否已签署为是需要判断合同是否在用或者流程中
if (CommonConstants.ZERO_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) &&
(Common.isEmpty(socialFlag) || Boolean.TRUE.equals(!socialFlag.getData()))) {
return R.other(CommonConstants.TWO_INT,null,"未找到流程中或者在用的社保信息!");
}
//是否已签署为否需要判断是否在用或者流程中的合同
if (CommonConstants.ONE_STRING.equals(employeeRegistrationPre.getSocialIsBuy()) &&
Common.isNotNull(socialFlag) && Boolean.TRUE.equals(socialFlag.getData()) &&
null != employeeRegistrationPre.getDispatchInfoPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) {
return R.other(CommonConstants.TWO_INT,null,"该人员存在在途/有效的社保数据,请将“是否已参保”调整为“是”");
}
//流程中的社保数据不能修改
//查已购买社保明细
if (null != employeeRegistrationPre.getDispatchInfoPreVo() &&
Common.isEmpty(employeeRegistrationPre.getDispatchInfoPreVo().getId())) {
R<EmployeePreSocialListVo> socialSdr = socialDaprUtils.getSocialPreInfoStatus(id);
if (socialSdr != null && socialSdr.getData() != null
&& null != socialSdr.getData().getDispatchInfoPreVo()
&& (socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.THREE_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.FIVE_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SIX_STRING)||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.SEVEN_STRING) ||
socialSdr.getData().getDispatchInfoPreVo().getProcessStatus().equals(CommonConstants.NINE_STRING))) {
return R.failed("流程中的社保待购买数据不可修改!");
}
}
}
//操作记录中字典值的转化 //操作记录中字典值的转化
String natureItemBefore = null; String natureItemBefore = null;
String natureItemAfter = null; String natureItemAfter = null;
...@@ -1487,6 +1522,15 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -1487,6 +1522,15 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
pre.setAttaList(attaInfo); pre.setAttaList(attaInfo);
} }
// 查已购买社保明细
R<EmployeePreSocialListVo> socialSdr = socialDaprUtils.getSocialPreInfoList(id);
if (socialSdr != null && socialSdr.getData() != null) {
if (null != socialSdr.getData().getExitSocialInfoList()) {
pre.setExitSocialInfoList(socialSdr.getData().getExitSocialInfoList());
} else if (null != socialSdr.getData().getDispatchInfoPreVo()) {
pre.setDispatchInfoPreVo(socialSdr.getData().getDispatchInfoPreVo());
}
}
} }
return pre; return pre;
} }
......
...@@ -577,6 +577,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -577,6 +577,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
baseMapper.updateById(tEmployeeContractInfo); baseMapper.updateById(tEmployeeContractInfo);
} }
// 不是待提交,记录审核记录 // 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo); this.setAuditInfo(tEmployeeContractInfo);
......
...@@ -31,21 +31,23 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService; ...@@ -31,21 +31,23 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator; import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
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.common.dapr.config.DaprInsurancesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
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 lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -73,6 +75,9 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -73,6 +75,9 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
@Lazy @Lazy
private final TAttaInfoService attaInfoService; private final TAttaInfoService attaInfoService;
@Autowired
private SocialDaprUtils socialDaprUtils;
/** /**
* 入职确认信息变更日志表简单分页查询 * 入职确认信息变更日志表简单分页查询
* *
...@@ -213,6 +218,13 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -213,6 +218,13 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList()); oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
//比较记录不影响业务逻辑,用try套住 //比较记录不影响业务逻辑,用try套住
//记录社保是否已购买日志
String isSocailBuyOld = oldInfo.getSocialIsBuy();
String isSocailBuyNew = newInfo.getSocialIsBuy();
//社保是否已购买list不做比较
oldInfo.setExitSocialInfoList(newInfo.getExitSocialInfoList());
oldInfo.setSocialIsBuy(newInfo.getSocialIsBuy());
//记录商险是否已购买日志 //记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy(); String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy(); String isBuyNew = newInfo.getInsuranceIsBuy();
...@@ -228,9 +240,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -228,9 +240,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
// 档案信息修改 // 档案信息修改
TEmployeePreLogDetail detailEmpLog = null; TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey) if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) { && !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)
&& !"dispatchInfoPreVo".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList",""); differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre",""); differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("dispatchInfoPreVo","");
diffTitle = "档案信息"; diffTitle = "档案信息";
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING); detailEmpLog.setModelType(CommonConstants.TWO_STRING);
...@@ -394,6 +408,63 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -394,6 +408,63 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
detailList.add(detailEmpLog); detailList.add(detailEmpLog);
} }
} }
String differenceSocialKey;
if (newInfo.getServerItem().contains("社保") && (Common.isEmpty(isSocailBuyOld) ||
(Common.isNotNull(isSocailBuyOld) && !isSocailBuyOld.equals(isSocailBuyNew)))) {
//单独记录是否已购买社保的变更记录
differenceSocialKey = "socialIsBuy";
TEmployeePreLogDetail detailSocialLog = new TEmployeePreLogDetail();
detailSocialLog.setModelType(CommonConstants.TWO_STRING);
detailSocialLog.setType(CommonConstants.FOUR_STRING);
Map<String,Object> old = new HashMap<>();
old.put("socialIsBuy", isSocailBuyOld);
Map<String,Object> simNew = new HashMap<>();
simNew.put("socialIsBuy", isSocailBuyNew);
this.setLogBaseInfo(empPreId, old, simNew, user, differenceSocialKey, logId, detailSocialLog);
detailList.add(detailSocialLog);
}
//查询老的社保明细
R<EmployeePreSocialListVo> socialSdr = socialDaprUtils.getSocialPreInfoList(empPreId);
TDispatchInfoPreVo dispatchInfoPreOldVo = null;
if (socialSdr != null && socialSdr.getData() != null && null != socialSdr.getData().getDispatchInfoPreVo()) {
dispatchInfoPreOldVo = socialSdr.getData().getDispatchInfoPreVo();
}
TDispatchInfoPreVo dispatchInfoPreVo = newInfo.getDispatchInfoPreVo();
if (!newInfo.getServerItem().contains("社保") && oldInfo.getServerItem().contains("社保")
&& Common.isNotNull(dispatchInfoPreOldVo)) {
//记录操作记录
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.THREE_STRING);
detailEmpLog.setType(CommonConstants.FOUR_STRING);
this.setLogBaseInfo(empPreId, dispatchInfoPreOldVo, null, user, null
, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息";
} else {
diffTitle = "社保信息";
}
}
if (newInfo.getServerItem().contains("社保") && dispatchInfoPreOldVo != null && dispatchInfoPreVo != null) {
differenceSocialKey = HrEquator.comparisonValueIgnoreField(dispatchInfoPreOldVo
, dispatchInfoPreVo, CONTRACT_IGNORE_FIELD);
if (differenceSocialKey.length() > 0) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息";
} else {
diffTitle = "社保信息";
}
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
detailEmpLog.setType(CommonConstants.FOUR_STRING);
this.setLogBaseInfo(empPreId, dispatchInfoPreOldVo, dispatchInfoPreVo, user,
differenceSocialKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
}
// 有修改,则加日志 // 有修改,则加日志
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
TEmployeePreLog empPreLog = new TEmployeePreLog(); TEmployeePreLog empPreLog = new TEmployeePreLog();
...@@ -422,6 +493,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -422,6 +493,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
contractPreService.saveContractPreInfo(preVo); contractPreService.saveContractPreInfo(preVo);
} }
//社保待购买数据处理
if (newInfo.getServerItem().contains("社保")) {
EmployeeRegistrationPreVo preVo = new EmployeeRegistrationPreVo();
BeanUtils.copyProperties(newInfo,preVo);
socialDaprUtils.saveSocialPreInfo(preVo);
}
if (!saveOrUpdateList.isEmpty()) { if (!saveOrUpdateList.isEmpty()) {
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId() HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId()
, "/temployeeinsurancepre/inner/saveOrUpdateInsuranceList" , "/temployeeinsurancepre/inner/saveOrUpdateInsuranceList"
...@@ -449,6 +526,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -449,6 +526,12 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
//记录商险是否已购买日志 //记录商险是否已购买日志
String isBuyOld = oldInfo.getInsuranceIsBuy(); String isBuyOld = oldInfo.getInsuranceIsBuy();
String isBuyNew = newInfo.getInsuranceIsBuy(); String isBuyNew = newInfo.getInsuranceIsBuy();
//记录社保是否已购买日志
String isSocailBuyOld = oldInfo.getSocialIsBuy();
String isSocailBuyNew = newInfo.getSocialIsBuy();
//社保是否已购买list不做比较
oldInfo.setExitSocialInfoList(newInfo.getExitSocialInfoList());
oldInfo.setSocialIsBuy(newInfo.getSocialIsBuy());
//商险是否已购买list不做比较 //商险是否已购买list不做比较
oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList()); oldInfo.setExitInsuranceInfoList(newInfo.getExitInsuranceInfoList());
oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy()); oldInfo.setInsuranceIsBuy(newInfo.getInsuranceIsBuy());
...@@ -465,9 +548,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -465,9 +548,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
TEmployeePreLogDetail detailEmpLog = null; TEmployeePreLogDetail detailEmpLog = null;
if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey) if (Common.isNotNull(differenceKey) && !"insurancePreList".equals(differenceKey)
&& !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)) { && !"attaIdList".equals(differenceKey) && !"employeeContractPre".equals(differenceKey)
&& !"dispatchInfoPreVo".equals(differenceKey)) {
differenceKey = differenceKey.replace("insurancePreList",""); differenceKey = differenceKey.replace("insurancePreList","");
differenceKey = differenceKey.replace("employeeContractPre",""); differenceKey = differenceKey.replace("employeeContractPre","");
differenceKey = differenceKey.replace("dispatchInfoPreVo","");
diffTitle = "档案信息二次确认"; diffTitle = "档案信息二次确认";
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING); detailEmpLog.setModelType(CommonConstants.TWO_STRING);
...@@ -532,6 +617,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -532,6 +617,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
} }
} }
String differenceContractKey = null; String differenceContractKey = null;
TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre(); TEmployeeContractPre employeeContractPre = newInfo.getEmployeeContractPre();
if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) { if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
...@@ -577,6 +663,60 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -577,6 +663,60 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
detailList.add(detailEmpLog); detailList.add(detailEmpLog);
} }
} }
String differenceSocialKey;
if (Common.isEmpty(isSocailBuyOld) ||(Common.isNotNull(isSocailBuyOld) && !isSocailBuyOld.equals(isSocailBuyNew))) {
//单独记录是否已购买社保的变更记录
differenceSocialKey = "socialIsBuy";
TEmployeePreLogDetail detailSocialLog = new TEmployeePreLogDetail();
detailSocialLog.setModelType(CommonConstants.TWO_STRING);
detailSocialLog.setType(CommonConstants.FOUR_STRING);
Map<String,Object> old = new HashMap<>();
old.put("socialIsBuy", isSocailBuyOld);
Map<String,Object> simNew = new HashMap<>();
simNew.put("socialIsBuy", isSocailBuyNew);
this.setPreLogBaseInfo(empPreId, old, simNew, userId, nickName, differenceSocialKey, logId, detailSocialLog);
detailList.add(detailSocialLog);
}
//查询老的社保明细
R<EmployeePreSocialListVo> socialSdr = socialDaprUtils.getSocialPreInfoList(empPreId);
TDispatchInfoPreVo dispatchInfoPreOldVo = null;
if (socialSdr != null && socialSdr.getData() != null && null != socialSdr.getData().getDispatchInfoPreVo()) {
dispatchInfoPreOldVo = socialSdr.getData().getDispatchInfoPreVo();
}
TDispatchInfoPreVo dispatchInfoPreVo = newInfo.getDispatchInfoPreVo();
if (!newInfo.getServerItem().contains("社保") && oldInfo.getServerItem().contains("社保") && Common.isNotNull(dispatchInfoPreOldVo)) {
//记录操作记录
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.THREE_STRING);
detailEmpLog.setType(CommonConstants.FOUR_STRING);
this.setPreLogBaseInfo(empPreId, dispatchInfoPreOldVo, null, userId, nickName,
null, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息";
} else {
diffTitle = "社保信息";
}
}
if (newInfo.getServerItem().contains("社保") && dispatchInfoPreOldVo != null && dispatchInfoPreVo != null) {
differenceSocialKey = HrEquator.comparisonValueIgnoreField(dispatchInfoPreOldVo, dispatchInfoPreVo, CONTRACT_IGNORE_FIELD);
if (differenceSocialKey.length() > 0) {
if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息";
} else {
diffTitle = "社保信息";
}
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.TWO_STRING);
detailEmpLog.setType(CommonConstants.FOUR_STRING);
this.setPreLogBaseInfo(empPreId, dispatchInfoPreOldVo, dispatchInfoPreVo, userId, nickName,
differenceSocialKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
}
// 有修改,则加日志 // 有修改,则加日志
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
TEmployeePreLog empPreLog = new TEmployeePreLog(); TEmployeePreLog empPreLog = new TEmployeePreLog();
......
...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil; ...@@ -42,6 +42,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
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.common.dapr.util.CspDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.CspDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.InsuranceDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -75,6 +76,9 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -75,6 +76,9 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
@Autowired @Autowired
private CspDaprUtils cspDaprUtils; private CspDaprUtils cspDaprUtils;
@Autowired
private SocialDaprUtils socialDaprUtils;
@Autowired @Autowired
private InsuranceDaprUtil insuranceDaprUtil; private InsuranceDaprUtil insuranceDaprUtil;
...@@ -593,6 +597,8 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -593,6 +597,8 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
.set(TEmployeeContractPre::getCustomerUsername, vo.getName()) .set(TEmployeeContractPre::getCustomerUsername, vo.getName())
.set(TEmployeeContractPre::getCustomerUserLoginname, vo.getLoginName()); .set(TEmployeeContractPre::getCustomerUserLoginname, vo.getLoginName());
employeeContractPreService.update(updateContractWrapper); employeeContractPreService.update(updateContractWrapper);
//更新社保待购买的前端客服
socialDaprUtils.updateSocialPreCustomerName(updateVo);
} }
} }
}catch (Exception e){ }catch (Exception e){
......
...@@ -8,7 +8,6 @@ spring: ...@@ -8,7 +8,6 @@ spring:
redis: redis:
host: 127.0.0.1 host: 127.0.0.1
port: 6379 port: 6379
password: '@yf_2017'
datasource: datasource:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="customerUsernameNew" column="customer_username_new"/> <result property="customerUsernameNew" column="customer_username_new"/>
<result property="insuranceIsBuy" column="insurance_is_buy"/> <result property="insuranceIsBuy" column="insurance_is_buy"/>
<result property="socialIsBuy" column="social_is_buy"/>
</resultMap> </resultMap>
<resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo"> <resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo">
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.util; package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeePreSocialListVo;
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.TEmployeeAutoRegistCheckVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistCheckVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
...@@ -10,7 +12,6 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties; ...@@ -10,7 +12,6 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpInsuranceViewVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSocialViewVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*; import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo; import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
...@@ -226,7 +227,6 @@ public class SocialDaprUtils { ...@@ -226,7 +227,6 @@ public class SocialDaprUtils {
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/selectExitEmpSocial", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN); return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialfundinfo/selectExitEmpSocial", JSON.toJSONString(cardVo), Boolean.class, SecurityConstants.FROM_IN);
} }
/** /**
* @Author huyc * @Author huyc
* @Description 新增社保待购买信息 * @Description 新增社保待购买信息
...@@ -253,4 +253,56 @@ public class SocialDaprUtils { ...@@ -253,4 +253,56 @@ public class SocialDaprUtils {
} }
return res; return res;
} }
/**
* @Author huych
* @Description 更新社保待购买的前端客服姓名
* @Date 2025-10-10 11:01:12
* @Param
* @return
**/
public void updateSocialPreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo){
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/updateSocialPreCustomerName" , updateVo
, Object.class, SecurityConstants.FROM_IN);
}
/**
* @Author huych
* @Description 获取社保待购买和已购买的信息
* @Date 2025-10-10 15:48:08
* @Param
* @return
**/
public R<EmployeePreSocialListVo> getSocialPreInfoList(String id){
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/getSocialPreInfoList" , id
, EmployeePreSocialListVo.class, SecurityConstants.FROM_IN);
}
/**
* @Author huych
* @Description 获取社保已购买的信息
* @Date 2025-10-10 15:48:08
* @Param
* @return
**/
public R<EmployeePreSocialListVo> getSocialPreInfoStatus(String id){
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/getSocialPreInfoStatus" , id
, EmployeePreSocialListVo.class, SecurityConstants.FROM_IN);
}
/**
* @Author huych
* @Description 删除社保已购买非流程中的数据
* @Date 2025-10-10 15:51:36
* @Param
* @return
**/
public void deleteUnProcessSocialPreInfo(String id){
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id
, Object.class, SecurityConstants.FROM_IN);
}
} }
...@@ -635,7 +635,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -635,7 +635,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
//1.9.16社保自动化校验逻辑 //1.9.16社保自动化校验逻辑
if (preVo.getServerItem().contains("社保购买") && null != preVo.getEmployeeContractPreVos()) { if (preVo.getServerItem().contains("社保购买")) {
//根据身份证号码和项目编号查询合同 //根据身份证号码和项目编号查询合同
TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo(); TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo();
cardVo.setEmpIdcard(registration.getEmpIdcard()); cardVo.setEmpIdcard(registration.getEmpIdcard());
...@@ -904,7 +904,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -904,7 +904,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
List<EmployeeRegistrationReceiveVo> receiveVoList = new ArrayList<>(); List<EmployeeRegistrationReceiveVo> receiveVoList = new ArrayList<>();
R<TEmployeeInsuranceWorkDayVo> dataR; R<TEmployeeInsuranceWorkDayVo> dataR;
R<Boolean> flag; R<Boolean> flag;
TEmployeeAutoRegistCheckVo exitCheckVo;
for (EmployeeRegistration registration:registrationList) { for (EmployeeRegistration registration:registrationList) {
exitCheckVo = new TEmployeeAutoRegistCheckVo();
exitCheckVo.setEmployeeName(registration.getEmployeeName());
exitCheckVo.setEmpIdcard(registration.getEmpIdcard());
exitCheckVo.setDeptName(registration.getDeptName());
exitCheckVo.setDeptNo(registration.getDeptNo());
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);
insurancePreVo.setEmpIdcard(registration.getEmpIdcard()); insurancePreVo.setEmpIdcard(registration.getEmpIdcard());
...@@ -935,11 +941,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -935,11 +941,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
compareTo(DateUtil.dateToString(insurancePreVo.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)) > 0) compareTo(DateUtil.dateToString(insurancePreVo.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)) > 0)
|| (DateUtil.dateToString(insurancePreVo.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT). || (DateUtil.dateToString(insurancePreVo.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT).
compareTo(DateUtil.dateToString(insurancePreVo.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)) > 0)) { compareTo(DateUtil.dateToString(insurancePreVo.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)) > 0)) {
TEmployeeAutoRegistCheckVo exitCheckVo = new TEmployeeAutoRegistCheckVo();
exitCheckVo.setEmployeeName(registration.getEmployeeName());
exitCheckVo.setEmpIdcard(registration.getEmpIdcard());
exitCheckVo.setDeptName(registration.getDeptName());
exitCheckVo.setDeptNo(registration.getDeptNo());
exitCheckVo.setType("商险"); exitCheckVo.setType("商险");
exitCheckVo.setErrorMsg("入职日期需要小于等于保单截止日期/保单开始日期需小于等于保单截止日期"); exitCheckVo.setErrorMsg("入职日期需要小于等于保单截止日期/保单开始日期需小于等于保单截止日期");
errorList.add(exitCheckVo); errorList.add(exitCheckVo);
...@@ -965,17 +966,28 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -965,17 +966,28 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
flag = archivesDaprUtil.selectExitEmpCopntract(cardVo); flag = archivesDaprUtil.selectExitEmpCopntract(cardVo);
//是否已签署为否需要判断是否在用或者流程中的合同 //是否已签署为否需要判断是否在用或者流程中的合同
if (Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) { if (Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
TEmployeeAutoRegistCheckVo exitCheckVo = new TEmployeeAutoRegistCheckVo();
exitCheckVo.setEmployeeName(registration.getEmployeeName());
exitCheckVo.setEmpIdcard(registration.getEmpIdcard());
exitCheckVo.setDeptName(registration.getDeptName());
exitCheckVo.setDeptNo(registration.getDeptNo());
exitCheckVo.setType("合同"); exitCheckVo.setType("合同");
exitCheckVo.setErrorMsg("该项目下存在在途/有效的合同数据"); exitCheckVo.setErrorMsg("该项目下存在在途/有效的合同数据");
errorList.add(exitCheckVo); errorList.add(exitCheckVo);
continue; continue;
} }
} }
//1.9.16社保自动化校验逻辑
if (preVo.getServerItem().contains("社保购买") && null != preVo.getDispatchInfoPreVo()) {
//根据身份证号码和项目编号查询合同
TEmployeeAutoRegistCheckVo cardVo = new TEmployeeAutoRegistCheckVo();
cardVo.setEmpIdcard(registration.getEmpIdcard());
flag = socialDaprUtils.selectExitEmpSocial(cardVo);
//是否已签署为否需要判断是否在用或者流程中的合同
if (Common.isNotNull(flag) && Boolean.TRUE.equals(flag.getData())) {
exitCheckVo.setType("社保");
exitCheckVo.setErrorMsg("该人员存在在途/有效的社保数据");
errorList.add(exitCheckVo);
continue;
}
}
//点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项, //点击“接收确认”的时候,监测到该人员该项目下已有在项的档案时,再次提醒:该人员已在项,
//状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项 //状态将更新成“已处理”;处理记录中,针对此情况,记录真实的进项时间,备注:先于登记入项
EmpProjectStatusVo vo = new EmpProjectStatusVo(); EmpProjectStatusVo vo = new EmpProjectStatusVo();
...@@ -1017,6 +1029,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1017,6 +1029,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//生成合同待购买数据 //生成合同待购买数据
initContractPreInfo(registration, employeeContractPreVo, user, domainR.getData()); initContractPreInfo(registration, employeeContractPreVo, user, domainR.getData());
} }
//服务类型包含社保购买时
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据
initSocialPreInfo(registration, preVo.getDispatchInfoPreVo(), user, domainR.getData());
socialDaprUtils.saveSocialPreInfo(preVo);
}
} }
}catch (Exception e) { }catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
...@@ -1170,6 +1189,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1170,6 +1189,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
//生成合同待购买数据 //生成合同待购买数据
initContractPreInfo(registrationNow, employeeContractPreVo, user, domainR.getData()); initContractPreInfo(registrationNow, employeeContractPreVo, user, domainR.getData());
} }
//服务类型包含社保购买时
if (preVo.getServerItem().contains("社保购买") && (null != preVo.getExitSocialInfoList()
|| null != preVo.getDispatchInfoPreVo())) {
//生成社保待购买或者已购买数据
initSocialPreInfo(registrationNow, preVo.getDispatchInfoPreVo(), user, domainR.getData());
socialDaprUtils.saveSocialPreInfo(preVo);
}
} }
}catch (Exception e) { }catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
...@@ -1677,11 +1703,33 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1677,11 +1703,33 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setUpdateBy(user.getId()); preVo.setUpdateBy(user.getId());
preVo.setTypeSub(CommonConstants.ZERO_STRING); preVo.setTypeSub(CommonConstants.ZERO_STRING);
preVo.setProcessStatus(CommonConstants.ZERO_STRING); preVo.setProcessStatus(CommonConstants.ZERO_STRING);
//如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType())) {
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(preVo.getExpectedCollectionType()));
vo.setYearAfter(0);
vo.setRegistDate(preVo.getJoinLeaveDate());
Date date = this.addYearsMonths(vo);
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
dayVo.setRegistType(0);
R<TEmployeeInsuranceWorkDayVo> dataR = socialDaprUtils.getBeforeOrAfterWorkDay(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData())
&& Common.isNotNull(dataR.getData().getPriDisDate())) {
preVo.setExpectedCollectionTime(dataR.getData().getPriDisDate());
preVo.setExpectedConfirmTime(dataR.getData().getPriDisDate());
} else {
preVo.setExpectedCollectionTime(date);
preVo.setExpectedConfirmTime(date);
}
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString( preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
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));
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString( preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE)); preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE));
} }
}
//商险状态是否正常判断 //商险状态是否正常判断
private boolean checkInsuranceIsProcess(EmployeeRegistrationPreVo preVo) { private boolean checkInsuranceIsProcess(EmployeeRegistrationPreVo preVo) {
......
...@@ -287,4 +287,31 @@ public class SocialTask { ...@@ -287,4 +287,31 @@ public class SocialTask {
"/tsocialfriend/inner/doChangeHandleStatusToEnd","", Object.class, SecurityConstants.FROM_IN); "/tsocialfriend/inner/doChangeHandleStatusToEnd","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理-定时任务结束------------"); log.info("------------定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理-定时任务结束------------");
} }
/**
* 每天九点推送社保待确认信息
* @author huych
* @param
* @return void
*/
public void pushWxConfrimMessage() {
log.info("-------------每天九点推送社保待确认信息------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(), daprProperties.getAppId(),
"/tdispatchinfopre/inner/pushWxConfrimMessage","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天九点推送社保待确认信息-定时任务开始------------");
}
/**
* 每天刷新商险到期提醒信息
* @author huych
* @param
* @return void
*/
public void pushDisConfrimSocial() {
log.info("-------------每天三点二十批量派单社保------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(), daprProperties.getAppId(),
"/tdispatchinfopre/inner/pushDisConfrimSocial","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天三点二十批量派单社保-定时任务开始------------");
}
} }
...@@ -897,4 +897,8 @@ public class TDispatchInfo extends BaseEntity { ...@@ -897,4 +897,8 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("医保仅补缴生成材料") @ExcelProperty("医保仅补缴生成材料")
private String dataFlagYsd; private String dataFlagYsd;
@Schema(description ="社保待购买id")
@TableField(exist = false)
private String preId;
} }
package com.yifu.cloud.plus.v1.yifu.social.entity; package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; 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;
...@@ -228,6 +226,13 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -228,6 +226,13 @@ public class TDispatchInfoPre extends BaseEntity {
@ExcelProperty("起缴日期是否一致 0 是 1否") @ExcelProperty("起缴日期是否一致 0 是 1否")
@Schema(description = "起缴日期是否一致 0 是 1否") @Schema(description = "起缴日期是否一致 0 是 1否")
private String isCreateDate; private String isCreateDate;
/**
* 起缴日期
*/
@ExcelAttribute(name = "起缴日期", isDate = true)
@Schema(description = "起缴日期")
@ExcelProperty("起缴日期")
private Date socialStartDate;
/** /**
* 配置名称 * 配置名称
*/ */
...@@ -236,6 +241,18 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -236,6 +241,18 @@ public class TDispatchInfoPre extends BaseEntity {
@ExcelProperty("配置名称") @ExcelProperty("配置名称")
@Schema(description = "配置名称") @Schema(description = "配置名称")
private String configName; private String configName;
/**
* 配置id
*/
@ExcelAttribute(name = "配置id")
@Schema(description = "配置id")
@ExcelProperty("配置id")
private String configId;
/**
* 接收方式
*/
@Schema(description = "接收方式 0项目配置 1自定义")
private String receiveType;
/** /**
* 入职确认信息主表id * 入职确认信息主表id
*/ */
...@@ -355,11 +372,29 @@ public class TDispatchInfoPre extends BaseEntity { ...@@ -355,11 +372,29 @@ public class TDispatchInfoPre extends BaseEntity {
/** /**
* 合同id * 合同id
*/ */
@ExcelAttribute(name = "合同id", maxLength = 32) @ExcelAttribute(name = "合同id")
@Length(max = 32, message = "合同id不能超过32个字符")
@ExcelProperty("合同id") @ExcelProperty("合同id")
@Schema(description = "合同id") @Schema(description = "合同id")
private String contractId; private String contractId;
/**
* 派单id
*/
@ExcelAttribute(name = "派单id")
@ExcelProperty("派单id")
@Schema(description = "派单id")
private String disPatcherId;
@Schema(description = "发起失败原因")
private String errorInfo;
@Schema(description = "发起失败时间")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Date errorTime;
@Schema(description = "派单审核/办理不通过原因")
private String errorBackInfo;
/** /**
* 0未删除1删除 * 0未删除1删除
*/ */
......
...@@ -557,6 +557,17 @@ public class TDispatchImportVo extends RowIndex implements Serializable { ...@@ -557,6 +557,17 @@ public class TDispatchImportVo extends RowIndex implements Serializable {
@ExcelProperty("派单ID" ) @ExcelProperty("派单ID" )
private String dispatchId; private String dispatchId;
@ExcelAttribute(name = "preId")
@ExcelProperty(value ="preId")
private String preId;
@ExcelAttribute(name = "preName")
@ExcelProperty(value ="preName")
private String preName;
@ExcelAttribute(name = "preLoginName")
@ExcelProperty(value ="preLoginName")
private String preLoginName;
/** /**
* 订单ID * 订单ID
......
...@@ -53,4 +53,8 @@ public class TDispatchInfoPreSearchVo extends TDispatchInfoPre { ...@@ -53,4 +53,8 @@ public class TDispatchInfoPreSearchVo extends TDispatchInfoPre {
@TableField(exist = false) @TableField(exist = false)
private String dispatcherTimeEnd; private String dispatcherTimeEnd;
@Schema(description = "失败标签 1查询失败数据")
@TableField(exist = false)
private String failType;
} }
...@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -2,6 +2,8 @@ package com.yifu.cloud.plus.v1.yifu.social.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.yifu.archives.vo.EmployeePreSocialListVo;
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;
...@@ -130,6 +132,16 @@ public class TDispatchInfoPreController { ...@@ -130,6 +132,16 @@ public class TDispatchInfoPreController {
return tDispatchInfoPreService.confirm(idList); return tDispatchInfoPreService.confirm(idList);
} }
/**
* 社保待购买信息单个/批量发起购买任务
* @param idList id数组
**/
@Operation(description = "合社保待购买信息单个/批量发起购买任务")
@PostMapping("/dispatcherContract")
public R dispatcherContract(@RequestBody List<String> idList) {
return tDispatchInfoPreService.dispatcherSocial(idList,"1");
}
/** /**
* 社保待购买数量查询 * 社保待购买数量查询
* @param searchVo 社保待购买任务表 * @param searchVo 社保待购买任务表
...@@ -154,4 +166,79 @@ public class TDispatchInfoPreController { ...@@ -154,4 +166,79 @@ public class TDispatchInfoPreController {
public Boolean saveSocialPreInfo(@RequestBody EmployeeRegistrationPreVo preVo) { public Boolean saveSocialPreInfo(@RequestBody EmployeeRegistrationPreVo preVo) {
return tDispatchInfoPreService.saveSocialPreInfo(preVo); return tDispatchInfoPreService.saveSocialPreInfo(preVo);
} }
/**
* 更新社保待购买的前端客服姓名
* @author huych
* @date 2025-10-10 11:02:35
**/
@Operation(description = "更新社保待购买的前端客服姓名")
@Inner
@PostMapping("/updateSocialPreCustomerName")
public void updateSocialPreCustomerName(@RequestBody EmployeeRegistrationCustomerUserUpdateVo updateVo) {
tDispatchInfoPreService.updateSocialPreCustomerName(updateVo);
}
/**
* 入职确认信息详情中的社保明细信息
* @author huych
* @date 2025-10-10 15:51:18
**/
@Operation(description = "入职确认信息详情中的社保明细信息")
@Inner
@PostMapping("/getSocialPreInfoList")
public EmployeePreSocialListVo getSocialPreInfoList(@RequestBody String id) {
return tDispatchInfoPreService.getSocialPreInfoList(id);
}
/**
* 查询社保待购买的状态
* @author huych
* @date 2025-10-11 14:45:26
**/
@Operation(description = "查询社保待购买的状态")
@Inner
@PostMapping("/getSocialPreInfoStatus")
public EmployeePreSocialListVo getSocialPreInfoStatus(@RequestBody String id) {
return tDispatchInfoPreService.getSocialPreInfoStatus(id);
}
/**
* 删除非流程中的社保待购买数据
* @author huych
* @date 2025-10-11 15:30:02
**/
@Operation(description = "删除非流程中的社保待购买数据")
@Inner
@PostMapping("/deleteUnProcessSocialPreInfo")
public void deleteUnProcessSocialPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id);
}
/**
* 派单当日9点统一推送确认信息
* @author huych
* @date 2025-10-11 18:50:16
* @return void
*/
@SysLog("派单当日9点统一推送确认信息")
@Inner
@PostMapping("/inner/pushWxConfrimMessage")
public void pushWxConfrimMessage() {
tDispatchInfoPreService.pushWxConfrimMessage();
}
/**
* 每天下午三点二十推送待购买数据
* @author huych
* @date 2025-10-11 18:51:58
* @return void
*/
@SysLog("每天下午三点二十推送待购买数据")
@Inner
@PostMapping("/inner/pushDisConfrimSocial")
public void pushDisConfrimSocial() {
tDispatchInfoPreService.pushDisConfrimSocial();
}
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.social.entity.TDispatchInfoPre; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -32,5 +33,10 @@ public interface TDispatchInfoPreMapper extends BaseMapper<TDispatchInfoPre> { ...@@ -32,5 +33,10 @@ public interface TDispatchInfoPreMapper extends BaseMapper<TDispatchInfoPre> {
List<TDispatchInfoPreExportVo> selectExportList(@Param("tDispatchInfoPre") TDispatchInfoPreSearchVo searchVo); List<TDispatchInfoPreExportVo> selectExportList(@Param("tDispatchInfoPre") TDispatchInfoPreSearchVo searchVo);
List<TDispatchImportVo> getDisPatcherSocialList(@Param("idList") List<String> idList, @Param("statusList") List<String> statusList, @Param("type") String type);
List<TDispatchInfoPre> getAllUnDisData();
List<String> getAllUnDisDataIdList();
} }
...@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.social.service; ...@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
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.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.yifu.archives.vo.EmployeePreSocialListVo;
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.social.entity.TDispatchInfoPre; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
...@@ -54,4 +56,29 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> { ...@@ -54,4 +56,29 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
* @return * @return
*/ */
Boolean saveSocialPreInfo(EmployeeRegistrationPreVo preVo); Boolean saveSocialPreInfo(EmployeeRegistrationPreVo preVo);
/**
* 更新社保待购买前端客服信息
* @param updateVo
* @return
*/
void updateSocialPreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo);
EmployeePreSocialListVo getSocialPreInfoList(String id);
EmployeePreSocialListVo getSocialPreInfoStatus(String id);
void deleteUnProcessSocialPreInfo(String id);
/**
* 社保待购买信息单个/批量发起签署任务
* @param idList id集合
* @param type 1 手动 2 自动
* @return
*/
R dispatcherSocial(List<String> idList,String type);
void pushWxConfrimMessage();
void pushDisConfrimSocial();
} }
...@@ -8,38 +8,44 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -8,38 +8,44 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TDispatchInfoPreVo; import com.yifu.cloud.plus.v1.csp.vo.TEmployeeContractDateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSocialPreDetailVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.LocalDateTimeUtils;
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.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
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.social.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoPreMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoPreMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoPreService; import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoPreService;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.THolidayInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialPreDetailService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialPreDetailService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList; import java.time.LocalDate;
import java.util.Arrays; import java.time.ZoneId;
import java.util.List; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 社保待购买表 * 社保待购买表
...@@ -55,8 +61,18 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -55,8 +61,18 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
@Autowired @Autowired
private ArchivesDaprUtil archivesDaprUtil; private ArchivesDaprUtil archivesDaprUtil;
@Autowired
private WxConfig wxConfig;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
private final TSocialPreDetailService socialPreDetailService; private final TSocialPreDetailService socialPreDetailService;
private final THolidayInfoService tHolidayInfoService;
private final TDispatchInfoService dispatchInfoService;
/** /**
* 社保待购买表简单分页查询 * 社保待购买表简单分页查询
* @param tDispatchInfoPre 社保待购买表 * @param tDispatchInfoPre 社保待购买表
...@@ -187,13 +203,36 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -187,13 +203,36 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isNotNull(preVo.getExpectedConfirmTime())) { if (Common.isNotNull(preVo.getExpectedConfirmTime())) {
pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime())); pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
} }
//如果自动触发派增为是,计算派单发起时间和派单确认时间
if (Common.isNotNull(preVo.getIsAutoDis()) && CommonConstants.ZERO_STRING.equals(preVo.getIsAutoDis())
&& Common.isNotNull(preVo.getExpectedCollectionType()) && Common.isEmpty(preVo.getExpectedCollectionTime())) {
TEmployeeContractDateVo vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(preVo.getExpectedCollectionType()));
vo.setYearAfter(0);
vo.setRegistDate(preVo.getJoinLeaveDate());
Date date = this.addYearsMonths(vo);
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(date);
dayVo.setRegistType(0);
TEmployeeInsuranceWorkDayVo dataR = tHolidayInfoService.getInitBeforeOrAfterWorkDay(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getPriDisDate())) {
preVo.setExpectedCollectionTime(dataR.getPriDisDate());
preVo.setExpectedConfirmTime(dataR.getPriDisDate());
} else {
preVo.setExpectedCollectionTime(date);
preVo.setExpectedConfirmTime(date);
}
preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE));
}
if (Common.isNotNull(preExit)) { if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId()); pre.setId(preExit.getId());
baseMapper.deleteById(preExit); baseMapper.deleteById(preExit);
baseMapper.insert(pre);
} else {
baseMapper.insert(pre);
} }
baseMapper.insert(pre);
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
return false; return false;
...@@ -203,6 +242,251 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -203,6 +242,251 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
return true; return true;
} }
@Override
public void updateSocialPreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo) {
//批量更新前端客服名称
if (Common.isNotNull(updateVo) && Common.isNotNull(updateVo.getDeptNo())) {
LambdaUpdateWrapper<TDispatchInfoPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TDispatchInfoPre::getDeptNo, updateVo.getDeptNo())
.set(TDispatchInfoPre::getCustomerUsername, updateVo.getCustomerUserName())
.set(TDispatchInfoPre::getCustomerUserLoginName, updateVo.getCustomerUserLoginName());
this.update(updateWrapper);
}
}
@Override
public EmployeePreSocialListVo getSocialPreInfoList(String id) {
EmployeePreSocialListVo preSocialListVo = new EmployeePreSocialListVo();
//获取社保已购买和待购买信息
List<TSocialPreDetail> exitSocialInfoList = socialPreDetailService.list(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id));
if (Common.isNotNull(exitSocialInfoList) && !exitSocialInfoList.isEmpty()) {
List<TSocialPreDetailVo> exitSocialInfoListVo = exitSocialInfoList.stream()
.map(detail -> {
TSocialPreDetailVo vo = new TSocialPreDetailVo();
BeanUtils.copyProperties(detail, vo);
return vo;
})
.collect(Collectors.toList());
preSocialListVo.setExitSocialInfoList(exitSocialInfoListVo);
return preSocialListVo;
}
TDispatchInfoPre preExit = baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getRegisterId, id)
.last(CommonConstants.LAST_ONE_SQL));
TDispatchInfoPreVo pre = new TDispatchInfoPreVo();
BeanUtils.copyProperties(preExit, pre);
preSocialListVo.setDispatchInfoPreVo(pre);
return preSocialListVo;
}
@Override
public EmployeePreSocialListVo getSocialPreInfoStatus(String id) {
EmployeePreSocialListVo preSocialListVo = new EmployeePreSocialListVo();
//获取社保已购买信息
TDispatchInfoPre preExit = baseMapper.selectById(id);
if (Common.isNotNull(preExit)) {
TDispatchInfoPreVo pre = new TDispatchInfoPreVo();
BeanUtils.copyProperties(preExit, pre);
preSocialListVo.setDispatchInfoPreVo(pre);
}
return preSocialListVo;
}
@Override
public void deleteUnProcessSocialPreInfo(String id) {
//删除未处理的社保待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id));
}
@Override
public R dispatcherSocial(List<String> idList,String type) {
YifuUser user = SecurityUtils.getUser();
List<TDispatchInfoPre> contractPreList = baseMapper.selectList(Wrappers.<TDispatchInfoPre>query()
.lambda().in(TDispatchInfoPre::getId, idList)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("1","2","4","8","9")));
// 如果没有找到任何未处理的社保待购买数据,返回失败消息
if (Common.isEmpty(contractPreList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
//发起派单
List<ErrorMessage> errorMessageListAll = new ArrayList<>();
List<TDispatchImportVo> excelVOList = baseMapper.getDisPatcherSocialList(idList,Arrays.asList("1","2","4","8","9"),type);
if (Common.isNotNull(excelVOList) && !excelVOList.isEmpty()) {
List<TDispatchImportVo> disList;
int k = 0;
int i = (int) Math.ceil((double) excelVOList.size() / CommonConstants.INTEGER_HUNDRED);
//前端客服对应的成功和失败数量
Map<String,Integer> sumMap = new HashMap<>();
Map<String,Integer> falureMap = new HashMap<>();
// 先统计每个登录名的总派单数量
for (TDispatchImportVo vo : excelVOList) {
String preLoginName = vo.getPreLoginName();
sumMap.put(preLoginName, sumMap.getOrDefault(preLoginName, 0) + 1);
// 初始化失败数量为0
falureMap.putIfAbsent(preLoginName, 0);
}
for (int j = 0; j < i; j++) {
if (j == i - 1) {
disList = excelVOList.subList(k, excelVOList.size());
} else {
disList = excelVOList.subList(k, k + 100);
}
k = k + 100;
if (Common.isNotNull(disList)) {
//调用批量派单接口100条处理一次,同原合同派单保持一致
List<ErrorMessage> errorMessageList = new ArrayList<>();
dispatchInfoService.importTDispatchInfo(excelVOList, errorMessageList,user, null, new HashMap<>());
if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
errorMessageListAll.addAll(errorMessageList);
//更新社保状态为2发起失败
for (ErrorMessage errorMessage : errorMessageList) {
if (!errorMessage.getMessage().equals(CommonConstants.SAVE_SUCCESS)) {
TDispatchImportVo contractVO = disList.stream().filter(vo -> Objects.equals(
vo.getRowIndex(), errorMessage.getLineNum())).collect(Collectors.toList()).get(0);
LambdaUpdateWrapper<TDispatchInfoPre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TDispatchInfoPre::getId, contractVO.getPreId())
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("1","2","4","8","9"))
.set(TDispatchInfoPre::getProcessStatus, CommonConstants.TWO_STRING)
.set(TDispatchInfoPre::getErrorInfo, errorMessage.getMessage())
.set(TDispatchInfoPre::getErrorTime, LocalDateTimeUtils.convertLDToDate(LocalDate.now()));
// 执行更新操作
errorMessage.setData(contractVO);
this.update(updateWrapper);
// 统计失败数量
String preLoginName = contractVO.getPreLoginName();
falureMap.put(preLoginName, falureMap.getOrDefault(preLoginName, 0) + 1);
}
}
}
}
}
//针对定时任务派单的记录失败次数,集中提醒至该项目的“前端客服”
if (!falureMap.isEmpty() && type.equals("2")) {
for (Map.Entry<String, Integer> entry : falureMap.entrySet()) {
String preLoginName = entry.getKey();
int failureCount = entry.getValue();
int sum = sumMap.get(preLoginName);
sendDisFalureMessageToWx(preLoginName ,sum, failureCount);
}
}
}
return R.ok(errorMessageListAll);
}
@Override
public void pushWxConfrimMessage() {
//获取所有预计派单时间为当天而且状态是待确认的合同待签署数据
List<TDispatchInfoPre> unConfirmList = baseMapper.getAllUnDisData();
if (Common.isNotNull(unConfirmList) && !unConfirmList.isEmpty()) {
for (TDispatchInfoPre pre : unConfirmList) {
try {
sendMessageToWx(pre);
} catch (Exception e) {
log.error("执行异常", e);
}
}
}
}
@Override
public void pushDisConfrimSocial() {
//获取所有待派单的数据
List<String> unConfirmList = baseMapper.getAllUnDisDataIdList();
if (null != unConfirmList && !unConfirmList.isEmpty()) {
try {
this.dispatcherSocial(unConfirmList,"2");
} catch (Exception e) {
log.error("执行异常", e);
}
}
}
//发送企业微信待办
private void sendMessageToWx(TDispatchInfoPre pre) {
//获取前端客服
SysUser user;
if (Common.isEmpty(pre.getCustomerUserLoginName())) {
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(pre.getCustomerUserLoginName());
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
} else {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(user.getWxMessage())) {
sendUser = new StringBuilder(user.getWxMessage());
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "04" + pre.getCustomerUserLoginName());
StringBuilder description = new StringBuilder();
String title = "社保购买确认";
description.append("您有新的社保待购买确认数据,请及时确认").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
textcard.put("description", description.toString());
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
}
}
//发送企业微信待办
private void sendDisFalureMessageToWx(String LoginName, int sum, int falureNum) {
//获取前端客服
SysUser user;
if (Common.isEmpty(LoginName)) {
return;
}
R<SysUser> res = upmsDaprUtils.getSimpleUserByLoginName(LoginName);
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
user = res.getData();
} else {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(user.getWxMessage())) {
sendUser = new StringBuilder(user.getWxMessage());
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
String authUrl = String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "05" + LoginName);
StringBuilder description = new StringBuilder();
String title = "作业自动化——社保派单发起失败提醒";
description.append("社保派单数:").append(sum).append("份,失败份数:").append(falureNum).append("份;").append("<br>");
description.append("点击查看详情").append("<br>");
description.append("<br>");
description.append("请及时至HRO系统处理,以免耽误购买进度!").append("<br>");
textcard.put("title", title);
textcard.put("url", authUrl);
textcard.put("description", description.toString());
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
}
}
/** /**
* @Description: 获取前端客服的所有项目权限 * @Description: 获取前端客服的所有项目权限
* @Author: huych * @Author: huych
...@@ -238,4 +522,22 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -238,4 +522,22 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
} }
return false; return false;
} }
public Date addYearsMonths(TEmployeeContractDateVo vo) {
if (vo == null || vo.getRegistDate() == null) return null;
// 转换为LocalDate(自动处理时区)
LocalDate localDate = vo.getRegistDate().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
// 添加年数和月数
localDate = localDate
.plusYears(vo.getYearAfter())
.plusMonths(vo.getMonthAfter())
.minusDays(1);
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
}
} }
...@@ -130,6 +130,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -130,6 +130,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final TAuditInfoMapper auditInfoMapper; private final TAuditInfoMapper auditInfoMapper;
private final TDispatchInfoPreMapper dispatchInfoPreMapper;
@Autowired @Autowired
private CacheManager cacheManager; private CacheManager cacheManager;
...@@ -777,7 +779,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -777,7 +779,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(socialFund) && Common.isNotNull(dispatch)) { if (Common.isNotNull(socialFund) && Common.isNotNull(dispatch)) {
socialFund.setDispatchId(dispatch.getId()); socialFund.setDispatchId(dispatch.getId());
} }
initSocialFundAndInsert(emp, social, fund, socialFund, project, dispatchPart, injury); initSocialFundAndInsert(emp, social, fund, socialFund, project, dispatchPart, injury,dispatch.getPreId());
} }
// 生成预付数据 // 生成预付数据
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getId())) { if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getId())) {
...@@ -957,7 +959,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -957,7 +959,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TProvidentFund fund, TProvidentFund fund,
TSocialFundInfo socialFund, TSocialFundInfo socialFund,
EmpProjectDispatchVo project, EmpProjectDispatchVo project,
boolean dispatchPart, boolean injury) { boolean dispatchPart, boolean injury,String preId) {
if (Common.isNotNull(socialFund)) { if (Common.isNotNull(socialFund)) {
if (Common.isNotNull(project)) { if (Common.isNotNull(project)) {
socialFund.setEmpNo(project.getEmpCode()); socialFund.setEmpNo(project.getEmpCode());
...@@ -1132,6 +1134,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1132,6 +1134,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} else { } else {
socialFundMapper.insert(socialFund); socialFundMapper.insert(socialFund);
} }
//派单完成更新社保待购买表的状态
if (Common.isNotNull(preId)) {
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectById(preId);
if (Common.isNotNull(dispatchInfoPre)) {
dispatchInfoPre.setProcessStatus(CommonConstants.THREE_STRING);
dispatchInfoPre.setDisPatcherId(socialFund.getId());
dispatchInfoPre.setErrorInfo(null);
dispatchInfoPre.setErrorTime(null);
dispatchInfoPreMapper.updateById(dispatchInfoPre);
}
}
} }
} }
...@@ -1333,7 +1346,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1333,7 +1346,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setContactAddress(excel.getContactAddress()); dispatch.setContactAddress(excel.getContactAddress());
} }
dispatch.setOrganName(user.getDeptName()); dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId()); if (Common.isNotNull(excel.getPreId())) {
dispatch.setPreId(excel.getPreId());
}
dispatch.setCreateBy(null == user ? "1" : user.getId());
dispatch.setCreateName(null == excel.getPreName() ? user.getNickname() : excel.getPreName());
dispatch.setCreateTime(LocalDateTime.now()); dispatch.setCreateTime(LocalDateTime.now());
dispatch.setContractSubName(excel.getContractSubName()); dispatch.setContractSubName(excel.getContractSubName());
dispatch.setContractName(excel.getContractName()); dispatch.setContractName(excel.getContractName());
...@@ -3669,6 +3686,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3669,6 +3686,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue; continue;
}*/ }*/
if (null != socialInfo) { if (null != socialInfo) {
//派单审核通过更新社保待购买表的状态
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getDisPatcherId, sf.getId())
.eq(TDispatchInfoPre::getProcessStatus, CommonConstants.THREE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
// 派增审核 // 派增审核
if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())) { if (CommonConstants.dingleDigitStrArray[0].equals(dis.getType())) {
//派增审核通过 //派增审核通过
...@@ -3679,6 +3701,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3679,6 +3701,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setSocialAddStatus(CommonConstants.ONE_STRING); sf.setSocialAddStatus(CommonConstants.ONE_STRING);
sf.setSocialStatus(CommonConstants.ONE_STRING); sf.setSocialStatus(CommonConstants.ONE_STRING);
} }
//审核通过更新状态
if (Common.isNotNull(dispatchInfoPre)) {
dispatchInfoPre.setProcessStatus(CommonConstants.FIVE_STRING);
dispatchInfoPreMapper.updateById(dispatchInfoPre);
}
//派增审核不通过 需要处理预估数据 //派增审核不通过 需要处理预估数据
} else if (CommonConstants.ONE_INT == flag) { } else if (CommonConstants.ONE_INT == flag) {
socialInfo.setDeleteFlag(CommonConstants.ONE_STRING); socialInfo.setDeleteFlag(CommonConstants.ONE_STRING);
...@@ -3691,7 +3718,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3691,7 +3718,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (null != sf.getSocialIdSuccess()){ if (null != sf.getSocialIdSuccess()){
sf.setSocialId(sf.getSocialIdSuccess()); sf.setSocialId(sf.getSocialIdSuccess());
} }
//审核不通过更新状态
if (Common.isNotNull(dispatchInfoPre)) {
dispatchInfoPre.setProcessStatus(CommonConstants.FOUR_STRING);
dispatchInfoPre.setErrorBackInfo(auditRemark);
dispatchInfoPreMapper.updateById(dispatchInfoPre);
}
} }
socialInfo.setAuditTime(now); socialInfo.setAuditTime(now);
socialInfo.setAuditUser(user.getId()); socialInfo.setAuditUser(user.getId());
...@@ -4388,6 +4420,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -4388,6 +4420,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
auditInfo.setSocialId(dis.getId()); auditInfo.setSocialId(dis.getId());
} }
//针对社保自动化过来的数据,办理更新待购买数据状态
TDispatchInfoPre dispatchInfoPre = dispatchInfoPreMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getDisPatcherId, sf.getId())
.eq(TDispatchInfoPre::getProcessStatus, CommonConstants.FIVE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(dispatchInfoPre)) {
//此处状态可能会更新为 办理成功 办理中 部分办理失败和办理失败
if (sf.getSocialStatus().equals(CommonConstants.TWO_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.SIX_STRING);
}
if (sf.getSocialStatus().equals(CommonConstants.FOUR_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.NINE_STRING);
dispatchInfoPre.setErrorBackInfo(handleRemark);
}
if (sf.getSocialStatus().equals(CommonConstants.FIVE_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.EIGHT_STRING);
dispatchInfoPre.setErrorBackInfo(handleRemark);
}
if (sf.getSocialStatus().equals(CommonConstants.THREE_STRING)) {
dispatchInfoPre.setProcessStatus(CommonConstants.SEVEN_STRING);
}
dispatchInfoPreMapper.updateById(dispatchInfoPre);
}
} else { } else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName())); errorList.add(new ErrorMessage(-1, "找不到对应员工社保派增派单数据:" + dis.getEmpName()));
return true; return true;
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
<result property="isAutoDis" column="IS_AUTO_DIS"/> <result property="isAutoDis" column="IS_AUTO_DIS"/>
<result property="isCreateDate" column="IS_CREATE_DATE"/> <result property="isCreateDate" column="IS_CREATE_DATE"/>
<result property="configName" column="CONFIG_NAME"/> <result property="configName" column="CONFIG_NAME"/>
<result property="configId" column="CONFIG_ID"/>
<result property="receiveType" column="RECEIVE_TYPE"/>
<result property="registerId" column="REGISTER_ID"/> <result property="registerId" column="REGISTER_ID"/>
<result property="pensionStart" column="PENSION_START"/> <result property="pensionStart" column="PENSION_START"/>
<result property="medicalStart" column="MEDICAL_START"/> <result property="medicalStart" column="MEDICAL_START"/>
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
<result property="workInjuryStart" column="WORK_INJURY_START"/> <result property="workInjuryStart" column="WORK_INJURY_START"/>
<result property="birthStart" column="BIRTH_START"/> <result property="birthStart" column="BIRTH_START"/>
<result property="bigailmentStart" column="BIGAILMENT_START"/> <result property="bigailmentStart" column="BIGAILMENT_START"/>
<result property="socialStartDate" column="SOCIAL_START_DATE"/>
<result property="trustRemark" column="TRUST_REMARK"/> <result property="trustRemark" column="TRUST_REMARK"/>
<result property="pensionCardinal" column="PENSION_CARDINAL"/> <result property="pensionCardinal" column="PENSION_CARDINAL"/>
<result property="medicalCardinal" column="MEDICAL_CARDINAL"/> <result property="medicalCardinal" column="MEDICAL_CARDINAL"/>
...@@ -49,12 +52,16 @@ ...@@ -49,12 +52,16 @@
<result property="paymentType" column="PAYMENT_TYPE"/> <result property="paymentType" column="PAYMENT_TYPE"/>
<result property="contractStatus" column="CONTRACT_STATUS"/> <result property="contractStatus" column="CONTRACT_STATUS"/>
<result property="contractId" column="CONTRACT_ID"/> <result property="contractId" column="CONTRACT_ID"/>
<result property="disPatcherId" column="DISPATCHER_ID"/>
<result property="createBy" column="CREATE_BY"/> <result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/> <result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/> <result property="createName" column="CREATE_NAME"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="deleteFlag" column="DELETE_FLAG"/> <result property="deleteFlag" column="DELETE_FLAG"/>
<result property="errorInfo" column="error_info"/>
<result property="errorBackInfo" column="error_back_info"/>
<result property="errorTime" column="error_time"/>
</resultMap> </resultMap>
<resultMap id="tDispatchInfoPreExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo"> <resultMap id="tDispatchInfoPreExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoPreExportVo">
...@@ -88,6 +95,7 @@ ...@@ -88,6 +95,7 @@
a.PROVIDENT_HOUSEHOLD_NAME, a.PROVIDENT_HOUSEHOLD_NAME,
a.SOCIAL_HOUSEHOLD_NAME, a.SOCIAL_HOUSEHOLD_NAME,
a.TYPE_SUB, a.TYPE_SUB,
a.RECEIVE_TYPE,
a.RECORD_BASE, a.RECORD_BASE,
a.RECORD_BASE_TYPE, a.RECORD_BASE_TYPE,
a.JOIN_LEAVE_DATE, a.JOIN_LEAVE_DATE,
...@@ -98,10 +106,12 @@ ...@@ -98,10 +106,12 @@
a.IS_AUTO_DIS, a.IS_AUTO_DIS,
a.IS_CREATE_DATE, a.IS_CREATE_DATE,
a.CONFIG_NAME, a.CONFIG_NAME,
a.CONFIG_ID,
a.REGISTER_ID, a.REGISTER_ID,
a.PENSION_START, a.PENSION_START,
a.MEDICAL_START, a.MEDICAL_START,
a.UNEMPLOY_START, a.UNEMPLOY_START,
a.SOCIAL_START_DATE,
a.WORK_INJURY_START, a.WORK_INJURY_START,
a.BIRTH_START, a.BIRTH_START,
a.BIGAILMENT_START, a.BIGAILMENT_START,
...@@ -120,7 +130,7 @@ ...@@ -120,7 +130,7 @@
a.CREATE_NAME, a.CREATE_NAME,
a.UPDATE_TIME, a.UPDATE_TIME,
a.CREATE_TIME, a.CREATE_TIME,
a.DELETE_FLAG a.DELETE_FLAG,error_info,error_time,a.DISPATCHER_ID,a.error_back_info
</sql> </sql>
<sql id="tDispatchInfoPre_where"> <sql id="tDispatchInfoPre_where">
<if test="tDispatchInfoPre != null"> <if test="tDispatchInfoPre != null">
...@@ -188,6 +198,9 @@ ...@@ -188,6 +198,9 @@
<if test="tDispatchInfoPre.customerUsername != null and tDispatchInfoPre.customerUsername.trim() != ''"> <if test="tDispatchInfoPre.customerUsername != null and tDispatchInfoPre.customerUsername.trim() != ''">
AND a.CUSTOMER_USERNAME = #{tDispatchInfoPre.customerUsername} AND a.CUSTOMER_USERNAME = #{tDispatchInfoPre.customerUsername}
</if> </if>
<if test="tDispatchInfoPre.customerUserLoginName != null and tDispatchInfoPre.customerUserLoginName.trim() != ''">
AND a.CUSTOMER_USER_LOGIN_NAME = #{tDispatchInfoPre.customerUsername.customerUserLoginName}
</if>
<if test="tDispatchInfoPre.expectedCollectionTime != null"> <if test="tDispatchInfoPre.expectedCollectionTime != null">
AND DATE_FORMAT(a.EXPECTED_COLLECTION_TIME,'%Y-%m-%d') = CURDATE() AND DATE_FORMAT(a.EXPECTED_COLLECTION_TIME,'%Y-%m-%d') = CURDATE()
</if> </if>
...@@ -208,6 +221,9 @@ ...@@ -208,6 +221,9 @@
</if> </if>
<if test="tDispatchInfoPre.contractStatus != null and tDispatchInfoPre.contractStatus.trim() != ''"> <if test="tDispatchInfoPre.contractStatus != null and tDispatchInfoPre.contractStatus.trim() != ''">
AND a.CONTRACT_STATUS = #{tDispatchInfoPre.contractStatus} AND a.CONTRACT_STATUS = #{tDispatchInfoPre.contractStatus}
</if>
<if test="tDispatchInfoPre.failType != null and tDispatchInfoPre.failType.trim() != ''">
AND a.error_info is not null
</if> </if>
<if test="tDispatchInfoPre.authSql != null and tDispatchInfoPre.authSql.trim() != ''"> <if test="tDispatchInfoPre.authSql != null and tDispatchInfoPre.authSql.trim() != ''">
${tDispatchInfoPre.authSql} ${tDispatchInfoPre.authSql}
...@@ -289,4 +305,64 @@ ...@@ -289,4 +305,64 @@
order by a.create_time desc order by a.create_time desc
limit 0,2000 limit 0,2000
</select> </select>
<!--tDispatchInfoPre社保待派单数据查询-->
<select id="getDisPatcherSocialList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo">
SELECT
(@i :=@i+1) as rowIndex,
a.EMP_NAME empName,
a.EMP_IDCARD empIdcard,
a.dept_no deptNo,
a.RECORD_BASE recordBase,
a.SOCIAL_HOUSEHOLD_NAME socialHousehold,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.PENSION_START) as pensionStart,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.MEDICAL_START) as medicalStart,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.WORK_INJURY_START) as workInjuryStart,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.UNEMPLOY_START) as unemployStart,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.BIRTH_START) as birthStart,
if(a.IS_CREATE_DATE = '0',a.SOCIAL_START_DATE,a.BIGAILMENT_START) as bigailmentStart,
a.PAYMENT_TYPE as paymentType,
if(a.PAYMENT_TYPE = '1',PENSION_CARDINAL,null) as pensionCardinal,
if(a.PAYMENT_TYPE = '1',MEDICAL_CARDINAL,null) as medicalCardinal,
if(a.PAYMENT_TYPE = '1',UNEMPLOYMENT_CARDINAL,null) as unemploymentCardinal,
if(a.PAYMENT_TYPE = '1',WORK_INJURY_CARDINAL,null) as workInjuryCardinal,
if(a.PAYMENT_TYPE = '1',BIRTH_CARDINAL,null) as birthCardinal,
if(a.PAYMENT_TYPE = '1',BIGAILMENT_CARDINAL,null) as bigailmentCardinal,
a.id preId,
a.CUSTOMER_USER_LOGIN_NAME as preLoginName,
if(#{type} = '1',concat('手动派单-',a.customer_username),concat('自动化派单-',a.customer_username)) preName
FROM t_dispatch_info_pre a,(select @i:=0) as itable
<where>
1=1
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
AND a.process_status in
<foreach item="status" index="index" collection="statusList" open="(" separator="," close=")">
#{status}
</foreach>
</where>
</select>
<select id="getAllUnDisData" resultMap="tDispatchInfoPreMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_dispatch_info_pre a
where
a.expected_collection_time is not null
and DATE_FORMAT(a.expected_collection_time,"%Y-%m-%d") <![CDATA[ <= ]]> CURDATE()
and a.process_status = '0'
group by a.customer_user_login_name
</select>
<select id="getAllUnDisDataIdList" resultType="java.lang.String">
SELECT
id
FROM t_dispatch_info_pre a
where
a.expected_collection_time is not null
and DATE_FORMAT(a.expected_collection_time,"%Y-%m-%d") <![CDATA[ <= ]]> CURDATE()
and a.process_status in ('1','2','4','8','9')
</select>
</mapper> </mapper>
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