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
0c8fea5b
Commit
0c8fea5b
authored
Jan 18, 2021
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
院领导绩效测算,渝北院领导特殊
parent
90175881
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
16 deletions
+85
-16
performance/Performance.Api/Controllers/AllotController.cs
+21
-13
performance/Performance.Api/wwwroot/Performance.Api.xml
+7
-0
performance/Performance.DtoModels/Request/RecalculationRequest.cs
+8
-0
performance/Performance.Services/AllotService.cs
+47
-0
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+2
-3
No files found.
performance/Performance.Api/Controllers/AllotController.cs
View file @
0c8fea5b
using
FluentValidation.AspNetCore
;
using
FluentValidation.AspNetCore
;
using
Hangfire
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http
;
using
Microsoft.AspNetCore.Http.Internal
;
using
Microsoft.AspNetCore.Http.Internal
;
...
@@ -7,7 +6,6 @@
...
@@ -7,7 +6,6 @@
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Performance.DtoModels
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Infrastructure
;
using
Performance.Services
;
using
Performance.Services
;
using
Performance.Services.AllotCompute
;
using
Performance.Services.AllotCompute
;
...
@@ -16,7 +14,6 @@
...
@@ -16,7 +14,6 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
...
@@ -27,19 +24,17 @@ namespace Performance.Api.Controllers
...
@@ -27,19 +24,17 @@ namespace Performance.Api.Controllers
public
class
AllotController
:
Controller
public
class
AllotController
:
Controller
{
{
private
AllotService
_allotService
;
private
AllotService
_allotService
;
private
readonly
ResultComputeService
resultComputeService
;
private
ResultComputeService
_resultComputeService
;
private
HospitalService
_hospitalService
;
private
ConfigService
_configService
;
private
ConfigService
_configService
;
private
IHostingEnvironment
_evn
;
private
IHostingEnvironment
_evn
;
private
ILogger
<
AllotController
>
_logger
;
private
ILogger
<
AllotController
>
_logger
;
private
ClaimService
_claim
;
private
ClaimService
_claim
;
private
readonly
LogManageService
logManageService
;
private
LogManageService
_
logManageService
;
private
IBackgroundTaskQueue
_backgroundTaskQueue
;
private
IBackgroundTaskQueue
_backgroundTaskQueue
;
private
IServiceScopeFactory
_serviceScopeFactory
;
private
IServiceScopeFactory
_serviceScopeFactory
;
public
AllotController
(
AllotService
allotService
,
public
AllotController
(
AllotService
allotService
,
ResultComputeService
resultComputeService
,
ResultComputeService
resultComputeService
,
HospitalService
hospitalService
,
ConfigService
configService
,
ConfigService
configService
,
ILogger
<
AllotController
>
logger
,
ILogger
<
AllotController
>
logger
,
IHostingEnvironment
evn
,
IHostingEnvironment
evn
,
...
@@ -49,12 +44,11 @@ public class AllotController : Controller
...
@@ -49,12 +44,11 @@ public class AllotController : Controller
LogManageService
logManageService
)
LogManageService
logManageService
)
{
{
_allotService
=
allotService
;
_allotService
=
allotService
;
this
.
resultComputeService
=
resultComputeService
;
_resultComputeService
=
resultComputeService
;
_hospitalService
=
hospitalService
;
_logger
=
logger
;
_logger
=
logger
;
_evn
=
evn
;
_evn
=
evn
;
_claim
=
claim
;
_claim
=
claim
;
this
.
logManageService
=
logManageService
;
_
logManageService
=
logManageService
;
_configService
=
configService
;
_configService
=
configService
;
_backgroundTaskQueue
=
backgroundTaskQueue
;
_backgroundTaskQueue
=
backgroundTaskQueue
;
_serviceScopeFactory
=
serviceScopeFactory
;
_serviceScopeFactory
=
serviceScopeFactory
;
...
@@ -190,7 +184,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
...
@@ -190,7 +184,7 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
if
(
allot
.
States
==
(
int
)
AllotStates
.
Wait
)
if
(
allot
.
States
==
(
int
)
AllotStates
.
Wait
)
return
new
ApiResponse
(
ResponseType
.
OK
,
"当前绩效正在等待生成"
);
return
new
ApiResponse
(
ResponseType
.
OK
,
"当前绩效正在等待生成"
);
logManageService
.
WriteMsg
(
"生成绩效准备中"
,
$"准备生成
{
allot
.
Year
}
-
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月份绩效,请稍等!"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
_
logManageService
.
WriteMsg
(
"生成绩效准备中"
,
$"准备生成
{
allot
.
Year
}
-
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月份绩效,请稍等!"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
Wait
,
EnumHelper
.
GetDescription
(
AllotStates
.
Wait
),
allot
.
Generate
);
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
Wait
,
EnumHelper
.
GetDescription
(
AllotStates
.
Wait
),
allot
.
Generate
);
if
(
_evn
.
IsEnvironment
(
"Localhost"
))
if
(
_evn
.
IsEnvironment
(
"Localhost"
))
{
{
...
@@ -211,13 +205,27 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
...
@@ -211,13 +205,27 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody] A
});
});
}
}
logManageService
.
WriteMsg
(
"等待绩效生成"
,
$"等待绩效生成
{
allot
.
Year
}
-
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月份绩效!"
,
1
,
allot
.
ID
,
"ReceiveMessage"
);
_
logManageService
.
WriteMsg
(
"等待绩效生成"
,
$"等待绩效生成
{
allot
.
Year
}
-
{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
月份绩效!"
,
1
,
allot
.
ID
,
"ReceiveMessage"
);
//_allotService.Generate(allot, email);
//_allotService.Generate(allot, email);
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
////BackgroundJob.Enqueue(() => _allotService.Generate(allot, email));
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
/// <summary>
/// <summary>
/// 重新计算院领导绩效
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
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>
/// </summary>
/// <param name="request"></param>
/// <param name="request"></param>
...
@@ -296,7 +304,7 @@ public ApiResponse Issued([FromBody] AllotRequest request)
...
@@ -296,7 +304,7 @@ public ApiResponse Issued([FromBody] AllotRequest request)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
_allotService
.
UpdateAllotStates
(
allot
.
ID
,
(
int
)
AllotStates
.
GenerateSucceed
,
EnumHelper
.
GetDescription
(
AllotStates
.
GenerateSucceed
));
// 科室下发
// 科室下发
resultComputeService
.
GenerateSecondAllot
(
allot
);
_
resultComputeService
.
GenerateSecondAllot
(
allot
);
return
new
ApiResponse
(
ResponseType
.
OK
);
return
new
ApiResponse
(
ResponseType
.
OK
);
}
}
...
...
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
0c8fea5b
...
@@ -184,6 +184,13 @@
...
@@ -184,6 +184,13 @@
<param
name=
"request"
></param>
<param
name=
"request"
></param>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Recalculation(Performance.DtoModels.RecalculationRequest)"
>
<summary>
重新计算院领导绩效
</summary>
<param
name=
"request"
></param>
<returns></returns>
</member>
<member
name=
"M:Performance.Api.Controllers.AllotController.Pigeonhole(Performance.DtoModels.AllotRequest)"
>
<member
name=
"M:Performance.Api.Controllers.AllotController.Pigeonhole(Performance.DtoModels.AllotRequest)"
>
<summary>
<summary>
归档绩效记录
归档绩效记录
...
...
performance/Performance.DtoModels/Request/RecalculationRequest.cs
0 → 100644
View file @
0c8fea5b
namespace
Performance.DtoModels
{
public
class
RecalculationRequest
{
public
int
AllotId
{
get
;
set
;
}
public
decimal
?
Money
{
get
;
set
;
}
}
}
performance/Performance.Services/AllotService.cs
View file @
0c8fea5b
...
@@ -32,6 +32,9 @@ public class AllotService : IAutoInjection
...
@@ -32,6 +32,9 @@ public class AllotService : IAutoInjection
private
PerforPerallotRepository
_allotRepository
;
private
PerforPerallotRepository
_allotRepository
;
private
IEmailService
emailService
;
private
IEmailService
emailService
;
private
readonly
IOptions
<
Application
>
options
;
private
readonly
IOptions
<
Application
>
options
;
private
readonly
ComputeDirector
_computeDirector
;
private
readonly
PerforRescomputeRepository
_perforRescomputeRepository
;
private
readonly
PerforImemployeeRepository
_perforImEmployeeRepository
;
private
PerforPeragainallotRepository
_againallotRepository
;
private
PerforPeragainallotRepository
_againallotRepository
;
private
PerforLogcheckRepository
perforLogcheckRepository
;
private
PerforLogcheckRepository
perforLogcheckRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
private
readonly
PerforHospitalRepository
perforHospitalRepository
;
...
@@ -59,6 +62,9 @@ public class AllotService : IAutoInjection
...
@@ -59,6 +62,9 @@ public class AllotService : IAutoInjection
IHostingEnvironment
evn
,
ILogger
<
AllotService
>
logger
,
IHostingEnvironment
evn
,
ILogger
<
AllotService
>
logger
,
IEmailService
emailService
,
IEmailService
emailService
,
IOptions
<
Application
>
options
,
IOptions
<
Application
>
options
,
ComputeDirector
computeDirector
,
PerforRescomputeRepository
perforRescomputeRepository
,
PerforImemployeeRepository
perforImEmployeeRepository
,
PerforPeragainallotRepository
againallotRepository
,
PerforPeragainallotRepository
againallotRepository
,
PerforLogcheckRepository
perforLogcheckRepository
,
PerforLogcheckRepository
perforLogcheckRepository
,
PerforHospitalRepository
perforHospitalRepository
,
PerforHospitalRepository
perforHospitalRepository
,
...
@@ -83,6 +89,9 @@ public class AllotService : IAutoInjection
...
@@ -83,6 +89,9 @@ public class AllotService : IAutoInjection
this
.
resultComputeService
=
resultComputeService
;
this
.
resultComputeService
=
resultComputeService
;
this
.
emailService
=
emailService
;
this
.
emailService
=
emailService
;
this
.
options
=
options
;
this
.
options
=
options
;
_computeDirector
=
computeDirector
;
_perforRescomputeRepository
=
perforRescomputeRepository
;
_perforImEmployeeRepository
=
perforImEmployeeRepository
;
this
.
configService
=
configService
;
this
.
configService
=
configService
;
this
.
logdbug
=
logdbug
;
this
.
logdbug
=
logdbug
;
this
.
perforresreservedRepository
=
perforresreservedRepository
;
this
.
perforresreservedRepository
=
perforresreservedRepository
;
...
@@ -451,6 +460,44 @@ public void Generate(per_allot allot, string mail)
...
@@ -451,6 +460,44 @@ public void Generate(per_allot allot, string mail)
}
}
/// <summary>
/// <summary>
/// 重新计算院领导绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="money"></param>
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>
/// </summary>
/// <param name="allot"></param>
/// <param name="allot"></param>
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
0c8fea5b
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
namespace
Performance.Services.ExtractExcelService
namespace
Performance.Services.ExtractExcelService
{
{
...
@@ -21,7 +20,7 @@ public class ExtractService : IAutoInjection
...
@@ -21,7 +20,7 @@ public class ExtractService : IAutoInjection
private
readonly
PerSheetService
perSheetService
;
private
readonly
PerSheetService
perSheetService
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforHospitalRepository
hospitalRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
PerforPerallotRepository
perallotRepository
;
private
readonly
Perfor
C
ollectdataRepository
collectdataRepository
;
private
readonly
Perfor
c
ollectdataRepository
collectdataRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
private
readonly
PerforPeremployeeRepository
peremployeeRepository
;
public
ExtractService
(
public
ExtractService
(
...
@@ -32,7 +31,7 @@ public class ExtractService : IAutoInjection
...
@@ -32,7 +31,7 @@ public class ExtractService : IAutoInjection
PerSheetService
perSheetService
,
PerSheetService
perSheetService
,
PerforHospitalRepository
hospitalRepository
,
PerforHospitalRepository
hospitalRepository
,
PerforPerallotRepository
perallotRepository
,
PerforPerallotRepository
perallotRepository
,
Perfor
C
ollectdataRepository
collectdataRepository
,
Perfor
c
ollectdataRepository
collectdataRepository
,
PerforPeremployeeRepository
peremployeeRepository
PerforPeremployeeRepository
peremployeeRepository
)
)
{
{
...
...
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