生产计划自动化-查询条件修改 5.14

master
zhc077 2 years ago
parent 0ad315236f
commit 10282bbdbf
  1. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java
  2. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -469,9 +469,15 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList()); List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList());
// 工位设备包含工序设备即匹配成功 // 工位设备包含工序设备即匹配成功
if (zyDevice_typeCodes.containsAll(zyProcessCodes)) { if (zyDevice_typeCodes.containsAll(zyProcessCodes)) {
String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(",")); List<ZyDevice> machineList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>()
zyPlanProcess.setMachineIds(machineIds); .in(ZyDevice::getId, stationMachineIds)
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds)); .in(ZyDevice::getTypeCode, zyProcessCodes)
);
if (!ObjectUtils.isEmpty(machineList)) {
String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(","));
List<String> collect = machineList.stream().map(ZyDevice::getId).collect(Collectors.toList());
zyPlanProcess.setMachineIds(ids);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(collect));
zyPlanProcess.setStationId(station.getId()); zyPlanProcess.setStationId(station.getId());
zyPlanProcess.setStationName(station.getStationName()); zyPlanProcess.setStationName(station.getStationName());
zyPlanProcess.setStationNum(station.getStationNum()); zyPlanProcess.setStationNum(station.getStationNum());
@ -480,6 +486,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
} }
} }
} }
}
return null; return null;
} }

@ -317,16 +317,24 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId())); List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId()));
if (!ObjectUtils.isEmpty(stationMachineList)) { if (!ObjectUtils.isEmpty(stationMachineList)) {
//工位设备ids //工位设备ids
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); 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<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()); List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList());
/** /**
* 工位设备包含工序设备即匹配成功 * 工位设备包含工序设备即匹配成功
*/ */
if (zyDevice_typeCodes.containsAll(zyDevicetype_codes)) { if (zyDevice_typeCodes.containsAll(zyDevicetype_codes)) {
String collect = zyProcessMachineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.joining(",")); List<ZyDevice> machineList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>()
zyPlanProcess.setMachineIds(collect); .in(ZyDevice::getId, stationMachineIds)
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(stationMachineIds)); .in(ZyDevice::getTypeCode, zyDevicetype_codes)
);
if (!ObjectUtils.isEmpty(machineList)) {
String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(","));
List<String> collect = machineList.stream().map(ZyDevice::getId).collect(Collectors.toList());
zyPlanProcess.setMachineIds(ids);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(collect));
zyPlanProcess.setStationId(station.getId()); zyPlanProcess.setStationId(station.getId());
zyPlanProcess.setStationName(station.getStationName()); zyPlanProcess.setStationName(station.getStationName());
zyPlanProcess.setStationNum(station.getStationNum()); zyPlanProcess.setStationNum(station.getStationNum());
@ -335,6 +343,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
} }
} }
} }
}
} }
} }

Loading…
Cancel
Save