zhangqiankun 2 سال پیش
والد
کامیت
8b99b50b28

+ 3 - 0
src/main/java/com/persagy/cameractl/conf/AllStaticConfig.java

@@ -12,4 +12,7 @@ public class AllStaticConfig {
 
 	// 69解码器密码
 	public static String decodeDevicePassword;
+	
+	public static String recordLocation;
+	
 }

+ 12 - 0
src/main/java/com/persagy/cameractl/conf/CameraApiConfig.java

@@ -25,6 +25,9 @@ public class CameraApiConfig {
 	
 	@Value("${hk-config.decodeDevicePort}")
 	private int decodeDevicePort;
+	
+	@Value("${hk-config.decodeDevicePort:}")
+	private String recordLocation;
 
 	public String getHkApiHost() {
 		return hkApiHost;
@@ -81,4 +84,13 @@ public class CameraApiConfig {
 	public void setDecodeDevicePort(int decodeDevicePort) {
 		this.decodeDevicePort = decodeDevicePort;
 	}
+
+	public String getRecordLocation() {
+		return recordLocation;
+	}
+
+	public void setRecordLocation(String recordLocation) {
+		this.recordLocation = recordLocation;
+	}
+	
 }

+ 5 - 8
src/main/java/com/persagy/cameractl/controller/HelloController.java

@@ -3,8 +3,6 @@ package com.persagy.cameractl.controller;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Map;
 
 import javax.servlet.http.HttpServletResponse;
 
@@ -12,20 +10,19 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RequestBody;
 
 import com.persagy.cameractl.conf.MyParamConfig;
-import com.persagy.cameractl.utils.ResultTools;
-import com.persagy.cameractl.utils.StringTools;
-import com.persagy.cameractl.utils.OtherTools;
+import com.persagy.cameractl.service.HkCameraExecuteApi;
 import com.persagy.cameractl.service.PtzMain;
 import com.persagy.cameractl.utils.Camera;
-import com.persagy.cameractl.utils.MimeCamera;
+import com.persagy.cameractl.utils.OtherTools;
 import com.persagy.cameractl.utils.ResultClass;
-import com.persagy.cameractl.service.HkCameraExecuteApi;
+import com.persagy.cameractl.utils.ResultTools;
+import com.persagy.cameractl.utils.StringTools;
 
 @Controller
 @CrossOrigin

+ 1 - 0
src/main/java/com/persagy/cameractl/init/SystemInit.java

@@ -30,6 +30,7 @@ public class SystemInit implements ApplicationRunner {
 		AllStaticConfig.decodeDeviceUserName=cameraApiConfig.getDecodeDeviceUserName();
 		AllStaticConfig.decodeDevicePassword=cameraApiConfig.getDecodeDevicePassword();
 		AllStaticConfig.decodeDevicePort=cameraApiConfig.getDecodeDevicePort();
+		AllStaticConfig.recordLocation=cameraApiConfig.getRecordLocation();
 		
 		log.info("SystemInit start");
 		System.out.println("端口号:"+serverConfig.getUrl());

+ 17 - 11
src/main/java/com/persagy/cameractl/service/HkCameraExecuteApi.java

@@ -1,26 +1,29 @@
 package com.persagy.cameractl.service;
 
+import java.io.File;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
 import com.hikvision.artemis.sdk.ArtemisHttpUtil;
 import com.hikvision.artemis.sdk.config.ArtemisConfig;
+import com.persagy.cameractl.conf.AllStaticConfig;
 import com.persagy.cameractl.conf.CameraApiConfig;
 import com.persagy.cameractl.utils.Camera;
 import com.persagy.cameractl.utils.CmdStreamThread;
 import com.persagy.cameractl.utils.EnumTools;
-import com.persagy.cameractl.utils.ResultClass;
 import com.persagy.cameractl.utils.EnumTools.OperatingSystem;
 import com.persagy.cameractl.utils.JsonTools;
 import com.persagy.cameractl.utils.OtherTools;
-import cn.hutool.core.date.DateUtil;
-
-import java.io.File;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import com.persagy.cameractl.utils.ResultClass;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import net.sf.json.JSONObject;
 
 @Component
@@ -170,6 +173,9 @@ public class HkCameraExecuteApi {
 
 			JSONObject jsonBody = new JSONObject();
 			jsonBody.put("cameraIndexCode", hkCamera.cameraIndexCode);
+			if (StrUtil.isNotBlank(AllStaticConfig.recordLocation)) {
+				jsonBody.put("recordLocation", AllStaticConfig.recordLocation);
+			}
 			jsonBody.put("protocol", hkCamera.protocol);
 			jsonBody.put("beginTime", hkCamera.startDateStr.replace(" ", "T") + ".000+08:00");
 			jsonBody.put("endTime", endString2.replace(" ", "T") + ".000+08:00");

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
src/main/resources/application.yml