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
72a97144
Commit
72a97144
authored
Dec 17, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取bug修改
parent
3dd3d5a8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
8 deletions
+22
-8
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+2
-2
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+6
-3
performance/Performance.Services/ExtractExcelService/QueryService.cs
+14
-3
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
72a97144
...
...
@@ -197,14 +197,14 @@ public static void WriteSheetData(ISheet sheet, PerSheetPoint point, SheetType s
{
var
departments
=
data
.
Select
(
s
=>
s
.
Department
??
""
)
/*.Where(w => !string.IsNullOrEmpty(w))*/
.
Distinct
().
ToList
();
var
filed
=
new
Dictionary
<
string
,
Func
<
ExtractTransDto
,
string
>>()
;
var
filed
=
fieldOut
;
if
(
sheetType
==
SheetType
.
Income
)
{
if
(
sheet
.
SheetName
.
Contains
(
"住院"
)
||
sheet
.
SheetName
.
Contains
(
"门诊"
))
filed
=
sheet
.
SheetName
.
Contains
(
"住院"
)
?
fieldInpat
:
fieldOut
;
var
ename
=
data
.
Where
(
w
=>
w
.
SheetName
==
sheet
.
SheetName
)?.
FirstOrDefault
(
w
=>
!
string
.
IsNullOrEmpty
(
w
.
EName
))?.
EName
;
if
(
ename
.
Contains
(
"住院"
)
||
ename
.
Contains
(
"门诊"
))
if
(
string
.
IsNullOrEmpty
(
ename
)
||
ename
.
Contains
(
"住院"
)
||
ename
.
Contains
(
"门诊"
))
filed
=
ename
.
Contains
(
"住院"
)
?
fieldInpatOut
:
fieldOutInpat
;
}
else
if
(
sheet
.
SheetName
.
Contains
(
"工作量"
))
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
72a97144
...
...
@@ -106,17 +106,18 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
allot
,
ref
extractFilePath
,
filePath
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"创建文件"
,
$"模板文件:
{
templateFilePath
}
"
,
1
,
isSingle
);
if
(!
FileHelper
.
IsExistFile
(
templateFilePath
))
throw
new
Performance
Exception
(
"抽取文件创建失败"
);
if
(!
FileHelper
.
IsExistFile
(
templateFilePath
))
throw
new
Exception
(
"抽取文件创建失败"
);
workbook
=
ExcelHelper
.
GetWorkbook
(
templateFilePath
);
if
(
workbook
==
null
)
throw
new
Performance
Exception
(
"文件读取失败"
);
if
(
workbook
==
null
)
throw
new
Exception
(
"文件读取失败"
);
WriteDataToFile
(
workbook
,
allot
,
dict
,
standData
,
groupName
,
isSingle
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取完成"
,
$"绩效数据提取成功"
,
5
,
isSingle
);
allot
.
IsExtracting
=
isSingle
?
2
:
0
;
allot
.
ExtractPath
=
extractFilePath
;
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"写入数据"
,
$"写入数据至Excel文件"
,
1
,
isSingle
);
workbook
.
EvaluateAll
();
using
(
FileStream
file
=
new
FileStream
(
extractFilePath
,
FileMode
.
OpenOrCreate
))
{
...
...
@@ -133,6 +134,8 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
finally
{
logService
.
ReturnTheLog
(
allotId
,
groupName
,
3
,
""
,
100
,
5
,
isSingle
);
if
(
allot
.
IsExtracting
!=
3
)
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"提取完成"
,
$"绩效数据提取成功"
,
5
,
isSingle
);
UpdateAllot
(
connection
,
allot
);
}
return
extractFilePath
;
...
...
performance/Performance.Services/ExtractExcelService/QueryService.cs
View file @
72a97144
...
...
@@ -272,7 +272,8 @@ private List<ex_result> ExtractItemData(per_allot allot, string groupName, bool
{
var
config
=
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
script
.
ConfigId
);
if
(
config
==
null
)
continue
;
try
{
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
{
...
...
@@ -298,7 +299,11 @@ private List<ex_result> ExtractItemData(per_allot allot, string groupName, bool
});
}
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
$"typeId:
{
typeId
}
提取数据异常
{
ex
}
,
{
Infrastructure
.
JsonHelper
.
Serialize
(
script
)}
"
);
}
}
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"项目“
{
string
.
Join
(
"、"
,
thisItems
.
Select
(
t
=>
t
.
ItemName
))}
”的数据已完成提取"
,
1
,
isSingle
);
}
}
...
...
@@ -336,7 +341,8 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo
{
var
config
=
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
script
.
ConfigId
);
if
(
config
==
null
)
continue
;
try
{
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
{
...
...
@@ -361,6 +367,11 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo
});
}
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
$"typeId:
{
typeId
}
提取数据异常
{
ex
}
,
{
Infrastructure
.
JsonHelper
.
Serialize
(
script
)}
"
);
}
}
logService
.
ReturnTheLog
(
allot
.
ID
,
groupName
,
2
,
"提取数据"
,
$"项目“
{
string
.
Join
(
"、"
,
thisSpecials
.
Select
(
t
=>
t
.
Target
))}
”的数据已完成提取"
,
1
,
isSingle
);
}
...
...
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