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
6b20f279
Commit
6b20f279
authored
May 10, 2023
by
ruyun.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取执行失败重试3次
parent
e285003f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
performance/Performance.Services/CustomExtractService.cs
+12
-9
No files found.
performance/Performance.Services/CustomExtractService.cs
View file @
6b20f279
using
Dapper
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
Dapper
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
NPOI.SS.UserModel
;
using
Performance.DtoModels
;
using
Performance.DtoModels.AppSettings
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
using
Performance.Repository
;
using
Performance.Services.ExtractExcelService
;
using
Performance.Services.Queues
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
namespace
Performance.Services
{
...
...
@@ -263,6 +262,9 @@ private void WriteDataToFile(int userId, per_allot allot, List<cust_script> scri
/// <returns></returns>
public
IEnumerable
<
dynamic
>
QueryData
(
sys_hospitalconfig
config
,
string
execsql
,
Dictionary
<
string
,
string
>
parameters
)
{
int
retryCount
=
0
;
while
(
retryCount
<
2
)
{
try
{
using
(
var
connection
=
ConnectionBuilder
.
Create
((
DatabaseType
)
config
.
DataBaseType
,
config
.
DbSource
,
config
.
DbName
,
config
.
DbUser
,
config
.
DbPassword
))
...
...
@@ -275,13 +277,14 @@ public IEnumerable<dynamic> QueryData(sys_hospitalconfig config, string execsql,
_logger
.
LogInformation
(
$"提取绩效数据SQL脚本
{
execsql
}
"
);
var
result
=
connection
.
Query
(
execsql
,
commandTimeout
:
20000
);
_logger
.
LogInformation
(
$"提取绩效数据执行脚本获取数据
{
result
?.
Count
()
??
0
}
条记录"
);
return
result
;
}
}
catch
(
Exception
ex
)
{
_logger
.
LogError
(
$"提取绩效数据SQL脚本查询错误:
{
execsql
}
错误原因:
{
ex
}
"
);
_logger
.
LogError
(
$"重试:
{
retryCount
}
;提取绩效数据SQL脚本查询错误:
{
execsql
}
错误原因:
{
ex
}
"
);
retryCount
++;
}
}
return
null
;
}
...
...
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