Merge branch 'release/2.19.1.2501.01' into release/个税版本
# Conflicts: # src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java
This commit is contained in:
commit
6ade625a39
|
|
@ -96,15 +96,18 @@ public class CheckStopSalaryAction implements Action {
|
|||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -115,15 +118,17 @@ public class CheckStopSalaryAction implements Action {
|
|||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
if(salaryArchiveList.size() > 1){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
log.error("停薪检查异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("停薪校验异常", e);
|
||||
log.error("停薪检查异常", e);
|
||||
requestInfo.getRequestManager().setMessage(e.getMessage());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,15 +107,18 @@ public class StopSalaryAction implements Action {
|
|||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentName + "个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "缺少最后发薪日期字段!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}else if(SalaryDateUtil.stringToDate(importDataMap.get("最后发薪日期").toString()) == null){
|
||||
requestInfo.getRequestManager().setMessage("最后发薪日期格式错误,格式为yyyy-MM-dd");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), "最后发薪日期格式错误,格式为yyyy-MM-dd" + importDataMap.get("最后发薪日期").toString());
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -123,10 +126,12 @@ public class StopSalaryAction implements Action {
|
|||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工不存在薪资档案,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
if(salaryArchiveList.size() > 1){
|
||||
requestInfo.getRequestManager().setMessage("该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
log.error("停薪异常 requestId:{} msg:{}", requestInfo.getRequestid(), taxAgentId +"_"+ employeeId+"该个税扣缴义务人下该员工存在多条薪资档案记录,请检查后重试!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
// 设置最后发薪日期
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.entity.extemp.dto;
|
||||
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 外部人员
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_external_employee
|
||||
@ElogTransform( name = "非系统人员")
|
||||
public class ExtEmpDTO {
|
||||
|
||||
@ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "username", key = "username")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
@TableTitle(title = "分部", dataIndex = "subcompanyName", key = "subcompanyName")
|
||||
private String subcompanyName;
|
||||
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
@TableTitle(title = "入职日期", dataIndex = "companystartdate", key = "companystartdate")
|
||||
private String companystartdate;
|
||||
|
||||
|
||||
/**
|
||||
* 工号
|
||||
*/
|
||||
@TableTitle(title = "工号", dataIndex = "workcode", key = "workcode")
|
||||
private String workcode;
|
||||
|
||||
}
|
||||
|
|
@ -25,6 +25,9 @@ public class SalaryStatisticsEmployeeSalaryQueryParam extends BaseQueryParam {
|
|||
// 关键字
|
||||
private String keyword;
|
||||
|
||||
//人员ids
|
||||
private List<Long> employeeIds;
|
||||
|
||||
// 起始年月
|
||||
private String startDateStr;
|
||||
private Date startDate;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
|
|
@ -248,12 +249,23 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll();
|
||||
Map<Long, Integer> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes);
|
||||
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Map<Long, String> itemDataTypeMap = SalaryEntityUtil.convert2Map(salaryItemPOList, SalaryItemPO::getId, SalaryItemPO::getDataType);
|
||||
|
||||
|
||||
Map<Long, List<SalaryAcctResultPO>> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
Map<Long, Map<String, String>> acctResultValueMap = new HashMap<>();
|
||||
Map<Long, Map<String, Object>> acctResultValueMap = new HashMap<>();
|
||||
acctResultValueList.forEach((k, v) -> {
|
||||
Map<String, String> map = new HashMap();
|
||||
Map<String, Object> map = new HashMap();
|
||||
v.forEach(l -> {
|
||||
map.put(l.getSalaryItemId() + "", l.getResultValue());
|
||||
String dataType = itemDataTypeMap.getOrDefault(l.getSalaryItemId(), "string");
|
||||
SalaryDataTypeEnum typeEnum = SalaryDataTypeEnum.parseByValue(dataType);
|
||||
String resultValue = l.getResultValue();
|
||||
if (typeEnum == SalaryDataTypeEnum.NUMBER && NumberUtil.isNumber(resultValue)) {
|
||||
map.put(l.getSalaryItemId() + "", Double.valueOf(resultValue));
|
||||
} else {
|
||||
map.put(l.getSalaryItemId() + "", resultValue);
|
||||
}
|
||||
});
|
||||
acctResultValueMap.put(k, map);
|
||||
});
|
||||
|
|
@ -265,7 +277,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
Map<String, Object> map;
|
||||
for (SalaryAcctEmployeePO se : salaryStatisticsEmployeeDetailResult.getSalaryAcctEmployeeList()) {
|
||||
map = Maps.newHashMap();
|
||||
Map<String, String> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||
Map<String, Object> resultValueMap = Optional.ofNullable(acctResultValueMap.get(se.getId())).orElse(Maps.newHashMap());
|
||||
Map<String, Object> finalMap = map;
|
||||
resultValueMap.forEach((k, v) -> {
|
||||
finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v);
|
||||
|
|
@ -332,6 +344,13 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
List<Long> employeeIds = employeeList.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList());
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//人员浏览按钮筛选
|
||||
List<Long> employeeIds = queryParam.getEmployeeIds();
|
||||
if(CollectionUtils.isNotEmpty(employeeIds)){
|
||||
salaryAcctEmployeeList = salaryAcctEmployeeList.stream().filter(acctEmp -> employeeIds.contains(acctEmp.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeeList)) {
|
||||
return new PageInfo<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -19,7 +20,7 @@ public interface ExtEmpService {
|
|||
|
||||
List<ExtEmpPO> list(ExtEmpQueryParam param);
|
||||
|
||||
PageInfo<ExtEmpPO> listPage (ExtEmpQueryParam param);
|
||||
PageInfo<ExtEmpDTO> listPage (ExtEmpQueryParam param);
|
||||
|
||||
void save(ExtEmpSaveParam po);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -83,9 +84,21 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||
List<ExtEmpPO> extEmpPOS = list(param);
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), extEmpPOS, ExtEmpPO.class);
|
||||
|
||||
List<ExtEmpDTO> list = extEmpPOS.stream().map(po -> {
|
||||
return ExtEmpDTO.builder()
|
||||
.id(po.getId())
|
||||
.username(po.getUsername())
|
||||
.departmentName(po.getDepartmentName())
|
||||
.subcompanyName(po.getSubcompanyName())
|
||||
.companystartdate(po.getCompanystartdate())
|
||||
.workcode(po.getWorkcode())
|
||||
.build();
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), list, ExtEmpDTO.class);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ import java.util.concurrent.LinkedBlockingDeque;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||
|
||||
import static com.engine.salary.constant.SalaryFormulaFieldConstant.SALARY_PATTERN;
|
||||
|
||||
/**
|
||||
|
|
@ -202,6 +204,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
private VariableItemService getVariableItemService(User user) {
|
||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -888,6 +891,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 12.4、是否采用系统算税
|
||||
TaxDeclarationFunctionEnum taxDeclarationFunction = getSalarySysConfService(user).getTaxDeclaration();
|
||||
// 12.5、多线程运算,运算结果存放在临时表中
|
||||
//是否同步计算
|
||||
boolean isSync = "0".equals(getSalarySysConfService(user).getValueByCode(SALARY_ACCT_SYNC_TYPE));
|
||||
for (List<SalaryAcctEmployeePO> acctEmployeePOS : partition) {
|
||||
SalaryAcctCalculateBO salaryAcctCalculateBO = new SalaryAcctCalculateBO()
|
||||
.setSalaryAcctRecordPO(salaryAcctRecordPO)
|
||||
|
|
@ -910,13 +915,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.setTaxDeclarationFunction(taxDeclarationFunction)
|
||||
.setTaxIds(taxIds);
|
||||
List<SalarySobBackItemPO> finalSalarySobBackItems = salarySobBackItems;
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
if (isSync) {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
} else {
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
@Override
|
||||
public void execute() {
|
||||
getSalaryAcctCalculateService(user).calculate(salaryAcctCalculateBO, simpleEmployee, finalSalarySobBackItems);
|
||||
}
|
||||
};
|
||||
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.HRM, "salaryAcctCalculate", localRunnable);
|
||||
}
|
||||
}
|
||||
// 13、等待所有子线程执行完毕
|
||||
childMonitor.await();
|
||||
|
|
@ -945,7 +954,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true);
|
||||
|
||||
//更新薪资核算记录最后操作日期
|
||||
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(),new Date());
|
||||
getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(), new Date());
|
||||
|
||||
stopWatch.stop();
|
||||
log.info(stopWatch.prettyPrint());
|
||||
|
|
@ -953,6 +962,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
// 记录日志
|
||||
// 查询操作日志的targetName
|
||||
String targetName = getSalaryAcctRecordService(user).getLogTargetNameById(calculateParam.getSalaryAcctRecordId());
|
||||
Collection<Long> ids = calculateParam.getIds();
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
targetName += ids;
|
||||
}
|
||||
LoggerContext<SalaryCheckResultPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(String.valueOf(calculateParam.getSalaryAcctRecordId()));
|
||||
|
|
|
|||
|
|
@ -71,6 +71,11 @@ public class SalarySysConstant {
|
|||
*/
|
||||
public static final String SALARY_ACCT_EMPLOYEE_RULE = "salaryAcctEmployeeRule";
|
||||
|
||||
/**
|
||||
* 是否采用线程池,同步异步。空/1异步, 0同步
|
||||
*/
|
||||
public static final String SALARY_ACCT_SYNC_TYPE = "SALARY_ACCT_SYNC_TYPE";
|
||||
|
||||
/**
|
||||
* 工资单二次验证方式
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ import java.util.stream.Collectors;
|
|||
@Slf4j
|
||||
public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -55,12 +60,6 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
|||
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
|
||||
private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz();
|
||||
|
||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,13 @@ import java.util.*;
|
|||
*/
|
||||
public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user);
|
||||
}
|
||||
|
|
@ -73,39 +80,43 @@ public class AutoSyncResignationEmpArchiveJob extends BaseCronJob {
|
|||
}
|
||||
cal.add(Calendar.MONTH, preMonthValue);
|
||||
Map<Long, String> resignationMap = getSalaryEmployeeService(user).getResignationMapByDate(SalaryDateUtil.getFormatDate(cal.getTime()));
|
||||
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
Date now = new Date();
|
||||
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
||||
for(SalaryArchivePO archive : salaryArchivePOS){
|
||||
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
||||
if (StringUtils.isNotBlank(dismissDate)) {
|
||||
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
||||
archive.setUpdateTime(now);
|
||||
needUpdateSalaryArchiveList.add(archive);
|
||||
|
||||
if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive, "false")) {
|
||||
// 获取离职人员中没有设置最后发薪日期的薪资档案
|
||||
List<SalaryArchivePO> salaryArchivePOS = getSalaryArchiveService(user).listPayEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
Date now = new Date();
|
||||
List<SalaryArchivePO> needUpdateSalaryArchiveList = new ArrayList<>();
|
||||
for(SalaryArchivePO archive : salaryArchivePOS){
|
||||
String dismissDate = resignationMap.get(archive.getEmployeeId());
|
||||
if (StringUtils.isNotBlank(dismissDate)) {
|
||||
archive.setPayEndDate(SalaryDateUtil.dateStrToLocalDate(dismissDate));
|
||||
archive.setUpdateTime(now);
|
||||
needUpdateSalaryArchiveList.add(archive);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
||||
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(needUpdateSalaryArchiveList)) {
|
||||
getSalaryArchiveMapper.batchUpdate(needUpdateSalaryArchiveList);
|
||||
}
|
||||
|
||||
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
||||
if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive, "false")) {
|
||||
// 获取离职人员中没有设置最后缴纳月的社保福利档案
|
||||
// List<InsuranceArchivesBaseInfoPO> needSyncList = siArchivesBiz.listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
// 设置社保、公积金最后缴纳月
|
||||
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
||||
String dismissDate = resignationMap.get(po.getEmployeeId());
|
||||
if (StringUtils.isNotEmpty(dismissDate)) {
|
||||
dismissDate = StringUtils.substring(dismissDate,0,7);
|
||||
// 更新社保最后缴纳月
|
||||
Long socialArchivesId = po.getSocialArchivesId();
|
||||
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
||||
// 更新公积金最后缴纳月
|
||||
Long fundArchivesId = po.getFundArchivesId();
|
||||
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
||||
// 更新企业年金及其他福利最后缴纳月
|
||||
Long otherArchivesId = po.getOtherArchivesId();
|
||||
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
||||
List<InsuranceArchivesBaseInfoPO> needSyncList = getSIArchivesService(user).listEndDateIsNull(new ArrayList<>(resignationMap.keySet()));
|
||||
// 设置社保、公积金最后缴纳月
|
||||
for(InsuranceArchivesBaseInfoPO po : needSyncList){
|
||||
String dismissDate = resignationMap.get(po.getEmployeeId());
|
||||
if (StringUtils.isNotEmpty(dismissDate)) {
|
||||
dismissDate = StringUtils.substring(dismissDate,0,7);
|
||||
// 更新社保最后缴纳月
|
||||
Long socialArchivesId = po.getSocialArchivesId();
|
||||
getSocialSchemeMapper().updateEndTime(socialArchivesId, dismissDate);
|
||||
// 更新公积金最后缴纳月
|
||||
Long fundArchivesId = po.getFundArchivesId();
|
||||
getFundSchemeMapper().updateEndTime(fundArchivesId, dismissDate);
|
||||
// 更新企业年金及其他福利最后缴纳月
|
||||
Long otherArchivesId = po.getOtherArchivesId();
|
||||
getOtherSchemeMapper().updateEndTime(otherArchivesId, dismissDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -48,7 +49,7 @@ public class ExtEmpController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ExtEmpQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpPO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||
return new ResponseResult<ExtEmpQueryParam, PageInfo<ExtEmpDTO>>(user).run(getExtEmpWrapper(user)::listPage, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.extemp.dto.ExtEmpDTO;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
|
||||
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
|
||||
|
|
@ -30,7 +31,7 @@ public class ExtEmpWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
|
||||
public PageInfo<ExtEmpDTO> listPage(ExtEmpQueryParam param) {
|
||||
return getExtEmpService(user).listPage(param);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue