Browse Source

rev:设备校验

master
刘先源 2 weeks ago
parent
commit
414ecdaea1
  1. 12
      acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java
  2. 9
      acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java

12
acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/AgvWaitUtil.java

@ -42,9 +42,8 @@ public class AgvWaitUtil {
log.info("仙工AGV请求取货,设备号 - {}", deviceCode); log.info("仙工AGV请求取货,设备号 - {}", deviceCode);
boolean flag = false; boolean flag = false;
JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0);
Device device = this.deviceAppService.findDeviceByCode(deviceCode); Device device = this.deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("请求失败,未找到设备!"); throw new BadRequestException("请求失败,未找到设备!");
} }
@ -85,9 +84,8 @@ public class AgvWaitUtil {
log.info("仙工AGV取货完成后请求离开,设备号 - {}", deviceCode); log.info("仙工AGV取货完成后请求离开,设备号 - {}", deviceCode);
boolean flag = false; boolean flag = false;
JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0);
Device device = this.deviceAppService.findDeviceByCode(deviceCode); Device device = this.deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("请求失败,未找到设备!"); throw new BadRequestException("请求失败,未找到设备!");
} }
@ -128,9 +126,8 @@ public class AgvWaitUtil {
log.info("仙工AGV请求放货,设备号 - {}", deviceCode); log.info("仙工AGV请求放货,设备号 - {}", deviceCode);
boolean flag = false; boolean flag = false;
JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0);
Device device = this.deviceAppService.findDeviceByCode(deviceCode); Device device = this.deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("请求失败,未找到设备!"); throw new BadRequestException("请求失败,未找到设备!");
} }
@ -177,9 +174,8 @@ public class AgvWaitUtil {
log.info("仙工AGV放货完成后请求离开,设备号 - {}", deviceCode); log.info("仙工AGV放货完成后请求离开,设备号 - {}", deviceCode);
boolean flag = false; boolean flag = false;
JSONObject jsonDevice = WQLObject.getWQLObject("acs_storage_cell").query("storage_code = '" + deviceCode + "'").uniqueResult(0);
Device device = this.deviceAppService.findDeviceByCode(deviceCode); Device device = this.deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(device) && ObjectUtil.isEmpty(jsonDevice)) { if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("请求失败,未找到设备!"); throw new BadRequestException("请求失败,未找到设备!");
} }

9
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)) { if (StrUtil.isBlank(address)) {
throw new BadRequestException("请求失败,地址为空!"); throw new BadRequestException("请求失败,地址为空!");
} }
WQLObject tab = WQLObject.getWQLObject("acs_storage_cell");
if (address.contains("IN")) { if (address.contains("IN")) {
String deviceCodeNow = address.substring(0, address.length() - 5); String deviceCodeNow = address.substring(0, address.length() - 5);
JSONObject jsonDevice = tab.query("storage_code = '" + deviceCodeNow + "'").uniqueResult(0); if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) {
if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow)) && ObjectUtil.isEmpty(jsonDevice)) {
throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!");
} }
@ -910,9 +907,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
} }
if (address.contains("OUT")) { if (address.contains("OUT")) {
String deviceCodeNow = address.substring(0, address.length() - 6); String deviceCodeNow = address.substring(0, address.length() - 6);
JSONObject jsonDevice = tab.query("storage_code = '" + deviceCodeNow + "'").uniqueResult(0); if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) {
if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow)) && ObjectUtil.isEmpty(jsonDevice)) {
throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!"); throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!");
} }

Loading…
Cancel
Save