From 30b5b8ce373303ff8ed687fb3f897cd7a6c29a73 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Mon, 8 Apr 2024 16:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=B8=8A=E4=B8=8B=E8=A1=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/config/SecurityConfig.java | 6 +++--- .../business/controller/VideoController.java | 21 +++++++------------ .../service/impl/DcBoardServiceImpl.java | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index f76628c4..ead83dcd 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -116,7 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage","/dc/**").anonymous() + .antMatchers("/login", "/register", "/captchaImage").anonymous() .antMatchers( HttpMethod.GET, "/", @@ -126,8 +126,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/**/*.js", "/profile/**" ).permitAll() - .antMatchers("/swagger-ui.html").anonymous() - .antMatchers("/swagger-resources/**").anonymous() +// .antMatchers("/swagger-ui.html").anonymous() +// .antMatchers("/swagger-resources/**").anonymous() .antMatchers("/webjars/**").anonymous() .antMatchers("/*/api-docs").anonymous() .antMatchers("/druid/**").anonymous() diff --git a/zc-business/src/main/java/com/zc/business/controller/VideoController.java b/zc-business/src/main/java/com/zc/business/controller/VideoController.java index 2021f8a4..7c374ad6 100644 --- a/zc-business/src/main/java/com/zc/business/controller/VideoController.java +++ b/zc-business/src/main/java/com/zc/business/controller/VideoController.java @@ -412,35 +412,30 @@ public class VideoController extends BaseController { Integer pileNumDistance = pileNumTransformMetre(pileNum); Map result = new HashMap<>(); - //上行列表 + //上行列表(包含双向) List> upCameraList = datalist.stream() - .filter(item -> "0".equals(item.get("camOrientation"))) .map(item->{ item.put("distance",Math.abs(pileNumTransformMetre(item.get("pileNum").toString()) - pileNumDistance)); return item; }) + .filter(item -> + ("0".equals(item.get("camOrientation")) || "2".equals(item.get("camOrientation"))) + && Integer.parseInt(item.get("distance").toString()) < 2000) .sorted(comparing(item -> Integer.parseInt(item.get("distance").toString()))) .collect(Collectors.toList()); - if (upCameraList.size() > 0 && Integer.parseInt(upCameraList.get(0).get("distance").toString()) < 2000){ - result.put("upCamera",upCameraList.get(0)); - } else { - result.put("upCamera",new HashMap<>()); - } + result.put("upCamera",upCameraList); + //下行列表 List> downCameraList = datalist.stream() - .filter(item -> "1".equals(item.get("camOrientation"))) .map(item->{ item.put("distance",Math.abs(pileNumTransformMetre(item.get("pileNum").toString()) - pileNumDistance)); return item; }) + .filter(item -> "1".equals(item.get("camOrientation")) && Integer.parseInt(item.get("distance").toString()) < 2000) .sorted(comparing(item -> Integer.parseInt(item.get("distance").toString()))) .collect(Collectors.toList()); - if (downCameraList.size() > 0 && Integer.parseInt(downCameraList.get(0).get("distance").toString()) < 2000){ - result.put("downCamera",downCameraList.get(0)); - } else { - result.put("downCamera",new HashMap<>()); - } + result.put("downCamera",downCameraList); return AjaxResult.success(result); diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java index 8a2c0a1f..a8c06783 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java @@ -260,7 +260,7 @@ public class DcBoardServiceImpl implements IDcBoardService { result.add(map); }else { status = "0"; - map.put("code",status); + map.put("code",status); map.put("msg",ajaxResult13.get("msg").toString()); result.add(map); }