diff --git a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java index 9049d8a..cf24be9 100644 --- a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java +++ b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java @@ -42,9 +42,8 @@ public class AgvWaitUtil { log.info("仙工AGV请求取货,设备号 - {}", deviceCode); boolean flag = false; - JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0); Device device = this.deviceAppService.findDeviceByCode(deviceCode); - if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(device)) { throw new BadRequestException("请求失败,未找到设备!"); } @@ -85,9 +84,8 @@ public class AgvWaitUtil { log.info("仙工AGV取货完成后请求离开,设备号 - {}", deviceCode); boolean flag = false; - JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0); Device device = this.deviceAppService.findDeviceByCode(deviceCode); - if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(device)) { throw new BadRequestException("请求失败,未找到设备!"); } @@ -128,9 +126,8 @@ public class AgvWaitUtil { log.info("仙工AGV请求放货,设备号 - {}", deviceCode); boolean flag = false; - JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0); Device device = this.deviceAppService.findDeviceByCode(deviceCode); - if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(device)) { throw new BadRequestException("请求失败,未找到设备!"); } @@ -177,9 +174,8 @@ public class AgvWaitUtil { log.info("仙工AGV放货完成后请求离开,设备号 - {}", deviceCode); boolean flag = false; - JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0); Device device = this.deviceAppService.findDeviceByCode(deviceCode); - if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(device)) { throw new BadRequestException("请求失败,未找到设备!"); } diff --git a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index c738b9e..78d9a5e 100644 --- a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -892,13 +892,10 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (StrUtil.isBlank(address)) { throw new BadRequestException("请求失败,地址为空!"); } - WQLObject tab = WQLObject.getWQLObject("acs_storage_cell"); if (address.contains("IN")) { String deviceCodeNow = address.substring(0, address.length() - 5); - JSONObject jsonDevice = tab.query("storage_code = '" + deviceCodeNow + "'").uniqueResult(0); - - if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow)) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); } @@ -910,9 +907,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } if (address.contains("OUT")) { String deviceCodeNow = address.substring(0, address.length() - 6); - JSONObject jsonDevice = tab.query("storage_code = '" + deviceCodeNow + "'").uniqueResult(0); - - if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow)) && ObjectUtil.isEmpty(jsonDevice)) { + if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) { throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); }