Browse Source

视频上下行列表修改

develop
lau572 8 months ago
parent
commit
30b5b8ce37
  1. 6
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
  2. 21
      zc-business/src/main/java/com/zc/business/controller/VideoController.java

6
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()

21
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<String,Object> result = new HashMap<>();
//上行列表
//上行列表(包含双向)
List<Map<String,Object>> 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<Map<String,Object>> 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);

Loading…
Cancel
Save