Browse Source

fix:不走异步

Roc 3 weeks ago
parent
commit
4973f6b7ec
2 changed files with 4 additions and 3 deletions
  1. 4 2
      logic/ai_predict_model/index.go
  2. 0 1
      models/ai_predict_model/request/index.go

+ 4 - 2
logic/ai_predict_model/index.go

@@ -378,6 +378,7 @@ func handleTaskRecordSuccessByTrain(aiPredictModelImportData request.AiPredictMo
 			err = fmt.Errorf("数据日期解析失败, %v", e)
 			return
 		}
+		timestamp := tmpDate.UnixNano() / 1e6
 
 		dataList = append(dataList, &aiPredictModel.AiPredictModelIndexConfigTrainData{
 			//AiPredictModelDataId:  0,
@@ -391,7 +392,7 @@ func handleTaskRecordSuccessByTrain(aiPredictModelImportData request.AiPredictMo
 			DeviationRate:               tmpData.DeviationRate,
 			CreateTime:                  time.Now(),
 			ModifyTime:                  time.Now(),
-			DataTimestamp:               tmpData.DataTimestamp,
+			DataTimestamp:               timestamp,
 			Source:                      tmpData.Source,
 		})
 	}
@@ -463,6 +464,7 @@ func handleTaskRecordSuccessByRun(aiPredictModelImportData request.AiPredictMode
 			err = fmt.Errorf("数据日期解析失败, %v", e)
 			return
 		}
+		timestamp := tmpDate.UnixNano() / 1e6
 
 		dataList = append(dataList, &aiPredictModel.AiPredictModelData{
 			//AiPredictModelDataId:  0,
@@ -475,7 +477,7 @@ func handleTaskRecordSuccessByRun(aiPredictModelImportData request.AiPredictMode
 			DeviationRate:         tmpData.DeviationRate,
 			CreateTime:            time.Now(),
 			ModifyTime:            time.Now(),
-			DataTimestamp:         tmpData.DataTimestamp,
+			DataTimestamp:         timestamp,
 			Source:                tmpData.Source,
 		})
 	}

+ 0 - 1
models/ai_predict_model/request/index.go

@@ -49,7 +49,6 @@ type AiPredictModelData struct {
 	PredictValue  sql.NullFloat64 `description:"预测值"`
 	Direction     string          `description:"方向"`
 	DeviationRate string          `description:"偏差率"`
-	DataTimestamp int64           `description:"数据日期时间戳"`
 	Source        int             `description:"来源:1-月度预测(默认);2-日度预测"`
 }