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