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
7835241b
Commit
7835241b
authored
Mar 16, 2022
by
ruyun.zhang@suvalue.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临洮提取
parent
04be0535
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
8 deletions
+31
-8
performance/Performance.Api/wwwroot/Performance.Api.xml
+5
-0
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
+10
-3
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+1
-1
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+3
-0
performance/Performance.Services/ExtractExcelService/QueryService.cs
+12
-4
No files found.
performance/Performance.Api/wwwroot/Performance.Api.xml
View file @
7835241b
...
...
@@ -2165,6 +2165,11 @@
<param
name=
"query"
></param>
<returns></returns>
</member>
<member
name=
"T:Performance.Api.ClearLoggerJob"
>
<summary>
删除历史日志
</summary>
</member>
<member
name=
"T:Performance.Api.ExpirationLimitMiddleware"
>
<summary>
过期限制
...
...
performance/Performance.Services/ExtractExcelService/DictionaryService.cs
View file @
7835241b
...
...
@@ -91,13 +91,16 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi
}
}
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"开始提取HIS数据"
,
isSingle
:
isSingle
);
var
hisScrips
=
hisscriptRepository
.
GetEntities
(
t
=>
t
.
HospitalId
==
hospitalId
);
if
(
hisScrips
==
null
||
!
hisScrips
.
Any
())
return
;
foreach
(
var
item
in
hisScrips
)
{
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"提取
{
item
.
SourceType
}
-
{
item
.
Category
}
数据"
,
isSingle
:
isSingle
);
HisData
(
allot
,
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
item
.
ConfigId
),
item
,
isSingle
);
HisData
(
allot
,
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
item
.
ConfigId
),
item
,
groupName
,
isSingle
);
}
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"提取HIS数据完成"
,
isSingle
:
isSingle
);
}
catch
(
Exception
)
{
...
...
@@ -227,10 +230,12 @@ private void JudgeDataEqual(List<string> columns, List<per_employee> emps, List<
}
}
private
void
HisData
(
per_allot
allot
,
sys_hospitalconfig
config
,
his_script
script
,
bool
isSingle
)
private
void
HisData
(
per_allot
allot
,
sys_hospitalconfig
config
,
his_script
script
,
string
groupName
,
bool
isSingle
)
{
try
{
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"提取“
{
script
.
SourceType
}
-
{
script
.
Category
}
”数据"
,
isSingle
:
isSingle
);
if
(
config
==
null
||
string
.
IsNullOrEmpty
(
script
.
ExecScript
))
return
;
var
data
=
queryService
.
QueryData
<
HisData
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
...
...
@@ -259,10 +264,12 @@ private void HisData(per_allot allot, sys_hospitalconfig config, his_script scri
CreateTime
=
DateTime
.
Now
,
});
hisdataRepository
.
AddRange
(
insertData
.
ToArray
());
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"提取“
{
script
.
SourceType
}
-
{
script
.
Category
}
”完成"
,
isSingle
:
isSingle
);
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
"获取his_data时发生异常:"
+
ex
.
ToString
());
logService
.
ReturnTheLog
(
allot
.
ID
,
allot
.
ID
.
ToString
(),
2
,
"SQL错误"
,
$"获取HIS数据“
{
script
.
SourceType
}
-
{
script
.
Category
}
”时发生异常"
,
3
,
isSingle
);
}
}
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
7835241b
...
...
@@ -159,7 +159,7 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
string
department
=
row
.
GetOrCreate
(
dataFirstCellNum
-
1
).
GetDecodeEscapes
();
if
(
string
.
IsNullOrEmpty
(
department
))
continue
;
if
(
rowIndex
>
dataFirstRowNum
)
dataFirstRowNum
=
rowIndex
+
1
;
if
(
rowIndex
>
=
dataFirstRowNum
)
dataFirstRowNum
=
rowIndex
+
1
;
var
deptData
=
data
.
Where
(
t
=>
t
.
Department
.
NoBlank
()
==
department
);
if
(
deptData
==
null
||
!
deptData
.
Any
(
t
=>
t
.
Value
.
HasValue
&&
t
.
Value
!=
0
))
continue
;
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
7835241b
...
...
@@ -106,10 +106,13 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
var
data
=
exresultRepository
.
GetEntities
(
t
=>
t
.
AllotId
==
allotId
);
data
.
AddRange
(
queryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
,
ref
dict
));
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取数据"
,
$"开始格式化数据"
,
1
,
isSingle
);
var
standData
=
StandDataFormat
(
hospitalId
,
data
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取数据"
,
$"格式化完成"
,
1
,
isSingle
);
dictionaryService
.
Handler
(
hospitalId
,
allot
,
groupName
,
isSingle
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"准备写入"
,
$"数据提取结束准备写入"
,
1
,
isSingle
);
var
statesArray
=
new
int
[]
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
};
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
allot
,
ref
extractFilePath
,
filePath
);
...
...
performance/Performance.Services/ExtractExcelService/QueryService.cs
View file @
7835241b
...
...
@@ -421,11 +421,19 @@ public IEnumerable<T> QueryData<T>(sys_hospitalconfig config, string execsql, pe
logService
.
ReturnTheLog
(
allot
.
ID
,
allot
.
ID
.
ToString
(),
2
,
"数据库连接"
,
$"数据库“
{
config
.
DbName
}
”连接失败"
,
3
,
isSingle
);
}
logger
.
LogInformation
(
$"提取绩效数据SQL脚本
{
execsql
}
"
);
var
result
=
connection
.
Query
<
T
>(
execsql
,
commandTimeout
:
20000
);
logger
.
LogInformation
(
$"提取绩效数据执行脚本获取数据
{
result
?.
Count
()
??
0
}
条记录"
);
try
{
logger
.
LogInformation
(
$"提取绩效数据SQL脚本
{
execsql
}
"
);
var
result
=
connection
.
Query
<
T
>(
execsql
,
commandTimeout
:
60
*
60
*
5
);
logger
.
LogInformation
(
$"提取绩效数据执行脚本获取数据
{
result
?.
Count
()
??
0
}
条记录"
);
return
result
;
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
$"SQL发生异常:
{
execsql
}
;
{
ex
}
"
);
throw
;
}
return
result
;
}
/// <summary>
...
...
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