|
|
@ -240,7 +240,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
|
|
|
|
Object data = JSON.parseObject(queryDeviceProperties(deviceId, propertyId, props).get("data").toString()).get("data"); |
|
|
|
JSONArray dataArray = JSON.parseArray(data.toString()); |
|
|
|
List<Object> list = new ArrayList<>(); |
|
|
|
List<Map<String, Object>> list = new ArrayList<>(); |
|
|
|
dataArray.forEach(o -> { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
JSONObject jsonObject = JSON.parseObject(o.toString()); |
|
|
@ -250,6 +250,12 @@ public class DcDeviceController extends BaseController { |
|
|
|
map.put("timestamp", formatValue.get("equipmentReportingTime")); |
|
|
|
list.add(map); |
|
|
|
}); |
|
|
|
Collections.sort(list, new Comparator<Map<String, Object>>() { |
|
|
|
@Override |
|
|
|
public int compare(Map<String, Object> map1, Map<String, Object> map2) { |
|
|
|
return map1.get("timestamp").toString().compareTo(map2.get("timestamp").toString()); |
|
|
|
} |
|
|
|
}); |
|
|
|
return AjaxResult.success(list); |
|
|
|
} |
|
|
|
|
|
|
|