Browse Source

fix:插值法bug修复

Roc 1 year ago
parent
commit
28019ce32c

+ 2 - 2
models/edb_data_calculate_ljznczj.go

@@ -344,8 +344,8 @@ func (obj LjzNczj) refresh(to orm.TxOrmer, edbInfoId, source int, edbInfo, fromE
 			}
 
 			if itemDate.Equal(currTime) {
-				valueMap[itemDate] = yearMap[year]
-				dateList = append(dateList, itemDate)
+				tmpDateDataMap[itemDate] = yearMap[year]
+				tmpDateList = append(tmpDateList, itemDate)
 			}
 		}
 		for _, currTime := range tmpDateList {

+ 7 - 0
models/handle_data.go

@@ -85,6 +85,13 @@ func HandleDataByLinearRegression(edbInfoDataList []*EdbInfoSearchData, handleDa
 			}
 		}
 
+		// 最后将自己赋值
+		newList = append(newList, &EdbInfoSearchData{
+			EdbDataId: v.EdbDataId,
+			DataTime:  v.DataTime,
+			Value:     v.Value,
+		})
+
 		startEdbInfoData = v
 	}
 

+ 2 - 2
models/predict_edb_data_calculate_ljznczj.go

@@ -336,8 +336,8 @@ func (obj PredictLjzNczj) refresh(to orm.TxOrmer, edbInfoId, source int, edbInfo
 			}
 
 			if itemDate.Equal(currTime) {
-				valueMap[itemDate] = yearMap[year]
-				dateList = append(dateList, itemDate)
+				tmpDateDataMap[itemDate] = yearMap[year]
+				tmpDateList = append(tmpDateList, itemDate)
 			}
 		}
 		for _, currTime := range tmpDateList {