Commit 9e4c90c8 authored by hongguangwu's avatar hongguangwu

1.7.23-优化

parent 4f0e0713
......@@ -232,7 +232,7 @@ public class EmployeeRegistrationPreController {
@Inner
@PostMapping("/inner/archiveByRegisterId")
public Boolean archiveByCardAndDeptNo(@RequestBody BaseSearchVO paramVo) {
return employeeRegistrationPreService.archiveByRegisterId(paramVo.getRegisterId());
return employeeRegistrationPreService.archiveByRegisterId(paramVo);
}
}
......@@ -363,6 +363,6 @@ public class TEmployeeContractPreController {
@Inner
@PostMapping("/inner/archiveContractByRegisterId")
public Boolean archiveContractByRegisterId(@RequestBody BaseSearchVO paramVo) {
return tEmployeeContractPreService.archiveContractByRegisterId(paramVo.getRegisterId());
return tEmployeeContractPreService.archiveContractByRegisterId(paramVo);
}
}
......@@ -130,6 +130,6 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
* @Date: 2026/5/12
* @return: java.lang.Boolean
**/
Boolean archiveByRegisterId(String registerId);
Boolean archiveByRegisterId(BaseSearchVO paramVo);
}
......@@ -110,5 +110,5 @@ public interface TEmployeeContractPreService extends IService<TEmployeeContractP
boolean judgeHaveProcessingContracnt(BaseSearchVO paramVo);
// 归档合同
boolean archiveContractByRegisterId(String registerId);
boolean archiveContractByRegisterId(BaseSearchVO paramVo);
}
......@@ -1910,15 +1910,23 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
@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);
public Boolean archiveByRegisterId(BaseSearchVO paramVo) {
if (Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
List<EmployeeRegistrationPre> registrationPreList = baseMapper.selectList(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard, paramVo.getEmpIdCard())
.eq(EmployeeRegistrationPre::getDeptNo, paramVo.getDeptNo())
);
if (registrationPreList != null && !registrationPreList.isEmpty()) {
EmployeeRegistrationPreOldHistory history;
for (EmployeeRegistrationPre pre : registrationPreList) {
if (pre != null && Common.isNotNull(pre.getId())) {
history = new EmployeeRegistrationPreOldHistory();
BeanUtils.copyProperties(pre, history);
history.setHistoryTime(LocalDateTime.now());
employeeRegistrationPreHistoryService.saveOrUpdate(history);
baseMapper.deleteById(pre.getId());
}
}
}
}
return true;
......
......@@ -1396,10 +1396,12 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
}
@Override
public boolean archiveContractByRegisterId(String registerId) {
if (Common.isNotNull(registerId)) {
public boolean archiveContractByRegisterId(BaseSearchVO paramVo) {
if (Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
List<TEmployeeContractPre> contractPreList = baseMapper.selectList(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, registerId));
.eq(TEmployeeContractPre::getEmpIdcard, paramVo.getEmpIdCard())
.eq(TEmployeeContractPre::getDeptNo, paramVo.getDeptNo())
);
if (contractPreList != null && !contractPreList.isEmpty()) {
TEmployeeContractPreOldHistory history;
for (TEmployeeContractPre pre : contractPreList) {
......
......@@ -857,12 +857,14 @@ public class ArchivesDaprUtil {
* @Description: 归档入职确认信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职ID
* @param empIdCard 身份证
* @param deptNo 项目编码
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveRegisterPreInfo(String registerId){
public R<Boolean> archiveRegisterPreInfo(String empIdCard, String deptNo){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
paramVo.setEmpIdCard(empIdCard);
paramVo.setDeptNo(deptNo);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
......@@ -881,12 +883,14 @@ public class ArchivesDaprUtil {
* @Description: 归档合同待签订信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @param empIdCard 身份证
* @param deptNo 项目编码
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveContractPreInfo(String registerId){
public R<Boolean> archiveContractPreInfo(String empIdCard, String deptNo){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
paramVo.setEmpIdCard(empIdCard);
paramVo.setDeptNo(deptNo);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprArchivesProperties.getAppUrl(),
daprArchivesProperties.getAppId(),
......
......@@ -268,12 +268,14 @@ public class InsuranceDaprUtil {
* @Description: 归档商险待购买信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @param empIdCard 身份证
* @param deptNo 项目编码
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveInsurancePreInfo(String registerId){
public R<Boolean> archiveInsurancePreInfo(String empIdCard, String deptNo){
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
paramVo.setEmpIdCard(empIdCard);
paramVo.setDeptNo(deptNo);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprInsurancesProperties.getAppUrl(),
daprInsurancesProperties.getAppId(),
......
......@@ -507,12 +507,14 @@ public class SocialDaprUtils {
* @Description: 归档社保/公积金待派单信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @param empIdCard 身份证
* @param deptNo 项目编码
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
public R<Boolean> archiveSocialFundPreInfo(String registerId) {
public R<Boolean> archiveSocialFundPreInfo(String empIdCard, String deptNo) {
BaseSearchVO paramVo = new BaseSearchVO();
paramVo.setRegisterId(registerId);
paramVo.setEmpIdCard(empIdCard);
paramVo.setDeptNo(deptNo);
R<Boolean> res = HttpDaprUtil.invokeMethodPost(
daprProperties.getAppUrl(),
daprProperties.getAppId(),
......
......@@ -50,9 +50,6 @@ 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);
......
......@@ -910,21 +910,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
preVo.setReceiveType(CommonConstants.ZERO_STRING); // 0-单个接收
}
}
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)) {
if (Common.isNotNull(registration.getEmpIdcard()) && Common.isNotNull(registration.getDeptNo())) {
// 历史数据归档
archivesDaprUtil.archiveRegisterPreInfo(historyId);
archivesDaprUtil.archiveContractPreInfo(historyId);
insuranceDaprUtil.archiveInsurancePreInfo(historyId);
socialDaprUtils.archiveSocialFundPreInfo(historyId);
archivesDaprUtil.archiveRegisterPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
archivesDaprUtil.archiveContractPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
insuranceDaprUtil.archiveInsurancePreInfo(registration.getEmpIdcard(), registration.getDeptNo());
socialDaprUtils.archiveSocialFundPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
}
//生成档案待建档数据
......@@ -1543,24 +1535,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
R<TEmployeeInsuranceWorkDayVo> dataR;
R<Boolean> flag;
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());
......@@ -1763,13 +1739,12 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
preVo.setReceiveType(CommonConstants.ONE_STRING); // 1-批量接收
}
historyId = historyIdMap.get(cardDeptKey);
if (Common.isNotNull(historyId)) {
if (Common.isNotNull(registration.getEmpIdcard()) && Common.isNotNull(registration.getDeptNo())) {
// 历史数据归档
archivesDaprUtil.archiveRegisterPreInfo(historyId);
archivesDaprUtil.archiveContractPreInfo(historyId);
insuranceDaprUtil.archiveInsurancePreInfo(historyId);
socialDaprUtils.archiveSocialFundPreInfo(historyId);
archivesDaprUtil.archiveRegisterPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
archivesDaprUtil.archiveContractPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
insuranceDaprUtil.archiveInsurancePreInfo(registration.getEmpIdcard(), registration.getDeptNo());
socialDaprUtils.archiveSocialFundPreInfo(registration.getEmpIdcard(), registration.getDeptNo());
}
//生成档案待建档数据
initRegistPreInfo(registration, preVo, user, CommonConstants.ZERO_STRING);
......@@ -1824,17 +1799,6 @@ 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,22 +428,6 @@
</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">
......
......@@ -412,7 +412,7 @@ public class TEmployeeInsurancePreController {
@Inner
@PostMapping("/inner/archiveInsuranceByRegisterId")
public Boolean archiveInsuranceByRegisterId(@RequestBody BaseSearchVO paramVo) {
return tEmployeeInsurancePreService.archiveInsuranceByRegisterId(paramVo.getRegisterId());
return tEmployeeInsurancePreService.archiveInsuranceByRegisterId(paramVo);
}
}
......@@ -146,9 +146,9 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
* @Description: 归档商险待购买信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @param paramVo 入职待建档ID
* @return: java.lang.Boolean
**/
Boolean archiveInsuranceByRegisterId(String registerId);
Boolean archiveInsuranceByRegisterId(BaseSearchVO paramVo);
}
......@@ -1126,10 +1126,12 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
}
@Override
public Boolean archiveInsuranceByRegisterId(String registerId) {
if (Common.isNotNull(registerId)) {
public Boolean archiveInsuranceByRegisterId(BaseSearchVO paramVo) {
if (Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, registerId));
.eq(TEmployeeInsurancePre::getEmpIdcard, paramVo.getEmpIdCard())
.eq(TEmployeeInsurancePre::getDeptNo, paramVo.getDeptNo())
);
if (insurancePreList != null && !insurancePreList.isEmpty()) {
for (TEmployeeInsurancePre pre : insurancePreList) {
TEmployeeInsurancePreOldHistory history = new TEmployeeInsurancePreOldHistory();
......
......@@ -544,7 +544,7 @@ public class TDispatchInfoPreController {
@Inner
@PostMapping("/inner/archiveSocialFundPreInfo")
public Boolean archiveSocialFundPreInfo(@RequestBody BaseSearchVO paramVo) {
return tDispatchInfoPreService.archiveSocialFundPreInfo(paramVo.getRegisterId());
return tDispatchInfoPreService.archiveSocialFundPreInfo(paramVo);
}
}
......@@ -122,9 +122,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
* @Description: 归档社保/公积金待派单信息到历史表
* @Author: hgw-trae
* @Date: 2026/5/12
* @param registerId 入职待建档ID
* @param paramVo 入职待建档ID
* @return: java.lang.Boolean
**/
Boolean archiveSocialFundPreInfo(String registerId);
Boolean archiveSocialFundPreInfo(BaseSearchVO paramVo);
}
......@@ -1145,10 +1145,12 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
}
@Override
public Boolean archiveSocialFundPreInfo(String registerId) {
if (Common.isNotNull(registerId)) {
public Boolean archiveSocialFundPreInfo(BaseSearchVO paramVo) {
if (Common.isNotNull(paramVo.getEmpIdCard()) && Common.isNotNull(paramVo.getDeptNo())) {
List<TDispatchInfoPre> dispatchInfoPreList = baseMapper.selectList(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getRegisterId, registerId));
.eq(TDispatchInfoPre::getEmpIdcard, paramVo.getEmpIdCard())
.eq(TDispatchInfoPre::getDeptNo, paramVo.getDeptNo())
);
if (dispatchInfoPreList != null && !dispatchInfoPreList.isEmpty()) {
TDispatchInfoPreOldHistory history;
for (TDispatchInfoPre pre : dispatchInfoPreList) {
......
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