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;