diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceOnlineController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceOnlineController.java index f1d1e1aa..a3088b5f 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceOnlineController.java +++ b/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 allMap = new HashMap<>(); @@ -333,8 +333,8 @@ public class DcDeviceOnlineController extends BaseController { Map totalOfflineMap = Collections.unmodifiableMap(new HashMap() {{ 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 sortMap = new TreeMap<>(); String orderRule = redisCache.getCacheObject(ORDERRULE);