From b2e4845b84b23aa3f9cc01141c74a8a27c56c17a Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期一, 13 三月 2023 10:52:39 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/all/BaseQueryController.java | 105 +++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 79 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/lf/server/controller/all/BaseQueryController.java b/src/main/java/com/lf/server/controller/all/BaseQueryController.java index 3d2b6c5..42f5448 100644 --- a/src/main/java/com/lf/server/controller/all/BaseQueryController.java +++ b/src/main/java/com/lf/server/controller/all/BaseQueryController.java @@ -19,6 +19,7 @@ import com.lf.server.mapper.all.BasicMapper; import com.lf.server.mapper.all.GeomBaseMapper; import com.lf.server.service.all.BaseQueryService; +import com.lf.server.service.data.DictService; import com.lf.server.service.data.DirService; import com.lf.server.service.data.DownloadService; import com.lf.server.service.data.MetaService; @@ -65,6 +66,9 @@ @Autowired BaseQueryService baseQueryService; + @Autowired + DictService dictService; + @SysLog() @ApiOperation(value = "鏌ヨ璁板綍鏁�") @ApiImplicitParams({ @@ -89,7 +93,7 @@ return success(count); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -132,7 +136,24 @@ return success(paged.getTotal(), paged.getRecords()); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); + } + } + + @SysLog() + @ApiOperation(value = "缂撳啿鍖烘煡璇�") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "鏄犲皠鍚嶇О", dataType = "String", paramType = "query", example = "dlgagnp"), + @ApiImplicitParam(name = "wkt", value = "WKT锛堣憲鍚嶆枃鏈級", dataType = "String", paramType = "query", example = ""), + @ApiImplicitParam(name = "limit", value = "闄愬埗鏉℃暟", dataType = "Integer", paramType = "query", example = "20") + }) + @GetMapping(value = "/selectByBuffer") + public ResponseMsg<List<Object>> selectByBuffer(String name, String wkt, Integer limit) { + try { + + return success(0, null); + } catch (Exception ex) { + return fail(ex, null); } } @@ -163,7 +184,7 @@ return success(count, rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -193,7 +214,7 @@ return success(wkt); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -228,7 +249,7 @@ return success(rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -244,7 +265,7 @@ return success(rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -260,20 +281,24 @@ return success(rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @SysLog() @ApiOperation(value = "鏌ヨ鎵�鏈夎〃") + @ApiImplicitParams({ + @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "鐐�"), + @ApiImplicitParam(name = "hasGeom", value = "鍚湁Geom瀛楁", dataType = "Boolean", paramType = "query", example = "false") + }) @GetMapping(value = "/selectTabs") - public ResponseMsg<List<TabEntity>> selectTabs() { + public ResponseMsg<List<TabEntity>> selectTabs(String name, Boolean hasGeom) { try { - List<TabEntity> list = baseQueryService.selectTabs(); + List<TabEntity> list = dictService.selectDictTab(name, null == hasGeom || !hasGeom ? "gid" : "geom"); return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -284,10 +309,11 @@ @ApiImplicitParam(name = "depcode", value = "鍗曚綅缂栫爜", dataType = "String", paramType = "query", example = "00"), @ApiImplicitParam(name = "dirs", value = "鐩綍缂栫爜", dataType = "String", paramType = "query", example = "00,01"), @ApiImplicitParam(name = "tab", value = "琛ㄥ悕", dataType = "String", paramType = "query", example = "dlg_"), + @ApiImplicitParam(name = "hasGeom", value = "鍚湁Geom瀛楁", dataType = "Boolean", paramType = "query", example = "false"), @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") }) - public ResponseMsg<List<TabEntity>> selectTabsByPage(String depcode, String dirs, String tab, Integer pageSize, Integer pageIndex) { + public ResponseMsg<Object> selectTabsByPage(String depcode, String dirs, String tab, Boolean hasGeom, Integer pageSize, Integer pageIndex) { try { if (pageSize < 1 || pageIndex < 1) { return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null); @@ -305,16 +331,17 @@ filters += String.format(" and (%s)", dirs); } - int count = baseQueryService.selectTabsForCount(tab); + String field = null == hasGeom || !hasGeom ? "gid" : "geom"; + int count = baseQueryService.selectTabsForCount(tab, field); if (count == 0) { return success(0, null); } - List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, filters, pageSize, pageSize * (pageIndex - 1)); + List<TabEntity> rs = baseQueryService.selectTabsByPage(tab, field, filters, pageSize, pageSize * (pageIndex - 1)); return success(count, rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -341,7 +368,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -362,7 +389,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -389,7 +416,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -410,7 +437,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -430,7 +457,7 @@ return success(rows); } catch (Exception ex) { - return fail(ex.getMessage(), 0); + return fail(ex, 0); } } @@ -456,7 +483,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -476,7 +503,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -512,7 +539,7 @@ return success(guid); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -544,8 +571,18 @@ return success(guid); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } + } + + @SysLog() + @ApiOperation(value = "鏌ョ湅鏂囦欢") + @ApiImplicitParams({ + @ApiImplicitParam(name = "guid", value = "闄勪欢Guid", dataType = "String", paramType = "body") + }) + @GetMapping(value = "/downloadForView") + public void downloadForView(String guid, HttpServletResponse res) { + metaService.downloadForView(guid, true, res); } @SysLog() @@ -575,7 +612,7 @@ return success(count, rs); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -591,7 +628,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -607,7 +644,23 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); + } + } + + @SysLog() + @ApiOperation(value = "鏍规嵁鍏冩暟鎹甀D鏌ヨ") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") + }) + @GetMapping(value = "/selectMetaById") + public ResponseMsg<MetaEntity> selectMetaById(int id) { + try { + MetaEntity entity = metaService.selectById(id); + + return success(entity); + } catch (Exception ex) { + return fail(ex, null); } } } \ No newline at end of file -- Gitblit v1.9.3