Commit 386abac8 authored by 赵啸非's avatar 赵啸非

修改校验

parent 81563edb
......@@ -11,6 +11,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.xhx.common.code.DeviceStatusEnum;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.PlatformTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.ErrorCode;
......@@ -285,10 +286,23 @@ public class SitestatServiceImpl extends AbstractCRUDCacheServiceImpl<SitestatDa
//分别统计数据
entity.setDeviceTotal(deviceList.size());
Long onlineCount = deviceList.stream().filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue()).count();
Long offlineCount = deviceList.stream().filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue()).count();
Long unActiveCount = deviceList.stream().filter(f -> f.getDeviceStatus() == DeviceStatusEnum.未激活.getValue()).count();
Long stopCount = deviceList.stream().filter(f -> f.getEnabled() == YesNoEnum.NO.getValue()).count();
Long onlineCount = deviceList.stream()
.filter(f -> f.getDeviceStatus() > DeviceStatusEnum.未激活.getValue())
.filter(f -> f.getEnabled() == EnabledEnum.启用.getValue())
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue())
.count();
Long offlineCount = deviceList.stream()
.filter(f -> f.getDeviceStatus() > DeviceStatusEnum.未激活.getValue())
.filter(f -> f.getEnabled() == EnabledEnum.启用.getValue())
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue())
.count();
Long unActiveCount = deviceList.stream()
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.未激活.getValue())
.count();
Long stopCount = deviceList.stream()
.filter(f -> f.getDeviceStatus() > DeviceStatusEnum.未激活.getValue())
.filter(f -> f.getEnabled() == YesNoEnum.NO.getValue())
.count();
entity.setOnlineCount(onlineCount.intValue());
entity.setOfflineCount(offlineCount.intValue());
......
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