生产计划-自动排位功能优化 5.12

master
zhc077 2 years ago
parent 132f31c519
commit d42c2548ed
  1. 34
      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<ZyProductPlanMapp
private IZyDeviceService iZyDeviceService; private IZyDeviceService iZyDeviceService;
ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<String> zyProcessCodes, List<Station> stationList) { ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<String> zyProcessCodes, List<Station> stationList) {
for (int j = 0; j < stationList.size(); j++) { if (!ObjectUtils.isEmpty(zyProcessCodes) && !ObjectUtils.isEmpty(zyProcessMachineIds)) {
Station station = stationList.get(j); for (int j = 0; j < stationList.size(); j++) {
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId())); Station station = stationList.get(j);
//工位设备ids List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId()));
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); //工位设备ids
List<ZyDevice> zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>().in(ZyDevice::getId, stationMachineIds)); List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).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(",")); if (zyDevice_typeCodes.containsAll(zyProcessCodes)) {
zyPlanProcess.setMachineIds(machineIds); String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(","));
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds)); zyPlanProcess.setMachineIds(machineIds);
zyPlanProcess.setStationId(station.getId()); zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds));
zyPlanProcess.setStationName(station.getStationName()); zyPlanProcess.setStationId(station.getId());
zyPlanProcess.setStationNum(station.getStationNum()); zyPlanProcess.setStationName(station.getStationName());
return zyPlanProcess; zyPlanProcess.setStationNum(station.getStationNum());
return zyPlanProcess;
}
} }
} }
return null; return null;

Loading…
Cancel
Save