|
@ -11,6 +11,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.util.common.LatitudeUtils;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.utils.encode.Base64;
|
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@ -71,6 +72,7 @@ public class YsDeviceService {
|
|
|
JSONObject result = new JSONObject();
|
|
|
try {
|
|
|
String decodeStr = messageDecrypt(message,YsConfig.msgDataKey);
|
|
|
decodeStr = StringEscapeUtils.unescapeJava(decodeStr);
|
|
|
result = JSONObject.parseObject(decodeStr);
|
|
|
JSONArray tmpArr = result.getJSONObject("eps").getJSONArray("alert");
|
|
|
boolean fallFlag = false;
|
|
@ -136,7 +138,7 @@ public class YsDeviceService {
|
|
|
JSONObject jsonObjectParam = new JSONObject();
|
|
|
jsonObjectParam.put("order", jsonObject);
|
|
|
map.put("jsonData", jsonObjectParam.toJSONString());
|
|
|
map.put("orderSource", 2);
|
|
|
map.put("orderSource", 4);
|
|
|
map.put("warnStr", "疑似跌倒");
|
|
|
|
|
|
String content = com.alibaba.fastjson.JSONObject.toJSONString(map);
|
|
@ -148,6 +150,7 @@ public class YsDeviceService {
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
logger.info("萤石摄像机消息推送:"+result.toString());
|
|
|
return result;
|
|
@ -162,7 +165,7 @@ public class YsDeviceService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public String messageDecrypt(String sSrc, String sKey) throws Exception {
|
|
|
public static String messageDecrypt(String sSrc, String sKey) throws Exception {
|
|
|
try {
|
|
|
byte[] raw = sKey.getBytes("utf-8");
|
|
|
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
|