库位寻找策略修改

This commit is contained in:
梁州 2025-03-04 21:48:43 +08:00
parent ec9df671e2
commit 5697b09754

View File

@ -124,8 +124,10 @@ public class AppLocationServiceImpl implements IAppLocationService {
AppLocation resultLocation = null;
// 可用库位列表
List<AppLocation> availableLocationList = appLocationList.stream().filter(item ->
item.getIsWorking() == 0 && item.getIsLock() == 0 && item.getLocationStatus() == 0).sorted(Comparator
.comparingInt(AppLocation::getwCol).thenComparingInt(AppLocation::getwLayer).thenComparingInt(AppLocation::getwDepth)).collect(Collectors.toList());
item.getIsWorking() == 0 && item.getIsLock() == 0 && item.getLocationStatus() == 0)
.sorted(Comparator.comparingInt(AppLocation::getwDepth).reversed())
.sorted(Comparator.comparingInt(location -> location.getwCol() + location.getwLayer()))
.collect(Collectors.toList());
// 排序
for (AppLocation appLocation : availableLocationList) {
if (appLocation.getIsWorking() == 1 || appLocation.getIsLock() == 1 || appLocation.getLocationStatus() == 1) {