|
|
@ -31,6 +31,7 @@ import javax.validation.Valid; |
|
|
|
import java.io.IOException; |
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 设备Controller |
|
|
@ -247,16 +248,19 @@ public class DcDeviceController extends BaseController { |
|
|
|
JSONObject formatValue = JSON.parseObject(jsonObject.get("formatValue").toString()); |
|
|
|
map.put("1", formatValue.get("1")); |
|
|
|
map.put("3", formatValue.get("3")); |
|
|
|
map.put("timestamp", formatValue.get("equipmentReportingTime")); |
|
|
|
map.put("timestamp", formatValue.get("equipmentReportingTime") == null? "":formatValue.get("equipmentReportingTime")); |
|
|
|
list.add(map); |
|
|
|
}); |
|
|
|
Collections.sort(list, new Comparator<Map<String, Object>>() { |
|
|
|
List<Map<String, Object>> newList = list.stream() |
|
|
|
.filter(map-> !map.get("timestamp").equals("")) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
Collections.sort(newList, 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); |
|
|
|
return AjaxResult.success(newList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|