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
8d57d416
Commit
8d57d416
authored
Nov 05, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绩效抽取数据文件名称错误、运营分析获取科室的数据
parent
5993b6ad
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+4
-4
performance/Performance.Services/ExtractExcelService/ExtractService.cs
+1
-3
performance/Performance.Services/ReportService.cs
+3
-5
No files found.
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
8d57d416
...
...
@@ -13,13 +13,13 @@ namespace Performance.Services.ExtractExcelService
{
public
class
ExtractHelper
{
public
static
string
GetExtractFile
(
int
hospitalId
,
ref
string
newFilePath
,
string
allotFilePath
=
""
)
public
static
string
GetExtractFile
(
int
hospitalId
,
per_allot
allot
,
ref
string
newFilePath
,
string
allotFilePath
=
""
)
{
string
originalPath
=
string
.
IsNullOrEmpty
(
allotFilePath
)
?
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院绩效模板.xlsx"
)
:
allotFilePath
;
CloseAutoFilter
(
originalPath
);
var
(
tempPath
,
filePath
)
=
CopyOriginalFile
(
hospitalId
,
originalPath
);
var
(
tempPath
,
filePath
)
=
CopyOriginalFile
(
hospitalId
,
originalPath
,
allot
);
newFilePath
=
filePath
;
return
tempPath
;
}
...
...
@@ -31,14 +31,14 @@ public static string GetExtractFile(int hospitalId, string prefix = "绩效提
return
Path
.
Combine
(
dpath
,
$"
{
prefix
}{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)}
.xlsx"
);
}
private
static
(
string
TempPath
,
string
FilePath
)
CopyOriginalFile
(
int
hospitalId
,
string
originalPath
)
private
static
(
string
TempPath
,
string
FilePath
)
CopyOriginalFile
(
int
hospitalId
,
string
originalPath
,
per_allot
allot
)
{
var
ext
=
FileHelper
.
GetExtension
(
originalPath
);
var
dpath
=
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Files"
,
$"
{
hospitalId
}
"
,
"autoextract"
);
FileHelper
.
CreateDirectory
(
dpath
);
string
tempPath
=
Path
.
Combine
(
dpath
,
$"Template
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)}{
ext
}
"
);
FileHelper
.
Copy
(
originalPath
,
tempPath
);
string
filePath
=
Path
.
Combine
(
dpath
,
$"绩效提取数据
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)}{
ext
}
"
);
string
filePath
=
Path
.
Combine
(
dpath
,
$"
{
allot
.
Year
}{
allot
.
Month
.
ToString
().
PadLeft
(
2
,
'0'
)}
绩效提取数据
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)}{
ext
}
"
);
return
(
tempPath
,
filePath
);
}
...
...
performance/Performance.Services/ExtractExcelService/ExtractService.cs
View file @
8d57d416
...
...
@@ -96,11 +96,9 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
var
statesArray
=
new
int
[]
{
(
int
)
AllotStates
.
GenerateSucceed
,
(
int
)
AllotStates
.
Archive
};
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
ref
extractFilePath
,
filePath
);
var
templateFilePath
=
ExtractHelper
.
GetExtractFile
(
hospitalId
,
allot
,
ref
extractFilePath
,
filePath
);
logService
.
ReturnTheLog
(
allotId
,
groupName
,
2
,
"创建文件"
,
$"模板文件:
{
templateFilePath
}
"
,
1
,
isSingle
);
extractFilePath
=
$"
{
allot
.
Year
}
_
{
allot
.
Month
}
_"
+
extractFilePath
;
if
(!
FileHelper
.
IsExistFile
(
templateFilePath
))
throw
new
PerformanceException
(
"抽取文件创建失败"
);
workbook
=
ExcelHelper
.
GetWorkbook
(
templateFilePath
);
...
...
performance/Performance.Services/ReportService.cs
View file @
8d57d416
...
...
@@ -427,11 +427,9 @@ public SheetExportResponse Operation(ReportRequest request)
if
(
years
==
null
||
!
years
.
Any
())
return
sheet
;
string
sql
=
$"select * from view_operation_report_result where hospitalid = @hospitalid and year in @year"
;
if
(
request
.
AccountingUnit
!=
null
&&
request
.
AccountingUnit
.
Any
())
{
sql
+=
" and accountingunit in @accountingunit"
;
}
string
sql
=
$"select * from view_operation_report_result where hospitalid = @hospitalid and year in @year and accountingunit in @accountingunit"
;
if
(
request
.
AccountingUnit
==
null
||
!
request
.
AccountingUnit
.
Any
())
request
.
AccountingUnit
=
new
string
[]
{
"全院运营分析"
};
var
data
=
perforReportRepository
.
DapperQuery
<
view_operation_report_result
>(
sql
,
new
{
hospitalId
=
request
.
HospitalId
,
year
=
years
,
accountingunit
=
request
.
AccountingUnit
})?.
ToList
();
...
...
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