|
|
|
@ -454,22 +454,24 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp |
|
|
|
|
private IZyDeviceService iZyDeviceService; |
|
|
|
|
|
|
|
|
|
ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<String> zyProcessCodes, List<Station> stationList) { |
|
|
|
|
for (int j = 0; j < stationList.size(); j++) { |
|
|
|
|
Station station = stationList.get(j); |
|
|
|
|
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId())); |
|
|
|
|
//工位设备ids
|
|
|
|
|
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); |
|
|
|
|
List<ZyDevice> zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>().in(ZyDevice::getId, stationMachineIds)); |
|
|
|
|
List<String> 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<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId())); |
|
|
|
|
//工位设备ids
|
|
|
|
|
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); |
|
|
|
|
List<ZyDevice> zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>().in(ZyDevice::getId, stationMachineIds)); |
|
|
|
|
List<String> 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; |
|
|
|
|