Commit ac6b244ae60ffc3e0019db5f7a2c520c882d7be9

Authored by 易文鹏
1 parent 6ca7305f

feat:自建库位全部设置到单伸位中

src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
@@ -373,9 +373,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService @@ -373,9 +373,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
373 //自建单据 373 //自建单据
374 @Override 374 @Override
375 public String isSelfCreated(String roadWay, int high, Integer frequencyLocation, boolean isFlammable) { 375 public String isSelfCreated(String roadWay, int high, Integer frequencyLocation, boolean isFlammable) {
376 - // 获取双伸位预留库位数  
377 - int reserveNumber = getReserveNumber();  
378 - // 移除掉可用库位数小于预留库位数的巷道  
379 LambdaQueryWrapper<Location> wrapper = Wrappers.lambdaQuery(); 376 LambdaQueryWrapper<Location> wrapper = Wrappers.lambdaQuery();
380 wrapper.eq(Location::getRoadway, roadWay) 377 wrapper.eq(Location::getRoadway, roadWay)
381 .eq(Location::getStatus, STATUS_LOCATION_EMPTY) 378 .eq(Location::getStatus, STATUS_LOCATION_EMPTY)
@@ -384,26 +381,11 @@ public class LocationAllocationServiceImpl implements LocationAllocationService @@ -384,26 +381,11 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
384 .eq(Location::getContainerCode, "") 381 .eq(Location::getContainerCode, "")
385 .last(" limit 20"); 382 .last(" limit 20");
386 383
387 - List<Location> totalLocationList = locationService.list(wrapper);  
388 - //双伸位预留库位数不够了就排除掉该巷道  
389 - if (totalLocationList.size() <= reserveNumber) {  
390 - return "可能是自建单据库位不够用了,请检查预留库位数";  
391 - } 384 + List<Location> locationList = locationService.list(wrapper);
392 385
393 - // 查找外侧的库位  
394 - LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery();  
395 - locationLambda.eq(Location::getRoadway, roadWay)  
396 - .eq(Location::getStatus, STATUS_LOCATION_EMPTY)  
397 - .eq(Location::getHigh, high)  
398 - .eq(Location::getSelfCreated, SELFCREATED)  
399 - .eq(Location::getRowFlag, ROW_OUT)//外侧  
400 - .eq(Location::getContainerCode, "")  
401 - .last(" limit 20");  
402 - List<Location> locationList = locationService.list(locationLambda);  
403 List<Location> removeLocaationList = new ArrayList<>(); 386 List<Location> removeLocaationList = new ArrayList<>();
404 if (locationList != null && !locationList.isEmpty()) { 387 if (locationList != null && !locationList.isEmpty()) {
405 for (Location location1 : locationList) { 388 for (Location location1 : locationList) {
406 - //库位内侧,有未完成的任务就去掉这个库位  
407 if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) { 389 if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) {
408 removeLocaationList.add(location1); 390 removeLocaationList.add(location1);
409 } 391 }
@@ -413,31 +395,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService @@ -413,31 +395,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService
413 locationList.removeAll(removeLocaationList); 395 locationList.removeAll(removeLocaationList);
414 } 396 }
415 397
416 - // 如果没有外侧库位可分配了,再查内侧的库位  
417 - if (locationList == null || locationList.isEmpty()) {  
418 - locationLambda = Wrappers.lambdaQuery();  
419 - locationLambda  
420 - .eq(StringUtils.isNotEmpty(roadWay), Location::getRoadway, roadWay)  
421 - .eq(Location::getStatus, STATUS_LOCATION_EMPTY)  
422 - .eq(Location::getHigh, high)  
423 - .eq(Location::getSelfCreated, SELFCREATED)  
424 - .eq(Location::getRowFlag, ROW_IN)  
425 - .eq(Location::getContainerCode, "")  
426 - .last(" limit 20");  
427 - locationList = locationService.list(locationLambda);  
428 -  
429 - removeLocaationList = new ArrayList<>();  
430 - if (locationList != null && !locationList.isEmpty()) {  
431 - for (Location location1 : locationList) {  
432 - if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) {  
433 - removeLocaationList.add(location1);  
434 - }  
435 - }  
436 - }  
437 - if (locationList != null) {  
438 - locationList.removeAll(removeLocaationList);  
439 - }  
440 - }  
441 if (locationList == null || locationList.isEmpty()) { 398 if (locationList == null || locationList.isEmpty()) {
442 return null; 399 return null;
443 } 400 }
src/main/java/com/huaheng/pc/config/location/controller/LocationController.java
@@ -106,7 +106,7 @@ public class LocationController extends BaseController { @@ -106,7 +106,7 @@ public class LocationController extends BaseController {
106 .eq(StringUtils.isNotNull(location.getSystemCreated()), Location::getStatus, location.getStatus()) 106 .eq(StringUtils.isNotNull(location.getSystemCreated()), Location::getStatus, location.getStatus())
107 .eq(StringUtils.isNotEmpty(location.getZoneCode()), Location::getZoneCode, location.getZoneCode()) 107 .eq(StringUtils.isNotEmpty(location.getZoneCode()), Location::getZoneCode, location.getZoneCode())
108 .eq(StringUtils.isNotNull(location.getIRow()), Location::getIRow, location.getIRow()) 108 .eq(StringUtils.isNotNull(location.getIRow()), Location::getIRow, location.getIRow())
109 - .eq(StringUtils.isNotNull(location.getRoadway()), Location::getRoadway, location.getRoadway()) 109 + .eq(StringUtils.isNotBlank(location.getRoadway()), Location::getRoadway, location.getRoadway())
110 .eq(StringUtils.isNotNull(location.getIColumn()), Location::getIColumn, location.getIColumn()) 110 .eq(StringUtils.isNotNull(location.getIColumn()), Location::getIColumn, location.getIColumn())
111 .eq(StringUtils.isNotNull(location.getIGrid()), Location::getIGrid, location.getIGrid()) 111 .eq(StringUtils.isNotNull(location.getIGrid()), Location::getIGrid, location.getIGrid())
112 .eq(StringUtils.isNotNull(location.getILayer()), Location::getILayer, location.getILayer()) 112 .eq(StringUtils.isNotNull(location.getILayer()), Location::getILayer, location.getILayer())