From f9d893c8e747d036e56c4e5d928562c49eb200aa Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 16 Dec 2022 11:45:59 +0800 Subject: [PATCH 1/2] ... --- .../modules/resource/service/impl/ResourceServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 a82b863e..bfa83b7c 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 @@ -290,13 +290,13 @@ public class ResourceServiceImpl extends CrudServiceImpl Date: Fri, 16 Dec 2022 11:46:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 3 +- .../service/impl/ResourceServiceImpl.java | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index 43ca733d..628095b3 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -122,7 +122,8 @@ public class ResourceController { @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "creator", value = "创建者用户id", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "delFlag", value = "创建者用户id", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "deptId", value = "资源所属部门id", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "deptId", value = "资源所属部门id", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "region", value = "是否过滤只出用户区域内部门", paramType = "query", dataType = "String") }) public Result> page(@ApiIgnore @RequestParam Map params) { PageData page = resourceService.page(params); 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 bfa83b7c..317e336e 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 @@ -56,10 +56,12 @@ import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dao.SysDeptDao; import io.renren.modules.sys.dao.SysRegionDao; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.dto.SysRoleDTO; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysDeptEntity; import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; +import io.renren.modules.sys.service.SysRoleService; import io.renren.modules.sys.service.SysUserService; import lombok.SneakyThrows; import okhttp3.*; @@ -167,6 +169,17 @@ public class ResourceServiceImpl extends CrudServiceImpl userDTOOptional = Optional.ofNullable(sysUserService.get(user.getId())); + SysRoleDTO roleDTO0 = sysRoleService.getByName(roleName0); + SysRoleDTO roleDTO1 = sysRoleService.getByName(roleName1); + SysRoleDTO roleDTO2 = sysRoleService.getByName(roleName2); + userDTOOptional.ifPresent(userDto -> { + if (userDto.getDeptId() != null) { + SysDeptEntity sysDeptEntity = sysDeptDao.getById(userDto.getDeptId()); + } + }); + } + } Boolean nonChinese = jsonObject.containsKey("nonChinese") ? jsonObject.getBoolean("nonChinese") : Boolean.FALSE; // 不传默认为中文走全文索引 //默认按上架时间降序排列 String orderField;