Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
performance
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zry
performance
Commits
3b92e0f8
Commit
3b92e0f8
authored
Nov 13, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
角色权限选择、工作量过滤
parent
fee18f0b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
7 deletions
+95
-7
performance/Performance.Api/Controllers/AccountController.cs
+2
-1
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
+21
-1
performance/Performance.EntityModels/Entity/ag_secondallot.cs
+16
-1
performance/Performance.EntityModels/Entity/sys_role.cs
+5
-0
performance/Performance.Infrastructure/Extensions/Extensions.String.cs
+11
-0
performance/Performance.Services/ConfigService.cs
+6
-1
performance/Performance.Services/UserService.cs
+34
-3
No files found.
performance/Performance.Api/Controllers/AccountController.cs
View file @
3b92e0f8
...
...
@@ -210,7 +210,8 @@ public ApiResponse<UserResponse> Password([FromBody]PasswordRequest request)
[
HttpPost
]
public
ApiResponse
<
List
<
sys_role
>>
RoleList
()
{
var
roleList
=
_userService
.
RoleList
();
var
userid
=
_claim
.
GetUserId
();
var
roleList
=
_userService
.
RoleList
(
userid
);
return
new
ApiResponse
<
List
<
sys_role
>>(
ResponseType
.
OK
,
"ok"
,
roleList
);
}
...
...
performance/Performance.Api/wwwroot/Performance.EntityModels.xml
View file @
3b92e0f8
...
...
@@ -651,7 +651,22 @@
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.Status"
>
<summary>
状态 1 未提交 2 提交
状态 1 未提交 2 等待审核 3 审核通过 4 驳回
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.SubmitTime"
>
<summary>
提交时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.AuditTime"
>
<summary>
审核时间
</summary>
</member>
<member
name=
"P:Performance.EntityModels.ag_secondallot.AuditUser"
>
<summary>
审核人
</summary>
</member>
<member
name=
"T:Performance.EntityModels.ag_temp"
>
...
...
@@ -3049,6 +3064,11 @@
菜单状态 1 启用 2禁用
</summary>
</member>
<member
name=
"P:Performance.EntityModels.sys_role.ParentRoles"
>
<summary>
父级角色
</summary>
</member>
<member
name=
"T:Performance.EntityModels.sys_role_menu"
>
<summary>
角色菜单关联表
...
...
performance/Performance.EntityModels/Entity/ag_secondallot.cs
View file @
3b92e0f8
...
...
@@ -52,8 +52,23 @@ public class ag_secondallot
public
Nullable
<
decimal
>
RealGiveFee
{
get
;
set
;
}
/// <summary>
/// 状态 1 未提交 2
提交
/// 状态 1 未提交 2
等待审核 3 审核通过 4 驳回
/// </summary>
public
Nullable
<
int
>
Status
{
get
;
set
;
}
/// <summary>
/// 提交时间
/// </summary>
public
Nullable
<
DateTime
>
SubmitTime
{
get
;
set
;
}
/// <summary>
/// 审核时间
/// </summary>
public
Nullable
<
DateTime
>
AuditTime
{
get
;
set
;
}
/// <summary>
/// 审核人
/// </summary>
public
Nullable
<
int
>
AuditUser
{
get
;
set
;
}
}
}
performance/Performance.EntityModels/Entity/sys_role.cs
View file @
3b92e0f8
...
...
@@ -35,5 +35,10 @@ public class sys_role
/// 菜单状态 1 启用 2禁用
/// </summary>
public
int
States
{
get
;
set
;
}
/// <summary>
/// 父级角色
/// </summary>
public
string
ParentRoles
{
get
;
set
;
}
}
}
performance/Performance.Infrastructure/Extensions/Extensions.String.cs
View file @
3b92e0f8
...
...
@@ -15,5 +15,16 @@ public static string RemoveEnter(this string text)
{
return
text
.
Replace
(
"\r"
,
""
);
}
/// <summary>
/// 分隔 移除空项
/// </summary>
/// <param name="text"></param>
/// <param name="separator"></param>
/// <returns></returns>
public
static
string
[]
SplitRemoveEmpty
(
this
string
text
,
params
string
[]
separator
)
{
return
text
.
Split
(
separator
,
StringSplitOptions
.
RemoveEmptyEntries
);
}
}
}
performance/Performance.Services/ConfigService.cs
View file @
3b92e0f8
...
...
@@ -593,7 +593,12 @@ public List<TitleValue> WorkHeader(int allotId)
if
(
sheets
==
null
)
return
new
List
<
TitleValue
>();
var
header
=
perforImheaderRepository
.
GetEntities
(
t
=>
sheets
.
Select
(
s
=>
s
.
ID
).
Contains
(
t
.
SheetID
.
Value
)
&&
!
t
.
CellValue
.
Contains
(
"核算单元"
)
&&
t
.
CellValue
!=
"科室名称"
)?.
ToList
();
return
header
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
.
CellValue
,
Value
=
t
.
CellValue
}).
Distinct
().
ToList
();
if
(
header
!=
null
&&
header
.
Count
>
0
)
{
var
list
=
header
.
Select
(
t
=>
t
.
CellValue
).
Where
(
t
=>
!
string
.
IsNullOrEmpty
(
t
)).
Distinct
();
return
list
?.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
}).
ToList
();
}
return
null
;
}
}
}
performance/Performance.Services/UserService.cs
View file @
3b92e0f8
...
...
@@ -4,6 +4,7 @@
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -303,10 +304,20 @@ public UserResponse UpdatePwd(PasswordRequest request, int userId)
/// 角色列表
/// </summary>
/// <returns></returns>
public
List
<
sys_role
>
RoleList
()
public
List
<
sys_role
>
RoleList
(
int
userId
)
{
var
role
=
_roleRepository
.
GetEntities
(
t
=>
t
.
States
==
1
);
return
role
;
var
user
=
_userroleRepository
.
GetEntity
(
t
=>
t
.
UserID
==
userId
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"登录用户不存在!"
);
var
roles
=
_roleRepository
.
GetEntities
(
t
=>
t
.
States
==
1
);
var
role
=
roles
.
FirstOrDefault
(
s
=>
s
.
ID
==
user
.
RoleID
);
if
(
user
==
null
)
throw
new
PerformanceException
(
"当前用户角色无效!"
);
List
<
sys_role
>
result
=
new
List
<
sys_role
>()
{
role
};
GetChildrenRole
(
roles
,
role
.
ID
,
result
);
return
result
;
}
/// <summary>
...
...
@@ -325,5 +336,25 @@ public List<TitleValue> Department(int hospitalID)
}
return
new
List
<
TitleValue
>();
}
/// <summary>
/// 递归获取所有下属角色
/// </summary>
/// <param name="roles"></param>
/// <param name="roleId"></param>
/// <param name="result"></param>
private
void
GetChildrenRole
(
List
<
sys_role
>
roles
,
int
roleId
,
List
<
sys_role
>
result
)
{
foreach
(
var
role
in
roles
.
Where
(
s
=>
!
string
.
IsNullOrEmpty
(
s
.
ParentRoles
)))
{
if
(
role
.
ParentRoles
.
SplitRemoveEmpty
(
","
).
Contains
(
roleId
.
ToString
()))
{
result
.
Add
(
role
);
GetChildrenRole
(
roles
,
role
.
ID
,
result
);
}
}
}
}
}
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