| | |
| | | */ |
| | | public static final String GRID_GET_EVENT_INFO_AREA_ID_URL = "http://171.217.92.33:53303/area/getAreaGridTreeByAreaId"; |
| | | /** |
| | | * 通过AREAID获取辖区网格数据列表 |
| | | */ |
| | | public static final String GRID_GET_GRID_DATA_AREA_ID_URL = "http://171.217.92.33:53303/gridDefined/getGridInfoByAreaId"; |
| | | /** |
| | | * 获取所有或者根据姓名和工号查询,分页 |
| | | */ |
| | | public static final String GRID_GET_GETALL_SEARCH_PAGE_URL = "http://171.217.92.33:53303/gridOperator/getAllOrSearchByPage?areaId=jhRxqEQp&limit=200&page=1"; |
| | |
| | | } |
| | | |
| | | /** |
| | | * description 获取指定区域网格列表 |
| | | * description 获取指定区域网格列表,树形结构。不包括具体的网格数据。 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | @ApiOperation(value = "获取指定区域网格树形列表,不包括具体的网格数据") |
| | | @GetMapping("lc/grid/tree") |
| | | public R getGridTreeByAreaId(String areaId) { |
| | | try { |
| | | return R.ok(lcApiService.getGridTreeByAreaId(areaId)); |
| | | } catch (Exception e) { |
| | | log.error("获取指定区域网格列表出现错误:{}", e.getMessage()); |
| | | } |
| | | return R.ok(Collections.emptyList()); |
| | | } |
| | | |
| | | /** |
| | | * description 获取指定区域网格数据列表 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 事件信息 |
| | |
| | | */ |
| | | @ApiOperation(value = "获取指定区域网格列表") |
| | | @GetMapping("lc/grid/list") |
| | | public R getGridListByAreaId(String areaId) { |
| | | public R getGridDataListByAreaId(String areaId) { |
| | | try { |
| | | return R.ok(lcApiService.getGridListByAreaId(areaId)); |
| | | return R.ok(lcApiService.getGridDataListByAreaId(areaId)); |
| | | } catch (Exception e) { |
| | | log.error("获取指定区域网格列表出现错误:{}", e.getMessage()); |
| | | } |
| | | return R.ok(Collections.emptyList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * description 流动人口 走访详情 |
| | | * |
| | |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | List<LcGridData> getGridListByAreaId(String areaId); |
| | | List<LcGridData> getGridTreeByAreaId(String areaId); |
| | | |
| | | /** |
| | | * description 获取指定区域网格列表,直接返回网格列表 |
| | | * |
| | | * @param areaId 区域ID |
| | | * @return String 事件信息 |
| | | * @author manailin |
| | | * @date 2021/6/10 17:00 |
| | | */ |
| | | List<LcGridData> getGridDataListByAreaId(String areaId); |
| | | /** |
| | | * description 获取所有或者根据姓名和工号查询,分页 |
| | | * |
| | | * @param areaId 区域ID |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<LcGridData> getGridListByAreaId(String areaId) { |
| | | public List<LcGridData> getGridTreeByAreaId(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_GET_EVENT_INFO_AREA_ID_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | request.form("level", 4); |
| | | HttpResponse result = request.execute(); |
| | | return JSONArray.parseArray(result.body(), LcGridData.class); |
| | | } |
| | | |
| | | @Override |
| | | public List<LcGridData> getGridDataListByAreaId(String areaId) { |
| | | HttpRequest request = HttpUtil.createPost(LcApiConstants.GRID_GET_GRID_DATA_AREA_ID_URL); |
| | | request.auth(getAuthToken()); |
| | | request.form("areaId", areaId); |
| | | HttpResponse result = request.execute(); |
| | | return JSONArray.parseArray(result.body(), LcGridData.class); |
| | | } |
| | |
| | | @Test |
| | | void getGridListByAreaId() { |
| | | //jhRxqEQp 代表西区 |
| | | List<LcGridData> list = lcApiService.getGridListByAreaId("jhRxqEQp"); |
| | | List<LcGridData> list = lcApiService.getGridTreeByAreaId("jhRxqEQp"); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | void getGridDataListByAreaId() { |
| | | //jhRxqEQp 代表西区 |
| | | List<LcGridData> list = lcApiService.getGridDataListByAreaId("2Fxq97CC"); |
| | | String pretty = JSONArray.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, |
| | | SerializerFeature.WriteDateUseDateFormat); |
| | | log.info(pretty); |