diff --git a/derby.log b/derby.log
new file mode 100644
index 00000000..debbe824
--- /dev/null
+++ b/derby.log
@@ -0,0 +1,13 @@
+----------------------------------------------------------------
+Thu Sep 07 18:35:29 CST 2023:
+Booting Derby version The Apache Software Foundation - Apache Derby - 10.14.2.0 - (1828579): instance a816c00e-018a-6f36-0bb6-000026acaf78
+on database directory memory:E:\Code\RadionuclideAnalysis\AnalysisSystemForRadionuclide\dd4468e9-cdd6-4c7a-91ec-3c8744a24ea3 with class loader sun.misc.Launcher$AppClassLoader@18b4aac2
+Loaded from file:/E:/maven/.m2/repository/org/apache/derby/derby/10.14.2.0/derby-10.14.2.0.jar
+java.vendor=Oracle Corporation
+java.runtime.version=1.8.0_351-b10
+user.dir=E:\Code\RadionuclideAnalysis\AnalysisSystemForRadionuclide
+os.name=Windows 10
+os.arch=amd64
+os.version=10.0
+derby.system.home=null
+Database Class Loader started - derby.database.classpath=''
diff --git a/jeecg-boot-base-core/pom.xml b/jeecg-boot-base-core/pom.xml
index a2a12189..1e5181eb 100644
--- a/jeecg-boot-base-core/pom.xml
+++ b/jeecg-boot-base-core/pom.xml
@@ -258,25 +258,5 @@
commons-net
3.3
-
\ No newline at end of file
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SymbolConstant.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SymbolConstant.java
index b51a37b1..1470c6ec 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SymbolConstant.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/SymbolConstant.java
@@ -121,4 +121,6 @@ public class SymbolConstant {
*/
public static final String BARRE = "-";
+ public static final String SPACE = " ";
+
}
\ No newline at end of file
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExportUtil.java b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExportUtil.java
index d9f25273..dc2ed676 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExportUtil.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/ExportUtil.java
@@ -2,7 +2,6 @@ package org.jeecg.common.util;
import cn.hutool.core.util.ObjectUtil;
import org.apache.poi.ss.usermodel.Workbook;
-import org.jeecg.modules.base.dto.QCResultDto;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
@@ -44,9 +43,8 @@ public class ExportUtil {
}
public static void exportXls(HttpServletResponse response, Class target,
- List data, String sheetName, String fileName){
+ List data, String fileName){
ExportParams params = new ExportParams();
- params.setSheetName(sheetName);
Workbook workbook = null;
OutputStream outputStream = null;
try {
@@ -70,23 +68,24 @@ public class ExportUtil {
}
public static void exportXls(HttpServletResponse response, Class target, List data){
- exportXls(response, target, data, "sheet1", "file");
+ exportXls(response, target, data, "file.xls");
}
public static TemplateExportParams excelTemplate(String name){
- //return new TemplateExportParams("C:/Users/a/Desktop/"+ name +".xlsx");
- return new TemplateExportParams("E:\\Code\\IDEA\\AnalysisSystemForRadionuclide\\jeecg-boot-base-core\\src\\main\\resources\\excelTemplate\\"+ name +".xlsx");
+ String templatePath = "D:\\excelTemplate\\";
+ templatePath += name;
+ return new TemplateExportParams(templatePath);
}
public static void exportXls(HttpServletResponse response, String template,
- Map data, String fileName){
+ Map dataMap, String fileName){
TemplateExportParams params = excelTemplate(template);
Workbook workbook = null;
OutputStream outputStream = null;
try {
// 设置文件名、Excel类型(xls|xlsx)
outputStream = ExportUtil.xls(response,fileName);
- workbook = ExcelExportUtil.exportExcel(params, data);
+ workbook = ExcelExportUtil.exportExcel(params, dataMap);
workbook.write(outputStream);
} catch (IOException e) {
e.printStackTrace();
@@ -101,4 +100,39 @@ public class ExportUtil {
}
}
}
+ public static void exportXls(HttpServletResponse response, String template,
+ Map dataMap){
+ exportXls(response,template,dataMap,"file.xls");
+ }
+
+ public static void exportXls(HttpServletResponse response, String template,
+ Class target, List dataSet,
+ Map dataMap, String fileName){
+ TemplateExportParams params = excelTemplate(template);
+ Workbook workbook = null;
+ OutputStream outputStream = null;
+ try {
+ // 设置文件名、Excel类型(xls|xlsx)
+ outputStream = ExportUtil.xls(response,fileName);
+ workbook = ExcelExportUtil.exportExcel(params, target,dataSet,dataMap);
+ workbook.write(outputStream);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }finally {
+ try {
+ if (ObjectUtil.isNotNull(outputStream))
+ outputStream.close();
+ if (ObjectUtil.isNotNull(workbook))
+ workbook.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public static void exportXls(HttpServletResponse response, String template,
+ Class target, List dataSet,
+ Map dataMap){
+ exportXls(response,template,target,dataSet,dataMap,"file.xls");
+ }
}
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/QCResultDto.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/QCResultDto.java
deleted file mode 100644
index 4d9dc19d..00000000
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/dto/QCResultDto.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.jeecg.modules.base.dto;
-
-import lombok.Data;
-import org.jeecgframework.poi.excel.annotation.Excel;
-
-@Data
-public class QCResultDto {
-
- @Excel(name = "Name",orderNum = "1",width = 30)
- private String fieldName;
-
- @Excel(name = "Value",orderNum = "2",width = 10)
- private Object fieldValue;
-}
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/ExportTemplate.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/ExportTemplate.java
new file mode 100644
index 00000000..1a2375ea
--- /dev/null
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/base/enums/ExportTemplate.java
@@ -0,0 +1,22 @@
+package org.jeecg.modules.base.enums;
+
+import lombok.Getter;
+import org.springframework.web.bind.annotation.GetMapping;
+
+/*
+* Excel文件导出模板模板名枚举
+* */
+@Getter
+public enum ExportTemplate {
+
+ SampleInfo_G("SampleInformation-G.xls"),
+ RadionuclideActivity_G("RadionuclideActivity-G.xls"),
+ SampleInfo_B("SampleInformation-B.xls"),
+ QcResult_B("QcResult-B.xls");
+
+ ExportTemplate(String name) {
+ this.name = name;
+ }
+
+ private String name;
+}
diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/TablePeak.java b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/TablePeak.java
index 50523d23..6b829980 100644
--- a/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/TablePeak.java
+++ b/jeecg-boot-base-core/src/main/java/org/jeecg/modules/entity/vo/TablePeak.java
@@ -1,28 +1,41 @@
package org.jeecg.modules.entity.vo;
import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
@Data
public class TablePeak implements Serializable {
+ @Excel(name = "Index",orderNum = "1",width = 10)
+ private Integer no;
+
+ @Excel(name = "Energy(keV)",orderNum = "2",width = 20)
private String energy;
+ @Excel(name = "Centroid",orderNum = "3",width = 20)
private String centroid;
+ @Excel(name = "Multiplet",orderNum = "4",width = 20)
private String multiplet;
+ @Excel(name = "Fwhm(keV)",orderNum = "5",width = 20)
private String fwhm;
+ @Excel(name = "NetArea",orderNum = "6",width = 20)
private String netArea;
+ @Excel(name = "AreaErr(%)",orderNum = "7",width = 20)
private String areaErr;
+ @Excel(name = "Significant",orderNum = "8",width = 20)
private String significant;
+ @Excel(name = "Sensitivity",orderNum = "9",width = 20)
private String sensitivity;
+ @Excel(name = "Nuclides",orderNum = "10",width = 20)
private String indentify;
}
diff --git a/jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xlsx b/jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xls
similarity index 70%
rename from jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xlsx
rename to jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xls
index b956e69e..d2dd62ae 100644
Binary files a/jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xlsx and b/jeecg-boot-base-core/src/main/resources/excelTemplate/SampleInfo-G.xls differ
diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java
index db9b4811..bb8f2d05 100644
--- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java
+++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/GammaController.java
@@ -22,7 +22,6 @@ public class GammaController {
private IGammaService gammaService;
@GetMapping("gammaByDB")
- @ApiOperation(value = "gamma页面loadFromDB加载数据", notes = "gamma页面loadFromDB加载数据")
public Result gammaByDB(@RequestParam Integer sampleId, @RequestParam String dbName){
return gammaService.gammaByDB(dbName, sampleId);
}
@@ -237,10 +236,16 @@ public class GammaController {
@GetMapping("peakInformation")
@ApiOperation(value = "查看Peak Information页面数据", notes = "查看Peak Information页面数据")
- public Result peakInformation(@RequestParam Integer sampleId, String fileName) {
+ public Result> peakInformation(@RequestParam Integer sampleId, String fileName){
return gammaService.peakInformation(sampleId, fileName);
}
+ @GetMapping("exportPeakInformation")
+ public void exportPeakInformation(@RequestParam Integer sampleId, String fileName,
+ HttpServletResponse response){
+ gammaService.exportPeakInformation(sampleId, fileName, response);
+ }
+
@GetMapping("viewARR")
@ApiOperation(value = "查看ARR页面数据", notes = "查看ARR页面数据")
public void viewARR(Integer sampleId, HttpServletResponse response) {
@@ -259,6 +264,12 @@ public class GammaController {
return gammaService.radionuclideActivity(sampleId, fileName);
}
+ @GetMapping("exportRadionuclideActivity")
+ public void exportRadionuclideActivity(Integer sampleId, String fileName,
+ HttpServletResponse response){
+ gammaService.exportRadionuclideActivity(sampleId, fileName, response);
+ }
+
@GetMapping("Spectrum")
@ApiOperation(value = "查看Spectrum页面数据", notes = "查看Spectrum页面数据")
public Result Spectrum(Integer sampleId, String fileName) {
@@ -267,7 +278,7 @@ public class GammaController {
@GetMapping("sampleInformation")
@ApiOperation(value = "查看Sample Information页面数据", notes = "查看Sample Information页面数据")
- public Result sampleInformation(Integer sampleId, String fileName) {
+ public Result> sampleInformation(Integer sampleId, String fileName){
return gammaService.sampleInformation(sampleId, fileName);
}
@@ -278,16 +289,13 @@ public class GammaController {
@GetMapping("viewQCResult")
@ApiOperation(value = "查看QC Result页面数据", notes = "查看QC Result页面数据")
- public Result> viewQCResult(Integer sampleId, String fileName) {
+ public Result> viewQCResult(Integer sampleId, String fileName){
return gammaService.viewQCResult(sampleId, fileName);
}
@GetMapping("exportQCResult")
- public void exportQCResult(Integer sampleId, String fileName, HttpServletResponse response){
- Result> result = gammaService.viewQCResult(sampleId, fileName);
- List tableQCResults = result.getResult();
- if (CollUtil.isEmpty(tableQCResults))return;
- gammaService.exportQCResult(tableQCResults,response);
+ public void exportQCResult(Integer sampleId, String fileName,HttpServletResponse response){
+ gammaService.exportQCResult(sampleId,fileName,response);
}
@GetMapping("viewRLR")
diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java
index 0f70f3ca..ed097a43 100644
--- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java
+++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java
@@ -1,11 +1,14 @@
package org.jeecg.modules.controller;
import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.QueryRequest;
import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.SymbolConstant;
import org.jeecg.modules.entity.GardsSampleDataSpectrum;
import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.service.ISpectrumAnalysisService;
@@ -16,6 +19,10 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
@RestController
@RequestMapping("spectrumAnalysis")
@@ -93,24 +100,26 @@ public class SpectrumAnalysesController {
@GetMapping("viewSampleInformation")
@ApiOperation(value = "查看SampleInformation数据", notes = "查看SampleInformation数据")
- public Result viewSampleInformation(Integer sampleId) {
+ public Result> viewSampleInformation(Integer sampleId){
return spectrumAnalysisService.viewSampleInformation(sampleId);
}
+ @GetMapping("exportSampleInformation")
+ @ApiOperation(value = "导出SampleInformation数据", notes = "导出SampleInformation数据")
+ public void exportSampleInformation(Integer sampleId, HttpServletResponse response){
+ spectrumAnalysisService.exportSampleInformation(sampleId,response);
+ }
+
@GetMapping("viewQCResult")
@ApiOperation(value = "查看QC Result数据", notes = "查看QC Result数据")
- public Result viewQCResult(Integer sampleId) {
+ public Result> viewQCResult(Integer sampleId){
return spectrumAnalysisService.viewQCResult(sampleId);
}
-
@GetMapping("exportQCResult")
@ApiOperation(value = "导出QC Result数据", notes = "导出QC Result数据")
public void exportQCResult(Integer sampleId,HttpServletResponse response){
- Result result = spectrumAnalysisService.viewQCResult(sampleId);
- QCResult qcResult = result.getResult();
- if (ObjectUtil.isNull(qcResult))return;
- spectrumAnalysisService.exportQCResult(qcResult,response);
+ spectrumAnalysisService.exportQCResult(sampleId,response);
}
@GetMapping("viewRLR")
diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGammaService.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGammaService.java
index 7596d85a..5a6b007d 100644
--- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGammaService.java
+++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/IGammaService.java
@@ -82,24 +82,28 @@ public interface IGammaService{
Result viewComment(Integer sampleId, String fileName);
- Result peakInformation(Integer sampleId, String fileName);
+ Result> peakInformation(Integer sampleId, String fileName);
+
+ void exportPeakInformation(Integer sampleId, String fileName, HttpServletResponse response);
void viewARR(Integer sampleId, HttpServletResponse response);
Result viewRRR(Integer sampleId, String fileName);
- Result radionuclideActivity(Integer sampleId, String fileName);
+ Result> radionuclideActivity(Integer sampleId, String fileName);
+
+ void exportRadionuclideActivity(Integer sampleId, String fileName, HttpServletResponse response);
Result Spectrum(Integer sampleId, String fileName);
- Result