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
9ae0577b
Commit
9ae0577b
authored
Mar 27, 2019
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码搬迁位置
parent
4e2343b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
108 deletions
+146
-108
performance/Performance.Api/Controllers/AllotController.cs
+6
-46
performance/Performance.Api/Controllers/ComputeController.cs
+70
-0
performance/Performance.Services/ComputeService.cs
+70
-1
performance/Performance.Services/PerExcelService/PerExcelService.cs
+0
-61
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
9ae0577b
...
...
@@ -6,9 +6,9 @@
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.EntityModels
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
...
...
@@ -145,6 +145,11 @@ public ApiResponse Import([FromForm] IFormCollection form)
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 绩效生成
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"generate"
)]
[
HttpPost
]
public
ApiResponse
Generate
([
CustomizeValidator
(
RuleSet
=
"Delete"
),
FromBody
]
AllotRequest
request
)
...
...
@@ -156,50 +161,5 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
BackgroundJob
.
Enqueue
(()
=>
_perExcelService
.
Execute
(
allot
));
return
new
ApiResponse
(
ResponseType
.
OK
);
}
[
Route
(
"getcompute"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
res_compute
>>
GetCompute
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_perExcelService
.
GetCompute
(
request
.
AllotId
,
request
.
Type
);
return
new
ApiResponse
<
List
<
res_compute
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
[
Route
(
"getspecial"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
res_specialunit
>>
GetSpecial
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_perExcelService
.
GetSpecial
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
res_specialunit
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
[
Route
(
"getdoctordata"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
DoctorResponse
>>
GetDoctor
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_perExcelService
.
GetDoctorPerformance
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
DoctorResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
[
Route
(
"getnursedata"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
NurseResponse
>>
GetNurse
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_perExcelService
.
GetNursePerformance
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
NurseResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
}
}
performance/Performance.Api/Controllers/ComputeController.cs
View file @
9ae0577b
...
...
@@ -5,6 +5,7 @@
using
Newtonsoft.Json.Linq
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
System
;
...
...
@@ -26,6 +27,75 @@ public class ComputeController : Controller
_computeService
=
computeService
;
}
/// <summary>
/// 获取绩效发放列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getcompute"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
res_compute
>>
GetCompute
([
CustomizeValidator
(
RuleSet
=
"Select"
),
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetCompute
(
request
.
AllotId
,
request
.
Type
);
return
new
ApiResponse
<
List
<
res_compute
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 特殊科室发放列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getspecial"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
res_specialunit
>>
GetSpecial
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetSpecial
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
res_specialunit
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 医生组科室绩效列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getdoctordata"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
DoctorResponse
>>
GetDoctor
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetDoctorPerformance
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
DoctorResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 护理组科室绩效列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"getnursedata"
)]
[
HttpPost
]
public
ApiResponse
<
List
<
NurseResponse
>>
GetNurse
([
FromBody
]
ComputerRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
list
=
_computeService
.
GetNursePerformance
(
request
.
AllotId
);
return
new
ApiResponse
<
List
<
NurseResponse
>>(
ResponseType
.
OK
,
"ok"
,
list
);
}
/// <summary>
/// 科室绩效详情
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"deptdetail"
)]
[
HttpPost
]
public
ApiResponse
<
DeptDetailResponse
>
DeptDetail
([
FromBody
]
DeptDetailRequest
request
)
...
...
performance/Performance.Services/ComputeService.cs
View file @
9ae0577b
using
AutoMapper
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -14,15 +16,82 @@ public class ComputeService : IAutoInjection
private
PerforResAccountnurseRepository
_perforResAccountnurseRepository
;
private
PerforPerSheetRepository
_perforPerSheetRepository
;
private
PerforImDataRepository
_perforImDataRepository
;
private
PerforRescomputeRepository
_perforRescomputeRepository
;
private
PerforResspecialunitRepository
_perforResspecialunitRepository
;
public
ComputeService
(
PerforResAccountdoctorRepository
perforResAccountdoctorRepository
,
PerforResAccountnurseRepository
perforResAccountnurseRepository
,
PerforPerSheetRepository
perforPerSheetRepository
,
PerforImDataRepository
perforImDataRepository
)
PerforImDataRepository
perforImDataRepository
,
PerforRescomputeRepository
perforRescomputeRepository
,
PerforResspecialunitRepository
perforResspecialunitRepository
)
{
_perforResAccountdoctorRepository
=
perforResAccountdoctorRepository
;
_perforResAccountnurseRepository
=
perforResAccountnurseRepository
;
_perforPerSheetRepository
=
perforPerSheetRepository
;
_perforImDataRepository
=
perforImDataRepository
;
_perforRescomputeRepository
=
perforRescomputeRepository
;
_perforResspecialunitRepository
=
perforResspecialunitRepository
;
}
public
List
<
res_compute
>
GetCompute
(
int
allotId
,
int
type
)
{
var
list
=
new
List
<
res_compute
>();
Dictionary
<
int
,
List
<
PerformanceType
>>
keyValues
=
new
Dictionary
<
int
,
List
<
PerformanceType
>>
{
{
1
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceDirector
}
},
{
2
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceDirectorAvg
}
},
{
3
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceNurseAvg95
,
PerformanceType
.
ReferenceHeadNurse
,
PerformanceType
.
Null
}
},
{
5
,
new
List
<
PerformanceType
>{
PerformanceType
.
Director
,
PerformanceType
.
DeputyDirector
}
},
{
6
,
new
List
<
PerformanceType
>{
PerformanceType
.
Nurse
}
}
};
if
(
keyValues
.
ContainsKey
(
type
))
{
var
conList
=
keyValues
[
type
].
Select
(
t
=>
EnumHelper
.
GetDescription
(
t
));
list
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
conList
.
Contains
(
t
.
FitPeople
));
}
else
if
(
type
==
99
)
{
list
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
}
else
{
throw
new
PerformanceException
(
"参数错误,type无效"
);
}
return
Mapper
.
Map
<
List
<
res_compute
>>(
list
);
}
public
List
<
res_specialunit
>
GetSpecial
(
int
allotId
)
{
var
list
=
_perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
Mapper
.
Map
<
List
<
res_specialunit
>>(
list
);
}
public
List
<
DoctorResponse
>
GetDoctorPerformance
(
int
allotId
)
{
var
list
=
_perforResAccountdoctorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
List
<
DoctorResponse
>
doctor
=
Mapper
.
Map
<
List
<
DoctorResponse
>>(
list
);
if
(
doctor
!=
null
)
{
foreach
(
var
item
in
doctor
)
{
item
.
UnitName
=
"医生组"
;
}
}
return
Mapper
.
Map
<
List
<
DoctorResponse
>>(
doctor
);
}
public
List
<
NurseResponse
>
GetNursePerformance
(
int
allotId
)
{
var
list
=
_perforResAccountnurseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
List
<
NurseResponse
>
nurse
=
Mapper
.
Map
<
List
<
NurseResponse
>>(
list
);
if
(
nurse
!=
null
)
{
foreach
(
var
item
in
nurse
)
{
item
.
UnitName
=
"护士组"
;
}
}
return
Mapper
.
Map
<
List
<
NurseResponse
>>(
nurse
);
}
/// <summary>
...
...
performance/Performance.Services/PerExcelService/PerExcelService.cs
View file @
9ae0577b
...
...
@@ -522,66 +522,5 @@ public List<res_baiscnorm> Compute(per_allot allot, PerExcel excel, res_baiscnor
return
baiscnormList
;
}
public
List
<
res_compute
>
GetCompute
(
int
allotId
,
int
type
)
{
var
list
=
new
List
<
res_compute
>();
Dictionary
<
int
,
List
<
PerformanceType
>>
keyValues
=
new
Dictionary
<
int
,
List
<
PerformanceType
>>
{
{
1
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceDirector
}
},
{
2
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceDirectorAvg
}
},
{
3
,
new
List
<
PerformanceType
>{
PerformanceType
.
ReferenceNurseAvg95
,
PerformanceType
.
ReferenceHeadNurse
,
PerformanceType
.
Null
}
},
{
5
,
new
List
<
PerformanceType
>{
PerformanceType
.
Director
,
PerformanceType
.
DeputyDirector
}
},
{
6
,
new
List
<
PerformanceType
>{
PerformanceType
.
Nurse
}
}
};
if
(
keyValues
.
ContainsKey
(
type
))
{
var
conList
=
keyValues
[
type
].
Select
(
t
=>
EnumHelper
.
GetDescription
(
t
));
list
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
conList
.
Contains
(
t
.
FitPeople
));
}
else
if
(
type
==
99
)
{
list
=
_perforRescomputeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
}
else
{
throw
new
PerformanceException
(
"参数错误,type无效"
);
}
return
Mapper
.
Map
<
List
<
res_compute
>>(
list
);
}
public
List
<
res_specialunit
>
GetSpecial
(
int
allotId
)
{
var
list
=
_perforResspecialunitRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
return
Mapper
.
Map
<
List
<
res_specialunit
>>(
list
);
}
public
List
<
DoctorResponse
>
GetDoctorPerformance
(
int
allotId
)
{
var
list
=
_perforResAccountdoctorRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
List
<
DoctorResponse
>
doctor
=
Mapper
.
Map
<
List
<
DoctorResponse
>>(
list
);
if
(
doctor
!=
null
)
{
foreach
(
var
item
in
doctor
)
{
item
.
UnitName
=
"医生组"
;
}
}
return
Mapper
.
Map
<
List
<
DoctorResponse
>>(
doctor
);
}
public
List
<
NurseResponse
>
GetNursePerformance
(
int
allotId
)
{
var
list
=
_perforResAccountnurseRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
List
<
NurseResponse
>
nurse
=
Mapper
.
Map
<
List
<
NurseResponse
>>(
list
);
if
(
nurse
!=
null
)
{
foreach
(
var
item
in
nurse
)
{
item
.
UnitName
=
"护士组"
;
}
}
return
Mapper
.
Map
<
List
<
NurseResponse
>>(
nurse
);
}
}
}
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