温红权 %!s(int64=7) %!d(string=hai) anos
pai
achega
ecb38747bc

+ 1 - 0
VisualInspection/js/util/const.js

@@ -46,6 +46,7 @@ var ROLE_DELETE = "/role/deleteRole/"
 
 
 var VIDEO_GET_ID = "/webcam/getVideoById/"
+var VIDEO_GET_IDs = "/webcam/getVideoByIds/"
 
 
 

+ 14 - 0
VisualInspection/js/util/service.js

@@ -316,6 +316,20 @@ function VideoGetById(id, success, fail) {
     });
 }
 
+function VideoGetByIds(ids, success, fail) {
+    var url = base_server_url + VIDEO_GET_IDs + ids;
+    ajaxGet(url, "", function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            success(data.result_data)
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
 
 function no_return_common_service(url, param, success, fail) {
     var url = base_server_url + url;

+ 59 - 1
VisualInspection/js/util/video.js

@@ -42,6 +42,51 @@ function setVideoPos() {
 
 }
 
+function queryVideoList(videoIds) {
+    if (videoIds != null) {
+        s1 = $.checkTask.start_time.replace(/-/g, "/");
+        var startTime = new Date(s1).getTime() / 1000;
+        s1 = $.checkTask.end_time.replace(/-/g, "/");
+        var endTime = new Date(s1).getTime() / 1000;
+
+        VideoGetByIds(videoIds, function(data) {
+            if (data != null && typeof(data) != "undefined") {
+                var pp = {
+                    "videoIds": videoIds,
+                    "cindex": 10,
+                    starttime: startTime,
+                    "endtime": endTime,
+                    "videos": []
+                };
+
+                data.forEach(came => {
+
+                    pp.videos.push({
+                        "videoId": came.id,
+                        "cametype": came.cameratype,
+                        "filetype": came.playtype
+                    });
+
+                });
+                var pp = {
+                    "videoIds": videoIds,
+                    "cindex": 1,
+                    starttime: startTime,
+                    "endtime": endTime,
+                    "videos": [{
+                        "videoId": curVideo,
+                        "cametype": data.cameratype,
+                        "filetype": data.playtype
+                    }]
+                };
+                callFunc("findvideolist", JSON.stringify(pp));
+            }
+        }, function(error) {});
+    }
+
+}
+
+
 function queryVideoList() {
 
     var videos = $.checkTask.video_id.split(',');
@@ -66,7 +111,20 @@ function queryVideoList() {
         VideoGetById(curVideo, function(data) {
             if (data != null && typeof(data) != "undefined") {
                 var str = curVideo + '|' + startTime + '|' + endTime + '|' + data.cameratype + '|' + data.playtype + '|' + index;
-                callFunc("findvideolist", str);
+
+
+                var pp = {
+                    "videoIds": curVideo,
+                    "cindex": 10,
+                    starttime: startTime,
+                    "endtime": endTime,
+                    "videos": [{
+                        "videoId": curVideo,
+                        "cametype": data.cameratype,
+                        "filetype": data.playtype
+                    }]
+                };
+                callFunc("findvideolist", JSON.stringify(pp));
             }
         }, function(error) {
 

+ 13 - 1
VisualInspection/qzd/js/task/check.js

@@ -66,7 +66,19 @@ function initCheck() {
         //TODO 获取分数
         queryCheckScores();
 
-        //TODO 查询录像播放列表
+        var videoids = $.checkTask.areainfo.video_ids;
+        if (videoids != "") {
+            queryVideoList(videoids);
+        } else {
+            callFunc("showvideoview", "false");
+            layer.msg('该处暂无视屏!', {
+                offset: 'r',
+                time: 2000, //20s后自动关闭
+            });
+            callFunc("stop", "");
+        }
+
+
 
     }
 

+ 17 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/WebcamController.java

@@ -1,5 +1,6 @@
 package com.xintong.visualinspection.controller;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -65,4 +66,20 @@ public class WebcamController extends BaseController {
 		}
 	}
 
+    @RequestMapping(value = "/getVideoByIds/{webcamids}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
+    public String getVideoByIds(@PathVariable String webcamids) {
+        try {
+            List<Webcam> webcams = new ArrayList<>();
+            String[] ids = webcamids.split(",");
+            for (String id:ids
+                 ) {
+                if(id.equals("")) {continue;}
+                webcams.add(webcamService.getOne(id));
+            }
+            return returnResult(0, "获取成功", webcams);
+        } catch (Exception e) {
+            throw new BusinessException(20001);
+        }
+    }
+
 }