Selaa lähdekoodia

fix:stl趋势分解指标名增加Fraction参数

zqbao 1 päivä sitten
vanhempi
commit
7dd78f1997
1 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 6 3
      services/data/stl/stl.go

+ 6 - 3
services/data/stl/stl.go

@@ -170,6 +170,9 @@ func GenerateStlEdbData(req *request.StlConfigReq, adminId int) (resp *response.
 		return
 	}
 	defer os.Remove(saveFilePath)
+	trendName := fmt.Sprintf("%sTrend/F%g", edbInfo.EdbName, confReq.Fraction)
+	seasonalName := fmt.Sprintf("%sSeasonal/F%g", edbInfo.EdbName, confReq.Fraction)
+	residualName := fmt.Sprintf("%sResidual/F%g", edbInfo.EdbName, confReq.Fraction)
 	resp = new(response.StlPreviewResp)
 	resp.OriginEdbInfo.EdbInfoId = edbInfo.EdbInfoId
 	resp.OriginEdbInfo.Title = edbInfo.EdbName
@@ -182,7 +185,7 @@ func GenerateStlEdbData(req *request.StlConfigReq, adminId int) (resp *response.
 	resp.TrendChartInfo.DataList = trendChart.DataList
 	resp.TrendChartInfo.MaxData = trendChart.MaxData
 	resp.TrendChartInfo.MinData = trendChart.MinData
-	resp.TrendChartInfo.Title = edbInfo.EdbName + "Trend"
+	resp.TrendChartInfo.Title = trendName
 	resp.TrendChartInfo.ClassifyId = edbInfo.ClassifyId
 	resp.TrendChartInfo.Frequency = edbInfo.Frequency
 	resp.TrendChartInfo.Unit = edbInfo.Unit
@@ -190,14 +193,14 @@ func GenerateStlEdbData(req *request.StlConfigReq, adminId int) (resp *response.
 	resp.SeasonalChartInfo.MaxData = seasonalChart.MaxData
 	resp.SeasonalChartInfo.MinData = seasonalChart.MinData
 	resp.SeasonalChartInfo.ClassifyId = edbInfo.ClassifyId
-	resp.SeasonalChartInfo.Title = edbInfo.EdbName + "Seasonal"
+	resp.SeasonalChartInfo.Title = seasonalName
 	resp.SeasonalChartInfo.Frequency = edbInfo.Frequency
 	resp.SeasonalChartInfo.Unit = edbInfo.Unit
 	resp.ResidualChartInfo.DataList = residualChart.DataList
 	resp.ResidualChartInfo.MaxData = residualChart.MaxData
 	resp.ResidualChartInfo.MinData = residualChart.MinData
 	resp.ResidualChartInfo.ClassifyId = edbInfo.ClassifyId
-	resp.ResidualChartInfo.Title = edbInfo.EdbName + "Residual"
+	resp.ResidualChartInfo.Title = residualName
 	resp.ResidualChartInfo.Frequency = edbInfo.Frequency
 	resp.ResidualChartInfo.Unit = edbInfo.Unit
 	resp.EvaluationResult.Mean = strconv.FormatFloat(result.ResidualMean, 'f', 4, 64)