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
f4f9fa75
Commit
f4f9fa75
authored
Dec 20, 2021
by
lcx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop20211216' into develop
parents
2fae6b6d
72a97144
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
47 deletions
+61
-47
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
+2
-2
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+6
-3
performance/Performance.Services/ExtractExcelService/QueryService.cs
+53
-42
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/WriteDataHelper.cs
View file @
f4f9fa75
...
...
@@ -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 @
f4f9fa75
...
...
@@ -115,17 +115,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
))
{
...
...
@@ -142,6 +143,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 @
f4f9fa75
...
...
@@ -272,33 +272,38 @@ private List<ex_result> ExtractItemData(per_allot allot, string groupName, bool
{
var
config
=
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
script
.
ConfigId
);
if
(
config
==
null
)
continue
;
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
try
{
thisItems
.
ForEach
(
f
=>
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
{
var
modulename
=
modules
.
FirstOrDefault
(
t
=>
t
.
Id
==
f
.
ModuleId
)?.
ModuleName
;
var
result
=
querydata
.
Select
(
t
=>
new
ex_result
thisItems
.
ForEach
(
f
=>
{
Department
=
t
.
Department
,
Category
=
f
.
ItemName
,
Fee
=
t
.
Value
,
DoctorName
=
t
.
DoctorName
,
PersonnelNumber
=
t
.
PersonnelNumber
,
Source
=
modulename
,
TypeId
=
typeId
,
DatabaseType
=
config
.
DataBaseType
,
ConfigId
=
config
.
Id
,
AllotId
=
allot
.
ID
,
CreateTime
=
CreateTime
,
}).
ToList
();
exresultRepository
.
InsertExecute
(
result
.
ToArray
());
data
.
AddRange
(
result
);
});
var
modulename
=
modules
.
FirstOrDefault
(
t
=>
t
.
Id
==
f
.
ModuleId
)?.
ModuleName
;
var
result
=
querydata
.
Select
(
t
=>
new
ex_result
{
Department
=
t
.
Department
,
Category
=
f
.
ItemName
,
Fee
=
t
.
Value
,
DoctorName
=
t
.
DoctorName
,
PersonnelNumber
=
t
.
PersonnelNumber
,
Source
=
modulename
,
TypeId
=
typeId
,
DatabaseType
=
config
.
DataBaseType
,
ConfigId
=
config
.
Id
,
AllotId
=
allot
.
ID
,
CreateTime
=
CreateTime
,
}).
ToList
();
exresultRepository
.
InsertExecute
(
result
.
ToArray
());
data
.
AddRange
(
result
);
});
}
}
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,29 +341,35 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo
{
var
config
=
configs
.
FirstOrDefault
(
t
=>
t
.
Id
==
script
.
ConfigId
);
if
(
config
==
null
)
continue
;
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
try
{
thisSpecials
.
ForEach
(
f
=>
var
querydata
=
QueryData
<
ExtractDto
>(
config
,
script
.
ExecScript
,
allot
,
isSingle
);
if
(
querydata
!=
null
&&
querydata
.
Any
())
{
var
result
=
querydata
.
Select
(
t
=>
new
ex_result
thisSpecials
.
ForEach
(
f
=>
{
Department
=
f
.
Department
,
Category
=
f
.
Target
,
Fee
=
t
.
Value
,
DoctorName
=
t
.
DoctorName
,
PersonnelNumber
=
t
.
PersonnelNumber
,
Source
=
"4.2 特殊核算单元绩效测算表"
,
TypeId
=
typeId
,
DatabaseType
=
config
.
DataBaseType
,
ConfigId
=
config
.
Id
,
AllotId
=
allot
.
ID
,
CreateTime
=
CreateTime
,
}).
ToList
();
exresultRepository
.
InsertExecute
(
result
.
ToArray
());
data
.
AddRange
(
result
);
});
var
result
=
querydata
.
Select
(
t
=>
new
ex_result
{
Department
=
f
.
Department
,
Category
=
f
.
Target
,
Fee
=
t
.
Value
,
DoctorName
=
t
.
DoctorName
,
PersonnelNumber
=
t
.
PersonnelNumber
,
Source
=
"4.2 特殊核算单元绩效测算表"
,
TypeId
=
typeId
,
DatabaseType
=
config
.
DataBaseType
,
ConfigId
=
config
.
Id
,
AllotId
=
allot
.
ID
,
CreateTime
=
CreateTime
,
}).
ToList
();
exresultRepository
.
InsertExecute
(
result
.
ToArray
());
data
.
AddRange
(
result
);
});
}
}
catch
(
Exception
ex
)
{
logger
.
LogError
(
$"typeId:
{
typeId
}
提取数据异常
{
ex
}
,
{
Infrastructure
.
JsonHelper
.
Serialize
(
script
)}
"
);
}
}
...
...
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