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
2177d123
Commit
2177d123
authored
Mar 25, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取添加日志
parent
9169e6e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
33 deletions
+45
-33
performance/Performance.Api/Controllers/TemplateController.cs
+36
-31
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
+5
-1
performance/Performance.Services/ExtractExcelService/QueryService.cs
+4
-1
No files found.
performance/Performance.Api/Controllers/TemplateController.cs
View file @
2177d123
...
@@ -233,39 +233,40 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
...
@@ -233,39 +233,40 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
// string email = claim.GetUserClaim(JwtClaimTypes.Mail);
// string email = claim.GetUserClaim(JwtClaimTypes.Mail);
string
email
=
""
;
string
email
=
""
;
if
(
isSingle
)
//
if (isSingle)
{
//
{
logger
.
LogInformation
(
"同一项目中进行提取"
);
logger
.
LogInformation
(
"同一项目中进行提取"
);
Task
.
Run
(()
=>
Task
.
Run
(()
=>
{
Thread
.
Sleep
(
1000
);
using
(
var
scope
=
serviceScopeFactory
.
CreateScope
())
{
var
scopedServices
=
scope
.
ServiceProvider
.
GetRequiredService
<
ExtractService
>();
logger
.
LogInformation
(
"提取绩效数据参数:"
+
JsonHelper
.
Serialize
(
new
{
allotId
=
allot
.
ID
,
hospitalId
=
allot
.
HospitalId
}));
string
extractFilePath
=
scopedServices
.
Main
(
allot
.
ID
,
allot
.
HospitalId
,
email
,
allot
.
ID
.
ToString
(),
filePath
,
isSingle
);
}
});
}
else
{
{
var
http
=
new
RestSharpHelper
();
Thread
.
Sleep
(
1000
);
var
extractUrl
=
http
.
SetUrl
(
url
.
HttpPost
,
"extract/extract"
);
using
(
var
scope
=
serviceScopeFactory
.
CreateScope
())
var
obj
=
new
ExtractRequest
{
{
AllotId
=
request
.
AllotId
,
var
scopedServices
=
scope
.
ServiceProvider
.
GetRequiredService
<
ExtractService
>();
HospitalId
=
request
.
HospitalId
,
logger
.
LogInformation
(
"提取绩效数据参数:"
+
JsonHelper
.
Serialize
(
new
{
allotId
=
allot
.
ID
,
hospitalId
=
allot
.
HospitalId
}));
Email
=
email
string
extractFilePath
=
scopedServices
.
Main
(
allot
.
ID
,
allot
.
HospitalId
,
email
,
allot
.
ID
.
ToString
(),
filePath
,
isSingle
);
};
}
});
string
json
=
JsonHelper
.
Serialize
(
obj
);
//}
logger
.
LogInformation
(
"提取绩效数据参数:"
+
json
);
//else
var
parameter
=
JsonHelper
.
Deserialize
<
Dictionary
<
string
,
object
>>(
json
);
//{
var
restRequest
=
string
.
IsNullOrEmpty
(
filePath
)
?
http
.
CreatePostRequest
(
json
)
:
http
.
CreateFileRequest
(
new
string
[]
{
filePath
},
parameter
);
// logger.LogInformation("多项目进行提取");
Task
.
Run
(()
=>
http
.
GetResponse
(
extractUrl
,
restRequest
));
// var http = new RestSharpHelper();
}
// var extractUrl = http.SetUrl(url.HttpPost, "extract/extract");
// var obj = new ExtractRequest
// {
// AllotId = request.AllotId,
// HospitalId = request.HospitalId,
// Email = email
// };
// string json = JsonHelper.Serialize(obj);
// logger.LogInformation("提取绩效数据参数:" + json);
// var parameter = JsonHelper.Deserialize<Dictionary<string, object>>(json);
// var restRequest = string.IsNullOrEmpty(filePath) ? http.CreatePostRequest(json) : http.CreateFileRequest(new string[] { filePath }, parameter);
// Task.Run(() => http.GetResponse(extractUrl, restRequest));
//}
return
new
ApiResponse
(
ResponseType
.
OK
,
"HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!"
,
new
{
IsExtracting
=
false
});
return
new
ApiResponse
(
ResponseType
.
OK
,
"HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!"
,
new
{
IsExtracting
=
false
});
}
}
...
@@ -441,7 +442,11 @@ public ApiResponse Schedule([FromBody] log_dbug request)
...
@@ -441,7 +442,11 @@ public ApiResponse Schedule([FromBody] log_dbug request)
var
allot
=
allotService
.
GetAllot
(
request
.
AllotID
.
Value
);
var
allot
=
allotService
.
GetAllot
(
request
.
AllotID
.
Value
);
if
(
null
==
allot
)
if
(
null
==
allot
)
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
throw
new
PerformanceException
(
"当前绩效记录不存在"
);
var
ratio
=
allotService
.
AllotLog
(
allot
,
3
)?.
Max
(
t
=>
ConvertHelper
.
TryDecimal
(
t
.
Message
))
??
0
;
var
logs
=
allotService
.
AllotLog
(
allot
,
3
);
var
ratio
=
0
m
;
if
(
logs
!=
null
&&
logs
.
Any
())
ratio
=
logs
.
Max
(
t
=>
ConvertHelper
.
TryDecimal
(
t
.
Message
));
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
ratio
});
return
new
ApiResponse
(
ResponseType
.
OK
,
new
{
ratio
});
}
}
...
...
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
View file @
2177d123
...
@@ -57,7 +57,11 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi
...
@@ -57,7 +57,11 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi
try
try
{
{
var
configs
=
hospitalconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
configs
=
hospitalconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
configs
==
null
||
!
configs
.
Any
())
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
if
(
configs
==
null
||
!
configs
.
Any
())
{
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
"医院未配置绩效抽取信息"
,
isSingle
:
isSingle
);
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
}
var
types
=
extypeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
new
int
[]
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OnlyExtract
}.
Contains
(
t
.
Source
));
var
types
=
extypeRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
&&
new
int
[]
{
(
int
)
SheetType
.
Employee
,
(
int
)
SheetType
.
OnlyExtract
}.
Contains
(
t
.
Source
));
if
(
types
!=
null
&&
types
.
Any
())
if
(
types
!=
null
&&
types
.
Any
())
...
...
performance/Performance.Services/ExtractExcelService/QueryService.cs
View file @
2177d123
...
@@ -72,7 +72,10 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
...
@@ -72,7 +72,10 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
try
try
{
{
var
configs
=
hosconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
var
configs
=
hosconfigRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
configs
==
null
||
!
configs
.
Any
())
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
if
(
configs
==
null
||
!
configs
.
Any
())
{
throw
new
Exception
(
"医院未配置绩效抽取信息"
);
}
dict
=
new
Dictionary
<
ExDataDict
,
object
>
dict
=
new
Dictionary
<
ExDataDict
,
object
>
{
{
...
...
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