From 65a5afa26f062d0bc089820aadf38fa33dc10161 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Thu, 8 Jul 2021 15:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BE=A4=E4=BC=97=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/dict/DictAppController.java | 24 +++++++++ .../com/cm/systemcity/dao/dict/IDictDao.java | 6 +++ .../pojo/vos/reportcase/ReportCaseVO.java | 2 +- .../systemcity/service/dict/IDictService.java | 14 ++++++ .../service/dict/impl/DictServiceImpl.java | 50 +++++++++++++++++++ .../impl/ReportCaseAutoAppServiceImpl.java | 3 +- .../mybatis/mapper/dict/dict-mapper.xml | 7 +++ 7 files changed, 103 insertions(+), 3 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 ae19fa3..0940e03 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 @@ -57,4 +57,28 @@ public class DictAppController extends AbstractController { return dictService.listDictAll(params); } + @ApiOperation(value = "查找绑定了部门的案件类型父类型", notes = "查找绑定了部门的案件类型父类型") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-case-type-parent-bind") + public List listCaseTypeParentBind(@RequestHeader("token") String token) throws SearchException { + Map params = getParams(); + return dictService.listCaseTypeParentBind(params); + } + + @ApiOperation(value = "查找绑定了部门的案件类型列表", notes = "查找绑定了部门的案件类型列表") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-case-type-bind/{dictParentId}") + public List listCaseTypeBind(@RequestHeader("token") String token, + @PathVariable("dictParentId") String dictParentId) throws SearchException { + Map params = getParams(); + params.put("dictParentId",dictParentId); + return dictService.listCaseTypeBind(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 ac6cd2a..bff2288 100755 --- a/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java +++ b/src/main/java/com/cm/systemcity/dao/dict/IDictDao.java @@ -99,4 +99,10 @@ public interface IDictDao { */ DictDTO getDictByNameAndParentId(Map params) throws SearchException; + /** + * 查询案件类型是否绑定了职能部门 + * @param params + * @return + */ + List> listBindDept(Map params); } diff --git a/src/main/java/com/cm/systemcity/pojo/vos/reportcase/ReportCaseVO.java b/src/main/java/com/cm/systemcity/pojo/vos/reportcase/ReportCaseVO.java index d086404..f2a2063 100755 --- a/src/main/java/com/cm/systemcity/pojo/vos/reportcase/ReportCaseVO.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/reportcase/ReportCaseVO.java @@ -158,7 +158,7 @@ public class ReportCaseVO { } public String getCaseFlowType() { - return caseFlowType == null ? "2" : caseFlowType; + return caseFlowType == null ? "1" : caseFlowType; } public void setCaseFlowType(String caseFlowType) { 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 b3bc804..8f0d377 100755 --- a/src/main/java/com/cm/systemcity/service/dict/IDictService.java +++ b/src/main/java/com/cm/systemcity/service/dict/IDictService.java @@ -120,4 +120,18 @@ public interface IDictService { * @throws SearchException */ List listEasyUITreeDict(Map params) throws SearchException; + + /** + * 查找绑定了部门的案件类型父类 + * @param params + * @return + */ + List listCaseTypeParentBind(Map params); + + /** + * 查找绑定了部门的案件类型列表 + * @param params + * @return + */ + List listCaseTypeBind(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 3f05391..9bb344e 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 @@ -159,4 +159,54 @@ public class DictServiceImpl extends AbstractService implements IDictService { return dictDao.getDictByNameAndParentId(params); } + @Override + public List listCaseTypeParentBind(Map params) { + /** + * wans 2021年7月8日14:40:33 + * 这里默认查询字典中案件类型的父ID + */ + params.put("dictParentId", "46d108b2-4ef9-4f6f-b30c-0c700e3ee852"); + List dictDTOS = dictDao.listDict(params); + if(dictDTOS == null || dictDTOS.size() == 0){ + return new ArrayList<>(0); + } + // 查询该案件类型下是否绑定了部门 + List bindDictList = new ArrayList<>(); + for (DictDTO item : dictDTOS){ + List caseTypeIds = new ArrayList<>(); + params.put("dictParentId", item.getDictId()); + List subDictDTOs = dictDao.listDict(params); + if(subDictDTOs == null || subDictDTOs.size() == 0){ + continue; + } + for(DictDTO subItem : subDictDTOs){ + caseTypeIds.add(subItem.getDictId()); + } + params.put("caseTypeIds",StringUtils.join(caseTypeIds, ",")); + List> deptList = dictDao.listBindDept(params); + if(deptList != null && deptList.size() > 0){ + bindDictList.add(item); + } + } + return bindDictList; + } + + @Override + public List listCaseTypeBind(Map params) { + List dictDTOS = dictDao.listDict(params); + if(dictDTOS == null || dictDTOS.size() == 0){ + return new ArrayList<>(0); + } + List bindDictList = new ArrayList<>(); + for(DictDTO item : dictDTOS){ + List caseTypeIds = new ArrayList<>(); + caseTypeIds.add(item.getDictId()); + params.put("caseTypeIds",StringUtils.join(caseTypeIds, ",")); + List> deptList = dictDao.listBindDept(params); + if(deptList != null && deptList.size() > 0){ + bindDictList.add(item); + } + } + return bindDictList; + } } diff --git a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseAutoAppServiceImpl.java b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseAutoAppServiceImpl.java index 7e183af..ecbd85b 100644 --- a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseAutoAppServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseAutoAppServiceImpl.java @@ -49,7 +49,7 @@ public class ReportCaseAutoAppServiceImpl extends BaseService implements IReport //2020-12-22 添加案件分类wans // caseFlowType 1 职能部门案件 2 街镇案件 // caseFlowForward 转发状态 0未转发 1转发 2回退 - String caseFlowType = StringUtils.isEmpty(params.get("caseFlowType"))? "" : params.get("caseFlowType").toString(); + String caseFlowType = StringUtils.isEmpty(params.get("caseFlowType"))? "1" : params.get("caseFlowType").toString(); params.put("caseFlowType",caseFlowType); params.put("caseFlowForward","0"); saveReportCaseInfo(params); @@ -84,7 +84,6 @@ public class ReportCaseAutoAppServiceImpl extends BaseService implements IReport params.put("caseFlowType","2"); break; } - params.put("caseFlowType","3"); } //受理 params.clear(); diff --git a/src/main/resources/mybatis/mapper/dict/dict-mapper.xml b/src/main/resources/mybatis/mapper/dict/dict-mapper.xml index b3d0b95..e8ed69c 100755 --- a/src/main/resources/mybatis/mapper/dict/dict-mapper.xml +++ b/src/main/resources/mybatis/mapper/dict/dict-mapper.xml @@ -216,4 +216,11 @@ dict_name = #{dictName} LIMIT 1; + + + \ No newline at end of file