Commit a3ebe62c authored by fangxinjiang's avatar fangxinjiang

入职确认接收及确认修改日志调整-fxj

parent be824495
...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo; ...@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.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.insurances.entity.TInsurancePreDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo; import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
...@@ -71,6 +72,7 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -71,6 +72,7 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "就职岗位") @Schema(description = "就职岗位")
private String position; private String position;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "入职日期") @Schema(description = "入职日期")
private Date joinLeaveDate; private Date joinLeaveDate;
...@@ -100,13 +102,14 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -100,13 +102,14 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "数据来源") @Schema(description = "数据来源")
private String dataSource; private String dataSource;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "预计收集时间") @Schema(description = "预计收集时间")
private Date expectedCollectionTime; private Date expectedCollectionTime;
@Schema(description = "确认人") @Schema(description = "确认人")
private String confirmUser; private String confirmUser;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "确认时间") @Schema(description = "确认时间")
private Date confirmTime; private Date confirmTime;
......
...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog; ...@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLog;
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.TEmployeePreLogSearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
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.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -84,4 +85,16 @@ public class TEmployeePreLogController { ...@@ -84,4 +85,16 @@ public class TEmployeePreLogController {
return R.ok(tEmployeePreLogService.getById(id)); return R.ok(tEmployeePreLogService.getById(id));
} }
/**
* 批量保存入职确认信息变更日志(内部接口)
*
* @param preLogList 日志列表
* @return Boolean
*/
@Inner
@PostMapping("/inner/saveBatch")
public Boolean saveBatch(@RequestBody List<TEmployeePreLog> preLogList) {
return tEmployeePreLogService.saveBatch(preLogList);
}
} }
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeePreLogDetail;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeePreLogDetailService;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeprelogdetail")
@Tag(name = "入职确认信息变更日志明细表管理")
public class TEmployeePreLogDetailController {
private final TEmployeePreLogDetailService tEmployeePreLogDetailService;
/**
* 批量保存入职确认信息变更日志明细(内部接口)
*
* @param detailList 日志明细列表
* @return Boolean
*/
@Inner
@PostMapping("/inner/saveBatch")
public Boolean saveBatch(@RequestBody List<TEmployeePreLogDetail> detailList) {
return tEmployeePreLogDetailService.saveBatch(detailList);
}
}
...@@ -176,6 +176,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -176,6 +176,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
IGNORE_FIELD.add("fundUpdateFlag"); IGNORE_FIELD.add("fundUpdateFlag");
IGNORE_FIELD.add("socialUpdateFlag"); IGNORE_FIELD.add("socialUpdateFlag");
IGNORE_FIELD.add("contractUpdateFlag"); IGNORE_FIELD.add("contractUpdateFlag");
IGNORE_FIELD.add("isLeave");
IGNORE_FIELD.add("isRefuse");
} }
private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>(); private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>();
...@@ -189,6 +191,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -189,6 +191,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
PRE_IGNORE_FIELD.add("fundUpdateFlag"); PRE_IGNORE_FIELD.add("fundUpdateFlag");
PRE_IGNORE_FIELD.add("socialUpdateFlag"); PRE_IGNORE_FIELD.add("socialUpdateFlag");
PRE_IGNORE_FIELD.add("contractUpdateFlag"); PRE_IGNORE_FIELD.add("contractUpdateFlag");
PRE_IGNORE_FIELD.add("isLeave");
PRE_IGNORE_FIELD.add("isRefuse");
} }
private static final List<String> CONTRACT_IGNORE_FIELD = new ArrayList<>(); private static final List<String> CONTRACT_IGNORE_FIELD = new ArrayList<>();
...@@ -215,6 +219,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -215,6 +219,8 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
CONTRACT_IGNORE_FIELD.add("internshipPeriodNum"); CONTRACT_IGNORE_FIELD.add("internshipPeriodNum");
CONTRACT_IGNORE_FIELD.add("tryPeriodNum"); CONTRACT_IGNORE_FIELD.add("tryPeriodNum");
CONTRACT_IGNORE_FIELD.add("fundUpdateFlag"); CONTRACT_IGNORE_FIELD.add("fundUpdateFlag");
CONTRACT_IGNORE_FIELD.add("isLeave");
CONTRACT_IGNORE_FIELD.add("isRefuse");
} }
private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>(); private static final List<String> SOCIAL_IGNORE_FIELD = new ArrayList<>();
...@@ -249,6 +255,43 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -249,6 +255,43 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
SOCIAL_IGNORE_FIELD.add("lowerLimit"); SOCIAL_IGNORE_FIELD.add("lowerLimit");
SOCIAL_IGNORE_FIELD.add("fundUpdateFlag"); SOCIAL_IGNORE_FIELD.add("fundUpdateFlag");
SOCIAL_IGNORE_FIELD.add("processStatus"); SOCIAL_IGNORE_FIELD.add("processStatus");
SOCIAL_IGNORE_FIELD.add("isLeave");
SOCIAL_IGNORE_FIELD.add("isRefuse");
}
private static final List<String> SOCIAL_IGNORE_FIELD_TWO = new ArrayList<>();
static {
SOCIAL_IGNORE_FIELD_TWO.add("joinLeaveDate");
SOCIAL_IGNORE_FIELD_TWO.add("createTime");
SOCIAL_IGNORE_FIELD_TWO.add("empName");
SOCIAL_IGNORE_FIELD_TWO.add("phone");
SOCIAL_IGNORE_FIELD_TWO.add("employeeName");
SOCIAL_IGNORE_FIELD_TWO.add("empIdcard");
SOCIAL_IGNORE_FIELD_TWO.add("deptNo");
SOCIAL_IGNORE_FIELD_TWO.add("deptName");
SOCIAL_IGNORE_FIELD_TWO.add("deptId");
SOCIAL_IGNORE_FIELD_TWO.add("customerUsername");
SOCIAL_IGNORE_FIELD_TWO.add("customerUserLoginname");
SOCIAL_IGNORE_FIELD_TWO.add("position");
SOCIAL_IGNORE_FIELD_TWO.add("contractId");
SOCIAL_IGNORE_FIELD_TWO.add("errorBackInfo");
SOCIAL_IGNORE_FIELD_TWO.add("errorInfo");
SOCIAL_IGNORE_FIELD_TWO.add("errorTime");
SOCIAL_IGNORE_FIELD_TWO.add("socialFundId");
SOCIAL_IGNORE_FIELD_TWO.add("dispatcherId");
SOCIAL_IGNORE_FIELD_TWO.add("contractStatus");
SOCIAL_IGNORE_FIELD_TWO.add("typeSub");
SOCIAL_IGNORE_FIELD_TWO.add("registerId");
SOCIAL_IGNORE_FIELD_TWO.add("createBy");
SOCIAL_IGNORE_FIELD_TWO.add("createName");
SOCIAL_IGNORE_FIELD_TWO.add("updateBy");
SOCIAL_IGNORE_FIELD_TWO.add("id");
SOCIAL_IGNORE_FIELD_TWO.add("expectedCollectionType");
SOCIAL_IGNORE_FIELD_TWO.add("upperLimit");
SOCIAL_IGNORE_FIELD_TWO.add("lowerLimit");
SOCIAL_IGNORE_FIELD_TWO.add("fundUpdateFlag");
SOCIAL_IGNORE_FIELD_TWO.add("isLeave");
SOCIAL_IGNORE_FIELD_TWO.add("isRefuse");
} }
...@@ -428,7 +471,24 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -428,7 +471,24 @@ 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 (!oldInfo.getServerItem().contains("合同") && newInfo.getServerItem().contains("合同")
&& Common.isNotNull(employeeContractPre)
&& null != newInfo.getContractUpdateFlag() && newInfo.getContractUpdateFlag()) {
//1.9.11 huych 附件类型不比较差异
employeeContractPre.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.ONE_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setLogBaseInfo(empPreId, null, employeeContractPre, user, differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
//删除旧合同
} else if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//记录操作记录 //记录操作记录
contractOld.setAttaList(null); contractOld.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
...@@ -481,6 +541,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -481,6 +541,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
.in(TEmployeeContractPre::getProcessStatus, Arrays.asList("0","1","3","5","7","10","11")) .in(TEmployeeContractPre::getProcessStatus, Arrays.asList("0","1","3","5","7","10","11"))
.eq(TEmployeeContractPre::getId,contractOld.getId())); .eq(TEmployeeContractPre::getId,contractOld.getId()));
} }
//修改合同
if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null if (newInfo.getServerItem().contains("合同") && contractOld != null && employeeContractPre != null
&& null != newInfo.getContractUpdateFlag() && newInfo.getContractUpdateFlag()) { && null != newInfo.getContractUpdateFlag() && newInfo.getContractUpdateFlag()) {
//1.9.11 huych 附件类型不比较差异 //1.9.11 huych 附件类型不比较差异
...@@ -506,8 +567,46 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -506,8 +567,46 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
} }
String differenceSocialKey; String differenceSocialKey;
if (newInfo.getServerItem().contains("社保") && null != newInfo.getSocialUpdateFlag() // 查询老的社保明细
&& newInfo.getSocialUpdateFlag() && (Common.isEmpty(isSocailBuyOld) || 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 (!oldInfo.getServerItem().contains("社保") && newInfo.getServerItem().contains("社保")
&& null != newInfo.getSocialUpdateFlag() && newInfo.getSocialUpdateFlag()) {
// 单独记录是否已购买社保的变更记录
if (Common.isEmpty(isSocailBuyOld) || (Common.isNotNull(isSocailBuyOld) && !isSocailBuyOld.equals(isSocailBuyNew))) {
differenceSocialKey = "socialIsBuy";
TEmployeePreLogDetail detailSocialLog = new TEmployeePreLogDetail();
detailSocialLog.setModelType(CommonConstants.ONE_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);
}
// 记录社保明细新增日志
if (dispatchInfoPreVo != null) {
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.ONE_STRING);
detailEmpLog.setType(CommonConstants.FOUR_STRING);
this.setLogBaseInfo(empPreId, null, dispatchInfoPreVo, user, null, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息";
} else {
diffTitle = "社保信息";
}
// 是否已购买记录
} else if (newInfo.getServerItem().contains("社保") && null != newInfo.getSocialUpdateFlag()
&& newInfo.getSocialUpdateFlag() && (Common.isEmpty(isSocailBuyOld) ||
(Common.isNotNull(isSocailBuyOld) && !isSocailBuyOld.equals(isSocailBuyNew)))) { (Common.isNotNull(isSocailBuyOld) && !isSocailBuyOld.equals(isSocailBuyNew)))) {
//单独记录是否已购买社保的变更记录 //单独记录是否已购买社保的变更记录
differenceSocialKey = "socialIsBuy"; differenceSocialKey = "socialIsBuy";
...@@ -526,14 +625,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -526,14 +625,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
diffTitle = "社保信息"; diffTitle = "社保信息";
} }
} }
//查询老的社保明细 // 删除:如果之前包含社保,现在不包含社保,记录删除日志
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("社保")) { if (!newInfo.getServerItem().contains("社保") && oldInfo.getServerItem().contains("社保")) {
//删除社保待购买相关数据 //删除社保待购买相关数据
socialDaprUtils.deleteUnProcessSocialPreInfo(empPreId); socialDaprUtils.deleteUnProcessSocialPreInfo(empPreId);
...@@ -552,12 +644,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -552,12 +644,11 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
diffTitle = "社保信息"; diffTitle = "社保信息";
} }
} }
} //修改
} else if (newInfo.getServerItem().contains("社保")&& null != newInfo.getSocialUpdateFlag()
if (newInfo.getServerItem().contains("社保")&& null != newInfo.getSocialUpdateFlag()
&& newInfo.getSocialUpdateFlag() && dispatchInfoPreOldVo != null && dispatchInfoPreVo != null) { && newInfo.getSocialUpdateFlag() && dispatchInfoPreOldVo != null && dispatchInfoPreVo != null) {
differenceSocialKey = HrEquator.comparisonValueIgnoreField(dispatchInfoPreOldVo differenceSocialKey = HrEquator.comparisonValueIgnoreField(dispatchInfoPreOldVo
, dispatchInfoPreVo, SOCIAL_IGNORE_FIELD); , dispatchInfoPreVo, SOCIAL_IGNORE_FIELD_TWO);
if (differenceSocialKey.length() > 0) { if (differenceSocialKey.length() > 0) {
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
diffTitle += "、社保信息"; diffTitle += "、社保信息";
...@@ -575,7 +666,45 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -575,7 +666,45 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
// 公积金处理逻辑 // 公积金处理逻辑
String differenceFundKey; String differenceFundKey;
if (newInfo.getServerItem().contains("公积金") && null != newInfo.getFundUpdateFlag() // 查询老的公积金明细
R<EmployeePreSocialListVo> fundSdr = socialDaprUtils.getFundPreInfoList(empPreId);
TDispatchInfoPreVo dispatchInfoFundPreOldVo = null;
if (fundSdr != null && fundSdr.getData() != null && null != fundSdr.getData().getDispatchInfoPreFundVo()) {
dispatchInfoFundPreOldVo = fundSdr.getData().getDispatchInfoPreFundVo();
}
TDispatchInfoPreVo dispatchInfoFundPreVo = newInfo.getDispatchInfoFundPreVo();
// 如果之前不包含公积金,现在包含公积金,记录新增日志
if (!oldInfo.getServerItem().contains("公积金") && newInfo.getServerItem().contains("公积金")
&& null != newInfo.getFundUpdateFlag() && newInfo.getFundUpdateFlag()) {
// 单独记录是否已购买公积金的变更记录
if (Common.isEmpty(isFundBuyOld) || (Common.isNotNull(isFundBuyOld) && !isFundBuyOld.equals(isFundBuyNew))) {
differenceFundKey = "fundIsBuy";
TEmployeePreLogDetail detailFundLog = new TEmployeePreLogDetail();
detailFundLog.setModelType(CommonConstants.ONE_STRING);
detailFundLog.setType(CommonConstants.FIVE_STRING);
Map<String,Object> old = new HashMap<>();
old.put("fundIsBuy", isFundBuyOld);
Map<String,Object> simNew = new HashMap<>();
simNew.put("fundIsBuy", isFundBuyNew);
this.setLogBaseInfo(empPreId, old, simNew, user, differenceFundKey, logId, detailFundLog);
detailList.add(detailFundLog);
}
// 记录公积金明细新增日志
if (dispatchInfoFundPreVo != null) {
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.ONE_STRING);
detailEmpLog.setType(CommonConstants.FIVE_STRING);
this.setLogBaseInfo(empPreId, null, dispatchInfoFundPreVo, user, null, logId, detailEmpLog);
detailList.add(detailEmpLog);
}
if (Common.isNotNull(diffTitle)) {
diffTitle += "、公积金信息";
} else {
diffTitle = "公积金信息";
}
// 是否已有修改记录更新
} else if (newInfo.getServerItem().contains("公积金") && null != newInfo.getFundUpdateFlag()
&& newInfo.getFundUpdateFlag() && (Common.isEmpty(isFundBuyOld) || && newInfo.getFundUpdateFlag() && (Common.isEmpty(isFundBuyOld) ||
(Common.isNotNull(isFundBuyOld) && !isFundBuyOld.equals(isFundBuyNew)))) { (Common.isNotNull(isFundBuyOld) && !isFundBuyOld.equals(isFundBuyNew)))) {
//单独记录是否已购买公积金的变更记录 //单独记录是否已购买公积金的变更记录
...@@ -595,14 +724,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -595,14 +724,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
diffTitle = "公积金信息"; diffTitle = "公积金信息";
} }
} }
//查询老的公积金明细 // 删除:如果之前包含公积金,现在不包含公积金,记录删除日志
R<EmployeePreSocialListVo> fundSdr = socialDaprUtils.getFundPreInfoList(empPreId);
TDispatchInfoPreVo dispatchInfoFundPreOldVo = null;
if (fundSdr != null && fundSdr.getData() != null && null != fundSdr.getData().getDispatchInfoPreFundVo()) {
dispatchInfoFundPreOldVo = fundSdr.getData().getDispatchInfoPreFundVo();
}
TDispatchInfoPreVo dispatchInfoFundPreVo = newInfo.getDispatchInfoFundPreVo();
if (!newInfo.getServerItem().contains("公积金") && oldInfo.getServerItem().contains("公积金")) { if (!newInfo.getServerItem().contains("公积金") && oldInfo.getServerItem().contains("公积金")) {
//删除公积金待购买相关数据 //删除公积金待购买相关数据
socialDaprUtils.deleteUnProcessFundPreInfo(empPreId); socialDaprUtils.deleteUnProcessFundPreInfo(empPreId);
...@@ -621,14 +743,13 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -621,14 +743,13 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
diffTitle = "公积金信息"; diffTitle = "公积金信息";
} }
} }
} // 修改记录日志
} else if (newInfo.getServerItem().contains("公积金") && null != newInfo.getFundUpdateFlag()
if (newInfo.getServerItem().contains("公积金") && null != newInfo.getFundUpdateFlag()
&& newInfo.getFundUpdateFlag() && dispatchInfoFundPreOldVo != null && newInfo.getFundUpdateFlag() && dispatchInfoFundPreOldVo != null
&& dispatchInfoFundPreVo != null) { && dispatchInfoFundPreVo != null) {
//initFundTime(dispatchInfoFundPreVo); //initFundTime(dispatchInfoFundPreVo);
differenceFundKey = HrEquator.comparisonValueIgnoreField(dispatchInfoFundPreOldVo differenceFundKey = HrEquator.comparisonValueIgnoreField(dispatchInfoFundPreOldVo
, dispatchInfoFundPreVo, SOCIAL_IGNORE_FIELD); , dispatchInfoFundPreVo, SOCIAL_IGNORE_FIELD_TWO);
if (differenceFundKey.length() > 0) { if (differenceFundKey.length() > 0) {
if (Common.isNotNull(diffTitle)) { if (Common.isNotNull(diffTitle)) {
diffTitle += "、公积金信息"; diffTitle += "、公积金信息";
...@@ -953,7 +1074,23 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -953,7 +1074,23 @@ 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 (!oldInfo.getServerItem().contains("合同") && newInfo.getServerItem().contains("合同")
&& Common.isNotNull(employeeContractPre)
&& null != newInfo.getContractUpdateFlag() && newInfo.getContractUpdateFlag()) {
//1.9.11 huych 附件类型不比较差异
employeeContractPre.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail();
detailEmpLog.setModelType(CommonConstants.ONE_STRING);
detailEmpLog.setType(CommonConstants.THREE_STRING);
this.setPreLogBaseInfo(empPreId, null, employeeContractPre, userId, nickName, differenceContractKey, logId, detailEmpLog);
detailList.add(detailEmpLog);
if (Common.isNotNull(diffTitle)) {
diffTitle += "、合同信息";
} else {
diffTitle = "合同信息";
}
} else if (!newInfo.getServerItem().contains("合同") && oldInfo.getServerItem().contains("合同") && Common.isNotNull(contractOld)) {
//记录操作记录 //记录操作记录
contractOld.setAttaList(null); contractOld.setAttaList(null);
detailEmpLog = new TEmployeePreLogDetail(); detailEmpLog = new TEmployeePreLogDetail();
......
...@@ -3,10 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util; ...@@ -3,10 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.common.dapr.util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysCspDeptVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TBusinessEmployeeExtendInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
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;
...@@ -783,5 +780,47 @@ public class ArchivesDaprUtil { ...@@ -783,5 +780,47 @@ public class ArchivesDaprUtil {
} }
return res; return res;
} }
/**
* @Description: 批量保存入职确认信息变更日志
* @Author: fxj
* @Date: 2026-04-16
* @param preLogList 日志主表列表
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> savePreLogBatch(List<TEmployeePreLog> preLogList){
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
"/temployeeprelog/inner/saveBatch",
JSON.toJSONString(preLogList),
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("保存入职确认信息变更日志失败!");
}
return res;
}
/**
* @Description: 批量保存入职确认信息变更日志明细
* @Author: fxj
* @Date: 2026-04-16
* @param detailList 日志明细列表
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> savePreLogDetailBatch(List<TEmployeePreLogDetail> detailList){
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
"/temployeeprelogdetail/inner/saveBatch",
JSON.toJSONString(detailList),
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("保存入职确认信息变更日志明细失败!");
}
return res;
}
} }
...@@ -1726,6 +1726,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -1726,6 +1726,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
} }
socialDaprUtils.saveFundPreInfo(preVo); socialDaprUtils.saveFundPreInfo(preVo);
} }
//确认接收时增加 档案、商险、合同、社保、公积金的变更日志 (具体产生哪些日志按服务事项(serverItem)来生成),参考 tEmployeePreLogService.saveModifyAndUpdateInsurance的实现,只处理日志
saveConfirmReceiveLog(domainR.getData(), preVo, user);
} }
}catch (Exception e) { }catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
...@@ -3236,9 +3238,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3236,9 +3238,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
StringBuilder diffTitleBuilder = new StringBuilder(); StringBuilder diffTitleBuilder = new StringBuilder();
// 1. 档案信息日志(type=1) // 1. 档案信息日志(type=1)
// 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象)
String differenceArchiveKey = HrEquator.comparisonValueIgnoreField(
new EmployeeRegistrationPreVo(), preVo, PRE_IGNORE_FIELD);
TEmployeePreLogDetail archiveDetail = new TEmployeePreLogDetail(); TEmployeePreLogDetail archiveDetail = new TEmployeePreLogDetail();
archiveDetail.setModelType(CommonConstants.ONE_STRING); // 1新增 archiveDetail.setModelType(CommonConstants.ONE_STRING); // 1新增
archiveDetail.setType(CommonConstants.ONE_STRING); // 1档案 archiveDetail.setType(CommonConstants.ONE_STRING); // 1档案
...@@ -3246,7 +3245,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3246,7 +3245,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
archiveDetail.setPreLogId(logId); archiveDetail.setPreLogId(logId);
archiveDetail.setOldInfo(null); // old对象为空 archiveDetail.setOldInfo(null); // old对象为空
archiveDetail.setNewInfo(JSON.toJSONString(preVo)); archiveDetail.setNewInfo(JSON.toJSONString(preVo));
//archiveDetail.setDifferenceInfo(Common.isNotNull(differenceArchiveKey) ? differenceArchiveKey : "employeeRegistrationPre"); archiveDetail.setDifferenceInfo(null);
archiveDetail.setCreateBy(user.getId()); archiveDetail.setCreateBy(user.getId());
archiveDetail.setCreateName(user.getNickname()); archiveDetail.setCreateName(user.getNickname());
detailList.add(archiveDetail); detailList.add(archiveDetail);
...@@ -3287,9 +3286,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3287,9 +3286,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
insuranceDetail.setOldInfo(null); insuranceDetail.setOldInfo(null);
insuranceDetail.setNewInfo(JSON.toJSONString(insurancePre)); insuranceDetail.setNewInfo(JSON.toJSONString(insurancePre));
// 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象) // 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象)
String differenceInsuranceKey = HrEquator.comparisonValueIgnoreField( insuranceDetail.setDifferenceInfo(null);
new TEmployeeInsurancePreVo(), insurancePre, INSURANCE_IGNORE_FIELD);
//insuranceDetail.setDifferenceInfo(Common.isNotNull(differenceInsuranceKey) ? differenceInsuranceKey : "insurancePreList");
insuranceDetail.setCreateBy(user.getId()); insuranceDetail.setCreateBy(user.getId());
insuranceDetail.setCreateName(user.getNickname()); insuranceDetail.setCreateName(user.getNickname());
detailList.add(insuranceDetail); detailList.add(insuranceDetail);
...@@ -3312,10 +3309,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3312,10 +3309,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
contractDetail.setPreLogId(logId); contractDetail.setPreLogId(logId);
contractDetail.setOldInfo(null); contractDetail.setOldInfo(null);
contractDetail.setNewInfo(JSON.toJSONString(preVo.getEmployeeContractPreVos())); contractDetail.setNewInfo(JSON.toJSONString(preVo.getEmployeeContractPreVos()));
// 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象) contractDetail.setDifferenceInfo(null);
String differenceContractKey = HrEquator.comparisonValueIgnoreField(
new TEmployeeContractPreVo(), preVo.getEmployeeContractPreVos(), CONTRACT_IGNORE_FIELD);
//contractDetail.setDifferenceInfo(Common.isNotNull(differenceContractKey) ? differenceContractKey : "employeeContractPre");
contractDetail.setCreateBy(user.getId()); contractDetail.setCreateBy(user.getId());
contractDetail.setCreateName(user.getNickname()); contractDetail.setCreateName(user.getNickname());
detailList.add(contractDetail); detailList.add(contractDetail);
...@@ -3354,10 +3348,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3354,10 +3348,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
socialDetail.setPreLogId(logId); socialDetail.setPreLogId(logId);
socialDetail.setOldInfo(null); socialDetail.setOldInfo(null);
socialDetail.setNewInfo(JSON.toJSONString(preVo.getDispatchInfoPreVo())); socialDetail.setNewInfo(JSON.toJSONString(preVo.getDispatchInfoPreVo()));
// 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象) socialDetail.setDifferenceInfo(null);
String differenceSocialKey = HrEquator.comparisonValueIgnoreField(
new TDispatchInfoPreVo(), preVo.getDispatchInfoPreVo(), SOCIAL_IGNORE_FIELD);
//socialDetail.setDifferenceInfo(Common.isNotNull(differenceSocialKey) ? differenceSocialKey : "dispatchInfoPreVo");
socialDetail.setCreateBy(user.getId()); socialDetail.setCreateBy(user.getId());
socialDetail.setCreateName(user.getNickname()); socialDetail.setCreateName(user.getNickname());
detailList.add(socialDetail); detailList.add(socialDetail);
...@@ -3397,10 +3388,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -3397,10 +3388,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
fundDetail.setPreLogId(logId); fundDetail.setPreLogId(logId);
fundDetail.setOldInfo(null); fundDetail.setOldInfo(null);
fundDetail.setNewInfo(JSON.toJSONString(preVo.getDispatchInfoFundPreVo())); fundDetail.setNewInfo(JSON.toJSONString(preVo.getDispatchInfoFundPreVo()));
// 使用 HrEquator 比较差异字段(新增时 old 为空,传入空对象) fundDetail.setDifferenceInfo(null);
String differenceFundKey = HrEquator.comparisonValueIgnoreField(
new TDispatchInfoPreVo(), preVo.getDispatchInfoFundPreVo(), SOCIAL_IGNORE_FIELD);
//fundDetail.setDifferenceInfo(Common.isNotNull(differenceFundKey) ? differenceFundKey : "dispatchInfoFundPreVo");
fundDetail.setCreateBy(user.getId()); fundDetail.setCreateBy(user.getId());
fundDetail.setCreateName(user.getNickname()); fundDetail.setCreateName(user.getNickname());
detailList.add(fundDetail); detailList.add(fundDetail);
......
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