From b111a1ee7360a423ecce9c31f2900f2d4b10f482 Mon Sep 17 00:00:00 2001
From: haungxing <1203316822@qq.com>
Date: Thu, 11 Jan 2024 08:54:09 +0800
Subject: [PATCH] =?UTF-8?q?#=20=E8=A7=86=E9=A2=91=E6=B5=81=E8=BD=AC?=
=?UTF-8?q?=E6=8D=A2=E4=B8=BAws=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hzims-biz-common/pom.xml | 4 ++
.../java/com/hnac/hzims/common/utils/HiKUtil.java | 72 ++++++++++++++++++++++
.../controller/StationVideoTypeController.java | 10 +++
.../station/service/IStationVideoTypeService.java | 7 +++
.../service/impl/StationVideoTypeServiceImpl.java | 48 +++++++++++++--
5 files changed, 137 insertions(+), 4 deletions(-)
create mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java
diff --git a/hzims-biz-common/pom.xml b/hzims-biz-common/pom.xml
index f1d1274..4908ce6 100644
--- a/hzims-biz-common/pom.xml
+++ b/hzims-biz-common/pom.xml
@@ -44,6 +44,10 @@
org.springblade
blade-starter-datascope
+
+ com.hikvision.ga
+ artemis-http-client
+
diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java
new file mode 100644
index 0000000..7481619
--- /dev/null
+++ b/hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/HiKUtil.java
@@ -0,0 +1,72 @@
+package com.hnac.hzims.common.utils;
+
+import com.alibaba.druid.support.json.JSONUtils;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.hikvision.artemis.sdk.ArtemisHttpUtil;
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.log.logger.BladeLogger;
+import org.springblade.core.tool.jackson.JsonUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.server.domain.Sys;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.Assert;
+
+import java.text.DateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * @Author: huangxing
+ * @Date: 2024/1/10 14:40
+ */
+public class HiKUtil {
+
+ public static String APP_KEY = "26486442";
+ public static String APP_SECRET = "tXBM9jsMqeM9yvEMS8qg";
+ public static String HOST = "140.210.208.111:443";
+
+ public static String send(String api, Map map) {
+ ArtemisConfig.host = HOST;
+ ArtemisConfig.appKey = APP_KEY;
+ ArtemisConfig.appSecret = APP_SECRET;
+
+ final String url = "/artemis" + api;
+ Map path = new HashMap(2){{
+ put("https://", url);
+ }};
+ String contentType = "application/json";
+ String body = JSON.toJSONString(map);
+ String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);
+ JSONObject object = JsonUtil.parse(result, JSONObject.class);
+ return object.getString("data");
+ }
+
+ public static String send(String api, Map map, String host,String appKey,String appSecret) {
+ ArtemisConfig.host = host;
+ ArtemisConfig.appKey = appKey;
+ ArtemisConfig.appSecret = appSecret;
+
+ final String url = "/artemis" + api;
+ Map path = new HashMap(2){{
+ put("https://", url);
+ }};
+ String contentType = "application/json";
+ String body = JSON.toJSONString(map);
+ String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);
+ JSONObject object = JsonUtil.parse(result, JSONObject.class);
+ return object.getString("data");
+ }
+
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
index 4c47925..e1cac85 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationVideoTypeController.java
@@ -301,4 +301,14 @@ public class StationVideoTypeController extends BladeController {
return R.success("视频监控处理成功");
}
+ @GetMapping("/getWsUrlByPointCode")
+ @ApiOperationSupport(order = 140)
+ @ApiOperation(value = "根据摄像头设备编码获取ws地址", notes = "根据摄像头设备编码获取ws地址")
+ public R