|
@@ -901,6 +901,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
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
|
|
@@ -915,6 +916,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
quarterMap := make(map[string][]*edbDataModel.EdbDataList, 0)
|
|
|
|
|
|
//整理出日期
|
|
|
+ var startTmpT, endTmpT time.Time
|
|
|
idx := 1
|
|
|
chartLegendMap := make(map[string]int, 0)
|
|
|
for currentStartYear := startYear; currentStartYear <= endYear; currentStartYear++ {
|
|
@@ -953,6 +955,8 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
}
|
|
|
dataMap[showName] = item
|
|
|
fmt.Println("年份" + showName + "日期" + startStr + " " + endStr)
|
|
|
+ startTmpT = startT
|
|
|
+ endTmpT = endT
|
|
|
chartLegendMap[showName] = idx
|
|
|
idx++
|
|
|
if lastDateT.Before(endT) {
|
|
@@ -974,31 +978,18 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
yearDataListMap[lv.Year] = lv
|
|
|
}
|
|
|
|
|
|
- //判断哪些点应该落在同一条时间线上
|
|
|
- maxY := lastDateT.Year()
|
|
|
- changeFlag := false
|
|
|
- if lastDateT.Month() >= 11 {
|
|
|
- maxY = maxY + 1
|
|
|
- }
|
|
|
- if maxY < nowYear {
|
|
|
- changeFlag = true
|
|
|
- maxY = nowYear
|
|
|
- }
|
|
|
- endTmp := fmt.Sprintf("%d-%s", maxY, xEndDate)
|
|
|
- endTmpT, _ := time.Parse(utils.FormatDate, endTmp)
|
|
|
- minY := maxY
|
|
|
- if jumpYear == 1 {
|
|
|
- minY = maxY - 1
|
|
|
- }
|
|
|
- startTmp := fmt.Sprintf("%d-%s", minY, xStartDate)
|
|
|
- startTmpT, _ := time.Parse(utils.FormatDate, startTmp)
|
|
|
-
|
|
|
fmt.Println("横轴截取日" + startTmpT.Format(utils.FormatDate) + " " + endTmpT.Format(utils.FormatDate))
|
|
|
+ fmt.Printf("lastDateT.Year() 为%d \n", lastDateT.Year())
|
|
|
+ fmt.Printf("maxY 为%d \n", maxY)
|
|
|
for name, dateItem := range dataMap {
|
|
|
- lv, ok1 := yearDataListMap[dateItem.EndDate.Year()]
|
|
|
- if changeFlag {
|
|
|
- lv, ok1 = yearDataListMap[dateItem.StartDate.Year()]
|
|
|
+ tY := dateItem.EndDate.Year()
|
|
|
+ if lastDateT.Month() >= 11 {
|
|
|
+ if maxY > endTmpT.Year() {
|
|
|
+ tY = tY + 1
|
|
|
+ }
|
|
|
}
|
|
|
+ lv, ok1 := yearDataListMap[tY]
|
|
|
+ fmt.Printf("name %s yearDataListMap[%d]\n", name, tY)
|
|
|
if !ok1 {
|
|
|
continue
|
|
|
}
|