shenyijian
2024-06-24 7d44d7a2a9ee8f55e911d678d78ff25f047cab4d
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/hk/controller/HkController.java
@@ -14,6 +14,7 @@
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
@@ -72,6 +73,7 @@
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         ProtocolConstant.WS,
         null==hk.getTransmode()?1:hk.getTransmode(),
         expand,
         null==hk.getStreamType()?1:hk.getStreamType());
      if (null!=result) {
@@ -101,6 +103,7 @@
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         hk.getProtocol(),
         null==hk.getTransmode()?1:hk.getTransmode(),
         expand,
         null==hk.getStreamType()?1:hk.getStreamType());
      if (null!=result) {
@@ -130,6 +133,7 @@
         HkConstant.previewURLs,
         hk.getCameraIndexCode(),
         ProtocolConstant.HLS,
         null==hk.getTransmode()?1:hk.getTransmode(),
         expand,
         null==hk.getStreamType()?1:hk.getStreamType());
      if (null!=result) {
@@ -147,7 +151,7 @@
    * @return
    */
   @ApiOperation(value = "海康设备-海康摄像头云台的控制", notes = "海康设备-海康摄像头云台的控制")
   @GetMapping(value = "/handleCameraPosition")
   @GetMapping(value = "/handleCameraPosition2")
   public R handleCameraPosition(HkVO hk) {
      // 获取海康播放url
      String result = controlling(null==hk.getType()?1:hk.getType(),HkConstant.controllingURLs,
@@ -240,6 +244,7 @@
      jsonBody.put("cameraIndexCode", hk.getCameraIndexCode());
      jsonBody.put("protocol", hk.getProtocol());
      jsonBody.put("recordLocation", "1");
      jsonBody.put("transmode", null==hk.getTransmode()?1:hk.getTransmode());
      jsonBody.put("beginTime", hk.getBeginTime());
      jsonBody.put("endTime", hk.getEndTime());
      String body = jsonBody.toJSONString();
@@ -266,6 +271,7 @@
      jsonBody.put("cameraIndexCode", hk.getCameraIndexCode());
      jsonBody.put("streamType",null==hk.getStreamType()?1:hk.getStreamType());
      jsonBody.put("protocol", hk.getProtocol());
      jsonBody.put("transmode", null==hk.getTransmode()?1:hk.getTransmode());
      String body = jsonBody.toJSONString();
      /**
@@ -337,10 +343,11 @@
      String resName = setWaterName(hk,info);
      // 设置区域名称
      hk.setRegionName(info.getCountyName());
      hk.setCityName(info.getCityName());
      // 判断
      // 通过区域名称查询对应的区域编号
      String rootRegionId = hkService.regionNodesByParams(hk);
      if (null!= rootRegionId && !rootRegionId.equals("")){
      if (!Strings.isBlank(rootRegionId)){
         // 更新
         /**
          * 组装请求参数
@@ -377,7 +384,7 @@
      // 根据水库名称、所在区域查询改水库的数量
      Integer number = attResBaseService.getWaterCountByResNameAndCountyName(hk.getRegionName(),info.getCountyCode());
      if (number>1){
         return info.getTownName() + hk.getRegionName();
         return  hk.getRegionName() + "(" + info.getTownName() + ")";
      }else {
         return hk.getRegionName();
      }