Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
99b06360
Commit
99b06360
authored
May 20, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
88ec1211
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
2 deletions
+65
-2
RequestParm.cs
Mall.Common/API/RequestParm.cs
+5
-0
RB_Menu_Extend.cs
Mall.Model/Extend/User/RB_Menu_Extend.cs
+5
-0
RB_Role_Extend.cs
Mall.Model/Extend/User/RB_Role_Extend.cs
+5
-0
EmployeeModule.cs
Mall.Module.User/EmployeeModule.cs
+10
-0
RB_MenuRepository.cs
Mall.Repository/User/RB_MenuRepository.cs
+6
-0
RB_RoleRepository.cs
Mall.Repository/User/RB_RoleRepository.cs
+16
-0
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+18
-2
No files found.
Mall.Common/API/RequestParm.cs
View file @
99b06360
...
...
@@ -57,5 +57,10 @@ namespace Mall.Common.API
/// 语种类型
/// </summary>
public
LanguageTypeEnum
languageType
{
get
;
set
;
}
/// <summary>
/// 员工编号【员工登录时使用】
/// </summary>
public
int
EmpId
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Menu_Extend.cs
View file @
99b06360
...
...
@@ -27,5 +27,10 @@ namespace Mall.Model.Extend.User
return
str
;
}
}
/// <summary>
/// 查询菜单编号
/// </summary>
public
string
QMenuIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Role_Extend.cs
View file @
99b06360
...
...
@@ -30,5 +30,10 @@ namespace Mall.Model.Entity.User
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 员工编号
/// </summary>
public
int
EmpId
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Module.User/EmployeeModule.cs
View file @
99b06360
...
...
@@ -53,6 +53,16 @@ namespace Mall.Module.User
return
roleRepository
.
GetRoleListRepository
(
query
);
}
/// <summary>
/// 根据员工编号获取角色权限
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtModule
(
RB_Role_Extend
query
)
{
return
roleRepository
.
GetRoleListExtRepository
(
query
);
}
/// <summary>
/// 新增修改角色
/// </summary>
...
...
Mall.Repository/User/RB_MenuRepository.cs
View file @
99b06360
...
...
@@ -31,10 +31,16 @@ namespace Mall.Repository.User
{
builder
.
AppendFormat
(
" AND MenuName LIKE '%{0}%' "
,
query
.
MenuName
.
Trim
());
}
if
(
query
.
QMenuIds
!=
null
&&
!
string
.
IsNullOrEmpty
(
query
.
QMenuIds
.
Trim
()))
{
builder
.
AppendFormat
(
" AND MenuId IN({0}) "
,
query
.
QMenuIds
.
Trim
());
}
}
return
Get
<
RB_Menu_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取菜单分页列表
/// </summary>
...
...
Mall.Repository/User/RB_RoleRepository.cs
View file @
99b06360
...
...
@@ -71,5 +71,21 @@ namespace Mall.Repository.User
}
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 根据员工编号获取角色权限
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtRepository
(
RB_Role_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT group_concat(RoleAuth) AS RoleAuth
FROM rb_role
WHERE `Status`=0 AND RoleId IN (SELECT group_concat(RoleAuth) AS RoleAuth FROM rb_employee WHERE empId={0} )
"
,
query
.
EmpId
);
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/TenantController.cs
View file @
99b06360
...
...
@@ -63,6 +63,10 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
private
Module
.
User
.
PlugInModule
plugInModule
=
new
Module
.
User
.
PlugInModule
();
/// <summary>
/// 员工管理处理类
/// </summary>
private
Module
.
User
.
EmployeeModule
employeeModule
=
new
Module
.
User
.
EmployeeModule
();
#
region
商户信息
...
...
@@ -567,13 +571,25 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
GetMenuList
()
{
List
<
object
>
resultList
=
new
List
<
object
>();
var
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
});
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
{
var
roleList
=
employeeModule
.
GetRoleListExtModule
(
new
RB_Role_Extend
()
{
EmpId
=
RequestParm
.
EmpId
});
if
(
roleList
!=
null
&&
roleList
.
Count
>
0
)
{
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
QMenuIds
=
roleList
?.
FirstOrDefault
()?.
RoleAuth
});
}
}
else
{
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
});
}
var
rootList
=
list
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
1
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
ToList
();
foreach
(
var
item
in
rootList
)
{
List
<
object
>
subResultList
=
new
List
<
object
>();
var
subList
=
list
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
2
&&
qitem
.
ParentId
==
item
.
MenuId
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
ToList
();
foreach
(
var
subItem
in
subList
)
{
List
<
object
>
thirdResultList
=
new
List
<
object
>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment