Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 326146f6
authored
Jun 29, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
poi升级兼容处理
1 parent
f3f0accb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
33 deletions
pom.xml
src/main/java/cn/com/glsx/admin/modules/controller/OpereportController.java
pom.xml
View file @
326146f
...
...
@@ -130,8 +130,8 @@
<version>
0.0.1-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel-core
</artifactId>
<groupId>
org.oreframework
</groupId>
<artifactId>
ore-web
</artifactId>
</exclusion>
</exclusions>
</dependency>
...
...
src/main/java/cn/com/glsx/admin/modules/controller/OpereportController.java
View file @
326146f
...
...
@@ -10,7 +10,6 @@ import cn.com.glsx.admin.modules.service.OpereportService;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.DateUtils
;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.office.excel.EasyExcelUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -19,8 +18,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -44,20 +41,8 @@ public class OpereportController extends AbstractController {
@GetMapping
(
value
=
"/vehicle/export"
)
public
R
vehicleExport
(
ReportVehicleSearch
search
)
{
List
<
ReportVehicleExport
>
list
=
opereportService
.
vehicleExport
(
search
);
//String url = super.uploadExcel(list, "运营统计报表(车辆维度)_" + DateUtils.formatSerial(new Date()), ReportVehicleExport.class);
String
fileName
=
"运营统计报表(车辆维度)_"
+
DateUtils
.
formatSerial
(
new
Date
());
try
(
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
())
{
EasyExcelUtils
.
writeExcel
(
baos
,
list
,
fileName
,
ReportVehicleExport
.
class
);
String
url
=
getExportFileUrl
(
fileName
,
baos
);
return
R
.
ok
().
data
(
url
);
}
catch
(
IOException
e
)
{
log
.
error
(
"上传Excel失败:{}"
,
e
.
getMessage
());
}
return
R
.
error
(
"下载失败"
);
String
url
=
super
.
uploadExcel
(
list
,
"运营统计报表(车辆维度)_"
+
DateUtils
.
formatSerial
(
new
Date
()),
ReportVehicleExport
.
class
);
return
R
.
ok
().
data
(
url
);
}
@ApiOperation
(
value
=
"设备列表查询"
)
...
...
@@ -71,20 +56,8 @@ public class OpereportController extends AbstractController {
@GetMapping
(
value
=
"/device/export"
)
public
R
deviceExport
(
ReportDeviceSearch
search
)
{
List
<
ReportDeviceExport
>
list
=
opereportService
.
deviceExport
(
search
);
//String url = super.uploadExcel(list, "运营统计报表(设备维度)_" + DateUtils.formatSerial(new Date()), ReportDeviceExport.class);
String
fileName
=
"运营统计报表(设备维度)_"
+
DateUtils
.
formatSerial
(
new
Date
());
try
(
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
())
{
EasyExcelUtils
.
writeExcel
(
baos
,
list
,
fileName
,
ReportDeviceExport
.
class
);
String
url
=
getExportFileUrl
(
fileName
,
baos
);
return
R
.
ok
().
data
(
url
);
}
catch
(
IOException
e
)
{
log
.
error
(
"上传Excel失败:{}"
,
e
.
getMessage
());
}
return
R
.
error
(
"下载失败"
);
String
url
=
super
.
uploadExcel
(
list
,
"运营统计报表(设备维度)_"
+
DateUtils
.
formatSerial
(
new
Date
()),
ReportDeviceExport
.
class
);
return
R
.
ok
().
data
(
url
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment