|
@ -1049,6 +1049,17 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
|
|
|
devInfoObj.put("routes", locations);
|
|
|
break;
|
|
|
case "7"://报警器 紧急工单
|
|
|
com.alibaba.fastjson.JSONObject response = getAqgDeviceInfo2(deviceSn);
|
|
|
//电量
|
|
|
if (response.containsKey("remaining_power") && response.get("remaining_power") != null) {
|
|
|
devInfoObj.put("remaining_power", response.get("remaining_power"));
|
|
|
}
|
|
|
//在线状态实时获取
|
|
|
if (!response.getBoolean("online")) {//设备在线状态
|
|
|
devInfoObj.put("contactStatus",0);
|
|
|
} else {
|
|
|
devInfoObj.put("contactStatus",1);
|
|
|
}
|
|
|
break;
|
|
|
case "12"://监控 视频地址
|
|
|
com.alibaba.fastjson.JSONObject tmp = ysDeviceService.getDeviceLiveAddress(patient, deviceSn, 1, null);
|
|
@ -1731,17 +1742,19 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
|
|
|
}
|
|
|
|
|
|
public com.alibaba.fastjson.JSONObject getAqgDeviceInfo2(String imei){
|
|
|
try {
|
|
|
String url = MessageFormat.format(AqgConfig.deviceInfo, imei);
|
|
|
HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, null, HttpMethod.GET, getCookie());
|
|
|
com.alibaba.fastjson.JSONObject json = response.getBody();
|
|
|
if(!json.getBoolean("success")){
|
|
|
return null;
|
|
|
synchronized (imei.intern()){
|
|
|
try {
|
|
|
String url = MessageFormat.format(AqgConfig.deviceInfo, imei);
|
|
|
HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, null, HttpMethod.GET, getCookie());
|
|
|
com.alibaba.fastjson.JSONObject json = response.getBody();
|
|
|
if(!json.getBoolean("success")){
|
|
|
return null;
|
|
|
}
|
|
|
return json.getJSONObject("obj");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return null;
|
|
|
}
|
|
|
return json.getJSONObject("obj");
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|