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
14ec4b54
Commit
14ec4b54
authored
Jul 15, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
6bac38c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
11 deletions
+44
-11
EmployeeModule.cs
Mall.Module.User/EmployeeModule.cs
+29
-2
RB_RoleRepository.cs
Mall.Repository/User/RB_RoleRepository.cs
+12
-6
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+3
-3
No files found.
Mall.Module.User/EmployeeModule.cs
View file @
14ec4b54
...
@@ -58,9 +58,36 @@ namespace Mall.Module.User
...
@@ -58,9 +58,36 @@ namespace Mall.Module.User
/// </summary>
/// </summary>
/// <param name="query"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtModule
(
RB_Role_Extend
query
)
public
string
GetRoleListExtModule
(
RB_Role_Extend
query
)
{
{
return
roleRepository
.
GetRoleListExtRepository
(
query
);
string
menuIds
=
""
;
List
<
string
>
menuIdList
=
new
List
<
string
>();
var
list
=
roleRepository
.
GetRoleListExtRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
item
.
RoleAuth
))
{
var
tempArray
=
item
.
RoleAuth
.
Split
(
','
);
if
(
tempArray
!=
null
&&
tempArray
.
Length
>
0
)
{
foreach
(
var
subItem
in
tempArray
)
{
if
(!
string
.
IsNullOrWhiteSpace
(
subItem
))
{
menuIdList
.
Add
(
subItem
);
}
}
}
}
}
}
if
(
menuIdList
!=
null
&&
menuIdList
.
Count
>
0
)
{
menuIds
=
string
.
Join
(
","
,
menuIdList
);
}
return
menuIds
;
}
}
/// <summary>
/// <summary>
...
...
Mall.Repository/User/RB_RoleRepository.cs
View file @
14ec4b54
...
@@ -79,13 +79,19 @@ namespace Mall.Repository.User
...
@@ -79,13 +79,19 @@ namespace Mall.Repository.User
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Role_Extend
>
GetRoleListExtRepository
(
RB_Role_Extend
query
)
public
List
<
RB_Role_Extend
>
GetRoleListExtRepository
(
RB_Role_Extend
query
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
string
empRoleSql
=
string
.
Format
(
@" SELECT RoleAuth FROM rb_employee WHERE empId={0} "
,
query
.
EmpId
);
builder
.
AppendFormat
(
@"
var
roleObj
=
base
.
ExecuteScalar
(
empRoleSql
);
SELECT group_concat(RoleAuth) AS RoleAuth
if
(
roleObj
!=
null
&&
!
string
.
IsNullOrWhiteSpace
(
roleObj
.
ToString
()))
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_role
FROM rb_role
WHERE `Status`=0 AND RoleId IN (SELECT group_concat(RoleAuth) AS RoleAuth FROM rb_employee WHERE empId={0} )
WHERE `Status`=0 AND RoleId IN ({0})
"
,
query
.
EmpId
);
"
,
roleObj
.
ToString
());
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Role_Extend
>(
builder
.
ToString
()).
ToList
();
}
return
new
List
<
RB_Role_Extend
>();
}
}
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/TenantController.cs
View file @
14ec4b54
...
@@ -970,10 +970,10 @@ namespace Mall.WebApi.Controllers.User
...
@@ -970,10 +970,10 @@ namespace Mall.WebApi.Controllers.User
var
list
=
new
List
<
RB_Menu_Extend
>();
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
if
(
RequestParm
.
EmpId
>
0
)
{
{
var
roleList
=
employeeModule
.
GetRoleListExtModule
(
new
RB_Role_Extend
()
{
EmpId
=
RequestParm
.
EmpId
});
var
menuIds
=
employeeModule
.
GetRoleListExtModule
(
new
RB_Role_Extend
()
{
EmpId
=
RequestParm
.
EmpId
});
if
(
roleList
!=
null
&&
roleList
.
Count
>
0
)
if
(
!
string
.
IsNullOrWhiteSpace
(
menuIds
)
)
{
{
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
QMenuIds
=
roleList
?.
FirstOrDefault
()?.
RoleAuth
});
list
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
QMenuIds
=
menuIds
});
var
superList
=
new
List
<
RB_Menu_Extend
>();
var
superList
=
new
List
<
RB_Menu_Extend
>();
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
...
...
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