薪酬系统导入方式配置-薪资核算-导入,添加导入人员筛选配置化处理

This commit is contained in:
sy 2022-09-16 13:23:37 +08:00
parent 7daa256584
commit 478b9a3d16
1 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
@ -27,7 +28,9 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.SalaryValueTypeEnum;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.service.*;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.excel.ExcelParseHelper;
@ -118,6 +121,10 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
return ServiceUtil.getService(SalaryAcctReportServiceImpl.class, user);
}
private SalarySysConfMapper getSalarySysConfMapper() {
return SqlProxyHandle.getProxy(SalarySysConfMapper.class);
}
@Override
public XSSFWorkbook exportSalaryAcctEmployee(SalaryAcctEmployeeQueryParam queryParam) {
ValidUtil.doValidator(queryParam);
@ -521,6 +528,9 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
Long currentEmployeeId = (long) user.getUID();
//查询对于人员信息导入筛选的全局配置
SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode");
// 薪资核算记录的id
Long salaryAcctRecordId = param.getSalaryAcctRecordId();
// 薪资核算记录
@ -612,25 +622,25 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
continue;
}
String dataValue = (String) map.getOrDefault(dataKey.toString(), "");
String deparmentName = (String) map.getOrDefault("部门", "");
String mobile = (String) map.getOrDefault("手机号", "");
String workcode = (String) map.getOrDefault("工号", "");
if (StringUtils.equals(SalaryI18nUtil.getI18nLabel(85429, "姓名"), dataKey.toString())) {
usernameIndex = j;
if (StringUtils.isEmpty(dataValue)) {
if (StringUtils.isEmpty(dataValue) && "0".equals(salarySysConfPO.getConfValue())) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"));
excelComments.add(errorMessageMap);
//salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(102838, "姓名不能为空"), i, i, j, j);
} else {
List<DataCollectionEmployee> employeeSameIds = salaryEmployees.stream().filter(e -> (StringUtils.isBlank(dataValue) || Objects.equals(e.getUsername(), dataValue))
&& (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))
&& (StringUtils.isBlank(mobile) || Objects.equals(e.getMobile(), mobile)))
.collect(Collectors.toList());
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
List<DataCollectionEmployee> employeeSameIds = getSalaryAcctEmployeeService(user).matchImportEmployee(salaryEmployees, dataValue, deparmentName, mobile, workcode);
// List<DataCollectionEmployee> employeeSameIds = salaryEmployees.stream().filter(e -> (StringUtils.isBlank(dataValue) || Objects.equals(e.getUsername(), dataValue))
// && (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))
// && (StringUtils.isBlank(mobile) || Objects.equals(e.getMobile(), mobile)))
// .collect(Collectors.toList());
if (CollectionUtils.isEmpty(employeeSameIds)) {
isError = true;