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
7dfac4e2
Commit
7dfac4e2
authored
Mar 02, 2021
by
钟博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人均界面新增修改
parent
9412cbcf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletions
+59
-1
performance/Performance.Api/Controllers/ComputeController.cs
+25
-1
performance/Performance.Services/ComputeService.cs
+34
-0
No files found.
performance/Performance.Api/Controllers/ComputeController.cs
View file @
7dfac4e2
...
...
@@ -12,6 +12,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Performance.DtoModels.Request
;
namespace
Performance.Api.Controllers
{
...
...
@@ -252,7 +253,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>
...
...
@@ -352,5 +353,27 @@ 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
}
}
\ No newline at end of file
performance/Performance.Services/ComputeService.cs
View file @
7dfac4e2
...
...
@@ -9,6 +9,7 @@
using
System.Linq.Expressions
;
using
System.Text
;
using
System.Text.RegularExpressions
;
using
Performance.DtoModels.Request
;
namespace
Performance.Services
{
...
...
@@ -210,8 +211,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
...
...
@@ -1412,5 +1420,31 @@ 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
);
}
}
}
}
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