Commit d2176594 authored by wujiang's avatar wujiang

修改偏差率问题

parent 216fc36f
...@@ -2174,12 +2174,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -2174,12 +2174,23 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
if (c < 0) { if (c < 0) {
c = -c; c = -c;
} }
double lsv = c / avageValue; double pcv = c / avageValue;
lsv = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, lsv)); pcv = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, pcv));
resultMap.put("lsv", lsv); resultMap.put("pcv", pcv);
resultList.add(resultMap); resultList.add(resultMap);
} }
} }
Collections.sort(resultList, new Comparator<Map<String, Object>>() {
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
String str1 = o1.get("hlx").toString();
String str2 = o2.get("hlx").toString();
//str1在前,str2在后,默认升序,这里Integer类型的也可以
return str1.compareTo(str2);
}
});
// 构建平台数据 // 构建平台数据
DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList); DataGridMock DataGridMock = new DataGridMock(0, resultList.size(), false, 0, resultList);
ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx"); ColModel colModelEventMovement = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment