Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-dc into develop

develop
lau572 8 months ago
parent
commit
4a945f58b5
  1. 8
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

8
zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java

@ -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);
}

Loading…
Cancel
Save