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