Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
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
黄奎
Education
Commits
33902769
Commit
33902769
authored
Nov 25, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
3cc48927
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
173 additions
and
26 deletions
+173
-26
RB_Role_FunctionPermission.cs
Edu.Model/Entity/System/RB_Role_FunctionPermission.cs
+7
-2
MenuTree_ViewModel.cs
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
+1
-1
Employee_ViewModel.cs
Edu.Model/ViewModel/User/Employee_ViewModel.cs
+5
-0
RoleModule.cs
Edu.Module.System/RoleModule.cs
+15
-20
RB_Menu_FunctionRepository.cs
Edu.Repository/System/RB_Menu_FunctionRepository.cs
+8
-2
RB_AccountRepository.cs
Edu.Repository/User/RB_AccountRepository.cs
+1
-1
RB_DepartmentRepository.cs
Edu.Repository/User/RB_DepartmentRepository.cs
+15
-0
ThirdController.cs
Edu.WebApi/Controllers/Third/ThirdController.cs
+121
-0
No files found.
Edu.Model/Entity/System/RB_Role_FunctionPermission.cs
View file @
33902769
...
@@ -22,9 +22,14 @@ namespace Edu.Model.Entity.System
...
@@ -22,9 +22,14 @@ namespace Edu.Model.Entity.System
public
int
Role_Id
{
get
;
set
;
}
public
int
Role_Id
{
get
;
set
;
}
/// <summary>
/// <summary>
///
功能菜单id
///
菜单编号
/// </summary>
/// </summary>
public
FunctionPermissionEnum
Action_Id
{
get
;
set
;
}
public
int
Menu_Id
{
get
;
set
;
}
/// <summary>
/// 功能编码
/// </summary>
public
int
Action_Id
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 权限名称描述
/// 权限名称描述
...
...
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
View file @
33902769
...
@@ -45,6 +45,6 @@ namespace Edu.Model.ViewModel.System
...
@@ -45,6 +45,6 @@ namespace Edu.Model.ViewModel.System
/// <summary>
/// <summary>
/// 功能权限列表
/// 功能权限列表
/// </summary>
/// </summary>
public
List
<
RB_
Role_FunctionPermiss
ion_ViewModel
>
FunctionSubList
{
get
;
set
;
}
public
List
<
RB_
Menu_Funct
ion_ViewModel
>
FunctionSubList
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/User/Employee_ViewModel.cs
View file @
33902769
...
@@ -68,5 +68,10 @@ namespace Edu.Model.ViewModel.User
...
@@ -68,5 +68,10 @@ namespace Edu.Model.ViewModel.User
/// 员工编号【查询使用,逗号分隔】
/// 员工编号【查询使用,逗号分隔】
/// </summary>
/// </summary>
public
string
QIds
{
get
;
set
;
}
public
string
QIds
{
get
;
set
;
}
/// <summary>
/// 部门层级
/// </summary>
public
int
DeptTier
{
get
;
set
;
}
}
}
}
}
Edu.Module.System/RoleModule.cs
View file @
33902769
...
@@ -29,6 +29,11 @@ namespace Edu.Module.System
...
@@ -29,6 +29,11 @@ namespace Edu.Module.System
/// </summary>
/// </summary>
private
readonly
RB_Role_FunctionPermissionRepository
roleFunctionPermissionRepository
=
new
RB_Role_FunctionPermissionRepository
();
private
readonly
RB_Role_FunctionPermissionRepository
roleFunctionPermissionRepository
=
new
RB_Role_FunctionPermissionRepository
();
/// <summary>
/// 菜单功能权限仓储层对象
/// </summary>
private
readonly
RB_Menu_FunctionRepository
functionRepository
=
new
RB_Menu_FunctionRepository
();
/// <summary>
/// <summary>
/// 系统菜单处理对象
/// 系统菜单处理对象
/// </summary>
/// </summary>
...
@@ -117,6 +122,10 @@ namespace Edu.Module.System
...
@@ -117,6 +122,10 @@ namespace Edu.Module.System
/// <returns></returns>
/// <returns></returns>
public
List
<
MenuTree_ViewModel
>
GetRolePermissionModule
(
int
roleId
)
public
List
<
MenuTree_ViewModel
>
GetRolePermissionModule
(
int
roleId
)
{
{
//菜单列表
var
menuList
=
menuModule
.
GetTreeMenuModule
(
new
RB_Menu_ViewModel
(),
isGetMenuFuncton
:
true
);
//获取功能权限列表
var
actionList
=
functionRepository
.
GetMenuFunctionListRepository
(
new
RB_Menu_Function_ViewModel
()
{
},
isQueryNormal
:
true
);
//角色菜单权限列表
//角色菜单权限列表
List
<
RB_Role_Permission_ViewModel
>
rolePermissionList
=
new
List
<
RB_Role_Permission_ViewModel
>();
List
<
RB_Role_Permission_ViewModel
>
rolePermissionList
=
new
List
<
RB_Role_Permission_ViewModel
>();
//角色功能权限列表
//角色功能权限列表
...
@@ -126,22 +135,24 @@ namespace Edu.Module.System
...
@@ -126,22 +135,24 @@ namespace Edu.Module.System
rolePermissionList
=
GetRolePermissionListModule
(
new
RB_Role_Permission_ViewModel
()
{
Role_Id
=
roleId
});
rolePermissionList
=
GetRolePermissionListModule
(
new
RB_Role_Permission_ViewModel
()
{
Role_Id
=
roleId
});
roleFunctionList
=
GetRoleFunctionPermissionListModule
(
new
RB_Role_FunctionPermission_ViewModel
()
{
Role_Id
=
roleId
});
roleFunctionList
=
GetRoleFunctionPermissionListModule
(
new
RB_Role_FunctionPermission_ViewModel
()
{
Role_Id
=
roleId
});
}
}
//菜单列表
var
menuList
=
menuModule
.
GetTreeMenuModule
(
new
RB_Menu_ViewModel
(),
isGetMenuFuncton
:
true
);
if
(
menuList
!=
null
&&
menuList
.
Count
>
0
)
if
(
menuList
!=
null
&&
menuList
.
Count
>
0
)
{
{
foreach
(
var
item
in
menuList
)
foreach
(
var
item
in
menuList
)
{
{
item
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
item
.
MenuId
)?.
Count
()
>
0
;
item
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
item
.
MenuId
)?.
Count
()
>
0
;
item
.
FunctionSubList
=
actionList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
item
.
MenuId
)?.
ToList
()
??
new
List
<
RB_Menu_Function_ViewModel
>();
if
(
item
.
SubList
!=
null
&&
item
.
SubList
.
Count
>
0
)
if
(
item
.
SubList
!=
null
&&
item
.
SubList
.
Count
>
0
)
{
{
foreach
(
var
subItem
in
item
.
SubList
)
foreach
(
var
subItem
in
item
.
SubList
)
{
{
subItem
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
subItem
.
MenuId
)?.
Count
()
>
0
;
subItem
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
subItem
.
MenuId
)?.
Count
()
>
0
;
subItem
.
FunctionSubList
=
actionList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
subItem
.
MenuId
)?.
ToList
()
??
new
List
<
RB_Menu_Function_ViewModel
>();
if
(
subItem
.
SubList
!=
null
&&
subItem
.
SubList
.
Count
>
0
)
if
(
subItem
.
SubList
!=
null
&&
subItem
.
SubList
.
Count
>
0
)
{
{
foreach
(
var
childItem
in
subItem
.
SubList
)
foreach
(
var
childItem
in
subItem
.
SubList
)
{
{
childItem
.
FunctionSubList
=
actionList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
childItem
.
MenuId
)?.
ToList
()
??
new
List
<
RB_Menu_Function_ViewModel
>();
childItem
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
childItem
.
MenuId
)?.
Count
()
>
0
;
childItem
.
IsChecked
=
rolePermissionList
?.
Where
(
qitem
=>
qitem
.
Menu_Id
==
childItem
.
MenuId
)?.
Count
()
>
0
;
}
}
}
}
...
@@ -152,22 +163,6 @@ namespace Edu.Module.System
...
@@ -152,22 +163,6 @@ namespace Edu.Module.System
return
menuList
;
return
menuList
;
}
}
/// <summary>
/// 获取功能权限分类名称
/// </summary>
/// <param name="categoryId"></param>
/// <returns></returns>
private
string
GetCategoryName
(
string
categoryId
)
{
string
str
=
"默认"
;
switch
(
categoryId
)
{
case
"10"
:
str
=
"系统"
;
break
;
case
"20"
:
str
=
"订单"
;
break
;
}
return
str
;
}
/// <summary>
/// <summary>
/// 新增修改[角色菜单、角色功能]权限
/// 新增修改[角色菜单、角色功能]权限
/// </summary>
/// </summary>
...
@@ -185,7 +180,7 @@ namespace Edu.Module.System
...
@@ -185,7 +180,7 @@ namespace Edu.Module.System
foreach
(
var
item
in
roleMenuList
)
foreach
(
var
item
in
roleMenuList
)
{
{
item
.
ID
=
0
;
item
.
ID
=
0
;
flag
=
rolePermissionRepository
.
Insert
(
item
)
>
0
;
flag
=
rolePermissionRepository
.
Insert
(
item
)
>
0
;
}
}
}
}
//功能权限
//功能权限
...
@@ -195,7 +190,7 @@ namespace Edu.Module.System
...
@@ -195,7 +190,7 @@ namespace Edu.Module.System
foreach
(
var
item
in
roleFunctionList
)
foreach
(
var
item
in
roleFunctionList
)
{
{
item
.
ID
=
0
;
item
.
ID
=
0
;
flag
=
roleFunctionPermissionRepository
.
Insert
(
item
)
>
0
;
flag
=
roleFunctionPermissionRepository
.
Insert
(
item
)
>
0
;
}
}
}
}
return
flag
;
return
flag
;
...
...
Edu.Repository/System/RB_Menu_FunctionRepository.cs
View file @
33902769
using
Edu.Model.Entity.System
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.System
;
using
Edu.Model.ViewModel.System
;
using
Edu.Model.ViewModel.System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
...
@@ -46,8 +47,9 @@ WHERE 1=1
...
@@ -46,8 +47,9 @@ WHERE 1=1
/// 获取菜单功能权限列表
/// 获取菜单功能权限列表
/// </summary>
/// </summary>
/// <param name="query"></param>
/// <param name="query"></param>
/// <param name="isQueryNormal">true-正常数据,false-全部数据</param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Menu_Function_ViewModel
>
GetMenuFunctionListRepository
(
RB_Menu_Function_ViewModel
query
)
public
List
<
RB_Menu_Function_ViewModel
>
GetMenuFunctionListRepository
(
RB_Menu_Function_ViewModel
query
,
bool
isQueryNormal
=
false
)
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
...
@@ -55,6 +57,10 @@ SELECT A.*
...
@@ -55,6 +57,10 @@ SELECT A.*
FROM RB_Menu_Function AS A
FROM RB_Menu_Function AS A
WHERE 1=1
WHERE 1=1
"
);
"
);
if
(
isQueryNormal
)
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Menu_Function_ViewModel
.
Status
)}
=
{(
int
)
DateStateEnum
.
Normal
}
"
);
}
if
(
query
!=
null
)
if
(
query
!=
null
)
{
{
if
(
query
.
MenuId
>
0
)
if
(
query
.
MenuId
>
0
)
...
...
Edu.Repository/User/RB_AccountRepository.cs
View file @
33902769
...
@@ -229,7 +229,7 @@ FROM
...
@@ -229,7 +229,7 @@ FROM
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.Dept
Name,'') AS DeptName,
IFNULL(p.PostName,'') AS PostName
,IFNULL(d.Dept
Id,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id,
IFNULL(p.PostName,'') AS PostName
FROM
FROM
(
(
SELECT A.*,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id
SELECT A.*,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id
...
...
Edu.Repository/User/RB_DepartmentRepository.cs
View file @
33902769
using
Edu.Model.Entity.User
;
using
Edu.Model.Entity.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
using
VT.FW.DB.Dapper
;
...
@@ -127,5 +128,19 @@ WHERE 1=1
...
@@ -127,5 +128,19 @@ WHERE 1=1
return
new
List
<
RB_Department_ViewModel
>();
return
new
List
<
RB_Department_ViewModel
>();
}
}
}
}
/// <summary>
/// 获取当前部门的所有上级部门
/// </summary>
/// <param name="currentIds"></param>
/// <returns></returns>
public
List
<
RB_Department_ViewModel
>
GetAllSuperiorDepartmentListRepository
(
object
DeptIds
)
{
var
parameters
=
new
DynamicParameters
();
string
procName
=
"proc_getsuperiordepartment"
;
parameters
.
Add
(
"QDeptIds"
,
DeptIds
,
direction
:
ParameterDirection
.
Input
);
return
Get
<
RB_Department_ViewModel
>(
procName
,
parameters
,
commandType
:
CommandType
.
StoredProcedure
).
ToList
();
}
}
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Third/ThirdController.cs
0 → 100644
View file @
33902769
using
Edu.Common.API
;
using
Edu.Common.Plugin
;
using
Edu.Module.User
;
using
Edu.WebApi.Filter
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
using
System.Linq
;
namespace
Edu.WebApi.Controllers.Third
{
/// <summary>
/// 第三方API
/// </summary>
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
ThirdController
:
BaseController
{
/// <summary>
/// 员工处理类
/// </summary>
private
readonly
EmployeeModule
employeeModule
=
new
EmployeeModule
();
/// <summary>
/// 根部部门层级获取部门主管
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetEmploeeByTier
()
{
JObject
jobj
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
EmployeeId
=
jobj
.
GetInt
(
"EmployeeId"
,
0
);
int
TierId
=
jobj
.
GetInt
(
"TierId"
,
0
);
if
(
EmployeeId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请传递员工编号!"
);
}
var
empModel
=
employeeModule
.
GetEmployeeListModule
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
Id
=
EmployeeId
})?.
FirstOrDefault
();
if
(
empModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"当前员工编号不存在!"
);
}
if
(
TierId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择部门层级!"
);
}
var
empList
=
employeeModule
.
GetEmployeeByDeptTierModule
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
Dept_Id
=
empModel
.
Dept_Id
,
DeptTier
=
TierId
,
Group_Id
=
empModel
.
Group_Id
});
var
result
=
empList
?.
Select
(
qitem
=>
new
{
qitem
.
Id
,
qitem
.
EmployeeName
,
qitem
.
Dept_Id
,
qitem
.
DeptName
,
qitem
.
Post_Id
,
qitem
.
PostName
,
qitem
.
School_Id
,
qitem
.
SchoolName
,
qitem
.
Group_Id
,
qitem
.
GroupName
});
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
/// 根据岗位编号获取岗位员工列表
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
HttpPost
]
[
AllowAnonymous
]
public
ApiResult
GetEmployeeByPost
()
{
JObject
jobj
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
EmployeeId
=
jobj
.
GetInt
(
"EmployeeId"
,
0
);
if
(
EmployeeId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请传递员工编号!"
);
}
var
empModel
=
employeeModule
.
GetEmployeeListModule
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
Id
=
EmployeeId
})?.
FirstOrDefault
();
if
(
empModel
==
null
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"当前员工编号不存在!"
);
}
int
postId
=
jobj
.
GetInt
(
"PostId"
);
if
(
postId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
message
:
"请选择岗位!"
);
}
var
list
=
employeeModule
.
GetEmployeeListModule
(
new
Model
.
ViewModel
.
User
.
Employee_ViewModel
()
{
QPostIds
=
postId
.
ToString
(),
Group_Id
=
empModel
.
Group_Id
});
return
ApiResult
.
Success
(
data
:
list
?.
Select
(
qitem
=>
new
{
qitem
.
Id
,
qitem
.
EmployeeName
,
qitem
.
Dept_Id
,
qitem
.
DeptName
,
qitem
.
Post_Id
,
qitem
.
PostName
,
qitem
.
School_Id
,
qitem
.
SchoolName
,
qitem
.
Group_Id
,
qitem
.
GroupName
}));
}
}
}
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