From 258a425d451965c11ad923a7d3748c6dab6e8053 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 7 Apr 2020 18:03:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8C=89=E7=85=A7=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datadictionary/DataDictionaryController.java | 10 ++++++++++ .../datadictionary/IDataDictionaryService.java | 9 ++++++++- .../impl/DataDictionaryServiceImpl.java | 7 +++++++ .../mapper/datadictionary/datadictionary-mapper.xml | 13 +++++++++++-- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java index f9758ad..cf1ba96 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/controller/apis/datadictionary/DataDictionaryController.java @@ -135,4 +135,14 @@ public class DataDictionaryController extends AbstractController { return dataDictionaryService.listZTreeDictionary(params); } + @ApiOperation(value = "字典列表(通过字典编码)", notes = "字典列表(通过字典编码)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "dictionaryCode", value = "字典编码", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listdictionarybydictionarycode/{dictionaryCode}") + public List listDictionaryByDictionaryCode(@PathVariable("dictionaryCode") String dictionaryCode) { + return dataDictionaryService.listDictionaryByDictionaryCode(dictionaryCode); + } + } diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java index ac3a417..a7c3bc1 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/IDataDictionaryService.java @@ -148,5 +148,12 @@ public interface IDataDictionaryService { */ List listZTreeDictionary(Map params) throws SearchException; - + /** + * 字典列表(通过字典编码) + * + * @param dictionaryCode + * @return + * @throws SearchException + */ + List listDictionaryByDictionaryCode(String dictionaryCode) throws SearchException; } diff --git a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java index 8d20016..cae2046 100644 --- a/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java +++ b/cloud-common-plugin-dictionary/src/main/java/com/cm/common/plugin/service/datadictionary/impl/DataDictionaryServiceImpl.java @@ -170,6 +170,13 @@ public class DataDictionaryServiceImpl extends AbstractService implements IDataD return zTreeDTOs; } + @Override + public List listDictionaryByDictionaryCode(String dictionaryCode) throws SearchException { + Map params = getHashMap(1); + params.put("dictionaryCode", dictionaryCode); + return dictionaryDao.listDictionary(params); + } + /** * 递归查询子组 * 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 d4cdfa6..ca16b6f 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 @@ -104,7 +104,12 @@