chart_info_interface.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package data
  2. import (
  3. "eta_gn/eta_api/models/data_manage"
  4. "eta_gn/eta_api/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. 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) {
  13. edbDataListMap, edbList, err = GetEdbDataMapList(chartInfoId, chartType, calendar, startDate, endDate, mappingList, seasonExtraConfig)
  14. return
  15. }
  16. func (e *BaseChartInfoDataShow) GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (mappingList []*data_manage.ChartEdbInfoMapping, err error) {
  17. mappingList, err = data_manage.GetChartEdbMappingListByEdbInfoIdList(edbIdList)
  18. return
  19. }
  20. type ExcelChartInfoDataShow struct {
  21. DataListMap map[int][]*data_manage.EdbDataList
  22. MappingListTmp []*excel.ExcelChartEdb
  23. }
  24. 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) {
  25. edbDataListMap, edbList, err = GetBalanceExcelEdbDataMapList(chartInfoId, chartType, calendar, startDate, endDate, mappingList, seasonExtraConfig, e.DataListMap)
  26. return
  27. }
  28. func (e *ExcelChartInfoDataShow) GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (mappingList []*data_manage.ChartEdbInfoMapping, err error) {
  29. mappingList, err = TransferChartEdbToEdbMappingFormat(0, 0, e.MappingListTmp, e.DataListMap)
  30. return
  31. }