rev:设备校验
This commit is contained in:
@@ -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("请求失败,未找到设备!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 + " 不存在!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user