|
@@ -32,8 +32,8 @@ func AddPredictEdbInfo(sourceEdbInfoId, classifyId int, edbName string, ruleList
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
|
- if !utils.InArrayByStr([]string{"日度", "周度", "月度"}, sourceEdbInfo.Frequency) {
|
|
|
- errMsg = "预测指标只支持选择日度、周度、月度的指标"
|
|
|
+ if !utils.InArrayByStr([]string{"日度", "周度", "月度", "年度"}, sourceEdbInfo.Frequency) {
|
|
|
+ errMsg = "预测指标只支持选择日度、周度、月度、年度的指标"
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
@@ -154,6 +154,13 @@ func AddPredictEdbInfo(sourceEdbInfoId, classifyId int, edbName string, ruleList
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if sourceEdbInfo.Frequency == "年度" && utils.InArrayByInt([]int{5, 6, 9, 11, 12}, v.RuleType) {
|
|
|
+ errMsg = "环比、环差、动态环差、季节性、移动平均同比不支持年度指标"
|
|
|
+ err = errors.New(errMsg)
|
|
|
+ return
|
|
|
+ }
|
|
|
switch v.RuleType {
|
|
|
case 8:
|
|
|
valInt, tmpErr := strconv.Atoi(v.Value)
|
|
@@ -389,8 +396,8 @@ func EditPredictEdbInfo(edbInfoId, classifyId int, edbName string, ruleList []mo
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
|
- if !utils.InArrayByStr([]string{"日度", "周度", "月度"}, sourceEdbInfo.Frequency) {
|
|
|
- errMsg = "预测指标只支持选择日度、周度、月度的指标"
|
|
|
+ if !utils.InArrayByStr([]string{"日度", "周度", "月度", "年度"}, sourceEdbInfo.Frequency) {
|
|
|
+ errMsg = "预测指标只支持选择日度、周度、月度、年度的指标"
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
@@ -434,6 +441,13 @@ func EditPredictEdbInfo(edbInfoId, classifyId int, edbName string, ruleList []mo
|
|
|
err = errors.New(errMsg)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ if sourceEdbInfo.Frequency == "年度" && utils.InArrayByInt([]int{5, 6, 9, 11, 12}, v.RuleType) {
|
|
|
+ errMsg = "环比、环差、动态环差、季节性、移动平均同比不支持年度指标"
|
|
|
+ err = errors.New(errMsg)
|
|
|
+ return
|
|
|
+ }
|
|
|
switch v.RuleType {
|
|
|
case 8:
|
|
|
valInt, tmpErr := strconv.Atoi(v.Value)
|