فهرست منبع

预测结果比对误差率调整 改成百分比 Excel导出调整

wangmiaomiao 9 ماه پیش
والد
کامیت
cb4b451177

+ 2 - 0
slibra-common/src/main/java/com/slibra/common/constant/MyConstants.java

@@ -7,6 +7,8 @@ public class MyConstants {
     public static final String QI_NIU_YUN_UPLOAD_URL = "userupload/";
     public static final String SUCCESS = "操作成功";
 
+    public static final String PERCENT_SYMBOL = "%";
+
     //报警计算使用的比例  默认是1.1倍
     public static final String XIAOSUANYAN_BZK = "15";
     public static final String XIAOSUANYAN_GKZ = "12";

+ 70 - 18
slibra-system/src/main/java/com/slibra/business/domain/TXinyiForecastComparison.java

@@ -1,7 +1,9 @@
 package com.slibra.business.domain;
 
 import java.math.BigDecimal;
+import java.util.Objects;
 
+import com.slibra.common.DecimalUtils;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -11,6 +13,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
 import com.slibra.common.annotation.Excel;
 import com.slibra.common.core.domain.BaseEntity;
 
+import static com.slibra.common.constant.MyConstants.PERCENT_SYMBOL;
+
 /**
  * 信义预测对比对象 t_xinyi_forecast_comparison
  * 
@@ -38,77 +42,89 @@ public class TXinyiForecastComparison extends BaseEntity
     private String category;
 
     /** 预测时间1 */
-    @Excel(name = "预测时间1")
+    @Excel(name = "预测1时间")
     private String forecastTimeOne;
 
     /** 实际值1 */
-    @Excel(name = "实际1")
+    @Excel(name = "实际1小时值")
     private BigDecimal realOne;
 
     /** 红杉预测值1 */
-    @Excel(name = "红杉预测值1")
+    @Excel(name = "TFT预测1小时值")
     private BigDecimal hsForecastOne;
 
     /** 红杉值1误差率 */
-    @Excel(name = "红杉值1误差率")
     private BigDecimal hsErrorRateOne;
 
+    @Excel(name = "TFT预测1小时误差")
+    private String hsErrorRateOneStr;
+
     /** 跃渊预测值1 */
-    @Excel(name = "跃渊预测值1")
+    @Excel(name = "LSTM预测1小时值")
     private BigDecimal yyForecastOne;
 
     /** 跃渊值1误差率 */
-    @Excel(name = "跃渊值1误差率")
     private BigDecimal yyErrorRateOne;
 
+    @Excel(name = "LSTM预测1小时误差")
+    private String yyErrorRateOneStr;
+
     /** 预测时间2 */
-    @Excel(name = "预测时间2")
+    @Excel(name = "预测2时间")
     private String forecastTimeTwo;
 
     /** 实际值2 */
-    @Excel(name = "实际2")
+    @Excel(name = "实际2小时值")
     private BigDecimal realTwo;
 
     /** 红杉预测值2 */
-    @Excel(name = "红杉预测值2")
+    @Excel(name = "TFT预测2小时值")
     private BigDecimal hsForecastTwo;
 
     /** 红杉值2误差率 */
-    @Excel(name = "红杉值2误差率")
     private BigDecimal hsErrorRateTwo;
 
+    @Excel(name = "TFT预测2小时误差")
+    private String hsErrorRateTwoStr;
+
     /** 跃渊预测值2 */
-    @Excel(name = "跃渊预测值2")
+    @Excel(name = "LSTM预测2小时值")
     private BigDecimal yyForecastTwo;
 
     /** 跃渊值2误差率 */
-    @Excel(name = "跃渊值2误差率")
     private BigDecimal yyErrorRateTwo;
 
+    @Excel(name = "LSTM预测2小时误差")
+    private String yyErrorRateTwoStr;
+
     /** 预测时间3 */
-    @Excel(name = "预测时间3")
+    @Excel(name = "预测3时间")
     private String forecastTimeThree;
 
     /** 实际值3 */
-    @Excel(name = "实际3")
+    @Excel(name = "实际3小时值")
     private BigDecimal realThree;
 
     /** 红杉预测值3 */
-    @Excel(name = "红杉预测值3")
+    @Excel(name = "TFT预测3小时值")
     private BigDecimal hsForecastThree;
 
     /** 红杉值3误差率 */
-    @Excel(name = "红杉值3误差率")
     private BigDecimal hsErrorRateThree;
 
+    @Excel(name = "TFT预测3小时误差")
+    private String hsErrorRateThreeStr;
+
     /** 跃渊预测值3 */
-    @Excel(name = "跃渊预测值3")
+    @Excel(name = "LSTM预测3小时值")
     private BigDecimal yyForecastThree;
 
     /** 跃渊值3误差率 */
-    @Excel(name = "跃渊值3误差率")
     private BigDecimal yyErrorRateThree;
 
+    @Excel(name = "LSTM预测3小时误差")
+    private String yyErrorRateThreeStr;
+
     /** 删除标志(0代表存在 2代表删除) */
     private Long delFlag;
 
@@ -124,4 +140,40 @@ public class TXinyiForecastComparison extends BaseEntity
     /** 截止时间 2024/06/18 13 格式的*/
     private String timeEnd;
 
+
+    public String getHsErrorRateOneStr() {
+        if(Objects.isNull(hsErrorRateOne))
+            return null;
+        return DecimalUtils.getAbsAndScale(hsErrorRateOne, 2) + PERCENT_SYMBOL;
+    }
+
+    public String getYyErrorRateOneStr() {
+        if(Objects.isNull(yyErrorRateOne))
+            return null;
+        return DecimalUtils.getAbsAndScale(yyErrorRateOne, 2) + PERCENT_SYMBOL;
+    }
+
+    public String getHsErrorRateTwoStr() {
+        if(Objects.isNull(hsErrorRateTwo))
+            return null;
+        return DecimalUtils.getAbsAndScale(hsErrorRateTwo, 2) + PERCENT_SYMBOL;
+    }
+
+    public String getYyErrorRateTwoStr() {
+        if(Objects.isNull(yyErrorRateTwo))
+            return null;
+        return DecimalUtils.getAbsAndScale(yyErrorRateTwo, 2) + PERCENT_SYMBOL;
+    }
+
+    public String getHsErrorRateThreeStr() {
+        if(Objects.isNull(hsErrorRateThree))
+            return null;
+        return DecimalUtils.getAbsAndScale(hsErrorRateThree, 2) + PERCENT_SYMBOL;
+    }
+
+    public String getYyErrorRateThreeStr() {
+        if(Objects.isNull(yyErrorRateThree))
+            return null;
+        return DecimalUtils.getAbsAndScale(yyErrorRateThree, 2) + PERCENT_SYMBOL;
+    }
 }