| 
					
				 | 
			
			
				@ -9,7 +9,6 @@ import com.yihu.iot.service.common.MyJdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.iot.service.device.IotPatientDeviceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.iot.service.equipment.IotEqtDetailService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.iot.service.label.FigureLabelSerachService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.iot.dict.IotSystemDictDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.iot.util.excel.hibernate.HibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.MixEnvelop; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.http.HttpClientUtil; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -43,6 +42,12 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String appid; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${spring.wlyy.appsecret}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String appSecret; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.id}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String wxId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.flag}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private boolean flag; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public static Map<String,String> tokenMap = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -54,13 +59,13 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private FigureLabelSerachService figureLabelSerachService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private IotEqtDetailService iotEqtDetailService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private IotEquipmentDetailDao iotEquipmentDetailDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HibenateUtils hibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private IotSystemDictDao iotSystemDictDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private IotEqtDetailService iotEqtDetailService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取位置信息 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -177,10 +182,40 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return jsonObject.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /*private String dealSql(Map<String, Object> params){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String dealSql(Map<String, Object> params){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        StringBuffer sql = new StringBuffer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql.append() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql.append("select count(1) AS \"total\",t.belong_are AS \"belong_are\",t.belong_are_code AS \"belong_are_code\" from iot_equipmet_detail t "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql.append(" where 1=1 "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null!=params.get("area")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql.append(" and t.belong_are = '"+params.get("area").toString()+"'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null!=params.get("startTime")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //sql.append(" and t.update_time > '" + beginTime+"'");//DateUtil.stringToDate(beginTime,"yyyy-MM-dd HH:mm:ss") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql.append( " and t.create_time >= str_to_date('" + params.get("startTime").toString() + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql.append(  " and t.create_time >= to_date('" + params.get("startTime").toString() + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql.append( " AND t.create_time >='" + params.get("startTime").toString() + " 00:00:00'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (null!=params.get("endTime")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //sql.append(" and t.update_time < '" + endTime+"'");//DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql.append( " and t.create_time <= str_to_date('" + params.get("endTime").toString() + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql.append(  " and t.create_time <= to_date('" + params.get("endTime").toString() + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql.append( " AND t.create_time <='" + params.get("endTime").toString() + " 00:00:00'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql.append(" group by t.belong_are_code order by \"total\" desc "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return sql.toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 慢病患者情况-统计 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -648,7 +683,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject totalRange(String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 String deviceType,String area,String hospital,String quotaCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 String deviceType,String area,String hospital,String quotaCode){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/totalRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("startTime",startTime); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -675,7 +710,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject diseaseUseRange(String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                      String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/diseaseUseRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("startTime",startTime); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -701,7 +736,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject diseaseRange(String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                     String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/diseaseRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("startTime",startTime); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -728,7 +763,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject yellowOrRedRange(String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String deviceType,String area,String hospital,Integer diseaseCondition){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                       String deviceType,String area,String hospital,Integer diseaseCondition){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/yellowOrRedRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("startTime",startTime); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -757,7 +792,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONArray warningInformationAlarm_new(Integer page,Integer pageSize,String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                  String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/warningInformationAlarm_new"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("page",page); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -786,7 +821,7 @@ public class MonitorPlatformService  { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject yellowAndRedRange(String startTime,String endTime, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                                 String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                        String deviceType,String area,String hospital){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "/wlyygc/iot_monitoring/yellowAndRedRange"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String, Object> params = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        params.put("startTime",startTime); 
			 |