Browse Source

fix:预测指标无权限,不返回数据值

Roc 11 months ago
parent
commit
28cfa12f1f
1 changed files with 29 additions and 25 deletions
  1. 29 25
      controllers/data_manage/predict_edb_info.go

+ 29 - 25
controllers/data_manage/predict_edb_info.go

@@ -1508,36 +1508,40 @@ func (this *PredictEdbInfoController) DataList() {
 	button := data.GetPredictEdbOpButton(this.SysUser, edbInfo.SysUserId, fullEdb.HaveOperaAuth)
 	button.AddButton = false
 
-	dataList, _, _, err, _ := data.GetPredictDataListByPredictEdbInfo(edbInfo, startDate, endDate, isTimeBetween)
-	//lenDataList := len(dataList)
-	//if lenDataList > 0 {
-	//	tmpValue := dataList[lenDataList-1]
-	//
-	//	// 如果最大值 小于 预测值,那么将预测值作为最大值数据返回
-	//	if edbInfo.MaxValue < tmpValue.Value {
-	//		edbInfo.MaxValue = tmpValue.Value
-	//	}
-	//
-	//	// 如果最小值 大于 预测值,那么将预测值作为最小值数据返回
-	//	if edbInfo.MinValue > tmpValue.Value {
-	//		edbInfo.MinValue = tmpValue.Value
-	//	}
-	//}
-
-	// 季节性图、公历、农历处理
-	resultDataList, err := data.GetChartDataList(dataList, chartType, calendar, edbInfo.LatestDate, startDate)
-	if err != nil {
-		br.Msg = "获取失败"
-		br.ErrMsg = "获取失败,Err:" + err.Error()
-		return
-	}
-
 	resp := response.PredictEdbInfoDataResp{
 		EdbInfo:      fullEdb,
-		DataList:     resultDataList,
 		Button:       button,
 		ClassifyList: classifyList,
 	}
+
+	if fullEdb.HaveOperaAuth {
+		dataList, _, _, err, _ := data.GetPredictDataListByPredictEdbInfo(edbInfo, startDate, endDate, isTimeBetween)
+		//lenDataList := len(dataList)
+		//if lenDataList > 0 {
+		//	tmpValue := dataList[lenDataList-1]
+		//
+		//	// 如果最大值 小于 预测值,那么将预测值作为最大值数据返回
+		//	if edbInfo.MaxValue < tmpValue.Value {
+		//		edbInfo.MaxValue = tmpValue.Value
+		//	}
+		//
+		//	// 如果最小值 大于 预测值,那么将预测值作为最小值数据返回
+		//	if edbInfo.MinValue > tmpValue.Value {
+		//		edbInfo.MinValue = tmpValue.Value
+		//	}
+		//}
+
+		// 季节性图、公历、农历处理
+		resultDataList, err := data.GetChartDataList(dataList, chartType, calendar, edbInfo.LatestDate, startDate)
+		if err != nil {
+			br.Msg = "获取失败"
+			br.ErrMsg = "获取失败,Err:" + err.Error()
+			return
+		}
+
+		resp.DataList = resultDataList
+	}
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"