From d42c2548ed01146dca12a26d756ad566d8fa4cb0 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 12 May 2023 11:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92-=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=8E=92=E4=BD=8D=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= =?UTF-8?q?=205.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IZyProductPlanAutoServiceImpl.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java index f5103093..aebe0b79 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java @@ -454,22 +454,24 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl zyProcessMachineIds, List zyProcessCodes, List stationList) { - for (int j = 0; j < stationList.size(); j++) { - Station station = stationList.get(j); - List stationMachineList = iStationMachineService.list(new LambdaQueryWrapper().eq(StationMachine::getStationId, station.getId())); - //工位设备ids - List stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); - List zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper().in(ZyDevice::getId, stationMachineIds)); - List zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList()); - // 工位设备包含工序设备即匹配成功 - if (zyDevice_typeCodes.containsAll(zyProcessCodes)) { - String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(",")); - zyPlanProcess.setMachineIds(machineIds); - zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds)); - zyPlanProcess.setStationId(station.getId()); - zyPlanProcess.setStationName(station.getStationName()); - zyPlanProcess.setStationNum(station.getStationNum()); - return zyPlanProcess; + if (!ObjectUtils.isEmpty(zyProcessCodes) && !ObjectUtils.isEmpty(zyProcessMachineIds)) { + for (int j = 0; j < stationList.size(); j++) { + Station station = stationList.get(j); + List stationMachineList = iStationMachineService.list(new LambdaQueryWrapper().eq(StationMachine::getStationId, station.getId())); + //工位设备ids + List stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); + List zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper().in(ZyDevice::getId, stationMachineIds)); + List zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList()); + // 工位设备包含工序设备即匹配成功 + if (zyDevice_typeCodes.containsAll(zyProcessCodes)) { + String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(",")); + zyPlanProcess.setMachineIds(machineIds); + zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds)); + zyPlanProcess.setStationId(station.getId()); + zyPlanProcess.setStationName(station.getStationName()); + zyPlanProcess.setStationNum(station.getStationNum()); + return zyPlanProcess; + } } } return null;