Compare commits
14 Commits
4cea877d98
...
0f1ba006e4
| Author | SHA1 | Date |
|---|---|---|
|
|
0f1ba006e4 | |
|
|
da6364a511 | |
|
|
37445cdd58 | |
|
|
99a0c3facc | |
|
|
b0fb2b3866 | |
|
|
eea9093cfd | |
|
|
b128f219f7 | |
|
|
8910183e7f | |
|
|
fe4b8b1fb3 | |
|
|
c8f281613b | |
|
|
3b520fcf62 | |
|
|
a29f8b3da9 | |
|
|
3fb29b2c3d | |
|
|
9cee19397d |
|
|
@ -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;
|
||||
}
|
||||
// 设置最后发薪日期
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO;
|
|||
import com.engine.salary.mapper.salarybill.SalarySendRangeObjMapper;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
|
@ -23,6 +25,10 @@ public class SalarySendRangeObjBiz {
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class);
|
||||
}
|
||||
|
||||
private SalarySendRangeObjMapper getSalarySendRangeObjMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySendRangeObjMapper.class);
|
||||
}
|
||||
|
||||
public <R> R applyMapper(Function<SalarySendRangeObjMapper, R> mapper) {
|
||||
try (SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession()) {
|
||||
final SalarySendRangeObjMapper salarySendRangeObjMapper = sqlSession.getMapper(SalarySendRangeObjMapper.class);
|
||||
|
|
@ -41,7 +47,13 @@ public class SalarySendRangeObjBiz {
|
|||
}
|
||||
|
||||
public List<SalarySendUserInfoDTO> getSalarySendUserInfoDTOs(List<Long> employees) {
|
||||
List<SalarySendUserInfoDTO> userDTOs = applyMapper(mapper -> mapper.getUserInfoByEmployeeIds(employees));
|
||||
List<SalarySendUserInfoDTO> userDTOs = new ArrayList<>();
|
||||
List<List<Long>> partition = Lists.partition(employees, 500);
|
||||
partition.forEach(l->{
|
||||
List<SalarySendUserInfoDTO> userInfos = getSalarySendRangeObjMapper().getUserInfoByEmployeeIds(l);
|
||||
userDTOs.addAll(userInfos);
|
||||
});
|
||||
|
||||
Map<Long, SalarySendUserInfoDTO> userMap = userDTOs.stream()
|
||||
.collect(Collectors.toMap(SalarySendUserInfoDTO::getResourceId, Function.identity()));
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -17,7 +18,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;
|
||||
|
|
@ -78,9 +79,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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ import java.util.concurrent.CountDownLatch;
|
|||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -190,15 +192,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
return ServiceUtil.getService(TaxAgentAdminServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private VariableItemService getVariableItemService(User user) {
|
||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) {
|
||||
return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private VariableItemService getVariableItemService(User user) {
|
||||
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCheckResultService salaryCheckResultService;
|
||||
|
||||
private SalaryAcctSobConfigService getSalaryAcctSobConfigService(User user) {
|
||||
|
|
@ -927,6 +929,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)
|
||||
|
|
@ -948,13 +952,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
.setVariableItems(variableItemPOS)
|
||||
.setTaxDeclarationFunction(taxDeclarationFunction);
|
||||
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();
|
||||
|
|
@ -983,7 +991,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());
|
||||
|
|
@ -991,6 +999,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()));
|
||||
|
|
|
|||
|
|
@ -1425,7 +1425,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
if (CollectionUtils.isEmpty(employeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds);
|
||||
List<List<Long>> partition = Lists.partition(employeeIds, 500);
|
||||
List<SalaryArchivePO> resultList = new ArrayList<>();
|
||||
partition.forEach(part -> {
|
||||
resultList.addAll(getSalaryArchiveMapper().listPayEndDateIsNull(part));
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -169,16 +169,6 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
&& Optional.ofNullable(salaryBillProgress.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(136104, "有其他人员正在发送中,请等待其他人员发送结束后再操作"));
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = ProgressDTO.builder()
|
||||
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
|
||||
.totalQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.progress(BigDecimal.ZERO)
|
||||
.status(true)
|
||||
.message("")
|
||||
.build();
|
||||
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
|
||||
|
||||
List<Long> ids = param.getIds();
|
||||
|
||||
|
|
@ -190,6 +180,17 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
throw new SalaryRunTimeException("工资发放范围内没有匹配员工");
|
||||
}
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = ProgressDTO.builder()
|
||||
.title(SalaryI18nUtil.getI18nLabel(136097, "发送中"))
|
||||
.totalQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.calculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.progress(BigDecimal.ZERO)
|
||||
.status(true)
|
||||
.message("")
|
||||
.build();
|
||||
getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress);
|
||||
|
||||
// 异步执行
|
||||
List<Long> finalIds = ids;
|
||||
LocalRunnable localRunnable = new LocalRunnable() {
|
||||
|
|
|
|||
|
|
@ -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