Browse Source

全部设备在线率

develop
王兴琳 4 weeks ago
parent
commit
77cc180f06
  1. 8
      zc-business/src/main/java/com/zc/business/controller/DcDeviceOnlineController.java

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

@ -315,8 +315,8 @@ public class DcDeviceOnlineController extends BaseController {
itemMap.put(SUCESS_RATE, formatPercentage(onlineRate*100));//在线率
itemMap.put(FAIL_RATE, formatPercentage(offlineRate*100));//离线率
// 累加总的在线和离线设备数量
/* totalOnline.addAndGet(onlineCount);
totalOffline.addAndGet(offlineCount);*/
totalOnline.addAndGet(onlineCount);
totalOffline.addAndGet(offlineCount);
returnMap.put(v, itemMap);
});
Map<String, Object> allMap = new HashMap<>();
@ -333,8 +333,8 @@ public class DcDeviceOnlineController extends BaseController {
Map<String, Long> totalOfflineMap = Collections.unmodifiableMap(new HashMap<String, Long>() {{
put(FAIL_RATE, totalOffline.get());
}});
allMap.put(SUCESS_RATE, formatPercentage((totalOnlineMap.get(SUCESS_RATE)/useDeviceList.size())*100) );
allMap.put(FAIL_RATE,formatPercentage((totalOfflineMap.get(FAIL_RATE)/useDeviceList.size())*100));
allMap.put(SUCESS_RATE, formatPercentage(((double)totalOnlineMap.get(SUCESS_RATE)/useDeviceList.size())*100) );
allMap.put(FAIL_RATE,formatPercentage(((double)totalOfflineMap.get(FAIL_RATE)/useDeviceList.size())*100));
returnMap.put(All_TYPE, allMap);
Map<String, Object> sortMap = new TreeMap<>();
String orderRule = redisCache.getCacheObject(ORDERRULE);

Loading…
Cancel
Save