Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-hook
gic-cloud
Commits
3ae200d2
Commit
3ae200d2
authored
Apr 07, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 耗时
parent
8b5732e6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
20 deletions
+12
-20
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+12
-2
ExceTest2.java
gic-cloud-data-hook-service/src/test/java/ExceTest2.java
+0
-18
ExceTest2.java
...ud-data-hook-service/src/test/java/com/gic/ExceTest2.java
+0
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
3ae200d2
package
com
.
gic
.
cloud
.
data
.
hook
.
service
.
impl
;
import
cn.hutool.core.date.StopWatch
;
import
cn.medubi.client.utils.LogPak
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -877,11 +878,17 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
String
dirName
=
"hdfs"
+
task
.
getId
();
String
path
=
HDFS_URL
+
"/"
+
dirName
;
try
{
StopWatch
stopWatch
=
StopWatch
.
create
(
"down"
);
stopWatch
.
start
();
logger
.
info
(
"下载开始"
);
boolean
downloadFlag
=
HDFSUtil
.
getInstance
().
downloadFile
(
path
,
SAVE_FOLDER
);
if
(!
downloadFlag
)
{
logger
.
info
(
"下载失败:{}-{}"
,
path
,
JSONObject
.
toJSONString
(
task
));
return
;
}
stopWatch
.
stop
();
logger
.
info
(
"下载耗时:{}"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
List
<
String
>
xlsxFiles
=
new
ArrayList
<>();
AtomicInteger
count
=
new
AtomicInteger
(
0
);
AtomicReference
<
XlsxFileInfo
>
currentFile
=
new
AtomicReference
<>();
...
...
@@ -896,7 +903,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
});
//结束
saveXlsSplitNew
(
currentFile
.
get
().
filepath
,
null
,
null
,
currentFile
.
get
(),
count
,
true
);
stopWatch
.
stop
();
logger
.
info
(
"写入本地excel耗时:{}"
,
stopWatch
.
getLastTaskTimeMillis
());
stopWatch
.
start
();
//是否压缩
boolean
zipFlag
=
(
xlsxFiles
.
size
()
>
1
)
?
true
:
false
;
String
cloudFileUrl
=
null
;
...
...
@@ -914,7 +923,8 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
logger
.
info
(
"[ 开始上传文件到腾讯云 ]: {}"
,
task
.
getId
());
cloudFileUrl
=
cloudFileUpload
(
task
.
getEnterpriseId
(),
new
File
(
currentFile
.
get
().
filepath
),
taskFileExt
.
substring
(
1
));
}
stopWatch
.
stop
();
logger
.
info
(
"上传腾讯云耗时:{}"
,
stopWatch
.
getLastTaskTimeMillis
());
logger
.
info
(
"[ 上传腾讯云 ]: {}"
,
"地址为:"
+
cloudFileUrl
);
task
.
setStatus
(
DownloadTaskStatus
.
COMPLISHED
);
task
.
setOverTime
(
new
Date
());
...
...
gic-cloud-data-hook-service/src/test/java/ExceTest2.java
deleted
100644 → 0
View file @
8b5732e6
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.streaming.SXSSFWorkbook
;
import
java.io.FileOutputStream
;
import
java.util.Date
;
public
class
ExceTest2
{
public
static
void
main
(
String
[]
args
)
{
int
n
=
25
;
int
c
=
100
;
Double
aDouble
=
Double
.
valueOf
((
double
)
n
/
c
);
System
.
out
.
println
(
aDouble
);
}
}
gic-cloud-data-hook-service/src/test/java/com/gic/ExceTest2.java
0 → 100644
View file @
3ae200d2
This diff is collapsed.
Click to expand it.
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