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
77817fb2
Commit
77817fb2
authored
Feb 19, 2021
by
lcx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关闭筛选功能
parent
38e7014a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
1 deletions
+34
-1
performance/Performance.Extract.Api/Performance.Extract.Api.csproj
+1
-0
performance/Performance.Extract.Api/Properties/PublishProfiles/FolderProfile.pubxml
+4
-1
performance/Performance.Services/AllotService.cs
+2
-0
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
+27
-0
No files found.
performance/Performance.Extract.Api/Performance.Extract.Api.csproj
View file @
77817fb2
...
...
@@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<UserSecretsId>3af57781-f816-4c0e-ab66-9b69387e7d35</UserSecretsId>
</PropertyGroup>
<ItemGroup>
...
...
performance/Performance.Extract.Api/Properties/PublishProfiles/FolderProfile.pubxml
View file @
77817fb2
...
...
@@ -14,6 +14,8 @@
<ExcludeApp_Data>
False
</ExcludeApp_Data>
<ProjectGuid>
a7ae6d0f-7b11-4eef-9fea-a279001ea54d
</ProjectGuid>
<publishUrl>
bin\Release\netcoreapp2.2\publish\
</publishUrl>
<DeleteExistingFiles>
False
</DeleteExistingFiles>
<DeleteExistingFiles>
True
</DeleteExistingFiles>
<TargetFramework>
netcoreapp2.2
</TargetFramework>
<SelfContained>
false
</SelfContained>
</PropertyGroup>
</Project>
\ No newline at end of file
performance/Performance.Services/AllotService.cs
View file @
77817fb2
...
...
@@ -314,6 +314,8 @@ public void Generate(per_allot allot, string mail)
logManageService
.
WriteMsg
(
"绩效开始执行"
,
$"数据来源:用户上传的Excel。"
,
1
,
allot
.
ID
,
"ReceiveMessage"
,
true
);
configService
.
Clear
(
allot
.
ID
);
// 关闭筛选功能
ExtractHelper
.
CloseAutoFilter
(
allot
.
Path
);
// 导出数据
excel
=
importDataService
.
ReadDataAndSave
(
allot
);
...
...
performance/Performance.Services/ExtractExcelService/ExtractHelper/ExtractHelper.cs
View file @
77817fb2
using
NPOI.SS.UserModel
;
using
OfficeOpenXml
;
using
Performance.DtoModels
;
using
Performance.EntityModels
;
using
Performance.Infrastructure
;
...
...
@@ -17,6 +18,7 @@ public static string GetExtractFile(int hospitalId, ref string newFilePath, stri
string
originalPath
=
string
.
IsNullOrEmpty
(
allotFilePath
)
?
Path
.
Combine
(
AppDomain
.
CurrentDomain
.
BaseDirectory
,
"Template"
,
"医院绩效模板.xls"
)
:
allotFilePath
;
CloseAutoFilter
(
originalPath
);
var
(
tempPath
,
filePath
)
=
CopyOriginalFile
(
hospitalId
,
originalPath
);
newFilePath
=
filePath
;
return
tempPath
;
...
...
@@ -108,5 +110,30 @@ public static void ClearSheetPartialData(ISheet sheet, PerSheetPoint point, Shee
}
}
}
public
static
void
CloseAutoFilter
(
string
path
)
{
try
{
var
fileInfo
=
new
FileInfo
(
path
);
using
(
ExcelPackage
package
=
new
ExcelPackage
(
fileInfo
))
{
ExcelWorkbook
workbook
=
package
.
Workbook
;
if
(
workbook
==
null
)
return
;
foreach
(
var
sheet
in
workbook
.
Worksheets
)
{
if
(
sheet
.
AutoFilterAddress
!=
null
)
{
sheet
.
Cells
[
sheet
.
AutoFilterAddress
.
Address
].
AutoFilter
=
false
;
}
}
package
.
Save
();
}
}
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