|
|
@ -71,6 +71,10 @@ public class HttpService implements IHttpService{ |
|
|
|
for (int i = 0; i < dataArray.size(); i++) { |
|
|
|
LogisticsEnvironmentRecord environmentRecord = new LogisticsEnvironmentRecord(); |
|
|
|
JSONObject oneObject = dataArray.getJSONObject(i); |
|
|
|
//获取设备运行状态 0未运行,1离线,2在线
|
|
|
|
Integer deviceStatus = oneObject.getInteger("deviceStatus"); |
|
|
|
//如果设备为在线状态 将数据存入到数据库
|
|
|
|
if (2 == deviceStatus){ |
|
|
|
environmentRecord.setEquipmentNum(oneObject.getString("deviceAddr")); |
|
|
|
environmentRecord.setRecordTime(System.currentTimeMillis()); |
|
|
|
|
|
|
@ -108,6 +112,8 @@ public class HttpService implements IHttpService{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|