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
8559f6ce
Commit
8559f6ce
authored
Mar 10, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
渝北院领导计算 代码丢失找回
parent
e6ede3ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
+59
-0
performance/Performance.Api/Controllers/AllotController.cs
+9
-0
performance/Performance.DtoModels/Request/RecalculationRequest.cs
+8
-0
performance/Performance.Services/AllotService.cs
+42
-0
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
8559f6ce
...
...
@@ -217,6 +217,15 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
return
new
ApiResponse
(
ResponseType
.
OK
);
}
[
Route
(
"recalculation"
)]
[
HttpPost
]
public
ApiResponse
Recalculation
([
FromBody
]
RecalculationRequest
request
)
{
if
(
request
.
Money
.
HasValue
&&
request
.
Money
.
Value
>
0
)
_allotService
.
Recalculation
(
request
.
AllotId
,
request
.
Money
.
Value
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
/// <summary>
/// 归档绩效记录
/// </summary>
...
...
performance/Performance.DtoModels/Request/RecalculationRequest.cs
0 → 100644
View file @
8559f6ce
namespace
Performance.DtoModels
{
public
class
RecalculationRequest
{
public
int
AllotId
{
get
;
set
;
}
public
decimal
?
Money
{
get
;
set
;
}
}
}
performance/Performance.Services/AllotService.cs
View file @
8559f6ce
...
...
@@ -33,6 +33,9 @@ public class AllotService : IAutoInjection
private
PerforPerallotRepository
_allotRepository
;
private
IEmailService
emailService
;
private
readonly
IOptions
<
Application
>
options
;
private
readonly
ComputeDirector
_computeDirector
;
private
readonly
PerforRescomputeRepository
_perforRescomputeRepository
;
private
readonly
PerforImemployeeRepository
_perforImEmployeeRepository
;
private
PerforPeragainallotRepository
_againallotRepository
;
private
PerforLogcheckRepository
perforLogcheckRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
...
...
@@ -60,6 +63,9 @@ public class AllotService : IAutoInjection
IHostingEnvironment
evn
,
ILogger
<
AllotService
>
logger
,
IEmailService
emailService
,
IOptions
<
Application
>
options
,
ComputeDirector
computeDirector
,
PerforRescomputeRepository
perforRescomputeRepository
,
PerforImemployeeRepository
perforImEmployeeRepository
,
PerforPeragainallotRepository
againallotRepository
,
PerforLogcheckRepository
perforLogcheckRepository
,
PerforHospitalRepository
perforHospitalRepository
,
...
...
@@ -84,6 +90,9 @@ public class AllotService : IAutoInjection
this
.
resultComputeService
=
resultComputeService
;
this
.
emailService
=
emailService
;
this
.
options
=
options
;
_computeDirector
=
computeDirector
;
_perforRescomputeRepository
=
perforRescomputeRepository
;
_perforImEmployeeRepository
=
perforImEmployeeRepository
;
this
.
configService
=
configService
;
this
.
logdbug
=
logdbug
;
this
.
perforresreservedRepository
=
perforresreservedRepository
;
...
...
@@ -453,6 +462,39 @@ public void Generate(per_allot allot, string mail)
}
}
public
void
Recalculation
(
int
allotId
,
decimal
money
)
{
var
allot
=
_allotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
);
var
empolyeeList
=
_perforImEmployeeRepository
.
GetEntities
(
t
=>
t
.
AllotID
==
allotId
&&
t
.
AccountType
==
AccountUnitType
.
行政高层
.
ToString
());
if
(
empolyeeList
==
null
)
return
;
var
computeEmployees
=
Mapper
.
Map
<
List
<
ComputeEmployee
>>(
empolyeeList
);
computeEmployees
.
ForEach
(
w
=>
w
.
FitPeopleValue
=
money
);
List
<
res_baiscnorm
>
baiscnormList
=
new
List
<
res_baiscnorm
>();
var
computResult
=
_computeDirector
.
Compute
(
computeEmployees
,
allot
,
baiscnormList
);
if
(
computResult
==
null
)
return
;
baiscnormList
=
baiscNormService
.
ComputeOtherAvg
(
baiscnormList
,
computResult
,
empolyeeList
);
var
historyRescompute
=
_perforRescomputeRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allotId
&&
w
.
AccountType
==
AccountUnitType
.
行政高层
.
ToString
());
if
(
historyRescompute
!=
null
&&
historyRescompute
.
Any
())
_perforRescomputeRepository
.
RemoveRange
(
historyRescompute
.
ToArray
());
var
computes
=
Mapper
.
Map
<
List
<
res_compute
>>(
computResult
);
computes
.
ForEach
(
t
=>
t
.
AllotID
=
allot
.
ID
);
_perforRescomputeRepository
.
AddRange
(
computes
.
ToArray
());
var
names
=
baiscnormList
.
Select
(
b
=>
b
.
PositionName
).
ToList
();
var
historyResbaiscnorm
=
perforResbaiscnormRepository
.
GetEntities
(
w
=>
w
.
AllotID
==
allotId
&&
names
.
Contains
(
w
.
PositionName
));
if
(
historyResbaiscnorm
!=
null
&&
historyResbaiscnorm
.
Any
())
perforResbaiscnormRepository
.
RemoveRange
(
historyResbaiscnorm
.
ToArray
());
perforResbaiscnormRepository
.
AddRange
(
Mapper
.
Map
<
res_baiscnorm
[
]>
(
baiscnormList
));
}
/// <summary>
/// 发送邮件
/// </summary>
...
...
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