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
66b19ddc
Commit
66b19ddc
authored
Sep 18, 2020
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入报表数据
parent
26ddecb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
performance/Performance.Services/DFExtractService.cs
+17
-1
No files found.
performance/Performance.Services/DFExtractService.cs
View file @
66b19ddc
...
@@ -612,6 +612,7 @@ private List<ex_result> QueryData(sys_hospitalconfig config, per_allot allot, st
...
@@ -612,6 +612,7 @@ private List<ex_result> QueryData(sys_hospitalconfig config, per_allot allot, st
/// <param name="configs"></param>
/// <param name="configs"></param>
private
void
ImportData
(
per_allot
allot
,
List
<
sys_hospitalconfig
>
configs
)
private
void
ImportData
(
per_allot
allot
,
List
<
sys_hospitalconfig
>
configs
)
{
{
logger
.
LogDebug
(
$"从HIS抽取报表数据"
);
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>
Dictionary
<
string
,
object
>
pairs
=
new
Dictionary
<
string
,
object
>
{
{
{
"@allotid"
,
allot
.
ID
},
{
"@allotid"
,
allot
.
ID
},
...
@@ -622,14 +623,19 @@ private void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
...
@@ -622,14 +623,19 @@ private void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
var
imports
=
repimportconfigRepository
.
GetEntities
(
w
=>
w
.
ScriptType
==
1
);
var
imports
=
repimportconfigRepository
.
GetEntities
(
w
=>
w
.
ScriptType
==
1
);
if
(
imports
==
null
||
!
imports
.
Any
())
return
;
if
(
imports
==
null
||
!
imports
.
Any
())
return
;
logger
.
LogDebug
(
$"imports
{
JsonHelper
.
Serialize
(
imports
)}
"
);
foreach
(
var
import
in
imports
)
foreach
(
var
import
in
imports
)
{
{
var
conf
=
configs
.
FirstOrDefault
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
Id
==
import
.
ConfigId
);
var
conf
=
configs
.
FirstOrDefault
(
w
=>
w
.
HospitalId
==
allot
.
HospitalId
&&
w
.
Id
==
import
.
ConfigId
);
if
(
conf
!=
null
)
if
(
conf
!=
null
)
{
{
logger
.
LogDebug
(
$"conf
{
JsonHelper
.
Serialize
(
conf
)}
"
);
var
timeRanges
=
import
.
TimeRange
.
SplitRemoveEmpty
(
","
);
var
timeRanges
=
import
.
TimeRange
.
SplitRemoveEmpty
(
","
);
if
(
timeRanges
==
null
||
!
timeRanges
.
Any
())
continue
;
if
(
timeRanges
==
null
||
!
timeRanges
.
Any
())
continue
;
logger
.
LogDebug
(
$" timeRanges
{
JsonHelper
.
Serialize
(
timeRanges
)}
"
);
foreach
(
var
item
in
timeRanges
)
foreach
(
var
item
in
timeRanges
)
{
{
if
(
item
==
"1"
)
if
(
item
==
"1"
)
...
@@ -649,11 +655,21 @@ private void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
...
@@ -649,11 +655,21 @@ private void ImportData(per_allot allot, List<sys_hospitalconfig> configs)
}
}
try
try
{
{
logger
.
LogDebug
(
$" pairs
{
JsonHelper
.
Serialize
(
pairs
)}
"
);
DatabaseType
type
=
(
DatabaseType
)
conf
.
DataBaseType
;
DatabaseType
type
=
(
DatabaseType
)
conf
.
DataBaseType
;
var
connection
=
ConnectionBuilder
.
Create
(
type
,
conf
.
DbSource
,
conf
.
DbName
,
conf
.
DbUser
,
conf
.
DbPassword
);
var
connection
=
ConnectionBuilder
.
Create
(
type
,
conf
.
DbSource
,
conf
.
DbName
,
conf
.
DbUser
,
conf
.
DbPassword
);
var
data
=
connection
.
Query
(
import
.
ImportScript
,
new
DynamicParameters
(
pairs
),
commandTimeout
:
60
*
60
);
foreach
(
var
key
in
pairs
.
Keys
)
{
import
.
ImportScript
=
import
.
ImportScript
.
Replace
(
key
,
pairs
[
key
].
ToString
());
}
logger
.
LogDebug
(
$"执行导入报表SQL:
{
import
.
TableName
}
--
{
import
.
ImportScript
}
"
);
logger
.
LogDebug
(
$"执行导入报表SQL:
{
import
.
TableName
}
--
{
import
.
ImportScript
}
"
);
logger
.
LogDebug
(
$"执行导入报表SQL参数:
{
import
.
TableName
}
--
{
JsonHelper
.
Serialize
(
pairs
)}
"
);
logger
.
LogDebug
(
$"执行导入报表SQL参数:
{
import
.
TableName
}
--
{
JsonHelper
.
Serialize
(
pairs
)}
"
);
var
data
=
connection
.
Query
(
import
.
ImportScript
,
new
DynamicParameters
(
pairs
),
commandTimeout
:
60
*
60
);
logger
.
LogDebug
(
$"执行导入报表SQL查询完成 --
{
data
.
Count
()}
"
);
perforPerallotRepository
.
ImportData
(
import
,
pairs
,
data
);
perforPerallotRepository
.
ImportData
(
import
,
pairs
,
data
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
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