|
|
|
|
@ -81,7 +81,6 @@ public class AppDataController extends BladeController { |
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
public R<IPage<AppData>> list(AppData appData, Query query) { |
|
|
|
|
log.info("/appData/list执行了--------------"); |
|
|
|
|
return R.data(appDataService.getPage(Condition.getPage(query), appData)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -106,6 +105,16 @@ public class AppDataController extends BladeController { |
|
|
|
|
return R.data(appDataService.putFile(appData, resultList)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 故障上报处理 |
|
|
|
|
*/ |
|
|
|
|
@CrossOrigin |
|
|
|
|
@PostMapping("/handle") |
|
|
|
|
public R handle(@RequestBody AppData appData) { |
|
|
|
|
appData.setStatus(2); |
|
|
|
|
return R.data(appDataService.updateById(appData)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 海信上报接口 |
|
|
|
|
*/ |
|
|
|
|
@ -340,145 +349,4 @@ public class AppDataController extends BladeController { |
|
|
|
|
return R.data(new JoysuchCoordinate((double) x, (double) y, lng, lat)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/test") |
|
|
|
|
public R test(String number) { |
|
|
|
|
// HCNetSDK.NET_DVR_ALARMHOST_MAIN_STATUS_V40 status = Alarm.getStatus(number);
|
|
|
|
|
//
|
|
|
|
|
// Alarm.xiaojing(number, 0);
|
|
|
|
|
|
|
|
|
|
externalUtils.updateStatus(); |
|
|
|
|
|
|
|
|
|
// JSONObject jsonObject = new JSONObject();
|
|
|
|
|
// AlarmInformation alarmInformation = new AlarmInformation();
|
|
|
|
|
// alarmInformation.setReportTime(new Date());
|
|
|
|
|
// alarmInformation.setBuildId("111222333");
|
|
|
|
|
// alarmInformation.setFloorNo("11");
|
|
|
|
|
// alarmInformation.setContent("22");
|
|
|
|
|
// jsonObject.put("message", JSONObject.toJSONString(alarmInformation));
|
|
|
|
|
// WebSocketServer.sendInfo(jsonObject);
|
|
|
|
|
// WebSocketServer.test();
|
|
|
|
|
return R.data(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/test001") |
|
|
|
|
public void test001() { |
|
|
|
|
// JSONObject jsonObject = new JSONObject();
|
|
|
|
|
// AlarmInformation alarmInformation = new AlarmInformation();
|
|
|
|
|
// alarmInformation.setReportTime(new Date());
|
|
|
|
|
// alarmInformation.setBuildId("111222333");
|
|
|
|
|
// alarmInformation.setFloorNo("11");
|
|
|
|
|
// alarmInformation.setContent("22");
|
|
|
|
|
// alarmInformation.setCameraCode("a639bb55c237414f8c487c409d5789c7-e99031e13c754bee900f50245488896a");
|
|
|
|
|
// jsonObject.put("message", JSONObject.toJSONString(alarmInformation));
|
|
|
|
|
// WebSocketServer.sendInfo(jsonObject);
|
|
|
|
|
WebSocketServer.test(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/test1") |
|
|
|
|
public void test1(String number) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
HttpClient client = new HttpClient(); |
|
|
|
|
String ip = "171.16.206.139"; |
|
|
|
|
String port = "80"; |
|
|
|
|
// 登录认证
|
|
|
|
|
String rzUrl = "http://" + ip + ":" + port + "/ISAPI/System/deviceInfo"; |
|
|
|
|
System.out.println("shuchu:" + HTTPClientUtil.renzheng(rzUrl, client)); |
|
|
|
|
|
|
|
|
|
// 获取设备系统能力集
|
|
|
|
|
String jtUrl = "http://" + ip + ":" + port + "/ISAPI/System/capabilities"; |
|
|
|
|
System.out.println("jt:" + HTTPClientUtil.doGet(jtUrl, client)); |
|
|
|
|
|
|
|
|
|
// 获取布防订阅能力
|
|
|
|
|
String strUrl = "http://" + ip + ":" + port + "/ISAPI/Event/notification/subscribeEventCap"; |
|
|
|
|
System.out.println("shuchu:" + HTTPClientUtil.doGet(strUrl, client)); |
|
|
|
|
|
|
|
|
|
// 建立布防订阅连接
|
|
|
|
|
String jlUrl = "http://" + ip + ":" + port + "/ISAPI/Event/notification/subscribeEvent?deployID=1"; |
|
|
|
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
|
|
|
|
"\n" + |
|
|
|
|
"<SubscribeEvent xmlns=\"http://www.isapi.org/ver20/XMLSchema\" version=\"2.0\">\n" + |
|
|
|
|
" <heartbeat>1</heartbeat>\n" + |
|
|
|
|
" <eventMode>all</eventMode>\n" + |
|
|
|
|
"</SubscribeEvent>"; |
|
|
|
|
// System.out.println("jl:" + HTTPClientUtil.doPost(jlUrl, xml, number, client));
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
try { |
|
|
|
|
// RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
// String url = "http://171.16.8.58:8080/prod-api/api/safeCare/callBack/getDeviceCamera?sn=1918FC32532E";
|
|
|
|
|
// HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
// headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
|
|
// HttpEntity request = new HttpEntity(headers);
|
|
|
|
|
// // 发送get请求,并输出结果
|
|
|
|
|
// ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.GET, request, String.class);
|
|
|
|
|
// // 返回数据
|
|
|
|
|
// Map cameraMap = JSONObject.parseObject(exchange.getBody(), Map.class);
|
|
|
|
|
|
|
|
|
|
// String rzUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/System/deviceInfo";
|
|
|
|
|
String rzUrl = "http://171.16.206.140:80/ISAPI/System/deviceInfo"; |
|
|
|
|
String renzheng = HTTPClientUtil.renzheng(rzUrl, HTTPClientUtil.client); |
|
|
|
|
// System.out.println(renzheng.contains("DS-PWA32-H20230524AACHQ25788522WU1"));
|
|
|
|
|
|
|
|
|
|
// System.out.println("shuchu:" + HTTPClientUtil.renzheng(rzUrl, HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String jtUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/System/capabilities";
|
|
|
|
|
// System.out.println("jt:" + HTTPClientUtil.doGet(jtUrl, HTTPClientUtil.client));
|
|
|
|
|
//
|
|
|
|
|
// String strUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/Event/notification/subscribeEventCap";
|
|
|
|
|
// System.out.println("shuchu:" + HTTPClientUtil.doGet(strUrl, HTTPClientUtil.client));
|
|
|
|
|
//
|
|
|
|
|
// String jlUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/Event/notification/subscribeEvent?deployID=1";
|
|
|
|
|
// String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
|
|
|
|
// "\n" +
|
|
|
|
|
// "<SubscribeEvent xmlns=\"http://www.isapi.org/ver20/XMLSchema\" version=\"2.0\">\n" +
|
|
|
|
|
// " <heartbeat>1</heartbeat>\n" +
|
|
|
|
|
// " <eventMode>all</eventMode>\n" +
|
|
|
|
|
// "</SubscribeEvent>";
|
|
|
|
|
// System.out.println("jl:" + HTTPClientUtil.doPost(jlUrl, xml));
|
|
|
|
|
|
|
|
|
|
// String bfUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/control/arm/1?ways=away&format=json";
|
|
|
|
|
// System.out.println("xj:" + HTTPClientUtil.doPut(bfUrl, "", HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String cfUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/control/disarm/1";
|
|
|
|
|
// System.out.println("xj:" + HTTPClientUtil.doPut(cfUrl, "", HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String xjUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/control/clearAlarm/1";
|
|
|
|
|
// System.out.println("xj:" + HTTPClientUtil.doPut(xjUrl, "", HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String plUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/control/bypass/1";
|
|
|
|
|
// System.out.println("xj:" + HTTPClientUtil.doPut(plUrl, "", HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String qxplUrl = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/control/bypassRecover/1";
|
|
|
|
|
// System.out.println("xj:" + HTTPClientUtil.doPut(qxplUrl, "", HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String status = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/status/communication?format=json";
|
|
|
|
|
// System.out.println("防区状态:" + HTTPClientUtil.doGet(status, HTTPClientUtil.client));
|
|
|
|
|
|
|
|
|
|
// String status = "http://" + HTTPClientUtil.strIP + ":" + HTTPClientUtil.iPort + "/ISAPI/SecurityCP/status/host?format=json";
|
|
|
|
|
// String statusData = HTTPClientUtil.doGet(status, HTTPClientUtil.client);
|
|
|
|
|
//
|
|
|
|
|
// Map tagsMap = JSONObject.parseObject(statusData, Map.class);
|
|
|
|
|
// Map alarmHostStatus = JSONObject.parseObject(tagsMap.get("AlarmHostStatus").toString(), Map.class);
|
|
|
|
|
// Map CommuniStatus = JSONObject.parseObject(alarmHostStatus.get("CommuniStatus").toString(), Map.class);
|
|
|
|
|
//// System.out.println("CommuniStatus" + CommuniStatus);
|
|
|
|
|
// List<Map> ZoneList = JSONObject.parseObject(alarmHostStatus.get("ZoneList").toString(), List.class);
|
|
|
|
|
// System.out.println("ZoneList" + ZoneList);
|
|
|
|
|
// for (Map map : ZoneList) {
|
|
|
|
|
// Map zone = JSONObject.parseObject(map.get("Zone").toString(), Map.class);
|
|
|
|
|
// boolean isArming = (boolean) zone.get("isArming");
|
|
|
|
|
// System.out.println(isArming);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<Map> SubSysList = JSONObject.parseObject(alarmHostStatus.get("SubSysList").toString(), List.class);
|
|
|
|
|
// System.out.println("SubSysList" + SubSysList);
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|