zhongrj
2023-06-25 30a778548cf99f8f8a17ce63dc09c577d7a5ed16
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/controller/HkController.java
@@ -53,9 +53,17 @@
   @ApiOperation(value = "海康设备-海康播放url查询(ws)", notes = "海康设备-海康播放url查询(ws)")
   @GetMapping(value = "/queryHkPreviewUrl")
   public R queryHkPreviewUrl(HkVO hk) {
      String expand = "";
      if (null!=hk.getExpand() && !hk.getExpand().equals("")){
         expand = hk.getExpand();
      }
      String url = "";
      // 获取海康播放url
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),HkConstant.previewURLs, hk.getCameraIndexCode(), ProtocolConstant.WS);
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         ProtocolConstant.WS,
         expand);
      if (null!=result) {
         JSONObject jsonObject = JSONObject.parseObject(result);
         Map map = (Map) jsonObject.get("data");
@@ -74,8 +82,16 @@
   @GetMapping(value = "/queryHkPreviewUrlCommon")
   public R queryHkPreviewUrlCommon(HkVO hk) {
      String url = "";
      String expand = "";
      if (null!=hk.getExpand() && !hk.getExpand().equals("")){
         expand = hk.getExpand();
      }
      // 获取海康播放url
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),HkConstant.previewURLs, hk.getCameraIndexCode(), hk.getProtocol());
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         hk.getProtocol(),
         expand);
      if (null!=result) {
         JSONObject jsonObject = JSONObject.parseObject(result);
         Map map = (Map) jsonObject.get("data");
@@ -94,8 +110,16 @@
   @GetMapping(value = "/queryHkPreviewUrlByHls")
   public R queryHkPreviewUrlByHls(HkVO hk) {
      String url = "";
      String expand = "";
      if (null!=hk.getExpand() && !hk.getExpand().equals("")){
         expand = hk.getExpand();
      }
      // 获取海康播放url
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),HkConstant.previewURLs, hk.getCameraIndexCode(), ProtocolConstant.HLS);
      String result = GetCameraPreviewURL(null==hk.getType()?1:hk.getType(),
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         ProtocolConstant.HLS,
         expand);
      if (null!=result) {
         JSONObject jsonObject = JSONObject.parseObject(result);
         Map map = (Map) jsonObject.get("data");
@@ -238,4 +262,29 @@
      return R.data(common(null==hk.getType()?1:hk.getType(),HkConstant.talkURLs, body));
   }
   /**
    * 设置监控点的预置点信息
    * @param hk 查询参数
    * @return
    */
   @ApiOperation(value = "海康设备-获取海康摄像头语音对讲url", notes = "海康设备-获取海康摄像头语音对讲url")
   @GetMapping(value = "/presetsAddition")
   public R presetsAddition(HkVO hk) {
      /**
       * 组装请求参数
       */
      JSONObject jsonBody = new JSONObject();
      jsonBody.put("cameraIndexCode", hk.getCameraIndexCode());
      jsonBody.put("presetName", hk.getPresetName());
      jsonBody.put("presetIndex", hk.getPresetIndex());
      String body = jsonBody.toJSONString();
      /**
       * 调用接口并返回数据
       * post请求application/json类型参数;
       */
      return R.data(common(null==hk.getType()?1:hk.getType(),HkConstant.presetsAdditionURLs, body));
   }
}