Browse Source

默认公历

xyxie 11 months ago
parent
commit
3732bb396f
1 changed files with 10 additions and 18 deletions
  1. 10 18
      controllers/chart_info.go

+ 10 - 18
controllers/chart_info.go

@@ -43,7 +43,6 @@ func (this *ChartInfoController) ChartInfoDetail() {
 		return
 	}
 	chartInfoId, _ := this.GetInt("ChartInfoId")
-	edbInfoId := this.GetString("EdbInfoId")
 
 	var err error
 	chartInfo := new(models.ChartInfoView)
@@ -74,6 +73,9 @@ func (this *ChartInfoController) ChartInfoDetail() {
 	startYear := chartInfo.StartYear
 
 	calendar := this.GetString("Calendar")
+	if calendar == "" {
+		calendar = chartInfo.Calendar
+	}
 	if calendar == "" {
 		calendar = "公历"
 	}
@@ -93,23 +95,12 @@ func (this *ChartInfoController) ChartInfoDetail() {
 	resp := new(models.ChartInfoDetailResp)
 
 	mappingList := make([]*models.ChartEdbInfoMapping, 0)
-	if chartInfoId > 0 {
-		mappingList, err = models.GetChartEdbMappingList(chartInfoId)
-		if err != nil {
-			br.Msg = "获取失败"
-			br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
-			return
-		}
-	} else {
-		if edbInfoId != "" {
-			edbInfoIds := strings.Split(edbInfoId, ",")
-			mappingList, err = models.GetChartEdbMappingListByEdbInfoId(edbInfoIds)
-			if err != nil {
-				br.Msg = "获取失败"
-				br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
-				return
-			}
-		}
+
+	mappingList, err = models.GetChartEdbMappingList(chartInfoId)
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取图表,指标信息失败,Err:" + err.Error()
+		return
 	}
 
 	// 图表额外数据参数
@@ -166,6 +157,7 @@ func (this *ChartInfoController) ChartInfoDetail() {
 	if chartInfo.ChartType == 2 {
 		chartInfo.StartDate = startDate
 		chartInfo.EndDate = endDate
+		chartInfo.Calendar = calendar
 	}
 
 	// 获取图表中的指标数据