diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/DBInfo.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/DBInfo.java new file mode 100644 index 00000000..e1dd2e3f --- /dev/null +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/DBInfo.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.base.dto; + +import lombok.Data; + +@Data +public class DBInfo { + + private String tableName; + + private Integer numRow; + + private Double dataSize; + + private Double indexSize; + + private Double used; +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java index 516cd170..840fa975 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/GammaServiceImpl.java @@ -4503,6 +4503,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String dataType = phd.getMsgInfo().getData_type().substring(0, 1); String format = ".txt"; String txtFileName = String.format("%s-%s_%s_%s_RESULT%s", detectorCode, date, time, dataType, format); + if (StrUtil.isNotBlank(fileName)){ + if (StrUtil.contains(fileName, ".PHD")) + txtFileName = StrUtil.replace(fileName, ".PHD", ".txt"); + } // 导出数据内容到txt文本 OutputStream fos = null; try { @@ -4641,6 +4645,10 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi String dataType = phd.getMsgInfo().getData_type().substring(0, 1); String format = ".xls"; String xlsFileName = String.format("%s-%s_%s_%s_RESULT%s", detectorCode, date, time, dataType, format); + if (StrUtil.isNotBlank(fileName)){ + if (StrUtil.contains(fileName, ".PHD")) + xlsFileName = StrUtil.replace(fileName, ".PHD", ".xls"); + } String template = SAVETOEXCEL_G.getName(); // 导出时使用默认文件名 file.xls ExportUtil.exportXls(response, template, data, xlsFileName); diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index c4b667cd..e52d0ac6 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -4452,6 +4452,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { PrintWriter writer = null; try { String export = "saveToHtml.html"; + String sampleFileName = anlyseResultIn.getSampleFileName(); + if (StrUtil.isNotBlank(sampleFileName)){ + if (StrUtil.contains(sampleFileName, ".PHD")) + export = StrUtil.replace(sampleFileName, ".PHD", ".html"); + } writer = ExportUtil.htmlWriter(response, export); writer.write(result); } catch (IOException e) { @@ -4469,6 +4474,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { // 将Null值替换为"",避免空指针异常(集合为空集合,不能为null) analyze.replaceAll((key, value) -> ObjectUtil.isNull(value) ? "" : value); String export = "SaveToExcel.xls"; + String sampleFileName = anlyseResultIn.getSampleFileName(); + if (StrUtil.isNotBlank(sampleFileName)){ + if (StrUtil.contains(sampleFileName, ".PHD")) + export = StrUtil.replace(sampleFileName, ".PHD", ".xls"); + } String template = SAVETOEXCEL.getName(); ExportUtil.exportXls(response, template, analyze,export); } @@ -4544,6 +4554,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { newLines.add(line); } String export = "SaveToTxt.txt"; + String sampleFileName = anlyseResultIn.getSampleFileName(); + if (StrUtil.isNotBlank(sampleFileName)){ + if (StrUtil.contains(sampleFileName, ".PHD")) + export = StrUtil.replace(sampleFileName, ".PHD", ".txt"); + } writer = ExportUtil.streamWriter(response, export); for (String newLine : newLines) { writer.println(newLine);