Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
2ebe6f9c
Commit
2ebe6f9c
authored
Aug 22, 2023
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.电梯导出
parent
b556571c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
ExcelUtil.java
.../yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
+8
-9
TemplateExportController.java
...ule/elevator/biz/controller/TemplateExportController.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/excel/ExcelUtil.java
View file @
2ebe6f9c
...
@@ -458,18 +458,17 @@ public class ExcelUtil {
...
@@ -458,18 +458,17 @@ public class ExcelUtil {
List
<
List
<
String
>>
heads
,
List
<
List
<
String
>>
heads
,
String
fileType
,
String
fileType
,
Executor
executorService
,
Executor
executorService
,
int
excelNumber
)
{
int
pageSize
)
{
int
dataSize
=
data
.
size
();
int
dataSize
=
data
.
size
();
int
threadDataSize
=
dataSize
/
excelNumber
;
int
excelNumber
=
(
int
)
Math
.
ceil
((
double
)
dataSize
/
pageSize
)
;
int
lastDataSize
=
dataSize
%
excelNumber
;
int
lastDataSize
=
dataSize
%
pageSize
;
List
<
CompletableFuture
<
ByteArrayOutputStream
>>
futures
=
new
ArrayList
<>();
List
<
CompletableFuture
<
ByteArrayOutputStream
>>
futures
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
excelNumber
;
i
++)
{
for
(
int
i
=
0
;
i
<
excelNumber
;
i
++)
{
int
start
=
i
*
threadData
Size
;
int
start
=
i
*
page
Size
;
int
end
=
start
+
threadData
Size
;
int
end
=
start
+
page
Size
;
if
(
i
==
excelNumber
-
1
)
{
if
(
i
==
excelNumber
-
1
)
{
end
=
start
+
threadDataSize
+
lastDataSize
;
end
=
start
+
(
lastDataSize
==
0
?
pageSize
:
lastDataSize
)
;
}
}
List
<?>
subList
=
data
.
subList
(
start
,
end
);
List
<?>
subList
=
data
.
subList
(
start
,
end
);
CompletableFuture
<
ByteArrayOutputStream
>
future
=
CompletableFuture
.
supplyAsync
(()
->
exportData2
(
subList
,
heads
),
executorService
)
CompletableFuture
<
ByteArrayOutputStream
>
future
=
CompletableFuture
.
supplyAsync
(()
->
exportData2
(
subList
,
heads
),
executorService
)
...
@@ -488,10 +487,10 @@ public class ExcelUtil {
...
@@ -488,10 +487,10 @@ public class ExcelUtil {
List
<
ByteArrayOutputStream
>
results
=
combinedFuture
.
join
();
List
<
ByteArrayOutputStream
>
results
=
combinedFuture
.
join
();
try
{
try
{
String
encodedFileName
=
URLEncoder
.
encode
(
fileName
+
".zip"
,
StandardCharsets
.
UTF_8
.
name
());
response
.
setContentType
(
"application/zip"
);
response
.
setContentType
(
"application/zip"
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setHeader
(
"Content-Disposition"
,
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
encodedFileName
);
"attachment; filename="
+
URLEncoder
.
encode
(
fileName
+
".zip"
,
StandardCharsets
.
UTF_8
.
name
()));
List
<
File
>
tempList
=
new
ArrayList
<>();
List
<
File
>
tempList
=
new
ArrayList
<>();
ExcelTypeEnum
typeEnum
;
ExcelTypeEnum
typeEnum
;
if
(
"1039"
.
equals
(
fileType
))
{
if
(
"1039"
.
equals
(
fileType
))
{
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/TemplateExportController.java
View file @
2ebe6f9c
...
@@ -225,7 +225,7 @@ public class TemplateExportController extends BaseController {
...
@@ -225,7 +225,7 @@ public class TemplateExportController extends BaseController {
list
=
elevatorServiceImpl
.
selectExportData
(
exportDto
.
getExportId
());
list
=
elevatorServiceImpl
.
selectExportData
(
exportDto
.
getExportId
());
redisUtil
.
set
(
BizCommonConstant
.
OLD_ELEVATOR_REDIS_KEY
,
JSONObject
.
toJSONString
(
list
));
redisUtil
.
set
(
BizCommonConstant
.
OLD_ELEVATOR_REDIS_KEY
,
JSONObject
.
toJSONString
(
list
));
}
}
ExcelUtil
.
exportWithMplThread2
(
response
,
fileName
,
list
,
heads
,
exportDto
.
getFileType
(),
customExecutor
,
10
);
ExcelUtil
.
exportWithMplThread2
(
response
,
fileName
,
list
,
heads
,
exportDto
.
getFileType
(),
customExecutor
,
10
000
);
return
;
return
;
}
else
if
(
"MAINTENANCE_COMPANY"
.
equals
(
exportDto
.
getExportType
()))
{
// 查询维保单位数据
}
else
if
(
"MAINTENANCE_COMPANY"
.
equals
(
exportDto
.
getExportType
()))
{
// 查询维保单位数据
list
=
iMaintenanceUnitService
.
selectExportData
(
exportDto
.
getExportId
());
list
=
iMaintenanceUnitService
.
selectExportData
(
exportDto
.
getExportId
());
...
...
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