From 8564f2e6d6c90b97b6e9f97314bd2f7a12a2ee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 30 Aug 2023 15:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=8F=90=E9=86=92=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TaxDeclarationApiFlowWarnServiceImpl.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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