소스 검색

指标期数位移-预测指标

gmy 6 달 전
부모
커밋
93b5401473
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      models/predict_edb_data_calculate_phase_shift.go

+ 9 - 1
models/predict_edb_data_calculate_phase_shift.go

@@ -241,6 +241,10 @@ func refreshAllPredictCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, sub
 			if periods < dataLen {
 				newIndex := dataList[dataLen-periods-1]
 				resultMap[newIndex.DataTime] = currentIndex.Value
+
+				if strings.Contains(currentIndex.DataTime, fromEdbInfo.LatestDate) {
+					latestDateStr = newIndex.DataTime
+				}
 			} else {
 				moveNum = formulaInt - i
 
@@ -269,6 +273,10 @@ func refreshAllPredictCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, sub
 			if periods > 0 {
 				newIndex := dataList[dataLen-periods]
 				resultMap[newIndex.DataTime] = currentIndex.Value
+
+				if strings.Contains(currentIndex.DataTime, fromEdbInfo.LatestDate) {
+					latestDateStr = newIndex.DataTime
+				}
 			} else {
 				moveNum = formulaInt + 1 - (dataLen - i)
 				// 新数据须根据频度补充key
@@ -284,11 +292,11 @@ func refreshAllPredictCalculatePhaseShift(to orm.TxOrmer, edbInfoId, source, sub
 				}
 
 				format := newDate.Format(utils.FormatDate)
+				resultMap[format] = currentIndex.Value
 
 				if strings.Contains(currentIndex.DataTime, fromEdbInfo.LatestDate) {
 					latestDateStr = format
 				}
-				resultMap[format] = currentIndex.Value
 			}
 		}
 	}