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条数据");