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;