xyxie пре 1 година
родитељ
комит
f413c6dc4e
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      services/data/chart_info.go

+ 5 - 2
services/data/chart_info.go

@@ -1025,6 +1025,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *data_manage.EdbDataResult, late
 	itemLength := len(result.List[length-1].Items)
 	//获取数据的最新日期
 	lastDate := result.List[length-1].Items[itemLength-1].DataTime
+	maxY := result.List[length-1].Year
 	lastDateT, tmpErr := time.Parse(utils.FormatDate, lastDate)
 	if tmpErr != nil {
 		err = tmpErr
@@ -1123,8 +1124,10 @@ func GetSeasonEdbInfoDataListByXDateNong(result *data_manage.EdbDataResult, late
 	fmt.Println("横轴截取日" + startTmpT.Format(utils.FormatDate) + " " + endTmpT.Format(utils.FormatDate))
 	for name, dateItem := range dataMap {
 		tY := dateItem.EndDate.Year()
-		if lastDateT.Month() >= 11 && jumpYear == 0 {
-			tY = tY + 1
+		if lastDateT.Month() >= 11 {
+			if tY < maxY {
+				tY = tY + 1
+			}
 		}
 		lv, ok1 := yearDataListMap[tY]
 		fmt.Printf("name %s yearDataListMap[%d]\n", name, tY)