From 10282bbdbf03799c3b90e73223487064c52d1807 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Sun, 14 May 2023 10:56:10 +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=E5=8C=96-=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=205.14?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IZyProductPlanAutoServiceImpl.java | 21 ++++++++++----- .../impl/ZyPlanProcessServiceImpl.java | 27 ++++++++++++------- 2 files changed, 32 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 19c3e362..76ac8dd6 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 @@ -469,13 +469,20 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl 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; + List machineList = iZyDeviceService.list(new LambdaQueryWrapper() + .in(ZyDevice::getId, stationMachineIds) + .in(ZyDevice::getTypeCode, zyProcessCodes) + ); + if (!ObjectUtils.isEmpty(machineList)) { + String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(",")); + List collect = machineList.stream().map(ZyDevice::getId).collect(Collectors.toList()); + zyPlanProcess.setMachineIds(ids); + zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(collect)); + zyPlanProcess.setStationId(station.getId()); + zyPlanProcess.setStationName(station.getStationName()); + zyPlanProcess.setStationNum(station.getStationNum()); + return zyPlanProcess; + } } } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index ee8319e2..9cc983f6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -317,21 +317,30 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl stationMachineList = iStationMachineService.list(new LambdaQueryWrapper().eq(StationMachine::getStationId, station.getId())); if (!ObjectUtils.isEmpty(stationMachineList)) { //工位设备ids - List stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); + 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(zyDevicetype_codes)) { - String collect = zyProcessMachineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.joining(",")); - zyPlanProcess.setMachineIds(collect); - zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(stationMachineIds)); - zyPlanProcess.setStationId(station.getId()); - zyPlanProcess.setStationName(station.getStationName()); - zyPlanProcess.setStationNum(station.getStationNum()); - this.updateById(zyPlanProcess); - return; + List machineList = iZyDeviceService.list(new LambdaQueryWrapper() + .in(ZyDevice::getId, stationMachineIds) + .in(ZyDevice::getTypeCode, zyDevicetype_codes) + ); + if (!ObjectUtils.isEmpty(machineList)) { + String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(",")); + List collect = machineList.stream().map(ZyDevice::getId).collect(Collectors.toList()); + zyPlanProcess.setMachineIds(ids); + zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(collect)); + zyPlanProcess.setStationId(station.getId()); + zyPlanProcess.setStationName(station.getStationName()); + zyPlanProcess.setStationNum(station.getStationNum()); + this.updateById(zyPlanProcess); + return; + } } } }