Browse Source

出库规则 优先少数先出 右侧库位推荐由右向左

zhangxin 1 năm trước cách đây
mục cha
commit
2fbc26a15d

+ 3 - 3
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/WmsDocOrderSubService.java

@@ -224,7 +224,7 @@ public class WmsDocOrderSubService {
             int locationIndex = partitionLocationIdList.indexOf(locationInfo.getId());
 
             List<Long> partitionLocationRightSubList = !StringUtils.equals(partitionRowKey, Constants.LAST) ?
-                    ListUtil.sub(partitionLocationIdList, locationIndex, partitionLocationIdList.size()) : Lists.newArrayList();
+                    ListUtil.reverse(ListUtil.sub(partitionLocationIdList, locationIndex, partitionLocationIdList.size())) : Lists.newArrayList();
             List<Long> partitionLocationLeftSubList = !StringUtils.equals(partitionRowKey, Constants.FIRST)
                     ? ListUtil.sub(partitionLocationIdList, Constants.START_VALUE, locationIndex + 1) : Lists.newArrayList();
             List<Long> partitionLocationSubList = CollectionUtil.isNotEmpty(partitionLocationRightSubList) ? partitionLocationRightSubList : partitionLocationLeftSubList;
@@ -238,9 +238,9 @@ public class WmsDocOrderSubService {
                 PartitionLocationDTO partitionLocationLeftDTO = buildPartitionLocationDTO(locationInfo.getId(), quantity, baseLocationLotattList,
                         sourceInvLotLocIdList, partitionLocationLeftSubList);
                 if (ObjectUtil.isNull(partitionLocationLeftDTO)) continue;
-                qtyCount = CompareUtil.compare(partitionLocationLeftDTO.getQtyCount(), qtyCount) > 0
+                qtyCount = CompareUtil.compare(partitionLocationLeftDTO.getQtyCount(), qtyCount) < 0
                         ? partitionLocationLeftDTO.getQtyCount() : qtyCount;
-                resultLocationIdList = CompareUtil.compare(partitionLocationLeftDTO.getQtyCount(), qtyCount) > 0
+                resultLocationIdList = CompareUtil.compare(partitionLocationLeftDTO.getQtyCount(), qtyCount) < 0
                         ? partitionLocationLeftDTO.getResultLocationIdList() : resultLocationIdList;
             }
             List<Long> partitionLocationList = resultLocationIdList;