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
82f3d0a1
Commit
82f3d0a1
authored
Apr 24, 2019
by
李承祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科室查询修改
parent
b5829785
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
12 deletions
+33
-12
performance/Performance.Api/Controllers/AssessController.cs
+2
-2
performance/Performance.DtoModels/TitleValue.cs
+4
-0
performance/Performance.Services/AssessService.cs
+27
-10
No files found.
performance/Performance.Api/Controllers/AssessController.cs
View file @
82f3d0a1
...
@@ -64,9 +64,9 @@ public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody]Asse
...
@@ -64,9 +64,9 @@ public ApiResponse DelAssess([CustomizeValidator(RuleSet = "Del"), FromBody]Asse
//获取所有科室列表
//获取所有科室列表
[
HttpPost
]
[
HttpPost
]
[
Route
(
"departmentlist"
)]
[
Route
(
"departmentlist"
)]
public
ApiResponse
DepartmentList
([
CustomizeValidator
(
RuleSet
=
"
List
"
),
FromBody
]
AssessRequest
request
)
public
ApiResponse
DepartmentList
([
CustomizeValidator
(
RuleSet
=
"
Use
"
),
FromBody
]
AssessRequest
request
)
{
{
var
department
=
assessService
.
Department
(
request
.
AllotID
);
var
department
=
assessService
.
Department
(
request
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
department
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
department
);
}
}
...
...
performance/Performance.DtoModels/TitleValue.cs
View file @
82f3d0a1
...
@@ -17,6 +17,10 @@ public class TitleValue<T>
...
@@ -17,6 +17,10 @@ public class TitleValue<T>
/// Value
/// Value
/// </summary>
/// </summary>
public
T
Value
{
get
;
set
;
}
public
T
Value
{
get
;
set
;
}
/// <summary>
/// 1、已选,2、未选,3、已被选择
/// </summary>
public
int
State
{
get
;
set
;
}
}
}
/// <summary>
/// <summary>
/// title value
/// title value
...
...
performance/Performance.Services/AssessService.cs
View file @
82f3d0a1
...
@@ -313,22 +313,39 @@ public ApiResponse UseTemplate(int allotID, int assessID)
...
@@ -313,22 +313,39 @@ public ApiResponse UseTemplate(int allotID, int assessID)
/// 科室列表
/// 科室列表
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
List
<
TitleValue
>
Department
(
int
allotId
)
public
List
<
TitleValue
>
Department
(
AssessRequest
request
)
{
{
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
allotId
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
AllotID
);
if
(
allot
!=
null
)
if
(
allot
!=
null
)
{
{
var
_checked
=
perforAsdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
)?.
Select
(
t
=>
t
.
Department
).
Distinct
();
var
result
=
new
List
<
TitleValue
>
();
var
allotList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
);
//取到该家医院下所有科室
var
idList
=
allotList
.
Select
(
s
=>
s
.
ID
).
ToList
();
var
idList
=
perforPerallotRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
)
.
Select
(
s
=>
s
.
ID
).
ToList
();
var
department
=
perforImemployeeRepository
.
GetEntities
(
t
=>
t
.
Department
!=
""
&&
idList
.
Contains
(
t
.
AllotID
.
Value
));
var
department
=
perforImemployeeRepository
.
GetEntities
(
t
=>
t
.
Department
!=
""
&&
idList
.
Contains
(
t
.
AllotID
.
Value
))
?.
Select
(
t
=>
t
.
Department
).
ToList
()
;
if
(
department
!=
null
&&
department
.
Count
>
0
)
if
(
department
!=
null
&&
department
.
Count
>
0
)
{
{
var
departmentList
=
department
.
Select
(
t
=>
t
.
Department
).
Distinct
();
if
(
_checked
!=
null
)
//自己选的
departmentList
=
departmentList
.
Except
(
_checked
).
ToList
();
var
_checked
=
perforAsdataRepository
.
GetEntities
(
t
=>
t
.
AssessID
==
request
.
AssessID
)?.
Select
(
t
=>
t
.
Department
).
ToList
();
return
departmentList
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
}).
OrderBy
(
t
=>
t
.
Title
).
ToList
();
if
(
_checked
!=
null
&&
_checked
.
Count
>
0
)
result
=
_checked
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
,
State
=
1
}).
ToList
();
//已经被选择
var
assessId
=
perforAsassessRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
request
.
AllotID
)?.
Select
(
t
=>
t
.
ID
).
ToList
();
if
(
assessId
.
Count
>
0
&&
assessId
!=
null
)
{
assessId
.
Remove
(
request
.
AssessID
);
_checked
=
perforAsdataRepository
.
GetEntities
(
t
=>
assessId
.
Contains
(
t
.
AssessID
.
Value
))?.
Select
(
t
=>
t
.
Department
).
ToList
();
if
(
_checked
!=
null
&&
_checked
.
Count
>
0
)
{
result
=
result
.
Union
(
_checked
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
,
State
=
3
})).
ToList
();
}
}
//未被选择
if
(
result
!=
null
||
result
.
Count
>
0
)
department
=
department
.
Except
(
result
.
Select
(
t
=>
t
.
Title
)).
ToList
();
result
=
result
.
Union
(
department
.
Select
(
t
=>
new
TitleValue
{
Title
=
t
,
Value
=
t
,
State
=
2
})).
OrderBy
(
t
=>
t
.
State
).
ThenBy
(
t
=>
t
.
Title
).
ToList
();
}
}
return
result
;
}
}
return
new
List
<
TitleValue
>();
return
new
List
<
TitleValue
>();
}
}
...
...
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