|
@@ -1,5 +1,6 @@
|
|
|
package com.business.slfh.manager.cameramanager.controller;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Arrays;
|
|
@@ -10,6 +11,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import com.business.slfh.manager.cameramanager.domain.TResCamera;
|
|
|
import com.business.slfh.manager.cameramanager.service.ITResCameraService;
|
|
|
+import com.business.slfh.tools.BrowserUtil;
|
|
|
import com.business.slfh.tools.UUID_Tools;
|
|
|
import com.business.slfh.visualization.event.service.Visualization_Event_Service;
|
|
|
import com.sooka.common.annotation.Log;
|
|
@@ -24,11 +26,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
@@ -158,6 +156,34 @@ public class TResCameraController extends BaseController
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 单个摄像头使用IE预览
|
|
|
+ */
|
|
|
+ @GetMapping("/onePreviewByIE/{id}")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxResult onePreviewByIE(@PathVariable("id") String id) {
|
|
|
+
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ return AjaxResult.error("启动摄像头失败,丢失唯一标识!");
|
|
|
+ }
|
|
|
+
|
|
|
+ TResCamera tResCamera = tResCameraService.selectTResCameraById(id);
|
|
|
+ if (tResCamera == null) {
|
|
|
+ return AjaxResult.error("启动摄像头失败,该摄像头不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ String ip = tResCamera.getHikIp();
|
|
|
+ String port = tResCamera.getHikPort();
|
|
|
+ String username = tResCamera.getHikUsername();
|
|
|
+ String password = tResCamera.getHikPassword();
|
|
|
+
|
|
|
+ String url = "http://218.27.1.154:9090/camera2/cn/demo.html?camera_id="+ip+","+port+","+username+","+password+",8000";
|
|
|
+
|
|
|
+ System.out.println(url);
|
|
|
+
|
|
|
+ return BrowserUtil.open_ie(url);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 单个摄像头预览
|
|
|
* 历史
|
|
|
*/
|