Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Pig
提交
4ab93eb9
P
Pig
项目概览
int
/
Pig
上一次同步 大约 1 年
通知
8
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pig
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4ab93eb9
编写于
8月 24, 2021
作者:
W
wjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
Introducing new features. closed #I470L8 优化原有用户信息查询逻辑
上级
00b4e9ec
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
118 addition
and
84 deletion
+118
-84
db/pig.sql
db/pig.sql
+4
-0
pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java
...ava/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java
+0
-1
pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java
.../main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java
+14
-0
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java
...va/com/pig4cloud/pig/admin/controller/MenuController.java
+7
-7
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java
...in/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java
+2
-9
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java
...in/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java
+7
-0
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysLogService.java
...n/java/com/pig4cloud/pig/admin/service/SysLogService.java
+10
-1
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java
.../java/com/pig4cloud/pig/admin/service/SysMenuService.java
+2
-2
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java
.../java/com/pig4cloud/pig/admin/service/SysRoleService.java
+0
-9
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserRoleService.java
...a/com/pig4cloud/pig/admin/service/SysUserRoleService.java
+0
-9
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
.../pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
+7
-0
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysLogServiceImpl.java
...m/pig4cloud/pig/admin/service/impl/SysLogServiceImpl.java
+22
-1
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
.../pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
+6
-5
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java
...4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java
+1
-1
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java
.../pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java
+0
-12
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserRoleServiceImpl.java
...4cloud/pig/admin/service/impl/SysUserRoleServiceImpl.java
+0
-12
pig-upms/pig-upms-biz/src/main/resources/mapper/SysMenuMapper.xml
.../pig-upms-biz/src/main/resources/mapper/SysMenuMapper.xml
+6
-14
pig-upms/pig-upms-biz/src/main/resources/mapper/SysUserMapper.xml
.../pig-upms-biz/src/main/resources/mapper/SysUserMapper.xml
+29
-0
pom.xml
pom.xml
+1
-1
未找到文件。
db/pig.sql
浏览文件 @
4ab93eb9
...
@@ -198,6 +198,7 @@ INSERT INTO `sys_menu` VALUES (1100, '用户管理', NULL, '/admin/user/index',
...
@@ -198,6 +198,7 @@ INSERT INTO `sys_menu` VALUES (1100, '用户管理', NULL, '/admin/user/index',
INSERT
INTO
`sys_menu`
VALUES
(
1101
,
'用户新增'
,
'sys_user_add'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:52:09'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1101
,
'用户新增'
,
'sys_user_add'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:52:09'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1102
,
'用户修改'
,
'sys_user_edit'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:52:48'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1102
,
'用户修改'
,
'sys_user_edit'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:52:48'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1103
,
'用户删除'
,
'sys_user_del'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:54:01'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1103
,
'用户删除'
,
'sys_user_del'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:54:01'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1104
,
'导入导出'
,
'sys_user_import_export'
,
NULL
,
1100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:54:01'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1200
,
'菜单管理'
,
NULL
,
'/admin/menu/index'
,
1000
,
'icon-caidanguanli'
,
NULL
,
2
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-08 09:57:27'
,
NULL
,
'2020-03-12 00:13:52'
);
INSERT
INTO
`sys_menu`
VALUES
(
1200
,
'菜单管理'
,
NULL
,
'/admin/menu/index'
,
1000
,
'icon-caidanguanli'
,
NULL
,
2
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-08 09:57:27'
,
NULL
,
'2020-03-12 00:13:52'
);
INSERT
INTO
`sys_menu`
VALUES
(
1201
,
'菜单新增'
,
'sys_menu_add'
,
NULL
,
1200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 10:15:53'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1201
,
'菜单新增'
,
'sys_menu_add'
,
NULL
,
1200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 10:15:53'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1202
,
'菜单修改'
,
'sys_menu_edit'
,
NULL
,
1200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 10:16:23'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
1202
,
'菜单修改'
,
'sys_menu_edit'
,
NULL
,
1200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 10:16:23'
,
NULL
,
'2021-05-25 06:48:34'
);
...
@@ -214,6 +215,7 @@ INSERT INTO `sys_menu` VALUES (1403, '部门删除', 'sys_dept_del', NULL, 1400,
...
@@ -214,6 +215,7 @@ INSERT INTO `sys_menu` VALUES (1403, '部门删除', 'sys_dept_del', NULL, 1400,
INSERT
INTO
`sys_menu`
VALUES
(
2000
,
'系统管理'
,
NULL
,
'/setting'
,
-
1
,
'icon-xitongguanli'
,
NULL
,
1
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-07 20:56:00'
,
NULL
,
'2020-03-11 23:52:53'
);
INSERT
INTO
`sys_menu`
VALUES
(
2000
,
'系统管理'
,
NULL
,
'/setting'
,
-
1
,
'icon-xitongguanli'
,
NULL
,
1
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-07 20:56:00'
,
NULL
,
'2020-03-11 23:52:53'
);
INSERT
INTO
`sys_menu`
VALUES
(
2100
,
'日志管理'
,
NULL
,
'/admin/log/index'
,
2000
,
'icon-rizhiguanli'
,
NULL
,
5
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-20 14:06:22'
,
NULL
,
'2020-03-12 00:15:49'
);
INSERT
INTO
`sys_menu`
VALUES
(
2100
,
'日志管理'
,
NULL
,
'/admin/log/index'
,
2000
,
'icon-rizhiguanli'
,
NULL
,
5
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-20 14:06:22'
,
NULL
,
'2020-03-12 00:15:49'
);
INSERT
INTO
`sys_menu`
VALUES
(
2101
,
'日志删除'
,
'sys_log_del'
,
NULL
,
2100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-20 20:37:37'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2101
,
'日志删除'
,
'sys_log_del'
,
NULL
,
2100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-20 20:37:37'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2102
,
'导入导出'
,
'sys_log_import_export'
,
NULL
,
2100
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-08 09:54:01'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2200
,
'字典管理'
,
NULL
,
'/admin/dict/index'
,
2000
,
'icon-navicon-zdgl'
,
NULL
,
6
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-29 11:30:52'
,
NULL
,
'2020-03-12 00:15:58'
);
INSERT
INTO
`sys_menu`
VALUES
(
2200
,
'字典管理'
,
NULL
,
'/admin/dict/index'
,
2000
,
'icon-navicon-zdgl'
,
NULL
,
6
,
'0'
,
'0'
,
'0'
,
NULL
,
'2017-11-29 11:30:52'
,
NULL
,
'2020-03-12 00:15:58'
);
INSERT
INTO
`sys_menu`
VALUES
(
2201
,
'字典删除'
,
'sys_dict_del'
,
NULL
,
2200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-29 11:30:11'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2201
,
'字典删除'
,
'sys_dict_del'
,
NULL
,
2200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2017-11-29 11:30:11'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2202
,
'字典新增'
,
'sys_dict_add'
,
NULL
,
2200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2018-05-11 22:34:55'
,
NULL
,
'2021-05-25 06:48:34'
);
INSERT
INTO
`sys_menu`
VALUES
(
2202
,
'字典新增'
,
'sys_dict_add'
,
NULL
,
2200
,
NULL
,
NULL
,
1
,
'0'
,
'1'
,
'0'
,
NULL
,
'2018-05-11 22:34:55'
,
NULL
,
'2021-05-25 06:48:34'
);
...
@@ -316,6 +318,7 @@ INSERT INTO `sys_role_menu` VALUES (1, 1100);
...
@@ -316,6 +318,7 @@ INSERT INTO `sys_role_menu` VALUES (1, 1100);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1101
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1101
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1102
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1102
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1103
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1103
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1104
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1200
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1200
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1201
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1201
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1202
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
1202
);
...
@@ -332,6 +335,7 @@ INSERT INTO `sys_role_menu` VALUES (1, 1403);
...
@@ -332,6 +335,7 @@ INSERT INTO `sys_role_menu` VALUES (1, 1403);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2000
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2000
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2100
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2100
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2101
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2101
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2102
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2200
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2200
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2201
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2201
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2202
);
INSERT
INTO
`sys_role_menu`
VALUES
(
1
,
2202
);
...
...
pig-auth/src/main/java/com/pig4cloud/pig/auth/endpoint/PigTokenEndpoint.java
浏览文件 @
4ab93eb9
...
@@ -172,5 +172,4 @@ public class PigTokenEndpoint {
...
@@ -172,5 +172,4 @@ public class PigTokenEndpoint {
return
R
.
ok
(
result
);
return
R
.
ok
(
result
);
}
}
}
}
pig-upms/pig-upms-api/src/main/java/com/pig4cloud/pig/admin/api/entity/SysLog.java
浏览文件 @
4ab93eb9
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
com.pig4cloud.pig.admin.api.entity
;
package
com.pig4cloud.pig.admin.api.entity
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
...
@@ -44,6 +46,7 @@ public class SysLog extends BaseEntity {
...
@@ -44,6 +46,7 @@ public class SysLog extends BaseEntity {
* 编号
* 编号
*/
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@ExcelProperty
(
"日志编号"
)
@ApiModelProperty
(
value
=
"日志编号"
)
@ApiModelProperty
(
value
=
"日志编号"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
private
Long
id
;
...
@@ -52,6 +55,7 @@ public class SysLog extends BaseEntity {
...
@@ -52,6 +55,7 @@ public class SysLog extends BaseEntity {
* 日志类型
* 日志类型
*/
*/
@NotBlank
(
message
=
"日志类型不能为空"
)
@NotBlank
(
message
=
"日志类型不能为空"
)
@ExcelProperty
(
"日志类型(0-正常 9-错误)"
)
@ApiModelProperty
(
value
=
"日志类型"
)
@ApiModelProperty
(
value
=
"日志类型"
)
private
String
type
;
private
String
type
;
...
@@ -59,54 +63,63 @@ public class SysLog extends BaseEntity {
...
@@ -59,54 +63,63 @@ public class SysLog extends BaseEntity {
* 日志标题
* 日志标题
*/
*/
@NotBlank
(
message
=
"日志标题不能为空"
)
@NotBlank
(
message
=
"日志标题不能为空"
)
@ExcelProperty
(
"日志标题"
)
@ApiModelProperty
(
value
=
"日志标题"
)
@ApiModelProperty
(
value
=
"日志标题"
)
private
String
title
;
private
String
title
;
/**
/**
* 操作IP地址
* 操作IP地址
*/
*/
@ExcelProperty
(
"IP"
)
@ApiModelProperty
(
value
=
"操作ip地址"
)
@ApiModelProperty
(
value
=
"操作ip地址"
)
private
String
remoteAddr
;
private
String
remoteAddr
;
/**
/**
* 用户浏览器
* 用户浏览器
*/
*/
@ExcelProperty
(
"浏览器类型"
)
@ApiModelProperty
(
value
=
"用户代理"
)
@ApiModelProperty
(
value
=
"用户代理"
)
private
String
userAgent
;
private
String
userAgent
;
/**
/**
* 请求URI
* 请求URI
*/
*/
@ExcelProperty
(
"请求URI"
)
@ApiModelProperty
(
value
=
"请求uri"
)
@ApiModelProperty
(
value
=
"请求uri"
)
private
String
requestUri
;
private
String
requestUri
;
/**
/**
* 操作方式
* 操作方式
*/
*/
@ExcelProperty
(
"操作方式"
)
@ApiModelProperty
(
value
=
"操作方式"
)
@ApiModelProperty
(
value
=
"操作方式"
)
private
String
method
;
private
String
method
;
/**
/**
* 操作提交的数据
* 操作提交的数据
*/
*/
@ExcelProperty
(
"请求参数"
)
@ApiModelProperty
(
value
=
"数据"
)
@ApiModelProperty
(
value
=
"数据"
)
private
String
params
;
private
String
params
;
/**
/**
* 执行时间
* 执行时间
*/
*/
@ExcelProperty
(
"方法执行时间"
)
@ApiModelProperty
(
value
=
"方法执行时间"
)
@ApiModelProperty
(
value
=
"方法执行时间"
)
private
Long
time
;
private
Long
time
;
/**
/**
* 异常信息
* 异常信息
*/
*/
@ExcelProperty
(
"异常信息"
)
@ApiModelProperty
(
value
=
"异常信息"
)
@ApiModelProperty
(
value
=
"异常信息"
)
private
String
exception
;
private
String
exception
;
/**
/**
* 服务ID
* 服务ID
*/
*/
@ExcelProperty
(
"应用标识"
)
@ApiModelProperty
(
value
=
"应用标识"
)
@ApiModelProperty
(
value
=
"应用标识"
)
private
String
serviceId
;
private
String
serviceId
;
...
@@ -114,6 +127,7 @@ public class SysLog extends BaseEntity {
...
@@ -114,6 +127,7 @@ public class SysLog extends BaseEntity {
* 删除标记
* 删除标记
*/
*/
@TableLogic
@TableLogic
@ExcelIgnore
private
String
delFlag
;
private
String
delFlag
;
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java
浏览文件 @
4ab93eb9
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
com.pig4cloud.pig.admin.controller
;
package
com.pig4cloud.pig.admin.controller
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
import
com.pig4cloud.pig.admin.service.SysMenuService
;
import
com.pig4cloud.pig.admin.service.SysMenuService
;
import
com.pig4cloud.pig.common.core.util.R
;
import
com.pig4cloud.pig.common.core.util.R
;
...
@@ -27,7 +29,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
...
@@ -27,7 +29,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -50,11 +51,10 @@ public class MenuController {
...
@@ -50,11 +51,10 @@ public class MenuController {
*/
*/
@GetMapping
@GetMapping
public
R
getUserMenu
(
Integer
parentId
)
{
public
R
getUserMenu
(
Integer
parentId
)
{
// 获取符合条件的菜单
// 获取符合条件的菜单
Set
<
SysMenu
>
all
=
new
HashSet
<>();
Set
<
SysMenu
>
sysMenuList
=
sysMenuService
SecurityUtils
.
getRoles
().
forEach
(
roleId
->
all
.
addAll
(
sysMenuService
.
findMenuByRoleId
(
roleId
)
));
.
findMenuByRoleId
(
CollUtil
.
join
(
SecurityUtils
.
getRoles
(),
StrUtil
.
COMMA
));
return
R
.
ok
(
sysMenuService
.
filterMenu
(
all
,
parentId
));
return
R
.
ok
(
sysMenuService
.
filterMenu
(
sysMenuList
,
parentId
));
}
}
/**
/**
...
@@ -75,8 +75,8 @@ public class MenuController {
...
@@ -75,8 +75,8 @@ public class MenuController {
*/
*/
@GetMapping
(
"/tree/{roleId}"
)
@GetMapping
(
"/tree/{roleId}"
)
public
R
getRoleTree
(
@PathVariable
Integer
roleId
)
{
public
R
getRoleTree
(
@PathVariable
Integer
roleId
)
{
return
R
.
ok
(
return
R
.
ok
(
sysMenuService
.
findMenuByRoleId
(
String
.
valueOf
(
roleId
)).
stream
().
map
(
SysMenu:
:
getMenuId
)
sysMenuService
.
findMenuByRoleId
(
roleId
).
stream
().
map
(
SysMenu:
:
getMenuId
)
.
collect
(
Collectors
.
toList
()));
.
collect
(
Collectors
.
toList
()));
}
}
/**
/**
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysMenuMapper.java
浏览文件 @
4ab93eb9
...
@@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.
Lis
t
;
import
java.util.
Se
t
;
/**
/**
* <p>
* <p>
...
@@ -38,13 +38,6 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
...
@@ -38,13 +38,6 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
* @param roleId 角色ID
* @param roleId 角色ID
* @return
* @return
*/
*/
List
<
SysMenu
>
listMenusByRoleId
(
Integer
roleId
);
Set
<
SysMenu
>
listMenusByRoleId
(
String
roleIds
);
/**
* 通过角色ID查询权限
* @param roleIds Ids
* @return
*/
List
<
String
>
listPermissionsByRoleIds
(
String
roleIds
);
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/mapper/SysUserMapper.java
浏览文件 @
4ab93eb9
...
@@ -60,4 +60,11 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
...
@@ -60,4 +60,11 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
*/
*/
UserVO
getUserVoById
(
Integer
id
);
UserVO
getUserVoById
(
Integer
id
);
/**
* 查询用户列表
* @param userDTO 查询条件
* @return
*/
List
<
UserVO
>
selectVoList
(
@Param
(
"query"
)
UserDTO
userDTO
);
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysLogService.java
浏览文件 @
4ab93eb9
...
@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
...
@@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
com.pig4cloud.pig.admin.api.dto.SysLogDTO
;
import
com.pig4cloud.pig.admin.api.dto.SysLogDTO
;
import
com.pig4cloud.pig.admin.api.entity.SysLog
;
import
com.pig4cloud.pig.admin.api.entity.SysLog
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 日志表 服务类
* 日志表 服务类
...
@@ -37,6 +39,13 @@ public interface SysLogService extends IService<SysLog> {
...
@@ -37,6 +39,13 @@ public interface SysLogService extends IService<SysLog> {
* @param sysLog
* @param sysLog
* @return
* @return
*/
*/
Page
getLogByPage
(
Page
page
,
SysLogDTO
sysLog
);
Page
<
SysLog
>
getLogByPage
(
Page
page
,
SysLogDTO
sysLog
);
/**
* 列表查询日志
* @param sysLog 查询条件
* @return List
*/
List
<
SysLog
>
getLogList
(
SysLogDTO
sysLog
);
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java
浏览文件 @
4ab93eb9
...
@@ -35,10 +35,10 @@ public interface SysMenuService extends IService<SysMenu> {
...
@@ -35,10 +35,10 @@ public interface SysMenuService extends IService<SysMenu> {
/**
/**
* 通过角色编号查询URL 权限
* 通过角色编号查询URL 权限
* @param roleId 角色ID
* @param roleId
s
角色ID
* @return 菜单列表
* @return 菜单列表
*/
*/
List
<
SysMenu
>
findMenuByRoleId
(
Integer
roleId
);
Set
<
SysMenu
>
findMenuByRoleId
(
String
roleIds
);
/**
/**
* 级联删除菜单
* 级联删除菜单
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysRoleService.java
浏览文件 @
4ab93eb9
...
@@ -19,8 +19,6 @@ package com.pig4cloud.pig.admin.service;
...
@@ -19,8 +19,6 @@ package com.pig4cloud.pig.admin.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.pig4cloud.pig.admin.api.entity.SysRole
;
import
com.pig4cloud.pig.admin.api.entity.SysRole
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 服务类
* 服务类
...
@@ -31,13 +29,6 @@ import java.util.List;
...
@@ -31,13 +29,6 @@ import java.util.List;
*/
*/
public
interface
SysRoleService
extends
IService
<
SysRole
>
{
public
interface
SysRoleService
extends
IService
<
SysRole
>
{
/**
* 通过用户ID,查询角色信息
* @param userId
* @return
*/
List
<
SysRole
>
findRolesByUserId
(
Integer
userId
);
/**
/**
* 通过角色ID,删除角色
* 通过角色ID,删除角色
* @param id
* @param id
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserRoleService.java
浏览文件 @
4ab93eb9
...
@@ -29,13 +29,4 @@ import com.pig4cloud.pig.admin.api.entity.SysUserRole;
...
@@ -29,13 +29,4 @@ import com.pig4cloud.pig.admin.api.entity.SysUserRole;
*/
*/
public
interface
SysUserRoleService
extends
IService
<
SysUserRole
>
{
public
interface
SysUserRoleService
extends
IService
<
SysUserRole
>
{
/**
* 根据用户Id删除该用户的角色关系
* @param userId 用户ID
* @return boolean
* @author 寻欢·李
* @date 2017年12月7日 16:31:38
*/
Boolean
removeRoleByUserId
(
Integer
userId
);
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -34,7 +34,9 @@ import org.springframework.stereotype.Service;
...
@@ -34,7 +34,9 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -143,6 +145,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
...
@@ -143,6 +145,11 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
treeNode
.
setId
(
dept
.
getDeptId
());
treeNode
.
setId
(
dept
.
getDeptId
());
treeNode
.
setParentId
(
dept
.
getParentId
());
treeNode
.
setParentId
(
dept
.
getParentId
());
treeNode
.
setName
(
dept
.
getName
());
treeNode
.
setName
(
dept
.
getName
());
treeNode
.
setWeight
(
dept
.
getSort
());
// 扩展属性
Map
<
String
,
Object
>
extra
=
new
HashMap
<>(
4
);
extra
.
put
(
"createTime"
,
dept
.
getCreateTime
());
treeNode
.
setExtra
(
extra
);
return
treeNode
;
return
treeNode
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysLogServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -28,6 +28,8 @@ import com.pig4cloud.pig.admin.mapper.SysLogMapper;
...
@@ -28,6 +28,8 @@ import com.pig4cloud.pig.admin.mapper.SysLogMapper;
import
com.pig4cloud.pig.admin.service.SysLogService
;
import
com.pig4cloud.pig.admin.service.SysLogService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 日志表 服务实现类
* 日志表 服务实现类
...
@@ -41,6 +43,25 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
...
@@ -41,6 +43,25 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
@Override
@Override
public
Page
getLogByPage
(
Page
page
,
SysLogDTO
sysLog
)
{
public
Page
getLogByPage
(
Page
page
,
SysLogDTO
sysLog
)
{
return
baseMapper
.
selectPage
(
page
,
buildQueryWrapper
(
sysLog
));
}
/**
* 列表查询日志
* @param sysLog 查询条件
* @return List
*/
@Override
public
List
getLogList
(
SysLogDTO
sysLog
)
{
return
baseMapper
.
selectList
(
buildQueryWrapper
(
sysLog
));
}
/**
* 构建查询的 wrapper
* @param sysLog 查询条件
* @return LambdaQueryWrapper
*/
private
LambdaQueryWrapper
buildQueryWrapper
(
SysLogDTO
sysLog
)
{
LambdaQueryWrapper
<
SysLog
>
wrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
SysLog
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(
StrUtil
.
isNotBlank
(
sysLog
.
getType
()))
{
if
(
StrUtil
.
isNotBlank
(
sysLog
.
getType
()))
{
wrapper
.
eq
(
SysLog:
:
getType
,
sysLog
.
getType
());
wrapper
.
eq
(
SysLog:
:
getType
,
sysLog
.
getType
());
...
@@ -51,7 +72,7 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
...
@@ -51,7 +72,7 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
sysLog
.
getCreateTime
()[
1
]);
sysLog
.
getCreateTime
()[
1
]);
}
}
return
baseMapper
.
selectPage
(
page
,
wrapper
)
;
return
wrapper
;
}
}
}
}
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -20,6 +20,7 @@ import cn.hutool.core.collection.CollUtil;
...
@@ -20,6 +20,7 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.Tree
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeNode
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.lang.tree.TreeUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
import
com.pig4cloud.pig.admin.api.entity.SysMenu
;
...
@@ -60,9 +61,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -60,9 +61,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
private
final
SysRoleMenuMapper
sysRoleMenuMapper
;
private
final
SysRoleMenuMapper
sysRoleMenuMapper
;
@Override
@Override
@Cacheable
(
value
=
CacheConstants
.
MENU_DETAILS
,
key
=
"#roleId + '_menu'"
,
unless
=
"#result == null"
)
@Cacheable
(
value
=
CacheConstants
.
MENU_DETAILS
,
key
=
"#roleId
s
+ '_menu'"
,
unless
=
"#result == null"
)
public
List
<
SysMenu
>
findMenuByRoleId
(
Integer
roleId
)
{
public
Set
<
SysMenu
>
findMenuByRoleId
(
String
roleIds
)
{
return
baseMapper
.
listMenusByRoleId
(
roleId
);
return
baseMapper
.
listMenusByRoleId
(
roleId
s
);
}
}
/**
/**
...
@@ -125,8 +126,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -125,8 +126,8 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
@Override
@Override
public
List
<
Tree
<
Integer
>>
filterMenu
(
Set
<
SysMenu
>
all
,
Integer
parentId
)
{
public
List
<
Tree
<
Integer
>>
filterMenu
(
Set
<
SysMenu
>
all
,
Integer
parentId
)
{
List
<
TreeNode
<
Integer
>>
collect
=
all
.
stream
()
List
<
TreeNode
<
Integer
>>
collect
=
all
.
stream
()
.
filter
(
menu
->
MenuTypeEnum
.
LEFT_MENU
.
getType
().
equals
(
menu
.
getType
()))
.
map
(
getNodeFunction
())
.
filter
(
menu
->
MenuTypeEnum
.
LEFT_MENU
.
getType
().
equals
(
menu
.
getType
()))
.
collect
(
Collectors
.
toList
());
.
filter
(
menu
->
StrUtil
.
isNotBlank
(
menu
.
getPath
())).
map
(
getNodeFunction
()).
collect
(
Collectors
.
toList
());
Integer
parent
=
parentId
==
null
?
CommonConstants
.
MENU_TREE_ROOT_ID
:
parentId
;
Integer
parent
=
parentId
==
null
?
CommonConstants
.
MENU_TREE_ROOT_ID
:
parentId
;
return
TreeUtil
.
build
(
collect
,
parent
);
return
TreeUtil
.
build
(
collect
,
parent
);
}
}
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleMenuServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -62,7 +62,7 @@ public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRo
...
@@ -62,7 +62,7 @@ public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRo
if
(
StrUtil
.
isBlank
(
menuIds
))
{
if
(
StrUtil
.
isBlank
(
menuIds
))
{
return
Boolean
.
TRUE
;
return
Boolean
.
TRUE
;
}
}
List
<
SysRoleMenu
>
roleMenuList
=
Arrays
.
stream
(
menuIds
.
split
(
","
)).
map
(
menuId
->
{
List
<
SysRoleMenu
>
roleMenuList
=
Arrays
.
stream
(
menuIds
.
split
(
StrUtil
.
COMMA
)).
map
(
menuId
->
{
SysRoleMenu
roleMenu
=
new
SysRoleMenu
();
SysRoleMenu
roleMenu
=
new
SysRoleMenu
();
roleMenu
.
setRoleId
(
roleId
);
roleMenu
.
setRoleId
(
roleId
);
roleMenu
.
setMenuId
(
Integer
.
valueOf
(
menuId
));
roleMenu
.
setMenuId
(
Integer
.
valueOf
(
menuId
));
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysRoleServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -29,8 +29,6 @@ import org.springframework.cache.annotation.CacheEvict;
...
@@ -29,8 +29,6 @@ import org.springframework.cache.annotation.CacheEvict;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 服务实现类
* 服务实现类
...
@@ -45,16 +43,6 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
...
@@ -45,16 +43,6 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
private
final
SysRoleMenuMapper
sysRoleMenuMapper
;
private
final
SysRoleMenuMapper
sysRoleMenuMapper
;
/**
* 通过用户ID,查询角色信息
* @param userId
* @return
*/
@Override
public
List
<
SysRole
>
findRolesByUserId
(
Integer
userId
)
{
return
baseMapper
.
listRolesByUserId
(
userId
);
}
/**
/**
* 通过角色ID,删除角色,并清空角色菜单缓存
* 通过角色ID,删除角色,并清空角色菜单缓存
* @param id
* @param id
...
...
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserRoleServiceImpl.java
浏览文件 @
4ab93eb9
...
@@ -33,16 +33,4 @@ import org.springframework.stereotype.Service;
...
@@ -33,16 +33,4 @@ import org.springframework.stereotype.Service;
@Service
@Service
public
class
SysUserRoleServiceImpl
extends
ServiceImpl
<
SysUserRoleMapper
,
SysUserRole
>
implements
SysUserRoleService
{
public
class
SysUserRoleServiceImpl
extends
ServiceImpl
<
SysUserRoleMapper
,
SysUserRole
>
implements
SysUserRoleService
{
/**
* 根据用户Id删除该用户的角色关系
* @param userId 用户ID
* @return boolean
* @author 寻欢·李
* @date 2017年12月7日 16:31:38
*/
@Override
public
Boolean
removeRoleByUserId
(
Integer
userId
)
{
return
baseMapper
.
deleteByUserId
(
userId
);
}
}
}
pig-upms/pig-upms-biz/src/main/resources/mapper/SysMenuMapper.xml
浏览文件 @
4ab93eb9
...
@@ -37,22 +37,14 @@
...
@@ -37,22 +37,14 @@
<!--通过角色查询菜单信息-->
<!--通过角色查询菜单信息-->
<select
id=
"listMenusByRoleId"
resultMap=
"BaseResultMap"
>
<select
id=
"listMenusByRoleId"
resultMap=
"BaseResultMap"
>
SELECT
SELECT
sys_menu.*
sys_menu.*
FROM
FROM
sys_menu
sys_menu
LEFT JOIN sys_role_menu ON sys_menu.menu_id = sys_role_menu.menu_id
LEFT JOIN sys_role_menu ON sys_menu.menu_id = sys_role_menu.menu_id
WHERE
WHERE
sys_menu.del_flag = 0
sys_menu.del_flag = 0
AND sys_role_menu.role_id
= #{roleId}
AND sys_role_menu.role_id
IN (#{roleIds})
ORDER BY
ORDER BY
sys_menu.sort DESC
sys_menu.sort DESC
</select>
</select>
<!--通过角色ID 查询权限-->
<select
id=
"listPermissionsByRoleIds"
resultType=
"java.lang.String"
>
SELECT
m.permission
FROM
sys_menu m, sys_role_menu rm WHERE m.menu_id = rm.menu_id AND m.del_flag = 0 AND rm.role_id IN (#{roleIds})
</select>
</mapper>
</mapper>
pig-upms/pig-upms-biz/src/main/resources/mapper/SysUserMapper.xml
浏览文件 @
4ab93eb9
...
@@ -149,4 +149,33 @@
...
@@ -149,4 +149,33 @@
</where>
</where>
ORDER BY `user`.create_time DESC
ORDER BY `user`.create_time DESC
</select>
</select>
<select
id=
"selectVoList"
resultMap=
"baseResultMap"
>
SELECT
u.user_id,
u.username,
u.password,
u.salt,
u.phone,
u.avatar,
u.dept_id,
u.create_time ucreate_time,
u.update_time uupdate_time,
u.del_flag,
u.lock_flag,
d.name AS deptName
FROM
sys_user u
LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
<where>
u.del_flag = '0'
<if
test=
"query.username != null and query.username != ''"
>
AND u.username LIKE CONCAT('%',#{query.username},'%')
</if>
<if
test=
"query.deptId != null and query.deptId != ''"
>
AND u.dept_id = #{query.deptId}
</if>
</where>
ORDER BY u.create_time DESC
</select>
</mapper>
</mapper>
pom.xml
浏览文件 @
4ab93eb9
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven.compiler.target>
1.8
</maven.compiler.target>
<spring-boot-admin.version>
2.5.
0
</spring-boot-admin.version>
<spring-boot-admin.version>
2.5.
1
</spring-boot-admin.version>
<hutool.version>
5.7.9
</hutool.version>
<hutool.version>
5.7.9
</hutool.version>
<mybatis-plus.version>
3.4.3.2
</mybatis-plus.version>
<mybatis-plus.version>
3.4.3.2
</mybatis-plus.version>
<dynamic-ds.version>
3.4.1
</dynamic-ds.version>
<dynamic-ds.version>
3.4.1
</dynamic-ds.version>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录