From 56e3e3fcb93ef1076e49eee2b2d6d34770046d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Thu, 2 Oct 2025 09:56:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=90=E8=A7=82=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WcsIntegrationController.java | 9 ++++----- .../service/WcsIntegrationService.java | 2 +- .../service/impl/WcsIntegrationServiceImpl.java | 14 ++++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/controller/WcsIntegrationController.java b/src/main/java/com/gaotao/modules/automatedWarehouse/controller/WcsIntegrationController.java index 9b691db..c413e7c 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/controller/WcsIntegrationController.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/controller/WcsIntegrationController.java @@ -62,15 +62,14 @@ public class WcsIntegrationController { @PostMapping(value="/checkPalletExists") @ResponseBody public R checkPalletExists(@RequestBody Map params) { - try { + Map result = wcsIntegrationService.checkPalletExists(params); return R.ok() .put("positions", result.get("positions")) .put("palletType", result.get("palletType")) - .put("locationCode", result.get("locationCode")); - } catch (Exception e) { - return R.error(e.getMessage()); - } + .put("locationCode", result.get("locationCode")) + .put("palletId", result.get("palletId")); + } /** diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/WcsIntegrationService.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/WcsIntegrationService.java index 9dd5a86..b39eb69 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/WcsIntegrationService.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/WcsIntegrationService.java @@ -17,7 +17,7 @@ public interface WcsIntegrationService { /** * 检查栈板是否存在并获取位置信息 - AI制作 */ - Map checkPalletExists(Map params) throws Exception; + Map checkPalletExists(Map params) ; /** * 获取栈板明细 - AI制作 diff --git a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java index f5375f9..d788ee8 100644 --- a/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java +++ b/src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java @@ -133,24 +133,26 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { // ==================== 打托相关方法实现 - AI制作 ==================== @Override - public Map checkPalletExists(Map params) throws Exception { + public Map checkPalletExists(Map params) { String site = (String) params.get("site"); String palletId = (String) params.get("palletId"); - + if (palletId.length() > 6) { + palletId = palletId.substring(0, 6); + } if (!StringUtils.hasText(site) || !StringUtils.hasText(palletId)) { - throw new Exception("参数不能为空"); + throw new RuntimeException("参数不能为空"); } // 检查栈板是否存在 Map palletInfo = wcsIntegrationMapper.getPalletInfo(site, palletId); if (palletInfo == null) { - throw new Exception("栈板不存在"); + throw new RuntimeException("栈板不存在"); } // 检查栈板是否正在被调用 String callingFlag = (String) palletInfo.get("calling_flag"); if ("Y".equals(callingFlag)) { - throw new Exception("栈板正在被调用中,无法进行打托操作"); + throw new RuntimeException("栈板正在被调用中,无法进行打托操作"); } // 获取栈板类型的位置信息 @@ -162,7 +164,7 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService { result.put("positions", positions); result.put("palletType", palletType); result.put("locationCode", locationCode); // 添加栈板位置信息 - + result.put("palletId", palletId); return result; }