浏览代码

Merge branch 'bzq1/bug_6744_chart_time_cf' of eta_server/eta_api into debug

baoziqiang 3 月之前
父节点
当前提交
0d4d6dc08f
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 5 0
      controllers/data_manage/chart_info.go
  2. 2 1
      services/data/chart_info.go

+ 5 - 0
controllers/data_manage/chart_info.go

@@ -1327,6 +1327,11 @@ func (this *ChartInfoController) PreviewChartInfoDetail() {
 		mappingList[k] = v
 	}
 
+	if req.ChartType == utils.CHART_TYPE_SEASON && req.DateType == utils.DateTypeNYears {
+		// 季节性图表,要特殊处理起始日期, 最近N年
+		dateMax = time.Date(dateMax.Year()+1, 1, 1, 0, 0, 0, 0, time.Local)
+	}
+
 	// 开始/结束日期
 	startDate, endDate := utils.GetDateByDateTypeV2(req.DateType, req.StartDate, req.EndDate, req.StartYear, dateMax)
 	if startDate == "" {

+ 2 - 1
services/data/chart_info.go

@@ -11,12 +11,13 @@ import (
 	"eta/eta_api/services/data/data_manage_permission"
 	"eta/eta_api/utils"
 	"fmt"
-	"github.com/shopspring/decimal"
 	"math"
 	"sort"
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/shopspring/decimal"
 )
 
 func ChartInfoRefreshV1(chartInfoId int) (err error) {