From 912a185b8f17cfe13d6848ae5d36c3266afd10c1 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Fri, 9 Jul 2021 13:34:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E6=A1=88=E4=BB=B6=E4=B8=8E=E7=BE=A4=E4=BC=97=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E6=A1=88=E4=BB=B6=E9=80=89=E6=8B=A9=E8=81=8C=E8=83=BD=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=E8=BF=87=E6=BB=A4=E6=8E=89=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E4=B8=93=E7=AE=A1=E5=91=98=E7=9A=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/dict/DictAppController.java | 13 +++++++ .../com/cm/systemcity/dao/dict/IDictDao.java | 7 ++++ .../systemcity/service/dict/IDictService.java | 7 ++++ .../service/dict/impl/DictServiceImpl.java | 35 +++++++++++++++++-- .../mybatis/mapper/dict/dict-mapper.xml | 16 +++++++++ 5 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cm/systemcity/controller/app/dict/DictAppController.java b/src/main/java/com/cm/systemcity/controller/app/dict/DictAppController.java index 0940e03..b7e9183 100644 --- a/src/main/java/com/cm/systemcity/controller/app/dict/DictAppController.java +++ b/src/main/java/com/cm/systemcity/controller/app/dict/DictAppController.java @@ -81,4 +81,17 @@ public class DictAppController extends AbstractController { return dictService.listCaseTypeBind(params); } + @ApiOperation(value = "查找绑定职能部门的案件类型及子项(APP特殊案件用)", notes = "查找绑定职能部门的案件类型及子项") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "dictParentId", value = "字典上级ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-bind-case-type-all/{dictParentId}") + public List listBindCaseTypeAll(@PathVariable("dictParentId") String dictParentId) throws SearchException { + Map params = getParams(); + params.put("dictParentId", dictParentId); + return dictService.listBindCaseTypeAll(params); + } + } diff --git a/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java b/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java index bff2288..4bf5c11 100755 --- a/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java +++ b/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java @@ -105,4 +105,11 @@ public interface IDictDao { * @return */ List> listBindDept(Map params); + + /** + * 查询职能部门下所有专管员 + * @param params + * @return + */ + List> listBindDeptUser(Map params); } diff --git a/src/main/java/com/cm/systemcity/service/dict/IDictService.java b/src/main/java/com/cm/systemcity/service/dict/IDictService.java index 8f0d377..970b6c1 100755 --- a/src/main/java/com/cm/systemcity/service/dict/IDictService.java +++ b/src/main/java/com/cm/systemcity/service/dict/IDictService.java @@ -134,4 +134,11 @@ public interface IDictService { * @return */ List listCaseTypeBind(Map params); + + /** + * 查找绑定职能部门的案件类型及子项(APP特殊案件用) + * @param params + * @return + */ + List listBindCaseTypeAll(Map params); } diff --git a/src/main/java/com/cm/systemcity/service/dict/impl/DictServiceImpl.java b/src/main/java/com/cm/systemcity/service/dict/impl/DictServiceImpl.java index 9bb344e..ee12311 100755 --- a/src/main/java/com/cm/systemcity/service/dict/impl/DictServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/dict/impl/DictServiceImpl.java @@ -79,6 +79,19 @@ public class DictServiceImpl extends AbstractService implements IDictService { return dictDTOs; } + @Override + public List listBindCaseTypeAll(Map params) { + // 查找所有绑定部门的案件类型父级列表 + List dictDTOS = listCaseTypeParentBind(params); + for (DictDTO item : dictDTOS){ + params.clear(); + params.put("dictParentId", item.getDictId()); + List subDTOs = listCaseTypeBind(params); + item.setSubDicts(subDTOs); + } + return dictDTOS; + } + @Override public DictDTO getDict(Map params) throws SearchException { return dictDao.getDict(params); @@ -185,7 +198,16 @@ public class DictServiceImpl extends AbstractService implements IDictService { params.put("caseTypeIds",StringUtils.join(caseTypeIds, ",")); List> deptList = dictDao.listBindDept(params); if(deptList != null && deptList.size() > 0){ - bindDictList.add(item); + List deptIds = new ArrayList<>(); + for (Map deptItem :deptList){ + deptIds.add(deptItem.get("department_id").toString()); + } + // 查询部门集合中是否有专管员 + params.put("deptIds",StringUtils.join(deptIds, ",")); + List> deptUserMap = dictDao.listBindDeptUser(params); + if(deptUserMap != null && deptUserMap.size() > 0){ + bindDictList.add(item); + } } } return bindDictList; @@ -204,7 +226,16 @@ public class DictServiceImpl extends AbstractService implements IDictService { params.put("caseTypeIds",StringUtils.join(caseTypeIds, ",")); List> deptList = dictDao.listBindDept(params); if(deptList != null && deptList.size() > 0){ - bindDictList.add(item); + List deptIds = new ArrayList<>(); + for (Map deptItem :deptList){ + deptIds.add(deptItem.get("department_id").toString()); + } + // 查询部门集合中是否有专管员 + params.put("deptIds",StringUtils.join(deptIds, ",")); + List> deptUserMap = dictDao.listBindDeptUser(params); + if(deptUserMap != null && deptUserMap.size() > 0){ + bindDictList.add(item); + } } } return bindDictList; diff --git a/src/main/resources/mybatis/mapper/dict/dict-mapper.xml b/src/main/resources/mybatis/mapper/dict/dict-mapper.xml index e8ed69c..52588d5 100755 --- a/src/main/resources/mybatis/mapper/dict/dict-mapper.xml +++ b/src/main/resources/mybatis/mapper/dict/dict-mapper.xml @@ -223,4 +223,20 @@ where is_delete = '0' AND FIND_IN_SET(case_type, #{caseTypeIds}) + + + + \ No newline at end of file