瀏覽代碼

区分wifi蓝牙的总数和恶意数量

wukai 2 年之前
父節點
當前提交
fa262538d4
共有 1 個文件被更改,包括 13 次插入8 次删除
  1. 13 8
      dayun-admin/src/main/java/com/jjt/biz/controller/IndexController.java

+ 13 - 8
dayun-admin/src/main/java/com/jjt/biz/controller/IndexController.java

@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 蓝牙信息Controller
@@ -48,14 +49,18 @@ public class IndexController extends BaseController {
         Map<String, Object> map = new HashMap<>(16);
         List deviceInfos = deviceInfoService.selectDeviceInfoList(new DeviceInfo());
         map.put("deviceNO", deviceInfos.size());
-        WifiInfo wifiInfo = new WifiInfo();
-        wifiInfo.setIsIllegal("Y");
-        List wifiInfos = wifiInfoService.selectWifiInfoList(wifiInfo);
-        map.put("wifiNO", wifiInfos.size());
-        BluetoothInfo bluetoothInfo = new BluetoothInfo();
-        bluetoothInfo.setIsIllegal("Y");
-        List bluetoothInfos = bluetoothInfoService.selectBluetoothInfoList(bluetoothInfo);
-        map.put("bluetoothNO", bluetoothInfos.size());
+        List<WifiInfo> wifiInfos = wifiInfoService.selectWifiInfoList(new WifiInfo());
+        List wifis = wifiInfos.stream()
+                .filter(bean -> bean.getIsIllegal().equals("Y"))
+                .collect(Collectors.toList());
+        map.put("totalWifiNO", wifiInfos.size());
+        map.put("wifiNO", wifis.size());
+        List<BluetoothInfo> bluetoothInfos = bluetoothInfoService.selectBluetoothInfoList(new BluetoothInfo());
+        List blues = bluetoothInfos.stream()
+                .filter(bean -> bean.getIsIllegal().equals("Y"))
+                .collect(Collectors.toList());
+        map.put("totalBluetoothNO", bluetoothInfos.size());
+        map.put("bluetoothNO", blues.size());
         List venueInfos = venueInfoService.selectVenueInfoList(new VenueInfo());
         map.put("venueNO", venueInfos.size());
         return map;