fix 立库设备反馈设备状态
This commit is contained in:
@@ -74,6 +74,7 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
String load = "";
|
String load = "";
|
||||||
String alarm = "";
|
String alarm = "";
|
||||||
String task_id = "";
|
String task_id = "";
|
||||||
|
String last_task_id = "";
|
||||||
|
|
||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
Boolean last_iserror = false;
|
Boolean last_iserror = false;
|
||||||
@@ -118,7 +119,7 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
}
|
}
|
||||||
public void setIserror(Boolean iserror) {
|
public void setIserror(Boolean iserror) {
|
||||||
this.iserror = iserror;
|
this.iserror = iserror;
|
||||||
if (this.iserror != this.last_iserror && device_id.startsWith("RGV")) {
|
if (this.iserror != this.last_iserror) {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", this.device_id);
|
param.put("device_code", this.device_id);
|
||||||
param.put("error", alarm);
|
param.put("error", alarm);
|
||||||
@@ -128,6 +129,20 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
param.put("product_area", paramService.findByCode("productArea").getValue());
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
acsToWmsService.sendDeviceStatus(param);
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
}
|
}
|
||||||
this.last_iserror = iserror;
|
this.last_iserror = this.iserror;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTask_id(String task_id) {
|
||||||
|
this.task_id = task_id;
|
||||||
|
if (!StrUtil.equals(this.task_id, this.last_task_id)) {
|
||||||
|
JSONObject param = new JSONObject();
|
||||||
|
param.put("device_code", this.device_id);
|
||||||
|
param.put("mode", StrUtil.isBlank(this.task_id) ? 2 : 3);
|
||||||
|
param.put("device_name", this.getDevice().getDevice_name());
|
||||||
|
param.put("device_type", "1");
|
||||||
|
param.put("product_area", paramService.findByCode("productArea").getValue());
|
||||||
|
acsToWmsService.sendDeviceStatus(param);
|
||||||
|
}
|
||||||
|
this.last_task_id = this.task_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user