From 18a0416a28ba6d79297c012bc2a2cc76d300ade4 Mon Sep 17 00:00:00 2001 From: Kelvin Date: Thu, 19 Dec 2024 09:14:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=87=AA=E5=8A=A8=E5=88=86?= =?UTF-8?q?=E9=85=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ktg/mes/wm/controller/WmsInTaskController.java | 2 +- .../ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java | 3 ++- .../java/com/ktg/mes/wm/service/impl/WmsInTaskServiceImpl.java | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) 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());