Browse Source

Merge branch 'feature/eta2.1.2_predit_edb' into debug

xyxie 6 months ago
parent
commit
9584242b87
2 changed files with 15 additions and 15 deletions
  1. 1 1
      logic/predict_edb.go
  2. 14 14
      models/edb_info.go

+ 1 - 1
logic/predict_edb.go

@@ -1123,7 +1123,7 @@ func AddStaticPredictEdbInfo(sourceEdbInfoId, classifyId int, edbName, frequency
 	edbCode := sourceEdbInfo.EdbCode + "_" + time.Now().Format(utils.FormatShortDateTimeUnSpace)
 
 	// 根据指标名称和指标ID校验库中是否还存在其他同名指标
-	existEdbName, err := CheckExistByEdbNameAndEdbInfoId(0, 0, edbName, lang)
+	existEdbName, err := CheckExistByEdbNameAndEdbInfoId(1, 0, edbName, lang)
 	if err != nil {
 		errMsg = "判断指标名称是否存在失败"
 		err = errors.New("判断指标名称是否存在失败,Err:" + err.Error())

+ 14 - 14
models/edb_info.go

@@ -1189,27 +1189,27 @@ func GetPredictDataListByPredictEdbConfList(edbInfo, sourceEdbInfoItem *EdbInfo,
 
 // GetPredictEdbDataListAll 获取该预测指标所有的数据 ,order:1升序,其余值为降序
 func GetPredictEdbDataListAll(edbInfo *EdbInfo, order int) (items []*EdbInfoSearchData, err error) {
-	if edbInfo.Source == utils.DATA_SOURCE_PREDICT { //普通的预测指标是没有入库数据的,直接往配置里面获取
+	/*if edbInfo.Source == utils.DATA_SOURCE_PREDICT { //普通的预测指标是没有入库数据的,直接往配置里面获取
 		items, _, err, _ = GetPredictDataListByPredictEdbInfo(edbInfo, 1, "")
-	} else {
-		items, err = GetEdbDataListAll(edbInfo.Source, edbInfo.SubSource, FindEdbDataListAllCond{
-			EdbInfoId: edbInfo.EdbInfoId,
-		}, order)
-	}
+	} else {*/
+	items, err = GetEdbDataListAll(edbInfo.Source, edbInfo.SubSource, FindEdbDataListAllCond{
+		EdbInfoId: edbInfo.EdbInfoId,
+	}, order)
+	//}
 	return
 }
 
 // GetPredictEdbDataListAllByStartDate 根据开始日期获取该预测指标所有的数据 ,order:1升序,其余值为降序
 func GetPredictEdbDataListAllByStartDate(edbInfo *EdbInfo, order int, startDate string) (items []*EdbInfoSearchData, err error) {
-	if edbInfo.Source == utils.DATA_SOURCE_PREDICT { //普通的预测指标是没有入库数据的,直接往配置里面获取
+	/*if edbInfo.Source == utils.DATA_SOURCE_PREDICT { //普通的预测指标是没有入库数据的,直接往配置里面获取
 		items, _, err, _ = GetPredictDataListByPredictEdbInfo(edbInfo, order, startDate)
-	} else {
-		items, err = GetEdbDataListAll(edbInfo.Source, edbInfo.SubSource, FindEdbDataListAllCond{
-			EdbInfoId:         edbInfo.EdbInfoId,
-			StartDataTime:     startDate,
-			StartDataTimeCond: ">=",
-		}, order)
-	}
+	} else {*/
+	items, err = GetEdbDataListAll(edbInfo.Source, edbInfo.SubSource, FindEdbDataListAllCond{
+		EdbInfoId:         edbInfo.EdbInfoId,
+		StartDataTime:     startDate,
+		StartDataTimeCond: ">=",
+	}, order)
+	//}
 	return
 }