Commit 2a1a9f0c authored by fangxinjiang's avatar fangxinjiang

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

parents 9615a97c 3879e29b
...@@ -33,6 +33,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil; ...@@ -33,6 +33,7 @@ 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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceAlertSearchVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -74,6 +75,25 @@ public class TEmpContractAlertController { ...@@ -74,6 +75,25 @@ public class TEmpContractAlertController {
setAuth(searchVo); setAuth(searchVo);
return R.ok(tEmpContractAlertService.pageDiy(page, searchVo)); return R.ok(tEmpContractAlertService.pageDiy(page, searchVo));
} }
/**
* 合同待续签-分页查询
* @param page 分页对象
* @param searchVo 员工合同续签待办
* @return
*/
@Operation(summary = "给自动化用的-合同待续签-分页查询", description = "合同待续签-分页查询")
@GetMapping("/getAutoPage" )
public R<IPage<TEmpContractAlert>> getAutoPage(Page page, ContractAlertSearchVo searchVo) {
setAuth(searchVo);
return R.ok(tEmpContractAlertService.getAutoPage(page, searchVo));
}
@Operation(description = "合同待续签数量查询")
@PostMapping("/getAutoContractCount")
public R<Long> getAutoContractCount(@RequestBody ContractAlertSearchVo searchVo) {
setAuth(searchVo);
return R.ok(tEmpContractAlertService.getAutoContractCount(searchVo));
}
/** /**
* 不分页查询 * 不分页查询
* @param searchVo 员工合同续签待办 * @param searchVo 员工合同续签待办
......
...@@ -46,6 +46,9 @@ public interface TAutoMainRelMapper extends BaseMapper<TAutoMainRel> { ...@@ -46,6 +46,9 @@ public interface TAutoMainRelMapper extends BaseMapper<TAutoMainRel> {
// 获取全量自动化项目与商险续保周期 // 获取全量自动化项目与商险续保周期
List<TAutoMainRel> getAutoDeptMap(); List<TAutoMainRel> getAutoDeptMap();
// 获取所有自动化的项目编号
List<String> getAutoDeptNo();
Long noPageCountDiy(@Param("tAutoMainRel")TAutoMainRelSearchVo tAutoMainRel); Long noPageCountDiy(@Param("tAutoMainRel")TAutoMainRelSearchVo tAutoMainRel);
List<TAutoMainRelExportVo> noPageDiy(@Param("tAutoMainRel")TAutoMainRelSearchVo tAutoMainRel); List<TAutoMainRelExportVo> noPageDiy(@Param("tAutoMainRel")TAutoMainRelSearchVo tAutoMainRel);
......
...@@ -41,6 +41,10 @@ import java.util.List; ...@@ -41,6 +41,10 @@ import java.util.List;
public interface TEmpContractAlertService extends IService<TEmpContractAlert> { public interface TEmpContractAlertService extends IService<TEmpContractAlert> {
IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo); IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo);
// 给自动化用的-合同待续签-分页查询
IPage<TEmpContractAlert> getAutoPage(Page page, ContractAlertSearchVo searchVo);
// 合同待续签数量查询
long getAutoContractCount(ContractAlertSearchVo searchVo);
List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo); List<TEmpContractAlert> listDiy(ContractAlertSearchVo searchVo);
......
...@@ -35,6 +35,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -35,6 +35,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -67,6 +69,8 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -67,6 +69,8 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private static final String FASC_NO_EMP_CONTRACT = "未找到自动生成的员工合同"; private static final String FASC_NO_EMP_CONTRACT = "未找到自动生成的员工合同";
private static final String FASC_NO_TEMPLATE = "未找到新法大大模板"; private static final String FASC_NO_TEMPLATE = "未找到新法大大模板";
private static final Logger logger = LoggerFactory.getLogger(FascService.class);
@Override @Override
public R<String> getTemplate(String templateName) throws ApiException { public R<String> getTemplate(String templateName) throws ApiException {
...@@ -82,14 +86,43 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -82,14 +86,43 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// templateName 签署任务模板名称 // templateName 签署任务模板名称
List<TFascTemplate> tList = new ArrayList<>(); List<TFascTemplate> tList = new ArrayList<>();
List<SignTemplateListInfo> listSubList; List<SignTemplateListInfo> listSubList;
List<TFascTemplate> tempList = new ArrayList<>(); List<TFascTemplate> tempList;
List<TFascTemplateDetail> detailList = new ArrayList<>(); List<TFascTemplateDetail> detailList = new ArrayList<>();
List<TFascTemplateDetail> detailSubList; List<TFascTemplateDetail> detailSubList;
// 重试次数
int maxRetries = 3;
boolean success;
Exception lastException;
// 20秒后重试、40秒后重试、60秒后重试
long millis = 20000;
for (TFascCompany company : companyList) { for (TFascCompany company : companyList) {
listSubList = fascUtil.getTemplateList(templateName, tFascPushLogService, company); listSubList = fascUtil.getTemplateList(templateName, tFascPushLogService, company);
if (listSubList != null && !listSubList.isEmpty()) { if (listSubList != null && !listSubList.isEmpty()) {
detailSubList = new ArrayList<>(); detailSubList = new ArrayList<>();
fascUtil.getTemplateDetailList(listSubList, tempList, detailSubList, tFascPushLogService, company); tempList = new ArrayList<>();
success = false;
lastException = null;
for (int attempt = 0; attempt < maxRetries && !success; attempt++) {
try {
fascUtil.getTemplateDetailList(listSubList, tempList, detailSubList, tFascPushLogService, company);
success = true;
} catch (Exception e) {
lastException = e;
if (attempt < maxRetries - 1) { // Don't wait after the last attempt
try {
Thread.sleep(millis * (attempt + 1)); // Wait 10 seconds
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
}
}
if (!success) {
logger.error("法大大获取模板详情,重试 " + maxRetries + " 次依然失败", lastException);
continue;
}
if (!tempList.isEmpty() && !detailSubList.isEmpty()) { if (!tempList.isEmpty() && !detailSubList.isEmpty()) {
tList.addAll(tempList); tList.addAll(tempList);
detailList.addAll(detailSubList); detailList.addAll(detailSubList);
...@@ -108,7 +141,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -108,7 +141,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
List<TFascTemplate> updateMain = new ArrayList<>(); List<TFascTemplate> updateMain = new ArrayList<>();
List<TFascTemplateDetail> updateDetail = new ArrayList<>(); List<TFascTemplateDetail> updateDetail = new ArrayList<>();
// TODO - 这里后期要分每个公司去拉取
List<TFascTemplate> allMain = tFascTemplateService.getTFascTemplateListAll(null); List<TFascTemplate> allMain = tFascTemplateService.getTFascTemplateListAll(null);
// TODO - 这里后期要分每个公司去拉取
List<TFascTemplateDetail> allDetail = tFascTemplateDetailService.getTFascTemplateDetailList(null); List<TFascTemplateDetail> allDetail = tFascTemplateDetailService.getTFascTemplateDetailList(null);
List<TFascEditLog> logList = new ArrayList<>(); List<TFascEditLog> logList = new ArrayList<>();
if (allMain == null || allMain.isEmpty()) { if (allMain == null || allMain.isEmpty()) {
...@@ -305,7 +340,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -305,7 +340,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
} }
private TFascCompany getTFascCompany(TEmployeeContractPre contract) { private TFascCompany getTFascCompany(TEmployeeContractPre contract) {
TFascCompany company = null; TFascCompany company = null;
if (Common.isNotNull(contract.getFadadaTemplateId())) { if (Common.isNotNull(contract.getFadadaTemplateId())) {
TFascTemplate tFascTemplate = tFascTemplateService.getOne(Wrappers.<TFascTemplate>query() TFascTemplate tFascTemplate = tFascTemplateService.getOne(Wrappers.<TFascTemplate>query()
.lambda().eq(TFascTemplate::getSignTemplateId, contract.getFadadaTemplateId()) .lambda().eq(TFascTemplate::getSignTemplateId, contract.getFadadaTemplateId())
...@@ -342,6 +377,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -342,6 +377,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return fascUtil.urgeTask(contract, tFascPushLogService, tEmployeeContractPreMapper, company); return fascUtil.urgeTask(contract, tFascPushLogService, tEmployeeContractPreMapper, company);
} }
/** /**
* @param id TEmployeeContractPre主键 * @param id TEmployeeContractPre主键
* @Description: 获取附件 * @Description: 获取附件
......
...@@ -88,6 +88,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -88,6 +88,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private final FeedBackDetailService feedBackDetailService; private final FeedBackDetailService feedBackDetailService;
private final TSettleDomainMapper settleDomainMapper; private final TSettleDomainMapper settleDomainMapper;
private final TAutoMainRelMapper tAutoMainRelMapper;
@Autowired @Autowired
private UpmsDaprUtils upmsDaprUtils; private UpmsDaprUtils upmsDaprUtils;
...@@ -98,6 +99,49 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM ...@@ -98,6 +99,49 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
@Autowired @Autowired
private WxConfig wxConfig; private WxConfig wxConfig;
@Override
public IPage<TEmpContractAlert> getAutoPage(Page page, ContractAlertSearchVo searchVo) {
List<String> deptList = tAutoMainRelMapper.getAutoDeptNo();
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
wrapper.isNotNull(TEmpContractAlert::getId);
if (deptList != null && !deptList.isEmpty()) {
wrapper.in(TEmpContractAlert::getProjectNo, deptList);
}
if (Common.isNotNull(searchVo.getContractEndStart())){
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart());
}
if (Common.isNotNull(searchVo.getContractEndEnd())){
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd());
}
if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql() + " order by CREATE_TIME desc");
} else {
wrapper.orderByDesc(BaseEntity::getCreateTime);
}
return baseMapper.selectPage(page,wrapper);
}
@Override
public long getAutoContractCount(ContractAlertSearchVo searchVo) {
List<String> deptList = tAutoMainRelMapper.getAutoDeptNo();
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
wrapper.isNotNull(TEmpContractAlert::getId);
if (deptList != null && !deptList.isEmpty()) {
wrapper.in(TEmpContractAlert::getProjectNo, deptList);
}
if (Common.isNotNull(searchVo.getContractEndStart())){
wrapper.ge(TEmpContractAlert::getContractEnd,searchVo.getContractEndStart());
}
if (Common.isNotNull(searchVo.getContractEndEnd())){
wrapper.le(TEmpContractAlert::getContractEnd,searchVo.getContractEndEnd());
}
if (Common.isNotNull(searchVo.getAuthSql())) {
wrapper.last(searchVo.getAuthSql());
}
return baseMapper.selectCount(wrapper);
}
@Override @Override
public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) { public IPage<TEmpContractAlert> pageDiy(Page page, ContractAlertSearchVo searchVo) {
LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TEmpContractAlert> wrapper = buildQueryWrapper(searchVo);
......
...@@ -129,6 +129,13 @@ ...@@ -129,6 +129,13 @@
left join t_settle_domain b on d.DEPT_ID = b.id left join t_settle_domain b on d.DEPT_ID = b.id
</select> </select>
<!-- 获取全量自动化项目编码 -->
<select id="getAutoDeptNo" resultType="java.lang.String">
SELECT
d.DEPT_NO
FROM t_auto_main_rel d
</select>
<select id="noPageCountDiy" resultType="java.lang.Long"> <select id="noPageCountDiy" resultType="java.lang.Long">
SELECT SELECT
......
/*
* 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.csp.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
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;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Data
@TableName("employee_registration_leave")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "自动化离职待办")
public class EmployeeRegistrationLeave extends BaseEntity {
/**
* 主键ID
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键ID")
@Schema(description = "主键ID")
private String id;
/**
* 离职处理状态:0待确认1待处理2处理中3已处理
*/
@ExcelAttribute(name = "离职处理状态:0待确认1待处理2处理中3已处理", maxLength = 1)
@Length(max = 1, message = "离职处理状态:0待确认1待处理2处理中3已处理不能超过1个字符")
@ExcelProperty("离职处理状态:0待确认1待处理2处理中3已处理")
@Schema(description = "离职处理状态:0待确认1待处理2处理中3已处理")
private String leaveStatus;
/**
* 执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理
*/
@ExcelAttribute(name = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理", maxLength = 1)
@Length(max = 1, message = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理不能超过1个字符")
@ExcelProperty("执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
@Schema(description = "执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理")
private String doStatus;
/**
* 执行详情
*/
@ExcelAttribute(name = "执行详情", maxLength = 100)
@Length(max = 100, message = "执行详情不能超过100个字符")
@ExcelProperty("执行详情")
@Schema(description = "执行详情")
private String doDetail;
/**
* 原因
*/
@ExcelAttribute(name = "原因", maxLength = 100)
@Length(max = 100, message = "原因不能超过100个字符")
@ExcelProperty("原因")
@Schema(description = "原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
*/
@ExcelAttribute(name = "合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过", maxLength = 2)
@Length(max = 2, message = "合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过不能超过2个字符")
@ExcelProperty("合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过")
@Schema(description = "合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过")
private String doStatusContract;
/**
* 社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过
*/
@ExcelAttribute(name = "社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过", maxLength = 2)
@Length(max = 2, message = "社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过不能超过2个字符")
@ExcelProperty("社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过")
@Schema(description = "社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过")
private String doStatusSocial;
/**
* 公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过
*/
@ExcelAttribute(name = "公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过", maxLength = 2)
@Length(max = 2, message = "公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过不能超过2个字符")
@ExcelProperty("公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过")
@Schema(description = "公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过")
private String doStatusFund;
/**
* 商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回
*/
@ExcelAttribute(name = "商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回", maxLength = 2)
@Length(max = 2, message = "商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回不能超过2个字符")
@ExcelProperty("商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回")
@Schema(description = "商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回")
private String doStatusInsurance;
/**
* 减项:0空1无需处理2待减项8减项成功9减项失败
*/
@ExcelAttribute(name = "减项:0空1无需处理2待减项8减项成功9减项失败", maxLength = 2)
@Length(max = 2, message = "减项:0空1无需处理2待减项8减项成功9减项失败不能超过2个字符")
@ExcelProperty("减项:0空1无需处理2待减项8减项成功9减项失败")
@Schema(description = "减项:0空1无需处理2待减项8减项成功9减项失败")
private String doStatusProject;
/**
* 减档:0空1无需处理2待减档8减档成功9减档失败
*/
@ExcelAttribute(name = "减档:0空1无需处理2待减档8减档成功9减档失败", maxLength = 2)
@Length(max = 2, message = "减档:0空1无需处理2待减档8减档成功9减档失败不能超过2个字符")
@ExcelProperty("减档:0空1无需处理2待减档8减档成功9减档失败")
@Schema(description = "减档:0空1无需处理2待减档8减档成功9减档失败")
private String doStatusEmp;
/**
* 需处理项:1社保2公积金3商险4合同5项目档案6人员档案
*/
@ExcelAttribute(name = "需处理项:1社保2公积金3商险4合同5项目档案6人员档案", maxLength = 2)
@Length(max = 2, message = "需处理项:1社保2公积金3商险4合同5项目档案6人员档案不能超过2个字符")
@ExcelProperty("需处理项:1社保2公积金3商险4合同5项目档案6人员档案")
@Schema(description = "需处理项:1社保2公积金3商险4合同5项目档案6人员档案")
private String doType;
/**
* 社保Id
*/
@ExcelAttribute(name = "社保Id", maxLength = 36)
@Length(max = 36, message = "社保Id不能超过36个字符")
@ExcelProperty("社保Id")
@Schema(description = "社保Id")
private String socialId;
/**
* 停缴社保日期
*/
@ExcelAttribute(name = "停缴社保日期", maxLength = 10)
@Length(max = 10, message = "停缴社保日期不能超过10个字符")
@ExcelProperty("停缴社保日期")
@Schema(description = "停缴社保日期")
private String socialReduceDate;
/**
* 减少原因(社保)
*/
@ExcelAttribute(name = "减少原因(社保)", maxLength = 50)
@Length(max = 50, message = "减少原因(社保)不能超过50个字符")
@ExcelProperty("减少原因(社保)")
@Schema(description = "减少原因(社保)")
private String socialReasonType;
/**
* 社保派减备注
*/
@ExcelAttribute(name = "社保派减备注", maxLength = 50)
@Length(max = 50, message = "社保派减备注不能超过50个字符")
@ExcelProperty("社保派减备注")
@Schema(description = "社保派减备注")
private String socialTrustRemark;
/**
* 社保派减时间
*/
@ExcelAttribute(name = "社保派减时间", isDate = true)
@ExcelProperty("社保派减时间")
@Schema(description = "社保派减时间")
private LocalDateTime socialExpectedTime;
/**
* 公积金Id
*/
@ExcelAttribute(name = "公积金Id", maxLength = 36)
@Length(max = 36, message = "公积金Id不能超过36个字符")
@ExcelProperty("公积金Id")
@Schema(description = "公积金Id")
private String fundId;
/**
* 停缴公积金日期
*/
@ExcelAttribute(name = "停缴公积金日期", maxLength = 10)
@Length(max = 10, message = "停缴公积金日期不能超过10个字符")
@ExcelProperty("停缴公积金日期")
@Schema(description = "停缴公积金日期")
private String fundReduceDate;
/**
* 减少原因(公积金)
*/
@ExcelAttribute(name = "减少原因(公积金)", maxLength = 50)
@Length(max = 50, message = "减少原因(公积金)不能超过50个字符")
@ExcelProperty("减少原因(公积金)")
@Schema(description = "减少原因(公积金)")
private String fundReasonType;
/**
* 公积金派减备注
*/
@ExcelAttribute(name = "公积金派减备注", maxLength = 50)
@Length(max = 50, message = "公积金派减备注不能超过50个字符")
@ExcelProperty("公积金派减备注")
@Schema(description = "公积金派减备注")
private String fundTrustRemark;
/**
* 公积金派减时间
*/
@ExcelAttribute(name = "公积金派减时间", isDate = true)
@ExcelProperty("公积金派减时间")
@Schema(description = "公积金派减时间")
private LocalDateTime fundExpectedTime;
/**
* 商险ID
*/
@ExcelAttribute(name = "商险ID", maxLength = 36)
@Length(max = 36, message = "商险ID不能超过36个字符")
@ExcelProperty("商险ID")
@Schema(description = "商险ID")
private String insuranceId;
/**
* 预计商险退保派单时间
*/
@ExcelAttribute(name = "预计商险退保派单时间", isDate = true)
@ExcelProperty("预计商险退保派单时间")
@Schema(description = "预计商险退保派单时间")
private LocalDateTime insuranceExpectedTime;
/**
* 商险停保日期
*/
@ExcelAttribute(name = "商险停保日期", isDate = true)
@ExcelProperty("商险停保日期")
@Schema(description = "商险停保日期")
private LocalDateTime insuranceExpectedTimeNext;
/**
* 合同ID
*/
@ExcelAttribute(name = "合同ID", maxLength = 36)
@Length(max = 36, message = "合同ID不能超过36个字符")
@ExcelProperty("合同ID")
@Schema(description = "合同ID")
private String contractId;
/**
* 合同终止发起时间
*/
@ExcelAttribute(name = "合同终止发起时间", isDate = true)
@ExcelProperty("合同终止发起时间")
@Schema(description = "合同终止发起时间")
private LocalDateTime contractExpectedTime;
/**
* 档案ID
*/
@ExcelAttribute(name = "档案ID", maxLength = 36)
@Length(max = 36, message = "档案ID不能超过36个字符")
@ExcelProperty("档案ID")
@Schema(description = "档案ID")
private String empId;
/**
* 项目档案ID
*/
@ExcelAttribute(name = "项目档案ID", maxLength = 36)
@Length(max = 36, message = "项目档案ID不能超过36个字符")
@ExcelProperty("项目档案ID")
@Schema(description = "项目档案ID")
private String empProjectId;
@Schema(description = "确认人")
private String confirmUser;
@Schema(description = "确认时间")
private LocalDateTime confirmTime;
// 联动端口:固定值:人员离职
@Schema(description = "联动端口")
private String linkPort;
@Schema(description = "是否多项目0否1是")
private String isMultipleDept;
}
/*
* 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.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 自动化离职待办-导出
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Data
public class EmployeeRegistrationLeaveConfirmExportVo {
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("员工姓名")
private String employeeName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("离职日期")
private String joinLeaveDate;
@ExcelProperty("确认人")
private String confirmUser;
@ExcelProperty("确认时间")
private String confirmTime;
// 联动端口:固定值:人员离职
@ExcelProperty("联动端口")
private String linkPort;
@ExcelProperty("离职处理状态")
private String leaveStatus;
/**
* 执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理
*/
@ExcelProperty("执行结果")
private String doStatus;
@ExcelProperty("执行详情")
private String doDetail;
@ExcelProperty("原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
*/
@ExcelProperty("合同终止")
private String doStatusContract;
/**
* 社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过
*/
@ExcelProperty("社保减员")
private String doStatusSocial;
/**
* 公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过
*/
@ExcelProperty("公积金减员")
private String doStatusFund;
/**
* 商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回
*/
@ExcelProperty("商险退保")
private String doStatusInsurance;
/**
* 减项:0空1无需处理2待减项8减项成功9减项失败
*/
@ExcelProperty("减项")
private String doStatusProject;
/**
* 减档:0空1无需处理2待减档8减档成功9减档失败
*/
@ExcelProperty("减档")
private String doStatusEmp;
}
/*
* 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.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 自动化离职待办-导出
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Data
public class EmployeeRegistrationLeaveExportVo {
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("员工姓名")
private String employeeName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("离职日期")
private String joinLeaveDate;
@ExcelProperty("离职处理状态")
private String leaveStatus;
/**
* 执行结果0空1未执行2执行中3部分成功4全部失败5全部成功6无需处理
*/
@ExcelProperty("执行结果")
private String doStatus;
@ExcelProperty("执行详情")
private String doDetail;
@ExcelProperty("原因")
private String doRemark;
/**
* 合同终止:0空1无需处理2待发起3发起失败4待审核8审核通过10审核不通过
*/
@ExcelProperty("合同终止")
private String doStatusContract;
/**
* 社保减员:0空1无需处理2待派单3发起失败4待审核5待办理6部分办理失败8办理成功9办理失败10审核不通过
*/
@ExcelProperty("社保减员")
private String doStatusSocial;
/**
* 公积金减员:0空1无需处理2待派单3发起失败4待审核5待办理8办理成功9办理失败10审核不通过
*/
@ExcelProperty("公积金减员")
private String doStatusFund;
/**
* 商险退保:0空1无需处理2待派单3发起失败4待减员5待办理6减员中8减员成功9减员退回
*/
@ExcelProperty("商险退保")
private String doStatusInsurance;
/**
* 减项:0空1无需处理2待减项8减项成功9减项失败
*/
@ExcelProperty("减项")
private String doStatusProject;
/**
* 减档:0空1无需处理2待减档8减档成功9减档失败
*/
@ExcelProperty("减档")
private String doStatusEmp;
}
/*
* 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.csp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.csp.entity.EmployeeRegistrationLeave;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Data
public class EmployeeRegistrationLeaveSearchVo extends EmployeeRegistrationLeave {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
//开始时间(查询专用)
@Schema(description = "入离职开始时间")
@TableField(exist = false)
private LocalDateTime joinTimeStart;
//截止时间(查询专用)
@Schema(description = "入离职截止时间")
@TableField(exist = false)
private LocalDateTime joinTimeEnd;
@Schema(description = "身份证合集")
@TableField(exist = false)
private List<String> idcardList;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
@ExcelProperty("项目名称")
private String deptName;
@ExcelProperty("项目编码")
private String deptNo;
@ExcelProperty("员工姓名")
private String employeeName;
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelProperty("离职日期")
private String joinLeaveDate;
}
/*
* 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.csp.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 自动化离职待办-列表
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Data
public class EmployeeRegistrationLeaveTableVo extends EmployeeRegistrationLeaveExportVo {
@Schema(description = "主键ID")
private String id;
@Schema(description = "确认人")
private String confirmUser;
@Schema(description = "确认时间")
private String confirmTime;
// 联动端口:固定值:人员离职
@Schema(description = "联动端口")
private String linkPort;
}
/*
* 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.csp.controller;
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.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.common.log.annotation.SysLog;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/employeeregistrationleave")
@Tag(name = "自动化离职待办管理")
public class EmployeeRegistrationLeaveController {
private final EmployeeRegistrationLeaveService employeeRegistrationLeaveService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
@Operation(description = "离职待办分页查询")
@GetMapping("/getEmployeeRegistrationLeaveTablePage")
public R<IPage<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage(page, employeeRegistrationLeave));
}
/**
* 简单分页查询
*
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
@Operation(description = "离职待办分页查询2000条")
@GetMapping("/getEmployeeRegistrationLeaveTablePage2000")
public R<List<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveTablePage2000(employeeRegistrationLeave));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
@Operation(description = "离职确认分页查询")
@GetMapping("/getEmployeeRegistrationLeaveConfirmTablePage")
public R<IPage<EmployeeRegistrationLeaveTableVo>> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return new R<>(employeeRegistrationLeaveService.getEmployeeRegistrationLeaveConfirmTablePage(page, employeeRegistrationLeave));
}
/**
* 通过id查询自动化离职待办
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<EmployeeRegistrationLeave> getById(@PathVariable("id") String id) {
return R.ok(employeeRegistrationLeaveService.getById(id));
}
/**
* 自动化离职待办 批量导出
*
* @author hgw
* @date 2025-11-19 19:23:15
**/
@SysLog(value = "导出自动化离职待办")
@Operation(description = "导出自动化离职待办")
@PostMapping("/exportTable")
public void exportTable(HttpServletResponse response, @RequestBody EmployeeRegistrationLeaveSearchVo searchVo) {
employeeRegistrationLeaveService.exportTable(response, searchVo);
}
/**
* 自动化离职确认 批量导出
*
* @author hgw
* @date 2025-11-19 19:23:15
**/
@SysLog(value = "导出自动化离职确认")
@Operation(description = "导出自动化离职确认")
@PostMapping("/exportConfirmTable")
public void exportConfirmTable(HttpServletResponse response, @RequestBody EmployeeRegistrationLeaveSearchVo searchVo) {
employeeRegistrationLeaveService.exportConfirmTable(response, searchVo);
}
}
/*
* 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.csp.mapper;
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.EmployeeRegistrationLeave;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Mapper
public interface EmployeeRegistrationLeaveMapper extends BaseMapper<EmployeeRegistrationLeave> {
/**
* 自动化离职待办简单分页查询
*
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, @Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page
, @Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
List<EmployeeRegistrationLeaveExportVo> getEmployeeRegistrationLeaveTableList(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
List<EmployeeRegistrationLeaveConfirmExportVo> getEmployeeRegistrationLeaveConfirmTableList(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
int getEmployeeRegistrationLeaveTableCount(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
int getEmployeeRegistrationLeaveConfirmTableCount(
@Param("employeeRegistrationLeave") EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
}
/*
* 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.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.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveSearchVo;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
public interface EmployeeRegistrationLeaveService extends IService<EmployeeRegistrationLeave> {
/**
* 自动化离职待办简单分页查询
*
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave);
void exportTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);
void exportConfirmTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo);
}
/*
* 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.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.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.entity.EmployeeRegistrationLeave;
import com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationLeaveMapper;
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.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 lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
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;
/**
* 自动化离职待办
*
* @author hgw
* @date 2025-11-19 19:23:15
*/
@Log4j2
@Service
public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRegistrationLeaveMapper, EmployeeRegistrationLeave> implements EmployeeRegistrationLeaveService {
/**
* 自动化离职待办简单分页查询
*
* @param employeeRegistrationLeave 自动化离职待办
* @return
*/
@Override
public IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return baseMapper.getEmployeeRegistrationLeaveTablePage(page, employeeRegistrationLeave);
}
@Override
public List<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveTablePage2000(EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return baseMapper.getEmployeeRegistrationLeaveTablePage2000(employeeRegistrationLeave);
}
@Override
public IPage<EmployeeRegistrationLeaveTableVo> getEmployeeRegistrationLeaveConfirmTablePage(Page<EmployeeRegistrationLeaveTableVo> page, EmployeeRegistrationLeaveSearchVo employeeRegistrationLeave) {
return baseMapper.getEmployeeRegistrationLeaveConfirmTablePage(page, employeeRegistrationLeave);
}
/**
* 自动化离职待办批量导出
*
* @param searchVo 自动化离职待办
* @return
*/
@Override
public void exportTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo) {
String fileName = "自动化离职待处理批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationLeaveExportVo> list = new ArrayList<>();
long count = baseMapper.getEmployeeRegistrationLeaveTableCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
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();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getEmployeeRegistrationLeaveTableList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("自动化离职待处理" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("自动化离职待处理" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
@Override
public void exportConfirmTable(HttpServletResponse response, EmployeeRegistrationLeaveSearchVo searchVo) {
String fileName = "自动化离职确认批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationLeaveConfirmExportVo> list = new ArrayList<>();
long count = baseMapper.getEmployeeRegistrationLeaveConfirmTableCount(searchVo);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
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();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = baseMapper.getEmployeeRegistrationLeaveConfirmTableList(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("自动化离职确认" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
}
} else {
WriteSheet writeSheet = EasyExcelFactory.writerSheet("自动化离职确认" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ 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)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.csp.mapper.EmployeeRegistrationLeaveMapper">
<!-- 主要使用 -->
<resultMap id="tableAndExportMap" type="com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationLeaveTableVo">
<id property="id" column="id"/>
<result property="leaveStatus" column="leave_status"/>
<result property="doStatus" column="do_status"/>
<result property="doDetail" column="do_detail"/>
<result property="doRemark" column="do_remark"/>
<result property="doStatusContract" column="do_status_contract"/>
<result property="doStatusSocial" column="do_status_social"/>
<result property="doStatusFund" column="do_status_fund"/>
<result property="doStatusInsurance" column="do_status_insurance"/>
<result property="doStatusProject" column="do_status_project"/>
<result property="doStatusEmp" column="do_status_emp"/>
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="linkPort" column="link_port"/>
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="deptName" column="dept_name"/>
<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"/>
<result property="doStatus" column="do_status"/>
<result property="doDetail" column="do_detail"/>
<result property="doRemark" column="do_remark"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="doStatusContract" column="do_status_contract"/>
<result property="doStatusSocial" column="do_status_social"/>
<result property="doStatusFund" column="do_status_fund"/>
<result property="doStatusInsurance" column="do_status_insurance"/>
<result property="doStatusProject" column="do_status_project"/>
<result property="doStatusEmp" column="do_status_emp"/>
<result property="doType" column="do_type"/>
<result property="socialId" column="social_id"/>
<result property="socialReduceDate" column="social_reduce_date"/>
<result property="socialReasonType" column="social_reason_type"/>
<result property="socialTrustRemark" column="social_trust_remark"/>
<result property="socialExpectedTime" column="social_expected_time"/>
<result property="fundId" column="fund_id"/>
<result property="fundReduceDate" column="fund_reduce_date"/>
<result property="fundReasonType" column="fund_reason_type"/>
<result property="fundTrustRemark" column="fund_trust_remark"/>
<result property="fundExpectedTime" column="fund_expected_time"/>
<result property="insuranceId" column="insurance_id"/>
<result property="insuranceExpectedTime" column="insurance_expected_time"/>
<result property="insuranceExpectedTimeNext" column="insurance_expected_time_next"/>
<result property="contractId" column="contract_id"/>
<result property="contractExpectedTime" column="contract_expected_time"/>
<result property="empId" column="emp_id"/>
<result property="empProjectId" column="emp_project_id"/>
<result property="confirmUser" column="confirm_user"/>
<result property="confirmTime" column="confirm_time"/>
<result property="linkPort" column="link_port"/>
<result property="isMultipleDept" column="is_multiple_dept"/>
</resultMap>
<!-- 全量字段 -->
<sql id="Base_Column_List">
a.id,
a.leave_status,
a.do_status,
a.do_detail,
a.do_remark,
a.create_by,
a.create_name,
a.create_time,
a.update_by,
a.update_time,
a.do_status_contract,
a.do_status_social,
a.do_status_fund,
a.do_status_insurance,
a.do_status_project,
a.do_status_emp,
a.do_type,
a.social_id,
a.social_reduce_date,
a.social_reason_type,
a.social_trust_remark,
a.social_expected_time,
a.fund_id,
a.fund_reduce_date,
a.fund_reason_type,
a.fund_trust_remark,
a.fund_expected_time,
a.insurance_id,
a.insurance_expected_time,
a.insurance_expected_time_next,
a.contract_id,
a.contract_expected_time,
a.emp_id,
a.emp_project_id,
a.confirm_user,
a.confirm_time,
a.link_port,
a.is_multiple_dept
</sql>
<sql id="employeeRegistrationLeave_where">
<if test="employeeRegistrationLeave != null">
<if test="employeeRegistrationLeave.id != null and employeeRegistrationLeave.id.trim() != ''">
AND a.id = #{employeeRegistrationLeave.id}
</if>
<if test="employeeRegistrationLeave.employeeName != null and employeeRegistrationLeave.employeeName.trim() != ''">
AND b.employee_name like CONCAT('%',#{employeeRegistrationLeave.employeeName},'%')
</if>
<if test="employeeRegistrationLeave.empIdcard != null and employeeRegistrationLeave.empIdcard.trim() != ''">
AND b.emp_idcard like CONCAT('%',#{employeeRegistrationLeave.empIdcard},'%')
</if>
<if test="employeeRegistrationLeave.idcardList != null and employeeRegistrationLeave.idcardList.size() > 0 ">
AND b.emp_idcard in
<foreach item="item" index="index" collection="employeeRegistrationLeave.idcardList" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="employeeRegistrationLeave.deptName != null and employeeRegistrationLeave.deptName.trim() != ''">
AND b.dept_name like CONCAT('%',#{employeeRegistrationLeave.deptName},'%')
</if>
<if test="employeeRegistrationLeave.joinTimeStart != null">
AND b.join_leave_date <![CDATA[ >= ]]> #{employeeRegistrationLeave.joinTimeStart}
</if>
<if test="employeeRegistrationLeave.joinTimeEnd != null">
AND b.join_leave_date <![CDATA[ <= ]]> #{employeeRegistrationLeave.joinTimeEnd}
</if>
<if test="employeeRegistrationLeave.deptNo != null and employeeRegistrationLeave.deptNo.trim() != ''">
AND b.dept_no = #{employeeRegistrationLeave.deptNo}
</if>
<if test="employeeRegistrationLeave.leaveStatus != null and employeeRegistrationLeave.leaveStatus.trim() != ''">
AND a.leave_status = #{employeeRegistrationLeave.leaveStatus}
</if>
<if test="employeeRegistrationLeave.doStatus != null and employeeRegistrationLeave.doStatus.trim() != ''">
AND a.do_status = #{employeeRegistrationLeave.doStatus}
</if>
<if test="employeeRegistrationLeave.doDetail != null and employeeRegistrationLeave.doDetail.trim() != ''">
AND a.do_detail = #{employeeRegistrationLeave.doDetail}
</if>
<if test="employeeRegistrationLeave.doRemark != null and employeeRegistrationLeave.doRemark.trim() != ''">
AND a.do_remark = #{employeeRegistrationLeave.doRemark}
</if>
<if test="employeeRegistrationLeave.createBy != null and employeeRegistrationLeave.createBy.trim() != ''">
AND a.create_by = #{employeeRegistrationLeave.createBy}
</if>
<if test="employeeRegistrationLeave.createName != null and employeeRegistrationLeave.createName.trim() != ''">
AND a.create_name = #{employeeRegistrationLeave.createName}
</if>
<if test="employeeRegistrationLeave.createTime != null">
AND a.create_time = #{employeeRegistrationLeave.createTime}
</if>
<if test="employeeRegistrationLeave.updateBy != null and employeeRegistrationLeave.updateBy.trim() != ''">
AND a.update_by = #{employeeRegistrationLeave.updateBy}
</if>
<if test="employeeRegistrationLeave.updateTime != null">
AND a.update_time = #{employeeRegistrationLeave.updateTime}
</if>
<if test="employeeRegistrationLeave.doStatusContract != null and employeeRegistrationLeave.doStatusContract.trim() != ''">
AND a.do_status_contract = #{employeeRegistrationLeave.doStatusContract}
</if>
<if test="employeeRegistrationLeave.doStatusSocial != null and employeeRegistrationLeave.doStatusSocial.trim() != ''">
AND a.do_status_social = #{employeeRegistrationLeave.doStatusSocial}
</if>
<if test="employeeRegistrationLeave.doStatusFund != null and employeeRegistrationLeave.doStatusFund.trim() != ''">
AND a.do_status_fund = #{employeeRegistrationLeave.doStatusFund}
</if>
<if test="employeeRegistrationLeave.doStatusInsurance != null and employeeRegistrationLeave.doStatusInsurance.trim() != ''">
AND a.do_status_insurance = #{employeeRegistrationLeave.doStatusInsurance}
</if>
<if test="employeeRegistrationLeave.doStatusProject != null and employeeRegistrationLeave.doStatusProject.trim() != ''">
AND a.do_status_project = #{employeeRegistrationLeave.doStatusProject}
</if>
<if test="employeeRegistrationLeave.doStatusEmp != null and employeeRegistrationLeave.doStatusEmp.trim() != ''">
AND a.do_status_emp = #{employeeRegistrationLeave.doStatusEmp}
</if>
<if test="employeeRegistrationLeave.doType != null and employeeRegistrationLeave.doType.trim() != ''">
AND a.do_type = #{employeeRegistrationLeave.doType}
</if>
<if test="employeeRegistrationLeave.socialId != null and employeeRegistrationLeave.socialId.trim() != ''">
AND a.social_id = #{employeeRegistrationLeave.socialId}
</if>
<if test="employeeRegistrationLeave.socialReduceDate != null and employeeRegistrationLeave.socialReduceDate.trim() != ''">
AND a.social_reduce_date = #{employeeRegistrationLeave.socialReduceDate}
</if>
<if test="employeeRegistrationLeave.socialReasonType != null and employeeRegistrationLeave.socialReasonType.trim() != ''">
AND a.social_reason_type = #{employeeRegistrationLeave.socialReasonType}
</if>
<if test="employeeRegistrationLeave.socialTrustRemark != null and employeeRegistrationLeave.socialTrustRemark.trim() != ''">
AND a.social_trust_remark = #{employeeRegistrationLeave.socialTrustRemark}
</if>
<if test="employeeRegistrationLeave.socialExpectedTime != null">
AND a.social_expected_time = #{employeeRegistrationLeave.socialExpectedTime}
</if>
<if test="employeeRegistrationLeave.fundId != null and employeeRegistrationLeave.fundId.trim() != ''">
AND a.fund_id = #{employeeRegistrationLeave.fundId}
</if>
<if test="employeeRegistrationLeave.fundReduceDate != null and employeeRegistrationLeave.fundReduceDate.trim() != ''">
AND a.fund_reduce_date = #{employeeRegistrationLeave.fundReduceDate}
</if>
<if test="employeeRegistrationLeave.fundReasonType != null and employeeRegistrationLeave.fundReasonType.trim() != ''">
AND a.fund_reason_type = #{employeeRegistrationLeave.fundReasonType}
</if>
<if test="employeeRegistrationLeave.fundTrustRemark != null and employeeRegistrationLeave.fundTrustRemark.trim() != ''">
AND a.fund_trust_remark = #{employeeRegistrationLeave.fundTrustRemark}
</if>
<if test="employeeRegistrationLeave.fundExpectedTime != null">
AND a.fund_expected_time = #{employeeRegistrationLeave.fundExpectedTime}
</if>
<if test="employeeRegistrationLeave.insuranceId != null and employeeRegistrationLeave.insuranceId.trim() != ''">
AND a.insurance_id = #{employeeRegistrationLeave.insuranceId}
</if>
<if test="employeeRegistrationLeave.insuranceExpectedTime != null">
AND a.insurance_expected_time = #{employeeRegistrationLeave.insuranceExpectedTime}
</if>
<if test="employeeRegistrationLeave.insuranceExpectedTimeNext != null">
AND a.insurance_expected_time_next = #{employeeRegistrationLeave.insuranceExpectedTimeNext}
</if>
<if test="employeeRegistrationLeave.contractId != null and employeeRegistrationLeave.contractId.trim() != ''">
AND a.contract_id = #{employeeRegistrationLeave.contractId}
</if>
<if test="employeeRegistrationLeave.contractExpectedTime != null">
AND a.contract_expected_time = #{employeeRegistrationLeave.contractExpectedTime}
</if>
<if test="employeeRegistrationLeave.empId != null and employeeRegistrationLeave.empId.trim() != ''">
AND a.emp_id = #{employeeRegistrationLeave.empId}
</if>
<if test="employeeRegistrationLeave.empProjectId != null and employeeRegistrationLeave.empProjectId.trim() != ''">
AND a.emp_project_id = #{employeeRegistrationLeave.empProjectId}
</if>
</if>
</sql>
<!-- 离职待办列表 -->
<sql id="Base_Table_List">
a.id,
<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,
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 '发起失败'
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,
b.employee_name,
b.emp_idcard,
DATE_FORMAT(b.join_leave_date,'%Y-%m-%d') join_leave_date,
b.dept_name,
b.dept_no
</sql>
<!-- 离职确认列表 -->
<sql id="Base_Confirm_Table_List">
a.id,
<include refid="Base_Confirm_Export_List"></include>
</sql>
<sql id="Base_Confirm_Export_List">
a.confirm_user,
DATE_FORMAT(a.confirm_time,'%Y-%m-%d %H:%i:%s') confirm_time,
a.link_port,
<include refid="Base_Export_List"></include>
</sql>
<!-- 离职待办列表-->
<select id="getEmployeeRegistrationLeaveTablePage" resultMap="tableAndExportMap">
SELECT
<include refid="Base_Table_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
ORDER BY b.create_time asc,b.id asc
</select>
<!-- 离职待办列表2000条-->
<select id="getEmployeeRegistrationLeaveTablePage2000" resultMap="tableAndExportMap">
SELECT
<include refid="Base_Table_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
ORDER BY b.create_time asc,b.id asc
limit 2000
</select>
<!--离职确认列表-->
<select id="getEmployeeRegistrationLeaveConfirmTablePage" resultMap="tableAndExportMap">
SELECT
<include refid="Base_Confirm_Table_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
ORDER BY b.create_time asc,b.id asc
</select>
<!-- 离职待办导出-->
<select id="getEmployeeRegistrationLeaveTableList" resultMap="tableAndExportMap">
SELECT
<include refid="Base_Export_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
ORDER BY b.create_time asc,b.id asc
<if test="employeeRegistrationLeave != null">
<if test="employeeRegistrationLeave.limitStart != null">
limit #{employeeRegistrationLeave.limitStart},#{employeeRegistrationLeave.limitEnd}
</if>
</if>
</select>
<!--离职确认导出-->
<select id="getEmployeeRegistrationLeaveConfirmTableList" resultMap="tableAndExportMap">
SELECT
<include refid="Base_Confirm_Export_List"/>
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
ORDER BY b.create_time asc,b.id asc
<if test="employeeRegistrationLeave != null">
<if test="employeeRegistrationLeave.limitStart != null">
limit #{employeeRegistrationLeave.limitStart},#{employeeRegistrationLeave.limitEnd}
</if>
</if>
</select>
<!-- 离职待办导出条数-->
<select id="getEmployeeRegistrationLeaveTableCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
</select>
<!--离职确认导出条数-->
<select id="getEmployeeRegistrationLeaveConfirmTableCount" resultType="java.lang.Integer">
SELECT
count(1)
FROM employee_registration_leave a
left join employee_registration b on a.id=b.id
<where>
1=1
<include refid="employeeRegistrationLeave_where"/>
</where>
</select>
</mapper>
...@@ -1349,5 +1349,5 @@ public class InsurancesConstants { ...@@ -1349,5 +1349,5 @@ public class InsurancesConstants {
public static final String INSURANCE_AUTO_FLAG_IS_ENABLE = "该项目已纳入自动化,请至作业自动化模块入职登记-接收确认后自动派单"; public static final String INSURANCE_AUTO_FLAG_IS_ENABLE = "该项目已纳入自动化,请至作业自动化模块入职登记-接收确认后自动派单";
// 0待确认1待派单 可忽略 // 0待确认1待派单 可忽略
public static final Set<String> ALERT_IGNORE_STATUS = new HashSet<>(Arrays.asList("0", "1")); public static final Set<String> ALERT_IGNORE_STATUS = new HashSet<>(Arrays.asList("0", "1", "2", "5"));
} }
...@@ -208,6 +208,14 @@ public class TInsurancePreRenewDetail extends BaseEntity { ...@@ -208,6 +208,14 @@ public class TInsurancePreRenewDetail extends BaseEntity {
@ExcelProperty("险种名称") @ExcelProperty("险种名称")
@Schema(description = "险种名称") @Schema(description = "险种名称")
private String insuranceTypeName; private String insuranceTypeName;
/**
* 险种Id
*/
@ExcelAttribute(name = "险种Id", maxLength = 50)
@Length(max = 50, message = "险种Id不能超过50个字符")
@ExcelProperty("险种Id")
@Schema(description = "险种Id")
private String insuranceTypeId;
/** /**
* 原购买标准 * 原购买标准
*/ */
......
...@@ -20,6 +20,12 @@ import java.util.List; ...@@ -20,6 +20,12 @@ import java.util.List;
public class InsuredParam extends BaseEntity implements Serializable { public class InsuredParam extends BaseEntity implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
/**
* 员工姓名或身份证(移动端搜索专用——这个接口:replacePageToAutoSelect)
*/
@Schema(description = "员工姓名或身份证")
private String empNameOrCard;
/** /**
* 员工姓名 * 员工姓名
*/ */
......
...@@ -18,10 +18,12 @@ ...@@ -18,10 +18,12 @@
package com.yifu.cloud.plus.v1.yifu.insurances.controller; package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetailQwDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreRenewDetailQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreRenewDetailQwDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreRenewDetailQwDetailService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
...@@ -29,6 +31,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; ...@@ -29,6 +31,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -66,4 +69,16 @@ public class TInsurancePreRenewDetailQwDetailController { ...@@ -66,4 +69,16 @@ public class TInsurancePreRenewDetailQwDetailController {
} }
return new R<>(tInsurancePreRenewDetailQwDetailService.getTInsurancePreRenewDetailQwDetailPage(page, tInsurancePreRenewDetailQwDetail)); return new R<>(tInsurancePreRenewDetailQwDetailService.getTInsurancePreRenewDetailQwDetailPage(page, tInsurancePreRenewDetailQwDetail));
} }
@Operation(description = "获取1条详情")
@GetMapping("/getQwDetailByMainId")
public R<TInsurancePreRenewDetailQwDetail> getQwDetailByMainId(@RequestParam(required = false) String mainId) {
if (Common.isEmpty(mainId)) {
return R.failed("请传参MainId");
}
TInsurancePreRenewDetailQwDetail pre = tInsurancePreRenewDetailQwDetailService.getOne(Wrappers.<TInsurancePreRenewDetailQwDetail>query().lambda()
.eq(TInsurancePreRenewDetailQwDetail::getMainId, mainId)
.last(CommonConstants.LAST_ONE_SQL));
return new R<>(pre);
}
} }
...@@ -16,6 +16,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -16,6 +16,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard; import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain; import com.yifu.cloud.plus.v1.yifu.archives.entity.TSettleDomain;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -30,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties; ...@@ -30,6 +32,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*; 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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants; import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants; import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.*; import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.*; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.*;
...@@ -53,9 +56,11 @@ import org.apache.commons.lang.ArrayUtils; ...@@ -53,9 +56,11 @@ import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -144,6 +149,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -144,6 +149,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Resource @Resource
private TInsuranceWarnMapper tInsuranceWarnMapper; private TInsuranceWarnMapper tInsuranceWarnMapper;
@Resource
private TInsurancePreRenewDetailQwService tInsurancePreRenewDetailQwService;
@Resource
private TInsurancePreRenewDetailQwDetailService tInsurancePreRenewDetailQwDetailService;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
@Autowired
private WxConfig wxConfig;
/***********************商险办理********************************/ /***********************商险办理********************************/
/** /**
* 每日定时刷新商险到期数据 * 每日定时刷新商险到期数据
...@@ -1161,7 +1178,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1161,7 +1178,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
detailList.add(detail); detailList.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING); updateEmployeeInsurancePreById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING, false);
} }
} }
} }
...@@ -1327,7 +1344,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1327,7 +1344,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
detailList.add(detail); detailList.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING); updateEmployeeInsurancePreById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("3").collect(Collectors.toList()),CommonConstants.FOUR_STRING, false);
} }
} }
} }
...@@ -1629,7 +1646,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1629,7 +1646,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
}); });
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING); updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING);
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING); updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING, true);
} }
//更新状态 //更新状态
this.updateBatchById(successList); this.updateBatchById(successList);
...@@ -1758,7 +1775,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1758,7 +1775,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT)); detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
successOne.add(detail); successOne.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//查找被替换人信息 //查找被替换人信息
one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
...@@ -1816,7 +1833,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1816,7 +1833,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setDefaultSettleId(settle.getId()); detail.setDefaultSettleId(settle.getId());
successTwo.add(detail); successTwo.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//生成收入数据 //生成收入数据
createInsuranceInfo(detail,settleDomain); createInsuranceInfo(detail,settleDomain);
}else { }else {
...@@ -1854,7 +1871,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1854,7 +1871,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setDefaultSettleId(settle.getId()); detail.setDefaultSettleId(settle.getId());
successTwo.add(detail); successTwo.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//生成收入数据 //生成收入数据
createInsuranceInfo(detail,settleDomain); createInsuranceInfo(detail,settleDomain);
} }
...@@ -1875,7 +1892,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1875,7 +1892,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
successOne.add(detail); successOne.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
} }
} }
} }
...@@ -8211,9 +8228,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8211,9 +8228,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successNum++; successNum++;
} }
} }
baseMapper.batchexpireIgnore(successList,remark); if (!successList.isEmpty()) {
//更新商险到期提醒表 baseMapper.batchexpireIgnore(successList, remark);
baseMapper.batchexpireAlertIgnore(successList,remark); //更新商险到期提醒表
baseMapper.batchexpireAlertIgnore(successList, remark);
}
if (successNum == ids.size()) { if (successNum == ids.size()) {
return R.ok(); return R.ok();
} else { } else {
...@@ -8796,7 +8815,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8796,7 +8815,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
// hgw-3商险待续签-商险各个入口更新待购买列表状态更新 // hgw-3商险待续签-商险各个入口更新待购买列表状态更新
private void updateEmployeeInsurancePreRenewById(TInsuranceDetail insuranceDetail,List<String> preStatusList,String status) { // handleFailToSendQwFlag - 办理失败发送企微
private void updateEmployeeInsurancePreRenewById(TInsuranceDetail insuranceDetail, List<String> preStatusList
, String status, boolean handleFailToSendQwFlag) {
TInsurancePreRenewDetail pre = tInsurancePreRenewDetailMapper.selectOne(Wrappers.<TInsurancePreRenewDetail>query().lambda() TInsurancePreRenewDetail pre = tInsurancePreRenewDetailMapper.selectOne(Wrappers.<TInsurancePreRenewDetail>query().lambda()
.eq(TInsurancePreRenewDetail::getInsurancesIdNew,insuranceDetail.getId()) .eq(TInsurancePreRenewDetail::getInsurancesIdNew,insuranceDetail.getId())
.in(TInsurancePreRenewDetail::getProcessStatus,preStatusList) .in(TInsurancePreRenewDetail::getProcessStatus,preStatusList)
...@@ -8804,6 +8825,103 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8804,6 +8825,103 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (Common.isNotNull(pre)) { if (Common.isNotNull(pre)) {
pre.setProcessStatus(status); pre.setProcessStatus(status);
tInsurancePreRenewDetailMapper.updateById(pre); tInsurancePreRenewDetailMapper.updateById(pre);
if (handleFailToSendQwFlag) {
handleFailToSendQw(pre.getCustomerUserLoginname(), pre.getCustomerUsername(), pre.getId(), pre.getEmpName()
, pre.getEmpIdcardNo(), insuranceDetail.getBackRemark());
}
}
}
/**
* @Description: 自动化续签的商险办理失败,发送企微
* @Author: hgw
* @Date: 2025/11/19 18:02
* @return: void
**/
private void handleFailToSendQw(String customerUserLoginname, String customerUsername, String preRenewId, String empName
, String empIdCard, String errorrMessage) {
TInsurancePreRenewDetailQw qw = new TInsurancePreRenewDetailQw();
String qwUuId = String.valueOf(UUID.randomUUID()).replace("-", "");
qw.setId(qwUuId);
qw.setCreateTime(LocalDateTime.now());
qw.setCustomerUserLoginname(customerUserLoginname);
qw.setCustomerUsername(customerUsername);
qw.setDescription("张三-" + empIdCard + ",商险续保办理失败 <br>请及时处理,以免产生用工风险!");
// 派单失败,组装需要推送企微的明细
TInsurancePreRenewDetailQwDetail qwDetail = new TInsurancePreRenewDetailQwDetail();
qwDetail.setPreId(preRenewId);
qwDetail.setMainId(qwUuId);
qwDetail.setEmpName(empName);
qwDetail.setEmpIdcard(empIdCard);
qwDetail.setErrorInfo(errorrMessage);
qwDetail.setErrorTime(LocalDateTime.now());
tInsurancePreRenewDetailQwService.save(qw);
tInsurancePreRenewDetailQwDetailService.save(qwDetail);
if (Common.isNotNull(customerUserLoginname)) {
Map<String, String> sysUserMap = getUserQiWeiInfo(customerUserLoginname);
String qwInfo;
if (!sysUserMap.isEmpty()) {
qwInfo = sysUserMap.get(customerUserLoginname);
if (Common.isNotNull(qwInfo)) {
sendMessageToWx(qwInfo, qw.getDescription(), qw.getId());
}
}
}
}
/**
* @param userLoginNames 登录名,逗号拼接
* @Description: 获取客服的企微信息
* @Author: hgw
* @Date: 2025/8/8 17:59
* @return: java.util.Map<java.lang.String, java.lang.String>
**/
private Map<String, String> getUserQiWeiInfo(String userLoginNames) {
Map<String, String> sysUserMap = new HashMap<>();
// 获取项目对应的前端客服用户信息--客服账号需要正常
if (Common.isNotKong(userLoginNames)) {
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(userLoginNames);
List<SysUser> users = null;
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())) {
users = res.getData().getUserList();
}
if (Common.isNotKong(users)) {
for (SysUser user : users) {
if (Common.isNotNull(user.getWxMessage())) {
sysUserMap.put(user.getUsername(), user.getWxMessage());
}
}
}
}
return sysUserMap;
}
//发送企业微信待办
private void sendMessageToWx(String useruserWx, String content, String mainId) {
if (Common.isEmpty(useruserWx) || Common.isEmpty(content)) {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(useruserWx)) {
sendUser = new StringBuilder(useruserWx);
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
textcard.put("title", "【作业自动化——商险续保办理失败提醒】");
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "77" + mainId));
textcard.put("description", content);
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
} }
} }
} }
...@@ -391,7 +391,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -391,7 +391,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
errorMessageMap.put(info.getInsurancePreRenewId(), info.getErrorMessage()); errorMessageMap.put(info.getInsurancePreRenewId(), info.getErrorMessage());
} }
Map<String, Set<String>> deptNumMap = new HashMap<>();
Map<String, Integer> allNumMap = new HashMap<>(); Map<String, Integer> allNumMap = new HashMap<>();
Map<String, Integer> failNumMap = new HashMap<>(); Map<String, Integer> failNumMap = new HashMap<>();
Map<String, TInsurancePreRenewDetailQw> preQwMap = new HashMap<>(); Map<String, TInsurancePreRenewDetailQw> preQwMap = new HashMap<>();
...@@ -400,7 +399,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -400,7 +399,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
TInsurancePreRenewDetail updatePre; TInsurancePreRenewDetail updatePre;
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String errorrMessage; String errorrMessage;
Set<String> tempSet;
Integer nums; Integer nums;
String customerUserLoginname; String customerUserLoginname;
...@@ -411,14 +409,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -411,14 +409,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
for (TInsurancePreRenewDetail pre : insurancePreList) { for (TInsurancePreRenewDetail pre : insurancePreList) {
customerUserLoginname = pre.getCustomerUserLoginname(); customerUserLoginname = pre.getCustomerUserLoginname();
if (Common.isNotNull(customerUserLoginname)) {
tempSet = deptNumMap.get(customerUserLoginname);
if (tempSet == null) {
tempSet = new HashSet<>();
}
tempSet.add(pre.getDeptNo());
deptNumMap.put(customerUserLoginname, tempSet);
}
updatePre = new TInsurancePreRenewDetail(); updatePre = new TInsurancePreRenewDetail();
updatePre.setId(pre.getId()); updatePre.setId(pre.getId());
String qwUuId; String qwUuId;
...@@ -483,7 +473,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -483,7 +473,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
// pushQiWeiFlag 推送企微的flag,true表示推送企微 // pushQiWeiFlag 推送企微的flag,true表示推送企微
if (pushQiWeiFlag && !preQwMap.isEmpty()) { if (pushQiWeiFlag && !preQwMap.isEmpty()) {
List<TInsurancePreRenewDetailQw> qwList = new ArrayList<>(); List<TInsurancePreRenewDetailQw> qwList = new ArrayList<>();
int deptNum;
int allNum; int allNum;
int failNum; int failNum;
StringBuilder description; StringBuilder description;
...@@ -496,12 +485,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -496,12 +485,6 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
userLoginNames = customerUserLoginname; userLoginNames = customerUserLoginname;
} }
qw = entry.getValue(); qw = entry.getValue();
tempSet = deptNumMap.get(customerUserLoginname);
if (Common.isNotNull(tempSet)) {
deptNum = tempSet.size();
} else {
deptNum = 0;
}
allNum = allNumMap.get(customerUserLoginname); allNum = allNumMap.get(customerUserLoginname);
if (Common.isEmpty(allNum)) { if (Common.isEmpty(allNum)) {
allNum = 0; allNum = 0;
...@@ -510,8 +493,8 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -510,8 +493,8 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
if (Common.isEmpty(failNum)) { if (Common.isEmpty(failNum)) {
failNum = 0; failNum = 0;
} }
description = new StringBuilder("项目数:").append(deptNum).append("个;自动化派单人数:") description = new StringBuilder("商险派单数:").append(allNum).append("份,【失败份数:").append(failNum)
.append(allNum).append("个,【失败人数:").append(failNum).append("个】<br>请及时至HRO系统处理,以免人员漏保!"); .append("份】<br>点击查看详情!<br>请及时至HRO系统处理,以免耽误购买进度!");
qw.setDescription(description.toString()); qw.setDescription(description.toString());
qwList.add(qw); qwList.add(qw);
} }
...@@ -649,7 +632,7 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP ...@@ -649,7 +632,7 @@ public class TInsurancePreRenewDetailServiceImpl extends ServiceImpl<TInsuranceP
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
textcard.put("title", "【商险自动化派单——失败提醒】"); textcard.put("title", "【作业自动化——商险续保发起失败提醒】");
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "76" + mainId)); textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "76" + mainId));
textcard.put("description", content); textcard.put("description", content);
requestMap.put("touser", sendUser); requestMap.put("touser", sendUser);
......
...@@ -2139,6 +2139,12 @@ ...@@ -2139,6 +2139,12 @@
a.INSURANCE_CITY_NAME as insuranceCityName a.INSURANCE_CITY_NAME as insuranceCityName
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = 3 and IS_USE = 0 and IS_EFFECT = 0 and IS_OVERDUE = 0 where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = 3 and IS_USE = 0 and IS_EFFECT = 0 and IS_OVERDUE = 0
<if test="param.empNameOrCard != null and param.empNameOrCard.trim() != ''">
and (
a.EMP_NAME like concat('%',replace(replace(#{param.empNameOrCard},'_','\_'),'%','\%'),'%')
or a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empNameOrCard},'_','\_'),'%','\%'),'%')
)
</if>
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%') and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if> </if>
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<result property="configName" column="CONFIG_NAME"/> <result property="configName" column="CONFIG_NAME"/>
<result property="insuranceCompanyName" column="INSURANCE_COMPANY_NAME"/> <result property="insuranceCompanyName" column="INSURANCE_COMPANY_NAME"/>
<result property="insuranceTypeName" column="INSURANCE_TYPE_NAME"/> <result property="insuranceTypeName" column="INSURANCE_TYPE_NAME"/>
<result property="insuranceTypeId" column="INSURANCE_TYPE_ID"/>
<result property="buyStandardOld" column="BUY_STANDARD_OLD"/> <result property="buyStandardOld" column="BUY_STANDARD_OLD"/>
<result property="buyStandard" column="BUY_STANDARD"/> <result property="buyStandard" column="BUY_STANDARD"/>
<result property="insuranceProvinceName" column="INSURANCE_PROVINCE_NAME"/> <result property="insuranceProvinceName" column="INSURANCE_PROVINCE_NAME"/>
...@@ -95,6 +96,7 @@ ...@@ -95,6 +96,7 @@
a.CONFIG_NAME, a.CONFIG_NAME,
a.INSURANCE_COMPANY_NAME, a.INSURANCE_COMPANY_NAME,
a.INSURANCE_TYPE_NAME, a.INSURANCE_TYPE_NAME,
a.INSURANCE_TYPE_ID,
a.BUY_STANDARD_OLD, a.BUY_STANDARD_OLD,
a.BUY_STANDARD, a.BUY_STANDARD,
a.INSURANCE_PROVINCE_NAME, a.INSURANCE_PROVINCE_NAME,
......
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