|
@@ -879,30 +879,22 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
|
|
|
*/
|
|
|
@Override
|
|
|
public AjaxResult calPTAngleAndSitPosition(JSONObject json) {
|
|
|
-
|
|
|
List<String> channelCodes = JSONUtil.toList(JSONUtil.parseArray(json.get("channelCodes")), String.class);
|
|
|
log.info("----开始执行----{}------返回报文:{}", "地视联动、三维定位计算", json);
|
|
|
for (String channelCode : channelCodes) {
|
|
|
- String prBody = null;
|
|
|
String token = getTokenByPassword();
|
|
|
String CALCULATE_PT_ANGLE_URL = host + "/evo-apigw/evo-gmcommon/1.3.2/watchtower/calPTAngleAndSitPosition?lng="
|
|
|
+ json.get("lng") + "&lat=" + json.get("lat") + "&channelCode=" + channelCode;
|
|
|
try {
|
|
|
IccHttpHttpRequest pr = new IccHttpHttpRequest(CALCULATE_PT_ANGLE_URL, Method.GET);
|
|
|
pr.getHttpRequest().header("Authorization", "bearer " + token);
|
|
|
- prBody = pr.execute();
|
|
|
+ String prBody = pr.execute();
|
|
|
log.info("----结束执行----{}------返回报文:{}", "地视联动、三维定位计算", prBody);
|
|
|
} catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- if (prBody != null) {
|
|
|
- JSONObject jsonObject = JSONUtil.parseObj(prBody);
|
|
|
- return AjaxResult.error("操作失败", jsonObject.get("errMsg").toString());
|
|
|
- }
|
|
|
- return AjaxResult.error("操作失败", "计算异常,请检查当前角度是否在可视域范围内且设备已完成标定");
|
|
|
+ log.error("操作失败", ex);
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success("操作成功");
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|