|
|
@@ -48,8 +48,27 @@ public class IotHomeServiceImpl implements IIotHomeService {
|
|
|
|
|
|
@Override
|
|
|
public IotHomeDeviceStatResVo getDeviceStatusStat() {
|
|
|
- IotDevice iotDevice = new IotDevice();
|
|
|
- return iIotDeviceService.selectHomeDeviceStatusStat(iotDevice);
|
|
|
+ IotHomeDeviceListReqVo reqVo = new IotHomeDeviceListReqVo();
|
|
|
+ List<IotHomeDeviceListResVo> deviceList = getDeviceList(reqVo);
|
|
|
+ int devNum = 0;
|
|
|
+ int onlineNum = 0;
|
|
|
+ int offlineNum = 0;
|
|
|
+
|
|
|
+ if(deviceList != null && !deviceList.isEmpty()) {
|
|
|
+ devNum = deviceList.size();
|
|
|
+ for(IotHomeDeviceListResVo item : deviceList) {
|
|
|
+ if("1".equals(item.getDevStatus())) {
|
|
|
+ onlineNum++;
|
|
|
+ } else {
|
|
|
+ offlineNum++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ IotHomeDeviceStatResVo resVo = new IotHomeDeviceStatResVo();
|
|
|
+ resVo.setDevNum(devNum);
|
|
|
+ resVo.setOnlineNum(onlineNum);
|
|
|
+ resVo.setOfflineNum(offlineNum);
|
|
|
+ return resVo;
|
|
|
}
|
|
|
|
|
|
@Override
|