浏览代码

导出问题

Raod 4 年之前
父节点
当前提交
2c79a61fa9

+ 1 - 1
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/controller/ReportExcelController.java

@@ -66,7 +66,7 @@ public class ReportExcelController extends GaeaBaseController<ReportExcelParam,
 
         return ResponseBean.builder().code(ResponseCode.SUCCESS_CODE)
                 .data(reportExcelService.exportExcel(reportExcelDto))
-                .message("导出成功,请稍后在下载中心查看").build();
+                .message("导出成功,请稍后在文件管理中查看").build();
     }
 
 //    @PostMapping("/exportPdf")

+ 6 - 3
report-core/src/main/java/com/anjiplus/template/gaea/business/modules/reportexcel/service/impl/ReportExcelServiceImpl.java

@@ -132,11 +132,13 @@ public class ReportExcelServiceImpl implements ReportExcelService {
     public Boolean exportExcel(ReportExcelDto reportExcelDto) {
         String reportCode = reportExcelDto.getReportCode();
         String exportType = reportExcelDto.getExportType();
-
-        if (exportType.equals(ExportTypeEnum.GAEA_TEMPLATE_EXCEL)) {
+        logger.error("导出...");
+        if (exportType.equals(ExportTypeEnum.GAEA_TEMPLATE_EXCEL.getCodeValue())) {
+            ReportExcelDto report = detailByReportCode(reportCode);
+            reportExcelDto.setJsonStr(report.getJsonStr());
             String jsonStr = analysisReportData(reportExcelDto);
             List<JSONObject> lists=(List<JSONObject> ) JSON.parse(jsonStr);
-            OutputStream out = null;
+            OutputStream out;
             try {
                 String fileId = UUID.randomUUID().toString();
                 String filePath = dictPath + File.separator + fileId + ".xlsx";
@@ -153,6 +155,7 @@ public class ReportExcelServiceImpl implements ReportExcelService {
                 XlsUtil.exportXlsFile(out, true, lists);
 
                 gaeaFileMapper.insert(gaeaFile);
+                logger.info("导出成功:{}", gaeaFile);
             } catch (IOException e) {
                 logger.error("导出失败", e);
             }