Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
有来技术
youlai-mall
提交
900d663f
Y
youlai-mall
项目概览
有来技术
/
youlai-mall
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
youlai-mall
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
900d663f
编写于
9月 09, 2020
作者:
H
haoxianrui@
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加菜单接口
上级
76eec829
变更
50
显示空白变更内容
内联
并排
Showing
50 changed file
with
228 addition
and
94 deletion
+228
-94
youlai-admin/src/main/java/com/youlai/admin/controller/SysDeptController.java
...n/java/com/youlai/admin/controller/SysDeptController.java
+35
-10
youlai-admin/src/main/java/com/youlai/admin/controller/SysDictController.java
...n/java/com/youlai/admin/controller/SysDictController.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/controller/SysDictTypeController.java
...va/com/youlai/admin/controller/SysDictTypeController.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/controller/SysMenuController.java
...n/java/com/youlai/admin/controller/SysMenuController.java
+15
-16
youlai-admin/src/main/java/com/youlai/admin/controller/SysRoleController.java
...n/java/com/youlai/admin/controller/SysRoleController.java
+2
-3
youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java
...n/java/com/youlai/admin/controller/SysUserController.java
+3
-8
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysDept.java
...src/main/java/com/youlai/admin/domain/entity/SysDept.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysDict.java
...src/main/java/com/youlai/admin/domain/entity/SysDict.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysDictType.java
...main/java/com/youlai/admin/domain/entity/SysDictType.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysMenu.java
...src/main/java/com/youlai/admin/domain/entity/SysMenu.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysPermission.java
...in/java/com/youlai/admin/domain/entity/SysPermission.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysRole.java
...src/main/java/com/youlai/admin/domain/entity/SysRole.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysRoleMenu.java
...main/java/com/youlai/admin/domain/entity/SysRoleMenu.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysRolePermission.java
...ava/com/youlai/admin/domain/entity/SysRolePermission.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysUser.java
...src/main/java/com/youlai/admin/domain/entity/SysUser.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/entity/SysUserRole.java
...main/java/com/youlai/admin/domain/entity/SysUserRole.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/vo/DeptVO.java
...dmin/src/main/java/com/youlai/admin/domain/vo/DeptVO.java
+1
-3
youlai-admin/src/main/java/com/youlai/admin/domain/vo/MenuVO.java
...dmin/src/main/java/com/youlai/admin/domain/vo/MenuVO.java
+31
-0
youlai-admin/src/main/java/com/youlai/admin/domain/vo/TreeSelectVO.java
...rc/main/java/com/youlai/admin/domain/vo/TreeSelectVO.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/domain/vo/UserVO.java
...dmin/src/main/java/com/youlai/admin/domain/vo/UserVO.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java
.../src/main/java/com/youlai/admin/mapper/SysDeptMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDictMapper.java
.../src/main/java/com/youlai/admin/mapper/SysDictMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDictTypeMapper.java
.../main/java/com/youlai/admin/mapper/SysDictTypeMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysMenuMapper.java
.../src/main/java/com/youlai/admin/mapper/SysMenuMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysPermissionMapper.java
...ain/java/com/youlai/admin/mapper/SysPermissionMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java
.../src/main/java/com/youlai/admin/mapper/SysRoleMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRoleMenuMapper.java
.../main/java/com/youlai/admin/mapper/SysRoleMenuMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRolePermissionMapper.java
...java/com/youlai/admin/mapper/SysRolePermissionMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysUserMapper.java
.../src/main/java/com/youlai/admin/mapper/SysUserMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/mapper/SysUserRoleMapper.java
.../main/java/com/youlai/admin/mapper/SysUserRoleMapper.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysDeptService.java
...c/main/java/com/youlai/admin/service/ISysDeptService.java
+3
-3
youlai-admin/src/main/java/com/youlai/admin/service/ISysDictService.java
...c/main/java/com/youlai/admin/service/ISysDictService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysDictTypeService.java
...in/java/com/youlai/admin/service/ISysDictTypeService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysMenuService.java
...c/main/java/com/youlai/admin/service/ISysMenuService.java
+10
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysPermissionService.java
.../java/com/youlai/admin/service/ISysPermissionService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysRoleMenuService.java
...in/java/com/youlai/admin/service/ISysRoleMenuService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysRolePermissionService.java
...a/com/youlai/admin/service/ISysRolePermissionService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysRoleService.java
...c/main/java/com/youlai/admin/service/ISysRoleService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysUserRoleService.java
...in/java/com/youlai/admin/service/ISysUserRoleService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/ISysUserService.java
...c/main/java/com/youlai/admin/service/ISysUserService.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java
...ava/com/youlai/admin/service/impl/SysDeptServiceImpl.java
+13
-9
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDictServiceImpl.java
...ava/com/youlai/admin/service/impl/SysDictServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDictTypeServiceImpl.java
...com/youlai/admin/service/impl/SysDictTypeServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysMenuServiceImpl.java
...ava/com/youlai/admin/service/impl/SysMenuServiceImpl.java
+75
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysPermissionServiceImpl.java
...m/youlai/admin/service/impl/SysPermissionServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRoleMenuServiceImpl.java
...com/youlai/admin/service/impl/SysRoleMenuServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRolePermissionServiceImpl.java
...ulai/admin/service/impl/SysRolePermissionServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRoleServiceImpl.java
...ava/com/youlai/admin/service/impl/SysRoleServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysUserRoleServiceImpl.java
...com/youlai/admin/service/impl/SysUserRoleServiceImpl.java
+1
-1
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java
...ava/com/youlai/admin/service/impl/SysUserServiceImpl.java
+1
-1
未找到文件。
youlai-admin/src/main/java/com/youlai/admin/controller/SysDeptController.java
浏览文件 @
900d663f
...
@@ -2,7 +2,8 @@ package com.youlai.admin.controller;
...
@@ -2,7 +2,8 @@ package com.youlai.admin.controller;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.youlai.admin.entity.SysDept
;
import
com.youlai.admin.common.AdminConstant
;
import
com.youlai.admin.domain.entity.SysDept
;
import
com.youlai.admin.service.ISysDeptService
;
import
com.youlai.admin.service.ISysDeptService
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -13,7 +14,9 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -13,7 +14,9 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
@Api
(
tags
=
"部门接口"
)
@Api
(
tags
=
"部门接口"
)
@RestController
@RestController
...
@@ -27,7 +30,8 @@ public class SysDeptController {
...
@@ -27,7 +30,8 @@ public class SysDeptController {
@ApiOperation
(
value
=
"列表分页"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"列表分页"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"部门名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"部门名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"mode"
,
value
=
"查询模式(mode:1-表格数据)"
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"部门状态"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"mode"
,
value
=
"查询模式(mode:1-表格数据 2-树形下拉)"
,
defaultValue
=
"1"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
})
})
@GetMapping
@GetMapping
public
Result
list
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
mode
,
public
Result
list
(
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
mode
,
...
@@ -38,13 +42,11 @@ public class SysDeptController {
...
@@ -38,13 +42,11 @@ public class SysDeptController {
.
orderByDesc
(
SysDept:
:
getUpdateTime
)
.
orderByDesc
(
SysDept:
:
getUpdateTime
)
.
orderByDesc
(
SysDept:
:
getCreateTime
);
.
orderByDesc
(
SysDept:
:
getCreateTime
);
List
list
;
List
list
;
if
(
mode
.
equals
(
1
))
{
if
(
mode
.
equals
(
1
))
{
// 表格数据
// 表格数据
baseQuery
=
baseQuery
.
like
(
StrUtil
.
isNotBlank
(
name
),
SysDept:
:
getName
,
name
)
baseQuery
=
baseQuery
.
like
(
StrUtil
.
isNotBlank
(
name
),
SysDept:
:
getName
,
name
)
.
eq
(
status
!=
null
,
SysDept:
:
getStatus
,
status
);
.
eq
(
status
!=
null
,
SysDept:
:
getStatus
,
status
);
list
=
iSysDeptService
.
listForTableData
(
baseQuery
);
list
=
iSysDeptService
.
listForTableData
(
baseQuery
);
}
else
if
(
mode
.
equals
(
2
))
{
}
else
if
(
mode
.
equals
(
2
))
{
// tree-select 树形下拉数据
// tree-select 树形下拉数据
list
=
iSysDeptService
.
listForTreeSelect
(
baseQuery
);
list
=
iSysDeptService
.
listForTreeSelect
(
baseQuery
);
}
else
{
}
else
{
list
=
iSysDeptService
.
list
(
baseQuery
);
list
=
iSysDeptService
.
list
(
baseQuery
);
...
@@ -64,8 +66,16 @@ public class SysDeptController {
...
@@ -64,8 +66,16 @@ public class SysDeptController {
@ApiImplicitParam
(
name
=
"sysDept"
,
value
=
"实体JSON对象"
,
required
=
true
,
paramType
=
"body"
,
dataType
=
"SysDept"
)
@ApiImplicitParam
(
name
=
"sysDept"
,
value
=
"实体JSON对象"
,
required
=
true
,
paramType
=
"body"
,
dataType
=
"SysDept"
)
@PostMapping
@PostMapping
public
Result
add
(
@RequestBody
SysDept
sysDept
)
{
public
Result
add
(
@RequestBody
SysDept
sysDept
)
{
boolean
status
=
iSysDeptService
.
save
(
sysDept
);
Integer
parentId
=
sysDept
.
getParentId
();
return
Result
.
status
(
status
);
String
treePath
;
if
(
parentId
.
equals
(
AdminConstant
.
ROOT_DEPT_ID
))
{
treePath
=
String
.
valueOf
(
AdminConstant
.
ROOT_DEPT_ID
);
}
else
{
SysDept
parentDept
=
iSysDeptService
.
getById
(
parentId
);
treePath
=
Optional
.
ofNullable
(
parentDept
).
map
(
dept
->
dept
.
getParentId
()
+
","
+
dept
.
getTreePath
()).
get
();
}
sysDept
.
setTreePath
(
treePath
);
return
Result
.
status
(
iSysDeptService
.
save
(
sysDept
));
}
}
@ApiOperation
(
value
=
"修改部门"
,
httpMethod
=
"PUT"
)
@ApiOperation
(
value
=
"修改部门"
,
httpMethod
=
"PUT"
)
...
@@ -77,6 +87,16 @@ public class SysDeptController {
...
@@ -77,6 +87,16 @@ public class SysDeptController {
public
Result
update
(
public
Result
update
(
@PathVariable
Integer
id
,
@PathVariable
Integer
id
,
@RequestBody
SysDept
sysDept
)
{
@RequestBody
SysDept
sysDept
)
{
Integer
parentId
=
sysDept
.
getParentId
();
String
treePath
;
if
(
parentId
.
equals
(
AdminConstant
.
ROOT_DEPT_ID
))
{
treePath
=
String
.
valueOf
(
AdminConstant
.
ROOT_DEPT_ID
);
}
else
{
SysDept
parentDept
=
iSysDeptService
.
getById
(
parentId
);
treePath
=
Optional
.
ofNullable
(
parentDept
).
map
(
dept
->
dept
.
getParentId
()
+
","
+
dept
.
getTreePath
()).
get
();
}
sysDept
.
setTreePath
(
treePath
);
boolean
status
=
iSysDeptService
.
updateById
(
sysDept
);
boolean
status
=
iSysDeptService
.
updateById
(
sysDept
);
return
Result
.
status
(
status
);
return
Result
.
status
(
status
);
}
}
...
@@ -85,7 +105,12 @@ public class SysDeptController {
...
@@ -85,7 +105,12 @@ public class SysDeptController {
@ApiImplicitParam
(
name
=
"ids[]"
,
value
=
"id集合"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataType
=
"Integer"
)
@ApiImplicitParam
(
name
=
"ids[]"
,
value
=
"id集合"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataType
=
"Integer"
)
@DeleteMapping
@DeleteMapping
public
Result
delete
(
@RequestParam
(
"ids"
)
List
<
Integer
>
ids
)
{
public
Result
delete
(
@RequestParam
(
"ids"
)
List
<
Integer
>
ids
)
{
boolean
status
=
iSysDeptService
.
removeByIds
(
ids
);
return
Result
.
status
(
status
);
// 删除部门以及子部门
Optional
.
ofNullable
(
ids
).
orElse
(
new
ArrayList
<>()).
forEach
(
id
->
iSysDeptService
.
remove
(
new
LambdaQueryWrapper
<
SysDept
>().
eq
(
SysDept:
:
getId
,
id
)
.
or
().
apply
(
"concat (',',tree_path,',') like concat('%,',{1},',%')"
,
id
))
);
return
Result
.
success
();
}
}
}
}
youlai-admin/src/main/java/com/youlai/admin/controller/SysDictController.java
浏览文件 @
900d663f
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.youlai.admin.entity.SysDict
;
import
com.youlai.admin.
domain.
entity.SysDict
;
import
com.youlai.admin.service.ISysDictService
;
import
com.youlai.admin.service.ISysDictService
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
...
...
youlai-admin/src/main/java/com/youlai/admin/controller/SysDictTypeController.java
浏览文件 @
900d663f
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.youlai.admin.entity.SysDictType
;
import
com.youlai.admin.
domain.
entity.SysDictType
;
import
com.youlai.admin.service.ISysDictTypeService
;
import
com.youlai.admin.service.ISysDictTypeService
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
...
...
youlai-admin/src/main/java/com/youlai/admin/controller/SysMenuController.java
浏览文件 @
900d663f
...
@@ -3,7 +3,8 @@ package com.youlai.admin.controller;
...
@@ -3,7 +3,8 @@ package com.youlai.admin.controller;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.youlai.admin.entity.SysMenu
;
import
com.youlai.admin.domain.entity.SysMenu
;
import
com.youlai.admin.domain.entity.SysMenu
;
import
com.youlai.admin.service.ISysMenuService
;
import
com.youlai.admin.service.ISysMenuService
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
...
@@ -24,31 +25,29 @@ import java.util.List;
...
@@ -24,31 +25,29 @@ import java.util.List;
@Slf4j
@Slf4j
public
class
SysMenuController
{
public
class
SysMenuController
{
@Autowired
@Autowired
private
ISysMenuService
iSysMenuService
;
private
ISysMenuService
iSysMenuService
;
@ApiOperation
(
value
=
"列表分页"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"列表分页"
,
httpMethod
=
"GET"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"菜单名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"每页数量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"mode"
,
value
=
"查询模式: 1-表格数据 2-树形下拉"
,
paramType
=
"query"
,
dataType
=
"Integer"
)
@ApiImplicitParam
(
name
=
"username"
,
value
=
"菜单名"
,
paramType
=
"query"
,
dataType
=
"String"
),
})
})
@GetMapping
@GetMapping
public
Result
list
(
Integer
page
,
Integer
limit
,
String
nam
e
)
{
public
Result
list
(
String
name
,
Integer
mod
e
)
{
LambdaQueryWrapper
<
SysMenu
>
queryWrapper
=
new
LambdaQueryWrapper
<
SysMenu
>()
LambdaQueryWrapper
<
SysMenu
>
baseQuery
=
new
LambdaQueryWrapper
<
SysMenu
>()
.
like
(
StrUtil
.
isNotBlank
(
name
),
SysMenu:
:
getName
,
name
)
.
orderByAsc
(
SysMenu:
:
getSort
)
.
orderByDesc
(
SysMenu:
:
getUpdateTime
)
.
orderByDesc
(
SysMenu:
:
getUpdateTime
)
.
orderByDesc
(
SysMenu:
:
getCreateTime
);
.
orderByDesc
(
SysMenu:
:
getCreateTime
);
List
list
;
if
(
page
!=
null
&&
limit
!=
null
)
{
if
(
mode
.
equals
(
1
))
{
// 表格数据
Page
<
SysMenu
>
result
=
iSysMenuService
.
page
(
new
Page
<>(
page
,
limit
)
,
queryWrapper
);
baseQuery
=
baseQuery
.
like
(
StrUtil
.
isNotBlank
(
name
),
SysMenu:
:
getName
,
name
);
list
=
iSysMenuService
.
listForTableData
(
baseQuery
);
return
PageResult
.
success
(
result
.
getRecords
(),
result
.
getTotal
());
}
else
if
(
mode
.
equals
(
2
))
{
// tree-select 树形下拉数据
}
else
if
(
limit
!=
null
)
{
list
=
iSysMenuService
.
listForTreeSelect
(
baseQuery
);
queryWrapper
.
last
(
"LIMIT "
+
limit
);
}
else
{
list
=
iSysMenuService
.
list
(
baseQuery
);
}
}
List
<
SysMenu
>
list
=
iSysMenuService
.
list
(
queryWrapper
);
return
Result
.
success
(
list
);
return
Result
.
success
(
list
);
}
}
...
...
youlai-admin/src/main/java/com/youlai/admin/controller/SysRoleController.java
浏览文件 @
900d663f
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
...
@@ -3,7 +3,7 @@ package com.youlai.admin.controller;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.youlai.admin.entity.SysRole
;
import
com.youlai.admin.
domain.
entity.SysRole
;
import
com.youlai.admin.service.ISysRoleService
;
import
com.youlai.admin.service.ISysRoleService
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
...
@@ -32,7 +32,7 @@ public class SysRoleController {
...
@@ -32,7 +32,7 @@ public class SysRoleController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"每页数量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"limit"
,
value
=
"每页数量"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"username"
,
value
=
"角色名"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"username"
,
value
=
"角色名
称
"
,
paramType
=
"query"
,
dataType
=
"String"
),
})
})
@GetMapping
@GetMapping
public
Result
list
(
Integer
page
,
Integer
limit
,
String
name
)
{
public
Result
list
(
Integer
page
,
Integer
limit
,
String
name
)
{
...
@@ -43,7 +43,6 @@ public class SysRoleController {
...
@@ -43,7 +43,6 @@ public class SysRoleController {
if
(
page
!=
null
&&
limit
!=
null
)
{
if
(
page
!=
null
&&
limit
!=
null
)
{
Page
<
SysRole
>
result
=
iSysRoleService
.
page
(
new
Page
<>(
page
,
limit
)
,
queryWrapper
);
Page
<
SysRole
>
result
=
iSysRoleService
.
page
(
new
Page
<>(
page
,
limit
)
,
queryWrapper
);
return
PageResult
.
success
(
result
.
getRecords
(),
result
.
getTotal
());
return
PageResult
.
success
(
result
.
getRecords
(),
result
.
getTotal
());
}
else
if
(
limit
!=
null
)
{
}
else
if
(
limit
!=
null
)
{
queryWrapper
.
last
(
"LIMIT "
+
limit
);
queryWrapper
.
last
(
"LIMIT "
+
limit
);
...
...
youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java
浏览文件 @
900d663f
...
@@ -3,18 +3,17 @@ package com.youlai.admin.controller;
...
@@ -3,18 +3,17 @@ package com.youlai.admin.controller;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSON
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.youlai.admin.api.dto.UserDTO
;
import
com.youlai.admin.api.dto.UserDTO
;
import
com.youlai.admin.entity.SysUser
;
import
com.youlai.admin.
domain.
entity.SysUser
;
import
com.youlai.admin.entity.SysUserRole
;
import
com.youlai.admin.
domain.
entity.SysUserRole
;
import
com.youlai.admin.service.ISysRoleService
;
import
com.youlai.admin.service.ISysRoleService
;
import
com.youlai.admin.service.ISysUserRoleService
;
import
com.youlai.admin.service.ISysUserRoleService
;
import
com.youlai.admin.service.ISysUserService
;
import
com.youlai.admin.service.ISysUserService
;
import
com.youlai.admin.vo.UserVO
;
import
com.youlai.admin.
domain.
vo.UserVO
;
import
com.youlai.common.auth.constant.AuthConstant
;
import
com.youlai.common.auth.constant.AuthConstant
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.PageResult
;
import
com.youlai.common.result.Result
;
import
com.youlai.common.result.Result
;
...
@@ -24,13 +23,10 @@ import io.swagger.annotations.ApiImplicitParams;
...
@@ -24,13 +23,10 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.server.reactive.ServerHttpRequest
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -129,7 +125,6 @@ public class SysUserController {
...
@@ -129,7 +125,6 @@ public class SysUserController {
userDTO
.
setRoles
(
roles
);
userDTO
.
setRoles
(
roles
);
}
}
}
}
return
userDTO
;
return
userDTO
;
}
}
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysDept.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysDept.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysDict.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysDict.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysDictType.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysDictType.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysMenu.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysMenu.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysPermission.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysPermission.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysRole.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysRole.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysRoleMenu.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysRoleMenu.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysRolePermission.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysRolePermission.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysUser.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysUser.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.youlai.common.core.entity.BaseEntity
;
import
com.youlai.common.core.entity.BaseEntity
;
...
...
youlai-admin/src/main/java/com/youlai/admin/entity/SysUserRole.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
entity/SysUserRole.java
浏览文件 @
900d663f
package
com.youlai.admin.entity
;
package
com.youlai.admin.
domain.
entity
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/vo/DeptVO.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
vo/DeptVO.java
浏览文件 @
900d663f
package
com.youlai.admin.vo
;
package
com.youlai.admin.
domain.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.List
;
...
...
youlai-admin/src/main/java/com/youlai/admin/domain/vo/MenuVO.java
0 → 100644
浏览文件 @
900d663f
package
com.youlai.admin.domain.vo
;
import
com.youlai.common.core.entity.BaseEntity
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
MenuVO
extends
BaseEntity
{
private
Integer
id
;
private
String
name
;
private
Integer
parentId
;
private
String
icon
;
private
Integer
sort
;
private
Integer
visible
;
private
Integer
status
;
private
String
path
;
private
String
perms
;
private
List
<
MenuVO
>
children
;
}
youlai-admin/src/main/java/com/youlai/admin/vo/TreeSelectVO.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
vo/TreeSelectVO.java
浏览文件 @
900d663f
package
com.youlai.admin.vo
;
package
com.youlai.admin.
domain.
vo
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/vo/UserVO.java
→
youlai-admin/src/main/java/com/youlai/admin/
domain/
vo/UserVO.java
浏览文件 @
900d663f
package
com.youlai.admin.vo
;
package
com.youlai.admin.
domain.
vo
;
import
lombok.Data
;
import
lombok.Data
;
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDeptMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysDept
;
import
com.youlai.admin.
domain.
entity.SysDept
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDictMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysDict
;
import
com.youlai.admin.
domain.
entity.SysDict
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysDictTypeMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysDictType
;
import
com.youlai.admin.
domain.
entity.SysDictType
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysMenuMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysMenu
;
import
com.youlai.admin.
domain.
entity.SysMenu
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysPermissionMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysPermission
;
import
com.youlai.admin.
domain.
entity.SysPermission
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRoleMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysRole
;
import
com.youlai.admin.
domain.
entity.SysRole
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRoleMenuMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysRoleMenu
;
import
com.youlai.admin.
domain.
entity.SysRoleMenu
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysRolePermissionMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysRolePermission
;
import
com.youlai.admin.
domain.
entity.SysRolePermission
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysUserMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysUser
;
import
com.youlai.admin.
domain.
entity.SysUser
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/mapper/SysUserRoleMapper.java
浏览文件 @
900d663f
package
com.youlai.admin.mapper
;
package
com.youlai.admin.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.youlai.admin.entity.SysUserRole
;
import
com.youlai.admin.
domain.
entity.SysUserRole
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
@Mapper
@Mapper
...
...
youlai-admin/src/main/java/com/youlai/admin/service/ISysDeptService.java
浏览文件 @
900d663f
...
@@ -3,9 +3,9 @@ package com.youlai.admin.service;
...
@@ -3,9 +3,9 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysDept
;
import
com.youlai.admin.
domain.
entity.SysDept
;
import
com.youlai.admin.vo.DeptVO
;
import
com.youlai.admin.
domain.
vo.DeptVO
;
import
com.youlai.admin.vo.TreeSelectVO
;
import
com.youlai.admin.
domain.
vo.TreeSelectVO
;
import
java.util.List
;
import
java.util.List
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/ISysDictService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysDict
;
import
com.youlai.admin.
domain.
entity.SysDict
;
public
interface
ISysDictService
extends
IService
<
SysDict
>
{
public
interface
ISysDictService
extends
IService
<
SysDict
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysDictTypeService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysDictType
;
import
com.youlai.admin.
domain.
entity.SysDictType
;
public
interface
ISysDictTypeService
extends
IService
<
SysDictType
>
{
public
interface
ISysDictTypeService
extends
IService
<
SysDictType
>
{
...
...
youlai-admin/src/main/java/com/youlai/admin/service/ISysMenuService.java
浏览文件 @
900d663f
package
com.youlai.admin.service
;
package
com.youlai.admin.service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysMenu
;
import
com.youlai.admin.domain.entity.SysMenu
;
import
com.youlai.admin.domain.vo.MenuVO
;
import
com.youlai.admin.domain.vo.TreeSelectVO
;
import
java.util.List
;
public
interface
ISysMenuService
extends
IService
<
SysMenu
>
{
public
interface
ISysMenuService
extends
IService
<
SysMenu
>
{
List
<
MenuVO
>
listForTableData
(
LambdaQueryWrapper
<
SysMenu
>
baseQuery
);
List
<
TreeSelectVO
>
listForTreeSelect
(
LambdaQueryWrapper
<
SysMenu
>
baseQuery
);
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysPermissionService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysPermission
;
import
com.youlai.admin.
domain.
entity.SysPermission
;
import
java.util.List
;
import
java.util.List
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/ISysRoleMenuService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysRoleMenu
;
import
com.youlai.admin.
domain.
entity.SysRoleMenu
;
public
interface
ISysRoleMenuService
extends
IService
<
SysRoleMenu
>
{
public
interface
ISysRoleMenuService
extends
IService
<
SysRoleMenu
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysRolePermissionService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysRolePermission
;
import
com.youlai.admin.
domain.
entity.SysRolePermission
;
public
interface
ISysRolePermissionService
extends
IService
<
SysRolePermission
>
{
public
interface
ISysRolePermissionService
extends
IService
<
SysRolePermission
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysRoleService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysRole
;
import
com.youlai.admin.
domain.
entity.SysRole
;
public
interface
ISysRoleService
extends
IService
<
SysRole
>
{
public
interface
ISysRoleService
extends
IService
<
SysRole
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysUserRoleService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysUserRole
;
import
com.youlai.admin.
domain.
entity.SysUserRole
;
public
interface
ISysUserRoleService
extends
IService
<
SysUserRole
>
{
public
interface
ISysUserRoleService
extends
IService
<
SysUserRole
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/ISysUserService.java
浏览文件 @
900d663f
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
...
@@ -2,7 +2,7 @@ package com.youlai.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.youlai.admin.entity.SysUser
;
import
com.youlai.admin.
domain.
entity.SysUser
;
public
interface
ISysUserService
extends
IService
<
SysUser
>
{
public
interface
ISysUserService
extends
IService
<
SysUser
>
{
}
}
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java
浏览文件 @
900d663f
...
@@ -4,11 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,11 +4,11 @@ import cn.hutool.core.bean.BeanUtil;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.common.AdminConstant
;
import
com.youlai.admin.common.AdminConstant
;
import
com.youlai.admin.entity.SysDept
;
import
com.youlai.admin.
domain.
entity.SysDept
;
import
com.youlai.admin.mapper.SysDeptMapper
;
import
com.youlai.admin.mapper.SysDeptMapper
;
import
com.youlai.admin.service.ISysDeptService
;
import
com.youlai.admin.service.ISysDeptService
;
import
com.youlai.admin.vo.DeptVO
;
import
com.youlai.admin.
domain.
vo.DeptVO
;
import
com.youlai.admin.vo.TreeSelectVO
;
import
com.youlai.admin.
domain.
vo.TreeSelectVO
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -26,6 +26,16 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -26,6 +26,16 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
}
}
@Override
public
List
<
TreeSelectVO
>
listForTreeSelect
(
LambdaQueryWrapper
<
SysDept
>
baseQuery
)
{
List
<
SysDept
>
deptList
=
this
.
baseMapper
.
selectList
(
baseQuery
);
List
<
TreeSelectVO
>
list
=
recursionForTreeSelect
(
AdminConstant
.
ROOT_DEPT_ID
,
deptList
);
return
list
;
}
/**
/**
* 递归生成部门表格数据
* 递归生成部门表格数据
* @param parentId
* @param parentId
...
@@ -47,12 +57,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -47,12 +57,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
return
list
;
return
list
;
}
}
@Override
public
List
<
TreeSelectVO
>
listForTreeSelect
(
LambdaQueryWrapper
<
SysDept
>
baseQuery
)
{
List
<
SysDept
>
deptList
=
this
.
baseMapper
.
selectList
(
baseQuery
);
List
<
TreeSelectVO
>
list
=
recursionForTreeSelect
(
AdminConstant
.
ROOT_DEPT_ID
,
deptList
);
return
list
;
}
/**
/**
* 递归生成部门树形下拉数据
* 递归生成部门树形下拉数据
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDictServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysDict
;
import
com.youlai.admin.
domain.
entity.SysDict
;
import
com.youlai.admin.mapper.SysDictMapper
;
import
com.youlai.admin.mapper.SysDictMapper
;
import
com.youlai.admin.service.ISysDictService
;
import
com.youlai.admin.service.ISysDictService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDictTypeServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysDictType
;
import
com.youlai.admin.
domain.
entity.SysDictType
;
import
com.youlai.admin.mapper.SysDictTypeMapper
;
import
com.youlai.admin.mapper.SysDictTypeMapper
;
import
com.youlai.admin.service.ISysDictTypeService
;
import
com.youlai.admin.service.ISysDictTypeService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysMenuServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysMenu
;
import
com.youlai.admin.common.AdminConstant
;
import
com.youlai.admin.domain.entity.SysMenu
;
import
com.youlai.admin.domain.entity.SysMenu
;
import
com.youlai.admin.domain.vo.MenuVO
;
import
com.youlai.admin.domain.vo.MenuVO
;
import
com.youlai.admin.domain.vo.TreeSelectVO
;
import
com.youlai.admin.mapper.SysMenuMapper
;
import
com.youlai.admin.mapper.SysMenuMapper
;
import
com.youlai.admin.service.ISysMenuService
;
import
com.youlai.admin.service.ISysMenuService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
@Service
@Service
public
class
SysMenuServiceImpl
extends
ServiceImpl
<
SysMenuMapper
,
SysMenu
>
implements
ISysMenuService
{
public
class
SysMenuServiceImpl
extends
ServiceImpl
<
SysMenuMapper
,
SysMenu
>
implements
ISysMenuService
{
@Override
public
List
<
MenuVO
>
listForTableData
(
LambdaQueryWrapper
<
SysMenu
>
baseQuery
)
{
List
<
SysMenu
>
deptList
=
this
.
baseMapper
.
selectList
(
baseQuery
);
List
<
MenuVO
>
list
=
recursionForTableData
(
AdminConstant
.
ROOT_DEPT_ID
,
deptList
);
return
list
;
}
@Override
public
List
<
TreeSelectVO
>
listForTreeSelect
(
LambdaQueryWrapper
<
SysMenu
>
baseQuery
)
{
List
<
SysMenu
>
deptList
=
this
.
baseMapper
.
selectList
(
baseQuery
);
List
<
TreeSelectVO
>
list
=
recursionForTreeSelect
(
AdminConstant
.
ROOT_DEPT_ID
,
deptList
);
return
list
;
}
/**
* 递归生成部门表格数据
* @param parentId
* @param deptList
* @return
*/
public
static
List
<
MenuVO
>
recursionForTableData
(
int
parentId
,
List
<
SysMenu
>
deptList
)
{
List
<
MenuVO
>
list
=
new
ArrayList
<>();
Optional
.
ofNullable
(
deptList
).
orElse
(
new
ArrayList
<>())
.
stream
()
.
filter
(
dept
->
dept
.
getParentId
().
equals
(
parentId
))
.
forEach
(
dept
->
{
MenuVO
deptVO
=
new
MenuVO
();
BeanUtil
.
copyProperties
(
dept
,
deptVO
);
List
<
MenuVO
>
children
=
recursionForTableData
(
dept
.
getId
(),
deptList
);
deptVO
.
setChildren
(
children
);
list
.
add
(
deptVO
);
});
return
list
;
}
/**
* 递归生成部门树形下拉数据
* @param parentId
* @param deptList
* @return
*/
public
static
List
<
TreeSelectVO
>
recursionForTreeSelect
(
int
parentId
,
List
<
SysMenu
>
deptList
)
{
List
<
TreeSelectVO
>
list
=
new
ArrayList
<>();
Optional
.
ofNullable
(
deptList
).
orElse
(
new
ArrayList
<>())
.
stream
()
.
filter
(
dept
->
dept
.
getParentId
().
equals
(
parentId
))
.
forEach
(
dept
->
{
TreeSelectVO
treeSelectVO
=
new
TreeSelectVO
();
treeSelectVO
.
setId
(
dept
.
getId
().
toString
());
treeSelectVO
.
setLabel
(
dept
.
getName
());
List
<
TreeSelectVO
>
children
=
recursionForTreeSelect
(
dept
.
getId
(),
deptList
);
treeSelectVO
.
setChildren
(
children
);
list
.
add
(
treeSelectVO
);
});
return
list
;
}
}
}
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysPermissionServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysPermission
;
import
com.youlai.admin.
domain.
entity.SysPermission
;
import
com.youlai.admin.mapper.SysPermissionMapper
;
import
com.youlai.admin.mapper.SysPermissionMapper
;
import
com.youlai.admin.service.ISysPermissionService
;
import
com.youlai.admin.service.ISysPermissionService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRoleMenuServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysRoleMenu
;
import
com.youlai.admin.
domain.
entity.SysRoleMenu
;
import
com.youlai.admin.mapper.SysRoleMenuMapper
;
import
com.youlai.admin.mapper.SysRoleMenuMapper
;
import
com.youlai.admin.service.ISysRoleMenuService
;
import
com.youlai.admin.service.ISysRoleMenuService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRolePermissionServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysRolePermission
;
import
com.youlai.admin.
domain.
entity.SysRolePermission
;
import
com.youlai.admin.mapper.SysRolePermissionMapper
;
import
com.youlai.admin.mapper.SysRolePermissionMapper
;
import
com.youlai.admin.service.ISysRolePermissionService
;
import
com.youlai.admin.service.ISysRolePermissionService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysRoleServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysRole
;
import
com.youlai.admin.
domain.
entity.SysRole
;
import
com.youlai.admin.mapper.SysRoleMapper
;
import
com.youlai.admin.mapper.SysRoleMapper
;
import
com.youlai.admin.service.ISysRoleService
;
import
com.youlai.admin.service.ISysRoleService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysUserRoleServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysUserRole
;
import
com.youlai.admin.
domain.
entity.SysUserRole
;
import
com.youlai.admin.mapper.SysUserRoleMapper
;
import
com.youlai.admin.mapper.SysUserRoleMapper
;
import
com.youlai.admin.service.ISysUserRoleService
;
import
com.youlai.admin.service.ISysUserRoleService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
youlai-admin/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java
浏览文件 @
900d663f
package
com.youlai.admin.service.impl
;
package
com.youlai.admin.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.youlai.admin.entity.SysUser
;
import
com.youlai.admin.
domain.
entity.SysUser
;
import
com.youlai.admin.mapper.SysUserMapper
;
import
com.youlai.admin.mapper.SysUserMapper
;
import
com.youlai.admin.service.ISysUserService
;
import
com.youlai.admin.service.ISysUserService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录