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
3bd71cea
Commit
3bd71cea
authored
Nov 27, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
任务开始前检查配置
parent
8b007359
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
performance/Performance.Api/Controllers/ModExtractController.cs
+6
-0
performance/Performance.Services/CustomExtractService.cs
+14
-1
No files found.
performance/Performance.Api/Controllers/ModExtractController.cs
View file @
3bd71cea
...
...
@@ -18,6 +18,7 @@ public class ModExtractController : Controller
{
private
readonly
ClaimService
_claim
;
private
readonly
AllotService
_allotService
;
private
readonly
CustomExtractService
_extractService
;
private
readonly
IServiceScopeFactory
_serviceScopeFactory
;
private
readonly
IHubNotificationQueue
_notificationQueue
;
private
readonly
IBackgroundTaskQueue
_backgroundTaskQueue
;
...
...
@@ -25,12 +26,14 @@ public class ModExtractController : Controller
public
ModExtractController
(
ClaimService
claim
,
AllotService
allotService
,
CustomExtractService
extractService
,
IServiceScopeFactory
serviceScopeFactory
,
IHubNotificationQueue
notificationQueue
,
IBackgroundTaskQueue
backgroundTaskQueue
)
{
_claim
=
claim
;
_allotService
=
allotService
;
_extractService
=
extractService
;
_serviceScopeFactory
=
serviceScopeFactory
;
_notificationQueue
=
notificationQueue
;
_backgroundTaskQueue
=
backgroundTaskQueue
;
...
...
@@ -40,6 +43,9 @@ public class ModExtractController : Controller
public
ApiResponse
CustomExtract
(
int
allotId
)
{
var
userId
=
_claim
.
GetUserId
();
if
(!
_extractService
.
CheckConfigScript
(
userId
,
allotId
))
return
new
ApiResponse
(
ResponseType
.
Fail
,
"配置信息错误"
);
_backgroundTaskQueue
.
QueueBackgroundWorkItem
(
async
token
=>
{
using
(
var
scope
=
_serviceScopeFactory
.
CreateScope
())
...
...
performance/Performance.Services/CustomExtractService.cs
View file @
3bd71cea
...
...
@@ -43,6 +43,19 @@ public class CustomExtractService : IAutoInjection
_perforHospitalconfigRepository
=
perforHospitalconfigRepository
;
_perforcustscriptRepository
=
perforcustscriptRepository
;
}
public
bool
CheckConfigScript
(
int
userId
,
int
allotId
)
{
var
allot
=
_perallotRepository
.
GetEntity
(
w
=>
w
.
ID
==
allotId
)
??
throw
new
PerformanceException
(
"绩效ID无效"
);
var
scripts
=
_perforcustscriptRepository
.
GetEntities
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
IsEnable
==
1
);
scripts
=
(
IsSecondAdmin
(
userId
))
?
scripts
?.
Where
(
w
=>
w
.
IsSecondAllot
==
1
).
ToList
()
:
scripts
?.
Where
(
w
=>
w
.
IsOnceAllot
==
1
).
ToList
();
return
scripts
?.
Count
()
>
0
;
}
public
bool
ExtractData
(
int
userId
,
int
allotId
,
out
string
resultFilePath
)
{
...
...
@@ -59,7 +72,7 @@ public bool ExtractData(int userId, int allotId, out string resultFilePath)
?
scripts
?.
Where
(
w
=>
w
.
IsSecondAllot
==
1
).
ToList
()
:
scripts
?.
Where
(
w
=>
w
.
IsOnceAllot
==
1
).
ToList
();
if
(
scripts
==
null
&&
scripts
.
Count
>
0
)
if
(
scripts
==
null
||
scripts
.
Count
==
0
)
{
result
=
false
;
return
result
;
...
...
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