From 17f0c20242c6ee3d35b9ee8f677d747ed012423c Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 02 九月 2022 16:30:20 +0800 Subject: [PATCH] remove 移除maven docker插件 过于老旧功能缺陷大 使用idea自带的docker插件替代 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index 8133489..e7e5b53 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -2,7 +2,11 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.PageQuery; @@ -10,7 +14,6 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.helper.LoginHelper; -import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.domain.SysRoleDept; import com.ruoyi.system.domain.SysRoleMenu; import com.ruoyi.system.domain.SysUserRole; @@ -41,7 +44,7 @@ @Override public TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery) { - Page<SysRole> page = baseMapper.selectPageRoleList(pageQuery.build(), role); + Page<SysRole> page = baseMapper.selectPageRoleList(pageQuery.build(), this.buildQueryWrapper(role)); return TableDataInfo.build(page); } @@ -53,7 +56,21 @@ */ @Override public List<SysRole> selectRoleList(SysRole role) { - return baseMapper.selectRoleList(role); + return baseMapper.selectRoleList(this.buildQueryWrapper(role)); + } + + private Wrapper<SysRole> buildQueryWrapper(SysRole role) { + Map<String, Object> params = role.getParams(); + QueryWrapper<SysRole> wrapper = Wrappers.query(); + wrapper.eq("r.del_flag", UserConstants.ROLE_NORMAL) + .eq(ObjectUtil.isNotNull(role.getRoleId()), "r.role_id", role.getRoleId()) + .like(StringUtils.isNotBlank(role.getRoleName()), "r.role_name", role.getRoleName()) + .eq(StringUtils.isNotBlank(role.getStatus()), "r.status", role.getStatus()) + .like(StringUtils.isNotBlank(role.getRoleKey()), "r.role_key", role.getRoleKey()) + .between(params.get("beginTime") != null && params.get("endTime") != null, + "r.create_time", params.get("beginTime"), params.get("endTime")) + .orderByAsc("r.role_sort"); + return wrapper; } /** @@ -102,7 +119,7 @@ */ @Override public List<SysRole> selectRoleAll() { - return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); + return this.selectRoleList(new SysRole()); } /** @@ -183,7 +200,7 @@ if (!LoginHelper.isAdmin()) { SysRole role = new SysRole(); role.setRoleId(roleId); - List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role); + List<SysRole> roles = this.selectRoleList(role); if (CollUtil.isEmpty(roles)) { throw new ServiceException("娌℃湁鏉冮檺璁块棶瑙掕壊鏁版嵁锛�"); } -- Gitblit v1.9.3