| 
					
				 | 
			
			
				@ -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,10 +72,12 @@ 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; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String deviceSN = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sceneUrl = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (int i=0;i<tmpArr.size();i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject tmpObj = tmpArr.getJSONObject(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String msgType = tmpObj.getString("msgType"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -92,6 +95,13 @@ public class YsDeviceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                if ("tumble_detection".equals(alarmType)){//tumble_detection跌倒类型    //有人出现SmartHumanDet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    fallFlag = true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    deviceSN = bodyJsonObj2.getString("devSerial");//设备SN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    if (bodyJsonObj2.containsKey("pictureList")&&bodyJsonObj2.getJSONArray("pictureList")!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                        JSONArray pictureList = bodyJsonObj2.getJSONArray("pictureList"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                        if (pictureList.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            JSONObject tmp = pictureList.getJSONObject(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                            sceneUrl = tmp.getString("url");//现场照片 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -133,10 +143,11 @@ public class YsDeviceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    jsonObject.put("serveLat",lat); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    jsonObject.put("serveLon",lon); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    jsonObject.put("topicItem","preventFall"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    jsonObject.put("sceneImg",sceneUrl); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    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 +159,7 @@ public class YsDeviceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("萤石摄像机消息推送:"+result.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return result; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -162,7 +174,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()); 
			 |