From 06f89c58252be275949a3cffe9883c4ba40afecb Mon Sep 17 00:00:00 2001 From: yvan Date: Fri, 25 Jul 2025 21:17:11 +0800 Subject: [PATCH] =?UTF-8?q?bracket=20=E9=92=A2=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yvan/workbench/controller/RcsController.java | 45 ++++++++-------------- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/servo/src/main/java/com/yvan/workbench/controller/RcsController.java b/servo/src/main/java/com/yvan/workbench/controller/RcsController.java index 390d769..8e1eb97 100644 --- a/servo/src/main/java/com/yvan/workbench/controller/RcsController.java +++ b/servo/src/main/java/com/yvan/workbench/controller/RcsController.java @@ -160,49 +160,42 @@ public class RcsController { if (Strings.isNullOrEmpty(fromStoreLoc)) { return R.fail("fromStoreLoc Must not be empty"); } - StoreLocation sourceLocation = StoreLocation.of(fromStoreLoc, "/"); - StaticItem sourceItem = ps.runtime.getStaticItemById(sourceLocation.rackId()); - if (sourceItem == null) { - return R.fail("fromStoreLoc storePoint not found!"); - } // 查找货位基础资料 LccBasLocation loadBasLocation = ps.runtime.queryDSL.selectFrom( lccBasLocation ) .where(lccBasLocation.envId.eq(ps.envId)) - .where(lccBasLocation.rack.eq(sourceLocation.rackId())) - .where(lccBasLocation.bay.eq(sourceLocation.bay())) - .where(lccBasLocation.level.eq(sourceLocation.level())) - .where(lccBasLocation.cell.eq(sourceLocation.cell())) + .where(lccBasLocation.locCode.eq(fromStoreLoc)) .fetchFirst(); if (loadBasLocation == null) { return R.fail("fromStoreLoc location not found!"); } - + StoreLocation sourceLocation = new StoreLocation(loadBasLocation.getRack(), loadBasLocation.getBay(), loadBasLocation.getLevel(), loadBasLocation.getCell()); + StaticItem sourceItem = ps.runtime.getStaticItemById(loadBasLocation.getRack()); + if (sourceItem == null) { + return R.fail("fromStoreLoc storePoint not found!"); + } // ==================== 查找卸货货位 ==================== String targetStoreLoc = Conv.asString(params.get("targetStoreLoc")); if (Strings.isNullOrEmpty(targetStoreLoc)) { return R.fail("targetStoreLoc Must not be empty"); } - StoreLocation targetLocation = StoreLocation.of(targetStoreLoc, "/"); - StaticItem targetItem = ps.runtime.getStaticItemById(targetLocation.rackId()); - if (targetItem == null) { - return R.fail("targetStoreLoc storePoint not found!"); - } // 查找货位基础资料 LccBasLocation unloadBasLocation = ps.runtime.queryDSL.selectFrom( lccBasLocation ) .where(lccBasLocation.envId.eq(ps.envId)) - .where(lccBasLocation.rack.eq(targetLocation.rackId())) - .where(lccBasLocation.bay.eq(targetLocation.bay())) - .where(lccBasLocation.level.eq(targetLocation.level())) - .where(lccBasLocation.cell.eq(targetLocation.cell())) + .where(lccBasLocation.locCode.eq(targetStoreLoc)) .fetchFirst(); if (unloadBasLocation == null) { return R.fail("targetStoreLoc location not found!"); } + StoreLocation targetLocation = new StoreLocation(unloadBasLocation.getRack(), unloadBasLocation.getBay(), unloadBasLocation.getLevel(), unloadBasLocation.getCell()); + StaticItem targetItem = ps.runtime.getStaticItemById(unloadBasLocation.getRack()); + if (targetItem == null) { + return R.fail("targetStoreLoc storePoint not found!"); + } // ==================== 找到托盘号 ==================== String lpn = ps.runtime.queryDSL @@ -257,20 +250,17 @@ public class RcsController { if (Strings.isNullOrEmpty(targetStoreLoc)) { return R.fail("targetStoreLoc Must not be empty"); } - StoreLocation targetLocation = StoreLocation.of(targetStoreLoc, "/"); // 查找货位基础资料 LccBasLocation unloadBasLocation = ps.runtime.queryDSL.selectFrom( lccBasLocation ) .where(lccBasLocation.envId.eq(ps.envId)) - .where(lccBasLocation.rack.eq(targetLocation.rackId())) - .where(lccBasLocation.bay.eq(targetLocation.bay())) - .where(lccBasLocation.level.eq(targetLocation.level())) - .where(lccBasLocation.cell.eq(targetLocation.cell())) + .where(lccBasLocation.locCode.eq(targetStoreLoc)) .fetchFirst(); if (unloadBasLocation == null) { return R.fail("targetStoreLoc location not found!"); } + StoreLocation targetLocation = new StoreLocation(unloadBasLocation.getRack(), unloadBasLocation.getBay(), unloadBasLocation.getLevel(), unloadBasLocation.getCell()); // ==================== 找到托盘号 ==================== BasLocationVo executorVo = new BasLocationVo(ps.agv); @@ -325,20 +315,17 @@ public class RcsController { if (Strings.isNullOrEmpty(targetStoreLoc)) { return R.fail("targetStoreLoc Must not be empty"); } - StoreLocation targetLocation = StoreLocation.of(targetStoreLoc, "/"); // 查找货位基础资料 LccBasLocation loadBasLocation = ps.runtime.queryDSL.selectFrom( lccBasLocation ) .where(lccBasLocation.envId.eq(ps.envId)) - .where(lccBasLocation.rack.eq(targetLocation.rackId())) - .where(lccBasLocation.bay.eq(targetLocation.bay())) - .where(lccBasLocation.level.eq(targetLocation.level())) - .where(lccBasLocation.cell.eq(targetLocation.cell())) + .where(lccBasLocation.locCode.eq(targetStoreLoc)) .fetchFirst(); if (loadBasLocation == null) { return R.fail("targetStoreLoc location not found!"); } + StoreLocation targetLocation = new StoreLocation(loadBasLocation.getRack(), loadBasLocation.getBay(), loadBasLocation.getLevel(), loadBasLocation.getCell()); // ==================== 找到托盘号 ==================== String lpn = ps.runtime.queryDSL