From 87fa388d22e9dae8927c31f40ead4dba1c3d69fb Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期五, 01 九月 2023 11:55:55 +0800
Subject: [PATCH] 实时报警聚合接口(all)增加报警类型
---
ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmData.java | 1
ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java | 27 +++++++++----
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SdkTask.java | 3 +
ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java | 12 +++++
ard-work/src/main/resources/templates/preview.html | 35 +++++++++++++++--
5 files changed, 63 insertions(+), 15 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmData.java b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmData.java
index c7b9d13..ddd0e13 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmData.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/domain/GlobalAlarmData.java
@@ -26,4 +26,5 @@
Double altitude;
Integer count;//鏈鏁�
Integer total;//鎬绘暟
+ String alarmType;
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
index 1572fae..5637468 100644
--- a/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -293,7 +293,8 @@
.setLatitude(ardAlarmStealelec.getLatitude())
.setAltitude(ardAlarmStealelec.getAltitude())
.setCount(ardAlarmStealelec.getCount())
- .setTotal(ardAlarmStealelec.getTotal());
+ .setTotal(ardAlarmStealelec.getTotal())
+ .setAlarmType("1001");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1001.size()>0) {
@@ -310,7 +311,8 @@
.setLongitude(ardAlarmCamera.getLongitude())
.setLatitude(ardAlarmCamera.getLatitude())
.setCount(ardAlarmCamera.getCount())
- .setTotal(ardAlarmCamera.getTotal());
+ .setTotal(ardAlarmCamera.getTotal())
+ .setAlarmType("1002");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1002.size()>0) {
@@ -327,7 +329,8 @@
.setLongitude(ardAlarmRadar.getLongitude())
.setLatitude(ardAlarmRadar.getLatitude())
.setCount(ardAlarmRadar.getCount())
- .setTotal(ardAlarmRadar.getTotal());
+ .setTotal(ardAlarmRadar.getTotal())
+ .setAlarmType("1003");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1003.size()>0) {
@@ -344,7 +347,8 @@
.setLongitude(ardAlarmRadar.getLongitude())
.setLatitude(ardAlarmRadar.getLatitude())
.setCount(ardAlarmRadar.getCount())
- .setTotal(ardAlarmRadar.getTotal());
+ .setTotal(ardAlarmRadar.getTotal())
+ .setAlarmType("1004");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1004.size()>0) {
@@ -361,7 +365,8 @@
.setLongitude(ardAlarmExternal.getLongitude())
.setLatitude(ardAlarmExternal.getLatitude())
.setCount(ardAlarmExternal.getCount())
- .setTotal(ardAlarmExternal.getTotal());
+ .setTotal(ardAlarmExternal.getTotal())
+ .setAlarmType("1005");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1005.size()>0) {
@@ -378,7 +383,8 @@
.setLongitude(ardAlarmAccess.getLongitude())
.setLatitude(ardAlarmAccess.getLatitude())
.setCount(ardAlarmAccess.getCount())
- .setTotal(ardAlarmAccess.getTotal());
+ .setTotal(ardAlarmAccess.getTotal())
+ .setAlarmType("1006");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1006.size()>0) {
@@ -395,7 +401,8 @@
.setLongitude(ardAlarmRadar.getLongitude())
.setLatitude(ardAlarmRadar.getLatitude())
.setCount(ardAlarmRadar.getCount())
- .setTotal(ardAlarmRadar.getTotal());
+ .setTotal(ardAlarmRadar.getTotal())
+ .setAlarmType("1007");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1007.size()>0) {
@@ -412,7 +419,8 @@
.setLongitude(ardAlarmApponekey.getLongitude())
.setLatitude(ardAlarmApponekey.getLatitude())
.setCount(ardAlarmApponekey.getCount())
- .setTotal(ardAlarmApponekey.getTotal());
+ .setTotal(ardAlarmApponekey.getTotal())
+ .setAlarmType("1009");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1009.size()>0) {
@@ -430,7 +438,8 @@
.setLatitude(ardAlarmTube.getLatitude())
.setAltitude(ardAlarmTube.getAltitude())
.setCount(ardAlarmTube.getCount())
- .setTotal(ardAlarmTube.getTotal());
+ .setTotal(ardAlarmTube.getTotal())
+ .setAlarmType("1014");
return globalAlarmData;
}).collect(Collectors.toList());
if(alarmData1014.size()>0) {
diff --git a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
index 5dd6550..a051843 100644
--- a/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/hiksdk/service/impl/HikClientServiceImpl.java
@@ -385,6 +385,9 @@
NET_DVR_FOCUSMODE_CFG focusmodeCfg = new NET_DVR_FOCUSMODE_CFG();
Pointer point = focusmodeCfg.getPointer();
IntByReference ibrBytesReturned = new IntByReference(0);
+ focusmodeCfg.byFocusMode=1;
+ focusmodeCfg.byAutoFocusMode=0;
+ focusmodeCfg.write();
boolean bool = hCNetSDK.NET_DVR_GetDVRConfig(userId, NET_DVR_GET_FOCUSMODECFG, channelNum, point, focusmodeCfg.size(), ibrBytesReturned);
if (bool) {
focusmodeCfg.read();
@@ -972,7 +975,14 @@
log.debug("璁剧疆鑱氱劍妯″紡鎴愬姛");
return bool;
}
-
+ /**
+ * @鎻忚堪 鑾峰彇鑱氱劍妯″紡
+ * @鍙傛暟 [userId, channelNum]
+ * @杩斿洖鍊� boolean
+ * @鍒涘缓浜� 鍒樿嫃涔�
+ * @鍒涘缓鏃堕棿 2023/1/18 13:07
+ * @淇敼浜哄拰鍏跺畠淇℃伅
+ */
public String getFocusMode(CameraCmd cmd) {
String cameraId = cmd.getCameraId();
Integer channelNum = cmd.getChannelNum();
diff --git a/ard-work/src/main/resources/templates/preview.html b/ard-work/src/main/resources/templates/preview.html
index 9915e66..381edb7 100644
--- a/ard-work/src/main/resources/templates/preview.html
+++ b/ard-work/src/main/resources/templates/preview.html
@@ -68,6 +68,18 @@
height: 100%;
object-fit: fill;
}
+ #loadingMessage {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 24px;
+ color: white;
+ background-color: rgba(0, 0, 0, 0.7);
+ padding: 10px 20px;
+ border-radius: 5px;
+ display: none;
+ }
</style>
</head>
<body>
@@ -75,6 +87,7 @@
<div class="container" id="gridContainer">
<!-- 缃戞牸椤圭洰灏嗙敱 JavaScript 鍔ㄦ�佺敓鎴� -->
</div>
+ <div id="loadingMessage">姝e湪鍙栨祦</div>
<div class="container2">
<div class="button-container">
<button class="toggle-button" onclick="changeGrid(1, 1)">1x1</button>
@@ -106,16 +119,27 @@
const videoContainer = document.createElement('div');
videoContainer.className = 'video-container';
const video = document.createElement('video');
- video.id="video"+i;
+ video.id = "video" + i;
video.controls = true;
video.autoplay = true;
video.muted = true;
+ video.loop= true;
+
videoContainer.appendChild(video);
gridItem.appendChild(videoContainer);
gridContainer.appendChild(gridItem);
video.addEventListener('loadedmetadata', function () {
adjustGridItemSize(gridItem, gridItem.videoWidth, gridItem.videoHeight);
+ });
+ video.addEventListener("click", function() {
+ loadingMessage.style.display = "block";
+ video.play().then(function() {
+ loadingMessage.style.display = "none";
+ }).catch(function(error) {
+ console.error("Error playing the video:", error);
+ loadingMessage.style.display = "none";
+ });
});
console.log(video.id)
}
@@ -365,7 +389,7 @@
}
let videoMap = new Map();
- $(document).on('click', 'video', function() {
+ $(document).on('click', 'video', function () {
let ID = this.id;//鑾峰彇褰撳墠鐐瑰嚮浜嬩欢鐨勫厓绱�
console.log(ID);
console.log(videoMap);
@@ -384,9 +408,10 @@
client.stop(id);
videoMap.delete(id);
}
- function closeAllVideo(){
- videoMap.forEach((val,key) => {
- console.log(val,key);
+
+ function closeAllVideo() {
+ videoMap.forEach((val, key) => {
+ console.log(val, key);
val.stop(key);
videoMap.delete(key);
})
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SdkTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SdkTask.java
index f844f56..ae59c72 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SdkTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/SdkTask.java
@@ -80,6 +80,9 @@
ptz.put("usernameZh", cmd.getOperatorZh());
ptz.put("operatorId", cmd.getOperator());//涓婇攣鐢ㄦ埛id
ptz.put("expirationRemainingSecond", secDatePoor);
+ ptz.put("longitude",camera.getLongitude());
+ ptz.put("latitude",camera.getLatitude());
+ ptz.put("altitude",camera.getAltitude());
list.add(ptz);
}
}
--
Gitblit v1.9.3