From e539922487bef3cbdfaeb7c65c54ce5f6f68fbf7 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Wed, 14 Sep 2022 19:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E3=80=81=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 8 +-- .../modules/resource/dao/ResourceDao.java | 11 +--- .../service/impl/ResourceServiceImpl.java | 43 +------------- .../resources/mapper/resource/ResourceDao.xml | 56 +++++++++++++------ 4 files changed, 46 insertions(+), 72 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 6658fb0d..6ec46ccc 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -353,7 +353,7 @@ public class CensusController { @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), - @ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectApplyDeptDetailTypeCountList(@RequestParam Map params) { return new Result().ok(resourceService.selectApplyDeptDetailTypeCountList(params)); @@ -366,7 +366,7 @@ public class CensusController { @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), - @ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectDeptDetailTypeCountList(@RequestParam Map params) { return new Result().ok(resourceService.selectDeptDetailTypeCountList(params)); @@ -380,7 +380,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), - @ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectCensusResourceTable(@RequestParam Map params){ return new Result().ok(resourceService.selectCensusResourceTable(params)); @@ -394,7 +394,7 @@ public class CensusController { @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), - @ApiImplicitParam(name = "approveStatus", value = "审核状态", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), }) public Result selectCensusApplyTable(@RequestParam Map params){ return new Result().ok(resourceService.selectCensusApplyTable(params)); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index c52428d9..05c79478 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -188,16 +188,9 @@ public interface ResourceDao extends BaseDao { List> selectApplyDeptDetailTypeCountList(Map params); - List> selectDeptDetailTypeCountList(@Param("delFlags") List delFlags, - @Param("deptId") Long deptId, - @Param("startDate") String startDate, - @Param("endDate") String endDate); + List> selectDeptDetailTypeCountList(Map params); - List selectCensusResourceTable(@Param("delFlags") List delFlags, - @Param("deptId") Long deptId, - @Param("type") String type, - @Param("startDate") String startDate, - @Param("endDate") String endDate); + List selectCensusResourceTable(Map params); List selectCensusApplyTable(Map params); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index b4c00fad..9824fd34 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -2023,26 +2023,7 @@ public class ResourceServiceImpl extends CrudServiceImpl delFlags=new ArrayList<>(); - if(params.get("approveStatus") != null){ - if("审核完成".equals(params.get("approveStatus"))){ - delFlags.add(0); - }else if("审核中".equals(params.get("approveStatus"))){ - delFlags.add(2); - delFlags.add(3); - } - }else { - delFlags.add(0); - delFlags.add(2); - delFlags.add(3); - } - List> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(delFlags, deptId, startDate, endDate); + List> typeCountListByDept = resourceDao.selectDeptDetailTypeCountList(params); Map>> typeCountListMap = typeCountListByDept.stream().collect(Collectors.groupingBy(m -> m.get("deptName").toString())); ArrayList resultList = new ArrayList<>(); typeCountListMap.forEach((k, v) -> { @@ -2056,27 +2037,7 @@ public class ResourceServiceImpl extends CrudServiceImpl delFlags=new ArrayList<>(); - if(params.get("approveStatus") != null){ - if("审核完成".equals(params.get("approveStatus"))){ - delFlags.add(0); - }else if("审核中".equals(params.get("approveStatus"))){ - delFlags.add(2); - delFlags.add(3); - } - }else { - delFlags.add(0); - delFlags.add(2); - delFlags.add(3); - } - return resourceDao.selectCensusResourceTable(delFlags, deptId, type, startDate, endDate); + return resourceDao.selectCensusResourceTable(params); } @Override diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 9e0a2c9e..ae9076ba 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -1711,9 +1711,14 @@ AND taa.user_id = su.id AND su.dept_id = sd.id AND taa.resource_id = tdr.id - - AND taa.approve_status = #{approveStatus} - + + + AND taa.approve_status = #{approveStatus} + + + AND taa.approve_status != '不通过' + + AND sd.id = #{deptId} @@ -1745,12 +1750,17 @@ WHERE 1 = 1 AND tdr.dept_id = sd.id - - AND tdr.del_flag in - - #{delFlag} - - + + + AND tdr.del_flag = 0 + + + AND tdr.del_flag in (2, 3) + + + AND tdr.del_flag in (0, 2, 3) + + AND sd.id = #{deptId} @@ -1769,12 +1779,17 @@ WHERE d.type NOT IN ('知识库','基础设施','数据资源')) tdr, sys_dept sd WHERE 1=1 AND tdr.dept_id=sd.id - - AND tdr.del_flag in - - #{delFlag} - - + + + AND tdr.del_flag = 0 + + + AND tdr.del_flag in (2, 3) + + + AND tdr.del_flag in (0, 2, 3) + + AND sd.id = #{deptId} @@ -1800,9 +1815,14 @@ AND taa.user_id = su.id AND su.dept_id = sd.id AND taa.resource_id = tdr.id - - AND taa.approve_status = #{approveStatus} - + + + AND taa.approve_status = #{approveStatus} + + + AND taa.approve_status != '不通过' + + AND sd.id = #{deptId}