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

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

@ -469,13 +469,20 @@ 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)
zyPlanProcess.setStationId(station.getId()); );
zyPlanProcess.setStationName(station.getStationName()); if (!ObjectUtils.isEmpty(machineList)) {
zyPlanProcess.setStationNum(station.getStationNum()); String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(","));
return zyPlanProcess; List<String> 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;
}
} }
} }
} }

@ -317,21 +317,30 @@ 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)
zyPlanProcess.setStationId(station.getId()); );
zyPlanProcess.setStationName(station.getStationName()); if (!ObjectUtils.isEmpty(machineList)) {
zyPlanProcess.setStationNum(station.getStationNum()); String ids = machineList.stream().map(ZyDevice::getId).collect(Collectors.joining(","));
this.updateById(zyPlanProcess); List<String> collect = machineList.stream().map(ZyDevice::getId).collect(Collectors.toList());
return; zyPlanProcess.setMachineIds(ids);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(collect));
zyPlanProcess.setStationId(station.getId());
zyPlanProcess.setStationName(station.getStationName());
zyPlanProcess.setStationNum(station.getStationNum());
this.updateById(zyPlanProcess);
return;
}
} }
} }
} }

Loading…
Cancel
Save