From fd1211cd8d25526bfc4039bfa6547c7859e399bb Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期五, 21 六月 2024 12:40:36 +0800
Subject: [PATCH] 提交代码
---
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/projectCamera.html | 3
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectCameraController.java | 73 ++++++++++++++++++++++++
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/player.html | 22 ++++--
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html | 63 +++++++++++++++-----
4 files changed, 134 insertions(+), 27 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectCameraController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectCameraController.java
index 281b86a..516da14 100644
--- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectCameraController.java
+++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectCameraController.java
@@ -1,7 +1,13 @@
package com.javaweb.geo.controller;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -31,6 +37,10 @@
public class ProjectCameraController extends BaseController {
private String prefix = "geo/projectCamera";
+ private String appkey = "833728d15dc74335ba90ad506e80f15e";
+ private String secret = "dc02e61722ffd37198660d0644b4daa1";
+ private String postUrl ="https://open.ys7.com/api/lapp/token/get";
+
@Autowired
private IProjectCameraService projectCameraService;
@@ -59,6 +69,42 @@
List<ProjectCamera> list = projectCameraService.selectProjectCameraList(projectCamera);
return AjaxResult.success(list);
+ }
+
+
+
+ @GetMapping("/cameraPlayerUrl")
+ @ResponseBody
+ public AjaxResult cameraPlayerUrl(String id ) {
+
+ ProjectCamera projectCamera = projectCameraService.selectProjectCameraById(id);
+ String url = projectCamera.getIp();
+
+ Map<String, Object> paramMap = new HashMap<>();
+ paramMap.put("appKey", appkey);
+ paramMap.put("appSecret", secret);
+
+ HttpResponse response = HttpRequest.post(postUrl)
+ .form(paramMap) // 琛ㄥ崟鍙傛暟
+ .execute();
+
+ String body = response.body();
+ JSONObject jsonObject = JSONUtil.parseObj(body);
+ String code = jsonObject.getStr("code");
+ StringBuffer buffer = new StringBuffer();
+ if(code.equals("200")){
+ JSONObject data = (JSONObject) jsonObject.get("data");
+ String token = data.getStr("accessToken");
+ buffer.append("https://open.ys7.com/console/jssdk/pc.html?accessToken=");
+ buffer.append(token);
+ buffer.append("&url=");
+ buffer.append(url);
+ }
+
+ logger.debug(buffer.toString());
+ AjaxResult ajaxResult = AjaxResult.success();
+ ajaxResult.put("url",buffer.toString());
+ return ajaxResult;
}
/**
@@ -107,10 +153,35 @@
*/
@GetMapping("/player")
public String player( String id, ModelMap mmap) {
+ ProjectCamera projectCamera = projectCameraService.selectProjectCameraById(id);
+ String url = projectCamera.getIp();
+
+ Map<String, Object> paramMap = new HashMap<>();
+ paramMap.put("appKey", appkey);
+ paramMap.put("appSecret", secret);
+
+ HttpResponse response = HttpRequest.post(postUrl)
+ .form(paramMap) // 琛ㄥ崟鍙傛暟
+ .execute();
+
+ String body = response.body();
+ JSONObject jsonObject = JSONUtil.parseObj(body);
+ String code = jsonObject.getStr("code");
+ StringBuffer buffer = new StringBuffer();
+ if(code.equals("200")){
+ JSONObject data = (JSONObject) jsonObject.get("data");
+ String token = data.getStr("accessToken");
+ buffer.append("https://open.ys7.com/console/jssdk/pc.html?accessToken=");
+ buffer.append(token);
+ buffer.append("&url=");
+ buffer.append(url);
+ }
+
+ logger.debug(buffer.toString());
mmap.put("id", id);
+ mmap.put("playerUrl", buffer.toString());
return prefix + "/player";
}
-
/**
* 淇敼淇濆瓨鐩戞帶璁惧
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
index 0d09f3b..311cff5 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/info.html
@@ -122,6 +122,39 @@
<el-col :span="10" >
<el-card class="box-card card-yellow" style="height: 320px;margin-right: 20px;">
<div slot="header" class="clearfix">
+ <span>閽诲瓟鍒嗗竷鍥�</span>
+ </div>
+ <div>
+ <el-image :src="src"
+ :preview-src-list="srcList">
+ <div slot="placeholder" class="image-slot">
+ 鍔犺浇涓�<span class="dot">...</span>
+ </div>
+ </el-image>
+ </div>
+ </el-card>
+ </el-col>
+
+ <el-col :span="6" >
+ <el-card class="box-card card-red" style="height: 320px;">
+ <div slot="header" class="clearfix">
+ <span>鍦哄湴杩涘害(%)</span>
+ </div>
+ <div>
+ <div style="padding-left: 20%;">
+ <el-progress type="dashboard" color="#FF0000" :percentage=holeProcess>
+ </el-progress>
+ </div>
+ </div>
+ </el-card>
+ </el-col>
+
+ </el-row>
+
+ <el-row style="height: 200px;">
+ <el-col :span="24" >
+ <el-card class="box-card card-blue" style="height: 320px;margin-top: 20px">
+ <div slot="header" class="clearfix">
<span>閽诲瓟杩涘害</span>
</div>
<div style="height: 250px;">
@@ -144,26 +177,10 @@
</el-card>
</el-col>
- <el-col :span="6" >
- <el-card class="box-card card-red" style="height: 320px;">
- <div slot="header" class="clearfix">
- <span>鍦哄湴杩涘害(%)</span>
- </div>
- <div>
- <div style="padding-left: 20%;">
- <el-progress type="dashboard" color="#FF0000" :percentage=holeProcess>
- </el-progress>
- </div>
- </div>
- </el-card>
- </el-col>
-
-
-
</el-row>
+
<el-row style="height: 200px;">
<el-col :span="24">
-
<el-card class="box-card card-yellow" style="height: 320px;margin-top: 20px">
<div slot="header" class="clearfix">
<span>鏉愭枡缁熻</span>
@@ -197,6 +214,14 @@
<script th:inline="javascript">
var project =[[${project}]];
+
+ var winURL = window.location.protocol + "//" + window.location.host + "/bjfw/profile";
+ console.log(winURL)
+
+ var projectUrl = winURL + project.url;
+ var arrayImg= new Array();
+ arrayImg.push(projectUrl);
+
var projectId=[[${projectId}]];
var statusDatas = [[${@dict.getType('hole_status')}]];
var prefix = ctx + "geo/hole";
@@ -217,6 +242,8 @@
vm.holeProcess = res.data==null ? 0 :(res.data*100).toFixed(0);
});
+ vm.src = projectUrl;
+ vm.srcList = arrayImg;
tubLogs();
});
@@ -305,6 +332,8 @@
project: "",
holeData: [],
tubLogs:[],
+ src:"",
+ srcList:[],
};
},
methods: {
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/player.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/player.html
index df4f66b..f42ec57 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/player.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/player.html
@@ -8,10 +8,12 @@
<!-- <div id="video-container" style="width:600px;">-->
<!-- </div>-->
<div>
- <video width="320" height="240" controls autoplay>
- <source id="videoPlayer" src="/bjfw/video/2.mp4" type="video/mp4">
-
- </video>
+ <iframe id ="palyerIframe"
+ src=""
+ width="100%"
+ height="600px;"
+ allowfullscreen>
+ </iframe>
</div>
</div>
@@ -19,10 +21,14 @@
<script th:src="@{/ajax/libs/EZUIKit/ezuikit.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "geo/projectCamera";
- var playr;
- var playrUrl="ezopen://open.ys7.com/AA2615287/1.live";
- //var token="at.9m3gto7jdlu1kwda7ranbh3nbiwouygq-7i07tcm9pu-17eg1uk-wrpjhveay";
- var token ="ra.5i97mecz3m31opfq14v3om7p43d19ylc-6ik4g9ca17-124mwk2-ifwpxx2mt";
+ var playerUrl = [[${playerUrl}]];
+ $("#palyerIframe").attr("src",playerUrl);
+
+
+ // var playr;
+ // var playrUrl="ezopen://open.ys7.com/AA2615287/1.live";
+ // //var token="at.9m3gto7jdlu1kwda7ranbh3nbiwouygq-7i07tcm9pu-17eg1uk-wrpjhveay";
+ // var token ="ra.5i97mecz3m31opfq14v3om7p43d19ylc-6ik4g9ca17-124mwk2-ifwpxx2mt";
// var player = new EZUIKit.EZUIKitPlayer({
// id: 'video-container', // 瑙嗛瀹瑰櫒ID
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/projectCamera.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/projectCamera.html
index 10596d0..7f2beff 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/projectCamera.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectCamera/projectCamera.html
@@ -90,7 +90,8 @@
},
{
field : 'ip',
- title : 'Ip鍦板潃'
+ title : 'Ip鍦板潃',
+ visible: false
},
{
title: '鎿嶄綔',
--
Gitblit v1.9.1