|
@@ -14,7 +14,7 @@ import (
|
|
|
type InterpolateStrategy struct{}
|
|
|
|
|
|
// Deal 空值填充:插值法填充
|
|
|
-func (i *InterpolateStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
+func (i *InterpolateStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*models.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
for _, v := range edbDataList {
|
|
|
if v.EdbInfoId != tmpConfig.StandardEdbInfoId {
|
|
|
if dataList, ok := v.DataList.([]*models.EdbDataList); ok {
|
|
@@ -179,7 +179,7 @@ func (i *InterpolateStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataL
|
|
|
type FillWithPreviousStrategy struct{}
|
|
|
|
|
|
// Deal 空值填充:前值填充
|
|
|
-func (f *FillWithPreviousStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
+func (f *FillWithPreviousStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*models.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
// 按自然日补充,再根据基准指标取对应数据
|
|
|
for _, v := range edbDataList {
|
|
|
if v.EdbInfoId != tmpConfig.StandardEdbInfoId {
|
|
@@ -302,7 +302,7 @@ func (f *FillWithPreviousStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edb
|
|
|
type FillWithNextStrategy struct{}
|
|
|
|
|
|
// Deal 空值填充:后值填充
|
|
|
-func (f *FillWithNextStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
+func (f *FillWithNextStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*models.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
// 按自然日补充,再根据基准指标取对应数据
|
|
|
for _, v := range edbDataList {
|
|
|
if v.EdbInfoId != tmpConfig.StandardEdbInfoId {
|
|
@@ -429,7 +429,7 @@ func (f *FillWithNextStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbData
|
|
|
type SetToZeroStrategy struct{}
|
|
|
|
|
|
// Deal 空值填充:设为0
|
|
|
-func (s *SetToZeroStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
+func (s *SetToZeroStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*models.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) (err error) {
|
|
|
// 按自然日补充,再根据基准指标取对应数据
|
|
|
for _, v := range edbDataList {
|
|
|
if v.EdbInfoId != tmpConfig.StandardEdbInfoId {
|
|
@@ -552,7 +552,7 @@ func (s *SetToZeroStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataLis
|
|
|
type DeleteDateStrategy struct{}
|
|
|
|
|
|
// Deal 删除日期
|
|
|
-func (d *DeleteDateStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*data_manage.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) error {
|
|
|
+func (d *DeleteDateStrategy) Deal(tmpConfig data_manage.AreaExtraConf, edbDataList []*models.ChartEdbInfoMapping, standardIndexMap map[string]*models.EdbDataList, startDate string, endDate string) error {
|
|
|
// 取所有指标的时间交集
|
|
|
// 创建一个 map 来保存每个时间点的出现次数
|
|
|
timeMap := make(map[string]int)
|