|
@@ -784,11 +784,6 @@ func GetPredictDataListByPredictEdbInfo(edbInfo *EdbInfo, order int, startDate s
|
|
|
|
|
|
// GetPredictDataListByPredictEdbConfList 根据预测指标信息获取预测指标的数据,order:1升序,其余值为降序
|
|
|
func GetPredictDataListByPredictEdbConfList(edbInfo, sourceEdbInfoItem *EdbInfo, predictEdbConfList []*PredictEdbConfAndData, order int, startDate string) (dataList []*EdbInfoSearchData, err error, errMsg string) {
|
|
|
- if len(predictEdbConfList) == 0 {
|
|
|
- errMsg = "获取预测指标配置信息失败"
|
|
|
- err = errors.New(errMsg)
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
allDataList := make([]*EdbInfoSearchData, 0)
|
|
|
//获取指标数据(实际已生成)
|
|
@@ -820,10 +815,12 @@ func GetPredictDataListByPredictEdbConfList(edbInfo, sourceEdbInfoItem *EdbInfo,
|
|
|
endDateStr := edbInfo.EndDate //预测指标的结束日期
|
|
|
|
|
|
var predictMinValue, predictMaxValue float64
|
|
|
- predictDataList, predictMinValue, predictMaxValue, err = GetChartPredictEdbInfoDataListByConfList(predictEdbConfList, startDate, sourceEdbInfoItem.LatestDate, endDateStr, edbInfo.Frequency, allDataList)
|
|
|
-
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
+ // 如果有配置的预测规则,那么就进行预测
|
|
|
+ if len(predictEdbConfList) > 0 {
|
|
|
+ predictDataList, predictMinValue, predictMaxValue, err = GetChartPredictEdbInfoDataListByConfList(predictEdbConfList, startDate, sourceEdbInfoItem.LatestDate, endDateStr, edbInfo.Frequency, allDataList)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//order:1升序,其余值为降序
|