diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 0b1e4e2..e3570ba 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -456,13 +456,22 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); - agvurl = agvurl + ":" + agvport + "/transportOrders"; + agvurl = agvurl + ":" + agvport + "/blockGroupStatus"; + try { + HttpResponse result = HttpRequest.get(agvurl) + .body(String.valueOf(param))//表单内容 + .timeout(20000)//超时,毫秒 + .execute(); + String body = result.body(); + if (StrUtil.isNotEmpty(body)){ + JSONArray jsonArray = JSONArray.parseArray(result.body()); + return jsonArray; + } + return null; + } catch (Exception e) { + return null; + } - HttpResponse result = HttpRequest.get(agvurl) - .body(String.valueOf(param))//表单内容 - .timeout(20000)//超时,毫秒 - .execute(); - return JSONArray.parseArray(result.body()); } else { return null; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 1a6f28f..2e308dc 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -1390,7 +1390,9 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial } else if (headtype.startsWith("REAL")) { datatype = "REAL"; } - } else { + }else if (datatype.startsWith("000")){ + datatype = "Boolean"; + }else { //西门子200 if (datatype.indexOf(".") == -1) { datatype = "Byte"; diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java index 361fcfa..b1a6cea 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java @@ -58,8 +58,10 @@ public class QueryXZAgvDeviceStatus { String task_type = "0"; if (StrUtil.isNotEmpty(inst_code)) { Instruction inst = instructionService.findByCodeFromCache(inst_code); - //任务类型 - task_type = inst.getInstruction_type(); + if (ObjectUtil.isNotEmpty(inst)){ + //任务类型 + task_type = inst.getInstruction_type(); + } } //x坐标 int x = Double.valueOf(rbk_report.getString("x")).intValue(); @@ -87,8 +89,14 @@ public class QueryXZAgvDeviceStatus { MaGangAgvDeviceDriver maGangAgvDeviceDriver; if (device.getDeviceDriver() instanceof MaGangAgvDeviceDriver) { maGangAgvDeviceDriver = (MaGangAgvDeviceDriver) device.getDeviceDriver(); - maGangAgvDeviceDriver.writing("status", status); - maGangAgvDeviceDriver.writing("type", task_type); + String kepStatus = String.valueOf(maGangAgvDeviceDriver.getStatus()); + String kepType = String.valueOf(maGangAgvDeviceDriver.getType()); + if (!StrUtil.equals(kepStatus,status)){ + maGangAgvDeviceDriver.writing("status", status); + } + if (!StrUtil.equals(kepType,task_type)){ + maGangAgvDeviceDriver.writing("type", task_type); + } maGangAgvDeviceDriver.writing("x_coordinate", String.valueOf(x)); maGangAgvDeviceDriver.writing("y_coordinate", String.valueOf(y)); }