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