页面返回增加isError及hasGoods
This commit is contained in:
@@ -75,6 +75,9 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
String alarm = "";
|
||||
String task_id = "";
|
||||
|
||||
Boolean iserror = false;
|
||||
Boolean hasGoods = false;
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
String flag = data.getString("option");
|
||||
@@ -108,6 +111,8 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
jo.put("alarm", alarm);
|
||||
jo.put("task_id", task_id);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError",this.getIserror());
|
||||
jo.put("hasGoods", this.getHasGoods());
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +71,16 @@ public class QueryLKDeviceStatus {
|
||||
deviceStatusDeviceDriver.setAlarm(deviceStatusData.getAlarm());
|
||||
deviceStatusDeviceDriver.setTask_id(deviceStatusData.getTaskId());
|
||||
deviceStatusDeviceDriver.setIsonline(true);
|
||||
if(!"0".equals(deviceStatusData.getAlarm())) {
|
||||
deviceStatusDeviceDriver.setIserror(true);
|
||||
}else{
|
||||
deviceStatusDeviceDriver.setIserror(false);
|
||||
}
|
||||
if(!"0".equals(deviceStatusData.getLoad())) {
|
||||
deviceStatusDeviceDriver.setHasGoods(true);
|
||||
}else{
|
||||
deviceStatusDeviceDriver.setHasGoods(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user