|
|
|
@ -496,47 +496,13 @@ public class DataImportServiceImpl implements DataImportService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<MonitorRet> getMonitorInfo () {
|
|
|
|
|
List<MonitorRet> monitorInfoList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
Map<String, String> monitorMap = new HashMap<>();
|
|
|
|
|
monitorMap.put("监测点1", "50");
|
|
|
|
|
monitorMap.put("监测点2", "45");
|
|
|
|
|
monitorMap.put("监测点3", "40");
|
|
|
|
|
monitorMap.put("监测点4", "35");
|
|
|
|
|
monitorMap.put("监测点5", "30");
|
|
|
|
|
monitorMap.put("监测点6", "25");
|
|
|
|
|
monitorMap.put("监测点7", "20");
|
|
|
|
|
monitorMap.put("监测点8", "15");
|
|
|
|
|
monitorMap.put("监测点9", "10");
|
|
|
|
|
monitorMap.put("监测点10", "5");
|
|
|
|
|
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点1", 104.06, 30.67, "50")); // 成都
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点2", 104.76, 31.46, "45")); // 绵阳
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点3", 105.06, 30.87, "40")); // 德阳
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点4", 105.36, 30.57, "35")); // 广元
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点5", 106.06, 29.37, "30")); // 遂宁
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点6", 106.76, 29.07, "25")); // 内江
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点7", 107.06, 28.77, "20")); // 乐山
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点8", 107.36, 28.47, "15")); // 眉山
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点9", 107.66, 28.17, "10")); // 宜宾
|
|
|
|
|
monitorInfoList.add(new MonitorRet("监测点10", 107.96, 27.87, "5")); // 泸州
|
|
|
|
|
|
|
|
|
|
// 使用Collections.sort和自定义的Comparator进行排序
|
|
|
|
|
Collections.sort(monitorInfoList, new Comparator<MonitorRet>() {
|
|
|
|
|
@Override
|
|
|
|
|
public int compare(MonitorRet o1, MonitorRet o2) {
|
|
|
|
|
// 提取值并转换为整数
|
|
|
|
|
int value1 = Integer.parseInt(o1.getMonitorValue());
|
|
|
|
|
int value2 = Integer.parseInt(o2.getMonitorValue());
|
|
|
|
|
// 降序排序
|
|
|
|
|
return Integer.compare(value2, value1);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return null;
|
|
|
|
|
try{
|
|
|
|
|
List<MonitorRet> monitorRetList = new ArrayList<>();
|
|
|
|
|
monitorRetList = tSamplingDataDetailsMapper.getMonitorInfo();
|
|
|
|
|
return monitorRetList;
|
|
|
|
|
}catch (ParamsException e){
|
|
|
|
|
throw new RuntimeException("数据库获取失败", e);
|
|
|
|
|
}
|
|
|
|
|
return monitorInfoList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|