Explorar el Código

性能验证添加接口返回值

Li Yuan hace 1 año
padre
commit
b7b4fa9e6b

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

@@ -95,11 +95,12 @@ public class PolynomialRegression extends Regression {
         for (int i = 0; i < parameters.length; i++) {
             function.append(Double.parseDouble(String.format("%." + scale + "f", parameters[i])));
 //            for (int j = 0; j < i; j++) {
+            if(i != 0){
                 function.append("x");
                 if (i - 1 > 0) {
                     function.append(String.format("<sup>%d</sup>",i));
                 }
-//            }
+            }
             if (i != (parameters.length - 1)) {
                 function.append(parameters[i+1]>0?"+":"");
             }

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

@@ -7,6 +7,8 @@ public class ReportDataDTO {
 
     private String reportResult;
 
+    private String shiYanShuJu;
+
 
     public TableDTO getDataDTO() {
         return dataDTO;
@@ -31,4 +33,12 @@ public class ReportDataDTO {
     public void setReportResult(String reportResult) {
         this.reportResult = reportResult;
     }
+
+    public String getShiYanShuJu() {
+        return shiYanShuJu;
+    }
+
+    public void setShiYanShuJu(String shiYanShuJu) {
+        this.shiYanShuJu = shiYanShuJu;
+    }
 }

+ 4 - 1
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/service/impl/PerformanceVerificationServiceImpl.java

@@ -37,7 +37,9 @@ public class PerformanceVerificationServiceImpl implements PerformanceVerificati
         Experimental experimental = experimentalRepository.load(id);
 
         ReportDataDTO dataDTO = ReportFactory.build(builder);
-        experimental.getData().setShiYanShuJu(JSONObject.toJSONString(builder.getDataArrays(), SerializerFeature.DisableCircularReferenceDetect));
+        String testingData = JSONObject.toJSONString(builder.getDataArrays(), SerializerFeature.DisableCircularReferenceDetect);
+        dataDTO.setShiYanShuJu(testingData);
+        experimental.getData().setShiYanShuJu(testingData);
         experimental.getData().setJiSuanJieGuo(JSONObject.toJSONString(dataDTO, SerializerFeature.DisableCircularReferenceDetect));
         experimental.getData().setShiYanJieLun(dataDTO.getReportResult());
         experimental.save();
@@ -81,6 +83,7 @@ public class PerformanceVerificationServiceImpl implements PerformanceVerificati
             builder.buildPVModel(object);
 
             ReportDataDTO dataDTO = ReportFactory.build(builder);
+            dataDTO.setShiYanShuJu(experimental.getData().getShiYanShuJu());
             experimental.getData().setJiSuanJieGuo(JSONObject.toJSONString(dataDTO, SerializerFeature.DisableCircularReferenceDetect));
             experimental.getData().setShiYanJieLun(builder.getPvModel().generateResult());
             experimental.save();