|
@@ -15,10 +15,9 @@ import (
|
|
|
)
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRule1(edbInfoId int, dataValue float64, startDate, endDate time.Time, frequency string, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList) {
|
|
|
+func GetChartPredictEdbInfoDataListByRule1(edbInfoId int, dataValue float64, dayList []time.Time, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList) {
|
|
|
newPredictEdbInfoData = predictEdbInfoData
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
predictEdbInfoData = make([]*models.EdbDataList, 0)
|
|
|
for k, v := range dayList {
|
|
|
newPredictEdbInfoData = append(newPredictEdbInfoData, &models.EdbDataList{
|
|
@@ -36,7 +35,7 @@ func GetChartPredictEdbInfoDataListByRule1(edbInfoId int, dataValue float64, sta
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleTb(edbInfoId int, tbValue float64, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleTb(edbInfoId int, tbValue float64, dayList []time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -44,7 +43,6 @@ func GetChartPredictEdbInfoDataListByRuleTb(edbInfoId int, tbValue float64, star
|
|
|
|
|
|
index := len(allDataList)
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
predictEdbInfoData = make([]*models.EdbDataList, 0)
|
|
|
for k, currentDate := range dayList {
|
|
|
|
|
@@ -163,7 +161,7 @@ func TbzDiv(a, b float64) (result float64) {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleTc(edbInfoId int, tcValue float64, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleTc(edbInfoId int, tcValue float64, dayList []time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -171,7 +169,6 @@ func GetChartPredictEdbInfoDataListByRuleTc(edbInfoId int, tcValue float64, star
|
|
|
|
|
|
index := len(allDataList)
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
predictEdbInfoData = make([]*models.EdbDataList, 0)
|
|
|
for k, currentDate := range dayList {
|
|
|
|
|
@@ -288,7 +285,7 @@ func TczDiv(a, b float64) (result float64) {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleHb(edbInfoId int, hbValue float64, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleHb(edbInfoId int, hbValue float64, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -296,7 +293,6 @@ func GetChartPredictEdbInfoDataListByRuleHb(edbInfoId int, hbValue float64, star
|
|
|
|
|
|
index := len(allDataList)
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
for k, currentDate := range dayList {
|
|
|
tmpK := index + k - 1
|
|
|
|
|
@@ -354,7 +350,7 @@ func HbzDiv(a, b float64) (result float64) {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleHc(edbInfoId int, hcValue float64, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleHc(edbInfoId int, hcValue float64, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -362,7 +358,6 @@ func GetChartPredictEdbInfoDataListByRuleHc(edbInfoId int, hcValue float64, star
|
|
|
|
|
|
index := len(allDataList)
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
for k, currentDate := range dayList {
|
|
|
tmpK := index + k - 1
|
|
|
|
|
@@ -414,7 +409,7 @@ func HczDiv(a, b float64) (result float64) {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleNMoveMeanValue(edbInfoId int, nValue int, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleNMoveMeanValue(edbInfoId int, nValue int, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -431,7 +426,6 @@ func GetChartPredictEdbInfoDataListByRuleNMoveMeanValue(edbInfoId int, nValue in
|
|
|
decimalN := decimal.NewFromInt(int64(nValue))
|
|
|
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
for k, currentDate := range dayList {
|
|
|
tmpIndex := lenAllData + k - 1
|
|
|
|
|
@@ -474,7 +468,7 @@ func GetChartPredictEdbInfoDataListByRuleNMoveMeanValue(edbInfoId int, nValue in
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleNLinearRegression(edbInfoId int, nValue int, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleNLinearRegression(edbInfoId int, nValue int, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
|
|
|
|
|
|
|
|
@@ -509,7 +503,6 @@ func GetChartPredictEdbInfoDataListByRuleNLinearRegression(edbInfoId int, nValue
|
|
|
a, b := getLinearResult(coordinateData)
|
|
|
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
for k, currentDate := range dayList {
|
|
|
tmpK := nValue + k + 1
|
|
|
|
|
@@ -598,7 +591,7 @@ func getLinearResult(s []Coordinate) (gradient, intercept float64) {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleTrendsHC(edbInfoId, configId int, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleTrendsHC(edbInfoId, configId int, startDate, endDate time.Time, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -619,7 +612,6 @@ func GetChartPredictEdbInfoDataListByRuleTrendsHC(edbInfoId, configId int, start
|
|
|
for _, v := range tmpPredictEdbRuleDataList {
|
|
|
hcDataMap[v.DataTime] = v.Value
|
|
|
}
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
for k, currentDate := range dayList {
|
|
|
|
|
|
tmpLenAllDataList := len(allDataList)
|
|
@@ -668,7 +660,7 @@ func GetChartPredictEdbInfoDataListByRuleTrendsHC(edbInfoId, configId int, start
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleFinalValueHc(edbInfoId int, finalValue float64, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleFinalValueHc(edbInfoId int, finalValue float64, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -676,7 +668,6 @@ func GetChartPredictEdbInfoDataListByRuleFinalValueHc(edbInfoId int, finalValue
|
|
|
|
|
|
index := len(allDataList)
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
lenDay := len(dayList)
|
|
|
if lenDay <= 0 {
|
|
|
return
|
|
@@ -754,7 +745,7 @@ type SeasonConf struct {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleSeason(edbInfoId int, yearsList []int, calendar string, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64, err error) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleSeason(edbInfoId int, yearsList []int, calendar string, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64, err error) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -809,8 +800,6 @@ func GetChartPredictEdbInfoDataListByRuleSeason(edbInfoId int, yearsList []int,
|
|
|
}
|
|
|
|
|
|
index := len(allDataList)
|
|
|
-
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
|
|
|
|
|
|
predictEdbInfoData = make([]*models.EdbDataList, 0)
|
|
@@ -942,7 +931,7 @@ type MoveAverageConf struct {
|
|
|
|
|
|
|
|
|
|
|
|
-func GetChartPredictEdbInfoDataListByRuleMoveAverageTb(edbInfoId int, nValue, year int, startDate, endDate time.Time, frequency string, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64, err error) {
|
|
|
+func GetChartPredictEdbInfoDataListByRuleMoveAverageTb(edbInfoId int, nValue, year int, dayList []time.Time, realPredictEdbInfoData, predictEdbInfoData []*models.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*models.EdbDataList, minValue, maxValue float64, err error) {
|
|
|
allDataList := make([]*models.EdbDataList, 0)
|
|
|
allDataList = append(allDataList, realPredictEdbInfoData...)
|
|
|
allDataList = append(allDataList, predictEdbInfoData...)
|
|
@@ -959,7 +948,6 @@ func GetChartPredictEdbInfoDataListByRuleMoveAverageTb(edbInfoId int, nValue, ye
|
|
|
decimalN := decimal.NewFromInt(int64(nValue))
|
|
|
|
|
|
|
|
|
- dayList := getPredictEdbDayList(startDate, endDate, frequency)
|
|
|
if len(dayList) <= 0 {
|
|
|
return
|
|
|
}
|