From cb9fbcd27a288d0c61d85fa13ff5fc8eb1f4deab Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期六, 18 三月 2023 16:44:56 +0800 Subject: [PATCH] 1 --- src/main/java/com/lf/server/controller/data/upload/QueryController.java | 82 ++++++++++++++++++++++++++++++++++------- 1 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/lf/server/controller/data/upload/QueryController.java b/src/main/java/com/lf/server/controller/data/upload/QueryController.java index ff25858..6b3df40 100644 --- a/src/main/java/com/lf/server/controller/data/upload/QueryController.java +++ b/src/main/java/com/lf/server/controller/data/upload/QueryController.java @@ -53,6 +53,40 @@ @Autowired protected BaseQueryService baseQueryService; + @Autowired + DictService dictService; + + @SysLog() + @ApiOperation(value = "鏍规嵁鐖禝D鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") + @ApiImplicitParams({ + @ApiImplicitParam(name = "metaid", value = "鐖禝D", dataType = "String", paramType = "query", example = "0"), + @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = ""), + @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), + @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") + }) + @GetMapping(value = "/selectPageAndCountByPid") + public ResponseMsg<List<MetaEntity>> selectPageAndCountByPid(Integer metaid, String name, Integer pageSize, Integer pageIndex) { + try { + if (pageSize < 1 || pageIndex < 1) { + return fail("姣忛〉椤垫暟鎴栧垎椤垫暟灏忎簬1", null); + } + if (null == metaid || metaid < 1) { + return fail("鐖禝D涓嶈兘涓虹┖涓斿ぇ浜�1", null); + } + + int count = metaService.selectCountByPid(metaid, name); + if (count == 0) { + return success(0, null); + } + + List<MetaEntity> rs = metaService.selectPageByPid(metaid, name, pageSize, pageSize * (pageIndex - 1)); + + return success(count, rs); + } catch (Exception ex) { + return fail(ex, null); + } + } + @SysLog() @ApiOperation(value = "鏌ヨ鎵�鏈夊崟浣�") @GetMapping(value = "/selectDepAll") @@ -62,7 +96,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -75,7 +109,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -98,7 +132,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -114,7 +148,7 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -127,20 +161,24 @@ return success(list); } 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); } } @@ -161,14 +199,14 @@ return success(list); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @SysLog() @ApiOperation(value = "鏌ヨ琛ㄤ腑鏁版嵁") @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "婧愭暟鎹甀D", dataType = "Integer", paramType = "query", example = "115"), + @ApiImplicitParam(name = "id", value = "鍏冩暟鎹甀D", dataType = "Integer", paramType = "query", example = "115"), @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1"), @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10") }) @@ -177,12 +215,12 @@ // noinspection AlibabaRemoveCommentedCode try { if (null == id || id < 0) { - return fail("婧愭暟鎹甀D涓嶈兘涓虹┖鎴栧皬浜�0", null); + return fail("鍏冩暟鎹甀D涓嶈兘涓虹┖鎴栧皬浜�0", null); } MetaEntity meta = metaService.selectById(id); if (null == meta || null == meta.getTab() || !meta.getTab().contains(StaticData.POINT)) { - return fail("鎵句笉鍒版簮鏁版嵁淇℃伅", null); + return fail("鎵句笉鍒板厓鏁版嵁淇℃伅", null); } String entity = meta.getTab().substring(meta.getTab().indexOf(".") + 1).replace("_", "").toLowerCase(); @@ -200,7 +238,7 @@ return success(paged.getTotal(), paged.getRecords()); } catch (Exception ex) { - return fail(ex.getMessage(), null); + return fail(ex, null); } } @@ -229,7 +267,23 @@ return success(count, 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); } } } -- Gitblit v1.9.3