Commit 326146f6 by levphon

poi升级兼容处理

1 parent f3f0accb
......@@ -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>
......
......@@ -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);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!