chart_info_interface.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package data
  2. import (
  3. "eta/eta_mobile/models/data_manage"
  4. "eta/eta_mobile/models/data_manage/excel"
  5. )
  6. type ChartInfoDataShow interface {
  7. GetEdbDataMapList(chartInfoId, chartType int, calendar, startDate, endDate string, mappingList []*data_manage.ChartEdbInfoMapping, seasonExtraConfig string) (edbDataListMap map[int][]*data_manage.EdbDataList, edbList []*data_manage.ChartEdbInfoMapping, err error)
  8. GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (mappingList []*data_manage.ChartEdbInfoMapping, err error)
  9. }
  10. type BaseChartInfoDataShow struct {
  11. }
  12. // GetEdbDataMapList 获取指标最后的基础数据
  13. func (e *BaseChartInfoDataShow) GetEdbDataMapList(chartInfoId, chartType int, calendar, startDate, endDate string, mappingList []*data_manage.ChartEdbInfoMapping, seasonExtraConfig string) (edbDataListMap map[int][]*data_manage.EdbDataList, edbList []*data_manage.ChartEdbInfoMapping, err error) {
  14. // 指标对应的所有数据
  15. edbDataListMap, edbList, err = GetEdbDataMapList(chartInfoId, chartType, calendar, startDate, endDate, mappingList, seasonExtraConfig)
  16. return
  17. }
  18. // GetChartEdbMappingListByEdbInfoIdList 获取指标最后的基础数据
  19. func (e *BaseChartInfoDataShow) GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (mappingList []*data_manage.ChartEdbInfoMapping, err error) {
  20. mappingList, err = data_manage.GetChartEdbMappingListByEdbInfoIdList(edbIdList)
  21. return
  22. }
  23. type ExcelChartInfoDataShow struct {
  24. DataListMap map[int][]*data_manage.EdbDataList
  25. MappingListTmp []*excel.ExcelChartEdb
  26. }
  27. // GetEdbDataMapList 获取指标最后的基础数据
  28. func (e *ExcelChartInfoDataShow) GetEdbDataMapList(chartInfoId, chartType int, calendar, startDate, endDate string, mappingList []*data_manage.ChartEdbInfoMapping, seasonExtraConfig string) (edbDataListMap map[int][]*data_manage.EdbDataList, edbList []*data_manage.ChartEdbInfoMapping, err error) {
  29. // 指标对应的所有数据
  30. edbDataListMap, edbList, err = GetBalanceExcelEdbDataMapList(chartInfoId, chartType, calendar, startDate, endDate, mappingList, seasonExtraConfig, e.DataListMap)
  31. return
  32. }
  33. // GetChartEdbMappingListByEdbInfoIdList 获取指标最后的基础数据
  34. func (e *ExcelChartInfoDataShow) GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (mappingList []*data_manage.ChartEdbInfoMapping, err error) {
  35. // 指标对应的所有数据
  36. mappingList, err = TransferChartEdbToEdbMappingFormat(0, 0, e.MappingListTmp, e.DataListMap)
  37. return
  38. }