Commit 24b68e38 authored by fangxinjiang's avatar fangxinjiang

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

parents a2146a39 b37d8f4f
......@@ -551,6 +551,13 @@ public class TEmployeeContractInfo extends BaseEntity {
@TableField(exist = false)
private String preName;
/**
* 离职待办的用户名称
*/
@Schema(description = "离职待办的用户名称")
@TableField(exist = false)
private String leaveName;
/**
* 试用期(单位月)
*/
......
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
......@@ -252,4 +253,12 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
@ExcelAttribute(name = "preName")
@ExcelProperty(value ="preName")
private String preName;
/**
* 离职待办的用户名称
*/
@Schema(description = "离职待办的用户名称")
@TableField(exist = false)
private String leaveName;
}
......@@ -200,7 +200,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
user = this.getNewYifuUser();
user = this.getNewYifuUser(tEmployeeContractInfo.getLeaveName());
}
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
......@@ -508,6 +508,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
initType(tEmployeeContractInfo);
if (Common.isEmpty(tEmployeeContractInfo.getId())) {
if (Common.isEmpty(tEmployeeContractInfo.getApplyNo())) {
String code = this.getCode(true);
tEmployeeContractInfo.setApplyNo(code);
}
// 针对编码再做一次重复性校验
String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
if (Common.isNotNull(isCur)) {
......@@ -701,6 +705,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
audit.setCreateBy("1");
audit.setCreateTime(LocalDateTime.now());
}
if (Common.isNotNull(tEmployeeContractInfo.getLeaveName())) {
audit.setCreateName(tEmployeeContractInfo.getLeaveName());
audit.setCreateBy("1");
audit.setCreateTime(LocalDateTime.now());
}
tEmployeeContractAuditMapper.updateById(audit);
}
}
......@@ -957,6 +966,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
//审核通过瓜子合同状态更新合同审核通过
updateGzOfferStatus(contractInfo,CommonConstants.THIRTEEN_STRING,CommonConstants.EIGHT_STRING,user.getId(),user.getNickname());
}
if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())) {
// 合同终止,通知离职待办变更状态
this.sendLeave(contractInfo.getId(), CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, tEmployeeContractInfo.getAuditRemark(), user);
}
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[3]) {
if (!fascFlag) {
......@@ -970,6 +984,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
contractPreMapper.updateById(contractPre);
}
}
if (EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation())) {
// 合同终止,通知离职待办变更状态
this.sendLeave(contractInfo.getId(), CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, tEmployeeContractInfo.getAuditRemark(), user);
}
}
tEmployeeContractInfo.setAuditUserName(user.getNickname());
tEmployeeContractInfo.setContractNo(contractInfo.getContractNo());
......@@ -1309,6 +1327,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
public BaseSearchListVO leaveToReduceContract(BaseSearchListVO paramVo) {
List<String> idList = new ArrayList<>();
List<BaseSearchVO> listParam = paramVo.getListParam();
String userName = paramVo.getUserName();
Map<String, BaseSearchVO> paramMap = new HashMap<>();
for (BaseSearchVO param : listParam) {
idList.add(param.getSearchKey());
......@@ -1327,6 +1346,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
for (EmployeeContractVO vo : excelVOList) {
i++;
vo.setRowIndex(i);
vo.setLeaveName(userName);
baseSearchVO = paramMap.get(vo.getContractId());
leaveId = null;
if (baseSearchVO != null) {
......@@ -2505,16 +2525,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
private YifuUser getNewYifuUser() {
private YifuUser getNewYifuUser(String leaveName) {
if (Common.isEmpty(leaveName)) {
leaveName = "自动化派单";
}
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
return new YifuUser("6", 1L, "", "自动化派单",
"自动化派单", "0", SecurityConstants.BCRYPT + "123456",
return new YifuUser("6", 1L, "", leaveName,
leaveName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
}
}
......@@ -129,6 +129,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired
@Lazy
private EmployeeRegistrationPreService registrationPreService;
private StringBuilder errorTemp;
@Override
public TSalaryStandardSelectViewVo getUnProjectEmpList(List<TSalaryStandardUnprojectVo> voList) {
......@@ -766,10 +767,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessage.append(";");
errorMessage.append(leaveReason);
errorMessage.append(";");
if (Common.isEmpty(excel.getLeaveRemark())) {
errorMessage.append("");
errorMessage.append(";");
}
// 倩倩说优化一下,没有这个就不显示,且这段特殊逻辑代码不删除,以作历史记录(历史代码是wzb写的,应该是特殊要求
/*if Common.isEmpty(excel.getLeaveRemark(
errorMessage.append("")
errorMessage.append(";")
*/
if (Common.isNotNull(excel.getLeaveRemark())) {
errorMessage.append(excel.getLeaveRemark());
errorMessage.append(";");
......
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
......@@ -26,6 +27,7 @@ import lombok.Data;
* @date 2025-11-19 19:23:15
*/
@Data
@ColumnWidth(17)
public class EmployeeRegistrationLeaveConfirmExportVo {
@ExcelProperty("项目名称")
......
......@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
/**
......@@ -26,6 +27,7 @@ import lombok.Data;
* @date 2025-11-19 19:23:15
*/
@Data
@ColumnWidth(17)
public class EmployeeRegistrationLeaveExportVo {
@ExcelProperty("项目名称")
......
......@@ -584,6 +584,9 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
if (Common.isEmpty(doTypeWu) && Common.isEmpty(doTypeYi)) {
return R.failed("请选择处理项");
}
if (Common.isNotNull(remark) && remark.length()>200) {
return R.failed("无需处理原因超过200字!");
}
if (leave != null) {
StringBuilder errorInfo = new StringBuilder();
StringBuilder logInfo = new StringBuilder("手动关闭:");
......@@ -1041,7 +1044,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
private R<List<EmployeeRegistrationLeave>> batchDoLeaveCore(List<EmployeeRegistrationLeave> leaveList, String isExit, String doType, YifuUser user) {
private R<List<EmployeeRegistrationLeave>> batchDoLeaveCore(List<EmployeeRegistrationLeave> leaveList, String isExit
, String doType, YifuUser user) {
if (Common.isEmpty(leaveList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
......@@ -1058,26 +1062,32 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
List<BaseSearchVO> listParamProject = new ArrayList<>();
List<BaseSearchVO> listParamEmp = new ArrayList<>();
BaseSearchVO searchVo;
int i = 0;
// 离职待办与商险的映射
Map<String, List<String>> leaveInsuranceMap = new HashMap<>();
// 单一离职待办里的商险
List<String> insuranceList;
String[] insuranceArr;
String errorMessage;
// 1社保2公积金3商险4合同5项目档案6人员档案
List<EmployeeRegistrationLeaveLog> logList = new ArrayList<>();
EmployeeRegistrationLeaveLog leaveLog;
String preContent = "立即发起全部日期的事项:";
if (Common.isNotNull(isExit) && isExit.equals(CommonConstants.ONE_STRING)) {
preContent += "立即发起今日及之前的事项:";
}
StringBuilder logSubType;
for (EmployeeRegistrationLeave leave : leaveList) {
i++;
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(leave.getSocialDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getSocialExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusSocial())
&& (leave.getDoStatusSocial().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.SIX_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.TEN_STRING)
)
) {
//日志
leaveLog = new EmployeeRegistrationLeaveLog();
leaveLog.setLeaveId(leave.getId());
leaveLog.setCreateName(user.getNickname());
leaveLog.setCreateTime(LocalDateTime.now());
leaveLog.setContent(preContent);
logSubType = new StringBuilder();
if (judgeToUpdateSocial(isExit, doType, nowTime, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.ONE_INT]).append(CommonConstants.DUNHAO_STRING);
leave.setFailSocialUser(userName);
vo = new TDispatchReduceVo();
vo.setLeaveId(leave.getId());
......@@ -1088,18 +1098,16 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
vo.setReasonType(leave.getLeaveReasonId());
vo.setTrustRemark(leave.getSocialTrustRemark());
vo.setChangeContractAndEmployee(CommonConstants.ONE_STRING);
if (Common.isNotNull(leave.getJoinLeaveDate())) {
try {
vo.setLeaveDate(DateUtil.parseDate(leave.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
} catch (Exception e) {
}
}
socialOldList.add(vo);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.TWO_STRING))
&& Common.isNotNull(leave.getFundDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getFundExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusFund())
&& (leave.getDoStatusFund().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.TEN_STRING)
)
) {
if (judgeToUpdateFund(isExit, doType, nowTime, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.TWO_INT]).append(CommonConstants.DUNHAO_STRING);
leave.setFailFundUser(userName);
vo = new TDispatchReduceVo();
vo.setLeaveId(leave.getId());
......@@ -1110,17 +1118,16 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
vo.setReasonType(leave.getLeaveReasonId());
vo.setTrustRemark(leave.getFundTrustRemark());
vo.setChangeContractAndEmployee(CommonConstants.ONE_STRING);
if (Common.isNotNull(leave.getJoinLeaveDate())) {
try {
vo.setLeaveDate(DateUtil.parseDate(leave.getJoinLeaveDate(), DateUtil.ISO_EXPANDED_DATE_FORMAT));
} catch (Exception e) {
}
}
fundOldList.add(vo);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.THREE_STRING))
&& Common.isNotNull(leave.getInsuranceIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getInsuranceExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusInsurance())
&& (leave.getDoStatusInsurance().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.NINE_STRING)
)
) {
if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.THREE_INT]).append(CommonConstants.DUNHAO_STRING);
insuranceArr = leave.getInsuranceIdOld().split(",");
insuranceList = new ArrayList<>();
for (String id : insuranceArr) {
......@@ -1129,15 +1136,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
leaveInsuranceMap.put(leave.getId(), insuranceList);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.FOUR_STRING))
&& Common.isNotNull(leave.getContractIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getContractExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusContract())
&& (leave.getDoStatusContract().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.TEN_STRING)
)
) {
if (judgeToUpdateContract(isExit, doType, nowTime, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.FOUR_INT]).append(CommonConstants.DUNHAO_STRING);
leave.setFailContractUser(userName);
searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getContractIdOld());
......@@ -1151,13 +1151,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
listParamContract.add(searchVo);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.FIVE_STRING))
&& Common.isNotNull(leave.getEmpProjectIdOld())
&& Common.isNotNull(leave.getDoStatusProject())
&& (leave.getDoStatusProject().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusProject().equals(CommonConstants.NINE_STRING)
)
) {
if (judgeToUpdateProject(doType, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.FIVE_INT]).append(CommonConstants.DUNHAO_STRING);
leave.setFailEmpUser(userName);
searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getEmpProjectIdOld());
......@@ -1172,13 +1167,8 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
listParamProject.add(searchVo);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(leave.getEmpIdOld())
&& Common.isNotNull(leave.getDoStatusEmp())
&& (leave.getDoStatusEmp().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusEmp().equals(CommonConstants.NINE_STRING)
)
) {
if (judgeToUpdateEmp(doType, leave) ) {
logSubType.append(RegistConstants.DO_TYPE_ARR[CommonConstants.SIX_INT]).append(CommonConstants.DUNHAO_STRING);
leave.setFailEmpProjectUser(userName);
searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getEmpProjectIdOld());
......@@ -1192,15 +1182,20 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
listParamEmp.add(searchVo);
}
if (logSubType.length() > 0) {
logSubType.setLength(logSubType.length() - 1); // 长度减1,去掉最后一个
leaveLog.setContent(preContent + logSubType);
logList.add(leaveLog);
}
}
//组装返回给前端
List<ErrorMessage> socialParamList = new ArrayList<>();
List<ErrorMessage> fundParamList = new ArrayList<>();
List<ErrorMessage> insuranceParamList = new ArrayList<>();
List<ErrorMessage> contractParamList = new ArrayList<>();
List<ErrorMessage> projectParamList = new ArrayList<>();
List<ErrorMessage> empParamList = new ArrayList<>();
List<ErrorMessage> socialParamList ;
List<ErrorMessage> fundParamList ;
List<ErrorMessage> insuranceParamList ;
List<ErrorMessage> contractParamList ;
List<ErrorMessage> projectParamList ;
List<ErrorMessage> empParamList ;
// 社保-完成
if (!socialOldList.isEmpty()) {
TDispatchReduceListVo paramListVo = new TDispatchReduceListVo();
......@@ -1224,6 +1219,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateSocial(isExit, doType, nowTime, leave) ) {
// 成功
if (successMap.get(leave.getId()) != null) {
leave.setSocialId(successMap.get(leave.getId()));
......@@ -1241,6 +1237,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
}
}
// 公积金-完成
if (!fundOldList.isEmpty()) {
TDispatchReduceListVo paramListVo = new TDispatchReduceListVo();
......@@ -1264,6 +1261,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateFund(isExit, doType, nowTime, leave) ) {
// 成功
if (successMap.get(leave.getId()) != null) {
leave.setFundId(successMap.get(leave.getId()));
......@@ -1281,6 +1279,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
}
}
// 商险-完成
if (!insuranceOldList.isEmpty()) {
// 查找是 2待派单3发起失败9减员退回 的再去办
......@@ -1307,6 +1306,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
List<String> errorList = new ArrayList<>();
List<String> successList = new ArrayList<>();
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
errorMsg = new StringBuilder();
leave.setInsuranceId(leave.getInsuranceIdOld());
insuranceList = leaveInsuranceMap.get(leave.getId());
......@@ -1335,6 +1335,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
}
}
// 批量处理商险明细表的状态为失败:
if (!errorList.isEmpty()) {
leaveInsuranceMapper.updateLeaveInsuranceListByIdAndStatus(CommonConstants.THREE_STRING, errorList);
......@@ -1345,9 +1346,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} else {
// 全部成功
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
leave.setInsuranceId(leave.getInsuranceIdOld());
// 待办理
leave.setDoStatusInsurance(CommonConstants.FIVE_STRING);
leave.setDoStatusInsurance(CommonConstants.FOUR_STRING);
}
}
leaveInsuranceMapper.updateLeaveInsuranceListByIdAndStatus(CommonConstants.FOUR_STRING, insuranceOldList);
}
......@@ -1377,6 +1380,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateContract(isExit, doType, nowTime, leave) ) {
// 成功
if (successMap.get(leave.getId()) != null) {
leave.setContractId(successMap.get(leave.getId()));
......@@ -1394,6 +1398,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
}
}
// 项目-完成
if (!listParamProject.isEmpty()) {
BaseSearchListVO paramVoProject = new BaseSearchListVO();
......@@ -1410,6 +1415,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
errorMap.put(message.getKey(), message.getMessage());
}
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateProject(doType, leave) ) {
if (errorMap.get(leave.getId()) != null) {
errorMessage = errorMap.get(leave.getId());
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
......@@ -1420,15 +1426,18 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
leave.setDoStatusProject(CommonConstants.NINE_STRING);
}
}
}
} else {
// 全部成功
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateProject(doType, leave) ) {
leave.setEmpProjectId(leave.getEmpProjectIdOld());
leave.setDoStatusProject(CommonConstants.EIGHT_STRING);
}
}
}
}
}
// 员工-完成
if (!listParamEmp.isEmpty()) {
BaseSearchListVO paramVoEmp = new BaseSearchListVO();
......@@ -1445,6 +1454,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
errorMap.put(message.getKey(), message.getMessage());
}
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateEmp(doType, leave) ) {
if (errorMap.get(leave.getId()) != null) {
errorMessage = errorMap.get(leave.getId());
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
......@@ -1455,52 +1465,26 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
leave.setDoStatusEmp(CommonConstants.NINE_STRING);
}
}
}
} else {
// 全部成功
for (EmployeeRegistrationLeave leave : leaveList) {
if (judgeToUpdateEmp(doType, leave) ) {
leave.setEmpId(leave.getEmpIdOld());
leave.setDoStatusEmp(CommonConstants.EIGHT_STRING);
}
}
}
}
// 1社保2公积金3商险4合同5项目档案6人员档案
List<EmployeeRegistrationLeaveLog> logList = new ArrayList<>();
EmployeeRegistrationLeaveLog leaveLog;
String preContent = "立即发起:";
if (Common.isNotNull(doType)) {
String[] doTypeArray = doType.split(",");
StringBuilder subType = new StringBuilder();
for (String doTypeSub :doTypeArray) {
subType.append(RegistConstants.DO_TYPE_ARR[Integer.parseInt(doTypeSub)]).append(CommonConstants.DUNHAO_STRING);
}
if (subType.length() > 0) {
subType.setLength(subType.length() - 1); // 长度减1,去掉最后一个
}
preContent += subType;
} else {
preContent = "全部事项";
}
if (Common.isNotNull(isExit) && isExit.equals(CommonConstants.ONE_STRING)) {
preContent += ",仅发起日期为今日及之前的事项";
} else {
preContent += ",且发起全部日期的事项";
}
// 是否返回前端错误信息
boolean isReturn = false;
// 最终更新总状态
for (EmployeeRegistrationLeave leave : leaveList) {
judgeStatus(leave);
//日志
leaveLog = new EmployeeRegistrationLeaveLog();
leaveLog.setLeaveId(leave.getId());
leaveLog.setCreateName(user.getNickname());
leaveLog.setCreateTime(LocalDateTime.now());
leaveLog.setContent(preContent);
logList.add(leaveLog);
if (!isReturn) {
if ((Common.isNotNull(leave.getDoStatusSocial()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusSocial()))
if (!isReturn && (Common.isNotNull(leave.getDoStatusSocial()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusSocial()))
|| (Common.isNotNull(leave.getDoStatusFund()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusFund()))
|| (Common.isNotNull(leave.getDoStatusContract()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusContract()))
|| (Common.isNotNull(leave.getDoStatusInsurance()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusInsurance()))
......@@ -1510,16 +1494,10 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
isReturn = true;
}
}
}
if (logList != null && !logList.isEmpty()) {
leaveLogService.saveBatch(logList);
}
this.updateBatchById(leaveList);
ErrorInfoVo errorVo = new ErrorInfoVo();
errorVo.setEmpParamList(empParamList);
errorVo.setProjectParamList(projectParamList);
errorVo.setContractParamList(contractParamList);
errorVo.setSocialParamList(socialParamList);
errorVo.setFundParamList(fundParamList);
errorVo.setInsuranceParamList(insuranceParamList);
if (isReturn) {
return R.failed(leaveList, "发起失败!");
} else {
......@@ -1527,6 +1505,72 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
private boolean judgeToUpdateEmp(String doType, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(leave.getEmpIdOld())
&& Common.isNotNull(leave.getDoStatusEmp())
&& (leave.getDoStatusEmp().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusEmp().equals(CommonConstants.NINE_STRING)
);
}
private boolean judgeToUpdateProject(String doType, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.FIVE_STRING))
&& Common.isNotNull(leave.getEmpProjectIdOld())
&& Common.isNotNull(leave.getDoStatusProject())
&& (leave.getDoStatusProject().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusProject().equals(CommonConstants.NINE_STRING)
);
}
private boolean judgeToUpdateContract(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.FOUR_STRING))
&& Common.isNotNull(leave.getContractIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getContractExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusContract())
&& (leave.getDoStatusContract().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.TEN_STRING)
);
}
private boolean judgeToUpdateSocial(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(leave.getSocialDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getSocialExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusSocial())
&& (leave.getDoStatusSocial().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.SIX_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.TEN_STRING)
);
}
private boolean judgeToUpdateFund(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.TWO_STRING))
&& Common.isNotNull(leave.getFundDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getFundExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusFund())
&& (leave.getDoStatusFund().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.TEN_STRING)
);
}
// 派单时,判断是否需要办理此条商险
private boolean judgeToUpdateInsurance(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.THREE_STRING))
&& Common.isNotNull(leave.getInsuranceIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getInsuranceExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusInsurance())
&& (leave.getDoStatusInsurance().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.NINE_STRING)
);
}
@Override
public void reduceHandleToLeave(BaseServiceParamListVO vo) {
if (vo == null) {
......
......@@ -5030,6 +5030,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//被替换人
one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, vo.getId())
//huyc-代码优化,取替换状态为成功的那一条数据
.eq(TInsuranceReplace::getReplaceStatus, CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()) {
byId = this.getById(one.getFromInsuranceDetailId());
......@@ -5049,6 +5051,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//替换人
fromOne = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getFromInsuranceDetailId, vo.getId())
//huyc-代码优化,取替换状态为成功的那一条数据
.eq(TInsuranceReplace::getReplaceStatus, CommonConstants.ONE_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(fromOne).isPresent()) {
byId = this.getById(fromOne.getToInsuranceDetailId());
......
......@@ -71,10 +71,10 @@ public class TSocialFriendController {
return tSocialFriendService.testToSocialFriendGet();
}
@Operation(description = "测试线上税友接口返回值,慎用")
@GetMapping("/testToSocialFriendOnline")
@Operation(description = "测试线上税友接口返回值,慎用type : 空,查增,1 查减少")
@PostMapping("/testToSocialFriendOnline")
@SysLog("测试线上税友接口返回值,慎用")
public String testToSocialFriendOnline(@RequestParam List<String> requestIdList, @RequestParam(required = false) String type) {
public String testToSocialFriendOnline(@RequestBody List<String> requestIdList, @RequestParam(required = false) String type) {
return tSocialFriendService.testToSocialFriendOnline(requestIdList, type);
}
......
......@@ -3930,8 +3930,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchInfoPre.setErrorBackInfo(null);
dispatchInfoPreMapper.updateById(dispatchInfoPre);
}
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.FIVE_STRING, CommonConstants.ONE_STRING, auditRemark, user);
// 审核不通过
} else if (CommonConstants.ONE_INT == flag) {
// 作废更新:公积金状态、同步档案的公积金状态、同步预估数据
......@@ -3955,8 +3954,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sendDisFalureMessageToWx(dispatchInfoPre,socialAutoLog.getId());
}
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, auditRemark, user);
}
providentFund.setAuditTime(now);
providentFund.setAuditUser(user.getId());
......@@ -3971,12 +3969,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
sf.setFundReduceStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.SIX_STRING);
}
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.FIVE_STRING, CommonConstants.ONE_STRING, auditRemark, user);
// 审核不通过
} else if (CommonConstants.ONE_INT == flag) {
// 作废更新:公积金状态、同步档案的公积金状态
sf.setFundReduceStatus(CommonConstants.ONE_STRING_NEGATE);
sf.setFundStatus(CommonConstants.THREE_STRING);
sf.setFundReduceDate(null);
// 派减审核或办理,更新离职待办
this.sendLeave(dis.getId(), CommonConstants.TWO_STRING, CommonConstants.TEN_STRING, CommonConstants.ZERO_STRING, auditRemark, user);
}
}
fundMapper.updateByIdOfAudit(providentFund);
......@@ -4729,13 +4731,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo, temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
// 派减审核或办理,更新离职待办
if (Common.isNotNull(socialInfo.getHandleStatus()) && CommonConstants.SEVEN_STRING.equals(socialInfo.getHandleStatus())) {
// 部分失败是0
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.SIX_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else {
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, handleRemark, user);
}
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
......@@ -4743,18 +4739,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo, temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
auditInfo.setSocialId(dis.getId());
// 派减审核或办理,更新离职待办
// 7 派减部分办理失败
if (Common.isNotNull(socialInfo.getHandleStatus()) && CommonConstants.SEVEN_STRING.equals(socialInfo.getHandleStatus())) {
if (Common.isNotNull(socialInfo.getHandleStatus())) {
if (CommonConstants.SEVEN_STRING.equals(socialInfo.getHandleStatus())) {
// 部分失败是0
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.SIX_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else {
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.NINE_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else if (CommonConstants.SIX_STRING.equals(socialInfo.getHandleStatus())) {
// 派减办理中 - 后续改造这里和离职待办的导出
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.FIVE_STRING, CommonConstants.ZERO_STRING, handleRemark, user);
} else if (CommonConstants.THREE_STRING.equals(socialInfo.getHandleStatus())) {
// 部分失败是0
this.sendLeave(dis.getId(), CommonConstants.ONE_STRING, CommonConstants.EIGHT_STRING, CommonConstants.ONE_STRING, handleRemark, user);
}
}
auditInfo.setSocialId(dis.getId());
} else {
errorList.add(new ErrorMessage(-1, "找不到对应员工社保数据:" + dis.getEmpName()));
......
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