|
@@ -428,18 +428,34 @@ func GetChartSectionCombineData(chartInfo *data_manage.ChartInfo, mappingList []
|
|
|
}
|
|
|
// todo 根据日期变换得到最终日期
|
|
|
edbDataListTmp := make([]*data_manage.EdbDataList, 0)
|
|
|
- if dateConfItem.EdbInfoId > 0 {
|
|
|
- edbDataListTmp, ok1 = edbDataListMap[dateConfItem.EdbInfoId]
|
|
|
- if !ok1 {
|
|
|
- err = fmt.Errorf("指标%d的日期数据不存在", dateConfItem.EdbInfoId)
|
|
|
+ if dateConfItem.DateType == 0 {
|
|
|
+ if dateConfItem.EdbInfoId > 0 {
|
|
|
+ edbDataListTmp, ok1 = edbDataListMap[dateConfItem.EdbInfoId]
|
|
|
+ if !ok1 {
|
|
|
+ err = fmt.Errorf("指标%d的日期数据不存在", dateConfItem.EdbInfoId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ findDate, err = GetChartSectionSeriesDateByDateChange(dateConfItem.EdbInfoId, edbDataListTmp, dateConfItem.DateChange, dateConfItem.MoveForward)
|
|
|
+ if err != nil {
|
|
|
+ err = fmt.Errorf("指标%d的日期变换处理失败", dateConfItem.EdbInfoId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ err = fmt.Errorf("请选择指标")
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- findDate, err = GetChartSectionSeriesDateByDateChange(dateConfItem.EdbInfoId, edbDataListTmp, dateConfItem.DateChange, dateConfItem.MoveForward)
|
|
|
- if err != nil {
|
|
|
- err = fmt.Errorf("指标%d的日期变换处理失败", dateConfItem.EdbInfoId)
|
|
|
- return
|
|
|
+ } else if dateConfItem.DateType == 1 {
|
|
|
+ findDate, err = GetChartSectionSeriesDateByDateChange(dateConfItem.EdbInfoId, edbDataListTmp, dateConfItem.DateChange, dateConfItem.MoveForward)
|
|
|
+ if err != nil {
|
|
|
+ err = fmt.Errorf("指标%d的日期变换处理失败", dateConfItem.EdbInfoId)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else if dateConfItem.DateType == 2 {
|
|
|
+ if dateConfItem.StaticDate == "" {
|
|
|
+ err = fmt.Errorf("请输入固定日期")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ findDate = dateConfItem.StaticDate
|
|
|
}
|
|
|
}
|
|
|
findDateTime, _ := time.ParseInLocation(utils.FormatDate, findDate, time.Local)
|
|
@@ -634,7 +650,6 @@ func GetChartSectionCombineData(chartInfo *data_manage.ChartInfo, mappingList []
|
|
|
extraConfig.DateConfList[i].Frequency = edbItem.Frequency
|
|
|
extraConfig.DateConfList[i].EndDate = edbItem.EndDate
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|