diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 37b7c3594..13717760d 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -8,7 +8,6 @@ import com.engine.core.impl.Service; import com.engine.salary.common.OptionDTO; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO; import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO; import com.engine.salary.entity.taxapiflow.param.CreateMessageRuleParam; @@ -77,21 +76,22 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax @Override public List getWarnReceiverList(Long warnConfigId) { - List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO - .builder() - .warnConfigId(warnConfigId) - .build()); + List receiverPOList = getTaxDeclarationApiFlowWarnReceiverMapper().listSome(TaxDeclarationApiFlowWarnReceiverPO.builder().warnConfigId(warnConfigId).build()); - List salaryEmployees = getTaxAgentService(user).listEmployees(); - Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, TaxAgentEmployeePO::getEmployeeId, TaxAgentEmployeePO::getUsername); + List empIds = SalaryEntityUtil.properties(receiverPOList, TaxDeclarationApiFlowWarnReceiverPO::getEmployeeId, Collectors.toList()); + List empInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); + Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(empInfos, DataCollectionEmployee::getEmployeeId); - return receiverPOList.stream().map(e -> TaxDeclarationApiFlowWarnReceiverListDTO.builder() - .employeeName(salaryEmployeeMap.get(e.getEmployeeId())) - .employeeId(e.getEmployeeId()) - .mobile(e.getMobile()) - .email(e.getEmail()) - .id(e.getId()) - .build()).collect(Collectors.toList()); + return receiverPOList.stream().map(e -> { + DataCollectionEmployee employee = salaryEmployeeMap.get(e.getEmployeeId()); + return TaxDeclarationApiFlowWarnReceiverListDTO.builder() + .employeeName(employee.getUsername()) + .employeeId(e.getEmployeeId()) + .mobile(employee.getMobile()) + .email(employee.getEmail()) + .id(e.getId()) + .build(); + }).collect(Collectors.toList()); } @Override