调整适配Oam菜单管理
This commit is contained in:
parent
e42de75103
commit
e62771a840
@ -60,7 +60,8 @@ public class MallLoginStrategy implements LoginStrategy{
|
|||||||
staffLoginInfo.setId(Constants.SUPER_ADMIN_ID).setName(Constants.SUPER_ADMIN).setSourceType(SourceType.COMMON);
|
staffLoginInfo.setId(Constants.SUPER_ADMIN_ID).setName(Constants.SUPER_ADMIN).setSourceType(SourceType.COMMON);
|
||||||
}
|
}
|
||||||
LoginUser loginUser = new LoginUser(staffLoginInfo, staffLoginInfo.getId(), getPermissionSet(sysUser.getUserName(), staffLoginInfo.getRoleId()));
|
LoginUser loginUser = new LoginUser(staffLoginInfo, staffLoginInfo.getId(), getPermissionSet(sysUser.getUserName(), staffLoginInfo.getRoleId()));
|
||||||
loginUser.setUserType(UserType.MALL_USER)
|
loginUser.setUserId(sysUser.getId())
|
||||||
|
.setUserType(UserType.MALL_USER)
|
||||||
.setUserName(sysUser.getUserName())
|
.setUserName(sysUser.getUserName())
|
||||||
.setLoginTime(System.currentTimeMillis())
|
.setLoginTime(System.currentTimeMillis())
|
||||||
.setStatus(sysUser.getStatus());
|
.setStatus(sysUser.getStatus());
|
||||||
|
|||||||
@ -55,7 +55,8 @@ public class OamLoginStrategy implements LoginStrategy{
|
|||||||
staffLoginInfo.setId(Constants.SUPER_ADMIN_ID);
|
staffLoginInfo.setId(Constants.SUPER_ADMIN_ID);
|
||||||
}
|
}
|
||||||
LoginUser loginUser = new LoginUser(staffLoginInfo, staffLoginInfo.getId(), getPermissionSet(sysUser.getUserName(), staffLoginInfo.getRoleId()));
|
LoginUser loginUser = new LoginUser(staffLoginInfo, staffLoginInfo.getId(), getPermissionSet(sysUser.getUserName(), staffLoginInfo.getRoleId()));
|
||||||
loginUser.setUserType(UserType.OAM_USER)
|
loginUser.setUserId(sysUser.getId())
|
||||||
|
.setUserType(UserType.OAM_USER)
|
||||||
.setUserName(sysUser.getUserName())
|
.setUserName(sysUser.getUserName())
|
||||||
.setLoginTime(System.currentTimeMillis())
|
.setLoginTime(System.currentTimeMillis())
|
||||||
.setStatus(sysUser.getStatus());
|
.setStatus(sysUser.getStatus());
|
||||||
|
|||||||
@ -16,23 +16,19 @@ cpop:
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: Cpop-Oam-Dev
|
name: Cpop-Oam-Dev
|
||||||
datasource:
|
|
||||||
url: jdbc:mysql://localhost:3306/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
#redis配置
|
#redis配置
|
||||||
redis:
|
redis:
|
||||||
#地址
|
#地址
|
||||||
host: localhost
|
host: 106.52.49.102
|
||||||
#端口
|
#端口
|
||||||
port: 6379
|
port: 6333
|
||||||
#数据库
|
#数据库
|
||||||
database: 0
|
database: 10
|
||||||
#密码
|
#密码
|
||||||
password:
|
password: Jambox.123*
|
||||||
#连接超时
|
#连接超时
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
lettuce:
|
jedis:
|
||||||
pool:
|
pool:
|
||||||
#
|
#
|
||||||
min-idle: 0
|
min-idle: 0
|
||||||
@ -57,6 +53,15 @@ server:
|
|||||||
mybatis-flex:
|
mybatis-flex:
|
||||||
configuration:
|
configuration:
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
datasource:
|
||||||
|
mall:
|
||||||
|
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: Customer0401
|
||||||
|
jambox:
|
||||||
|
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/jambox_test?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||||
|
username: root
|
||||||
|
password: Customer0401
|
||||||
|
|
||||||
# springdoc-openapi项目配置
|
# springdoc-openapi项目配置
|
||||||
knife4j:
|
knife4j:
|
||||||
|
|||||||
@ -31,7 +31,7 @@ spring:
|
|||||||
max-file-size: 1024MB
|
max-file-size: 1024MB
|
||||||
max-request-size: 300MB
|
max-request-size: 300MB
|
||||||
profiles:
|
profiles:
|
||||||
active: dev,jambox,api,sdk
|
active: dev,core
|
||||||
datasource:
|
datasource:
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@ -124,4 +124,27 @@ xss:
|
|||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
#swagger日志
|
#swagger日志
|
||||||
springfox: error
|
springfox: error
|
||||||
|
|
||||||
|
#微信
|
||||||
|
wx:
|
||||||
|
#企业微信
|
||||||
|
cp:
|
||||||
|
corpId: 111
|
||||||
|
appConfigs:
|
||||||
|
# (某一具体应用的AgentId,如果是要配置通讯录同步的应用,可以随便配置一个)
|
||||||
|
- agentId: 1000001
|
||||||
|
#(该应用的Secret)
|
||||||
|
secret: 1111
|
||||||
|
# (应用中的 “接受消息” 部分的 “接收消息服务器配置” 里的Token值)
|
||||||
|
token: 111
|
||||||
|
# (应用中的 “接受消息” 部分的 “接收消息服务器配置” 里的EncodingAESKey值)
|
||||||
|
aesKey: 111
|
||||||
|
#开放平台
|
||||||
|
open:
|
||||||
|
openAppid: wx6e07ba6606e912a5
|
||||||
|
componentAppId: wx1efbf67f8637d7d1
|
||||||
|
componentSecret: fc2e9457aaa32342751cc655b5a1d273
|
||||||
|
componentToken: jambox
|
||||||
|
componentAesKey: 1a3NBxmCFwkCJvfoQ7WhJHB6iX3qHPsc9JbaDznE1i0
|
||||||
|
redirectUri: https://empower.oamapi.cpopsz.com/test/openPlatform/thirdPartyPlatform/redirectUrl
|
||||||
@ -1,64 +0,0 @@
|
|||||||
package com.cpop.oam.business.controller;
|
|
||||||
|
|
||||||
import com.cpop.core.base.R;
|
|
||||||
import com.cpop.oam.business.service.LoginService;
|
|
||||||
import com.cpop.oam.business.vo.LoginUserInfoVo;
|
|
||||||
import com.cpop.oam.business.vo.MenuRouteVo;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DB
|
|
||||||
* @createTime 2023/09/10 11:13
|
|
||||||
* @description 系统登陆
|
|
||||||
*/
|
|
||||||
@Api(tags = "系统登录模块")
|
|
||||||
@RestController
|
|
||||||
public class LoginController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private LoginService loginService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author LOST.yuan
|
|
||||||
* @Description 获取登录用户详情
|
|
||||||
* @date 14:52 2022/9/7
|
|
||||||
* @return {@link R<LoginUserInfoVo>}
|
|
||||||
**/
|
|
||||||
@GetMapping("/getUserInfo")
|
|
||||||
@ApiOperation("获取登录用户详情")
|
|
||||||
public R<LoginUserInfoVo> getUserInfo() {
|
|
||||||
return R.ok(loginService.getUserInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author LOST.yuan
|
|
||||||
* @Description 获取权限码
|
|
||||||
* @date 14:52 2022/9/7
|
|
||||||
* @return {@link List<String>}
|
|
||||||
**/
|
|
||||||
@ApiOperation("获取权限码")
|
|
||||||
@GetMapping("/getPermCode")
|
|
||||||
public R<List<String>> getPermCode(){
|
|
||||||
List<String> list = loginService.getPermCode();
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author LOST.yuan
|
|
||||||
* @Description 获取菜单列表
|
|
||||||
* @date 14:52 2022/9/7
|
|
||||||
* @return {@link R<List<MenuRouteVo>>}
|
|
||||||
**/
|
|
||||||
@ApiOperation("获取菜单列表")
|
|
||||||
@GetMapping("/getMenuList")
|
|
||||||
public R<List<MenuRouteVo>> getMenuList(){
|
|
||||||
List<MenuRouteVo> list = loginService.getOamMenuList();
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,107 +0,0 @@
|
|||||||
package com.cpop.oam.business.controller;
|
|
||||||
|
|
||||||
import com.cpop.core.annontation.OperationLog;
|
|
||||||
import com.cpop.core.base.R;
|
|
||||||
import com.cpop.core.base.enums.OperationLogEnum;
|
|
||||||
import com.cpop.oam.business.bo.MenuBo;
|
|
||||||
import com.cpop.oam.business.bo.MenuListBo;
|
|
||||||
import com.cpop.oam.business.service.MenuService;
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统菜单模块接口
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-07
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@Api(tags = "系统菜单模块")
|
|
||||||
@RequestMapping("/menu")
|
|
||||||
public class MenuController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MenuService menuService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取系统菜单树列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 15:48
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return com.jambox.core.base.R<java.util.List<OamMenuVo>>
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:menu:list')")
|
|
||||||
@ApiOperation("获取OAM菜单树列表")
|
|
||||||
@GetMapping("/getOamMenuTreeList")
|
|
||||||
public R<List<MenuVo>> getOamMenuTreeList(MenuListBo bo) {
|
|
||||||
List<MenuVo> list = menuService.getOamMenuTreeList(bo);
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取目录与菜单树
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:41
|
|
||||||
* @return com.jambox.core.base.R<java.util.List<com.jambox.oam.business.vo.OamMenuVo>>
|
|
||||||
*/
|
|
||||||
@ApiOperation("获取目录与菜单树")
|
|
||||||
@GetMapping("/getDirectoryAndMenuTreeList")
|
|
||||||
public R<List<MenuVo>> getDirectoryAndMenuTreeList() {
|
|
||||||
List<MenuVo> list = menuService.getDirectoryAndMenuTreeList();
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 新增系统菜单
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:45
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return com.jambox.core.base.R<java.lang.Void>
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:menu:insert')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.INSERT_OAM_MENU)
|
|
||||||
@ApiOperation("新增OAM菜单")
|
|
||||||
@PostMapping("/insertOamMenu")
|
|
||||||
public R<Void> insertOamMenu(@RequestBody @Validated MenuBo bo) {
|
|
||||||
menuService.insertOamMenu(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 修改系统菜单表
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:menu:update')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_MENU)
|
|
||||||
@ApiOperation("修改OAM菜单")
|
|
||||||
@PutMapping("/updateOamMenu")
|
|
||||||
public R<Void> updateOamMenu(@RequestBody @Validated MenuBo bo) {
|
|
||||||
menuService.updateOamMenu(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 删除系统菜单表
|
|
||||||
* @param id 主键id
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:menu:remove')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.REMOVE_OAM_MENU)
|
|
||||||
@ApiOperation("删除OAM菜单")
|
|
||||||
@DeleteMapping("/removeOamMenu/{id}")
|
|
||||||
public R<Void> removeOamMenu(@PathVariable String id) {
|
|
||||||
menuService.removeOamMenu(id);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
package com.cpop.oam.business.controller;
|
|
||||||
|
|
||||||
import com.cpop.core.annontation.OperationLog;
|
|
||||||
import com.cpop.core.base.R;
|
|
||||||
import com.cpop.core.base.enums.OperationLogEnum;
|
|
||||||
import com.cpop.oam.business.bo.MenuListBo;
|
|
||||||
import com.cpop.oam.business.bo.RoleBo;
|
|
||||||
import com.cpop.oam.business.bo.RolePageBo;
|
|
||||||
import com.cpop.oam.business.bo.RoleStatusBo;
|
|
||||||
import com.cpop.oam.business.service.MenuService;
|
|
||||||
import com.cpop.oam.business.service.RoleService;
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
import com.cpop.oam.business.vo.RolePageVo;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统角色表 控制层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-08
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@Api(tags = "系统角色模块")
|
|
||||||
@RequestMapping("/role")
|
|
||||||
public class RoleController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RoleService roleService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MenuService menuService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 查询系统角色分页列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/10 16:51
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return R<PageVo<SysRolePageVo>>
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:role:list')")
|
|
||||||
@ApiOperation("查询系统角色分页列表")
|
|
||||||
@GetMapping("/getRolePageList")
|
|
||||||
public R<Page<RolePageVo>> getOamRolePageList(RolePageBo bo) {
|
|
||||||
Page<RolePageVo> pageVo = roleService.selectOamRolePageList(bo);
|
|
||||||
return R.ok(pageVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 新增角色
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/10/12 10:48
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return: com.cpop.core.base.R<java.lang.Void>
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:role:insert')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.INSERT_OAM_ROLE)
|
|
||||||
@ApiOperation("新增角色")
|
|
||||||
@PostMapping("/insertRole")
|
|
||||||
public R<Void> insertSysRole(@RequestBody @Validated RoleBo bo) {
|
|
||||||
roleService.insertOamRole(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 获取系统菜单树列表
|
|
||||||
* @return: R<List<SysMenuVo>>
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 14:39
|
|
||||||
**/
|
|
||||||
@ApiOperation("获取菜单树列表")
|
|
||||||
@GetMapping("/getFilterAuthMenuTreeList")
|
|
||||||
public R<List<MenuVo>> getFilterAuthMenuTreeList() {
|
|
||||||
List<MenuVo> list = menuService.getOamMenuTreeList(new MenuListBo());
|
|
||||||
//过滤掉没有权限的数据
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 修改角色
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/10 17:45
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return com.jambox.core.base.R<java.lang.Void>
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:role:update')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_ROLE)
|
|
||||||
@ApiOperation("修改角色")
|
|
||||||
@PutMapping("/updateRole")
|
|
||||||
public R<Void> updateRole(@RequestBody @Validated RoleBo bo) {
|
|
||||||
roleService.updateOamRole(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除系统角色表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:role:remove')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.REMOVE_OAM_ROLE)
|
|
||||||
@ApiOperation("删除系统角色表")
|
|
||||||
@DeleteMapping("/removeRole/{id}")
|
|
||||||
public R<Void> removeRole(@PathVariable String id) {
|
|
||||||
roleService.removeOamRole(id);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 设置角色状态
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return: R<Void>
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/9 14:13
|
|
||||||
**/
|
|
||||||
@PreAuthorize("@aps.hasPermission('system:role:update')")
|
|
||||||
@OperationLog(operationLogEnumType = OperationLogEnum.UPDATE_OAM_ROLE)
|
|
||||||
@ApiOperation("设置角色状态")
|
|
||||||
@PutMapping("/setRoleStatus")
|
|
||||||
public R<Void> setOamRoleStatus(@RequestBody @Validated RoleStatusBo bo) {
|
|
||||||
roleService.setOamRoleStatus(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.cpop.oam.business.controller;
|
package com.cpop.oam.business.controller;
|
||||||
|
|
||||||
|
import com.cpop.system.business.service.RoleService;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.cpop.common.constant.Constants;
|
import com.cpop.common.constant.Constants;
|
||||||
@ -9,7 +10,6 @@ import com.cpop.core.base.enums.OperationLogEnum;
|
|||||||
import com.cpop.core.utils.SpringUtils;
|
import com.cpop.core.utils.SpringUtils;
|
||||||
import com.cpop.oam.business.bo.*;
|
import com.cpop.oam.business.bo.*;
|
||||||
import com.cpop.oam.business.service.DeptService;
|
import com.cpop.oam.business.service.DeptService;
|
||||||
import com.cpop.oam.business.service.RoleService;
|
|
||||||
import com.cpop.oam.business.service.StaffService;
|
import com.cpop.oam.business.service.StaffService;
|
||||||
import com.cpop.oam.business.vo.*;
|
import com.cpop.oam.business.vo.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|||||||
@ -1,94 +0,0 @@
|
|||||||
package com.cpop.oam.business.entity;
|
|
||||||
|
|
||||||
import com.mybatisflex.annotation.Id;
|
|
||||||
import com.mybatisflex.annotation.Table;
|
|
||||||
import com.cpop.core.base.entity.BaseEntity;
|
|
||||||
import com.cpop.core.base.entity.BaseInsertListener;
|
|
||||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统菜单表 实体类。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-07
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper=false)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Table(value = "cp_oam_menu", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
|
||||||
public class Menu extends BaseEntity implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单ID
|
|
||||||
*/
|
|
||||||
@Id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级菜单ID
|
|
||||||
*/
|
|
||||||
private String parentMenu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单图标
|
|
||||||
*/
|
|
||||||
private String icon;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单路由,父菜单为空
|
|
||||||
*/
|
|
||||||
private String component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标记菜单的状态 0:禁用 1:正常(根据权限正常显示)
|
|
||||||
*/
|
|
||||||
private Boolean status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单类型,0:目录,1:菜单,2:按钮
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 权限
|
|
||||||
*/
|
|
||||||
private String permission;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 重定向路径,一级菜单有值
|
|
||||||
*/
|
|
||||||
private String redirect;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序,值越小越靠前,一级菜单有值
|
|
||||||
*/
|
|
||||||
private Integer orderNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路由地址
|
|
||||||
*/
|
|
||||||
private String path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 隐藏菜单
|
|
||||||
*/
|
|
||||||
private Boolean hideMenu;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
package com.cpop.oam.business.entity;
|
|
||||||
|
|
||||||
import com.mybatisflex.annotation.Id;
|
|
||||||
import com.mybatisflex.annotation.Table;
|
|
||||||
import com.cpop.core.base.entity.BaseEntity;
|
|
||||||
import com.cpop.core.base.entity.BaseInsertListener;
|
|
||||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统角色表 实体类。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-08
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper=false)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Table(value = "cp_oam_role", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
|
||||||
public class Role extends BaseEntity implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@Id
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色名称
|
|
||||||
*/
|
|
||||||
private String roleName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色值
|
|
||||||
*/
|
|
||||||
private String roleValue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态
|
|
||||||
*/
|
|
||||||
private Boolean status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
private Integer orderNo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
package com.cpop.oam.business.entity;
|
|
||||||
|
|
||||||
import com.mybatisflex.annotation.Table;
|
|
||||||
import com.cpop.core.base.entity.BaseEntity;
|
|
||||||
import com.cpop.core.base.entity.BaseInsertListener;
|
|
||||||
import com.cpop.core.base.entity.BaseUpdateListener;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统-角色-菜单表 实体类。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-10
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper=false)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Table(value = "cp_oam_role_menu", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
|
|
||||||
public class RoleMenu extends BaseEntity implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色id
|
|
||||||
*/
|
|
||||||
private String roleId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单id
|
|
||||||
*/
|
|
||||||
private String menuId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.cpop.oam.business.mapper;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
|
||||||
import com.cpop.oam.business.entity.Menu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统菜单表 映射层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-07
|
|
||||||
*/
|
|
||||||
public interface MenuMapper extends BaseMapper<Menu> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.cpop.oam.business.mapper;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
|
||||||
import com.cpop.oam.business.entity.Role;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统角色表 映射层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-08
|
|
||||||
*/
|
|
||||||
public interface RoleMapper extends BaseMapper<Role> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.cpop.oam.business.mapper;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
|
||||||
import com.cpop.oam.business.entity.RoleMenu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统-角色-菜单表 映射层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-10
|
|
||||||
*/
|
|
||||||
public interface RoleMenuMapper extends BaseMapper<RoleMenu> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package com.cpop.oam.business.service;
|
|
||||||
|
|
||||||
import com.cpop.oam.business.vo.LoginUserInfoVo;
|
|
||||||
import com.cpop.oam.business.vo.MenuRouteVo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统登陆
|
|
||||||
*/
|
|
||||||
public interface LoginService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取登录用户详情
|
|
||||||
*
|
|
||||||
* @return 系统用户登陆信息
|
|
||||||
*/
|
|
||||||
LoginUserInfoVo getUserInfo();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取权限码
|
|
||||||
*/
|
|
||||||
List<String> getPermCode();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 获取菜单列表
|
|
||||||
* @return: List<SysMenuRouteVo>
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/11 9:16
|
|
||||||
**/
|
|
||||||
List<MenuRouteVo> getOamMenuList();
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
package com.cpop.oam.business.service;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.service.IService;
|
|
||||||
import com.cpop.oam.business.bo.MenuBo;
|
|
||||||
import com.cpop.oam.business.bo.MenuListBo;
|
|
||||||
import com.cpop.oam.business.entity.Menu;
|
|
||||||
import com.cpop.oam.business.vo.MenuRouteVo;
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统菜单表 服务层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-07
|
|
||||||
*/
|
|
||||||
public interface MenuService extends IService<Menu> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取系统菜单树列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 15:53
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return java.util.List<com.jambox.oam.business.vo.OamMenuVo>
|
|
||||||
*/
|
|
||||||
List<MenuVo> getOamMenuTreeList(MenuListBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取目录与菜单树
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:42
|
|
||||||
* @return java.util.List<com.jambox.system.business.vo.SysMenuVo>
|
|
||||||
*/
|
|
||||||
List<MenuVo> getDirectoryAndMenuTreeList();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 新增系统菜单
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:50
|
|
||||||
* @param bo 请求参数
|
|
||||||
*/
|
|
||||||
void insertOamMenu(MenuBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 修改系统菜单表
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
void updateOamMenu(MenuBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 删除系统菜单表
|
|
||||||
* @param id 主键id
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
void removeOamMenu(String id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取菜单列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/10 14:06
|
|
||||||
* @return java.util.List<com.jambox.system.business.vo.SysMenuRouteVo>
|
|
||||||
*/
|
|
||||||
List<MenuRouteVo> getOamMenuList();
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.cpop.oam.business.service;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.service.IService;
|
|
||||||
import com.cpop.oam.business.entity.RoleMenu;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统-角色-菜单表 服务层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-10
|
|
||||||
*/
|
|
||||||
public interface RoleMenuService extends IService<RoleMenu> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
package com.cpop.oam.business.service;
|
|
||||||
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
|
||||||
import com.mybatisflex.core.service.IService;
|
|
||||||
import com.cpop.oam.business.bo.RoleBo;
|
|
||||||
import com.cpop.oam.business.bo.RolePageBo;
|
|
||||||
import com.cpop.oam.business.bo.RoleStatusBo;
|
|
||||||
import com.cpop.oam.business.entity.Role;
|
|
||||||
import com.cpop.oam.business.vo.RolePageVo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统角色表 服务层。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-08
|
|
||||||
*/
|
|
||||||
public interface RoleService extends IService<Role> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询系统角色分页列表
|
|
||||||
*
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return SysRole集合
|
|
||||||
*/
|
|
||||||
Page<RolePageVo> selectOamRolePageList(RolePageBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增角色
|
|
||||||
*
|
|
||||||
* @param bo 请求参数
|
|
||||||
*/
|
|
||||||
void insertOamRole(RoleBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 修改角色
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/10 17:45
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return: com.jambox.core.base.R<java.lang.Void>
|
|
||||||
*/
|
|
||||||
void updateOamRole(RoleBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除系统角色
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
*/
|
|
||||||
void removeOamRole(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 设置角色状态
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return: void
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/9 14:13
|
|
||||||
**/
|
|
||||||
void setOamRoleStatus(RoleStatusBo bo);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 过滤掉没有权限的数据
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/10/11 17:26
|
|
||||||
* @param list 原数据
|
|
||||||
* @return: java.util.List<com.cpop.oam.business.vo.MenuVo>
|
|
||||||
*/
|
|
||||||
List<MenuVo> filterAuthMenu(List<MenuVo> list);
|
|
||||||
}
|
|
||||||
@ -1,92 +0,0 @@
|
|||||||
package com.cpop.oam.business.service.impl;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import com.cpop.common.constant.Constants;
|
|
||||||
import com.cpop.core.base.entity.LoginUser;
|
|
||||||
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
|
|
||||||
import com.cpop.core.service.RedisService;
|
|
||||||
import com.cpop.core.utils.SecurityUtils;
|
|
||||||
import com.cpop.core.utils.SpringUtils;
|
|
||||||
import com.cpop.oam.business.entity.Menu;
|
|
||||||
import com.cpop.oam.business.service.LoginService;
|
|
||||||
import com.cpop.oam.business.service.MenuService;
|
|
||||||
import com.cpop.oam.business.vo.LoginUserInfoVo;
|
|
||||||
import com.cpop.oam.business.vo.MenuRouteVo;
|
|
||||||
import com.cpop.oam.framework.utils.OamUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.cpop.oam.business.entity.table.MenuTableDef.MENU;
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleMenuTableDef.ROLE_MENU;
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleTableDef.ROLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DB
|
|
||||||
* @createTime 2023/09/10 11:19
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Service("oamLoginService")
|
|
||||||
public class LoginServiceImpl implements LoginService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MenuService menuService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author LOST.yuan
|
|
||||||
* @Description 获取用户信息
|
|
||||||
* @date 23:01 2022/9/26
|
|
||||||
* @return {@link String}
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public LoginUserInfoVo getUserInfo() {
|
|
||||||
//获取当前登录用户信息
|
|
||||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
|
||||||
//获取申请员工信息
|
|
||||||
OamStaffLoginInfo staffInfo = SpringUtils.getBean(OamUtils.class).getLoginStaffInfo();
|
|
||||||
return new LoginUserInfoVo()
|
|
||||||
.setUserId(loginUser.getUserId())
|
|
||||||
.setUsername(loginUser.getUsername())
|
|
||||||
.setRealName(staffInfo.getName())
|
|
||||||
.setAvatar(staffInfo.getAvatar())
|
|
||||||
.setHomePath("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author LOST.yuan
|
|
||||||
* @Description 获取权限码
|
|
||||||
* @date 17:30 2022/10/19
|
|
||||||
* @return {@link List<String>}
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public List<String> getPermCode() {
|
|
||||||
//获取当前用户所属角色以及菜单信息
|
|
||||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
|
||||||
OamStaffLoginInfo staffInfo = SpringUtils.getBean(OamUtils.class).getLoginStaffInfo();
|
|
||||||
if (Constants.SUPER_ADMIN.equals(loginUser.getUsername())){
|
|
||||||
return new ArrayList<String>(Collections.singleton(Constants.ALL_PERMISSION));
|
|
||||||
}
|
|
||||||
List<Menu> list = menuService.list(QueryWrapper.create()
|
|
||||||
.leftJoin(ROLE_MENU).on(ROLE_MENU.MENU_ID.eq(MENU.ID))
|
|
||||||
.leftJoin(ROLE).on(ROLE.ID.eq(ROLE_MENU.ROLE_ID))
|
|
||||||
.where(MENU.TYPE.in(1, 2))
|
|
||||||
.and(MENU.PERMISSION.ne(""))
|
|
||||||
.and(ROLE.ID.eq(staffInfo.getRoleId())));
|
|
||||||
return list.stream().map(Menu::getPermission).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取菜单列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MenuRouteVo> getOamMenuList() {
|
|
||||||
return menuService.getOamMenuList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,287 +0,0 @@
|
|||||||
package com.cpop.oam.business.service.impl;
|
|
||||||
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|
||||||
import com.cpop.common.constant.Constants;
|
|
||||||
import com.cpop.common.utils.StringUtils;
|
|
||||||
import com.cpop.common.utils.bean.BeanUtils;
|
|
||||||
import com.cpop.core.base.entity.LoginUser;
|
|
||||||
import com.cpop.core.base.entity.loginInfo.OamStaffLoginInfo;
|
|
||||||
import com.cpop.core.utils.SecurityUtils;
|
|
||||||
import com.cpop.core.utils.SpringUtils;
|
|
||||||
import com.cpop.oam.business.bo.MenuBo;
|
|
||||||
import com.cpop.oam.business.bo.MenuListBo;
|
|
||||||
import com.cpop.oam.business.entity.Menu;
|
|
||||||
import com.cpop.oam.business.mapper.MenuMapper;
|
|
||||||
import com.cpop.oam.business.service.MenuService;
|
|
||||||
import com.cpop.oam.business.vo.MenuRouteVo;
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
import com.cpop.oam.framework.utils.OamUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.cpop.oam.business.entity.table.MenuTableDef.MENU;
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleMenuTableDef.ROLE_MENU;
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleTableDef.ROLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统菜单表 服务层实现。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-07
|
|
||||||
*/
|
|
||||||
@Service("oamMenuService")
|
|
||||||
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取系统菜单树列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 15:53
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @return java.util.List<com.jambox.oam.business.vo.OAMMenuVo>
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MenuVo> getOamMenuTreeList(MenuListBo bo) {
|
|
||||||
return buildMenuTree(this.listAs(QueryWrapper.create()
|
|
||||||
//状态不为空
|
|
||||||
.and(MENU.STATUS.eq(bo.getStatus()))
|
|
||||||
//标题不为空
|
|
||||||
.and(MENU.TITLE.like(bo.getTitle()))
|
|
||||||
.orderBy(MENU.ORDER_NO.asc()), MenuVo.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 构建菜单树
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 16:36
|
|
||||||
* @param menus 菜单集合
|
|
||||||
* @return java.util.List<com.jambox.OAMtem.business.vo.OAMMenuVo>
|
|
||||||
*/
|
|
||||||
private List<MenuVo> buildMenuTree(List<MenuVo> menus) {
|
|
||||||
List<MenuVo> returnList = new ArrayList<MenuVo>();
|
|
||||||
if (menus.isEmpty()) {
|
|
||||||
return menus;
|
|
||||||
}
|
|
||||||
//构建根节点
|
|
||||||
List<MenuVo> tempList = menus.stream()
|
|
||||||
.filter(s -> StringUtils.isBlank(s.getParentMenu())).collect(Collectors.toList());
|
|
||||||
for (MenuVo menu : tempList) {
|
|
||||||
MenuVo menuVo = recursionFn(menus, menu);
|
|
||||||
returnList.add(menuVo);
|
|
||||||
}
|
|
||||||
return returnList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 递归列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 16:36
|
|
||||||
* @param list 递归集合
|
|
||||||
* @param menu 菜单
|
|
||||||
* @return com.jambox.OAMtem.business.vo.OAMMenuVo
|
|
||||||
*/
|
|
||||||
private MenuVo recursionFn(List<MenuVo> list, MenuVo menu) {
|
|
||||||
// 得到子节点列表
|
|
||||||
List<MenuVo> childList = new ArrayList<MenuVo>();
|
|
||||||
for (MenuVo menuNode : list) {
|
|
||||||
if (null != menuNode.getParentMenu() && menuNode.getParentMenu().equals(menu.getId())) {
|
|
||||||
childList.add(recursionFn(list, menuNode));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!childList.isEmpty()){
|
|
||||||
menu.setChildren(childList);
|
|
||||||
}
|
|
||||||
return menu;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取目录与菜单树
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:42
|
|
||||||
* @return java.util.List<com.jambox.OAMtem.business.vo.OAMMenuVo>
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MenuVo> getDirectoryAndMenuTreeList() {
|
|
||||||
//只读取启用的菜单
|
|
||||||
return buildMenuTree(this.listAs(QueryWrapper.create()
|
|
||||||
.where(MENU.TYPE.in(0, 1))
|
|
||||||
.orderBy(MENU.ORDER_NO.asc())
|
|
||||||
, MenuVo.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 新增系统菜单
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/07 17:50
|
|
||||||
* @param bo 请求参数
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void insertOamMenu(MenuBo bo) {
|
|
||||||
Menu entity = new Menu();
|
|
||||||
BeanUtils.copyBeanProp(entity, bo);
|
|
||||||
//设置菜单名
|
|
||||||
if (StringUtils.isNotBlank(bo.getPath())){
|
|
||||||
String[] split = bo.getPath().split("/");
|
|
||||||
String name = StringUtils.getMethodName(split[split.length - 1].replace("/", ""));
|
|
||||||
entity.setName(name);
|
|
||||||
}
|
|
||||||
//设置组件
|
|
||||||
if (StringUtils.isBlank(bo.getComponent())){
|
|
||||||
entity.setComponent("LAYOUT");
|
|
||||||
}
|
|
||||||
this.save(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 修改系统菜单表
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void updateOamMenu(MenuBo bo) {
|
|
||||||
Menu entity = new Menu();
|
|
||||||
BeanUtils.copyBeanProp(entity, bo);
|
|
||||||
//设置菜单名
|
|
||||||
if (StringUtils.isNotBlank(bo.getPath())){
|
|
||||||
String[] split = bo.getPath().split("/");
|
|
||||||
String toUpperCaseString = split[split.length - 1];
|
|
||||||
if (toUpperCaseString.contains(":")) {
|
|
||||||
toUpperCaseString = split[split.length - 2];
|
|
||||||
}
|
|
||||||
String name = StringUtils.getMethodName(toUpperCaseString.replace("/", ""));
|
|
||||||
entity.setName(name);
|
|
||||||
}
|
|
||||||
//设置组件
|
|
||||||
if (StringUtils.isBlank(bo.getComponent())){
|
|
||||||
entity.setComponent("LAYOUT");
|
|
||||||
}
|
|
||||||
this.updateById(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 删除系统菜单表
|
|
||||||
* @param id 主键id
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 16:01
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void removeOamMenu(String id) {
|
|
||||||
//查询所有
|
|
||||||
List<Menu> list = this.list();
|
|
||||||
//递归获取当前菜单及其下属子菜单
|
|
||||||
List<String> removeIds = new ArrayList<>();
|
|
||||||
recursionRemove(list, id, removeIds);
|
|
||||||
removeIds.add(id);
|
|
||||||
this.removeByIds(removeIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 递归要删除的菜单集合
|
|
||||||
* @param list 菜单集合
|
|
||||||
* @param id id
|
|
||||||
* @param removeIds 删除id集合
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 15:27
|
|
||||||
**/
|
|
||||||
private void recursionRemove(List<Menu> list, String id, List<String> removeIds) {
|
|
||||||
//过滤出删除根菜单
|
|
||||||
List<Menu> sonMenu = list.stream().filter(s -> null != s.getParentMenu()&& s.getParentMenu().equals(id)).collect(Collectors.toList());
|
|
||||||
if (!sonMenu.isEmpty()) {
|
|
||||||
sonMenu.forEach(item -> {
|
|
||||||
recursionRemove(list, item.getId(), removeIds);
|
|
||||||
removeIds.add(item.getId());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 获取菜单列表
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/09/10 14:06
|
|
||||||
* @return java.util.List<OAMMenuRouteVo>
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MenuRouteVo> getOamMenuList() {
|
|
||||||
//获取用户信息
|
|
||||||
LoginUser user = SecurityUtils.getInstance().getLoginUser();
|
|
||||||
//获取申请员工信息
|
|
||||||
OamStaffLoginInfo staffInfo = SpringUtils.getBean(OamUtils.class).getLoginStaffInfo();
|
|
||||||
//超级管理员
|
|
||||||
if (Constants.SUPER_ADMIN.equals(user.getUsername())) {
|
|
||||||
//获取菜单
|
|
||||||
List<MenuRouteVo> list = this.listAs(QueryWrapper.create()
|
|
||||||
.where(MENU.TYPE.in(0, 1))
|
|
||||||
.orderBy(MENU.ORDER_NO.asc()),
|
|
||||||
MenuRouteVo.class);
|
|
||||||
return buildMenuRouteTree(list);
|
|
||||||
} else {
|
|
||||||
return buildMenuRouteTree(this.listAs(QueryWrapper.create()
|
|
||||||
.select(MENU.ALL_COLUMNS)
|
|
||||||
.leftJoin(ROLE_MENU).on(ROLE_MENU.MENU_ID.eq(MENU.ID))
|
|
||||||
.leftJoin(ROLE).on(ROLE.ID.eq(ROLE_MENU.ROLE_ID))
|
|
||||||
.where(MENU.STATUS.eq(1))
|
|
||||||
.and(MENU.TYPE.in(0, 1))
|
|
||||||
.and(MENU.NAME.notIn(Constants.HIDE_MENU.split(",")))
|
|
||||||
.and(ROLE_MENU.ROLE_ID.eq(staffInfo.getRoleId()))
|
|
||||||
.orderBy(MENU.ORDER_NO.asc()),
|
|
||||||
MenuRouteVo.class));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 构建菜单路由树
|
|
||||||
* @param menus 菜单集合
|
|
||||||
* @return: List<MenuRouteVo>
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/11 9:21
|
|
||||||
**/
|
|
||||||
private List<MenuRouteVo> buildMenuRouteTree(List<MenuRouteVo> menus) {
|
|
||||||
if (menus.isEmpty()){
|
|
||||||
return menus;
|
|
||||||
}
|
|
||||||
//构建内部类
|
|
||||||
menus.forEach(item->{
|
|
||||||
MenuRouteVo.Meta meta = item.new Meta();
|
|
||||||
meta.setIcon(item.getIcon());
|
|
||||||
meta.setOrderNo(item.getOrderNo());
|
|
||||||
meta.setTitle(item.getTitle());
|
|
||||||
meta.setHideMenu(item.getHideMenu());
|
|
||||||
item.setMeta(meta);
|
|
||||||
});
|
|
||||||
//构建根节点
|
|
||||||
List<MenuRouteVo> tempList = menus.stream()
|
|
||||||
.filter(s -> StringUtils.isBlank(s.getParentMenu())).collect(Collectors.toList());
|
|
||||||
List<MenuRouteVo> menuRoutes = new ArrayList<>();
|
|
||||||
for (MenuRouteVo menu : tempList) {
|
|
||||||
MenuRouteVo menuVo = recursionMenuRoute(menus, menu);
|
|
||||||
//设置是否需要隐藏子内部菜单
|
|
||||||
menuVo.getMeta().setHideChildrenInMenu(null != menuVo.getChildren() && menuVo.getChildren().size() == 1 && menuVo.getChildren().get(0).getHideMenu());
|
|
||||||
menuRoutes.add(menuVo);
|
|
||||||
}
|
|
||||||
return BeanUtils.mapToList(menuRoutes, MenuRouteVo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 递归列表
|
|
||||||
* @param list 菜单集合
|
|
||||||
* @param menu 菜单
|
|
||||||
* @return: MenuRouteVo
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/11 9:22
|
|
||||||
**/
|
|
||||||
private MenuRouteVo recursionMenuRoute(List<MenuRouteVo> list, MenuRouteVo menu) {
|
|
||||||
// 得到子节点列表
|
|
||||||
List<MenuRouteVo> childList = new ArrayList<MenuRouteVo>();
|
|
||||||
for (MenuRouteVo menuNode : list) {
|
|
||||||
if (StringUtils.isNotBlank(menuNode.getParentMenu()) && menuNode.getParentMenu().equals(menu.getId())) {
|
|
||||||
childList.add(recursionMenuRoute(list, menuNode));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
menu.setChildren(childList);
|
|
||||||
return menu;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package com.cpop.oam.business.service.impl;
|
|
||||||
|
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|
||||||
import com.cpop.oam.business.entity.RoleMenu;
|
|
||||||
import com.cpop.oam.business.mapper.RoleMenuMapper;
|
|
||||||
import com.cpop.oam.business.service.RoleMenuService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统-角色-菜单表 服务层实现。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-10
|
|
||||||
*/
|
|
||||||
@Service("oamRoleMenuService")
|
|
||||||
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements RoleMenuService {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,202 +0,0 @@
|
|||||||
package com.cpop.oam.business.service.impl;
|
|
||||||
|
|
||||||
import com.cpop.oam.business.vo.MenuVo;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|
||||||
import com.cpop.common.constant.Constants;
|
|
||||||
import com.cpop.common.utils.StringUtils;
|
|
||||||
import com.cpop.common.utils.bean.BeanUtils;
|
|
||||||
import com.cpop.core.base.entity.PageDomain;
|
|
||||||
import com.cpop.core.utils.SpringUtils;
|
|
||||||
import com.cpop.core.utils.sql.SqlUtils;
|
|
||||||
import com.cpop.oam.business.bo.RoleBo;
|
|
||||||
import com.cpop.oam.business.bo.RolePageBo;
|
|
||||||
import com.cpop.oam.business.bo.RoleStatusBo;
|
|
||||||
import com.cpop.oam.business.entity.Role;
|
|
||||||
import com.cpop.oam.business.entity.RoleMenu;
|
|
||||||
import com.cpop.oam.business.mapper.RoleMapper;
|
|
||||||
import com.cpop.oam.business.service.RoleMenuService;
|
|
||||||
import com.cpop.oam.business.service.RoleService;
|
|
||||||
import com.cpop.oam.business.vo.RolePageVo;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleMenuTableDef.ROLE_MENU;
|
|
||||||
import static com.cpop.oam.business.entity.table.RoleTableDef.ROLE;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统角色表 服务层实现。
|
|
||||||
*
|
|
||||||
* @author DB
|
|
||||||
* @since 2023-09-08
|
|
||||||
*/
|
|
||||||
@Service("oamRoleService")
|
|
||||||
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Description: 查询系统角色表列表
|
|
||||||
* @return: PageVo<SysRolePageVo>
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 17:59
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public Page<RolePageVo> selectOamRolePageList(RolePageBo bo) {
|
|
||||||
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
|
|
||||||
Page<RolePageVo> page = this.mapper.paginateAs(pageDomain.getPageNum(), pageDomain.getPageSize(),
|
|
||||||
QueryWrapper.create()
|
|
||||||
.select(ROLE.ALL_COLUMNS)
|
|
||||||
.where(ROLE.ROLE_VALUE.ne(Constants.SUPER_ADMIN_VALUE))
|
|
||||||
.and(ROLE.ROLE_NAME.like(bo.getRoleName()))
|
|
||||||
.and(ROLE.STATUS.eq(bo.getStatus()))
|
|
||||||
.orderBy(ROLE.ORDER_NO.asc())
|
|
||||||
, RolePageVo.class);
|
|
||||||
if (!page.getRecords().isEmpty()) {
|
|
||||||
//根据角色查询中间表
|
|
||||||
List<RoleMenu> roleMenuList = SpringUtils.getBean(RoleMenuService.class).list(QueryWrapper.create()
|
|
||||||
.where(ROLE_MENU.ROLE_ID.in(page.getRecords().stream().map(RolePageVo::getId).collect(Collectors.toSet()))));
|
|
||||||
page.getRecords().forEach(item -> {
|
|
||||||
List<String> filterMenuIds = roleMenuList.stream()
|
|
||||||
.filter(s -> StringUtils.equals(s.getRoleId(), item.getId()))
|
|
||||||
.map(RoleMenu::getMenuId).collect(Collectors.toList());
|
|
||||||
item.setMenuIds(filterMenuIds);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Description: 新增角色
|
|
||||||
* @return: void
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 18:07
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void insertOamRole(RoleBo bo) {
|
|
||||||
Role role = BeanUtils.mapToClass(bo, Role.class);
|
|
||||||
this.save(role);
|
|
||||||
//将菜单信息录入中间表
|
|
||||||
if (!bo.getMenuIds().isEmpty()) {
|
|
||||||
List<RoleMenu> roleMenus = new ArrayList<>();
|
|
||||||
bo.getMenuIds().forEach(item -> {
|
|
||||||
RoleMenu roleMenu = new RoleMenu();
|
|
||||||
roleMenu.setMenuId(item);
|
|
||||||
roleMenu.setRoleId(role.getId());
|
|
||||||
roleMenus.add(roleMenu);
|
|
||||||
});
|
|
||||||
SpringUtils.getBean(RoleMenuService.class).saveBatch(roleMenus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Description: 修改系统角色
|
|
||||||
* @return: void
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 18:07
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void updateOamRole(RoleBo bo) {
|
|
||||||
Role entity = new Role();
|
|
||||||
BeanUtils.copyBeanProp(entity, bo);
|
|
||||||
this.updateById(entity);
|
|
||||||
//将菜单信息录入中间表
|
|
||||||
if (!bo.getMenuIds().isEmpty()) {
|
|
||||||
//先删后存
|
|
||||||
RoleMenuService sysRoleMenuService = SpringUtils.getBean(RoleMenuService.class);
|
|
||||||
sysRoleMenuService.remove(QueryWrapper.create()
|
|
||||||
.where(ROLE_MENU.ROLE_ID.eq(entity.getId())));
|
|
||||||
List<RoleMenu> roleMenus = new ArrayList<>();
|
|
||||||
bo.getMenuIds().forEach(item -> {
|
|
||||||
RoleMenu roleMenu = new RoleMenu();
|
|
||||||
roleMenu.setMenuId(item);
|
|
||||||
roleMenu.setRoleId(entity.getId());
|
|
||||||
roleMenus.add(roleMenu);
|
|
||||||
});
|
|
||||||
sysRoleMenuService.saveBatch(roleMenus);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id 主键
|
|
||||||
* @Description: 删除系统角色
|
|
||||||
* @return: void
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/10 18:07
|
|
||||||
**/
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
@Override
|
|
||||||
public void removeOamRole(String id) {
|
|
||||||
this.removeById(id);
|
|
||||||
//删除相关联菜单
|
|
||||||
SpringUtils.getBean(RoleMenuService.class).remove(QueryWrapper.create().where(ROLE_MENU.ROLE_ID.eq(id)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param bo 请求参数
|
|
||||||
* @Description: 设置角色状态
|
|
||||||
* @return: void
|
|
||||||
* @Author: DB
|
|
||||||
* @Date: 2023/5/9 14:13
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void setOamRoleStatus(RoleStatusBo bo) {
|
|
||||||
this.updateById(BeanUtils.mapToClass(bo, Role.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 过滤掉没有权限的数据
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/10/11 17:27
|
|
||||||
* @param list 原数据
|
|
||||||
* @return: java.util.List<com.cpop.oam.business.vo.MenuVo>
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<MenuVo> filterAuthMenu(List<MenuVo> list) {
|
|
||||||
if (list.isEmpty()) {
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
return recursionFilterFn(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @descriptions 递归过滤
|
|
||||||
* @author DB
|
|
||||||
* @date 2023/10/11 17:36
|
|
||||||
* @param list 递归列表
|
|
||||||
* @return: java.util.List<com.cpop.oam.business.vo.MenuVo>
|
|
||||||
*/
|
|
||||||
private List<MenuVo> recursionFilterFn(List<MenuVo> list) {
|
|
||||||
if (!list.isEmpty()){
|
|
||||||
list.forEach(item -> {
|
|
||||||
//判断是否是目录z
|
|
||||||
if (item.getType() == 0){
|
|
||||||
if (null != item.getChildren()){
|
|
||||||
recursionFilterFn(item.getChildren());
|
|
||||||
}
|
|
||||||
}else if (item.getType() == 1){
|
|
||||||
//是否是菜单 判断是否是目录与是否有子菜单
|
|
||||||
if (StringUtils.isBlank(item.getPermission()) || null == item.getChildren() ){
|
|
||||||
//当前是菜单并且没权限或子菜单为空
|
|
||||||
list.remove(item);
|
|
||||||
}
|
|
||||||
} else if (item.getType() == 2){
|
|
||||||
//按钮
|
|
||||||
if(StringUtils.isBlank(item.getPermission())){
|
|
||||||
list.remove(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.cpop.oam.business.mapper.MenuMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.cpop.oam.business.mapper.RoleMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.cpop.oam.business.mapper.RoleMenuMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@ -19,7 +19,7 @@ import java.util.Set;
|
|||||||
* @createTime 2023/09/10 11:19
|
* @createTime 2023/09/10 11:19
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@Service("oamLoginService")
|
@Service("loginService")
|
||||||
public class LoginServiceImpl implements LoginService {
|
public class LoginServiceImpl implements LoginService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user