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
56b80856
Commit
56b80856
authored
Mar 09, 2021
by
钟博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '新增菜单' into v20201230yubei
parents
e6ede3ac
1d294215
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
238 additions
and
4 deletions
+238
-4
performance/Performance.Api/Controllers/ComputeController.cs
+48
-1
performance/Performance.Api/Controllers/EmployeeController.cs
+15
-0
performance/Performance.Api/Controllers/SecondAllotController.cs
+3
-3
performance/Performance.DtoModels/Request/ComputerAvgRequest.cs
+42
-0
performance/Performance.Services/ComputeService.cs
+69
-0
performance/Performance.Services/EmployeeService.cs
+61
-0
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
56b80856
...
...
@@ -13,6 +13,7 @@
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
Performance.DtoModels.Request
;
namespace
Performance.Api.Controllers
{
...
...
@@ -22,12 +23,15 @@ public class ComputeController : Controller
private
ComputeService
_computeService
;
private
AllotService
_allotService
;
private
ClaimService
_claim
;
private
EmployeeService
_employeeService
;
public
ComputeController
(
AllotService
allotService
,
ComputeService
computeService
,
EmployeeService
employeeService
,
ClaimService
claim
)
{
_allotService
=
allotService
;
_computeService
=
computeService
;
_employeeService
=
employeeService
;
_claim
=
claim
;
}
...
...
@@ -253,7 +257,7 @@ public ApiResponse AllComputeAvg([FromBody] ComputerRequest request)
// ? 0 : Math.Round(gc.Sum(s => s.RealGiveFee) / gc.Select(p => new { p.JobNumber, p.EmployeeName }).Distinct().Count() ?? 0)
// }));
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
avgs
.
Select
(
w
=>
new
{
w
.
PositionName
,
w
.
TotelNumber
,
w
.
TotelValue
,
w
.
AvgValue
}));
return
new
ApiResponse
(
ResponseType
.
OK
,
"ok"
,
avgs
.
Select
(
w
=>
new
{
w
.
ID
,
w
.
PositionName
,
w
.
TotelNumber
,
w
.
TotelValue
,
w
.
AvgValue
}));
}
/// <summary>
...
...
@@ -366,5 +370,47 @@ public ApiResponse DoctorDetail(int computeId)
var
result
=
_computeService
.
GetDoctorDetail
(
computeId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
#
region
人均绩效修改
/// <summary>
/// 编辑全院绩效平均
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"EditHospitalAvg"
)]
[
HttpPost
]
public
ApiResponse
<
res_baiscnorm
>
EditHospitalAvg
([
FromBody
]
ComputerAvgRequest
request
)
{
var
allot
=
_allotService
.
GetAllot
(
request
.
AllotId
);
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
result
=
_computeService
.
EditHospitalAvg
(
request
);
return
new
ApiResponse
<
res_baiscnorm
>(
ResponseType
.
OK
,
result
);
}
#
endregion
#
region
其他绩效统计
/// <summary>
/// 其他医院绩效统计
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
Route
(
"OtherPerStats/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
OtherPerStats
(
int
allotId
)
{
var
employee
=
_employeeService
.
GetAprList
(
allotId
,
_claim
.
GetUserId
());
if
(
employee
==
null
)
return
new
ApiResponse
(
ResponseType
.
OK
,
null
);
var
relust
=
_computeService
.
GetOtherPerStats
(
employee
);
return
new
ApiResponse
(
ResponseType
.
OK
,
relust
);
}
#
endregion
}
}
\ No newline at end of file
performance/Performance.Api/Controllers/EmployeeController.cs
View file @
56b80856
...
...
@@ -462,5 +462,20 @@ public ApiResponse<List<TitleValue>> GetPerforTypeDict([FromRoute] int allotId)
var
result
=
employeeService
.
GetPerforTypeDict
(
allotId
);
return
new
ApiResponse
<
List
<
TitleValue
>>(
ResponseType
.
OK
,
"绩效类型字典"
,
result
);
}
/// <summary>
/// 材料科室考核
/// </summary>
/// <returns></returns>
[
Route
(
"deptAssessment/{allotId}"
)]
[
HttpPost
]
public
ApiResponse
GetDeptAssessment
(
int
allotId
)
{
if
(
allotId
<=
0
)
return
new
ApiResponse
(
ResponseType
.
ParameterError
,
"参数AllotId无效!"
);
var
result
=
employeeService
.
GetDeptAssessment
(
allotId
);
return
new
ApiResponse
(
ResponseType
.
OK
,
result
);
}
}
}
performance/Performance.Api/Controllers/SecondAllotController.cs
View file @
56b80856
...
...
@@ -401,11 +401,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
[
HttpPost
]
public
ApiResponse
OtherList
([
FromBody
]
AgOtherRequest
request
)
{
//
var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
var
result
=
secondAllotDetails
.
GetOtherTempData
(
claimService
.
GetUserId
(),
request
.
SecondId
,
request
.
IsArchive
,
request
.
EmployeeSource
,
out
decimal
?
realAmount
);
var
result
=
secondAllotService
.
OtherList
(
request
.
SecondId
,
claimService
.
GetUserId
());
//
var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var
obj
=
new
{
header
=
secondAllotService
.
OtherListHeader
(
request
.
SecondId
,
re
alAmount
),
header
=
secondAllotService
.
OtherListHeader
(
request
.
SecondId
,
re
sult
?.
Sum
(
t
=>
t
.
RealAmount
)
),
body
=
result
,
};
return
new
ApiResponse
(
ResponseType
.
OK
,
obj
);
...
...
performance/Performance.DtoModels/Request/ComputerAvgRequest.cs
0 → 100644
View file @
56b80856
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
FluentValidation
;
namespace
Performance.DtoModels.Request
{
public
class
ComputerAvgRequest
{
public
int
Id
{
get
;
set
;
}
public
int
AllotId
{
get
;
set
;
}
public
int
SheetId
{
get
;
set
;
}
/// <summary>
/// 绩效核算人群
/// </summary>
public
string
PositionName
{
get
;
set
;
}
/// <summary>
/// 绩效总额
/// </summary>
public
decimal
TotelValue
{
get
;
set
;
}
/// <summary>
/// 人均绩效
/// </summary>
public
decimal
AvgValue
{
get
;
set
;
}
/// <summary>
/// 总人数
/// </summary>
public
decimal
TotelNumber
{
get
;
set
;
}
}
public
class
ComputerRequestValidator
:
AbstractValidator
<
ComputerAvgRequest
>
{
public
ComputerRequestValidator
()
{
RuleFor
(
x
=>
x
.
Id
).
NotNull
();
RuleFor
(
x
=>
x
.
AllotId
).
NotNull
().
GreaterThan
(
0
);
RuleFor
(
x
=>
x
.
PositionName
).
NotNull
().
NotEmpty
();
RuleFor
(
x
=>
x
.
TotelNumber
).
NotNull
();
RuleFor
(
x
=>
x
.
TotelValue
).
NotNull
();
RuleFor
(
x
=>
x
.
AvgValue
).
NotNull
();
}
}
}
performance/Performance.Services/ComputeService.cs
View file @
56b80856
...
...
@@ -9,6 +9,8 @@
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
Performance.DtoModels.Request
;
using
Performance.DtoModels.Response
;
namespace
Performance.Services
{
...
...
@@ -210,8 +212,15 @@ public List<res_baiscnorm> AllComputeAvg(int allotId, List<ComputeResponse> list
List
<
res_baiscnorm
>
avgs
=
new
List
<
res_baiscnorm
>();
var
emps
=
perforPeremployeeRepository
.
GetEntities
(
w
=>
w
.
AllotId
==
allotId
);
var
jobCategory
=
emps
?.
Select
(
w
=>
string
.
IsNullOrEmpty
(
w
.
JobCategory
)
?
"未知"
:
w
.
JobCategory
).
Distinct
()
??
new
List
<
string
>();
var
basicnorm
=
perforResbaiscnormRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
);
var
position
=
basicnorm
?.
Select
(
t
=>
string
.
IsNullOrEmpty
(
t
.
PositionName
)
?
""
:
t
.
PositionName
).
Distinct
()
??
new
List
<
string
>();
foreach
(
var
item
in
jobCategory
)
{
if
(
position
.
Contains
(
item
))
{
avgs
.
Add
(
basicnorm
.
First
(
t
=>
t
.
PositionName
==
item
));
continue
;
}
var
sumfee
=
(
from
com
in
list
join
emp
in
emps
?.
Where
(
w
=>
w
.
JobCategory
==
item
)
on
com
.
JobNumber
equals
emp
.
PersonnelNumber
...
...
@@ -1416,5 +1425,65 @@ public DeptDataDetails GetDoctorDetail(int computeId)
}
return
doctorDetails
;
}
public
res_baiscnorm
EditHospitalAvg
(
ComputerAvgRequest
request
)
{
if
(
request
.
Id
==
0
)
{
var
baiscnorm
=
Mapper
.
Map
<
res_baiscnorm
>(
request
);
if
(!
perforResbaiscnormRepository
.
Add
(
baiscnorm
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
res_baiscnorm
>(
baiscnorm
);
}
else
{
var
baiscnorm
=
perforResbaiscnormRepository
.
GetEntity
(
t
=>
t
.
ID
==
request
.
Id
);
if
(
baiscnorm
==
null
)
throw
new
PerformanceException
(
$"ID不存在 :
{
request
.
Id
}
"
);
baiscnorm
.
TotelNumber
=
request
.
TotelNumber
;
baiscnorm
.
TotelValue
=
request
.
TotelValue
;
baiscnorm
.
AvgValue
=
request
.
AvgValue
;
//var baiscnorm = Mapper.Map<res_baiscnorm>(request);
if
(!
perforResbaiscnormRepository
.
Update
(
baiscnorm
))
throw
new
PerformanceException
(
"保存失败"
);
return
Mapper
.
Map
<
res_baiscnorm
>(
baiscnorm
);
}
}
public
List
<
Dictionary
<
string
,
string
>>
GetOtherPerStats
(
List
<
per_apr_amount
>
employees
)
{
var
perForType
=
employees
.
Select
(
t
=>
t
.
PerforType
).
Distinct
();
var
doctor
=
employees
.
Select
(
t
=>
t
.
DoctorName
.
Trim
()).
Distinct
();
var
others
=
new
List
<
Dictionary
<
string
,
string
>>();
foreach
(
var
name
in
doctor
)
{
var
dicData
=
new
Dictionary
<
string
,
string
>();
var
amount
=
employees
.
First
(
t
=>
t
.
DoctorName
==
name
);
var
unitype
=
perforPeremployeeRepository
.
GetEntity
(
t
=>
t
.
DoctorName
==
name
&&
t
.
JobNumber
==
amount
.
PersonnelNumber
)?.
UnitType
;
dicData
.
Add
(
"核算单元组别"
,
unitype
??
"/"
);
dicData
.
Add
(
"核算单元"
,
amount
?.
AccountingUnit
??
""
);
dicData
.
Add
(
"工号"
,
amount
?.
PersonnelNumber
??
""
);
dicData
.
Add
(
"人员姓名"
,
amount
?.
DoctorName
??
""
);
foreach
(
var
type
in
perForType
)
{
var
emp
=
employees
.
Where
(
t
=>
t
.
PerforType
==
type
&&
t
.
DoctorName
==
name
)?.
ToList
();
if
(!
emp
.
Any
())
dicData
.
Add
(
type
,
"0"
);
else
dicData
.
Add
(
type
,
Math
.
Round
(
Convert
.
ToDecimal
(
emp
?.
First
()?.
Amount
),
0
).
ToString
());
}
var
sum
=
employees
.
Where
(
c
=>
c
.
DoctorName
==
name
)?.
Sum
(
t
=>
t
.
Amount
);
dicData
.
Add
(
"合计"
,
Math
.
Round
(
Convert
.
ToDecimal
(
sum
),
0
).
ToString
());
others
.
Add
(
dicData
);
}
return
others
;
}
}
}
performance/Performance.Services/EmployeeService.cs
View file @
56b80856
...
...
@@ -21,6 +21,7 @@ public class EmployeeService : IAutoInjection
{
private
PerforImemployeeRepository
perforImemployeeRepository
;
private
PerforPersheetRepository
perforPersheetRepository
;
private
PerforImdataRepository
perforImdataRepository
;
private
PerforPerallotRepository
perforPerallotRepository
;
private
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
;
private
PerforUserhospitalRepository
perforUserhospitalRepository
;
...
...
@@ -34,6 +35,7 @@ public class EmployeeService : IAutoInjection
public
EmployeeService
(
PerforImemployeeRepository
perforImemployeeRepository
,
PerforPersheetRepository
perforPersheetRepository
,
PerforImdataRepository
perforImdataRepository
,
PerforPerallotRepository
perforPerallotRepository
,
PerforImemployeeclinicRepository
perforImemployeeclinicRepository
,
PerforUserhospitalRepository
perforUserhospitalRepository
,
...
...
@@ -47,6 +49,7 @@ public class EmployeeService : IAutoInjection
{
this
.
perforImemployeeRepository
=
perforImemployeeRepository
;
this
.
perforPersheetRepository
=
perforPersheetRepository
;
this
.
perforImdataRepository
=
perforImdataRepository
;
this
.
perforPerallotRepository
=
perforPerallotRepository
;
this
.
perforImemployeeclinicRepository
=
perforImemployeeclinicRepository
;
this
.
perforUserhospitalRepository
=
perforUserhospitalRepository
;
...
...
@@ -637,5 +640,63 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
Value
=
t
}).
ToList
();
}
#
region
科室考核
public
List
<
string
[
]>
GetDeptAssessment
(
int
allotId
)
{
var
sheet
=
perforPersheetRepository
.
GetEntity
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetName
==
"5.4 科室材料考核2"
);
if
(
sheet
==
null
)
return
new
List
<
string
[
]>
();
var
data
=
perforImdataRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
SheetID
==
sheet
.
ID
);
var
dataNum
=
data
?.
Select
(
t
=>
t
.
RowNumber
)?.
OrderBy
(
c
=>
c
.
Value
).
Distinct
();
var
rowData
=
new
List
<
string
[
]>
();
if
(
dataNum
!=
null
)
foreach
(
var
num
in
dataNum
)
{
var
deptData
=
new
string
[
7
];
var
row
=
data
.
Where
(
t
=>
t
.
RowNumber
==
num
);
deptData
[
2
]
=
row
.
First
()?.
AccountingUnit
;
if
((
int
)
row
.
First
()?.
UnitType
==(
int
)
UnitType
.
医生组
)
deptData
[
1
]
=
"医生组"
;
else
if
((
int
)
row
.
First
()?.
UnitType
==(
int
)
UnitType
.
医技组
)
deptData
[
1
]
=
"医技组"
;
else
if
((
int
)
row
.
First
()?.
UnitType
==
(
int
)
UnitType
.
护理组
)
deptData
[
1
]
=
"护理组"
;
foreach
(
var
imData
in
row
)
{
if
(
imData
.
TypeName
==
"考核得分合计"
)
{
if
(
imData
.
CellValue
!=
null
)
deptData
[
0
]
=
Math
.
Round
((
decimal
)
imData
.
CellValue
*
100
)
+
"%"
;
}
else
if
(
imData
.
TypeName
==
"考核1"
)
{
if
(
imData
.
CellValue
!=
null
)
deptData
[
3
]
=
Math
.
Round
((
decimal
)
imData
.
CellValue
*
100
)
+
"%"
;
}
else
if
(
imData
.
TypeName
==
"考核2"
)
{
if
(
imData
.
CellValue
!=
null
)
deptData
[
4
]
=
Math
.
Round
((
decimal
)
imData
.
CellValue
*
100
)
+
"%"
;
}
else
if
(
imData
.
TypeName
==
"考核三"
)
{
if
(
imData
.
CellValue
!=
null
)
deptData
[
5
]
=
Math
.
Round
((
decimal
)
imData
.
CellValue
*
100
)
+
"%"
;
}
else
if
(
imData
.
TypeName
==
"考核四"
)
if
(
imData
.
CellValue
!=
null
)
deptData
[
6
]
=
Math
.
Round
((
decimal
)
imData
.
CellValue
*
100
)
+
"%"
;
}
rowData
.
Add
(
deptData
);
}
return
rowData
;
}
#
endregion
}
}
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