From ee47e1ae0067f180fc52d9244c1d0edec22a1d13 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Mon, 27 Jul 2020 14:36:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E8=A1=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=BC=80=E5=90=AF=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/dataarea/DataAreaAppController.java | 55 +++++++++++++++++++ .../DataDictionaryAppController.java | 55 +++++++++++++++++++ .../pojo/dtos/dataarea/DataAreaDTO.java | 4 +- .../datadictionary/DataDictionaryDTO.java | 3 +- .../mapper/dataarea/dataarea-mapper.xml | 14 +++-- .../datadictionary/datadictionary-mapper.xml | 14 +++-- 6 files changed, 131 insertions(+), 14 deletions(-) diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/dataarea/DataAreaAppController.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/dataarea/DataAreaAppController.java index 2b72f8c..522403d 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/dataarea/DataAreaAppController.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/dataarea/DataAreaAppController.java @@ -80,6 +80,16 @@ public class DataAreaAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("getareabyid/{areaId}") public DataAreaDTO getAreaById(@RequestHeader("token") String token, @PathVariable("areaId") String areaId) { + return getAreaByIdRelease(areaId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典详情(ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典详情(ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "areaId", value = "地区字典ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getareabyid" + ISystemConstant.RELEASE_SUFFIX + "/{areaId}") + public DataAreaDTO getAreaByIdRelease(@PathVariable("areaId") String areaId) { return dataAreaService.getAreaById(areaId); } @@ -91,6 +101,16 @@ public class DataAreaAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listareabyparentid/{areaParentId}") public List listAreaByParentId(@RequestHeader("token") String token, @PathVariable("areaParentId") String areaParentId) { + return listAreaByParentIdRelease(areaParentId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典列表(上级ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典列表(上级ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "areaParentId", value = "地区字典上级ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listareabyparentid" + ISystemConstant.RELEASE_SUFFIX + "/{areaParentId}") + public List listAreaByParentIdRelease(@PathVariable("areaParentId") String areaParentId) { return dataAreaService.listAreaByParentId(areaParentId); } @@ -102,6 +122,16 @@ public class DataAreaAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listareaallbyparentid/{areaParentId}") public List listArea(@RequestHeader("token") String token, @PathVariable("areaParentId") String areaParentId) throws SearchException { + return listAreaAllByParentIdRelease(areaParentId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典全部列表(上级ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "地区字典全部列表(上级ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "areaParentId", value = "地区字典上级ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listareaallbyparentid" + ISystemConstant.RELEASE_SUFFIX + "/{areaParentId}") + public List listAreaAllByParentIdRelease(@PathVariable("areaParentId") String areaParentId) throws SearchException { return dataAreaService.listAreaAllByParentId(areaParentId); } @@ -118,6 +148,21 @@ public class DataAreaAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpagearea") public SuccessResultList> listPageArea(@RequestHeader("token") String token, ListPage page) { + return listPageAreaRelease(page); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "分页地区字典列表", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "分页地区字典列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "parentId", value = "上级ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagearea" + ISystemConstant.RELEASE_SUFFIX) + public SuccessResultList> listPageAreaRelease(ListPage page) { Map params = requestParams(); String areaParentId = "0"; if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_PARENT_ID) == null ? null : params.get(ISystemConstant.PARAMS_PARENT_ID).toString())) { @@ -136,6 +181,16 @@ public class DataAreaAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listztreearea") public List listZTreeArea(@RequestHeader("token") String token) throws SearchException { + return listZTreeAreaRelease(); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "zTree列表", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "zTree列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "父ID", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listztreearea" + ISystemConstant.RELEASE_SUFFIX) + public List listZTreeAreaRelease() throws SearchException { Map params = requestParams(); String areaParentId = "0"; if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_ID) == null ? null : params.get(ISystemConstant.PARAMS_ID).toString())) { diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/datadictionary/DataDictionaryAppController.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/datadictionary/DataDictionaryAppController.java index 893bccc..190b436 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/datadictionary/DataDictionaryAppController.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/app/datadictionary/DataDictionaryAppController.java @@ -80,6 +80,16 @@ public class DataDictionaryAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("getdictionarybyid/{dictionaryId}") public DataDictionaryDTO getDictionaryById(@RequestHeader("token") String token, @PathVariable("dictionaryId") String dictionaryId) { + return getDictionaryByIdRelease(dictionaryId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典详情(ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典详情(ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryId", value = "字典ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getdictionarybyid" + ISystemConstant.RELEASE_SUFFIX + "/{dictionaryId}") + public DataDictionaryDTO getDictionaryByIdRelease(@PathVariable("dictionaryId") String dictionaryId) { return dataDictionaryService.getDictionaryById(dictionaryId); } @@ -91,6 +101,16 @@ public class DataDictionaryAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listdictionarybyparentid/{dictionaryParentId}") public List listDictionaryByParentId(@RequestHeader("token") String token, @PathVariable("dictionaryParentId") String dictionaryParentId) { + return listDictionaryByParentIdRelease(dictionaryParentId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典列表(上级ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典列表(上级ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryParentId", value = "字典上级ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdictionarybyparentid" + ISystemConstant.RELEASE_SUFFIX + "/{dictionaryParentId}") + public List listDictionaryByParentIdRelease(@PathVariable("dictionaryParentId") String dictionaryParentId) { return dataDictionaryService.listDictionaryByParentId(dictionaryParentId); } @@ -102,6 +122,16 @@ public class DataDictionaryAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listdictionaryallbyparentid/{dictionaryParentId}") public List listDictionary(@RequestHeader("token") String token, @PathVariable("dictionaryParentId") String dictionaryParentId) throws SearchException { + return listDictionaryRelease(dictionaryParentId); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典全部列表(上级ID查询)", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "字典全部列表(上级ID查询)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryParentId", value = "字典上级ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdictionaryallbyparentid" + ISystemConstant.RELEASE_SUFFIX + "/{dictionaryParentId}") + public List listDictionaryRelease(@PathVariable("dictionaryParentId") String dictionaryParentId) throws SearchException { return dataDictionaryService.listDictionaryAllByParentId(dictionaryParentId); } @@ -118,6 +148,21 @@ public class DataDictionaryAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listpagedictionary") public SuccessResultList> listPageDictionary(@RequestHeader("token") String token, ListPage page) { + return listPageDictionaryRelease(page); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "分页字典列表", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "分页字典列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "parentId", value = "上级ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpagedictionary" + ISystemConstant.RELEASE_SUFFIX) + public SuccessResultList> listPageDictionaryRelease(ListPage page) { Map params = requestParams(); String dictionaryParentId = "0"; if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_PARENT_ID) == null ? null : params.get(ISystemConstant.PARAMS_PARENT_ID).toString())) { @@ -136,6 +181,16 @@ public class DataDictionaryAppController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("listztreedictionary") public List listZTreeDictionary(@RequestHeader("token") String token) throws SearchException { + return listZTreeDictionaryRelease(); + } + + @ApiOperation(value = ISystemConstant.API_TAGS_RELEASE_PREFIX + "zTree列表", notes = ISystemConstant.API_TAGS_RELEASE_PREFIX + "zTree列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "父ID", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listztreedictionary" + ISystemConstant.RELEASE_SUFFIX) + public List listZTreeDictionaryRelease() throws SearchException { Map params = requestParams(); String dictionaryParentId = "0"; if (!StringUtils.isBlank(params.get(ISystemConstant.PARAMS_ID) == null ? null : params.get(ISystemConstant.PARAMS_ID).toString())) { diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/dataarea/DataAreaDTO.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/dataarea/DataAreaDTO.java index 49a5dcd..b9cbc6f 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/dataarea/DataAreaDTO.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/dataarea/DataAreaDTO.java @@ -3,6 +3,7 @@ package com.cm.common.plugin.pojo.dtos.dataarea; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -17,8 +18,9 @@ import java.util.List; * @Version: 1.0 **/ @ApiModel -public class DataAreaDTO { +public class DataAreaDTO implements Serializable { + private static final long serialVersionUID = 230115030021213880L; @ApiModelProperty(name = "areaId", value = "地区ID") private String areaId; @ApiModelProperty(name = "areaParentId", value = "地区上级ID") diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/datadictionary/DataDictionaryDTO.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/datadictionary/DataDictionaryDTO.java index 21f50c0..82eda99 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/datadictionary/DataDictionaryDTO.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/pojo/dtos/datadictionary/DataDictionaryDTO.java @@ -3,6 +3,7 @@ package com.cm.common.plugin.pojo.dtos.datadictionary; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -17,7 +18,7 @@ import java.util.List; * @Version: 1.0 **/ @ApiModel -public class DataDictionaryDTO { +public class DataDictionaryDTO implements Serializable { @ApiModelProperty(name = "dictionaryId", value = "字典ID") private String dictionaryId; diff --git a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/dataarea/dataarea-mapper.xml b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/dataarea/dataarea-mapper.xml index 5a1cd88..f321d0d 100644 --- a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/dataarea/dataarea-mapper.xml +++ b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/dataarea/dataarea-mapper.xml @@ -2,6 +2,8 @@ + + @@ -26,7 +28,7 @@ - + INSERT INTO data_area( area_parent_id, area_name, @@ -67,7 +69,7 @@ - + UPDATE data_area SET @@ -82,7 +84,7 @@ - + UPDATE data_area SET @@ -126,7 +128,7 @@ - SELECT * FROM @@ -140,7 +142,7 @@ - SELECT area_id, area_parent_id, @@ -222,7 +224,7 @@ - SELECT COUNT(*) FROM diff --git a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml index ca16b6f..59ae73f 100644 --- a/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml +++ b/cloud-common-plugin-dictionary/src/main/resources/mybatis/mapper/datadictionary/datadictionary-mapper.xml @@ -2,6 +2,8 @@ + + @@ -19,7 +21,7 @@ - + INSERT INTO data_dictionary( dictionary_id, dictionary_parent_id, @@ -48,7 +50,7 @@ - + UPDATE data_dictionary SET @@ -63,7 +65,7 @@ - + UPDATE data_dictionary SET @@ -86,7 +88,7 @@ - SELECT * FROM @@ -102,7 +104,7 @@ - SELECT dictionary_id, dictionary_parent_id, @@ -146,7 +148,7 @@ - SELECT t1.*, t2.dictionary_name dictionary_parent_name