diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 368457f27..893357963 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.*; @@ -29,9 +30,11 @@ import com.engine.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEn import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.archive.SalaryArchiveItemMapper; import com.engine.salary.mapper.archive.SalaryArchiveMapper; +import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.SalaryAcctEmployeeService; import com.engine.salary.service.SalaryArchiveService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.entity.vo.OrderRuleVO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; @@ -110,6 +113,10 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private SalarySysConfMapper getSalarySysConfMapper() { + return SqlProxyHandle.getProxy(SalarySysConfMapper.class); + } + @Override public SalaryArchivePO getById(Long salaryArchiveId) { return salaryArchiveMapper.getById(salaryArchiveId); @@ -960,6 +967,10 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe String mobile = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(86186, "手机号"))).orElse("").toString(); String workcode = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(86317, "工号"))).orElse("").toString(); + //查询对于人员信息导入筛选的全局配置 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 List emps = getSalaryAcctEmployeeService(user).matchImportEmployee(importHandleParam.getEmployees(), userName, deparmentName, mobile, workcode); @@ -971,7 +982,8 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe employeeSameIds = emps.stream().map(DataCollectionEmployee::getEmployeeId).collect(Collectors.toList()); } Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 && employeeSameIds.get(0) > 0 ? employeeSameIds.get(0) : null; - + //设置当前的待校验人员id + importHandleParam.setEmployeeId(employeeId); // 调薪和调整个税扣缴义务人的存在相同的取第一条 if (employeeId != null && allEmployeeIds.contains(employeeId) && (isTaxAgentAdjust || isSalaryItemAdjust)) { @@ -1026,13 +1038,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe String cellVal = Optional.ofNullable(map.get(key)).orElse("").toString(); - boolean isEmpty = StringUtils.isEmpty(cellVal) && (userNameI18n.equals(key) + boolean isEmpty = StringUtils.isEmpty(cellVal) && (userNameI18n.equals(key)&& "0".equals(confValue) // 个税扣缴义务人列判空(初始化导入或调整个税扣缴义务人) || (taxAgentI18n.equals(key) && (isInit || isTaxAgentAdjust)) || (effectiveTimeI18n.equals(key) && isSalaryItemAdjust) // 调整原因列判空(调薪或调整个税扣缴义务人) || (adjustReasonI18n.equals(key) && (isTaxAgentAdjust || isSalaryItemAdjust))); // 判空 - if (userNameI18n.equals(key) && StringUtils.isEmpty(cellVal)) { + if (userNameI18n.equals(key) && StringUtils.isEmpty(cellVal) && "0".equals(confValue)) { Map errorMessageMap = Maps.newHashMap(); errorMessageMap.put("message", rowindex + key + "不能为空"); excelComments.add(errorMessageMap); @@ -1085,8 +1097,8 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe isError = true; } - //设置当前的待校验人员id - importHandleParam.setEmployeeId(employeeId); +// //设置当前的待校验人员id +// importHandleParam.setEmployeeId(employeeId); } else if (!isEmpty && taxAgentI18n.equals(key) && (isInit || isTaxAgentAdjust)) { // 2.个税扣缴义务人列处理(初始化导入或调整个税扣缴义务人) isError = handleTaxAgent(isError, isInit, excelComments, errorCount, j, taxAgentId, effectiveTime, finalSalaryArchive, adjustReason, importHandleParam, map);