|
@@ -387,7 +387,23 @@ func refreshAllPredictCalculateNhcc(to orm.TxOrmer, edbInfo, firstEdbInfo, secon
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- latestDateStr = firstEdbInfo.LatestDate
|
|
|
+
|
|
|
+ latestDateA, _ := time.ParseInLocation(utils.FormatDate, firstEdbInfo.LatestDate, time.Local)
|
|
|
+ if existItemA.MoveValue != 0 {
|
|
|
+ latestDateA = latestDateA.AddDate(0, 0, existItemA.MoveValue)
|
|
|
+ }
|
|
|
+
|
|
|
+ latestDateB, _ := time.ParseInLocation(utils.FormatDate, secondEdbInfo.LatestDate, time.Local)
|
|
|
+ if existItemB.MoveValue != 0 {
|
|
|
+ latestDateB = latestDateA.AddDate(0, 0, existItemB.MoveValue)
|
|
|
+ }
|
|
|
+
|
|
|
+ if latestDateA.Before(latestDateB) {
|
|
|
+ latestDateStr = latestDateA.Format(utils.FormatDate)
|
|
|
+ }else{
|
|
|
+ latestDateStr = latestDateB.Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+
|
|
|
var dateArr []string
|
|
|
dataMap := make(map[string]*EdbDataPredictCalculateNhcc)
|
|
|
removeDataTimeMap := make(map[string]int)
|
|
@@ -472,7 +488,7 @@ func refreshAllPredictCalculateNhcc(to orm.TxOrmer, edbInfo, firstEdbInfo, secon
|
|
|
err = tmpErr
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if tmpEndDate.Before(nhccDate.EndDate) {
|
|
|
nhccDate.EndDate = tmpEndDate
|
|
|
}
|
|
@@ -540,7 +556,7 @@ func refreshAllPredictCalculateNhcc(to orm.TxOrmer, edbInfo, firstEdbInfo, secon
|
|
|
b2Decimal := decimal.NewFromFloat(b2Val)
|
|
|
|
|
|
val, _ := bDecimal.Sub(b2Decimal).RoundCeil(4).Float64()
|
|
|
- if firstEdbInfo.LatestDate == currDate {
|
|
|
+ if latestDateStr == currDate {
|
|
|
latestValue = val
|
|
|
}
|
|
|
|