Commit c7215676 authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-派单暂存

parent 20f4d4a5
......@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
......@@ -606,4 +607,18 @@ public class TEmployeeInfoController {
public Set<String> getCustomerUserMap(@RequestBody List<String> empIdCardList) {
return tEmployeeInfoService.getEmpOnlineMap(empIdCardList);
}
/**
* @param paramVo
* @Description: 查询是否存在派增部分失败与成功的的社保
* @Author: hgw
* @Date: 2025/11/20 17:15
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
@Operation(summary = "查询是否存在派增部分失败与成功的的社保、公积金", description = "查询是否存在派增部分失败与成功的的社保")
@Inner
@PostMapping("/inner/getEmpAndContractStatus")
public BaseSearchVO getEmpAndContractStatus(@RequestBody BaseSearchVO paramVo) {
return tEmployeeInfoService.getEmpAndContractStatus(paramVo);
}
}
......@@ -114,6 +114,7 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
void updateContractChange(@Param("idCard")String empIdcard, @Param("deptNo")String deptNo, @Param("oldDeptNo")String odlDeptNo);
String getContractByEmpIdCardAndDeptId(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
String getContractByEmpIdCardAndDeptNo(@Param("empIdCard") String empIdCard, @Param("deptId") String deptNo);
String getMinDateByCardAndDeptId(@Param("vo") IdNameNoVo vo);
......
......@@ -161,4 +161,6 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
List<SysAreaVo> getSysAreaList(@Param("areaIdSet") Set<Integer> areaIdSet);
String getEmpInfoByIdCard(@Param("empIdCard") String empIdCard);
}
......@@ -198,4 +198,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
Boolean selectExitEmpCopntract(TEmployeeAutoRegistCheckVo cardVo);
// 获取合同ID,在用,已审核
String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo);
}
......@@ -25,6 +25,7 @@ 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.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import org.springframework.web.multipart.MultipartFile;
......@@ -297,4 +298,6 @@ public interface TEmployeeInfoService extends IService<TEmployeeInfo> {
R<TEmployeeInfo> getByEmpNameAndCard(String empName, String empIdCard);
Set<String> getEmpOnlineMap(List<String> empIdCardList);
BaseSearchVO getEmpAndContractStatus(BaseSearchVO paramVo);
}
......@@ -202,6 +202,8 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
TEmployeeProject getByEmpIdAndDeptId(String empId, String deptId);
TEmployeeProject getByEmpIdCardAndDeptId(String empIdCard, String deptId);
TEmployeeProject getByEmpIdCardAndDeptNo(String empIdCard, String deptNo);
String getIsMultiByEmpIdCard(String empIdCard);
/**
* @Description: 获取已减项或已删除的项目档案信息
......
......@@ -2166,6 +2166,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
@Override
public String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo) {
return baseMapper.getContractByEmpIdCardAndDeptNo(empIdCard, deptNo);
}
@Override
public String getMinDateByCardAndDeptId(IdNameNoVo vo) {
return baseMapper.getMinDateByCardAndDeptId(vo);
......
......@@ -44,6 +44,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.*;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ExcelColumnVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.ExcelSheetVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
......@@ -4681,4 +4682,38 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
return baseMapper.getEmpOnlineMap(empIdCardList);
}
@Override
public BaseSearchVO getEmpAndContractStatus(BaseSearchVO paramVo) {
BaseSearchVO returnVo = new BaseSearchVO();
if (Common.isNotNull(paramVo) && Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
// 档案
String empId = baseMapper.getEmpInfoByIdCard(paramVo.getEmpIdCard());
if (Common.isNotNull(empId)) {
returnVo.setResultIdOne(empId);
returnVo.setResultIdOneStatus("在档");
}
TEmployeeProject empProject = tEmployeeProjectService.getByEmpIdCardAndDeptNo(paramVo.getEmpIdCard(), paramVo.getDeptNo());
if (empProject != null && Common.isNotNull(empProject.getId())) {
returnVo.setResultIdTwo(empProject.getId());
if (Common.isNotNull(empProject.getStatus())) {
if (CommonConstants.ZERO_INT == empProject.getStatus()) {
returnVo.setResultIdTwoStatus("草稿");
} else {
returnVo.setResultIdTwoStatus("已审核");
}
}
returnVo.setResultIdFour(tEmployeeProjectService.getIsMultiByEmpIdCard(paramVo.getEmpIdCard()));
}
String contractId = contractServicer.getContractByEmpIdCardAndDeptNo(paramVo.getEmpIdCard(), paramVo.getDeptNo());
if (Common.isNotNull(contractId)) {
returnVo.setResultIdThree(empId);
returnVo.setResultIdThreeStatus("可用");
}
}
return returnVo;
}
}
......@@ -1496,6 +1496,33 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return employeeProject;
}
@Override
public TEmployeeProject getByEmpIdCardAndDeptNo(String empIdCard, String deptNo) {
TEmployeeProject employeeProject = null;
if (Common.isEmpty(empIdCard) || Common.isEmpty(deptNo)) {
return employeeProject;
}
employeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, empIdCard)
.eq(TEmployeeProject::getDeptNo, deptNo)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
return employeeProject;
}
@Override
public String getIsMultiByEmpIdCard(String empIdCard) {
TEmployeeProject employeeProject = null;
if (Common.isEmpty(empIdCard)) {
return CommonConstants.ZERO_STRING;
}
long count = baseMapper.selectCount(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, empIdCard)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING));
return count > 1 ? CommonConstants.ONE_STRING : CommonConstants.ZERO_STRING;
}
@Override
public TEmployeeProject getByEmpIdCardAndDeptIdAndDelete(String empIdCard, String deptId) {
TEmployeeProject employeeProject = null;
......
......@@ -870,6 +870,15 @@
limit 1
</select>
<select id="getContractByEmpIdCardAndDeptNo" resultType="java.lang.String">
select
e.id
from t_employee_contract_info e
where e.EMP_IDCARD = #{empIdCard} and e.DEPT_NO = #{deptNo}
and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '0'
limit 1
</select>
<!-- 获取最小的审核通过的合同,税友自动生成 离职证明书使用 -->
<select id="getMinDateByCardAndDeptId" resultType="java.lang.String">
select
......
......@@ -1528,4 +1528,13 @@
order by a.CREATE_TIME desc
</select>
<!-- 在档的信息 -->
<select id="getEmpInfoByIdCard" resultType="java.lang.String">
select
a.id
from t_employee_info a
where a.DELETE_FLAG = '0' and a.file_Status = 0 and a.EMP_IDCARD = {empIdCard}
limit 1
</select>
</mapper>
/*
* 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.common.core.vo;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @Description: 通用查询与返回的VO
* @Author: hgw
* @Date: 2025/11/20 15:43
* @return:
**/
@Getter
@Setter
public class BaseSearchVO implements Serializable {
private static final long serialVersionUID = 1L;
// 其他查询参数
private String searchKey;
// 身份证
private String empIdCard;
// 项目编码
private String deptNo;
// 返回结果1(社保ID)(商险ID)(人员档案ID)
private String resultIdOne;
private String resultIdOneStatus;
// 返回结果2(公积金ID)(项目档案ID)
private String resultIdTwo;
private String resultIdTwoStatus;
// 返回结果3(合同ID)
private String resultIdThree;
private String resultIdThreeStatus;
// 返回结果4(是否多项目,0否1是)
private String resultIdFour;
private String resultIdFourStatus;
}
......@@ -12,6 +12,7 @@ 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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.AutoDeptVO;
......@@ -665,4 +666,20 @@ public class ArchivesDaprUtil {
return HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),
"/temployeecontractpre/inner/saveContractPreInfo", JSON.toJSONString(preVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 查询人员的档案、项目档案、合同状态
* @Author: hgw
* @Date: 2025/11/20 15:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public R<BaseSearchVO> getEmpAndContractStatus(BaseSearchVO paramVo) {
R<BaseSearchVO> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId()
,"/temployeeinfo/inner/getEmpAndContractStatus", paramVo, BaseSearchVO.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("查询人员的档案、项目档案、合同状态失败!");
}
return res;
}
}
......@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
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.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
......@@ -90,4 +92,21 @@ public class InsuranceDaprUtil {
return HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),
"/temployeeinsurancepre/inner/checkExitInsuanceIsProcess", JSON.toJSONString(preVo), Boolean.class, SecurityConstants.FROM_IN);
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 查询人员的商险状态
* @Author: hgw
* @Date: 2025/11/20 15:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public R<BaseSearchVO> getInsurancesStatus(BaseSearchVO paramVo) {
R<BaseSearchVO> res = HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId()
,"/insuranceDetail/inner/getInsurancesStatus", paramVo, BaseSearchVO.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("查询人员的商险状态失败!");
}
return res;
}
}
......@@ -8,6 +8,7 @@ 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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
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.EkpSocialViewVo;
......@@ -384,4 +385,20 @@ public class SocialDaprUtils {
, HolidayListVO.class, SecurityConstants.FROM_IN);
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 查询人员的社保公积金状态
* @Author: hgw
* @Date: 2025/11/20 15:50
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public R<BaseSearchVO> getSocialAndFundStatus(BaseSearchVO paramVo) {
R<BaseSearchVO> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId()
,"/tsocialfundinfo/inner/getSocialAndFundStatus", paramVo, BaseSearchVO.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("查询人员的社保公积金状态失败!");
}
return res;
}
}
......@@ -33,4 +33,7 @@ public class RegistConstants {
public static final String BACK_RECEIVE = "拒绝入职";
public static final String BASE_REASON_TYPE = "个人辞职";
public static final String BASE_LINK_PORT = "人员离职";
}
......@@ -285,4 +285,240 @@ public class EmployeeRegistrationLeave extends BaseEntity {
@Schema(description = "是否多项目0否1是")
private String isMultipleDept;
/**
* 原社保派单ID
*/
@ExcelAttribute(name = "原社保派单ID", maxLength = 36)
@Length(max = 36, message = "原社保派单ID不能超过36个字符")
@ExcelProperty("原社保派单ID")
@Schema(description = "原社保派单ID")
private String socialDispatchIdOld;
/**
* 原公积金派单ID
*/
@ExcelAttribute(name = "原公积金派单ID", maxLength = 36)
@Length(max = 36, message = "原公积金派单ID不能超过36个字符")
@ExcelProperty("原公积金派单ID")
@Schema(description = "原公积金派单ID")
private String fundDispatchIdOld;
/**
* 原商险ID
*/
@ExcelAttribute(name = "原商险ID", maxLength = 36)
@Length(max = 36, message = "原商险ID不能超过36个字符")
@ExcelProperty("原商险ID")
@Schema(description = "原商险ID")
private String insuranceIdOld;
/**
* 原合同ID
*/
@ExcelAttribute(name = "原合同ID", maxLength = 36)
@Length(max = 36, message = "原合同ID不能超过36个字符")
@ExcelProperty("原合同ID")
@Schema(description = "原合同ID")
private String contractIdOld;
/**
* 原档案ID
*/
@ExcelAttribute(name = "原档案ID", maxLength = 36)
@Length(max = 36, message = "原档案ID不能超过36个字符")
@ExcelProperty("原档案ID")
@Schema(description = "原档案ID")
private String empIdOld;
/**
* 原项目档案ID
*/
@ExcelAttribute(name = "原项目档案ID", maxLength = 36)
@Length(max = 36, message = "原项目档案ID不能超过36个字符")
@ExcelProperty("原项目档案ID")
@Schema(description = "原项目档案ID")
private String empProjectIdOld;
/**
* 原社保状态
*/
@ExcelAttribute(name = "原社保状态", maxLength = 36)
@Length(max = 36, message = "原社保状态不能超过36个字符")
@ExcelProperty("原社保状态")
@Schema(description = "原社保状态")
private String socialStatusOld;
/**
* 原公积金状态
*/
@ExcelAttribute(name = "原公积金状态", maxLength = 36)
@Length(max = 36, message = "原公积金状态不能超过36个字符")
@ExcelProperty("原公积金状态")
@Schema(description = "原公积金状态")
private String fundStatusOld;
/**
* 原商险状态
*/
@ExcelAttribute(name = "原商险状态", maxLength = 36)
@Length(max = 36, message = "原商险状态不能超过36个字符")
@ExcelProperty("原商险状态")
@Schema(description = "原商险状态")
private String insuranceStatusOld;
/**
* 原合同状态
*/
@ExcelAttribute(name = "原合同状态", maxLength = 36)
@Length(max = 36, message = "原合同状态不能超过36个字符")
@ExcelProperty("原合同状态")
@Schema(description = "原合同状态")
private String contractStatusOld;
/**
* 原档案状态
*/
@ExcelAttribute(name = "原档案状态", maxLength = 36)
@Length(max = 36, message = "原档案状态不能超过36个字符")
@ExcelProperty("原档案状态")
@Schema(description = "原档案状态")
private String empStatusOld;
/**
* 原项目档案状态
*/
@ExcelAttribute(name = "原项目档案状态", maxLength = 36)
@Length(max = 36, message = "原项目档案状态不能超过36个字符")
@ExcelProperty("原项目档案状态")
@Schema(description = "原项目档案状态")
private String empProjectStatusOld;
/**
* 社保失败人
*/
@ExcelAttribute(name = "社保失败人", maxLength = 50)
@Length(max = 50, message = "社保失败人不能超过50个字符")
@ExcelProperty("社保失败人")
@Schema(description = "社保失败人")
private String failSocialUser;
/**
* 公积金失败人
*/
@ExcelAttribute(name = "公积金失败人", maxLength = 50)
@Length(max = 50, message = "公积金失败人不能超过50个字符")
@ExcelProperty("公积金失败人")
@Schema(description = "公积金失败人")
private String failFundUser;
/**
* 商险失败人
*/
@ExcelAttribute(name = "商险失败人", maxLength = 50)
@Length(max = 50, message = "商险失败人不能超过50个字符")
@ExcelProperty("商险失败人")
@Schema(description = "商险失败人")
private String failInsuranceUser;
/**
* 合同失败人
*/
@ExcelAttribute(name = "合同失败人", maxLength = 50)
@Length(max = 50, message = "合同失败人不能超过50个字符")
@ExcelProperty("合同失败人")
@Schema(description = "合同失败人")
private String failContractUser;
/**
* 档案失败人
*/
@ExcelAttribute(name = "档案失败人", maxLength = 50)
@Length(max = 50, message = "档案失败人不能超过50个字符")
@ExcelProperty("档案失败人")
@Schema(description = "档案失败人")
private String failEmpUser;
/**
* 项目档案失败人
*/
@ExcelAttribute(name = "项目档案失败人", maxLength = 50)
@Length(max = 50, message = "项目档案失败人不能超过50个字符")
@ExcelProperty("项目档案失败人")
@Schema(description = "项目档案失败人")
private String failEmpProjectUser;
/**
* 社保失败原因
*/
@ExcelAttribute(name = "社保失败原因", maxLength = 50)
@Length(max = 50, message = "社保失败原因不能超过50个字符")
@ExcelProperty("社保失败原因")
@Schema(description = "社保失败原因")
private String failSocialRemark;
/**
* 公积金失败原因
*/
@ExcelAttribute(name = "公积金失败原因", maxLength = 50)
@Length(max = 50, message = "公积金失败原因不能超过50个字符")
@ExcelProperty("公积金失败原因")
@Schema(description = "公积金失败原因")
private String failFundRemark;
/**
* 商险失败原因
*/
@ExcelAttribute(name = "商险失败原因", maxLength = 50)
@Length(max = 50, message = "商险失败原因不能超过50个字符")
@ExcelProperty("商险失败原因")
@Schema(description = "商险失败原因")
private String failInsuranceRemark;
/**
* 合同失败原因
*/
@ExcelAttribute(name = "合同失败原因", maxLength = 50)
@Length(max = 50, message = "合同失败原因不能超过50个字符")
@ExcelProperty("合同失败原因")
@Schema(description = "合同失败原因")
private String failContractRemark;
/**
* 档案失败原因
*/
@ExcelAttribute(name = "档案失败原因", maxLength = 50)
@Length(max = 50, message = "档案失败原因不能超过50个字符")
@ExcelProperty("档案失败原因")
@Schema(description = "档案失败原因")
private String failEmpRemark;
/**
* 项目档案失败原因
*/
@ExcelAttribute(name = "项目档案失败原因", maxLength = 50)
@Length(max = 50, message = "项目档案失败原因不能超过50个字符")
@ExcelProperty("项目档案失败原因")
@Schema(description = "项目档案失败原因")
private String failEmpProjectRemark;
/**
* 社保失败时间
*/
@ExcelAttribute(name = "社保失败时间", isDate = true)
@ExcelProperty("社保失败时间")
@Schema(description = "社保失败时间")
private LocalDateTime failSocialTime;
/**
* 公积金失败时间
*/
@ExcelAttribute(name = "公积金失败时间", isDate = true)
@ExcelProperty("公积金失败时间")
@Schema(description = "公积金失败时间")
private LocalDateTime failFundTime;
/**
* 商险失败时间
*/
@ExcelAttribute(name = "商险失败时间", isDate = true)
@ExcelProperty("商险失败时间")
@Schema(description = "商险失败时间")
private LocalDateTime failInsuranceTime;
/**
* 合同失败时间
*/
@ExcelAttribute(name = "合同失败时间", isDate = true)
@ExcelProperty("合同失败时间")
@Schema(description = "合同失败时间")
private LocalDateTime failContractTime;
/**
* 档案失败时间
*/
@ExcelAttribute(name = "档案失败时间", isDate = true)
@ExcelProperty("档案失败时间")
@Schema(description = "档案失败时间")
private LocalDateTime failEmpTime;
/**
* 项目档案失败时间
*/
@ExcelAttribute(name = "项目档案失败时间", isDate = true)
@ExcelProperty("项目档案失败时间")
@Schema(description = "项目档案失败时间")
private LocalDateTime failEmpProjectTime;
}
......@@ -16,8 +16,13 @@
*/
package com.yifu.cloud.plus.v1.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
/**
* 自动化离职待办-列表
......@@ -41,4 +46,162 @@ public class EmployeeRegistrationLeaveTableVo extends EmployeeRegistrationLeaveE
@Schema(description = "联动端口")
private String linkPort;
@Schema(description = "需处理项:1社保2公积金3商险4合同5项目档案6人员档案")
private String doType;
@Schema(description = "项目档案ID")
private String empProjectId;
@ExcelProperty("档案ID")
@Schema(description = "档案ID")
private String empId;
@ExcelProperty("合同ID")
@Schema(description = "合同ID")
private String contractId;
@ExcelProperty("商险ID")
@Schema(description = "商险ID")
private String insuranceId;
@Schema(description = "公积金Id")
private String fundId;
@Schema(description = "社保Id")
private String socialId;
/**
* 社保失败人
*/
@ExcelAttribute(name = "社保失败人", maxLength = 50)
@Length(max = 50, message = "社保失败人不能超过50个字符")
@ExcelProperty("社保失败人")
@Schema(description = "社保失败人")
private String failSocialUser;
/**
* 公积金失败人
*/
@ExcelAttribute(name = "公积金失败人", maxLength = 50)
@Length(max = 50, message = "公积金失败人不能超过50个字符")
@ExcelProperty("公积金失败人")
@Schema(description = "公积金失败人")
private String failFundUser;
/**
* 商险失败人
*/
@ExcelAttribute(name = "商险失败人", maxLength = 50)
@Length(max = 50, message = "商险失败人不能超过50个字符")
@ExcelProperty("商险失败人")
@Schema(description = "商险失败人")
private String failInsuranceUser;
/**
* 合同失败人
*/
@ExcelAttribute(name = "合同失败人", maxLength = 50)
@Length(max = 50, message = "合同失败人不能超过50个字符")
@ExcelProperty("合同失败人")
@Schema(description = "合同失败人")
private String failContractUser;
/**
* 档案失败人
*/
@ExcelAttribute(name = "档案失败人", maxLength = 50)
@Length(max = 50, message = "档案失败人不能超过50个字符")
@ExcelProperty("档案失败人")
@Schema(description = "档案失败人")
private String failEmpUser;
/**
* 项目档案失败人
*/
@ExcelAttribute(name = "项目档案失败人", maxLength = 50)
@Length(max = 50, message = "项目档案失败人不能超过50个字符")
@ExcelProperty("项目档案失败人")
@Schema(description = "项目档案失败人")
private String failEmpProjectUser;
/**
* 社保失败原因
*/
@ExcelAttribute(name = "社保失败原因", maxLength = 50)
@Length(max = 50, message = "社保失败原因不能超过50个字符")
@ExcelProperty("社保失败原因")
@Schema(description = "社保失败原因")
private String failSocialRemark;
/**
* 公积金失败原因
*/
@ExcelAttribute(name = "公积金失败原因", maxLength = 50)
@Length(max = 50, message = "公积金失败原因不能超过50个字符")
@ExcelProperty("公积金失败原因")
@Schema(description = "公积金失败原因")
private String failFundRemark;
/**
* 商险失败原因
*/
@ExcelAttribute(name = "商险失败原因", maxLength = 50)
@Length(max = 50, message = "商险失败原因不能超过50个字符")
@ExcelProperty("商险失败原因")
@Schema(description = "商险失败原因")
private String failInsuranceRemark;
/**
* 合同失败原因
*/
@ExcelAttribute(name = "合同失败原因", maxLength = 50)
@Length(max = 50, message = "合同失败原因不能超过50个字符")
@ExcelProperty("合同失败原因")
@Schema(description = "合同失败原因")
private String failContractRemark;
/**
* 档案失败原因
*/
@ExcelAttribute(name = "档案失败原因", maxLength = 50)
@Length(max = 50, message = "档案失败原因不能超过50个字符")
@ExcelProperty("档案失败原因")
@Schema(description = "档案失败原因")
private String failEmpRemark;
/**
* 项目档案失败原因
*/
@ExcelAttribute(name = "项目档案失败原因", maxLength = 50)
@Length(max = 50, message = "项目档案失败原因不能超过50个字符")
@ExcelProperty("项目档案失败原因")
@Schema(description = "项目档案失败原因")
private String failEmpProjectRemark;
/**
* 社保失败时间
*/
@ExcelAttribute(name = "社保失败时间", isDate = true)
@ExcelProperty("社保失败时间")
@Schema(description = "社保失败时间")
private LocalDateTime failSocialTime;
/**
* 公积金失败时间
*/
@ExcelAttribute(name = "公积金失败时间", isDate = true)
@ExcelProperty("公积金失败时间")
@Schema(description = "公积金失败时间")
private LocalDateTime failFundTime;
/**
* 商险失败时间
*/
@ExcelAttribute(name = "商险失败时间", isDate = true)
@ExcelProperty("商险失败时间")
@Schema(description = "商险失败时间")
private LocalDateTime failInsuranceTime;
/**
* 合同失败时间
*/
@ExcelAttribute(name = "合同失败时间", isDate = true)
@ExcelProperty("合同失败时间")
@Schema(description = "合同失败时间")
private LocalDateTime failContractTime;
/**
* 档案失败时间
*/
@ExcelAttribute(name = "档案失败时间", isDate = true)
@ExcelProperty("档案失败时间")
@Schema(description = "档案失败时间")
private LocalDateTime failEmpTime;
/**
* 项目档案失败时间
*/
@ExcelAttribute(name = "项目档案失败时间", isDate = true)
@ExcelProperty("项目档案失败时间")
@Schema(description = "项目档案失败时间")
private LocalDateTime failEmpProjectTime;
}
......@@ -23,11 +23,15 @@ import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationLeaveService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.BatchIgnoreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAutoParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -111,7 +115,7 @@ public class EmployeeRegistrationLeaveController {
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<EmployeeRegistrationLeave> getById(@PathVariable("id") String id) {
return R.ok(employeeRegistrationLeaveService.getById(id));
return R.ok(employeeRegistrationLeaveService.initLeaveInfo(id));
}
/**
......@@ -148,6 +152,44 @@ public class EmployeeRegistrationLeaveController {
menuUtil.setAuthSql(user, searchVo);
}
/**
* @param leave 离职待办
*/
@Operation(summary = "单个确认-离职待办", description = "单个确认-离职待办")
@SysLog("单个确认-离职待办")
@PostMapping("/doSure")
public R<String> doSure(@RequestBody EmployeeRegistrationLeave leave) {
return employeeRegistrationLeaveService.doSure(leave);
}
/**
* @Description: 批量确认
* @Author: hgw
* @Date: 2025-11-20 20:12:53
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
@Operation(summary = "批量确认-离职待办", description = "批量确认-离职待办")
@SysLog("批量确认-离职待办(与单个确认分开,是因为单个确认还有编辑功能,批量仅改状态")
@PostMapping("/doSureBatch")
public R<String> doSureBatch(@RequestBody BatchIgnoreVo vo) {
if (null == vo || vo.getIds() == null || vo.getIds().isEmpty()){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
return employeeRegistrationLeaveService.doSureBatch(vo);
}
/**
* @Description: 离职待办单个/批量派单
* @Author: hgw
* @Date: 2025/11/17 14:17
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R
**/
@Operation(description = "离职待办单个/批量派单")
@PostMapping("/batchDoLeave")
public R<List<InsuranceAutoParam>> batchDoLeave(@RequestBody List<String> idList, @RequestParam(required = false) String isExit) {
return employeeRegistrationLeaveService.batchDoLeave(idList, isExit, false);
}
}
......@@ -25,6 +25,8 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveConfirmExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -65,4 +67,11 @@ public interface EmployeeRegistrationLeaveMapper extends BaseMapper<EmployeeRegi
int getEmployeeRegistrationLeaveConfirmTableCount(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
List<EmployeeRegistrationLeave> selectLeaveListBySure(@Param("idList") List<String> idList);
void doBatchSure(@Param("idList") List<String> idList);
List<EmployeeRegistrationLeave> selectLeaveListByDispatch(@Param("idList") List<String> idList);
}
......@@ -20,9 +20,14 @@ package com.yifu.cloud.plus.v1.csp.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.BatchIgnoreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceAutoParam;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -52,4 +57,22 @@ public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegis
void exportConfirmTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);
// 初始化新增离职待办信息
void saveLeaveInfo(EmployeeRegistration registration);
EmployeeRegistrationLeave initLeaveInfo(String id);
// 单个确认(含编辑功能)
R<String> doSure(EmployeeRegistrationLeave leave);
// 批量确认(不含编辑)
R<String> doSureBatch(BatchIgnoreVo vo);
// 每天下午三点、三点二十推送续保待派单数据
//void autoDoInsurancePreRenew();
// 批量派单
// pushQiWeiFlag : 是否推送企微 true:推送(当前仅下午3点与3点20的定时任务,需要推送企微),false:不推送
R<List<InsuranceAutoParam>> batchDoLeave(List<String> idList, String sameFlag, boolean pushQiWeiFlag);
}
......@@ -19,11 +19,15 @@ package com.yifu.cloud.plus.v1.csp.service.impl;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.constants.RegistConstants;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationLeaveMapper;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationMapper;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationLeaveService;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveConfirmExportVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveExportVo;
......@@ -35,9 +39,18 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
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.InsuranceDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceAlert;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetailQw;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetailQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -46,8 +59,11 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
/**
* 自动化离职待办
......@@ -61,6 +77,12 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
@Autowired
private SocialDaprUtils socialDaprUtils;
@Autowired
private InsuranceDaprUtil insuranceDaprUtil;
@Autowired
private EmployeeRegistrationMapper employeeRegistrationMapper;
/**
* 自动化离职待办简单分页查询
......@@ -236,4 +258,366 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
@Override
public void saveLeaveInfo(EmployeeRegistration registration) {
//获取假日信息
R<HolidayListVO> holidayListR = socialDaprUtils.getOneMonthDay();
Map<String, Integer> holidayMap = null;
if (null != holidayListR && Common.isNotNull(holidayListR.getData()) && Common.isNotNull(holidayListR.getData().getWorkDayMap())) {
holidayMap = holidayListR.getData().getHolidayMap();
}
EmployeeRegistrationLeave leave = new EmployeeRegistrationLeave();
leave.setId(registration.getId());
leave.setLeaveStatus(CommonConstants.ZERO_STRING);
// 设置执行状态为“未执行”
leave.setDoStatus(CommonConstants.ZERO_STRING);
// 1社保2公积金3商险4合同5项目档案6人员档案
StringBuilder doType = new StringBuilder();
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setEmpIdCard(registration.getEmpIdcard());
paramVo.setDeptNo(registration.getDeptNo());
// 设置社保减员状态
String socialId = "";
String socialStatusOld = "";
String fundId = "";
String fundStatusOld = "";
BaseSearchVO returnVo;
R<BaseSearchVO> returnR = socialDaprUtils.getSocialAndFundStatus(paramVo);
if (null != returnR && Common.isNotNull(returnR.getData())) {
returnVo = returnR.getData();
if (Common.isNotNull(returnVo.getResultIdOne())) {
socialId = returnVo.getResultIdOne();
socialStatusOld = returnVo.getResultIdOneStatus();
}
if (Common.isNotNull(returnVo.getResultIdTwo())) {
fundId = returnVo.getResultIdTwo();
fundStatusOld = returnVo.getResultIdTwoStatus();
}
}
if (Common.isNotNull(socialId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.ONE_STRING);
leave.setDoStatusSocial(CommonConstants.ZERO_STRING);
leave.setSocialDispatchIdOld(socialId);
leave.setSocialStatusOld(socialStatusOld);
leave.setSocialReasonType(RegistConstants.BASE_REASON_TYPE);
} else {
leave.setDoStatusSocial(CommonConstants.ONE_STRING);
}
// 设置公积金减员状态
if (Common.isNotNull(fundId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.TWO_STRING);
leave.setDoStatusFund(CommonConstants.ZERO_STRING);
leave.setFundDispatchIdOld(fundId);
leave.setFundStatusOld(fundStatusOld);
leave.setFundReasonType(RegistConstants.BASE_REASON_TYPE);
} else {
leave.setDoStatusFund(CommonConstants.ONE_STRING);
}
// 设置商险退保状态
String insuranceId = "";
String insuranceStatusOld = "";
returnR = insuranceDaprUtil.getInsurancesStatus(paramVo);
if (null != returnR && Common.isNotNull(returnR.getData())) {
returnVo = returnR.getData();
if (Common.isNotNull(returnVo.getResultIdOne())) {
insuranceId = returnVo.getResultIdOne();
insuranceStatusOld = returnVo.getResultIdOneStatus();
}
}
if (Common.isNotNull(insuranceId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.THREE_STRING);
leave.setDoStatusInsurance(CommonConstants.ZERO_STRING);
leave.setInsuranceIdOld(insuranceId);
leave.setInsuranceStatusOld(insuranceStatusOld);
} else {
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
}
// 设置合同终止状态
String contractId = "";
String contractStatusOld = "";
String empProjectId = "";
String empProjectStatusOld = "";
String empId = "";
String empStatusOld = "";
// 是否多项目0否1是
String isMultipleDept = CommonConstants.ZERO_STRING;
returnR = archivesDaprUtil.getEmpAndContractStatus(paramVo);
if (null != returnR && Common.isNotNull(returnR.getData())) {
returnVo = returnR.getData();
if (Common.isNotNull(returnVo.getResultIdOne())) {
empId = returnVo.getResultIdOne();
empStatusOld = returnVo.getResultIdOneStatus();
}
if (Common.isNotNull(returnVo.getResultIdTwo())) {
empProjectId = returnVo.getResultIdTwo();
empProjectStatusOld = returnVo.getResultIdTwoStatus();
}
if (Common.isNotNull(returnVo.getResultIdThree())) {
contractId = returnVo.getResultIdThree();
contractStatusOld = returnVo.getResultIdThreeStatus();
}
if (Common.isNotNull(returnVo.getResultIdFour())) {
isMultipleDept = returnVo.getResultIdFour();
}
}
if (Common.isNotNull(contractId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.FOUR_STRING);
leave.setDoStatusContract(CommonConstants.ZERO_STRING);
leave.setContractIdOld(contractId);
leave.setContractStatusOld(contractStatusOld);
} else {
leave.setDoStatusContract(CommonConstants.ONE_STRING);
}
leave.setIsMultipleDept(isMultipleDept);
if (Common.isNotNull(empProjectId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.FIVE_STRING);
leave.setDoStatusProject(CommonConstants.ZERO_STRING);
leave.setEmpProjectIdOld(empProjectId);
leave.setEmpProjectStatusOld(empProjectStatusOld);
} else {
leave.setDoStatusProject(CommonConstants.ONE_STRING);
}
if (Common.isNotNull(empId)) {
if (Common.isNotNull(doType)) {
doType.append(",");
}
doType.append(CommonConstants.SIX_STRING);
leave.setDoStatusEmp(CommonConstants.ZERO_STRING);
leave.setEmpIdOld(empId);
leave.setEmpStatusOld(empStatusOld);
} else {
leave.setDoStatusEmp(CommonConstants.ONE_STRING);
}
// 设置需处理项(1社保2公积金3商险4合同5项目档案6人员档案)
leave.setDoType(doType.toString());
// 设置联动端口(固定值:人员离职)
leave.setLinkPort(RegistConstants.BASE_LINK_PORT);
this.saveOrUpdate(leave);
}
@Override
public EmployeeRegistrationLeave initLeaveInfo(String id) {
EmployeeRegistration registration = employeeRegistrationMapper.selectById( id);
EmployeeRegistrationLeave leave = this.getById( id);
if (registration == null || leave == null) {
return leave;
}
//获取假日信息
R<HolidayListVO> holidayListR = socialDaprUtils.getOneMonthDay();
Map<String, Integer> holidayMap = null;
if (null != holidayListR && Common.isNotNull(holidayListR.getData()) && Common.isNotNull(holidayListR.getData().getWorkDayMap())) {
holidayMap = holidayListR.getData().getHolidayMap();
}
// 获取下个工作日,且大于等于今天,如果大于15点20,换下个工作日
if (Common.isNotNull(leave.getSocialDispatchIdOld()) && Common.isEmpty(leave.getSocialExpectedTime())) {
leave.setSocialExpectedTime(calculateNextWorkDays(holidayMap));
}
// 获取下个工作日,且大于等于今天,如果大于15点20,换下个工作日
if (Common.isNotNull(leave.getFundDispatchIdOld()) && Common.isEmpty(leave.getFundExpectedTime())) {
leave.setFundExpectedTime(calculateNextWorkDays(holidayMap));
}
// 设置商险退保状态
if (Common.isNotNull(leave.getInsuranceIdOld()) && Common.isNotNull(registration.getJoinLeaveDate()) && Common.isEmpty(leave.getInsuranceExpectedTime())) {
// 获取下个工作日,且大于等于今天,如果大于15点20,换下个工作日
leave.setInsuranceExpectedTime(calculateNextWorkDaysByDate(dateToLocalDate(registration.getJoinLeaveDate()),holidayMap));
leave.setInsuranceExpectedTimeNext(leave.getInsuranceExpectedTime().plusDays(CommonConstants.ONE_INT));
}
// 设置合同终止状态
if (Common.isNotNull(leave.getContractIdOld()) && Common.isEmpty(leave.getContractExpectedTime())) {
leave.setContractExpectedTime(calculateNextWorkDays(holidayMap));
}
return leave;
}
private LocalDate dateToLocalDate(Date joinLeaveDate) {
return joinLeaveDate.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
}
// 获取下一个工作日:先比较与今天谁大,用大的,如果非工作日,或大于15点20,取下个工作日,否则用大的
private LocalDateTime calculateNextWorkDaysByDate(LocalDate joinLeaveDate, Map<String, Integer> holidayMap) {
// 获取下一个工作日:先比较与今天谁大,用大的,如果非工作日,或大于15点20,取下个工作日,否则用大的
// 今天
LocalDate today = LocalDate.now();
LocalDateTime todayTime = LocalDateTime.now();
// 创建今天的15点20时间
LocalDateTime targetTime = LocalDateTime.now().withHour(15).withMinute(20).withSecond(0).withNano(0);
// 判断是否大于15点20,大于则取明天
if (todayTime.isAfter(targetTime)) {
today = today.plusDays(1);
}
if (joinLeaveDate.isBefore(today)) {
// 如果B小于今天,则B为今天
joinLeaveDate = today;
}
// 如果今天是工作日,则为今天
if (this.isWorkday(joinLeaveDate, holidayMap)) {
return joinLeaveDate.atTime(15, 20, 0);
} else {
// 今天非工作日,顺延到工作日
return getNextWorkday(joinLeaveDate, holidayMap).atTime(15, 20, 0);
}
}
private LocalDateTime calculateNextWorkDays(Map<String, Integer> holidayMap) {
// 获取下一个工作日:先比较与今天谁大,用大的,如果非工作日,或大于15点20,取下个工作日,否则用大的
// 今天
LocalDate today = LocalDate.now();
LocalDateTime todayTime = LocalDateTime.now();
// 创建今天的15点20时间
LocalDateTime targetTime = LocalDateTime.now().withHour(15).withMinute(20).withSecond(0).withNano(0);
// 判断是否大于15点20,大于则取明天
if (todayTime.isAfter(targetTime)) {
today = today.plusDays(1);
}
// 如果今天是工作日,则为今天
if (this.isWorkday(today, holidayMap)) {
return today.atTime(15, 20, 0);
} else {
// 今天非工作日,顺延到工作日
return getNextWorkday(today, holidayMap).atTime(15, 20, 0);
}
}
// 获取下一个工作日
public LocalDate getNextWorkday(LocalDate date, Map<String, Integer> holidayMap) {
LocalDate result = date.plusDays(CommonConstants.ONE_INT);
while (!this.isWorkday(date, holidayMap)) {
result = result.plusDays(CommonConstants.ONE_INT);
}
return result;
}
/**
* 判断是否为工作日,true是,false否
*/
public boolean isWorkday(LocalDate date, Map<String, Integer> holidayMap) {
String days = LocalDateUtil.getDateSrt(date, LocalDateUtil.NORM_DATE_PATTERN);
return holidayMap.get(days) == null;
}
@Override
public R<String> doSure(EmployeeRegistrationLeave leave) {
if (leave != null && Common.isNotNull(leave.getId())) {
EmployeeRegistrationLeave leaveOld = this.getById(leave.getId());
if (leaveOld != null && Common.isNotNull(leaveOld.getId())) {
if (CommonConstants.ZERO_STRING.equals(leaveOld.getLeaveStatus())) {
leave.setLeaveStatus(CommonConstants.ONE_STRING);
this.updateById(leave);
return R.ok();
} else {
return R.failed("状态不是待确认");
}
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
} else {
return R.failed("请传参ID");
}
}
@Override
public R<String> doSureBatch(BatchIgnoreVo vo) {
List<String> ids = vo.getIds();
if (Common.isEmpty(ids)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
// 先查再更新
List<EmployeeRegistrationLeave> alertList = baseMapper.selectLeaveListBySure(ids);
if (alertList != null && !alertList.isEmpty()) {
List<String> successList = new ArrayList<>();
Map<String, EmployeeRegistrationLeave> alertMap = new HashMap<>();
for (EmployeeRegistrationLeave alert : alertList) {
alertMap.put(alert.getId(), alert);
}
EmployeeRegistrationLeave alert;
int successNum = 0;
for (String id : ids) {
alert = alertMap.get(id);
if (alert != null && CommonConstants.ZERO_STRING.equals(alert.getLeaveStatus())) {
successList.add(id);
successNum++;
}
}
if (successNum == CommonConstants.ZERO_INT) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} else {
baseMapper.doBatchSure(successList);
return R.ok();
}
} else {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
}
@Override
public R<List<InsuranceAutoParam>> batchDoLeave(List<String> idList, String sameFlag, boolean pushQiWeiFlag) {
List<EmployeeRegistrationLeave> leaveList = baseMapper.selectLeaveListByDispatch(idList);
if (Common.isEmpty(leaveList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<String> socialOldList = new ArrayList<>();
List<String> fundOldList = new ArrayList<>();
List<String> insuranceOldList = new ArrayList<>();
List<String> contractOldList = new ArrayList<>();
List<String> empOldList = new ArrayList<>();
List<String> empProjectOldList = new ArrayList<>();
for (EmployeeRegistrationLeave leave :leaveList) {
if (Common.isNotNull(leave.getSocialDispatchIdOld())) {
socialOldList.add(leave.getSocialDispatchIdOld());
}
if (Common.isNotNull(leave.getFundDispatchIdOld())) {
fundOldList.add(leave.getFundDispatchIdOld());
}
if (Common.isNotNull(leave.getInsuranceId())) {
insuranceOldList.add(leave.getInsuranceId());
}
if (Common.isNotNull(leave.getContractIdOld())) {
contractOldList.add(leave.getContractIdOld());
}
if (Common.isNotNull(leave.getEmpIdOld())) {
empOldList.add(leave.getEmpIdOld());
}
if (Common.isNotNull(leave.getEmpProjectIdOld())) {
empProjectOldList.add(leave.getEmpProjectIdOld());
}
}
// TODO -继续完善
return R.ok();
}
}
......@@ -16,9 +16,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.config.WxConfig;
import com.yifu.cloud.plus.v1.csp.constants.RegistConstants;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistration;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.entity.TCspAttaInfo;
import com.yifu.cloud.plus.v1.csp.entity.TOperationLog;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationLeaveMapper;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationMapper;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationLeaveService;
import com.yifu.cloud.plus.v1.csp.service.EmployeeRegistrationService;
import com.yifu.cloud.plus.v1.csp.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.csp.service.TOperationLogService;
......@@ -33,6 +36,7 @@ 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.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.UserPermissionVo;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
......@@ -40,7 +44,9 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
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.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.HolidayListVO;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsuranceSelectVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
......@@ -109,6 +115,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
private final TAttaInfoService tAttaInfoService;
private final TOperationLogService logService;
private final EmployeeRegistrationLeaveService employeeRegistrationLeaveService;
/**
* 入离职登记表简单分页查询
......@@ -530,6 +537,10 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
insertList.add(insert);
//新增记录,新增操作记录
baseMapper.insert(insert);
if (Common.isNotNull(insert.getFeedbackType()) && CommonConstants.TWO_STRING.equals(insert.getFeedbackType())) {
// 生成离职待办
employeeRegistrationLeaveService.saveLeaveInfo(insert);
}
if (CommonConstants.ONE_STRING.equals(insert.getFeedbackType())) {
inNum++;
} else {
......
......@@ -39,6 +39,32 @@
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="linkPort" column="link_port"/>
<result property="doType" column="do_type"/>
<result property="empProjectId" column="emp_project_id"/>
<result property="empId" column="emp_id"/>
<result property="contractId" column="contract_id"/>
<result property="insuranceId" column="insurance_id"/>
<result property="fundId" column="fund_id"/>
<result property="socialId" column="social_id"/>
<result property="failSocialUser" column="fail_social_user"/>
<result property="failFundUser" column="fail_fund_user"/>
<result property="failInsuranceUser" column="fail_insurance_user"/>
<result property="failContractUser" column="fail_contract_user"/>
<result property="failEmpUser" column="fail_emp_user"/>
<result property="failEmpProjectUser" column="fail_emp_project_user"/>
<result property="failSocialRemark" column="fail_social_remark"/>
<result property="failFundRemark" column="fail_fund_remark"/>
<result property="failInsuranceRemark" column="fail_insurance_remark"/>
<result property="failContractRemark" column="fail_contract_remark"/>
<result property="failEmpRemark" column="fail_emp_remark"/>
<result property="failEmpProjectRemark" column="fail_emp_project_remark"/>
<result property="failSocialTime" column="fail_social_time"/>
<result property="failFundTime" column="fail_fund_time"/>
<result property="failInsuranceTime" column="fail_insurance_time"/>
<result property="failContractTime" column="fail_contract_time"/>
<result property="failEmpTime" column="fail_emp_time"/>
<result property="failEmpProjectTime" column="fail_emp_project_time"/>
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="joinLeaveDate" column="join_leave_date"/>
......@@ -46,7 +72,7 @@
<result property="deptNo" column="dept_no"/>
</resultMap>
<!-- 新表全量字段 -->
<!-- 新表全量字段-确认、派单时使用 -->
<resultMap id="employeeRegistrationLeaveMap" type="com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave">
<id property="id" column="id"/>
<result property="leaveStatus" column="leave_status"/>
......@@ -86,6 +112,36 @@
<result property="confirmTime" column="confirm_time"/>
<result property="linkPort" column="link_port"/>
<result property="isMultipleDept" column="is_multiple_dept"/>
<result property="socialDispatchIdOld" column="social_dispatch_id_old"/>
<result property="fundDispatchIdOld" column="fund_dispatch_id_old"/>
<result property="insuranceIdOld" column="insurance_id_old"/>
<result property="contractIdOld" column="contract_id_old"/>
<result property="empIdOld" column="emp_id_old"/>
<result property="empProjectIdOld" column="emp_project_id_old"/>
<result property="socialStatusOld" column="social_status_old"/>
<result property="fundStatusOld" column="fund_status_old"/>
<result property="insuranceStatusOld" column="insurance_status_old"/>
<result property="contractStatusOld" column="contract_status_old"/>
<result property="empStatusOld" column="emp_status_old"/>
<result property="empProjectStatusOld" column="emp_project_status_old"/>
<result property="failSocialUser" column="fail_social_user"/>
<result property="failFundUser" column="fail_fund_user"/>
<result property="failInsuranceUser" column="fail_insurance_user"/>
<result property="failContractUser" column="fail_contract_user"/>
<result property="failEmpUser" column="fail_emp_user"/>
<result property="failEmpProjectUser" column="fail_emp_project_user"/>
<result property="failSocialRemark" column="fail_social_remark"/>
<result property="failFundRemark" column="fail_fund_remark"/>
<result property="failInsuranceRemark" column="fail_insurance_remark"/>
<result property="failContractRemark" column="fail_contract_remark"/>
<result property="failEmpRemark" column="fail_emp_remark"/>
<result property="failEmpProjectRemark" column="fail_emp_project_remark"/>
<result property="failSocialTime" column="fail_social_time"/>
<result property="failFundTime" column="fail_fund_time"/>
<result property="failInsuranceTime" column="fail_insurance_time"/>
<result property="failContractTime" column="fail_contract_time"/>
<result property="failEmpTime" column="fail_emp_time"/>
<result property="failEmpProjectTime" column="fail_emp_project_time"/>
</resultMap>
<!-- 全量字段 -->
<sql id="Base_Column_List">
......@@ -126,7 +182,37 @@
a.confirm_user,
a.confirm_time,
a.link_port,
a.is_multiple_dept
a.is_multiple_dept,
a.social_dispatch_id_old,
a.fund_dispatch_id_old,
a.insurance_id_old,
a.contract_id_old,
a.emp_id_old,
a.emp_project_id_old,
a.social_status_old,
a.fund_status_old,
a.insurance_status_old,
a.contract_status_old,
a.emp_status_old,
a.emp_project_status_old,
a.fail_social_user,
a.fail_fund_user,
a.fail_insurance_user,
a.fail_contract_user,
a.fail_emp_user,
a.fail_emp_project_user,
a.fail_social_remark,
a.fail_fund_remark,
a.fail_insurance_remark,
a.fail_contract_remark,
a.fail_emp_remark,
a.fail_emp_project_remark,
a.fail_social_time,
a.fail_fund_time,
a.fail_insurance_time,
a.fail_contract_time,
a.fail_emp_time,
a.fail_emp_project_time
</sql>
......@@ -278,26 +364,44 @@
<!-- 离职待办列表 -->
<sql id="Base_Table_List">
a.id,
a.id,a.do_type,a.emp_project_id,a.emp_id,a.contract_id,a.insurance_id,a.fund_id,a.social_id,
a.fail_social_user,
a.fail_fund_user,
a.fail_insurance_user,
a.fail_contract_user,
a.fail_emp_user,
a.fail_emp_project_user,
a.fail_social_remark,
a.fail_fund_remark,
a.fail_insurance_remark,
a.fail_contract_remark,
a.fail_emp_remark,
a.fail_emp_project_remark,
a.fail_social_time,
a.fail_fund_time,
a.fail_insurance_time,
a.fail_contract_time,
a.fail_emp_time,
a.fail_emp_project_time,
<include refid="Base_Export_List"></include>
</sql>
<sql id="Base_Export_List">
case a.leave_status when '0' then '待确认' when '1' then '待处理' when '2' then '处理中' when '3' then '已处理' else '——' end leave_status,
case a.do_status when '0' then '——' when '1' then '未执行' when '2' then '执行中' when '3' then '部分成功' when '4' then '全部失败' when '5' then '全部成功' when '6' then '无需处理' else '——' end do_status,
case a.leave_status when '0' then '待确认' when '1' then '待处理' when '2' then '处理中' when '3' then '已处理' else '--' end leave_status,
case a.do_status when '0' then '--' when '1' then '未执行' when '2' then '执行中' when '3' then '部分成功' when '4' then '全部失败' when '5' then '全部成功' when '6' then '无需处理' else '--' end do_status,
a.do_detail,
a.do_remark,
case a.do_status_contract when '0' then '——' when '1' then '无需处理' when '2' then '待发起' when '3' then '发起失败'
when '4' then '待审核' when '8' then '审核通过' when '10' then '审核不通过' else '——' end do_status_contract,
case a.do_status_social when '0' then '——' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
case a.do_status_contract when '0' then '--' when '1' then '无需处理' when '2' then '待发起' when '3' then '发起失败'
when '4' then '待审核' when '8' then '审核通过' when '10' then '审核不通过' else '--' end do_status_contract,
case a.do_status_social when '0' then '--' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
when '4' then '待审核' when '5' then '待办理' when '6' then '部分办理失败' when '8' then '办理成功'
when '9' then '办理失败' when '10' then '审核不通过' else '——' end do_status_social,
case a.do_status_fund when '0' then '——' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
when '4' then '待审核' when '5' then '待办理' when '8' then '办理成功' when '9' then '办理失败' when '10' then '审核不通过' else '——' end do_status_fund,
case a.do_status_insurance when '0' then '——' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' when '8' then '减员成功' when '9' then '减员退回' else '——' end do_status_insurance,
case a.do_status_project when '0' then '——' when '1' then '无需处理' when '2' then '待减项' when '8' then '减项成功' when '9' then '减项失败' else '——' end do_status_project,
case a.do_status_emp when '0' then '——' when '1' then '无需处理' when '2' then '待减档' when '8' then '减档成功' when '9' then '减档失败' else '——' end do_status_emp,
when '9' then '办理失败' when '10' then '审核不通过' else '--' end do_status_social,
case a.do_status_fund when '0' then '--' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
when '4' then '待审核' when '5' then '待办理' when '8' then '办理成功' when '9' then '办理失败' when '10' then '审核不通过' else '--' end do_status_fund,
case a.do_status_insurance when '0' then '--' when '1' then '无需处理' when '2' then '待派单' when '3' then '发起失败'
when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' when '8' then '减员成功' when '9' then '减员退回' else '--' end do_status_insurance,
case a.do_status_project when '0' then '--' when '1' then '无需处理' when '2' then '待减项' when '8' then '减项成功' when '9' then '减项失败' else '--' end do_status_project,
case a.do_status_emp when '0' then '--' when '1' then '无需处理' when '2' then '待减档' when '8' then '减档成功' when '9' then '减档失败' else '--' end do_status_emp,
b.employee_name,
b.emp_idcard,
DATE_FORMAT(b.join_leave_date,'%Y-%m-%d') join_leave_date,
......@@ -307,7 +411,25 @@ when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' wh
<!-- 离职确认列表 -->
<sql id="Base_Confirm_Table_List">
a.id,
a.id,a.do_type,a.emp_project_id,a.emp_id,a.contract_id,a.insurance_id,a.fund_id,a.social_id,
a.fail_social_user,
a.fail_fund_user,
a.fail_insurance_user,
a.fail_contract_user,
a.fail_emp_user,
a.fail_emp_project_user,
a.fail_social_remark,
a.fail_fund_remark,
a.fail_insurance_remark,
a.fail_contract_remark,
a.fail_emp_remark,
a.fail_emp_project_remark,
a.fail_social_time,
a.fail_fund_time,
a.fail_insurance_time,
a.fail_contract_time,
a.fail_emp_time,
a.fail_emp_project_time,
<include refid="Base_Confirm_Export_List"></include>
</sql>
......@@ -415,4 +537,51 @@ when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' wh
</where>
</select>
<select id="selectLeaveListBySure" resultMap="employeeRegistrationLeaveMap" >
SELECT
a.ID,
a.leave_status
FROM employee_registration_leave a
where a.leave_status = '0'
<if test="idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</select>
<update id="doBatchSure">
<if test="idList != null and idList.size() > 0">
update employee_registration_leave a
set a.leave_status = '1'
where
a.id in
<foreach collection="idList" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
</update>
<!-- 查找符合条件的需要派单的数据 -->
<select id="selectLeaveListByDispatch" resultMap="employeeRegistrationLeaveMap">
SELECT
<include refid="Base_Column_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
a.leave_status in ('1','2')
<if test="idList != null and idList.size() > 0">
and a.id in
<foreach collection="idList" item="param" index="index" open="(" close=")" separator=",">
#{param}
</foreach>
</if>
<if test="idList == null or idList.size() == 0">
and a.id = '-1'
</if>
</where>
ORDER BY b.create_time asc,b.id asc
</select>
</mapper>
......@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.ResultConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
......@@ -886,4 +887,18 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getOnProcessInsurancesInfo(empIdcard));
}
/**
* @param paramVo
* @Description: 查询是否存在派增部分失败与成功的的社保
* @Author: hgw
* @Date: 2025/11/20 17:15
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
@Operation(summary = "查询是否存在派增部分失败与成功的的社保、公积金", description = "查询是否存在派增部分失败与成功的的社保")
@Inner
@PostMapping("/inner/getInsurancesStatus")
public BaseSearchVO getInsurancesStatus(@RequestBody BaseSearchVO paramVo) {
return tInsuranceDetailService.getInsurancesStatus(paramVo);
}
}
......@@ -340,4 +340,6 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
List<TInsurancePreDetail> getOnProcessInsuredList(@Param("empIdCard") String empIdCard);
List<String> getInsuranceDetailList(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
......@@ -580,5 +581,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
List<TInsurancePreDetail> getOnProcessInsurancesInfo(String empIdCard);
BaseSearchVO getInsurancesStatus(BaseSearchVO paramVo);
}
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
......@@ -46,6 +47,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskListVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryRiskVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptDetailVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.ChangeDeptVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
......@@ -9024,4 +9026,21 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
@Override
public BaseSearchVO getInsurancesStatus(BaseSearchVO paramVo) {
BaseSearchVO returnVo = new BaseSearchVO();
if (Common.isNotNull(paramVo) && Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
List<String> idList = baseMapper.getInsuranceDetailList(paramVo.getEmpIdCard(), paramVo.getDeptNo());
if (idList != null && !idList.isEmpty()) {
String idString = String.join(CommonConstants.COMMA_STRING, idList);
if (idString.length()>1000) {
idString = idString.substring(0, 1000);
}
returnVo.setResultIdOne(idString);
returnVo.setResultIdOneStatus("已投保");
}
}
return returnVo;
}
}
......@@ -2210,4 +2210,14 @@
group by a.POLICY_NO,a.INSURANCE_COMPANY_NAME,a.INSURANCE_TYPE_NAME,a.POLICY_START,a.POLICY_END,a.BUY_STANDARD
ORDER BY a.CREATE_TIME DESC ,a.ID ASC
</select>
<select id="getInsuranceDetailList" resultType="java.lang.String">
SELECT
a.id
FROM t_insurance_detail a
where a.EMP_IDCARD_NO = #{empIdCard}
and a.DEPT_NO = #{deptNo}
and a.BUY_HANDLE_STATUS = 3 and a.IS_EFFECT = 0 and a.IS_OVERDUE = 0
</select>
</mapper>
......@@ -25,6 +25,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
......@@ -274,4 +275,18 @@ public class TSocialFundInfoController {
return tSocialFundInfoService.selectExitEmpFund(cardVo);
}
/**
* @param paramVo
* @Description: 查询是否存在派增部分失败与成功的的社保
* @Author: hgw
* @Date: 2025/11/20 17:15
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
@Operation(summary = "查询是否存在派增部分失败与成功的的社保、公积金", description = "查询是否存在派增部分失败与成功的的社保")
@Inner
@PostMapping("/inner/getSocialAndFundStatus")
public BaseSearchVO getSocialAndFundStatus(@RequestBody BaseSearchVO paramVo) {
return tSocialFundInfoService.getSocialAndFundStatus(paramVo);
}
}
......@@ -105,4 +105,10 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
long selectFundCountByEmpIdcard(@Param("empIdcard") String empIdcard);
List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(@Param("empIdcard")String empIdcard);
// 离职待办专用,查询社保ID与状态(主要派增部分失败与成功的)
TSocialFundInfo getSocialStatus(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
// 离职待办专用,查询公积金ID与状态(主要派增部分失败与成功的)
TSocialFundInfo getFundStatus(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
}
......@@ -24,6 +24,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.SocialFundVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeAutoRegistCheckVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TInsuranceUnpurchasePersonCardVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.UpdateSocialFoundVo;
......@@ -109,4 +110,14 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
Boolean selectExitEmpFund(TEmployeeAutoRegistCheckVo cardVo);
List<UnFundInfoVo> selectUnFundInfoByEmpIdcard(String empIdcard);
/**
* @param paramVo
* @Description: 查询正常的社保、公积金
* @Author: hgw
* @Date: 2025/11/20 15:57
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
BaseSearchVO getSocialAndFundStatus(BaseSearchVO paramVo);
}
......@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.salary.vo.ListStringVo;
......@@ -968,6 +969,36 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
return false;
}
}
@Override
public BaseSearchVO getSocialAndFundStatus(BaseSearchVO paramVo) {
BaseSearchVO returnVo = new BaseSearchVO();
if (Common.isNotNull(paramVo) && Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
TSocialFundInfo social = baseMapper.getSocialStatus(paramVo.getEmpIdCard(), paramVo.getDeptNo());
if (social != null && Common.isNotNull(social.getDispatchId())) {
returnVo.setResultIdOne(social.getDispatchId());
// 3办理成功、4部分办理失败
if (Common.isNotNull(social.getSocialStatus())) {
if (CommonConstants.THREE_STRING.equals(social.getSocialStatus())) {
returnVo.setResultIdOneStatus("办理成功");
} else if (CommonConstants.FOUR_STRING.equals(social.getSocialStatus())) {
returnVo.setResultIdOneStatus("部分办理失败");
}
}
}
TSocialFundInfo fund = baseMapper.getFundStatus(paramVo.getEmpIdCard(), paramVo.getDeptNo());
if (fund != null && Common.isNotNull(fund.getDispatchId())) {
returnVo.setResultIdTwo(fund.getDispatchId());
if (Common.isNotNull(fund.getFundStatus())) {
if (CommonConstants.THREE_STRING.equals(fund.getFundStatus())) {
returnVo.setResultIdTwoStatus("办理成功");
} else if (CommonConstants.FOUR_STRING.equals(fund.getFundStatus())) {
returnVo.setResultIdTwoStatus("部分办理失败");
}
}
}
}
return returnVo;
}
/**
* @Author fxj
......
......@@ -1293,4 +1293,23 @@
and a.fund_status in ('0', '1', '3', '5', '6', '8')
</select>
<select id="getSocialStatus" resultMap="tSocialFundInfoMap">
SELECT d.id DISPATCH_ID,a.SOCIAL_STATUS
FROM t_social_fund_info a
LEFT JOIN t_dispatch_info d on d.SOCIAL_ID = a.SOCIAL_ID
where a.EMP_IDCARD = #{empIdCard}
and a.SETTLE_DOMAIN_CODE = #{deptNo}
and a.SOCIAL_STATUS in ('3','4')
</select>
<select id="getFundStatus" resultMap="tSocialFundInfoMap">
SELECT d.id DISPATCH_ID,a.FUND_STATUS
FROM t_social_fund_info a
LEFT JOIN t_dispatch_info d on d.FUND_ID = a.FUND_ID
where a.EMP_IDCARD = #{empIdCard}
and a.SETTLE_DOMAIN_CODE_FUND = #{deptNo}
and a.FUND_STATUS in ('3','4')
</select>
</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