浏览代码

未登录获取场景列表

lyhzzz 2 年之前
父节点
当前提交
b9a52cee97

+ 1 - 0
src/main/java/com/fdkankan/fusion/request/ScenePram.java

@@ -12,6 +12,7 @@ public class ScenePram extends RequestBase {
     private List<String> numList;
     private Integer haveVoid = 0;
     private Integer status; //
+    private Integer caseId;
 
     private List<String> snCodes;
 

+ 12 - 6
src/main/java/com/fdkankan/fusion/service/impl/SceneService.java

@@ -1,5 +1,6 @@
 package com.fdkankan.fusion.service.impl;
 
+import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -77,12 +78,17 @@ public class SceneService implements ISceneService {
         if(param.getType() == null){
            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
-        List<TmCamera> tmCameraList = tmCameraService.getByDeptIds();
-        List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
-        if(CollectionUtil.isEmpty(snCodes)){
-            snCodes = Arrays.asList("no_snCode");
+        List<TmCamera> tmCameraList = null;
+        String tokenValue = StpUtil.getTokenValue();
+
+        if(StringUtils.isNotBlank(tokenValue)){
+            tmCameraList = tmCameraService.getByDeptIds();
+            List<String> snCodes = tmCameraList.stream().map(TmCamera::getCameraSn).collect(Collectors.toList());
+            if(CollectionUtil.isEmpty(snCodes)){
+                snCodes = Arrays.asList("no_snCode");
+            }
+            param.setSnCodes(snCodes);
         }
-        param.setSnCodes(snCodes);
         List<SceneVo> sceneVoList = new ArrayList<>();
         long total = 0;
         if(param.getType() == 0 || param.getType() == 1 || param.getType() == 4){      //看看,看见 ,深时obj
@@ -110,7 +116,7 @@ public class SceneService implements ISceneService {
             laserSceneParam.setPageNum(param.getPageNum());
             laserSceneParam.setPageSize(param.getPageSize());
             laserSceneParam.setStatus(param.getStatus());
-            laserSceneParam.setSnCodes(snCodes);
+            laserSceneParam.setSnCodes(param.getSnCodes());
             if(StringUtils.isNotBlank(param.getSceneName())){
                 laserSceneParam.setTitle(param.getSceneName());
             }

+ 2 - 2
src/main/resources/application-test.yaml

@@ -3,8 +3,8 @@ spring:
     type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
     driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
     #120.25.146.52
-    #url: jdbc:mysql://120.25.146.52:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
-    url: jdbc:mysql://127.0.0.1:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    url: jdbc:mysql://120.25.146.52:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    #url: jdbc:mysql://127.0.0.1:13306/fd_fusion?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
     username: root
     password: JK123456%JIK
     hikari: