wenhongquan 8 лет назад
Родитель
Сommit
976dc5b045

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

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

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

@@ -279,6 +279,22 @@ function getConstantList(url, param, success, fail) {
     });
 }
 
+
+function VideoGetById(id, success, fail) {
+    var url = base_server_url + VIDEO_GET_ID +id;
+    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;
     ajaxPost(url, param, function(response) {

+ 16 - 10
VisualInspection/js/util/video.js

@@ -8,22 +8,28 @@ function doAction(func){
 }
 
 function queryVideoList(){
-    console.log("视屏:"+curVideo);
-    //alert(curVideo);
-    if(!curVideo) {
-        var videos = $.checkTask.video_id.split(',');
-        curVideo = videos[0];
-        //alert(curVideo);
-    }
-    // alert(curVideo);
+
+    var videos = $.checkTask.video_id.split(',');
+    curVideo = videos[0];
+
     if(curVideo) {
         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;
+     
+        //获取摄像头信息
+        VideoGetById(curVideo,function(data){
+            if(data!=null && typeof(data)!="undefined"){
+                var str = curVideo+'|'+startTime+'|'+endTime+'|'+data.cameratype+'|'+data.playtype;
+                callFunc("findvideolist",str);
+            }
+        },function(error){
+
+        });
+
         // alert(curVideo);
-        var str = 120+'|'+startTime+'|'+endTime;
-        callFunc("findvideolist",str);
+        
     }else{
 
     }

+ 3 - 3
VisualInspection/view/mytask/check.html

@@ -50,14 +50,14 @@
                             <div class="tab-pane" id="tabContent3" class="col-sm-12">
                             </div>
                         </div>
-                        <div class="row" class="col-md-12" style="padding:5px;margin-top:30px;text-align:center">
+                        <div class="row" class="col-md-12" style="padding:5px;margin-top:5px;text-align:center">
                             <input id="ex1" class="col-md-12"  type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0"/>
                         </div>
                         <div class="row" style="padding:0 10px;margin-top:5px;text-align:center">
                             <select class="form-control" id="video_list" style="width:200px;float:left;"></select>
                             <div class="btn-group" style="float:right;">
-                                <button type="button" class="btn btn-info" onclick="setCurrentProcessValue(90)"><i class="icon icon-play-circle icon-2x"></i></button>
-                                <button type="button" class="btn btn-info" onclick="setCurrentProcessValue(70)"><i class="icon icon-pause icon-2x"></i></button>
+                                <button type="button" class="btn btn-info" onclick="doAction('start')"><i class="icon icon-play-circle icon-2x"></i></button>
+                                <button type="button" class="btn btn-info" onclick="doAction('stop')"><i class="icon icon-pause icon-2x"></i></button>
                                 <button type="button" class="btn btn-info" onclick="doAction('fast')"><i class="icon icon-forward icon-2x"></i></button>
                                 <button type="button" class="btn btn-info" onclick="doAction('slow')"><i class="icon icon-backward icon-2x"></i></button>
                                 <button type="button" class="btn btn-success" onclick="doAction('screenshot')"><i class="icon icon-camera icon-2x"></i></button>

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Webcam.java

@@ -34,6 +34,8 @@ public class Webcam {
 	private String ip;
 	private Integer port;
 	private Integer channel;
+	private Integer cameratype;
+	private Integer playtype;
 }
 
 

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

@@ -56,7 +56,7 @@ public class WebcamController extends BaseController {
 	}
 
 	@RequestMapping(value = "/getVideoById/{webcamid}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
-	public String getVideoById(@PathVariable Integer webcamid) {
+	public String getVideoById(@PathVariable String webcamid) {
 		try {
 			Webcam u = webcamService.getOne(webcamid);
 			return returnResult(0, "获取成功", u);

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/cluster/WebcamDao.java

@@ -13,7 +13,7 @@ import com.xintong.visualinspection.bean.Webcam;
 @Mapper
 public interface WebcamDao {
     public List<Webcam> getAll();
-    public Webcam getOne(Integer id);
+    public Webcam getOne(String deviceid);
     public List<Webcam> getWebcams(Webcam webcam);
 
 }

+ 6 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/WebcamMapper.xml

@@ -54,6 +54,10 @@
 			jdbcType="INTEGER" />
 		<result column="channel" property="channel"
 			jdbcType="INTEGER" />
+			<result column="cameratype" property="cameratype"
+			jdbcType="INTEGER" />
+			<result column="playtype" property="playtype"
+			jdbcType="INTEGER" />
 	
 	</resultMap>
 	
@@ -65,11 +69,11 @@
 		t_br_layer_webcam
 	</select>
 
-	<select id="getOne" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+	<select id="getOne" parameterType="String" resultMap="BaseResultMap">
 		SELECT
 		*
 		FROM t_br_layer_webcam
-		WHERE id = #{id}
+		WHERE DEVICE_ID =  #{deviceid,jdbcType=VARCHAR}
 	</select>
 
 	<select id="getWebcams" parameterType="com.xintong.visualinspection.bean.Webcam"

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/WebcamService.java

@@ -10,6 +10,6 @@ import com.xintong.visualinspection.bean.Webcam;
  */
 public interface WebcamService {
     public List<Webcam> getAll();
-    public Webcam getOne(Integer id);
+    public Webcam getOne(String deviceid);
     public List<Webcam> getWebcams(Webcam webcam);
 }

+ 2 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/WebcamServiceImpl.java

@@ -33,8 +33,8 @@ public class WebcamServiceImpl extends BaseService implements WebcamService {
 
 
 	@Override
-	public Webcam getOne(Integer id) {
-	    return webcamDao.getOne(id);
+	public Webcam getOne(String deviceid) {
+	    return webcamDao.getOne(deviceid);
 	}