|  | @ -3,9 +3,12 @@ package com.yihu.iot.service.monitorPlatform;
 | 
												
													
														
															|  | import com.alibaba.fastjson.JSON;
 |  | import com.alibaba.fastjson.JSON;
 | 
												
													
														
															|  | import com.alibaba.fastjson.JSONArray;
 |  | import com.alibaba.fastjson.JSONArray;
 | 
												
													
														
															|  | import com.alibaba.fastjson.JSONObject;
 |  | import com.alibaba.fastjson.JSONObject;
 | 
												
													
														
															|  | 
 |  | import com.yihu.iot.dao.dict.IotSystemDictDao;
 | 
												
													
														
															|  | import com.yihu.iot.service.common.MyJdbcTemplate;
 |  | import com.yihu.iot.service.common.MyJdbcTemplate;
 | 
												
													
														
															|  | import com.yihu.iot.service.device.IotPatientDeviceService;
 |  | import com.yihu.iot.service.device.IotPatientDeviceService;
 | 
												
													
														
															|  | 
 |  | import com.yihu.iot.service.equipment.IotEqtDetailService;
 | 
												
													
														
															|  | import com.yihu.iot.service.label.FigureLabelSerachService;
 |  | import com.yihu.iot.service.label.FigureLabelSerachService;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
 | 
												
													
														
															|  | import com.yihu.jw.restmodel.web.MixEnvelop;
 |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
												
													
														
															|  | import com.yihu.jw.util.http.HttpClientUtil;
 |  | import com.yihu.jw.util.http.HttpClientUtil;
 | 
												
													
														
															|  | import io.swagger.annotations.ApiOperation;
 |  | import io.swagger.annotations.ApiOperation;
 | 
												
											
												
													
														
															|  | @ -46,6 +49,10 @@ public class MonitorPlatformService  {
 | 
												
													
														
															|  |     private MyJdbcTemplate myJdbcTemplate;
 |  |     private MyJdbcTemplate myJdbcTemplate;
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private FigureLabelSerachService figureLabelSerachService;
 |  |     private FigureLabelSerachService figureLabelSerachService;
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private IotSystemDictDao iotSystemDictDao;
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private IotEqtDetailService iotEqtDetailService;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 获取位置信息
 |  |      * 获取位置信息
 | 
												
											
												
													
														
															|  | @ -426,21 +433,87 @@ public class MonitorPlatformService  {
 | 
												
													
														
															|  |         String response = sendGet(url,params);
 |  |         String response = sendGet(url,params);
 | 
												
													
														
															|  |         JSONObject json = JSONObject.parseObject(response);
 |  |         JSONObject json = JSONObject.parseObject(response);
 | 
												
													
														
															|  |         if(json.getInteger("status")==200){
 |  |         if(json.getInteger("status")==200){
 | 
												
													
														
															|  | 
 |  |             IotSystemDictDO iotSystemDictDO = iotSystemDictDao.findByDictNameAndValueAndDel("DEVICE_TYPE","健康小屋",1);
 | 
												
													
														
															|  |             JSONArray jsonArray = json.getJSONArray("data");
 |  |             JSONArray jsonArray = json.getJSONArray("data");
 | 
												
													
														
															|  |             for (int i=0;i<jsonArray.size();i++){
 |  | 
 | 
												
													
														
															|  |                 JSONObject jo = jsonArray.getJSONObject(i);
 |  | 
 | 
												
													
														
															|  |                 String tmp = jo.getString("type");
 |  | 
 | 
												
													
														
															|  |                 if("1".equals(tmp)){
 |  | 
 | 
												
													
														
															|  |                     jo.put("typeName","血糖仪");
 |  | 
 | 
												
													
														
															|  |                 }else if("2".equals(tmp)){
 |  | 
 | 
												
													
														
															|  |                     jo.put("typeName","血压计");
 |  | 
 | 
												
													
														
															|  |                 }else if("3".equals(tmp)){
 |  | 
 | 
												
													
														
															|  |                     jo.put("typeName","智能药盒");
 |  | 
 | 
												
													
														
															|  |                 }else if("4".equals(tmp)){
 |  | 
 | 
												
													
														
															|  |                     jo.put("typeName","智能手表");
 |  | 
 | 
												
													
														
															|  | 
 |  |             String[] str =deviceType.split(",");
 | 
												
													
														
															|  | 
 |  |             List<String> list = new ArrayList<>();
 | 
												
													
														
															|  | 
 |  |             for (int i=0;i<str.length;i++){
 | 
												
													
														
															|  | 
 |  |                 list.add(str[i]);
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |             if (iotSystemDictDO!=null){
 | 
												
													
														
															|  | 
 |  |                 if (!list.contains(iotSystemDictDO.getCode())){
 | 
												
													
														
															|  | 
 |  |                     for (int i=0;i<jsonArray.size();i++){
 | 
												
													
														
															|  | 
 |  |                         JSONObject jo = jsonArray.getJSONObject(i);
 | 
												
													
														
															|  | 
 |  |                         String tmp = jo.getString("type");
 | 
												
													
														
															|  | 
 |  |                         if("1".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                             jo.put("typeName","血糖仪");
 | 
												
													
														
															|  | 
 |  |                         }else if("2".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                             jo.put("typeName","血压计");
 | 
												
													
														
															|  | 
 |  |                         }else if("3".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                             jo.put("typeName","智能药盒");
 | 
												
													
														
															|  | 
 |  |                         }else if("4".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                             jo.put("typeName","智能手表");
 | 
												
													
														
															|  | 
 |  |                         }
 | 
												
													
														
															|  | 
 |  |                     }
 | 
												
													
														
															|  | 
 |  |                 }else {
 | 
												
													
														
															|  | 
 |  |                     if (jsonArray!=null&&jsonArray.size()!=0){
 | 
												
													
														
															|  | 
 |  |                         for (int i=0;i<jsonArray.size();i++){
 | 
												
													
														
															|  | 
 |  |                             JSONObject jo = jsonArray.getJSONObject(i);
 | 
												
													
														
															|  | 
 |  |                             String tmp = jo.getString("type");
 | 
												
													
														
															|  | 
 |  |                             if("1".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                                 jo.put("typeName","血糖仪");
 | 
												
													
														
															|  | 
 |  |                             }else if("2".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                                 jo.put("typeName","血压计");
 | 
												
													
														
															|  | 
 |  |                             }else if("3".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                                 jo.put("typeName","智能药盒");
 | 
												
													
														
															|  | 
 |  |                             }else if("4".equals(tmp)){
 | 
												
													
														
															|  | 
 |  |                                 jo.put("typeName","智能手表");
 | 
												
													
														
															|  | 
 |  |                             }
 | 
												
													
														
															|  | 
 |  |                         }
 | 
												
													
														
															|  | 
 |  |                         if (org.apache.commons.lang3.StringUtils.isNoneBlank(hospital)){
 | 
												
													
														
															|  | 
 |  |                             JSONObject jsonObject= new JSONObject();
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("type",iotSystemDictDO.getCode());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("typeName",iotSystemDictDO.getValue());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("signNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("unSignNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonArray.add(jsonObject);
 | 
												
													
														
															|  | 
 |  |                         }else {
 | 
												
													
														
															|  | 
 |  |                             Long count = iotEqtDetailService.findCountByHealthHourse(startTime,endTime,area);
 | 
												
													
														
															|  | 
 |  |                             JSONObject jsonObject= new JSONObject();
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("type",iotSystemDictDO.getCode());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("typeName",iotSystemDictDO.getValue());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("signNum",count);
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("unSignNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonArray.add(jsonObject);
 | 
												
													
														
															|  | 
 |  |                         }
 | 
												
													
														
															|  | 
 |  |                     }else {
 | 
												
													
														
															|  | 
 |  |                         if (org.apache.commons.lang3.StringUtils.isNoneBlank(hospital)){
 | 
												
													
														
															|  | 
 |  |                             jsonArray = new JSONArray();
 | 
												
													
														
															|  | 
 |  |                             JSONObject jsonObject= new JSONObject();
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("type",iotSystemDictDO.getCode());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("typeName",iotSystemDictDO.getValue());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("signNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("unSignNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonArray.add(jsonObject);
 | 
												
													
														
															|  | 
 |  |                         }else {
 | 
												
													
														
															|  | 
 |  |                             Long count = iotEqtDetailService.findCountByHealthHourse(startTime,endTime,area);
 | 
												
													
														
															|  | 
 |  |                             jsonArray = new JSONArray();
 | 
												
													
														
															|  | 
 |  |                             JSONObject jsonObject= new JSONObject();
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("type",iotSystemDictDO.getCode());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("typeName",iotSystemDictDO.getValue());
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("signNum",count);
 | 
												
													
														
															|  | 
 |  |                             jsonObject.put("unSignNum",0);
 | 
												
													
														
															|  | 
 |  |                             jsonArray.add(jsonObject);
 | 
												
													
														
															|  | 
 |  |                         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                     }
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             return jsonArray;
 |  |             return jsonArray;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 |