|
@@ -1761,7 +1761,12 @@ func GetChartPredictEdbInfoDataListByRuleAnnualValueInversion(edbInfoId int, con
|
|
|
}
|
|
|
|
|
|
yearVal := yearTotalMap[currentDate.Year()]
|
|
|
- yearVal = yearVal + val
|
|
|
+ if frequency == "周度" {
|
|
|
+
|
|
|
+ yearVal = yearVal + val/7
|
|
|
+ } else {
|
|
|
+ yearVal = yearVal + val
|
|
|
+ }
|
|
|
yearTotalMap[currentDate.Year()] = yearVal
|
|
|
dateTotalMap[currentDate] = yearVal
|
|
|
dateIndexMap[currentDate] = i
|
|
@@ -1785,12 +1790,16 @@ func GetChartPredictEdbInfoDataListByRuleAnnualValueInversion(edbInfoId int, con
|
|
|
}
|
|
|
|
|
|
currYearBalance := yearValueConfig - yearTotalMap[currDayTime.Year()]
|
|
|
+
|
|
|
|
|
|
var sum, avg float64
|
|
|
for _, year := range yearList {
|
|
|
yearTotal := yearTotalMap[year]
|
|
|
+
|
|
|
tmpDate := time.Date(year, currDayTime.Month(), currDayTime.Day(), 0, 0, 0, 0, currDayTime.Location())
|
|
|
+
|
|
|
dateTotal, ok := dateTotalMap[tmpDate]
|
|
|
+
|
|
|
if ok {
|
|
|
sum = sum + (yearTotal - dateTotal)
|
|
|
} else {
|
|
@@ -1800,6 +1809,7 @@ func GetChartPredictEdbInfoDataListByRuleAnnualValueInversion(edbInfoId int, con
|
|
|
for tmpDateTime := indexDateMap[tmpIndex+1]; tmpDateTime.Year() == year; tmpDateTime = indexDateMap[tmpIndex+1] {
|
|
|
dateTotal, ok = dateTotalMap[tmpDateTime]
|
|
|
if ok {
|
|
|
+
|
|
|
sum = sum + (yearTotal - dateTotal)
|
|
|
break
|
|
|
}
|
|
@@ -1808,9 +1818,13 @@ func GetChartPredictEdbInfoDataListByRuleAnnualValueInversion(edbInfoId int, con
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
avg = sum / float64(len(yearList))
|
|
|
+
|
|
|
|
|
|
tbVal := decimal.NewFromFloat(currYearBalance).Div(decimal.NewFromFloat(avg))
|
|
|
+
|
|
|
+ fmt.Printf("同比增速%.4f\n", tbVal11)*/
|
|
|
|
|
|
for k, currentDate := range dayList {
|
|
|
|