Commit 8640ccc96d0db0ea7d5734c7ba49f0e6dfd34139

Authored by 肖超群
1 parent aa020577

修改库位分配

huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/LocationAllocationServiceImpl.java
... ... @@ -221,9 +221,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
221 221 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery();
222 222 locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode).eq(Location::getWarehouseCode, warehouseCode).eq(Location::getRoadWay, roadWay)
223 223 .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY).ge(Location::getHigh, high)
224   - .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode)
225   - .in(Location::getLocationTypeCode, locationTypeCodeList).eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING)
226   - .orderByAsc(true, Location::getHigh).orderByAsc(true, Location::getLayer).orderByAsc(true, Location::getId);
  224 + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode).in(Location::getLocationTypeCode, locationTypeCodeList)
  225 + .eq(Location::getContainerCode, QuantityConstant.EMPTY_STRING).orderByAsc(true, Location::getHigh).orderByAsc(true, Location::getLayer)
  226 + .orderByAsc(true, Location::getId);
227 227 // 单伸位逻辑简单,只需要找到一个空闲库位
228 228 Page page = new Page<Location>(1, 1);
229 229 IPage iPage = locationService.page(page, locationLambdaQueryWrapper);
... ... @@ -321,13 +321,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
321 321 }
322 322 Collections.shuffle(roadWays);// 打乱巷道排序
323 323 int roadWay = roadWays.get(0);
324   -// if (roadWays.size() == 1) {
325   -// return roadWay;
326   -// }
327   -// roadWays = locationAllocationService.removeRoadWaysByPreLocations(roadWays, zoneCode, warehouseCode);
328   -// if (roadWays.size() == 0) {
329   -// return roadWay;
330   -// }
  324 + if (roadWays.size() == 1) {
  325 + return roadWay;
  326 + }
331 327 int min = Integer.MAX_VALUE;
332 328 List<InventoryDetail> inventoryDetailList = inventoryDetailService.getInventoryDetailListByMaterialCodeAndZoneCode(materialCode, zoneCode, warehouseCode);
333 329 if (inventoryDetailList.size() != 0) {
... ...