Commit 3b7549aa authored by hongguangwu's avatar hongguangwu

1.7.23-确认接收留存历史数据并清空上一份入职数据

parent 14da156a
This diff is collapsed.
---
name: "code-style-guide"
description: "检查代码是否符合Yifu项目开发规范,包括命名规范、代码格式、注解使用、异常处理等。Invoke when user wants to verify code compliance or needs guidance on coding standards."
---
# Yifu 代码规范检查器
## 功能说明
本Skill用于检查代码是否符合Yifu项目的开发规范,帮助开发者在编码过程中保持代码风格的一致性。
## 检查范围
### 1. 命名规范
- 类名:采用大驼峰命名(PascalCase)
- 方法名:采用小驼峰命名(camelCase)
- 变量名:采用小驼峰命名(camelCase)
- 常量名:全大写+下划线(UPPER_CASE)
- 文件名:与类名保持一致
### 2. 代码格式
- 缩进:4个空格
- 换行:每行不超过120字符
- 空行:方法之间空1行,逻辑块之间空1行
- 大括号:左大括号不换行,右大括号单独占一行
### 3. 注解顺序(从上到下)
1. Spring组件注解(@RestController, @Service等)
2. Lombok注解(@RequiredArgsConstructor, @Log4j2等)
3. 请求映射注解(@RequestMapping)
4. Swagger注解(@Tag, @Operation等)
### 4. 依赖注入
- 优先使用构造器注入(@RequiredArgsConstructor)
- 禁止使用字段注入(@Autowired在字段上)
### 5. 异常处理
- 使用统一响应封装 `R<T>`
- 异常必须记录日志
- 禁止使用 `System.out.println`
### 6. 日志规范
- 使用 `@Log4j2` 注解
- 日志级别:INFO用于业务操作,ERROR用于异常
### 7. REST API规范
- HTTP方法:GET(查询)、POST(新增)、PUT(更新)、DELETE(删除)
- 路径命名:小写字母+连字符,如 `/employeeregistration/page`
- 响应格式:统一使用 `R<T>` 封装
## 使用方式
```java
// 示例:符合规范的Controller类
@RestController
@RequiredArgsConstructor
@RequestMapping("/employeeregistration")
@Tag(name = "入离职登记表管理")
public class EmployeeRegistrationController {
private final EmployeeRegistrationService employeeRegistrationService;
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<EmployeeRegistration>> getEmployeeRegistrationPage(
Page<EmployeeRegistration> page,
EmployeeRegistrationSearchVo searchVo) {
return new R<>(employeeRegistrationService.getEmployeeRegistrationPage(page, searchVo));
}
}
```
## 检查清单
| 检查项 | 检查内容 |
|-------|---------|
| 命名规范 | 类名、方法名、变量名是否符合规范 |
| 代码格式 | 缩进、换行、空行是否符合规范 |
| 注解使用 | 注解顺序、权限注解是否正确 |
| 异常处理 | 是否有日志记录、异常是否正确处理 |
| 依赖注入 | 是否使用构造器注入 |
| 响应格式 | 是否统一使用 `R<T>` 封装 |
| 日志记录 | 是否使用 `@Log4j2`、日志级别是否合适 |
## 代码生成器集成
本规范已集成到项目的代码生成器模板中,使用代码生成功能时会自动生成符合规范的代码。
## 静态检查
项目已集成 `spring-javaformat-maven-plugin`,执行以下命令进行代码格式化检查:
```bash
# 检查代码格式
mvn spring-javaformat:check
# 自动格式化代码
mvn spring-javaformat:apply
```
## 参考文档
- [Yifu项目架构说明](https://wiki.example.com/yifu/architecture)
- [MyBatis Plus官方文档](https://baomidou.com/)
- [Spring Boot官方文档](https://docs.spring.io/spring-boot/docs/current/reference/html/)
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
@Data
@TableName("employee_registration_pre_old_history")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "入职待建档历史表")
public class EmployeeRegistrationPreOldHistory extends EmployeeRegistrationPre {
@Schema(description = "归档时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime historyTime;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 合同待签订任务记录表
*
* @author huych
* @date 2025-06-11 14:15:53
*/
@Data
@TableName("t_employee_contract_pre_old_history")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "合同待签订任务归档表")
public class TEmployeeContractPreOldHistory extends TEmployeeContractPre {
@Schema(description = "归档时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
private LocalDateTime historyTime;
}
......@@ -224,4 +224,15 @@ public class EmployeeRegistrationPreController {
return employeeRegistrationPreService.getGzEmployeeInfo(vo);
}
/**
* @Description: 归档入职确认信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
**/
@Inner
@PostMapping("/inner/archiveByRegisterId")
public Boolean archiveByCardAndDeptNo(@RequestBody BaseSearchVO paramVo) {
return employeeRegistrationPreService.archiveByRegisterId(paramVo.getRegisterId());
}
}
......@@ -353,4 +353,16 @@ public class TEmployeeContractPreController {
public Boolean judgeHaveProcessingContracnt(@RequestBody BaseSearchVO paramVo) {
return tEmployeeContractPreService.judgeHaveProcessingContracnt(paramVo);
}
/**
* @Description: 归档入职确认信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
**/
@Inner
@PostMapping("/inner/archiveContractByRegisterId")
public Boolean archiveContractByRegisterId(@RequestBody BaseSearchVO paramVo) {
return tEmployeeContractPreService.archiveContractByRegisterId(paramVo.getRegisterId());
}
}
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPreOldHistory;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface EmployeeRegistrationPreHistoryMapper extends BaseMapper<EmployeeRegistrationPreOldHistory> {
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreOldHistory;
import org.apache.ibatis.annotations.Mapper;
/**
* 合同待签订任务归档表
*
* @author hgw
* @date 2026-05-13 14:15:53
*/
@Mapper
public interface TEmployeeContractPreOldHistoryMapper extends BaseMapper<TEmployeeContractPreOldHistory> {
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPreOldHistory;
public interface EmployeeRegistrationPreHistoryService extends IService<EmployeeRegistrationPreOldHistory> {
}
\ No newline at end of file
......@@ -124,4 +124,12 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
**/
EmployeeRegistrationPre getEmployeeRegistrationPreById(String id);
/**
* @Description: 归档入职确认信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @return: java.lang.Boolean
**/
Boolean archiveByRegisterId(String registerId);
}
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreOldHistory;
/**
* 合同待签订任务归档表
*
* @author hgw
* @date 2026-05-13 14:15:53
*/
public interface TEmployeeContractPreOldHistoryService extends IService<TEmployeeContractPreOldHistory> {
}
......@@ -100,7 +100,7 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
/**
* 合同待签订一键催办
* @param idList id集合
* @param id id集合
* @return
*/
R contractUrg(String id);
......@@ -108,4 +108,7 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
R<TEmployeeContractPre> getInfoByRegistId(String registId);
boolean judgeHaveProcessingContracnt(BaseSearchVO paramVo);
// 归档合同
boolean archiveContractByRegisterId(String registerId);
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPreOldHistory;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.EmployeeRegistrationPreHistoryMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.EmployeeRegistrationPreHistoryService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
@Log4j2
@Service
public class EmployeeRegistrationPreHistoryServiceImpl extends ServiceImpl<EmployeeRegistrationPreHistoryMapper, EmployeeRegistrationPreOldHistory> implements EmployeeRegistrationPreHistoryService {
}
\ No newline at end of file
......@@ -31,8 +31,6 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.*;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.OnProcessInsurancesVo;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -114,6 +112,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Autowired
SysConfigMapper sysConfigMapper;
private final EmployeeRegistrationPreHistoryService employeeRegistrationPreHistoryService;
/**
* 入职待建档表简单分页查询
* @param employeeRegistrationPre 入职待建档表
......@@ -1909,4 +1909,19 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
return pre;
}
@Override
public Boolean archiveByRegisterId(String registerId) {
if (Common.isNotNull(registerId)) {
EmployeeRegistrationPre registration = this.getById(registerId);
if (registration != null && Common.isNotNull(registration.getId())) {
EmployeeRegistrationPreOldHistory history = new EmployeeRegistrationPreOldHistory();
BeanUtils.copyProperties(registration, history);
history.setHistoryTime(LocalDateTime.now());
employeeRegistrationPreHistoryService.saveOrUpdate(history);
baseMapper.deleteById(registerId);
}
}
return true;
}
}
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreOldHistory;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreOldHistoryMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeContractPreOldHistoryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 合同待签订任务归档表
*
* @author hgw
* @date 2026-05-13 14:15:53
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TEmployeeContractPreOldHistoryServiceImpl extends ServiceImpl<TEmployeeContractPreOldHistoryMapper, TEmployeeContractPreOldHistory> implements TEmployeeContractPreOldHistoryService {
}
......@@ -26,6 +26,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.social.vo.TEmployeeInsuranceWorkDayVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -57,6 +58,9 @@ import java.util.stream.Stream;
public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContractPreMapper, TEmployeeContractPre> implements TEmployeeContractPreService {
private final TEmployeeContractPreHistoryMapper tEmployeeContractPreHistoryMapper;
private final TEmployeeContractPreOldHistoryService tEmployeeContractPreOldHistoryService;
private final TSettleDomainService tSettleDomainService;
private final TEmployeeContractAuditService tEmployeeContractAuditService;
......@@ -1285,4 +1289,26 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
return false;
}
}
@Override
public boolean archiveContractByRegisterId(String registerId) {
if (Common.isNotNull(registerId)) {
List<TEmployeeContractPre> contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, registerId));
if (contractPreList != null && !contractPreList.isEmpty()) {
TEmployeeContractPreOldHistory history;
for (TEmployeeContractPre pre : contractPreList) {
if (pre != null && Common.isNotNull(pre.getId())) {
history = new TEmployeeContractPreOldHistory();
BeanUtils.copyProperties(pre, history);
history.setHistoryTime(LocalDateTime.now());
tEmployeeContractPreOldHistoryService.saveOrUpdate(history);
baseMapper.deleteById(pre.getId());
}
}
}
}
return true;
}
}
......@@ -848,4 +848,52 @@ public class ArchivesDaprUtil {
}
return res;
}
/**
* @Description: 归档入职确认信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职ID
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveRegisterPreInfo(String registerId){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
"/employeeregistrationpre/inner/archiveByRegisterId",
paramVo,
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("归档入职确认信息失败!");
}
return res;
}
/**
* @Description: 归档合同待签订信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveContractPreInfo(String registerId){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
"/temployeecontractpre/inner/archiveContractByRegisterId",
paramVo,
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("归档合同待签订信息失败!");
}
return res;
}
}
......@@ -264,4 +264,28 @@ public class InsuranceDaprUtil {
return res;
}
/**
* @Description: 归档商险待购买信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveInsurancePreInfo(String registerId){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprInsurancesProperties.getAppUrl(),
daprInsurancesProperties.getAppId(),
"/temployeeinsurancepre/inner/archiveInsuranceByRegisterId",
paramVo,
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("归档商险待购买信息失败!");
}
return res;
}
}
......@@ -502,4 +502,28 @@ public class SocialDaprUtils {
}
return res;
}
/**
* @Description: 归档社保/公积金待派单信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveSocialFundPreInfo(String registerId) {
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprProperties.getAppUrl(),
daprProperties.getAppId(),
"/tdispatchinfopre/inner/archiveSocialFundPreInfo",
paramVo,
Boolean.class,
SecurityConstants.FROM_IN
);
if (Common.isEmpty(res)){
return R.failed("归档社保/公积金待派单信息失败!");
}
return res;
}
}
......@@ -50,6 +50,9 @@ public interface EmployeeRegistrationMapper extends BaseMapper<EmployeeRegistrat
List<EmployeeRegistration> selectRegistrationListBySure(@Param("idList") List<String> idList);
// emp_idcard里存的是key,身份证加项目编码
List<EmployeeRegistration> getHistoryId(@Param("cardDeptList") List<String> cardDeptList, @Param("curIdList") List<String> curIdList);
// 查询是否有处理中的离职信息,如果有,不允许再次登记入离职
int getEmployeeRegistrationLeavingCount(@Param("idCard") String idCard, @Param("deptNo") String deptNo);
......
......@@ -898,6 +898,23 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null);
try {
List<String> cardDeptList = new ArrayList<>();
List<String> curIdList = new ArrayList<>();
String cardDeptKey = registration.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + registration.getDeptNo();
cardDeptList.add(cardDeptKey);
curIdList.add(registration.getId());
// 上一次入职信息,用于存储历史数据
Map<String, String> historyIdMap = new HashMap<>();
getHistoryIdMap(cardDeptList, curIdList, historyIdMap);
String historyId = historyIdMap.get(cardDeptKey);
if (Common.isNotNull(historyId)) {
// 历史数据归档
archivesDaprUtil.archiveRegisterPreInfo(historyId);
archivesDaprUtil.archiveContractPreInfo(historyId);
insuranceDaprUtil.archiveInsurancePreInfo(historyId);
socialDaprUtils.archiveSocialFundPreInfo(historyId);
}
//生成档案待建档数据
initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo);
......@@ -1515,7 +1532,22 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
TEmployeeAutoRegistCheckVo exitCheckVo;
R<SysBaseSetInfoVo> resR;
SysBaseSetInfoVo setInfo;
// 查找历史的入职,如果有,存历史的入职确认信息等
List<String> cardDeptList = new ArrayList<>();
List<String> curIdList = new ArrayList<>();
for (EmployeeRegistration registration:registrationList) {
cardDeptList.add(registration.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + registration.getDeptNo());
curIdList.add(registration.getId());
}
// 上一次入职信息,用于存储历史数据
Map<String, String> historyIdMap = new HashMap<>();
getHistoryIdMap(cardDeptList, curIdList, historyIdMap);
String cardDeptKey;
String historyId;
for (EmployeeRegistration registration:registrationList) {
cardDeptKey = registration.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + registration.getDeptNo();
exitCheckVo = new TEmployeeAutoRegistCheckVo();
exitCheckVo.setEmployeeName(registration.getEmployeeName());
exitCheckVo.setEmpIdcard(registration.getEmpIdcard());
......@@ -1708,6 +1740,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
user.getNickname(), null);
try {
historyId = historyIdMap.get(cardDeptKey);
if (Common.isNotNull(historyId)) {
// 历史数据归档
archivesDaprUtil.archiveRegisterPreInfo(historyId);
archivesDaprUtil.archiveContractPreInfo(historyId);
insuranceDaprUtil.archiveInsurancePreInfo(historyId);
socialDaprUtils.archiveSocialFundPreInfo(historyId);
}
//生成档案待建档数据
initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
R<String> domainR = archivesDaprUtil.saveRegistPreInfo(preVo);
......@@ -1761,6 +1801,17 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
return R.ok();
}
// 获取上一次的入职id,用于存储历史
private void getHistoryIdMap(List<String> cardDeptList, List<String> curIdList, Map<String, String> historyIdMap) {
List<EmployeeRegistration> historyIdList = baseMapper.getHistoryId(cardDeptList, curIdList);
if (historyIdList != null && !historyIdList.isEmpty()) {
// emp_idcard里存的是key,身份证加项目编码
for (EmployeeRegistration er : historyIdList) {
historyIdMap.put(er.getEmpIdcard(), er.getId());
}
}
}
@Override
public R registAdd(EmployeeRegistration registration) {
//提交校验内容:
......
......@@ -428,6 +428,23 @@
</select>
<!-- 取上一次入职的1条 -->
<select id="getHistoryId" resultMap="employeeRegistrationMap">
SELECT
concat(a.emp_idcard,'_',a.dept_no) emp_idcard,SUBSTRING_INDEX(GROUP_CONCAT(a.id ORDER BY a.CREATE_TIME desc),',',1) as id
FROM employee_registration a
where a.feedback_type = '1' and concat(a.emp_idcard,'_',a.dept_no) in
<foreach item="cardStr" index="index" collection="cardDeptList" open="(" separator="," close=")">
#{cardStr}
</foreach>
AND a.id not in
<foreach item="idStr" index="index" collection="curIdList" open="(" separator="," close=")">
#{idStr}
</foreach>
group by a.emp_idcard,a.dept_no
</select>
<!--查询是否有处理中的离职信息,如果有,不允许再次登记入离职-->
<select id="getEmployeeRegistrationLeavingCount" resultType="java.lang.Integer">
SELECT
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 商险待购买历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Data
@TableName("t_employee_insurance_pre_old_history")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商险待购买历史表")
public class TEmployeeInsurancePreOldHistory extends TEmployeeInsurancePre {
@Schema(description = "归档时间")
private LocalDateTime historyTime;
}
......@@ -404,4 +404,15 @@ public class TEmployeeInsurancePreController {
return tEmployeeInsurancePreService.judgeHaveProcessingInsurance(paramVo);
}
/**
* @Description: 归档商险待购买信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
**/
@Inner
@PostMapping("/inner/archiveInsuranceByRegisterId")
public Boolean archiveInsuranceByRegisterId(@RequestBody BaseSearchVO paramVo) {
return tEmployeeInsurancePreService.archiveInsuranceByRegisterId(paramVo.getRegisterId());
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreOldHistory;
import org.apache.ibatis.annotations.Mapper;
/**
* 商险待购买历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Mapper
public interface TEmployeeInsurancePreOldHistoryMapper extends BaseMapper<TEmployeeInsurancePreOldHistory> {
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreOldHistory;
/**
* 商险待购买历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
public interface TEmployeeInsurancePreOldHistoryService extends IService<TEmployeeInsurancePreOldHistory> {
}
......@@ -142,4 +142,13 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
boolean judgeHaveProcessingInsurance(BaseSearchVO paramVo);
/**
* @Description: 归档商险待购买信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @return: java.lang.Boolean
**/
Boolean archiveInsuranceByRegisterId(String registerId);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreOldHistory;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreOldHistoryMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreOldHistoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/**
* 商险待购买历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Service
@RequiredArgsConstructor
public class TEmployeeInsurancePreOldHistoryServiceImpl extends ServiceImpl<TEmployeeInsurancePreOldHistoryMapper, TEmployeeInsurancePreOldHistory> implements TEmployeeInsurancePreOldHistoryService {
}
......@@ -89,6 +89,9 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired
private TInsurancePreRenewDetailService tInsurancePreRenewDetailService;
@Autowired
private TEmployeeInsurancePreOldHistoryService tEmployeeInsurancePreOldHistoryService;
/**
* 商险待办任务表简单分页查询
*
......@@ -1121,4 +1124,22 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return false;
}
}
@Override
public Boolean archiveInsuranceByRegisterId(String registerId) {
if (Common.isNotNull(registerId)) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, registerId));
if (insurancePreList != null && !insurancePreList.isEmpty()) {
for (TEmployeeInsurancePre pre : insurancePreList) {
TEmployeeInsurancePreOldHistory history = new TEmployeeInsurancePreOldHistory();
BeanUtils.copyProperties(pre, history);
history.setHistoryTime(LocalDateTime.now());
tEmployeeInsurancePreOldHistoryService.saveOrUpdate(history);
baseMapper.deleteById(pre.getId());
}
}
}
return true;
}
}
package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
/**
* 社保/公积金待派单历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Data
@TableName("t_dispatch_info_pre_old_history")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "社保/公积金待派单历史表")
public class TDispatchInfoPreOldHistory extends TDispatchInfoPre {
@Schema(description = "归档时间")
private LocalDateTime historyTime;
}
......@@ -536,4 +536,15 @@ public class TDispatchInfoPreController {
return tDispatchInfoPreService.judgeHaveProcessingSocialOrFund(paramVo);
}
/**
* @Description: 归档社保/公积金待派单信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
**/
@Inner
@PostMapping("/inner/archiveSocialFundPreInfo")
public Boolean archiveSocialFundPreInfo(@RequestBody BaseSearchVO paramVo) {
return tDispatchInfoPreService.archiveSocialFundPreInfo(paramVo.getRegisterId());
}
}
package com.yifu.cloud.plus.v1.yifu.social.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPreOldHistory;
import org.apache.ibatis.annotations.Mapper;
/**
* 社保/公积金待派单历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Mapper
public interface TDispatchInfoPreOldHistoryMapper extends BaseMapper<TDispatchInfoPreOldHistory> {
}
package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPreOldHistory;
/**
* 社保/公积金待派单历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
public interface TDispatchInfoPreOldHistoryService extends IService<TDispatchInfoPreOldHistory> {
}
......@@ -117,4 +117,14 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
Boolean updateLeaveFundPreInfo(String id);
boolean judgeHaveProcessingSocialOrFund(BaseSearchVO paramVo);
/**
* @Description: 归档社保/公积金待派单信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @return: java.lang.Boolean
**/
Boolean archiveSocialFundPreInfo(String registerId);
}
package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPreOldHistory;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TDispatchInfoPreOldHistoryMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoPreOldHistoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/**
* 社保/公积金待派单历史表
*
* @Author: hgw-trae
* @Date: 2026/5/12
*/
@Service
@RequiredArgsConstructor
public class TDispatchInfoPreOldHistoryServiceImpl extends ServiceImpl<TDispatchInfoPreOldHistoryMapper, TDispatchInfoPreOldHistory> implements TDispatchInfoPreOldHistoryService {
}
......@@ -23,6 +23,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPreOldHistory;
import com.yifu.cloud.plus.v1.yifu.social.entity.TFundPreDetail;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAutoLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialPreDetail;
......@@ -81,6 +82,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
@Autowired
private final THouseHoldLimitService houseHoldLimitService;
@Autowired
private TDispatchInfoPreOldHistoryService tDispatchInfoPreOldHistoryService;
/**
* 社保待购买表简单分页查询
* @param tDispatchInfoPre 社保待购买表
......@@ -1140,4 +1144,23 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
}
@Override
public Boolean archiveSocialFundPreInfo(String registerId) {
if (Common.isNotNull(registerId)) {
List<TDispatchInfoPre> dispatchInfoPreList = baseMapper.selectList(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getRegisterId, registerId));
if (dispatchInfoPreList != null && !dispatchInfoPreList.isEmpty()) {
TDispatchInfoPreOldHistory history;
for (TDispatchInfoPre pre : dispatchInfoPreList) {
history = new TDispatchInfoPreOldHistory();
BeanUtils.copyProperties(pre, history);
history.setHistoryTime(LocalDateTime.now());
tDispatchInfoPreOldHistoryService.saveOrUpdate(history);
baseMapper.deleteById(pre.getId());
}
}
}
return true;
}
}
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