Commit 0bdbdd03 authored by fangxinjiang's avatar fangxinjiang

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

parents caa7c1bd 0e5c805b
/*
* 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 com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 通用查询与返回的VO
* @Author: hgw
* @Date: 2025/11/20 15:43
* @return:
**/
@Getter
@Setter
public class BaseSearchListVO implements Serializable {
private static final long serialVersionUID = 1L;
// 其他查询参数
private List<BaseSearchVO> listParam = new ArrayList<>();
// 返回参数
private List<ErrorMessage> errorMessageList = new ArrayList<>();
}
......@@ -6,6 +6,7 @@ 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.BaseSearchListVO;
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;
......@@ -109,4 +110,28 @@ public class InsuranceDaprUtil {
return res;
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 离职待办确认后,更新为商险续签待办为已离职
* @Author: hgw
* @Date: 2025-11-21 14:28:20
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public void updateInsurancePreRenewToIsLeave(BaseSearchVO paramVo) {
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId()
,"/tinsuranceprerenewdetail/inner/updateInsurancePreRenewToIsLeave", paramVo, String.class, SecurityConstants.FROM_IN);
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 离职待办确认后,更新为商险续签待办为已离职
* @Author: hgw
* @Date: 2025-11-21 14:28:20
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public void updateInsurancePreRenewToIsLeaveList(BaseSearchListVO paramVo) {
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId()
,"/tinsuranceprerenewdetail/inner/updateInsurancePreRenewToIsLeaveList", paramVo, String.class, SecurityConstants.FROM_IN);
}
}
......@@ -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.BaseSearchListVO;
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;
......@@ -17,6 +18,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.entity.TIncomeDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SysBaseSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TIncomeDetailReturnVo;
import lombok.extern.log4j.Log4j2;
......@@ -401,4 +403,20 @@ public class SocialDaprUtils {
return res;
}
/**
* @param paramVo 查询参数,主要是身份证与项目编码
* @Description: 离职待办调用的批量派减社保、公积金
* @Author: hgw
* @Date: 2025-11-21 14:54:37
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO>
**/
public R<BaseSearchListVO> leaveToReduceSocialAndFund(List<TDispatchReduceVo> paramVo) {
R<BaseSearchListVO> res = HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId()
,"/tsocialfundinfo/inner/leaveToReduceSocialAndFund", JSON.toJSONString(paramVo), BaseSearchListVO.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("查询人员的社保公积金状态失败!");
}
return res;
}
}
......@@ -33,7 +33,8 @@ public class RegistConstants {
public static final String BACK_RECEIVE = "拒绝入职";
public static final String BASE_REASON_TYPE = "个人辞职";
//
public static final String BASE_REASON_TYPE = "1";
public static final String BASE_LINK_PORT = "人员离职";
}
......@@ -19,9 +19,9 @@ package com.yifu.cloud.plus.v1.csp.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -30,7 +30,6 @@ import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 自动化离职待办
......@@ -157,7 +156,7 @@ public class EmployeeRegistrationLeave extends BaseEntity {
@Schema(description = "停缴社保日期")
private String socialReduceDate;
/**
* 减少原因(社保)
* 减少原因(社保)ID默认为1
*/
@ExcelAttribute(name = "减少原因(社保)", maxLength = 50)
@Length(max = 50, message = "减少原因(社保)不能超过50个字符")
......@@ -521,4 +520,33 @@ public class EmployeeRegistrationLeave extends BaseEntity {
@Schema(description = "项目档案失败时间")
private LocalDateTime failEmpProjectTime;
@Schema(description = "无需处理原因(社保)")
private String closeRemarkSocial;
@Schema(description = "无需处理原因(公积金)")
private String closeRemarkFund;
@Schema(description = "无需处理原因(商险)")
private String closeRemarkInsurance;
@Schema(description = "无需处理原因(合同)")
private String closeRemarkContract;
@Schema(description = "无需处理原因(档案)")
private String closeRemarkEmp;
@Schema(description = "无需处理原因(项目档案)")
private String closeRemarkEmpProject;
@TableField(exist = false)
@ExcelProperty(value = "项目编码")
private String deptNo;
@TableField(exist = false)
@ExcelProperty(value = "项目名称")
private String deptName;
@TableField(exist = false)
@Schema(description = "员工姓名")
private String employeeName;
@TableField(exist = false)
@Schema(description = "身份证号")
private String empIdcard;
}
package com.yifu.cloud.plus.v1.csp.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
@Data
@Schema(description = "离职批量确认VO")
public class BatchSureLeaveVo implements Serializable {
private static final long serialVersionUID = 628032758008497542L;
/**
* 更新主键集合ids
*/
@Schema(description = "更新主键集合ids")
private List<String> ids;
/**
* 商险是否处理
*/
@Schema(description = "商险是否处理:0否1是")
private String doTypeInsurance;
@Schema(description = "停缴社保日期")
private String socialReduceDate;
@Schema(description = "停缴公积金日期")
private String fundReduceDate;
@Schema(description = "减少原因(社保和公积金)")
private String socialReasonTypeAndFund;
@Schema(description = "社保公积金派减备注")
private String socialTrustRemarkAndFund;
@Schema(description = "社保公积金派减时间")
private LocalDateTime socialExpectedTimeAndFund;
@Schema(description = "合同终止发起时间")
private LocalDateTime contractExpectedTime;
}
......@@ -21,17 +21,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.BatchSureLeaveVo;
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.ErrorMessage;
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;
......@@ -118,6 +117,15 @@ public class EmployeeRegistrationLeaveController {
return R.ok(employeeRegistrationLeaveService.initLeaveInfo(id));
}
/**
* 批量确认初始化
*/
@Operation(summary = "批量确认初始化", description = "批量确认初始化")
@GetMapping("/initBatchSureInfo")
public R<BatchSureLeaveVo> initBatchSureInfo() {
return R.ok(employeeRegistrationLeaveService.initBatchSureInfo());
}
/**
* 自动化离职待办 批量导出
*
......@@ -152,6 +160,40 @@ public class EmployeeRegistrationLeaveController {
menuUtil.setAuthSql(user, searchVo);
}
/**
* 单个手动关闭
*/
@Operation(summary = "单个手动关闭-离职待办", description = "单个手动关闭-离职待办")
@SysLog("单个手动关闭-离职待办")
@GetMapping("/doClose")
public R<String> doClose(@RequestParam String id, @RequestParam String remark) {
EmployeeRegistrationLeave leave = employeeRegistrationLeaveService.getById( id);
if (leave != null) {
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusSocial())) {
leave.setCloseRemarkSocial( remark);
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusFund())) {
leave.setCloseRemarkFund( remark);
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusInsurance())) {
leave.setCloseRemarkInsurance( remark);
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusContract())) {
leave.setCloseRemarkContract( remark);
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusEmp())) {
leave.setCloseRemarkEmp( remark);
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusProject())) {
leave.setCloseRemarkEmpProject( remark);
}
leave.setDoStatus(CommonConstants.SIX_STRING);
leave.setLeaveStatus(CommonConstants.THREE_STRING);
employeeRegistrationLeaveService.updateById( leave);
}
return R.ok();
}
/**
* @param leave 离职待办
*/
......@@ -171,7 +213,7 @@ public class EmployeeRegistrationLeaveController {
@Operation(summary = "批量确认-离职待办", description = "批量确认-离职待办")
@SysLog("批量确认-离职待办(与单个确认分开,是因为单个确认还有编辑功能,批量仅改状态")
@PostMapping("/doSureBatch")
public R<String> doSureBatch(@RequestBody BatchIgnoreVo vo) {
public R<String> doSureBatch(@RequestBody BatchSureLeaveVo vo) {
if (null == vo || vo.getIds() == null || vo.getIds().isEmpty()){
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
......@@ -179,6 +221,20 @@ public class EmployeeRegistrationLeaveController {
}
/**
* @Description: 定时任务批量派单
* @Author: hgw
* @Date: 2025-11-21 16:20:03
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R
**/
@Operation(description = "定时任务批量派单")
@PostMapping("/inner/autoDoLeave")
public void autoDoLeave() {
employeeRegistrationLeaveService.autoDoLeave();
}
/**
* @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
* @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
* @Description: 离职待办单个/批量派单
* @Author: hgw
* @Date: 2025/11/17 14:17
......@@ -186,8 +242,9 @@ public class EmployeeRegistrationLeaveController {
**/
@Operation(description = "离职待办单个/批量派单")
@PostMapping("/batchDoLeave")
public R<List<InsuranceAutoParam>> batchDoLeave(@RequestBody List<String> idList, @RequestParam(required = false) String isExit) {
return employeeRegistrationLeaveService.batchDoLeave(idList, isExit, false);
public R<List<ErrorMessage>> batchDoLeave(@RequestBody List<String> idList, @RequestParam String isExit
, @RequestParam(required = false) String doType) {
return employeeRegistrationLeaveService.batchDoLeave(idList, isExit, doType);
}
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.*;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProjectBelongDept;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeProjectBelongDeptSearchCspVo;
......@@ -47,5 +48,7 @@ public interface EmployeeRegistrationMapper extends BaseMapper<EmployeeRegistrat
List<EmployeeRegistrationHrAutoExportVo> selectHrAutoExportList(@Param("employeeRegistration") EmployeeRegistrationSearchVo employeeRegistration);
List<EmployeeRegistration> selectRegistrationListBySure(@Param("idList") List<String> idList);
}
......@@ -22,12 +22,11 @@ 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.BatchSureLeaveVo;
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.ErrorMessage;
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;
......@@ -65,14 +64,18 @@ public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegis
// 单个确认(含编辑功能)
R<String> doSure(EmployeeRegistrationLeave leave);
// 批量确认初始化
BatchSureLeaveVo initBatchSureInfo();
// 批量确认(不含编辑)
R<String> doSureBatch(BatchIgnoreVo vo);
R<String> doSureBatch(BatchSureLeaveVo vo);
// 每天下午三点、三点二十推送续保待派单数据
//void autoDoInsurancePreRenew();
void autoDoLeave();
// 批量派单
// pushQiWeiFlag : 是否推送企微 true:推送(当前仅下午3点与3点20的定时任务,需要推送企微),false:不推送
R<List<InsuranceAutoParam>> batchDoLeave(List<String> idList, String sameFlag, boolean pushQiWeiFlag);
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
R<List<ErrorMessage>> batchDoLeave(List<String> idList, String isExit, String doType);
}
......@@ -19,7 +19,6 @@ 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;
......@@ -29,28 +28,26 @@ 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;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import com.yifu.cloud.plus.v1.csp.vo.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
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.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
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.BaseSearchListVO;
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 com.yifu.cloud.plus.v1.yifu.insurances.vo.HolidayListVO;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceBatchParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceReplaceParam;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -61,9 +58,9 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.util.*;
import java.util.stream.Collectors;
/**
* 自动化离职待办
......@@ -173,7 +170,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, EmployeeRegistrationLeave.class).build();
ExcelWriter excelWriter = EasyExcelFactory.write(out, EmployeeRegistrationLeaveExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......@@ -222,7 +219,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcelFactory.write(out, EmployeeRegistrationLeave.class).build();
ExcelWriter excelWriter = EasyExcelFactory.write(out, EmployeeRegistrationLeaveConfirmExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......@@ -260,12 +257,6 @@ 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());
......@@ -420,16 +411,20 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
@Override
public EmployeeRegistrationLeave initLeaveInfo(String id) {
EmployeeRegistration registration = employeeRegistrationMapper.selectById( id);
EmployeeRegistrationLeave leave = this.getById( 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();
Map<String, Integer> holidayMap = getHolidayMap();
// 停缴社保日期
if (Common.isNotNull(leave.getSocialDispatchIdOld()) && Common.isEmpty(leave.getSocialReduceDate())) {
leave.setSocialReduceDate(DateUtil.addMonth(CommonConstants.ONE_INT));
}
// 停缴公积金日期
if (Common.isNotNull(leave.getFundDispatchIdOld()) && Common.isEmpty(leave.getFundReduceDate())) {
leave.setFundReduceDate(DateUtil.addMonth(CommonConstants.ONE_INT));
}
// 获取下个工作日,且大于等于今天,如果大于15点20,换下个工作日
......@@ -442,11 +437,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
// 设置商险退保状态
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));
}
initInsurance(registration, leave, holidayMap);
// 设置合同终止状态
if (Common.isNotNull(leave.getContractIdOld()) && Common.isEmpty(leave.getContractExpectedTime())) {
leave.setContractExpectedTime(calculateNextWorkDays(holidayMap));
......@@ -454,6 +445,36 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
return leave;
}
// 初始化商险
private void initInsurance(EmployeeRegistration registration, EmployeeRegistrationLeave leave, Map<String, Integer> 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));
}
}
@Override
public BatchSureLeaveVo initBatchSureInfo() {
BatchSureLeaveVo vo = new BatchSureLeaveVo();
//获取假日信息
//获取假日信息
Map<String, Integer> holidayMap = getHolidayMap();
// 商险是否处理:0否1是
vo.setDoTypeInsurance(CommonConstants.ONE_STRING);
// 停缴社保日期
vo.setSocialReduceDate(DateUtil.addMonth(CommonConstants.ONE_INT));
// 停缴公积金日期
vo.setFundReduceDate(DateUtil.addMonth(CommonConstants.ONE_INT));
vo.setSocialReasonTypeAndFund(RegistConstants.BASE_REASON_TYPE);
// 获取下个工作日,且大于等于今天,如果大于15点20,换下个工作日
vo.setSocialExpectedTimeAndFund(calculateNextWorkDays(holidayMap));
// 设置合同终止
vo.setContractExpectedTime(calculateNextWorkDays(holidayMap));
return vo;
}
private LocalDate dateToLocalDate(Date joinLeaveDate) {
return joinLeaveDate.toInstant()
.atZone(ZoneId.systemDefault())
......@@ -526,10 +547,56 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
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())) {
EmployeeRegistration registrationOld = employeeRegistrationMapper.selectById(leave.getId());
if (leaveOld != null && Common.isNotNull(leaveOld.getId()) && registrationOld != null
&& Common.isNotNull(registrationOld.getEmpIdcard()) && Common.isNotNull(registrationOld.getDeptNo())) {
if (CommonConstants.ZERO_STRING.equals(leaveOld.getLeaveStatus())) {
leave.setLeaveStatus(CommonConstants.ONE_STRING);
leave.setLeaveStatus(CommonConstants.ONE_STRING);
// 初始化信息
String doStatus = CommonConstants.SIX_STRING;
if (Common.isNotNull(leave.getDoType())) {
if (leave.getDoType().contains(CommonConstants.THREE_STRING)) {
leave.setDoStatusInsurance(CommonConstants.TWO_STRING);
} else {
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
}
// 停缴社保日期
if (Common.isNotNull(leave.getSocialDispatchIdOld())) {
leave.setDoStatusSocial(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
// 停缴公积金日期
if (Common.isNotNull(leave.getFundDispatchIdOld())) {
leave.setDoStatusFund(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
// 设置合同终止状态
if (Common.isNotNull(leave.getContractIdOld())) {
leave.setDoStatusContract(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
if (Common.isNotNull(leave.getEmpProjectIdOld())) {
leave.setDoStatusProject(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
if (Common.isNotNull(leave.getEmpIdOld())) {
leave.setDoStatusEmp(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
leave.setDoStatus(doStatus);
if (CommonConstants.SIX_STRING.equals(doStatus)) {
leave.setLeaveStatus(CommonConstants.THREE_STRING);
}
}
this.updateById(leave);
// 离职待办确认后,更新为商险续签待办为已离职
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setEmpIdCard(registrationOld.getEmpIdcard());
paramVo.setDeptNo(registrationOld.getDeptNo());
insuranceDaprUtil.updateInsurancePreRenewToIsLeave(paramVo);
return R.ok();
} else {
return R.failed("状态不是待确认");
......@@ -543,32 +610,112 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
@Override
public R<String> doSureBatch(BatchIgnoreVo vo) {
public R<String> doSureBatch(BatchSureLeaveVo vo) {
List<String> ids = vo.getIds();
if (Common.isEmpty(ids)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
//获取假日信息
Map<String, Integer> holidayMap = getHolidayMap();
if (holidayMap == null) {
return R.failed("未获取到假日信息,请检查社保服务!");
}
// 先查再更新
List<EmployeeRegistrationLeave> alertList = baseMapper.selectLeaveListBySure(ids);
if (alertList != null && !alertList.isEmpty()) {
List<String> successList = new ArrayList<>();
List<EmployeeRegistration> registrationList = employeeRegistrationMapper.selectRegistrationListBySure(ids);
if (alertList != null && !alertList.isEmpty() && registrationList != null && !registrationList.isEmpty()) {
List<EmployeeRegistrationLeave> successList = new ArrayList<>();
Map<String, EmployeeRegistrationLeave> alertMap = new HashMap<>();
Map<String, EmployeeRegistration> registrationMap = new HashMap<>();
for (EmployeeRegistrationLeave alert : alertList) {
alertMap.put(alert.getId(), alert);
}
EmployeeRegistrationLeave alert;
for (EmployeeRegistration registration : registrationList) {
registrationMap.put(registration.getId(), registration);
}
EmployeeRegistrationLeave leave;
EmployeeRegistration registration;
int successNum = 0;
// 有任一处理项,则变为1未执行,否则6无需处理
String doStatus = CommonConstants.SIX_STRING;
// 离职待办确认后,更新为商险续签待办为已离职
List<BaseSearchVO> paramVoList = new ArrayList<>();
BaseSearchVO paramVo;
for (String id : ids) {
alert = alertMap.get(id);
if (alert != null && CommonConstants.ZERO_STRING.equals(alert.getLeaveStatus())) {
successList.add(id);
leave = alertMap.get(id);
registration = registrationMap.get(id);
if (registration != null && leave != null && CommonConstants.ZERO_STRING.equals(leave.getLeaveStatus())) {
leave.setLeaveStatus(CommonConstants.ONE_STRING);
// 初始化信息
if (Common.isNotNull(leave.getDoType())) {
if (leave.getDoType().contains(CommonConstants.THREE_STRING)) {
// 要处理商险初始值
if (Common.isNotNull(vo.getDoTypeInsurance()) && CommonConstants.ONE_STRING.equals(vo.getDoTypeInsurance())) {
// 初始化商险
initInsurance(registration, leave, holidayMap);
leave.setDoStatusInsurance(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
} else {
this.removeInsuranceToDoType(leave);
}
}
// 停缴社保日期
if (Common.isNotNull(leave.getSocialDispatchIdOld())) {
leave.setSocialReduceDate(vo.getSocialReduceDate());
leave.setSocialReasonType(vo.getSocialReasonTypeAndFund());
leave.setSocialTrustRemark(vo.getSocialTrustRemarkAndFund());
leave.setSocialExpectedTime(vo.getSocialExpectedTimeAndFund());
leave.setDoStatusSocial(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
// 停缴公积金日期
if (Common.isNotNull(leave.getFundDispatchIdOld())) {
leave.setFundReduceDate(vo.getFundReduceDate());
leave.setFundReasonType(vo.getSocialReasonTypeAndFund());
leave.setFundTrustRemark(vo.getSocialTrustRemarkAndFund());
leave.setFundExpectedTime(vo.getSocialExpectedTimeAndFund());
leave.setDoStatusFund(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
// 设置合同终止状态
if (Common.isNotNull(leave.getContractIdOld())) {
leave.setContractExpectedTime(vo.getContractExpectedTime());
leave.setDoStatusContract(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
if (Common.isNotNull(leave.getEmpProjectIdOld())) {
leave.setDoStatusProject(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
if (Common.isNotNull(leave.getEmpIdOld())) {
leave.setDoStatusEmp(CommonConstants.TWO_STRING);
doStatus = CommonConstants.ONE_STRING;
}
leave.setDoStatus(doStatus);
if (CommonConstants.SIX_STRING.equals(doStatus)) {
leave.setLeaveStatus(CommonConstants.THREE_STRING);
}
}
paramVo = new BaseSearchVO();
paramVo.setEmpIdCard(registration.getEmpIdcard());
paramVo.setDeptNo(registration.getDeptNo());
paramVoList.add(paramVo);
successList.add(leave);
successNum++;
}
}
if (successNum == CommonConstants.ZERO_INT) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
} else {
baseMapper.doBatchSure(successList);
this.updateBatchById(successList);
// 离职待办确认后,更新为商险续签待办为已离职
if (!paramVoList.isEmpty()) {
BaseSearchListVO baseSearchListVO = new BaseSearchListVO();
baseSearchListVO.setListParam(paramVoList);
insuranceDaprUtil.updateInsurancePreRenewToIsLeaveList(baseSearchListVO);
}
return R.ok();
}
} else {
......@@ -576,48 +723,266 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
}
}
private Map<String, Integer> getHolidayMap() {
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();
}
return holidayMap;
}
// 去除浮动的商险
private void removeInsuranceToDoType(EmployeeRegistrationLeave alert) {
if (alert.getDoType().contains(",3")) {
alert.setDoType(alert.getDoType().replace(",3", ""));
} else if (alert.getDoType().contains("3,")) {
alert.setDoType(alert.getDoType().replace("3,", ""));
} else if (CommonConstants.THREE_STRING.equals(alert.getDoType())) {
alert.setDoType("");
}
}
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
@Override
public R<List<InsuranceAutoParam>> batchDoLeave(List<String> idList, String sameFlag, boolean pushQiWeiFlag) {
public void autoDoLeave() {
List<EmployeeRegistrationLeave> leaveList = baseMapper.selectLeaveListByDispatch(null);
batchDoLeaveCore(leaveList, CommonConstants.ZERO_STRING, null);
}
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
@Override
public R<List<ErrorMessage>> batchDoLeave(List<String> idList, String isExit, String doType) {
List<EmployeeRegistrationLeave> leaveList = baseMapper.selectLeaveListByDispatch(idList);
return batchDoLeaveCore(leaveList, isExit, doType);
}
// @param isExit: 1仅发起日期为今日及之前的事项 0立即发起(全量)
// * @param doType: 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
private R<List<ErrorMessage>> batchDoLeaveCore(List<EmployeeRegistrationLeave> leaveList, String isExit, String doType) {
if (Common.isEmpty(leaveList)) {
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
List<String> socialOldList = new ArrayList<>();
List<String> fundOldList = new ArrayList<>();
List<TDispatchReduceVo> socialOldList = new ArrayList<>();
TDispatchReduceVo vo;
List<TDispatchReduceVo> 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())) {
// 今天的最后时间,用于发起今日及之前的事项
LocalDateTime nowTime = LocalDateTime.now().with(LocalTime.MAX);
for (EmployeeRegistrationLeave leave : leaveList) {
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)))) {
vo = new TDispatchReduceVo();
vo.setEmpName(leave.getEmployeeName());
vo.setEmpIdcard(leave.getEmpIdcard());
vo.setDepartNo(leave.getDeptNo());
vo.setSocialReduceDate(leave.getSocialReduceDate());
vo.setReasonType(leave.getSocialReasonType());
vo.setTrustRemark(leave.getSocialTrustRemark());
vo.setChangeContractAndEmployee(CommonConstants.ONE_STRING);
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)))) {
vo = new TDispatchReduceVo();
vo.setEmpName(leave.getEmployeeName());
vo.setEmpIdcard(leave.getEmpIdcard());
vo.setDepartNo(leave.getDeptNo());
vo.setFundReduceDate(leave.getFundReduceDate());
vo.setReasonType(leave.getFundReasonType());
vo.setTrustRemark(leave.getFundTrustRemark());
vo.setChangeContractAndEmployee(CommonConstants.ONE_STRING);
fundOldList.add(vo);
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.THREE_STRING))
&&Common.isNotNull(leave.getInsuranceId()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getInsuranceExpectedTime().isBefore(nowTime)))) {
insuranceOldList.add(leave.getInsuranceId());
}
if (Common.isNotNull(leave.getContractIdOld())) {
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)))) {
contractOldList.add(leave.getContractIdOld());
}
if (Common.isNotNull(leave.getEmpIdOld())) {
empOldList.add(leave.getEmpIdOld());
}
if (Common.isNotNull(leave.getEmpProjectIdOld())) {
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.FIVE_STRING))
&&Common.isNotNull(leave.getEmpProjectIdOld())) {
empProjectOldList.add(leave.getEmpProjectIdOld());
}
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(leave.getEmpIdOld())) {
empOldList.add(leave.getEmpIdOld());
}
}
// TODO -继续完善
//组装返回给前端
List<ErrorMessage> socialParamList = new ArrayList<>();
List<ErrorMessage> fundParamList = new ArrayList<>();
List<InsuranceBatchParam> batchParamList = new ArrayList<>();
List<InsuranceReplaceParam> replaceParamList = new ArrayList<>();
if (!socialOldList.isEmpty()) {
R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(socialOldList);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())
&& listR.getData().getErrorMessageList() != null && !listR.getData().getErrorMessageList().isEmpty()) {
socialParamList = listR.getData().getErrorMessageList();
}
}
if (!fundOldList.isEmpty()) {
R<BaseSearchListVO> listR = socialDaprUtils.leaveToReduceSocialAndFund(fundOldList);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData())
&& listR.getData().getErrorMessageList() != null && !listR.getData().getErrorMessageList().isEmpty()) {
fundParamList = listR.getData().getErrorMessageList();
}
}
/*if (!insuranceOldList.isEmpty()) {
R<List<InsuranceBatchParam>> listR = insuranceDaprUtil.batchInsurance(insuranceOldList, null, true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
batchParamList = listR.getData();
}
}
if (!contractOldList.isEmpty()) {
R<List<InsuranceReplaceParam>> listR = archivesDaprUtil.replaceInsurance(contractOldList, null, true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
replaceParamList = listR.getData();
}
}
if (!empProjectOldList.isEmpty()) {
R<List<InsuranceReplaceParam>> listR = archivesDaprUtil.replaceInsurance(empProjectOldList, null, true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
replaceParamList = listR.getData();
}
}
if (!empOldList.isEmpty()) {
R<List<InsuranceReplaceParam>> listR = archivesDaprUtil.replaceInsurance(empOldList, null, true);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().isEmpty()) {
replaceParamList = listR.getData();
}
}
// 使用Stream合并三个列表
List<InsuranceAutoParam> autoAddParamList = this.getInsuranceAutoParamList(paramList, batchParamList, replaceParamList);
if (autoAddParamList.isEmpty()) {
LambdaUpdateWrapper<EmployeeRegistrationLeave> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(EmployeeRegistrationLeave::getId, idList)
.set(EmployeeRegistrationLeave::getLeaveStatus, CommonConstants.THREE_STRING)
.set(EmployeeRegistrationLeave::getDoStatus, CommonConstants.FIVE_STRING);
this.update(updateWrapper);
} else {
// 将 autoAddParamList 中的id等信息提取出来,放入一个 Set 中
Set<String> autoAddParamSet = new HashSet<>();
Map<String, String> errorMessageMap = new HashMap<>();
for (InsuranceAutoParam info : autoAddParamList) {
autoAddParamSet.add(info.getInsurancePreRenewId());
errorMessageMap.put(info.getInsurancePreRenewId(), info.getErrorMessage());
}
for (TInsurancePreRenewDetail pre : leaveList) {
// 派单失败的
if (autoAddParamSet.contains(pre.getId())) {
errorrMessage = errorMessageMap.get(pre.getId());
if (Common.isNotNull(customerUserLoginname)) {
nums = failNumMap.get(customerUserLoginname);
if (Common.isEmpty(nums)) {
nums = CommonConstants.ZERO_INT;
}
nums++;
failNumMap.put(customerUserLoginname, nums);
// 派单失败,组装需要推送企微的明细
qw = preQwMap.get(customerUserLoginname);
if (qw == null) {
qw = new TInsurancePreRenewDetailQw();
qwUuId = String.valueOf(UUID.randomUUID()).replace("-", "");
qw.setId(qwUuId);
qw.setCreateTime(now);
qw.setCustomerUserLoginname(customerUserLoginname);
qw.setCustomerUsername(pre.getCustomerUsername());
} else {
qwUuId = qw.getId();
}
preQwMap.put(customerUserLoginname, qw);
// 派单失败,组装需要推送企微的明细
qwDetail = new TInsurancePreRenewDetailQwDetail();
qwDetail.setPreId(pre.getId());
qwDetail.setMainId(qwUuId);
qwDetail.setEmpName(pre.getEmpName());
qwDetail.setEmpIdcard(pre.getEmpIdcardNo());
qwDetail.setErrorInfo(errorrMessage);
qwDetail.setErrorTime(now);
qwDetalList.add(qwDetail);
}
updatePre.setProcessStatus(CommonConstants.TWO_STRING);
updatePre.setErrorTime(now);
return R.ok();
updatePre.setErrorInfo(errorrMessage);
updateList.add(updatePre);
} else {
// 派单成功的
updatePre.setProcessStatus(CommonConstants.THREE_STRING);
updateList.add(updatePre);
}
}
if (!updateList.isEmpty()) {
this.updateBatchById(updateList);
}
// pushQiWeiFlag 推送企微的flag,true表示推送企微
if (pushQiWeiFlag && !preQwMap.isEmpty()) {
List<TInsurancePreRenewDetailQw> qwList = new ArrayList<>();
int allNum;
int failNum;
StringBuilder description;
String userLoginNames = null;
for (Map.Entry<String, TInsurancePreRenewDetailQw> entry : preQwMap.entrySet()) {
customerUserLoginname = entry.getKey();
if (Common.isNotNull(userLoginNames)) {
userLoginNames += "," + customerUserLoginname;
} else {
userLoginNames = customerUserLoginname;
}
qw = entry.getValue();
allNum = allNumMap.get(customerUserLoginname);
if (Common.isEmpty(allNum)) {
allNum = 0;
}
failNum = failNumMap.get(customerUserLoginname);
if (Common.isEmpty(failNum)) {
failNum = 0;
}
description = new StringBuilder("商险派单数:").append(allNum).append("份,【失败份数:").append(failNum)
.append("份】<br>点击查看详情!<br>请及时至HRO系统处理,以免耽误购买进度!");
qw.setDescription(description.toString());
qwList.add(qw);
}
if (!qwDetalList.isEmpty() && !qwList.isEmpty()) {
tInsurancePreRenewDetailQwDetailService.saveBatch(qwDetalList);
tInsurancePreRenewDetailQwService.saveBatch(qwList);
if (Common.isNotNull(userLoginNames)) {
Map<String, String> sysUserMap = getUserQiWeiInfo(userLoginNames);
String qwInfo;
if (!sysUserMap.isEmpty()) {
for (TInsurancePreRenewDetailQw sendQw : qwList) {
qwInfo = sysUserMap.get(sendQw.getCustomerUserLoginname());
if (Common.isNotNull(qwInfo)) {
sendMessageToWx(qwInfo, sendQw.getDescription(), sendQw.getId());
}
}
}
}
}
}
}*/
return R.ok(socialParamList);
}
}
......@@ -142,6 +142,18 @@
<result property="failContractTime" column="fail_contract_time"/>
<result property="failEmpTime" column="fail_emp_time"/>
<result property="failEmpProjectTime" column="fail_emp_project_time"/>
<result property="closeRemarkSocial" column="close_remark_social"/>
<result property="closeRemarkFund" column="close_remark_fund"/>
<result property="closeRemarkInsurance" column="close_remark_insurance"/>
<result property="closeRemarkContract" column="close_remark_contract"/>
<result property="closeRemarkEmpProject" column="close_remark_emp_project"/>
<result property="closeRemarkEmp" column="close_remark_emp"/>
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
</resultMap>
<!-- 全量字段 -->
<sql id="Base_Column_List">
......@@ -212,7 +224,13 @@
a.fail_insurance_time,
a.fail_contract_time,
a.fail_emp_time,
a.fail_emp_project_time
a.fail_emp_project_time,
a.close_remark_social,
a.close_remark_fund,
a.close_remark_insurance,
a.close_remark_contract,
a.close_remark_emp,
a.close_remark_emp_project
</sql>
......@@ -566,6 +584,10 @@ when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' wh
<!-- 查找符合条件的需要派单的数据 -->
<select id="selectLeaveListByDispatch" resultMap="employeeRegistrationLeaveMap">
SELECT
b.employee_name,
b.emp_idcard,
b.dept_name,
b.dept_no,
<include refid="Base_Column_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
......@@ -577,9 +599,6 @@ when '4' then '待减员' when '5' then '待办理' when '6' then '减员中' wh
#{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>
......
......@@ -411,4 +411,18 @@
</if>
</update>
<select id="selectRegistrationListBySure" resultMap="employeeRegistrationMap">
SELECT
<include refid="Base_Column_List"/>
FROM employee_registration a
left join employee_registration_leave b on a.id=b.id
where b.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>
</mapper>
......@@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
......@@ -165,4 +167,34 @@ public class TInsurancePreRenewDetailController {
return tInsurancePreRenewDetailService.isWorkDayTest();
}
/**
* @param paramVo
* @Description: 离职待办确认后,更新为商险续签待办为已离职
* @Author: hgw
* @Date: 2025-11-21 14:21:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
@Operation(summary = "离职待办确认后,更新为商险续签待办为已离职", description = "离职待办确认后,更新为商险续签待办为已离职")
@Inner
@PostMapping("/inner/updateInsurancePreRenewToIsLeave")
public String updateInsurancePreRenewToIsLeave(@RequestBody BaseSearchVO paramVo) {
tInsurancePreRenewDetailService.updateInsurancePreRenewToIsLeave(paramVo);
return CommonConstants.UPDATE_SUCCESS;
}
/**
* @param paramVoList
* @Description: 离职待办确认后,更新为商险续签待办为已离职_多条数据
* @Author: hgw
* @Date: 2025-11-21 14:21:25
* @return: com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO
**/
@Operation(summary = "离职待办确认后,更新为商险续签待办为已离职", description = "离职待办确认后,更新为商险续签待办为已离职")
@Inner
@PostMapping("/inner/updateInsurancePreRenewToIsLeaveList")
public String updateInsurancePreRenewToIsLeaveList(@RequestBody BaseSearchListVO paramVoList) {
tInsurancePreRenewDetailService.updateInsurancePreRenewToIsLeaveList(paramVoList);
return CommonConstants.UPDATE_SUCCESS;
}
}
......@@ -55,4 +55,7 @@ public interface TInsurancePreRenewDetailMapper extends BaseMapper<TInsurancePre
void updateRenewBatchById(@Param("idList") List<String> idList);
// 离职待办确认后,更新为商险续签待办为已离职
void updateInsurancePreRenewToIsLeave(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
}
......@@ -21,6 +21,8 @@ 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.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
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;
......@@ -61,4 +63,9 @@ public interface TInsurancePreRenewDetailService extends IService<TInsurancePreR
R<List<InsuranceAutoParam>> batchDoInsurancePreRenew(List<String> idList, String sameFlag, boolean pushQiWeiFlag);
boolean isWorkDayTest();
// 离职待办确认后,更新为商险续签待办为已离职
void updateInsurancePreRenewToIsLeave(BaseSearchVO paramVo);
void updateInsurancePreRenewToIsLeaveList(BaseSearchListVO paramVoList);
}
......@@ -27,6 +27,8 @@ 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.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchVO;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.SocialDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig;
......@@ -673,4 +675,20 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
return sysUserMap;
}
// 离职待办确认后,更新为商险续签待办为已离职
@Override
public void updateInsurancePreRenewToIsLeave(BaseSearchVO paramVo) {
baseMapper.updateInsurancePreRenewToIsLeave(paramVo.getEmpIdCard(), paramVo.getDeptNo());
}
// 离职待办确认后,更新为商险续签待办为已离职
@Override
public void updateInsurancePreRenewToIsLeaveList(BaseSearchListVO paramVoList) {
if (paramVoList != null && !paramVoList.getListParam().isEmpty()) {
for (BaseSearchVO paramVo : paramVoList.getListParam()) {
baseMapper.updateInsurancePreRenewToIsLeave(paramVo.getEmpIdCard(), paramVo.getDeptNo());
}
}
}
}
......@@ -332,4 +332,12 @@
</foreach>
</update>
<update id="updateInsurancePreRenewToIsLeave">
<if test="empIdCard != null and empIdCard.trim() != '' and deptNo != null and deptNo.trim() != ''">
update t_insurance_pre_renew_detail a
set a.is_leave = '1'
where a.EMP_IDCARD_NO = #{empIdCard} and a.DEPT_NO = #{deptNo}
</if>
</update>
</mapper>
......@@ -29,6 +29,7 @@ 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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
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.HttpDaprUtil;
......@@ -503,6 +504,14 @@ public class TDispatchInfoController {
return R.ok(errorMessageList);
}
@Operation(description = "离职调用的派减社保或公积金")
@SysLog("离职调用的派减社保或公积金")
@PostMapping("/inner/leaveToReduceSocialAndFund")
@Inner
public R<BaseSearchListVO> leaveToReduceSocialAndFund(@RequestBody List<TDispatchReduceVo> excelVOList) {
return new R<>(tDispatchInfoService.leaveToReduceSocialAndFund(excelVOList));
}
/**
* @Author fxj
* @Description 派单申请批量审核
......
......@@ -24,7 +24,6 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.THolidayInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
/**
......
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SocialAndFundReduceVo;
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.BaseSearchListVO;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFundInfo;
......@@ -72,6 +73,9 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream, String orderId,String flag);
// 离职待办调用的批量派减社保、公积金
BaseSearchListVO leaveToReduceSocialAndFund(List<TDispatchReduceVo> excelVOList);
@Transactional
@ShardingTransactionType(TransactionType.BASE)
void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList, YifuUser user, String orderId,String flag);
......
......@@ -51,6 +51,8 @@ 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.redis.RedisDistributedLock;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.BaseSearchListVO;
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.CheckDaprUtil;
......@@ -91,6 +93,8 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.http.HttpHeaders;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
......@@ -3129,6 +3133,45 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return this.judgeAllMessage(errorMessageList);
}
// 离职待办调用的批量派减社保、公积金
@Override
public BaseSearchListVO leaveToReduceSocialAndFund(List<TDispatchReduceVo> excelVOList) {
BaseSearchListVO returnVo = new BaseSearchListVO();
List<ErrorMessage> errorMessageList = new ArrayList<>();
int batchCount = CommonConstants.BATCH_COUNT;
List<TDispatchReduceVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(batchCount);
YifuUser userLogin = SecurityUtils.getUser();
String nickName = "自动化自动";
if (userLogin != null && Common.isNotNull(userLogin.getNickname())) {
nickName += "-" + userLogin.getNickname();
}
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("2", 1L, "", nickName,
nickName, "0", SecurityConstants.BCRYPT + "123456",
"12345678911", true, true, true,
true,
"1", authorities, "1",
null, null,
null,null);
if (excelVOList != null && !excelVOList.isEmpty()) {
int i=1;
TDispatchReduceVo dispatchVo;
for (TDispatchReduceVo vo : excelVOList) {
i++;
cachedDataList.add(vo);
if (cachedDataList.size() >= batchCount) {
batchReduceDispatch(cachedDataList, errorMessageList, user, null, null);
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(batchCount);
}
}
}
returnVo.setErrorMessageList(errorMessageList);
return returnVo;
}
@Override
public void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList,
YifuUser user, String orderId, String flag) {
......
......@@ -96,6 +96,6 @@
SELECT
DATE_FORMAT(a.DATE,'%Y-%m-%d') DATE
FROM t_holiday_info a
where a.DATE between DATE_FORMAT(curdate(),'%Y-%m-%d') and DATE_FORMAT(date_add( curdate(), INTERVAL 1 MONTH ),'%Y-%m-%d')
where a.DATE between DATE_FORMAT(curdate(),'%Y-%m-%d') and DATE_FORMAT(date_add( curdate(), INTERVAL 1 YEAR ),'%Y-%m-%d')
</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