生产计划自动化-查询条件修改 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());
// 工位设备包含工序设备即匹配成功
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<ZyDevice> machineList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>()
.in(ZyDevice::getId, stationMachineIds)
.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.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()));
if (!ObjectUtils.isEmpty(stationMachineList)) {
//工位设备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<String> 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<ZyDevice> machineList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>()
.in(ZyDevice::getId, 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.setStationName(station.getStationName());
zyPlanProcess.setStationNum(station.getStationNum());
this.updateById(zyPlanProcess);
return;
}
}
}
}

Loading…
Cancel
Save