Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
b0b2e279
Commit
b0b2e279
authored
Jun 02, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出数据
parent
fc9cb9c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ExcelHttp.java
.../src/main/java/com/yanzuoguang/cloud/excel/ExcelHttp.java
+6
-0
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/excel/ExcelHttp.java
View file @
b0b2e279
...
@@ -3,6 +3,7 @@ package com.yanzuoguang.cloud.excel;
...
@@ -3,6 +3,7 @@ package com.yanzuoguang.cloud.excel;
import
com.yanzuoguang.cloud.helper.HttpFileHelper
;
import
com.yanzuoguang.cloud.helper.HttpFileHelper
;
import
com.yanzuoguang.excel.*
;
import
com.yanzuoguang.excel.*
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.thread.ThreadHelper
;
import
com.yanzuoguang.util.thread.ThreadHelper
;
...
@@ -68,11 +69,16 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
...
@@ -68,11 +69,16 @@ public class ExcelHttp<T extends Object> extends ExcelConsole<T> {
boolean
isDown
=
file
.
exists
();
boolean
isDown
=
file
.
exists
();
if
(
isDown
)
{
if
(
isDown
)
{
// 下载文件
HttpFileHelper
.
localToDown
(
this
.
getFileName
(),
downFileName
,
response
);
HttpFileHelper
.
localToDown
(
this
.
getFileName
(),
downFileName
,
response
);
}
else
{
}
else
{
// 返回文件名和生成的文件大小
// 假如连续1分钟返回文件大小为0,则说明性能存在问题,或者是其他线程已经删除文件
ExportTempRes
res
=
new
ExportTempRes
();
ExportTempRes
res
=
new
ExportTempRes
();
res
.
setFileName
(
fileName
);
res
.
setFileName
(
fileName
);
res
.
setSize
(
fileTemp
.
length
());
res
.
setSize
(
fileTemp
.
length
());
// 输出结果
response
.
getWriter
().
print
(
JsonHelper
.
serialize
(
res
));
}
}
return
isDown
;
return
isDown
;
}
}
...
...
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