Browse Source

Merge branch 'pool/337' into debug

# Conflicts:
#	services/data/stl/stl.go
Roc 1 month ago
parent
commit
3cdf358037
1 changed files with 2 additions and 2 deletions
  1. 2 2
      services/data/stl/stl.go

+ 2 - 2
services/data/stl/stl.go

@@ -69,7 +69,7 @@ func GenerateStlEdbData(req *request.StlConfigReq, adminId int) (resp *response.
 	case LAST_N_YEARS:
 		condition += " AND data_time >=?"
 		year := time.Now().Year()
-		lastNyear, er := strconv.Atoi(confReq.LastNYear)
+		lastNyear, er := strconv.Atoi(req.LastNYear)
 		if er != nil {
 			msg = "最近N年输入不合法"
 			err = er
@@ -158,7 +158,7 @@ func GenerateStlEdbData(req *request.StlConfigReq, adminId int) (resp *response.
 		msg = "保存数据到Excel失败"
 		return
 	}
-	//defer os.Remove(loadFilePath)
+	defer os.Remove(loadFilePath)
 
 	saveFilePath := exPath + "/" + strconv.Itoa(adminId) + "_" + time.Now().Format(utils.FormatDateTimeUnSpace) + "_res" + ".xlsx"
 	result, err := execStlPythonCode(loadFilePath, saveFilePath, confReq.Period, confReq.Seasonal, confReq.Trend, confReq.TrendDeg, confReq.SeasonalDeg, confReq.LowPassDeg, confReq.Fraction, confReq.Robust)