diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index a19654c..f50cdf6 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -102,7 +102,7 @@ public class WmsInTaskController extends BaseController { } // 自动分配非临时库位 - WmStorageArea wmStorageArea = this.wmStorageLocationService.queryOneAreaByLocationCode("DDJ01", ucmCtBaseByCode.getAttr3() == 1); + WmStorageArea wmStorageArea = this.wmStorageLocationService.queryOneAreaByLocationCode("DDJ01", ucmCtBaseByCode.getAttr3() != null && ucmCtBaseByCode.getAttr3() == 1); wmsInTask.setCellTgt(wmStorageArea.getAreaId()); wmsInTask.setCellName(wmStorageArea.getAreaName()); wmsInTask.setCellCode(wmStorageArea.getAreaCode()); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java index 616fe40..80b09b0 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java @@ -172,7 +172,8 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService { // 过滤掉临时库位 .filter(it -> !it.getAreaCode().equals("TEMP")) .collect(Collectors.toList()); - if (wmStorageAreaList.isEmpty()) throw new RuntimeException("自动获取库位失败,无可用库位"); + if (wmStorageAreaList == null || wmStorageAreaList.isEmpty()) + throw new RuntimeException("自动获取库位失败,无可用库位"); // 返回第一个可用的库位 return wmStorageAreaList.get(0); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java index 4ed6073..0d91fc0 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java @@ -62,6 +62,7 @@ public class WmsInTaskServiceImpl implements IWmsInTaskService { return null; } for (BaseKnife baseKnife : ucmCtBase.getBaseKnifeList()) { + wmsInTaskList.clear(); WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity(); wmsInPlanDetailEntityQuery.setRfid(baseKnife.getRfid());