|
@@ -378,7 +378,7 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
|
|
|
pr.getHttpRequest().header("Authorization", "bearer " + token);
|
|
|
prBody = pr.execute();
|
|
|
log.info("----结束执行----{}------返回报文:{}", "获取大华摄像头的预置点", prBody);
|
|
|
- return AjaxResult.success("操作成功", JSONUtil.parseObj(prBody));
|
|
|
+ return AjaxResult.success("操作成功", JSON.parseObject(prBody));
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(prBody);
|
|
@@ -408,10 +408,10 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
|
|
|
.header("User-Id", "1");
|
|
|
prBody = pr.execute();
|
|
|
log.info("----结束执行----{}------返回报文:{}", "预置点控制(添加/删除/定位)", prBody);
|
|
|
- return AjaxResult.success("操作成功", JSONUtils.parse(prBody));
|
|
|
+ return AjaxResult.success("操作成功", JSON.parseObject(prBody));
|
|
|
} catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
- return AjaxResult.error("操作失败", JSONUtils.parse(prBody));
|
|
|
+ return AjaxResult.error("操作失败", JSON.parseObject(prBody));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -774,5 +774,36 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
|
|
|
return System.getProperty("os.name");
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * 大华联动调转摄像头指向
|
|
|
+ *
|
|
|
+ * @author 韩福成
|
|
|
+ * @date 2025/8/19 上午9:26
|
|
|
+ */
|
|
|
+ public AjaxResult cameraSteering(Double lng, Double lat, List<String> list) {
|
|
|
+ List<String> creamList = centermonitorTCameraMapper.getCreamList(list);
|
|
|
+ if (CollectionUtils.isEmpty(creamList)) {
|
|
|
+ return AjaxResult.error("未找到对应的摄像头编码");
|
|
|
+ }
|
|
|
+ String ROTATION_URL = host + "/evo-apigw/evo-gmcommon/" + versionLinkage + "/watchtower/calPTAngleAndSitPosition";
|
|
|
+ String token = getToken();
|
|
|
+ for (String channelNum : creamList) {
|
|
|
+
|
|
|
+ String urlWithParams = ROTATION_URL + "?lng=" + lng + "&lat=" + lat + "&channelCode=" + channelNum;
|
|
|
+ log.info("----开始执行----{}------请求参数:{}", "调转摄像头指向", JSONUtil.toJsonStr(urlWithParams));
|
|
|
+ String prBody = null;
|
|
|
+ try {
|
|
|
+ IccHttpHttpRequest pr = new IccHttpHttpRequest(urlWithParams, Method.GET);
|
|
|
+ pr.getHttpRequest().header("Authorization", "bearer " + token);
|
|
|
+ prBody = pr.execute();
|
|
|
+ log.info("----结束执行----{}------返回报文:{}", "调转摄像头指向", prBody);
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(prBody);
|
|
|
+ log.error("通道 {} 请求异常: {}", channelNum, jsonObject.get("errMsg").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
|
|
|
}
|