Ver código fonte

[task-1766] 性能验证模块 开发 (二期) / 【后端】验证报告的接口开发

liyuan 1 ano atrás
pai
commit
2f0109cf73

+ 7 - 6
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/LinearRangeEP6A.java

@@ -3,10 +3,7 @@ package com.lc.ibps.components.verification.model2;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.SerializerFeature;
 import com.lc.ibps.components.verification.regression.PolynomialRegression;
-import com.lc.ibps.components.verification.report.ChartDTO;
-import com.lc.ibps.components.verification.report.EchartsFreemarkerUtils;
-import com.lc.ibps.components.verification.report.ReportDataDTO;
-import com.lc.ibps.components.verification.report.TableDTO;
+import com.lc.ibps.components.verification.report.*;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.math3.stat.StatUtils;
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
@@ -153,6 +150,11 @@ public class LinearRangeEP6A extends PVModel {
         return table;
     }
 
+    @Override
+    public SheetDTO[] buildSheetDTO() {
+        return null;
+    }
+
     public Map<String, TableDTO> buildReportTableDTO(){
         Map<String, TableDTO> reports = new HashMap<>();
         reports.put("表1: 重复性差异检测结果",buildTable1DTO());
@@ -161,7 +163,6 @@ public class LinearRangeEP6A extends PVModel {
         return reports;
     }
 
-    @Override
     public Map<String, ChartDTO> buildChartDTO() {
         Map<String,ChartDTO> charts = new HashMap<>();
         charts.put("图1: 线性实验",buildChart1DTO());
@@ -282,7 +283,7 @@ public class LinearRangeEP6A extends PVModel {
 
 
         report.setDataDTO(tableDTO);
-        report.setReportDataDTO(stringTableDTOMap);
+//        report.setReportDataDTO(stringTableDTOMap);
         String s = JSONObject.toJSONString(report, SerializerFeature.DisableCircularReferenceDetect);
 
         System.out.println(s);

+ 3 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/PVModel.java

@@ -2,9 +2,11 @@ package com.lc.ibps.components.verification.model2;
 
 import com.lc.ibps.components.verification.funcs.xValue;
 import com.lc.ibps.components.verification.report.ChartDTO;
+import com.lc.ibps.components.verification.report.SheetDTO;
 import com.lc.ibps.components.verification.report.TableDTO;
 import org.apache.commons.math3.distribution.ChiSquaredDistribution;
 import org.apache.commons.math3.distribution.TDistribution;
+import org.apache.poi.ss.usermodel.Sheet;
 
 import java.util.Map;
 
@@ -50,6 +52,7 @@ public abstract class PVModel {
     public abstract TableDTO buildDataTableDTO();
     public abstract Map<String, TableDTO> buildReportTableDTO();
     public abstract Map<String, ChartDTO> buildChartDTO();
+    public abstract SheetDTO[] buildSheetDTO();
 
     public int getScale() {
         return scale;

+ 6 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/PrecisionEP15.java

@@ -1,6 +1,7 @@
 package com.lc.ibps.components.verification.model2;
 
 import com.lc.ibps.components.verification.report.ChartDTO;
+import com.lc.ibps.components.verification.report.SheetDTO;
 import com.lc.ibps.components.verification.report.TableDTO;
 import org.apache.commons.math3.stat.StatUtils;
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
@@ -69,6 +70,11 @@ public class PrecisionEP15 extends PVModel {
         return null;
     }
 
+    @Override
+    public SheetDTO[] buildSheetDTO() {
+        return null;
+    }
+
     private Map<String, TableDTO> buildTable1DTO(Item item) {
         Map<String, TableDTO> reports = new HashMap<>();
         TableDTO table = new TableDTO();

+ 6 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/TruenessEP15Patient.java

@@ -1,6 +1,7 @@
 package com.lc.ibps.components.verification.model2;
 
 import com.lc.ibps.components.verification.report.ChartDTO;
+import com.lc.ibps.components.verification.report.SheetDTO;
 import com.lc.ibps.components.verification.report.TableDTO;
 import org.apache.commons.math3.stat.StatUtils;
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
@@ -207,4 +208,9 @@ public class TruenessEP15Patient extends PVModel {
     public Map<String, ChartDTO> buildChartDTO() {
         return null;
     }
+
+    @Override
+    public SheetDTO[] buildSheetDTO() {
+        return null;
+    }
 }

+ 17 - 5
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/TruenessRefernece.java

@@ -1,6 +1,7 @@
 package com.lc.ibps.components.verification.model2;
 
 import com.lc.ibps.components.verification.report.ChartDTO;
+import com.lc.ibps.components.verification.report.SheetDTO;
 import com.lc.ibps.components.verification.report.TableDTO;
 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
 
@@ -208,11 +209,7 @@ public class TruenessRefernece extends PVModel {
 
     @Override
     public Map<String, TableDTO> buildReportTableDTO() {
-        Map<String, TableDTO> reports = new HashMap<>();
-        for (Item item : items) {
-            reports.putAll(buildTable1DTO(item));
-        }
-        return reports;
+        return null;
     }
 
     @Override
@@ -220,6 +217,21 @@ public class TruenessRefernece extends PVModel {
         return null;
     }
 
+    @Override
+    public SheetDTO[] buildSheetDTO() {
+        SheetDTO[] reports = new SheetDTO[items.size()];
+        for (int i=0; i<items.size();i++) {
+            final SheetDTO sheet = new SheetDTO();
+            Map<String, TableDTO> table = new HashMap<>();
+            table.putAll(buildTable1DTO(items.get(i)));
+            sheet.setReportDataDTO(table);
+            sheet.setTitle(items.get(i).name);
+            reports[i] = sheet;
+        }
+
+        return reports;
+    }
+
     private Map<String, TableDTO> buildTable1DTO(Item item) {
         Map<String, TableDTO> reports = new HashMap<>();
         TableDTO table = new TableDTO();

+ 5 - 14
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/report/ReportDataDTO.java

@@ -5,9 +5,8 @@ import java.util.Map;
 public class ReportDataDTO {
 
     private TableDTO   dataDTO;
-    private Map<String, TableDTO> reportDataDTO;
+    private SheetDTO[] sheetDTO;
 
-    private Map<String,ChartDTO> chartDataDTO;
 
     public TableDTO getDataDTO() {
         return dataDTO;
@@ -17,19 +16,11 @@ public class ReportDataDTO {
         this.dataDTO = dataDTO;
     }
 
-    public Map<String, TableDTO> getReportDataDTO() {
-        return reportDataDTO;
+    public SheetDTO[] getSheetDTO() {
+        return sheetDTO;
     }
 
-    public void setReportDataDTO(Map<String, TableDTO> reportDataDTO) {
-        this.reportDataDTO = reportDataDTO;
-    }
-
-    public Map<String, ChartDTO> getChartDataDTO() {
-        return chartDataDTO;
-    }
-
-    public void setChartDataDTO(Map<String, ChartDTO> chartDataDTO) {
-        this.chartDataDTO = chartDataDTO;
+    public void setSheetDTO(SheetDTO[] sheetDTO) {
+        this.sheetDTO = sheetDTO;
     }
 }

+ 1 - 2
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/report/ReportFactory.java

@@ -7,8 +7,7 @@ public class ReportFactory {
     public static ReportDataDTO build(PVItemBuilder builder){
         ReportDataDTO data = new ReportDataDTO();
         data.setDataDTO(builder.getPvModel().buildDataTableDTO());
-        data.setReportDataDTO(builder.getPvModel().buildReportTableDTO());
-        data.setChartDataDTO(builder.getPvModel().buildChartDTO());
+        data.setSheetDTO(builder.getPvModel().buildSheetDTO());
         return  data;
     }
 }

+ 46 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/report/SheetDTO.java

@@ -0,0 +1,46 @@
+package com.lc.ibps.components.verification.report;
+
+import java.util.Map;
+
+public class SheetDTO {
+
+    private String title;
+
+//    private String[] steps;
+
+    private Map<String, TableDTO> reportDataDTO;
+
+    private Map<String,ChartDTO> chartDataDTO;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+//    public String[] getSteps() {
+//        return steps;
+//    }
+//
+//    public void setSteps(String[] steps) {
+//        this.steps = steps;
+//    }
+
+    public Map<String, TableDTO> getReportDataDTO() {
+        return reportDataDTO;
+    }
+
+    public void setReportDataDTO(Map<String, TableDTO> reportDataDTO) {
+        this.reportDataDTO = reportDataDTO;
+    }
+
+    public Map<String, ChartDTO> getChartDataDTO() {
+        return chartDataDTO;
+    }
+
+    public void setChartDataDTO(Map<String, ChartDTO> chartDataDTO) {
+        this.chartDataDTO = chartDataDTO;
+    }
+}

+ 10 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/report/TableDTO.java

@@ -11,6 +11,8 @@ public class TableDTO {
 
     private Map<String, Object>[] list;
 
+    private String note;
+
     public void buildHeader(String[] h, Map<String,String[]> child){
         header = new Map[h.length];
         int k = 0;
@@ -78,4 +80,12 @@ public class TableDTO {
     public void setList(Map<String, Object>[] list) {
         this.list = list;
     }
+
+    public String getNote() {
+        return note;
+    }
+
+    public void setNote(String note) {
+        this.note = note;
+    }
 }