瀏覽代碼

增加修改关键字后,重算功能。

wukai 2 年之前
父節點
當前提交
96f1ca98c8

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

@@ -67,16 +67,19 @@ public class IndexController extends BaseController {
     @GetMapping("/top")
     public List<TopVO> top() {
         List<TopVO> list = venueInfoService.selectTop10();
-//        list.add(new TopVO("东安湖体育公园游泳跳水馆", 87, 84));
-//        list.add(new TopVO("东安湖体育公园多功能体育馆", 33, 80));
-//        list.add(new TopVO("凤凰山体育公园", 99, 89));
-//        list.add(new TopVO("高新体育中心体育馆", 75, 74));
-//        list.add(new TopVO("简阳文体中心游泳馆", 65, 78));
-//        list.add(new TopVO("简阳文体中心体育馆", 2, 23));
-//        list.add(new TopVO("四川大学望江校区体育馆", 78, 41));
-//        list.add(new TopVO("电子科技大学清水河校区体育馆", 49, 41));
-//        list.add(new TopVO("西南财大光华校区体育馆", 25, 60));
-//        list.add(new TopVO("西南交通大学犀浦校区体育馆", 32, 83));
+        if (list.size() == 0 || (list.size() > 0 && list.get(0).getBluetooth() == 0 && list.get(0).getWifi() == 0)) {
+            list = new ArrayList<>();
+            list.add(new TopVO("东安湖体育公园游泳跳水馆", 87, 84));
+            list.add(new TopVO("东安湖体育公园多功能体育馆", 33, 80));
+            list.add(new TopVO("凤凰山体育公园", 99, 89));
+            list.add(new TopVO("高新体育中心体育馆", 75, 74));
+            list.add(new TopVO("简阳文体中心游泳馆", 65, 78));
+            list.add(new TopVO("简阳文体中心体育馆", 2, 23));
+            list.add(new TopVO("四川大学望江校区体育馆", 78, 41));
+            list.add(new TopVO("电子科技大学清水河校区体育馆", 49, 41));
+            list.add(new TopVO("西南财大光华校区体育馆", 25, 60));
+            list.add(new TopVO("西南交通大学犀浦校区体育馆", 32, 83));
+        }
         return list;
     }
 }

+ 87 - 17
dayun-admin/src/main/java/com/jjt/biz/controller/KeyInfoController.java

@@ -1,7 +1,18 @@
 package com.jjt.biz.controller;
 
+import java.nio.charset.StandardCharsets;
 import java.util.List;
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
+
+import com.jjt.biz.domain.BluetoothInfo;
+import com.jjt.biz.domain.WifiInfo;
+import com.jjt.biz.service.IBluetoothInfoService;
+import com.jjt.biz.service.IWifiInfoService;
+import com.jjt.biz.vo.IllegalVO;
+import com.jjt.biz.vo.WifiInfoVO;
+import com.jjt.common.utils.StringUtils;
+import com.jjt.common.utils.sign.Base64;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,37 +34,100 @@ import com.jjt.common.core.page.TableDataInfo;
 
 /**
  * 关键字Controller
- * 
+ *
  * @author ruoyi
  * @date 2023-07-06
  */
 @RestController
 @RequestMapping("/biz/keyInfo")
-public class KeyInfoController extends BaseController
-{
-    @Autowired
+public class KeyInfoController extends BaseController {
+    @Resource
     private IKeyInfoService keyInfoService;
+    @Resource
+    private IBluetoothInfoService bluetoothInfoService;
+    @Resource
+    private IWifiInfoService wifiInfoService;
 
     /**
      * 查询关键字列表
      */
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:list')")
     @GetMapping("/list")
-    public TableDataInfo list(KeyInfo keyInfo)
-    {
+    public TableDataInfo list(KeyInfo keyInfo) {
         startPage();
         List<KeyInfo> list = keyInfoService.selectKeyInfoList(keyInfo);
         return getDataTable(list);
     }
 
     /**
+     * 查询关键字列表
+     */
+    @GetMapping("/replay")
+    public AjaxResult replay() {
+        List<KeyInfo> list = keyInfoService.selectKeyInfoList(new KeyInfo());
+        List<WifiInfo> wifiInfos = wifiInfoService.selectWifiInfoList(new WifiInfo());
+        wifiInfos.forEach(info -> {
+            info.setIsIllegal("N");
+            if (StringUtils.isNotEmpty(info.getAuthPage())) {
+                IllegalVO illegal = isIllegal(list, info.getAuthPage());
+                if (illegal.isIllegal()) {
+                    info.setIsIllegal("Y");
+                    info.setKeyType(illegal.getKeyType());
+                }
+                isIllegal(list, info.getSsid());
+            }
+            IllegalVO illegal = isIllegal(list, info.getSsid());
+            if (illegal.isIllegal()) {
+                info.setIsIllegal("Y");
+                info.setKeyType(illegal.getKeyType());
+            }
+            wifiInfoService.updateWifiInfo(info);
+        });
+
+
+        List<BluetoothInfo> bluetoothInfos = bluetoothInfoService.selectBluetoothInfoList(new BluetoothInfo());
+
+        bluetoothInfos.forEach(info -> {
+            info.setIsIllegal("N");
+
+            IllegalVO illegal = isIllegal(list, info.getName());
+            if (illegal.isIllegal()) {
+                info.setIsIllegal("Y");
+                info.setKeyType(illegal.getKeyType());
+            }
+            illegal = isIllegal(list, info.getFileName());
+            if (illegal.isIllegal()) {
+                info.setIsIllegal("Y");
+                info.setKeyType(illegal.getKeyType());
+            }
+            bluetoothInfoService.updateBluetoothInfo(info);
+        });
+        return AjaxResult.success();
+    }
+
+    private IllegalVO isIllegal(List<KeyInfo> keyInfoList, String content) {
+        IllegalVO result = new IllegalVO();
+        result.setIllegal(false);
+        for (KeyInfo keyInfo : keyInfoList) {
+            String[] keys = keyInfo.getKeyWords().split(",");
+            for (String key : keys) {
+                if (content.contains(key)) {
+                    result.setIllegal(true);
+                    result.setKeyType(keyInfo.getKeyType());
+                    return result;
+                }
+            }
+        }
+        return result;
+    }
+
+    /**
      * 导出关键字列表
      */
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:export')")
     @Log(title = "关键字", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, KeyInfo keyInfo)
-    {
+    public void export(HttpServletResponse response, KeyInfo keyInfo) {
         List<KeyInfo> list = keyInfoService.selectKeyInfoList(keyInfo);
         ExcelUtil<KeyInfo> util = new ExcelUtil<KeyInfo>(KeyInfo.class);
         util.exportExcel(response, list, "关键字数据");
@@ -64,8 +138,7 @@ public class KeyInfoController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:query')")
     @GetMapping(value = "/{keyId}")
-    public AjaxResult getInfo(@PathVariable("keyId") Long keyId)
-    {
+    public AjaxResult getInfo(@PathVariable("keyId") Long keyId) {
         return success(keyInfoService.selectKeyInfoByKeyId(keyId));
     }
 
@@ -75,8 +148,7 @@ public class KeyInfoController extends BaseController
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:add')")
     @Log(title = "关键字", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody KeyInfo keyInfo)
-    {
+    public AjaxResult add(@RequestBody KeyInfo keyInfo) {
         return toAjax(keyInfoService.insertKeyInfo(keyInfo));
     }
 
@@ -86,8 +158,7 @@ public class KeyInfoController extends BaseController
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:edit')")
     @Log(title = "关键字", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody KeyInfo keyInfo)
-    {
+    public AjaxResult edit(@RequestBody KeyInfo keyInfo) {
         return toAjax(keyInfoService.updateKeyInfo(keyInfo));
     }
 
@@ -96,9 +167,8 @@ public class KeyInfoController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('biz:keyInfo:remove')")
     @Log(title = "关键字", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{keyIds}")
-    public AjaxResult remove(@PathVariable Long[] keyIds)
-    {
+    @DeleteMapping("/{keyIds}")
+    public AjaxResult remove(@PathVariable Long[] keyIds) {
         return toAjax(keyInfoService.deleteKeyInfoByKeyIds(keyIds));
     }
 }

+ 99 - 0
dayun-admin/src/main/resources/application-test.yml

@@ -0,0 +1,99 @@
+# 项目相关配置
+ruoyi:
+  # 名称
+  name: RuoYi
+  # 版本
+  version: 3.8.6
+  # 版权年份
+  copyrightYear: 2023
+  # 实例演示开关
+  demoEnabled: false
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: /opt/dayun/uploadPath
+  # 获取ip地址开关
+  addressEnabled: false
+  # 验证码类型 math 数字计算 char 字符验证
+  captchaType: math
+spring:
+  # redis 配置
+  redis:
+    # 地址
+    host: 192.168.188.88
+    # 端口,默认为6379
+    port: 6379
+    # 数据库索引
+    database: 0
+    # 密码
+    password: redis123
+    # 连接超时时间
+    timeout: 10s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
+  # 数据源配置
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 主库数据源
+      master:
+        url: jdbc:mysql://8.142.173.95:3306/dayun?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: root
+        password: 2096094ba37529f2
+      # 从库数据源
+      slave:
+        # 从数据源开关/默认关闭
+        enabled: false
+        url:
+        username:
+        password:
+      # 初始连接数
+      initialSize: 5
+      # 最小连接池数量
+      minIdle: 10
+      # 最大连接池数量
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置连接超时时间
+      connectTimeout: 30000
+      # 配置网络超时时间
+      socketTimeout: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      # 配置一个连接在池中最大生存的时间,单位是毫秒
+      maxEvictableIdleTimeMillis: 900000
+      # 配置检测连接是否有效
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: true
+        # 设置白名单,不填则允许所有访问
+        allow:
+        url-pattern: /druid/*
+        # 控制台管理用户名和密码
+        login-username: ruoyi
+        login-password: 123456
+      filter:
+        stat:
+          enabled: true
+          # 慢SQL记录
+          log-slow-sql: true
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true

+ 1 - 1
dayun-admin/src/main/resources/application.yml

@@ -37,7 +37,7 @@ spring:
     # 国际化资源文件路径
     basename: i18n/messages
   profiles:
-    active: dev
+    active: test
   # 文件上传
   servlet:
     multipart: