|
|
@@ -153,8 +153,17 @@ public class DeviceServiceImpl implements IDeviceService
|
|
|
DeviceOverviewVO typeStats = deviceTypeMap.get(frontendType);
|
|
|
|
|
|
if (typeStats != null) {
|
|
|
- typeStats.setOnline(((Number) stat.get("online")).intValue());
|
|
|
- typeStats.setOffline(((Number) stat.get("offline")).intValue());
|
|
|
+ // 原有值
|
|
|
+ int oldOnline = typeStats.getOnline() != null ? typeStats.getOnline() : 0;
|
|
|
+ int oldOffline = typeStats.getOffline() != null ? typeStats.getOffline() : 0;
|
|
|
+
|
|
|
+ // 新增值
|
|
|
+ int addOnline = stat.get("online") != null ? ((Number) stat.get("online")).intValue() : 0;
|
|
|
+ int addOffline = stat.get("offline") != null ? ((Number) stat.get("offline")).intValue() : 0;
|
|
|
+
|
|
|
+ // 累加
|
|
|
+ typeStats.setOnline(oldOnline + addOnline);
|
|
|
+ typeStats.setOffline(oldOffline + addOffline);
|
|
|
}
|
|
|
}
|
|
|
}
|