Browse Source

Merge branch 'feature/eta1.1.0_edb_classify' into debug

# Conflicts:
#	controllers/data_manage/predict_edb_info.go
#	models/data_manage/response/predit_edb_info.go
xyxie 1 year ago
parent
commit
b56277e47a

+ 20 - 3
controllers/data_manage/predict_edb_info.go

@@ -970,6 +970,15 @@ func (this *PredictEdbInfoController) Detail() {
 			calculateList[k] = v
 		}
 	}
+	fullEdb := new(data_manage.EdbInfoFullClassify)
+	classifyList, err, errMsg := data.GetFullClassifyByClassifyId(edbInfo.ClassifyId)
+	if err != nil {
+		br.Msg = err.Error()
+		br.ErrMsg = errMsg
+		return
+	}
+	fullEdb.EdbInfo = edbInfo
+	fullEdb.ClassifyList = classifyList
 
 	// 拟合残差计算相关系数
 	var correlationStr string
@@ -1015,7 +1024,7 @@ func (this *PredictEdbInfoController) Detail() {
 	}
 
 	resp := response.PredictEdbInfo{
-		EdbInfo:        *edbInfo,
+		EdbInfo:        *fullEdb,
 		RuleType:       ruleType,
 		FixedValue:     fixedValue,
 		CalculateList:  calculateList,
@@ -1342,9 +1351,17 @@ func (this *PredictEdbInfoController) DataList() {
 		br.ErrMsg = "获取失败,Err:" + err.Error()
 		return
 	}
-
+	fullEdb := new(data_manage.EdbInfoFullClassify)
+	classifyList, err, errMsg := data.GetFullClassifyByClassifyId(edbInfo.ClassifyId)
+	if err != nil {
+		br.Msg = err.Error()
+		br.ErrMsg = errMsg
+		return
+	}
+	fullEdb.EdbInfo = edbInfo
+	fullEdb.ClassifyList = classifyList
 	resp := response.PredictEdbInfoDataResp{
-		EdbInfo:  edbInfo,
+		EdbInfo:  fullEdb,
 		DataList: resultDataList,
 		Button:   button,
 	}

+ 2 - 2
models/data_manage/response/predit_edb_info.go

@@ -19,14 +19,14 @@ type PredictEdbInfoListResp struct {
 
 // PredictEdbInfoDataResp 预测指标数据返回
 type PredictEdbInfoDataResp struct {
-	EdbInfo  *data_manage.EdbInfo
+	EdbInfo  *data_manage.EdbInfoFullClassify
 	Button   data_manage.EdbClassifyItemsButton
 	DataList interface{}
 }
 
 // PredictEdbInfo 预测指标详情
 type PredictEdbInfo struct {
-	data_manage.EdbInfo
+	EdbInfo        data_manage.EdbInfoFullClassify
 	RuleType       int                                   `description:"预测规则,1:最新,2:固定值,3:同比,4:同差,5:环比,6:环差,7:N期移动均值,8:N期段线性外推值"`
 	FixedValue     float64                               `description:"固定值"`
 	CalculateList  []*data_manage.EdbInfoCalculateDetail `description:"关联指标"`