Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education
提交
0e33bf61
R
roncoo-education
项目概览
roncoo
/
roncoo-education
大约 1 年 前同步成功
通知
146
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0e33bf61
编写于
7月 23, 2019
作者:
K
keyinghao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
菜单列出
上级
84f55d62
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
218 addition
and
8 deletion
+218
-8
roncoo-education-boss/src/router/index.js
roncoo-education-boss/src/router/index.js
+0
-1
roncoo-education-boss/src/store/modules/menu.js
roncoo-education-boss/src/store/modules/menu.js
+1
-0
roncoo-education-boss/src/views/sys/pms/menu/add.vue
roncoo-education-boss/src/views/sys/pms/menu/add.vue
+1
-1
roncoo-education-boss/src/views/sys/pms/menu/edit.vue
roncoo-education-boss/src/views/sys/pms/menu/edit.vue
+9
-6
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/api/pc/PcApiSysMenuController.java
...ucation/system/service/api/pc/PcApiSysMenuController.java
+12
-0
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/biz/pc/PcApiSysMenuBiz.java
...ncoo/education/system/service/biz/pc/PcApiSysMenuBiz.java
+81
-0
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/req/SysMenuUserListREQ.java
...ucation/system/service/common/req/SysMenuUserListREQ.java
+26
-0
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/resq/SysMenuUserListRESQ.java
...ation/system/service/common/resq/SysMenuUserListRESQ.java
+28
-0
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/resq/SysMenuUserRESQ.java
...education/system/service/common/resq/SysMenuUserRESQ.java
+60
-0
未找到文件。
roncoo-education-boss/src/router/index.js
浏览文件 @
0e33bf61
...
...
@@ -4,7 +4,6 @@ import Router from 'vue-router'
Vue
.
use
(
Router
)
import
Layout
from
'
@/views/layout/Layout
'
export
const
asyncRouterMap
=
[
{
path
:
'
dashboard
'
,
...
...
roncoo-education-boss/src/store/modules/menu.js
浏览文件 @
0e33bf61
...
...
@@ -28,6 +28,7 @@ const menu = {
actions
:
{
setMenu
({
commit
})
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
"
用户信息
"
+
commit
)
// TODO 后续续修改为从服务器获取,并且做数据处理
commit
(
'
set_system_menu
'
,
mockMenuData
)
resolve
()
...
...
roncoo-education-boss/src/views/sys/pms/menu/add.vue
浏览文件 @
0e33bf61
...
...
@@ -12,7 +12,7 @@
<el-form-item
label=
"菜单地址:"
prop=
"menuUrl"
>
<el-input
v-model=
"formData.menuUrl"
></el-input>
</el-form-item>
<el-form-item
label=
"目标名称:"
prop=
"targetName"
>
<el-form-item
label=
"目标名称:"
>
<el-input
v-model=
"formData.targetName"
></el-input>
</el-form-item>
<el-form-item
label=
"图标:"
prop=
"menuIcon"
>
...
...
roncoo-education-boss/src/views/sys/pms/menu/edit.vue
浏览文件 @
0e33bf61
<
template
>
<!--弹窗-->
<el-dialog
width=
"3
0
%"
width=
"3
5
%"
:title=
"title"
:visible.sync=
"visible"
:before-close=
"handleClose"
>
<el-form
ref=
"formData"
:model=
"formData"
:rules=
"rules"
label-width=
"
8
0px"
>
<el-form
ref=
"formData"
:model=
"formData"
:rules=
"rules"
label-width=
"
10
0px"
>
<el-form-item
label=
"菜单名称:"
prop=
"menuName"
>
<el-input
v-model=
"formData.menuName"
></el-input>
</el-form-item>
<el-form-item
label=
"菜单路径:"
prop=
"menuUrl"
>
<el-input
v-model=
"formData.menuUrl"
></el-input>
</el-form-item>
<el-form-item
label=
"目标名称:"
prop=
"menuUrl"
>
<el-input
v-model=
"formData.
menuUrl
"
></el-input>
<el-form-item
label=
"目标名称:"
>
<el-input
v-model=
"formData.
targetName
"
></el-input>
</el-form-item>
<el-form-item
label=
"排序:"
>
<el-input-number
style=
"width: 300px;"
v-model=
"formData.sort"
@
change=
"handleChange"
:min=
"1"
:max=
"10000"
></el-input-number>
...
...
@@ -35,8 +35,11 @@
data
()
{
return
{
rules
:
{
roleName
:
[
{
required
:
true
,
message
:
'
请输入名称
'
,
trigger
:
'
blur
'
}
menuName
:
[
{
required
:
true
,
message
:
'
请输入菜单名称
'
,
trigger
:
'
blur
'
}
],
menuUrl
:
[
{
required
:
true
,
message
:
'
请输入菜单路径
'
,
trigger
:
'
blur
'
}
]
}
}
...
...
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/api/pc/PcApiSysMenuController.java
浏览文件 @
0e33bf61
...
...
@@ -11,8 +11,10 @@ import com.roncoo.education.system.service.common.req.SysMenuDeleteREQ;
import
com.roncoo.education.system.service.common.req.SysMenuListREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuSaveREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuUpdateREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuUserListREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuViewREQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuListRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuUserListRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuViewRESQ
;
import
com.roncoo.education.util.base.BaseController
;
import
com.roncoo.education.util.base.Result
;
...
...
@@ -75,5 +77,15 @@ public class PcApiSysMenuController extends BaseController {
public
Result
<
SysMenuViewRESQ
>
view
(
@RequestBody
SysMenuViewREQ
sysMenuViewREQ
)
{
return
biz
.
view
(
sysMenuViewREQ
);
}
/**
* 用户菜单信息列出信息接口
*/
@ApiOperation
(
value
=
"用户菜单信息列出信息接口"
,
notes
=
"用户菜单信息列出信息接口"
)
@RequestMapping
(
value
=
"/user/list"
,
method
=
RequestMethod
.
POST
)
public
Result
<
SysMenuUserListRESQ
>
list
(
@RequestBody
SysMenuUserListREQ
sysMenuUserListREQ
)
{
return
biz
.
userList
(
sysMenuUserListREQ
);
}
}
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/biz/pc/PcApiSysMenuBiz.java
浏览文件 @
0e33bf61
...
...
@@ -13,12 +13,21 @@ import com.roncoo.education.system.service.common.req.SysMenuDeleteREQ;
import
com.roncoo.education.system.service.common.req.SysMenuListREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuSaveREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuUpdateREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuUserListREQ
;
import
com.roncoo.education.system.service.common.req.SysMenuViewREQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuListRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuUserListRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuUserRESQ
;
import
com.roncoo.education.system.service.common.resq.SysMenuViewRESQ
;
import
com.roncoo.education.system.service.dao.SysMenuDao
;
import
com.roncoo.education.system.service.dao.SysMenuRoleDao
;
import
com.roncoo.education.system.service.dao.SysRoleUserDao
;
import
com.roncoo.education.system.service.dao.SysUserDao
;
import
com.roncoo.education.system.service.dao.impl.mapper.entity.SysMenu
;
import
com.roncoo.education.system.service.dao.impl.mapper.entity.SysMenuRole
;
import
com.roncoo.education.system.service.dao.impl.mapper.entity.SysRoleUser
;
import
com.roncoo.education.system.service.dao.impl.mapper.entity.SysUser
;
import
com.roncoo.education.util.base.Result
;
import
com.roncoo.education.util.enums.ResultEnum
;
import
com.roncoo.education.util.tools.BeanUtil
;
...
...
@@ -35,6 +44,12 @@ public class PcApiSysMenuBiz {
@Autowired
private
SysMenuDao
dao
;
@Autowired
private
SysUserDao
sysUserDao
;
@Autowired
private
SysRoleUserDao
sysRoleUserDao
;
@Autowired
private
SysMenuRoleDao
sysMenuRoleDao
;
public
Result
<
SysMenuListRESQ
>
list
(
SysMenuListREQ
req
)
{
SysMenuListRESQ
resq
=
new
SysMenuListRESQ
();
...
...
@@ -132,4 +147,70 @@ public class PcApiSysMenuBiz {
return
Result
.
success
(
BeanUtil
.
copyProperties
(
record
,
SysMenuViewRESQ
.
class
));
}
public
Result
<
SysMenuUserListRESQ
>
userList
(
SysMenuUserListREQ
req
)
{
if
(
req
.
getUserNo
()
==
null
)
{
return
Result
.
error
(
"用户编不能为空"
);
}
SysUser
sysUser
=
sysUserDao
.
getByUserNo
(
req
.
getUserNo
());
if
(
ObjectUtil
.
isNull
(
sysUser
))
{
return
Result
.
error
(
"用户异常"
);
}
SysMenuUserListRESQ
resq
=
new
SysMenuUserListRESQ
();
List
<
SysMenuRole
>
sysMenuRoleList
=
new
ArrayList
<>();
List
<
SysRoleUser
>
sysRoleUserList
=
sysRoleUserDao
.
listByUserId
(
sysUser
.
getId
());
for
(
SysRoleUser
sru
:
sysRoleUserList
)
{
sysMenuRoleList
.
addAll
(
sysMenuRoleDao
.
listByRoleId
(
sru
.
getRoleId
()));
}
// 筛选
resq
.
setSysMenu
(
listByRole
(
sysMenuRoleList
));
return
Result
.
success
(
resq
);
}
private
List
<
SysMenuUserRESQ
>
listByRole
(
List
<
SysMenuRole
>
sysMenuRoleList
)
{
List
<
SysMenuUserRESQ
>
list
=
userRecursion
(
0L
);
List
<
SysMenuUserRESQ
>
sysMenuUserRESQList
=
new
ArrayList
<>();
sysMenuUserRESQList
=
listMenu
(
sysMenuUserRESQList
,
sysMenuRoleList
,
list
);
return
sysMenuUserRESQList
;
}
private
List
<
SysMenuUserRESQ
>
listMenu
(
List
<
SysMenuUserRESQ
>
sysMenuVOList
,
List
<
SysMenuRole
>
sysMenuRoleList
,
List
<
SysMenuUserRESQ
>
list
)
{
for
(
SysMenuUserRESQ
mv
:
list
)
{
SysMenuUserRESQ
v
=
null
;
for
(
SysMenuRole
vo
:
sysMenuRoleList
)
{
if
(
mv
.
getId
().
equals
(
vo
.
getMenuId
()))
{
v
=
BeanUtil
.
copyProperties
(
mv
,
SysMenuUserRESQ
.
class
);
break
;
}
}
if
(
ObjectUtil
.
isNotNull
(
v
))
{
sysMenuVOList
.
add
(
v
);
List
<
SysMenuUserRESQ
>
l
=
new
ArrayList
<>();
if
(
v
!=
null
)
{
v
.
setChildren
(
l
);
}
listMenu
(
l
,
sysMenuRoleList
,
mv
.
getChildren
());
}
}
return
sysMenuVOList
;
}
/**
* 用户递归显示菜单(角色关联菜单)
*/
private
List
<
SysMenuUserRESQ
>
userRecursion
(
Long
parentId
)
{
List
<
SysMenuUserRESQ
>
lists
=
new
ArrayList
<>();
List
<
SysMenu
>
list
=
dao
.
listByParentId
(
parentId
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
for
(
SysMenu
m
:
list
)
{
SysMenuUserRESQ
resq
=
BeanUtil
.
copyProperties
(
m
,
SysMenuUserRESQ
.
class
);
resq
.
setName
(
m
.
getMenuName
());
resq
.
setPath
(
m
.
getMenuUrl
());
resq
.
setIcon
(
m
.
getMenuIcon
());
resq
.
setChildren
(
userRecursion
(
m
.
getId
()));
lists
.
add
(
resq
);
}
}
return
lists
;
}
}
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/req/SysMenuUserListREQ.java
0 → 100644
浏览文件 @
0e33bf61
package
com.roncoo.education.system.service.common.req
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 用户菜单信息-列出
*
* @author wujing
*/
@Data
@Accessors
(
chain
=
true
)
public
class
SysMenuUserListREQ
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 用户编号
*/
@ApiModelProperty
(
value
=
"用户编号"
,
required
=
false
)
private
Long
userNo
;
}
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/resq/SysMenuUserListRESQ.java
0 → 100644
浏览文件 @
0e33bf61
package
com.roncoo.education.system.service.common.resq
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 菜单信息-列出
*
* @author wujing
*/
@Data
@Accessors
(
chain
=
true
)
public
class
SysMenuUserListRESQ
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 菜单集合
*/
@ApiModelProperty
(
value
=
"菜单集合"
)
private
List
<
SysMenuUserRESQ
>
sysMenu
=
new
ArrayList
<>();
}
roncoo-education-system/roncoo-education-system-service/src/main/java/com/roncoo/education/system/service/common/resq/SysMenuUserRESQ.java
0 → 100644
浏览文件 @
0e33bf61
package
com.roncoo.education.system.service.common.resq
;
import
java.io.Serializable
;
import
java.util.List
;
import
com.fasterxml.jackson.databind.annotation.JsonSerialize
;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* 菜单信息
*
* @author wujing
*/
@Data
@Accessors
(
chain
=
true
)
public
class
SysMenuUserRESQ
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@ApiModelProperty
(
value
=
"主键"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
id
;
/**
* 父ID
*/
@ApiModelProperty
(
value
=
"父ID"
)
@JsonSerialize
(
using
=
ToStringSerializer
.
class
)
private
Long
parentId
;
/**
* 菜单名称
*/
@ApiModelProperty
(
value
=
"菜单名称"
)
private
String
name
;
/**
* 菜单路径
*/
@ApiModelProperty
(
value
=
"菜单路径"
)
private
String
path
;
/**
* 菜单图标
*/
@ApiModelProperty
(
value
=
"菜单图标"
)
private
String
icon
;
/**
* 目标名称
*/
@ApiModelProperty
(
value
=
"目标名称"
)
private
String
targetName
;
/**
* 下级菜单集合
*/
private
List
<
SysMenuUserRESQ
>
children
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录