|
@@ -601,7 +601,7 @@ func getEdbDataMapList(chartInfoId, chartType int, calendar, startDate, endDate
|
|
|
item.ConvertValue = v.ConvertValue
|
|
|
item.ConvertUnit = v.ConvertUnit
|
|
|
item.ConvertEnUnit = v.ConvertEnUnit
|
|
|
-
|
|
|
+
|
|
|
var startDateReal string
|
|
|
var diffSeconds int64
|
|
|
if chartType == 2 { //季节性图
|
|
@@ -800,6 +800,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*edbDataModel.EdbDataList, lates
|
|
|
}
|
|
|
endYear := lastDateT.Year()
|
|
|
nowYear := time.Now().Year()
|
|
|
+ chartLegendMaxYear := 0
|
|
|
dataMap := make(map[string]edbDataModel.QuarterXDateItem, 0)
|
|
|
|
|
|
quarterDataList := make([]*edbDataModel.QuarterData, 0)
|
|
@@ -844,6 +845,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*edbDataModel.EdbDataList, lates
|
|
|
EndDate: endT,
|
|
|
ShowName: showName,
|
|
|
}
|
|
|
+ chartLegendMaxYear = endT.Year()
|
|
|
dataMap[name] = item
|
|
|
chartLegendMap[name] = idx
|
|
|
idx++
|
|
@@ -853,9 +855,13 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*edbDataModel.EdbDataList, lates
|
|
|
}
|
|
|
}
|
|
|
lenYear := len(dataMap)
|
|
|
+ if chartLegendMaxYear > endYear {
|
|
|
+ chartLegendMaxYear = endYear
|
|
|
+ }
|
|
|
for k, v := range dataMap {
|
|
|
if i, ok := chartLegendMap[k]; ok {
|
|
|
- v.ChartLegend = strconv.Itoa(endYear - lenYear + i)
|
|
|
+ //v.ChartLegend = strconv.Itoa(endYear - lenYear + i)
|
|
|
+ v.ChartLegend = strconv.Itoa(chartLegendMaxYear - lenYear + i)
|
|
|
}
|
|
|
dataMap[k] = v
|
|
|
}
|
|
@@ -989,6 +995,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
}
|
|
|
endYear := lastDateT.Year()
|
|
|
nowYear := time.Now().Year()
|
|
|
+ chartLegendMaxYear := 0
|
|
|
dataMap := make(map[string]edbDataModel.QuarterXDateItem, 0)
|
|
|
|
|
|
quarterDataList := make([]*edbDataModel.QuarterData, 0)
|
|
@@ -1033,6 +1040,7 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
EndDate: endT,
|
|
|
ShowName: showName,
|
|
|
}
|
|
|
+ chartLegendMaxYear = endT.Year()
|
|
|
dataMap[showName] = item
|
|
|
fmt.Println("年份" + showName + "日期" + startStr + " " + endStr)
|
|
|
startTmpT = startT
|
|
@@ -1045,9 +1053,13 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
}
|
|
|
}
|
|
|
lenYear := len(dataMap)
|
|
|
+ if chartLegendMaxYear > endYear {
|
|
|
+ chartLegendMaxYear = endYear
|
|
|
+ }
|
|
|
for k, v := range dataMap {
|
|
|
if i, ok := chartLegendMap[k]; ok {
|
|
|
- v.ChartLegend = strconv.Itoa(endYear - lenYear + i)
|
|
|
+ //v.ChartLegend = strconv.Itoa(endYear - lenYear + i)
|
|
|
+ v.ChartLegend = strconv.Itoa(chartLegendMaxYear - lenYear + i)
|
|
|
}
|
|
|
dataMap[k] = v
|
|
|
}
|