|  | @ -12,10 +12,7 @@ import org.elasticsearch.index.query.QueryBuilders;
 | 
												
													
														
															|  | import org.elasticsearch.search.builder.SearchSourceBuilder;
 |  | import org.elasticsearch.search.builder.SearchSourceBuilder;
 | 
												
													
														
															|  | import org.springframework.beans.factory.annotation.Autowired;
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
													
														
															|  | import org.springframework.http.MediaType;
 |  | import org.springframework.http.MediaType;
 | 
												
													
														
															|  | import org.springframework.web.bind.annotation.PostMapping;
 |  | 
 | 
												
													
														
															|  | import org.springframework.web.bind.annotation.RequestBody;
 |  | 
 | 
												
													
														
															|  | import org.springframework.web.bind.annotation.RequestMapping;
 |  | 
 | 
												
													
														
															|  | import org.springframework.web.bind.annotation.RestController;
 |  | 
 | 
												
													
														
															|  | 
 |  | import org.springframework.web.bind.annotation.*;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | @RestController
 |  | @RestController
 | 
												
													
														
															|  | @RequestMapping(DataRequestMapping.api_iot_common)
 |  | @RequestMapping(DataRequestMapping.api_iot_common)
 | 
												
											
												
													
														
															|  | @ -27,10 +24,10 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_data_search_one, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_data_search_one, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "查询单条数据", notes = "根据id查询单条数据")
 |  |     @ApiOperation(value = "查询单条数据", notes = "根据id查询单条数据")
 | 
												
													
														
															|  |     public Envelop getOne(@ApiParam(name = "id", value = "", defaultValue = "") @RequestBody String id){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getOne(
 | 
												
													
														
															|  | 
 |  |             @ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             String jsonData = "{\"id\":" + id + "}";
 |  | 
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataSearch.message_success,dataSearchService.getData(jsonData,1,1));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -38,9 +35,11 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "查询数据", notes = "根据条件查询数据")
 |  |     @ApiOperation(value = "查询数据", notes = "根据条件查询数据")
 | 
												
													
														
															|  |     public Envelop getList(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getList(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                            @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                            @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataSearch.message_success,dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -48,9 +47,11 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list_page, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list_page, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "查询数据,分页", notes = "根据条件查询数据,分页")
 |  |     @ApiOperation(value = "查询数据,分页", notes = "根据条件查询数据,分页")
 | 
												
													
														
															|  |     public Envelop getListPage(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getListPage(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                                @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                                @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataSearch.message_success,dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -58,9 +59,11 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_recent5, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_recent5, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "获取最近5条数据", notes = "根据居民的体征类型,测量时间获取")
 |  |     @ApiOperation(value = "获取最近5条数据", notes = "根据居民的体征类型,测量时间获取")
 | 
												
													
														
															|  |     public Envelop getRecent5(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getRecent5(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                               @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                               @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataSearch.message_success,dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -68,9 +71,11 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_abnormal_times_a_week, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_abnormal_times_a_week, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "获取居民一周内体征数据异常次数", notes = "血糖或血压体征数据")
 |  |     @ApiOperation(value = "获取居民一周内体征数据异常次数", notes = "血糖或血压体征数据")
 | 
												
													
														
															|  |     public Envelop getAbnormalTimesAWeek(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getAbnormalTimesAWeek(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                                          @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                                          @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataSearch.message_success,dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -78,11 +83,11 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_recent1, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_recent1, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "查询体征数据", notes = "根据居民code和删除标识获取最近一次体征数据")
 |  |     @ApiOperation(value = "查询体征数据", notes = "根据居民code和删除标识获取最近一次体征数据")
 | 
												
													
														
															|  |     public Envelop getOneByCodeAndDel(@ApiParam(name = "userCode", value = "", defaultValue = "") @RequestBody String userCode,
 |  | 
 | 
												
													
														
															|  |                                       @ApiParam(name = "del", value = "", defaultValue = "") @RequestBody String del) {
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getOneByCodeAndDel(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                                       @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                                       @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size) {
 | 
												
													
														
															|  |         try {
 |  |         try {
 | 
												
													
														
															|  |             String jsonData = "{\"userCode\":" + userCode + ",\"del\":" + del + "}";
 |  | 
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success, dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success, dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e) {
 |  |         } catch (ApiException e) {
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
											
												
													
														
															|  | @ -90,17 +95,14 @@ public class DataSearchController {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list_code_del, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 |  |     @PostMapping(value = DataRequestMapping.DataSearch.api_user_search_list_code_del, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
												
													
														
															|  |     @ApiOperation(value = "查询体征数据", notes = "根据居民code和删除标识获取所有体征数据,时间倒序")
 |  |     @ApiOperation(value = "查询体征数据", notes = "根据居民code和删除标识获取所有体征数据,时间倒序")
 | 
												
													
														
															|  |     public Envelop getListByCodeAndDel(
 |  | 
 | 
												
													
														
															|  |             @ApiParam(name = "userCode", value = "", defaultValue = "") @RequestBody String userCode,
 |  | 
 | 
												
													
														
															|  |             @ApiParam(name = "del", value = "", defaultValue = "") @RequestBody String del){
 |  | 
 | 
												
													
														
															|  | 
 |  |     public Envelop getListByCodeAndDel(@ApiParam(name = "json_data", value = "", defaultValue = "") @RequestBody String jsonData,
 | 
												
													
														
															|  | 
 |  |                                        @ApiParam(name = "page", value = "", defaultValue = "") @RequestParam int page,
 | 
												
													
														
															|  | 
 |  |                                        @ApiParam(name = "size", value = "", defaultValue = "") @RequestParam int size){
 | 
												
													
														
															|  |         try{
 |  |         try{
 | 
												
													
														
															|  |             String jsonData = "{\"userCode\":"+userCode+",\"del\":"+ del +"}";
 |  | 
 | 
												
													
														
															|  |             SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
 |  | 
 | 
												
													
														
															|  |             searchSourceBuilder.query(QueryBuilders.matchQuery("user", "kimchy"));
 |  | 
 | 
												
													
														
															|  | //            searchSourceBuilder.query(JSONObject.parseObject(jsonData).);
 |  | 
 | 
												
													
														
															|  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData));
 |  | 
 | 
												
													
														
															|  | 
 |  |             return Envelop.getSuccess(DataRequestMapping.DataInput.message_success,dataSearchService.getData(jsonData,page,size));
 | 
												
													
														
															|  |         } catch (ApiException e){
 |  |         } catch (ApiException e){
 | 
												
													
														
															|  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 |  |             return Envelop.getError(e.getMessage(), e.getErrorCode());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | }
 |  | }
 |