From ae00d7671da9a9f3ff80e0669a931ef46bc6f458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Wed, 26 Jul 2023 10:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E7=9B=91=E7=9D=A3bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/service/impl/SupvPlanServiceImpl.java | 6 +++--- .../service/impl/SupvPushGwServiceImpl.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java index 6112724a8..faba6dc51 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java @@ -184,7 +184,7 @@ public class SupvPlanServiceImpl extends ServiceImpl i Page page = this.page(new Page<>(PageFactory.getPageNum(supvPlanParam), PageFactory.getPageSize(supvPlanParam)), lambdaQueryWrapper); List supvPlanVOList = BeanUtil.copyToList(page.getRecords(), SupvPlanVO.class); - List userIds = supvPlanVOList.stream().map(SupvPlanVO::getUpdateBy).distinct().collect(Collectors.toList()); + List userIds = supvPlanVOList.stream().map(SupvPlanVO::getPlanUserId).distinct().collect(Collectors.toList()); supvPlanVOList.forEach(item -> { PvTerminalTreeVO pvTerminalTreeVO = null; if (mapCode.containsKey(item.getSupvOrgId())) { @@ -231,8 +231,8 @@ public class SupvPlanServiceImpl extends ServiceImpl i List userList = userFeignClient.getUserByIdList(userIds).getData(); Map map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity())); - if (map.containsKey(item.getUpdateBy())) { - item.setCreateBy(map.get(item.getUpdateBy()).getName()); + if (map.containsKey(item.getPlanUserId())) { + item.setPlanUserName(map.get(item.getPlanUserId()).getName()); } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index 221d2f7fd..b00f8718f 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -15,12 +15,15 @@ import com.njcn.process.pojo.po.SupvFile; import com.njcn.process.pojo.po.SupvPlan; import com.njcn.process.pojo.po.SupvProblem; import com.njcn.process.pojo.po.SupvReportM; +import com.njcn.process.pojo.vo.SupvPlanVO; import com.njcn.process.service.SupvPushGwService; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataTypeEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.api.UserFeignClient; import com.njcn.user.pojo.po.Dept; +import com.njcn.user.pojo.po.User; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.utils.RestTemplateUtil; import lombok.RequiredArgsConstructor; @@ -66,6 +69,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { private final DeptFeignClient deptFeignClient; private final FileStorageUtil fileStorageUtil; + + private final UserFeignClient userFeignClient; + @Override public boolean pushPlan(List planIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); @@ -93,6 +99,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { List supvVoltageDicList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData(); Map mapVoltage = supvVoltageDicList.stream().collect(Collectors.toMap(DictData::getId,Function.identity())); + List userIds = supvPlanList.stream().map(SupvPlan::getUpdateBy).distinct().collect(Collectors.toList()); + List userList = userFeignClient.getUserByIdList(userIds).getData(); + Map map = userList.stream().collect(Collectors.toMap(User::getId, Function.identity())); for(SupvPlan supvPlan:supvPlanList){ @@ -168,6 +177,11 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { supvPlan.setObjVoltageLevelName(dictData.getName()); } + + if (map.containsKey(supvPlan.getPlanUserId())) { + supvPlan.setPlanUserName(map.get(supvPlan.getPlanUserId()).getName()); + } + } if(supvPlanList.size()>100){ throw new BusinessException("一次最多上送100条数据");