|  | @ -281,6 +281,16 @@ public class MonitorPlatformService  {
 | 
												
													
														
															|  |         return myJdbcTemplate.queryJson(sql.toString(),new Object[]{(page-1)*pageSize,pageSize});
 |  |         return myJdbcTemplate.queryJson(sql.toString(),new Object[]{(page-1)*pageSize,pageSize});
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Integer deviceOverhaulListTotal(String deviceSn){
 | 
												
													
														
															|  | 
 |  |         String sql = "SELECT count(o.id) c from iot_patient_device d,iot_device_overhaul o" +
 | 
												
													
														
															|  | 
 |  |                 " WHERE d.device_sn = '"+deviceSn+"' and d.id = o.patient_device_id ";
 | 
												
													
														
															|  | 
 |  |         List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
 | 
												
													
														
															|  | 
 |  |         if(list.size()>0){
 | 
												
													
														
															|  | 
 |  |             return list.get(0).getInteger("c");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         return 0;
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 入住情况
 |  |      * 入住情况
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
											
												
													
														
															|  | @ -404,11 +414,15 @@ public class MonitorPlatformService  {
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
													
														
															|  |      * 智能设备发放
 |  |      * 智能设备发放
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public JSONArray smartDeviceDistribution(String type,String name){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public JSONArray smartDeviceDistribution(String startTime,String endTime,
 | 
												
													
														
															|  | 
 |  |                                              String deviceType,String area,String hospital){
 | 
												
													
														
															|  |         String url = "/wlyygc/iot_monitoring/smartDeviceDistribution";
 |  |         String url = "/wlyygc/iot_monitoring/smartDeviceDistribution";
 | 
												
													
														
															|  |         Map<String, Object> params = new HashMap<>();
 |  |         Map<String, Object> params = new HashMap<>();
 | 
												
													
														
															|  |         params.put("type",type);
 |  | 
 | 
												
													
														
															|  |         params.put("name",name);
 |  | 
 | 
												
													
														
															|  | 
 |  |         params.put("startTime",startTime);
 | 
												
													
														
															|  | 
 |  |         params.put("endTime",endTime);
 | 
												
													
														
															|  | 
 |  |         params.put("deviceType",deviceType);
 | 
												
													
														
															|  | 
 |  |         params.put("area",area);
 | 
												
													
														
															|  | 
 |  |         params.put("hospital",hospital);
 | 
												
													
														
															|  |         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){
 | 
												
											
												
													
														
															|  | @ -440,7 +454,7 @@ public class MonitorPlatformService  {
 | 
												
													
														
															|  |      * @param deviceSn
 |  |      * @param deviceSn
 | 
												
													
														
															|  |      * @return
 |  |      * @return
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public JSONArray deviceUseData(Integer page,Integer pageSize,String deviceSn){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public JSONObject deviceUseData(Integer page,Integer pageSize,String deviceSn){
 | 
												
													
														
															|  |         String url = "/wlyygc/iot_monitoring/deviceUseData";
 |  |         String url = "/wlyygc/iot_monitoring/deviceUseData";
 | 
												
													
														
															|  |         Map<String, Object> params = new HashMap<>();
 |  |         Map<String, Object> params = new HashMap<>();
 | 
												
													
														
															|  |         params.put("page",page);
 |  |         params.put("page",page);
 | 
												
											
												
													
														
															|  | @ -449,10 +463,10 @@ 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){
 | 
												
													
														
															|  |             return json.getJSONArray("data");
 |  | 
 | 
												
													
														
															|  | 
 |  |             return json.getJSONObject("data");
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return new JSONArray();
 |  | 
 | 
												
													
														
															|  | 
 |  |         return new JSONObject();
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     /**
 |  |     /**
 | 
												
											
												
													
														
															|  | @ -469,7 +483,25 @@ 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){
 | 
												
													
														
															|  |             return json.getJSONObject("data");
 |  | 
 | 
												
													
														
															|  | 
 |  |             JSONObject tmp = json.getJSONObject("data");
 | 
												
													
														
															|  | 
 |  |             //查询物联网获取设备信息
 | 
												
													
														
															|  | 
 |  |             String sql = "SELECT d.device_sn,b.supplier_name supplierName,b.origin_place originPlace,e.product_img productImg" +
 | 
												
													
														
															|  | 
 |  |                     ",e.description  from iot_device d,iot_product_base_info b,iot_product_extend_info e" +
 | 
												
													
														
															|  | 
 |  |                     " WHERE d.device_sn = '"+deviceSn+"' and d.product_id = b.id and d.product_id = e.product_id";
 | 
												
													
														
															|  | 
 |  |             List<JSONObject> list = myJdbcTemplate.queryJson(sql.toString(),new Object[]{});
 | 
												
													
														
															|  | 
 |  |             if(list!=null&&list.size()>0){
 | 
												
													
														
															|  | 
 |  |                 JSONObject js = list.get(0);
 | 
												
													
														
															|  | 
 |  |                 tmp.put("supplierName",js.getString("supplierName"));
 | 
												
													
														
															|  | 
 |  |                 tmp.put("originPlace",js.getString("originPlace"));
 | 
												
													
														
															|  | 
 |  |                 tmp.put("productImg",js.getString("productImg"));
 | 
												
													
														
															|  | 
 |  |                 tmp.put("description",js.getString("description"));
 | 
												
													
														
															|  | 
 |  |             }else{
 | 
												
													
														
															|  | 
 |  |                 tmp.put("supplierName","");
 | 
												
													
														
															|  | 
 |  |                 tmp.put("originPlace","");
 | 
												
													
														
															|  | 
 |  |                 tmp.put("productImg","");
 | 
												
													
														
															|  | 
 |  |                 tmp.put("description","");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |             return tmp;
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return new JSONObject();
 |  |         return new JSONObject();
 |