万德隆调整

This commit is contained in:
Harryxzy 2025-07-23 21:06:17 +08:00
parent ded111bff0
commit 038b15db0f
11 changed files with 110 additions and 11 deletions

View File

@ -2,7 +2,6 @@ package com.engine.salary.action;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.util.SalaryEntityUtil;
@ -105,10 +104,11 @@ public class CheckStayDelToStopSIArchiveAction implements Action {
if(insuranceArchivesBaseInfoPO == null){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在福利档案,请检查后重试!");
return FAILURE_AND_CONTINUE;
} else if(!insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
// else if(!insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
// requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
// return FAILURE_AND_CONTINUE;
// }
} catch (Exception e) {
log.error("减员校验异常", e);

View File

@ -139,10 +139,11 @@ public class EditToStopSIArchiveAction implements Action {
if(insuranceArchivesBaseInfoPO == null){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在福利档案,请检查后重试!");
return FAILURE_AND_CONTINUE;
} else if(!insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
// else if(!insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
// requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
// return FAILURE_AND_CONTINUE;
// }
//减员
Map<String, Object> resultMap = getSIArchivesService(user).stayDelToStop(Collections.singletonList(insuranceArchivesBaseInfoPO.getId()));
if (resultMap.get("type").toString().equals("fail")) {

View File

@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SIArchivesService;
@ -130,10 +129,11 @@ public class StayDelToStopSIArchiveAction implements Action {
if(insuranceArchivesBaseInfoPO == null){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在福利档案,请检查后重试!");
return FAILURE_AND_CONTINUE;
} else if(StrUtil.isBlank(payEndYearMonth) && !insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
return FAILURE_AND_CONTINUE;
}
// else if(StrUtil.isBlank(payEndYearMonth) && !insuranceArchivesBaseInfoPO.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue())){
// requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工的福利档案状态不是待减员,无法进行减员操作,请检查后重试!");
// return FAILURE_AND_CONTINUE;
// }
//减员
Map<String, Object> resultMap = new HashMap<>();
if (StrUtil.isBlank(payEndYearMonth)) {

View File

@ -1,24 +1,34 @@
package com.engine.salary.action;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemBatchSaveParam;
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveItemSaveParam;
import com.engine.salary.entity.salaryarchive.po.WdlArchiveWorkflowPO;
import com.engine.salary.enums.salaryarchive.WdlArchiveWorkflowEnum;
import com.engine.salary.mapper.archive.WdlArchiveWorkflowMapper;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.util.JsonUtil;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.wrapper.SalaryArchiveItemWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.BaseBean;
import weaver.hrm.User;
import weaver.interfaces.workflow.action.Action;
import weaver.soa.workflow.request.RequestInfo;
import weaver.wechat.util.Utils;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ClassName WdlSalaryArchiveTriggerAction
@ -37,6 +47,10 @@ public class WdlSalaryArchiveTriggerAction implements Action {
return ServiceUtil.getService(SalaryArchiveItemWrapper.class, user);
}
private SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
@Override
public String execute(RequestInfo requestInfo) {
try {
@ -77,6 +91,21 @@ public class WdlSalaryArchiveTriggerAction implements Action {
} else if (po.getOperateType().equals(WdlArchiveWorkflowEnum.SINGLE_INIT.getValue())) {
SalaryArchiveItemSaveParam param = JsonUtil.parseBean(po.getOperateJson(), SalaryArchiveItemSaveParam.class);
try {
if (StringUtils.isNotBlank(param.getIdNo())) {
// 获取人员id
List<DataCollectionEmployee> employeeByIdNo = getSalaryEmployeeService(user).getEmployeeByIdNos(Collections.singletonList(param.getIdNo()));
if (CollectionUtils.isEmpty(employeeByIdNo)) {
requestInfo.getRequestManager().setMessage("身份证号不存在");
log.error("万德隆调薪定薪触发action 单个定薪异常 requestId:{} poId:{} msg:{}", requestInfo.getRequestid(),po.getId(), "身份证号不存在");
return FAILURE_AND_CONTINUE;
}
if (employeeByIdNo.size() > 1) {
requestInfo.getRequestManager().setMessage("身份证号存在多个员工");
log.error("万德隆调薪定薪触发action 单个定薪异常 requestId:{} poId:{} msg:{}", requestInfo.getRequestid(),po.getId(), "身份证号存在多个员工");
return FAILURE_AND_CONTINUE;
}
param.setEmployeeId(employeeByIdNo.get(0).getEmployeeId());
}
getSalaryArchiveItemWrapper(user).initSalaryItem4Workflow(param);
} catch (Exception e) {
requestInfo.getRequestManager().setMessage(e.getMessage());
@ -86,6 +115,20 @@ public class WdlSalaryArchiveTriggerAction implements Action {
} else if (po.getOperateType().equals(WdlArchiveWorkflowEnum.BATCH_INIT.getValue())) {
List<SalaryArchiveItemBatchSaveParam> param = JsonUtil.parseList(po.getOperateJson(), SalaryArchiveItemBatchSaveParam.class);
try {
if (CollectionUtils.isNotEmpty(param)) {
List<String> idNos = param.stream().map(SalaryArchiveItemBatchSaveParam::getIdNo).collect(Collectors.toList());
// 获取人员id
List<DataCollectionEmployee> employeeByIdNo = getSalaryEmployeeService(user).getEmployeeByIdNos(idNos);
if (CollectionUtils.isNotEmpty(employeeByIdNo)) {
Map<String, Long> idNoMap = SalaryEntityUtil.convert2Map(employeeByIdNo, DataCollectionEmployee::getIdNo, DataCollectionEmployee::getEmployeeId);
for (SalaryArchiveItemBatchSaveParam singleParam: param) {
Long empId = idNoMap.get(singleParam.getIdNo());
if (empId != null && StringUtils.isNotBlank(singleParam.getIdNo())) {
singleParam.setEmployeeId(Utils.null2String(idNoMap.get(singleParam.getIdNo())));
}
}
}
}
getSalaryArchiveItemWrapper(user).batchInitSalaryItem4Workflow(param);
} catch (Exception e) {
requestInfo.getRequestManager().setMessage(e.getMessage());

View File

@ -23,6 +23,8 @@ public class SalaryArchiveItemBatchSaveParam {
private String employeeId;
private String idNo;
private String effectiveTime;
private SalaryArchiveItemAdjustReasonEnum adjustReason;

View File

@ -58,6 +58,8 @@ public class SalaryArchiveItemSaveParam {
private Long employeeId;
private String idNo;
private String salaryStartDate;
private String salaryEndDate;

View File

@ -181,4 +181,6 @@ public interface EmployMapper {
List<Long> listByDepartment(@Param("departmentIds") List<Long> departmentIds);
List<Long> listByJob(@Param("jobIds") List<Long> jobIds);
List<DataCollectionEmployee> listbyIdNos(@Param("idNos")List<String> idNo);
}

View File

@ -672,4 +672,32 @@
from hrmjobcall job
where job.id = #{jobCallId}
</select>
<select id="listbyIdNos" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
select e.id as employeeId,
e.lastname as username,
e.status as status,
e.sex as sex,
e.certificatenum as idNo,
e.workcode as workcode,
d.departmentname as departmentName,
d.id as departmentId,
c.jobtitlename as jobtitleName,
c.id as jobtitleId,
e.companystartdate as companystartdate,
e.mobile as mobile,
e.enddate as dismissdate,
e.accounttype as accountType,
sc.SUBCOMPANYNAME as subcompanyName,
sc.id as subcompanyid
from hrmresource e
left join hrmdepartment d on e.departmentid = d.id
left join HrmSubCompany sc on e.SUBCOMPANYID1=sc.id
left join hrmjobtitles c on e.jobtitle = c.id
where e.status not in (7)
AND e.certificatenum IN
<foreach collection="idNos" open="(" item="idNo" separator="," close=")">
#{idNo}
</foreach>
</select>
</mapper>

View File

@ -196,4 +196,6 @@ public interface SalaryEmployeeService {
JobCallInfo getJobCallInfoById(Long jobCallId);
List<DataCollectionEmployee> snapshot(List<Long> employeeIds, Date snapshotTime);
List<DataCollectionEmployee> getEmployeeByIdNos(List<String> idNos);
}

View File

@ -686,4 +686,12 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return SalaryI18nUtil.i18nList(employees);
}
@Override
public List<DataCollectionEmployee> getEmployeeByIdNos(List<String> idNos) {
if (CollectionUtils.isEmpty(idNos)) {
return null;
}
return getEmployMapper().listbyIdNos(idNos);
}
}

View File

@ -780,6 +780,17 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
} else if (po.getOperateType().equals(WdlArchiveWorkflowEnum.SINGLE_INIT.getValue())) {
SalaryArchiveItemSaveParam param = JsonUtil.parseBean(po.getOperateJson(), SalaryArchiveItemSaveParam.class);
try {
if (StringUtils.isNotBlank(param.getIdNo())) {
// 获取人员id
List<DataCollectionEmployee> employeeByIdNo = getSalaryEmployeeService(user).getEmployeeByIdNos(Collections.singletonList(param.getIdNo()));
if (CollectionUtils.isEmpty(employeeByIdNo)) {
throw new SalaryRunTimeException("");
}
if (employeeByIdNo.size() > 1) {
throw new SalaryRunTimeException("");
}
param.setEmployeeId(employeeByIdNo.get(0).getEmployeeId());
}
initSalaryItem4Workflow(param);
} catch (Exception e) {
// requestInfo.getRequestManager().setMessage(e.getMessage());