|
@@ -640,7 +640,9 @@ func getEdbDataMapList(chartInfoId, chartType int, calendar, startDate, endDate
|
|
|
err = errors.New("获取农历数据失败,Err:" + tmpErr.Error())
|
|
|
return
|
|
|
}
|
|
|
- quarterDataList, tErr := GetSeasonEdbInfoDataListByXDateNong(result, latestDate, seasonExtraConfig, calendarPreYear)
|
|
|
+ endDateTmp := dataList[len(dataList)-1].DataTime
|
|
|
+ endDateForm, _ := time.Parse(utils.FormatDate, endDateTmp)
|
|
|
+ quarterDataList, tErr := GetSeasonEdbInfoDataListByXDateNong(result, latestDate, seasonExtraConfig, calendarPreYear, int(endDateForm.Month()))
|
|
|
if tErr != nil {
|
|
|
err = errors.New("获取季节性图表数据失败,Err:" + tErr.Error())
|
|
|
return
|
|
@@ -767,6 +769,10 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*edbDataModel.EdbDataList, lates
|
|
|
ShowName: showName,
|
|
|
}
|
|
|
dataMap[name] = item
|
|
|
+ if lastDateT.Before(endT) {
|
|
|
+ //如果最新的日期在起始日之前,则跳出循环
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
for k, v := range dataMap {
|
|
|
if leftNameFlag {
|
|
@@ -851,7 +857,7 @@ func GetSeasonEdbInfoDataListByXDate(dataList []*edbDataModel.EdbDataList, lates
|
|
|
}
|
|
|
|
|
|
// GetSeasonEdbInfoDataListByXDateNong 季节性图的指标数据根据横轴选择农历时展示
|
|
|
-func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, latestDate time.Time, seasonExtraConfig string, calendarPreYear int) (quarterDataListSort edbDataModel.QuarterDataList, err error) {
|
|
|
+func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, latestDate time.Time, seasonExtraConfig string, calendarPreYear, thisMonth int) (quarterDataListSort edbDataModel.QuarterDataList, err error) {
|
|
|
xStartDate := "01-01"
|
|
|
xEndDate := "12-31"
|
|
|
jumpYear := 0
|
|
@@ -949,6 +955,10 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
ShowName: showName,
|
|
|
}
|
|
|
dataMap[showName] = item
|
|
|
+ if lastDateT.Before(endT) {
|
|
|
+ //如果最新的日期在起始日之前,则跳出循环
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
for k, v := range dataMap {
|
|
|
if leftNameFlag {
|
|
@@ -986,8 +996,14 @@ func GetSeasonEdbInfoDataListByXDateNong(result *edbDataModel.EdbDataResult, lat
|
|
|
|
|
|
for name, dateItem := range dataMap {
|
|
|
lv, ok1 := yearDataListMap[dateItem.EndDate.Year()]
|
|
|
+ if thisMonth > 11 {
|
|
|
+ lv, ok1 = yearDataListMap[dateItem.EndDate.Year()-1]
|
|
|
+ }
|
|
|
if dateItem.EndDate.Year() > maxY {
|
|
|
lv, ok1 = yearDataListMap[dateItem.StartDate.Year()]
|
|
|
+ if thisMonth > 11 {
|
|
|
+ lv, ok1 = yearDataListMap[dateItem.StartDate.Year()-1]
|
|
|
+ }
|
|
|
}
|
|
|
if !ok1 {
|
|
|
continue
|