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
1a8553e0
Commit
1a8553e0
authored
Sep 16, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次分配自动补全
parent
c447d46c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
23 deletions
+109
-23
performance/Performance.Api/Controllers/SecondAllotController.cs
+12
-0
performance/Performance.Api/wwwroot/Performance.Api.xml
+6
-0
performance/Performance.DtoModels/Request/SecondEmpRequest.cs
+0
-9
performance/Performance.Services/PersonService.cs
+10
-0
performance/Performance.Services/SecondAllotService.cs
+81
-14
No files found.
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
1a8553e0
...
...
@@ -148,6 +148,18 @@ public ApiResponse AutoComplete([FromBody] SecondEmpRequest request)
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
/// <summary>
/// 二次绩效录入页面其他模板自动补全
/// </summary>
/// <returns></returns>
[
Route
(
"api/second/other/autocomplete"
)]
[
HttpPost
]
public
ApiResponse
OtherAutoComplete
([
FromBody
]
SecondEmpRequest
request
)
{
var
result
=
secondAllotService
.
OtherAutoComplete
(
request
,
claimService
.
GetUserId
());
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
region
模板使用
/// <summary>
/// 选择二次绩效模板
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
1a8553e0
...
...
@@ -1051,6 +1051,12 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.OtherAutoComplete(Performance.DtoModels.SecondEmpRequest)"
>
<summary>
二次绩效录入页面其他模板自动补全
</summary>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.SecondAllotController.Temp(Performance.DtoModels.AllotDeptRequest)"
>
<summary>
选择二次绩效模板
...
...
performance/Performance.DtoModels/Request/SecondEmpRequest.cs
View file @
1a8553e0
...
...
@@ -9,12 +9,6 @@ public class SecondEmpRequest
{
public
int
TempId
{
get
;
set
;
}
public
int
HospitalId
{
get
;
set
;
}
public
string
Department
{
get
;
set
;
}
public
string
UnitType
{
get
;
set
;
}
public
int
SecondId
{
get
;
set
;
}
public
string
EmployeeName
{
get
;
set
;
}
...
...
@@ -27,9 +21,6 @@ public class SecondEmpRequestValidator : AbstractValidator<SecondEmpRequest>
public
SecondEmpRequestValidator
()
{
RuleFor
(
x
=>
x
.
TempId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
HospitalId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
Department
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
UnitType
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
SecondId
).
NotNull
().
GreaterThan
(
0
);
}
}
...
...
performance/Performance.Services/PersonService.cs
View file @
1a8553e0
...
...
@@ -136,6 +136,16 @@ private void SaveAllotPersons(List<per_employee> employees)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
List
<
per_employee
>
GetPerEmployee
(
int
allotId
)
{
return
peremployeeRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
)?.
OrderBy
(
t
=>
t
.
Id
).
ToList
();
}
/// <summary>
/// 获取所有员工记录
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public
List
<
per_employee
>
GetPersons
(
int
allotId
,
int
userId
)
{
var
(
dept
,
unittype
)
=
GetDeptByUser
(
userId
);
...
...
performance/Performance.Services/SecondAllotService.cs
View file @
1a8553e0
...
...
@@ -286,19 +286,24 @@ public List<SecondListResponse> GetSecondList(int userId)
/// <returns></returns>
public
List
<
BodyItem
>
AutoComplete
(
SecondEmpRequest
request
,
int
userId
)
{
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
SecondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"当前科室二次分配绩效信息无效"
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
second
.
AllotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"当前绩效信息无效"
);
var
usetemp
=
perforAgusetempRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
request
.
HospitalId
&&
t
.
Department
==
request
.
Department
&&
t
.
UnitType
==
request
.
UnitType
);
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Department
==
second
.
Department
&&
t
.
UnitType
==
second
.
UnitType
);
if
(
usetemp
==
null
)
throw
new
PerformanceException
(
"当前科室暂未配置绩效模板"
);
//获取固定模板列 + 工作量列
var
headItems
=
GetHeadItems
(
request
.
TempId
,
usetemp
.
HospitalId
.
Value
,
usetemp
.
Department
,
usetemp
.
UnitType
);
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
SecondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"当前科室二次分配绩效信息无效"
);
var
bodyItems
=
GetEmployees
(
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
,
request
.
EmployeeName
,
request
.
JobNumber
);
var
employees
=
personService
.
GetPerEmployee
(
second
.
AllotId
.
Value
);
var
bodyItems
=
GetEmployees
(
employees
,
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
,
request
.
EmployeeName
,
request
.
JobNumber
);
return
bodyItems
;
}
...
...
@@ -351,14 +356,16 @@ public SecondResponse GetSecondDetail(UseTempRequest request, int userId)
if
(
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
)
==
null
||
!
fixatList
.
Where
(
t
=>
t
.
RowNumber
!=
-
1
).
Any
())
{
//更换模板时,会自动保存顶部数据
result
.
BodyItems
.
AddRange
(
GetEmployees
(
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
));
var
employees
=
personService
.
GetPersons
(
second
.
AllotId
.
Value
,
userId
);
result
.
BodyItems
.
AddRange
(
GetEmployees
(
employees
,
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
));
}
}
else
{
//无数据 根据IsBring带出历史二次绩效中需要带出的数据
//result.BodyItems = GetBringItems(request, headItems);
result
.
BodyItems
=
GetEmployees
(
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
);
var
employees
=
personService
.
GetPersons
(
second
.
AllotId
.
Value
,
userId
);
result
.
BodyItems
=
GetEmployees
(
employees
,
second
.
AllotId
.
Value
,
userId
,
headItems
,
second
.
UnitType
);
var
bodys
=
Mapper
.
Map
<
List
<
BodyItem
>>(
headItems
.
Where
(
t
=>
t
.
Type
==
1
));
if
(
bodys
!=
null
&&
bodys
.
Any
())
...
...
@@ -404,19 +411,20 @@ private void SupplementOtherPerfor(SecondResponse result, int allotId)
}
}
private
List
<
BodyItem
>
GetEmployees
(
int
allotId
,
int
userId
,
List
<
HeadItem
>
heads
,
string
unittype
,
string
empName
=
""
,
string
jobNumber
=
""
)
private
List
<
BodyItem
>
GetEmployees
(
List
<
per_employee
>
employees
,
int
allotId
,
int
userId
,
List
<
HeadItem
>
heads
,
string
unittype
,
string
empName
=
""
,
string
jobNumber
=
""
)
{
var
list
=
new
List
<
BodyItem
>();
var
employees
=
personService
.
GetPersons
(
allotId
,
userId
);
//
var employees = personService.GetPersons(allotId, userId);
if
(
employees
==
null
||
!
employees
.
Any
(
t
=>
t
.
UnitType
==
unittype
))
return
list
;
employees
=
employees
.
Where
(
t
=>
t
.
UnitType
==
unittype
).
ToList
();
if
(
string
.
IsNullOrEmpty
(
empName
)
&&
string
.
IsNullOrEmpty
(
jobNumber
))
employees
=
employees
.
Where
(
t
=>
t
.
UnitType
==
unittype
).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
empName
))
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
empName
?.
Trim
()).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
jobNumber
))
employees
=
employees
?.
Where
(
w
=>
w
.
PersonnelNumber
?.
Trim
()
==
jobNumber
?.
Trim
(
)).
ToList
();
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
.
Contains
(
jobNumber
.
Trim
()
)).
ToList
();
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
Func
<
per_employee
,
decimal
?>
getAprAmount
=
(
t
)
=>
perapramounts
...
...
@@ -1432,6 +1440,67 @@ public List<ag_othersource> OtherList(int secondId, int userId)
WorkPost
=
t
.
JobTitle
,
}).
ToList
();
}
SupplementSecondDetail
(
second
,
employees
,
result
);
return
result
;
}
/// <summary>
/// 二次绩效录入页面其他模板自动补全
/// </summary>
/// <param name="secondId"></param>
/// <param name="userId"></param>
/// <returns></returns>
public
List
<
ag_othersource
>
OtherAutoComplete
(
SecondEmpRequest
request
,
int
userId
)
{
var
second
=
perforAgsecondallotRepository
.
GetEntity
(
t
=>
t
.
Id
==
request
.
SecondId
);
if
(
second
==
null
)
throw
new
PerformanceException
(
"当前科室二次分配绩效信息无效"
);
var
allot
=
perforPerallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
second
.
AllotId
);
if
(
allot
==
null
)
throw
new
PerformanceException
(
"当前绩效信息无效"
);
var
usetemp
=
perforAgusetempRepository
.
GetEntity
(
t
=>
t
.
HospitalId
==
allot
.
HospitalId
&&
t
.
Department
==
second
.
Department
&&
t
.
UnitType
==
second
.
UnitType
);
if
(
usetemp
==
null
)
throw
new
PerformanceException
(
"当前科室暂未配置绩效模板"
);
//获取固定模板列 + 工作量列
var
headItems
=
GetHeadItems
(
request
.
TempId
,
usetemp
.
HospitalId
.
Value
,
usetemp
.
Department
,
usetemp
.
UnitType
);
var
employees
=
personService
.
GetPerEmployee
(
second
.
AllotId
.
Value
);
if
(
employees
==
null
)
return
new
List
<
ag_othersource
>();
if
(!
string
.
IsNullOrEmpty
(
request
.
EmployeeName
))
employees
=
employees
?.
Where
(
w
=>
w
.
DoctorName
?.
Trim
()
==
request
.
EmployeeName
?.
Trim
()).
ToList
();
if
(!
string
.
IsNullOrEmpty
(
request
.
JobNumber
))
employees
=
employees
?.
Where
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
PersonnelNumber
)
&&
w
.
PersonnelNumber
.
Contains
(
request
.
JobNumber
.
Trim
())).
ToList
();
List
<
ag_othersource
>
result
=
employees
.
Select
(
t
=>
new
ag_othersource
{
SecondId
=
request
.
SecondId
,
WorkNumber
=
t
.
PersonnelNumber
,
Name
=
t
.
DoctorName
,
Department
=
t
.
Department
,
WorkPost
=
t
.
JobTitle
,
}).
ToList
();
SupplementSecondDetail
(
second
,
employees
,
result
);
return
result
;
}
/// <summary>
/// 补充二次分配 人员明细
/// </summary>
/// <param name="second"></param>
/// <param name="employees"></param>
/// <param name="result"></param>
private
void
SupplementSecondDetail
(
ag_secondallot
second
,
List
<
per_employee
>
employees
,
List
<
ag_othersource
>
result
)
{
// 补充医院其他绩效 及 预留比例
var
perapramounts
=
perapramountRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
second
.
AllotId
);
Func
<
per_employee
,
decimal
?>
getAprAmount
=
(
t
)
=>
perapramounts
...
...
@@ -1455,8 +1524,6 @@ public List<ag_othersource> OtherList(int secondId, int userId)
item
.
TitlePerformance
=
getDistPerformance
(
empl
);
}
}
return
result
;
}
public
Dictionary
<
string
,
string
>
OtherListHeader
(
int
secondId
,
decimal
?
amount
)
...
...
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