修复外部人员初始化档案数据

This commit is contained in:
钱涛 2023-07-13 10:20:41 +08:00
parent 89ecf0984d
commit 23c0a78adc
1 changed files with 12 additions and 21 deletions

View File

@ -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<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
Collection<SalaryArchiveListDTO> salaryArchives = getSalaryArchiveMapper().list(queryParam);
// boolean isSearchIdNo = enableHr && StringUtils.isNotEmpty(queryParam.getIdNo());
// if (isSearchIdNo) {
// Map<Long, String> 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<SalaryArchiveListDTO> 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<TaxAgentEmployeeDTO> taxAgentEmployees = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
List<Long> 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<Long, String> idNoEmpMap =
// enableHr ? salaryEmployeeService.mapByEmployeeIds(salaryArchives.stream().map(SalaryArchiveListDTO::getEmployeeId).distinct().collect(Collectors.toList()), tenantKey)
// :
new HashMap<>();
if (queryParam.getHasData()) {
List<Map<String, Object>> 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()