|
@@ -14,12 +14,6 @@ import (
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-var (
|
|
|
- yoyMap = map[int]string{
|
|
|
- 17: "同比",
|
|
|
- 18: "同差",
|
|
|
- }
|
|
|
-)
|
|
|
|
|
|
type RuleParams struct {
|
|
|
EdbInfoId int
|
|
@@ -1564,13 +1558,6 @@ func getReplaceValue(replaceValueMap map[string]float64, days, dayStep int, curr
|
|
|
// 4、上述“去年同期”如果没有严格对应的日期,则前后查找最近35天的值。
|
|
|
// 5、选择的同比指标日期需要与预测指标未来日期对应上,对应不上的不生成预测值。
|
|
|
func GetChartPredictEdbInfoDataListByRuleDynamicYOYComparisonOrDifference(ruleType, edbInfoId int, configValue string, dayList []time.Time, realPredictEdbInfoData []*data_manage.EdbDataList, existMap map[string]float64) (newPredictEdbInfoData []*data_manage.EdbDataList, minValue, maxValue float64, err error) {
|
|
|
- var yoyType string
|
|
|
- if _, ok := yoyMap[ruleType]; !ok {
|
|
|
- err = errors.New("计算规则不存在")
|
|
|
- return
|
|
|
- } else {
|
|
|
- yoyType = yoyMap[ruleType]
|
|
|
- }
|
|
|
//预测指标的去年同期数据
|
|
|
baseDynamicDataList := make(map[string]decimal.Decimal, len(dayList))
|
|
|
DynamicCalculateDataList := make(map[string]decimal.Decimal, len(dayList))
|