|
@@ -259,7 +259,7 @@ func RefreshAllPredictCalculate(edbInfoIdList []*EdbInfo, edbInfoId, source, sub
|
|
|
}()
|
|
|
|
|
|
latestDateStr, latestValue, err = refreshAllPredictCalculate(to, edbInfoIdList, edbInfoId, source, subSource, edbCode, formulaStr, startDate, edbInfoIdBytes, emptyType, maxEmptyType)
|
|
|
-
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -268,7 +268,7 @@ func refreshAllPredictCalculate(to orm.TxOrmer, edbInfoIdList []*EdbInfo, edbInf
|
|
|
fmt.Println("startDate:", startDate)
|
|
|
|
|
|
|
|
|
- var minLatestDate, minEndDate, maxStartDate time.Time
|
|
|
+ var minLatestDate, maxStartDate time.Time
|
|
|
dateList := make([]string, 0)
|
|
|
|
|
|
realSaveDataMap := make(map[string]map[int]float64)
|
|
@@ -276,7 +276,7 @@ func refreshAllPredictCalculate(to orm.TxOrmer, edbInfoIdList []*EdbInfo, edbInf
|
|
|
|
|
|
for edbInfoIndex, v := range edbInfoIdList {
|
|
|
|
|
|
- tmpLatestDate, tmpErr := time.ParseInLocation(utils.FormatDate, v.LatestDate, time.Local)
|
|
|
+
|
|
|
if tmpErr != nil {
|
|
|
err = errors.New(`最近的日期格式化失败;日期:` + v.LatestDate + `;err:` + tmpErr.Error())
|
|
|
return
|
|
@@ -300,6 +300,7 @@ func refreshAllPredictCalculate(to orm.TxOrmer, edbInfoIdList []*EdbInfo, edbInf
|
|
|
if minEndDate.IsZero() || tmpEndDate.Before(minEndDate) {
|
|
|
minEndDate = tmpEndDate
|
|
|
}
|
|
|
+ }*/
|
|
|
|
|
|
|
|
|
dataList, tmpErr := GetPredictEdbDataListAllByStartDate(v, 1, startDate)
|
|
@@ -331,6 +332,13 @@ func refreshAllPredictCalculate(to orm.TxOrmer, edbInfoIdList []*EdbInfo, edbInf
|
|
|
}
|
|
|
if edbInfoIndex == 0 {
|
|
|
dateList = append(dateList, dv.DataTime)
|
|
|
+ tmpDate, _ := time.ParseInLocation(utils.FormatDate, dv.DataTime, time.Local)
|
|
|
+ if minLatestDate.IsZero() || tmpDate.After(minLatestDate) {
|
|
|
+ minLatestDate = tmpDate
|
|
|
+ }
|
|
|
+ if maxStartDate.IsZero() || tmpDate.Before(maxStartDate) {
|
|
|
+ maxStartDate = tmpDate
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|