|
|
@ -160,49 +160,42 @@ public class RcsController { |
|
|
if (Strings.isNullOrEmpty(fromStoreLoc)) { |
|
|
if (Strings.isNullOrEmpty(fromStoreLoc)) { |
|
|
return R.fail("fromStoreLoc Must not be empty"); |
|
|
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 loadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
lccBasLocation |
|
|
lccBasLocation |
|
|
) |
|
|
) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.rack.eq(sourceLocation.rackId())) |
|
|
.where(lccBasLocation.locCode.eq(fromStoreLoc)) |
|
|
.where(lccBasLocation.bay.eq(sourceLocation.bay())) |
|
|
|
|
|
.where(lccBasLocation.level.eq(sourceLocation.level())) |
|
|
|
|
|
.where(lccBasLocation.cell.eq(sourceLocation.cell())) |
|
|
|
|
|
.fetchFirst(); |
|
|
.fetchFirst(); |
|
|
if (loadBasLocation == null) { |
|
|
if (loadBasLocation == null) { |
|
|
return R.fail("fromStoreLoc location not found!"); |
|
|
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")); |
|
|
String targetStoreLoc = Conv.asString(params.get("targetStoreLoc")); |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
return R.fail("targetStoreLoc Must not be empty"); |
|
|
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 unloadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
lccBasLocation |
|
|
lccBasLocation |
|
|
) |
|
|
) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.rack.eq(targetLocation.rackId())) |
|
|
.where(lccBasLocation.locCode.eq(targetStoreLoc)) |
|
|
.where(lccBasLocation.bay.eq(targetLocation.bay())) |
|
|
|
|
|
.where(lccBasLocation.level.eq(targetLocation.level())) |
|
|
|
|
|
.where(lccBasLocation.cell.eq(targetLocation.cell())) |
|
|
|
|
|
.fetchFirst(); |
|
|
.fetchFirst(); |
|
|
if (unloadBasLocation == null) { |
|
|
if (unloadBasLocation == null) { |
|
|
return R.fail("targetStoreLoc location not found!"); |
|
|
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 |
|
|
String lpn = ps.runtime.queryDSL |
|
|
@ -257,20 +250,17 @@ public class RcsController { |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
return R.fail("targetStoreLoc Must not be empty"); |
|
|
return R.fail("targetStoreLoc Must not be empty"); |
|
|
} |
|
|
} |
|
|
StoreLocation targetLocation = StoreLocation.of(targetStoreLoc, "/"); |
|
|
|
|
|
// 查找货位基础资料
|
|
|
// 查找货位基础资料
|
|
|
LccBasLocation unloadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
LccBasLocation unloadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
lccBasLocation |
|
|
lccBasLocation |
|
|
) |
|
|
) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.rack.eq(targetLocation.rackId())) |
|
|
.where(lccBasLocation.locCode.eq(targetStoreLoc)) |
|
|
.where(lccBasLocation.bay.eq(targetLocation.bay())) |
|
|
|
|
|
.where(lccBasLocation.level.eq(targetLocation.level())) |
|
|
|
|
|
.where(lccBasLocation.cell.eq(targetLocation.cell())) |
|
|
|
|
|
.fetchFirst(); |
|
|
.fetchFirst(); |
|
|
if (unloadBasLocation == null) { |
|
|
if (unloadBasLocation == null) { |
|
|
return R.fail("targetStoreLoc location not found!"); |
|
|
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); |
|
|
BasLocationVo executorVo = new BasLocationVo(ps.agv); |
|
|
@ -325,20 +315,17 @@ public class RcsController { |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
if (Strings.isNullOrEmpty(targetStoreLoc)) { |
|
|
return R.fail("targetStoreLoc Must not be empty"); |
|
|
return R.fail("targetStoreLoc Must not be empty"); |
|
|
} |
|
|
} |
|
|
StoreLocation targetLocation = StoreLocation.of(targetStoreLoc, "/"); |
|
|
|
|
|
// 查找货位基础资料
|
|
|
// 查找货位基础资料
|
|
|
LccBasLocation loadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
LccBasLocation loadBasLocation = ps.runtime.queryDSL.selectFrom( |
|
|
lccBasLocation |
|
|
lccBasLocation |
|
|
) |
|
|
) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.envId.eq(ps.envId)) |
|
|
.where(lccBasLocation.rack.eq(targetLocation.rackId())) |
|
|
.where(lccBasLocation.locCode.eq(targetStoreLoc)) |
|
|
.where(lccBasLocation.bay.eq(targetLocation.bay())) |
|
|
|
|
|
.where(lccBasLocation.level.eq(targetLocation.level())) |
|
|
|
|
|
.where(lccBasLocation.cell.eq(targetLocation.cell())) |
|
|
|
|
|
.fetchFirst(); |
|
|
.fetchFirst(); |
|
|
if (loadBasLocation == null) { |
|
|
if (loadBasLocation == null) { |
|
|
return R.fail("targetStoreLoc location not found!"); |
|
|
return R.fail("targetStoreLoc location not found!"); |
|
|
} |
|
|
} |
|
|
|
|
|
StoreLocation targetLocation = new StoreLocation(loadBasLocation.getRack(), loadBasLocation.getBay(), loadBasLocation.getLevel(), loadBasLocation.getCell()); |
|
|
|
|
|
|
|
|
// ==================== 找到托盘号 ====================
|
|
|
// ==================== 找到托盘号 ====================
|
|
|
String lpn = ps.runtime.queryDSL |
|
|
String lpn = ps.runtime.queryDSL |
|
|
|