diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 978563ab8..a3c51c7ca 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,7 +14,6 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -315,32 +314,24 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch rows.add(header); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listAll(); - Collection salaryArchives = getSalaryArchiveMapper().list(queryParam); -// boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo()); -// if (isSearchIdNo) { -// Map idNoEmpMap = salaryEmployeeService -// .mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey); -// salaryArchives = salaryArchives.stream().filter(f -> Optional.ofNullable(idNoEmpMap.get(f.getEmployeeId())).orElse("").contains(queryParam.getIdNo())) -// .collect(Collectors.toList()); -// } - // 开启分权并且不是薪酬模块总管理员 + Collection salaryArchives = new ArrayList<>(); + + if (queryParam.isExtSalaryArchiveList()) { + //非系统人员档案 + salaryArchives = getSalaryArchiveMapper().listExtSalaryArchive(queryParam); + } else { + salaryArchives = getSalaryArchiveMapper().list(queryParam); + } long employeeId = user.getUID(); if (getTaxAgentService(user).isNeedAuth(employeeId)) { - List taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - salaryArchives = salaryArchives.stream().filter(f -> + salaryArchives = salaryArchives.stream() + .filter(f -> // 作为管理员 taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - // 作为分管理员 -// || TaxAgentBO.checkTaxAgentAndEmployee(taxAgentEmployees, f.getTaxAgentId(), f.getEmployeeId()) -// || employeeId.equals(f.getModifier()) - ).collect(Collectors.toList()); + ).collect(Collectors.toList()); } - Map idNoEmpMap = -// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey) -// : - new HashMap<>(); if (queryParam.getHasData()) { List> listMaps = salaryArchiveService(user) .buildSalaryArchiveData(salaryArchives, taxAgentList, salaryItems, Boolean.FALSE); @@ -716,7 +707,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch UseEmployeeTypeEnum empType = UseEmployeeTypeEnum.ORG; //外部人员导入 - if(param.isExtEmp()){ + if (param.isExtEmp()) { empType = UseEmployeeTypeEnum.EXT; } return SalaryArchiveImportHandleParam.builder()