|
@@ -11,542 +11,6 @@ import (
|
|
|
"unicode"
|
|
|
)
|
|
|
|
|
|
-// // OilDemandAnalysisContinentProcessor
|
|
|
-// // @Description: OilDemandAnalysisContinentProcessor处理器
|
|
|
-// type OilDemandAnalysisContinentProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisContinentProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisContinentProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Continent"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisContinentProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisContinentProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisRegionProcessor
|
|
|
-// // @Description: OilDemandAnalysisRegionProcessor处理器
|
|
|
-// type OilDemandAnalysisRegionProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisRegionProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisRegionProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Region"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisRegionProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisRegionProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisCountryProcessor
|
|
|
-// // @Description: OilDemandAnalysisCountryProcessor
|
|
|
-// type OilDemandAnalysisCountryProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisCountryProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisCountryProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Country"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisCountryProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisCountryProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisProductCategoryProcessor
|
|
|
-// // @Description: OilDemandAnalysisProductCategoryProcessor处理器
|
|
|
-// type OilDemandAnalysisProductCategoryProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisProductCategoryProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisProductCategoryProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Product category"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisProductCategoryProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisProductCategoryProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisProductDetailProcessor
|
|
|
-// // @Description: OilDemandAnalysisProductDetailProcessor处理器
|
|
|
-// type OilDemandAnalysisProductDetailProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisProductDetailProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisProductDetailProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Product detail"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisProductDetailProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisProductDetailProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisSectorCategoryProcessor
|
|
|
-// // @Description: OilDemandAnalysisSectorCategoryProcessor处理器
|
|
|
-// type OilDemandAnalysisSectorCategoryProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisSectorCategoryProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisSectorCategoryProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Sector category"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisSectorCategoryProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisSectorCategoryProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisSectorDetailProcessor
|
|
|
-// // @Description: OilDemandAnalysisSectorDetailProcessor处理器
|
|
|
-// type OilDemandAnalysisSectorDetailProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisSectorDetailProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisSectorDetailProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Sector detail"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisSectorDetailProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisSectorDetailProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// // OilDemandAnalysisScenarioProcessor
|
|
|
-// // @Description: OilDemandAnalysisScenarioProcessor处理器
|
|
|
-// type OilDemandAnalysisScenarioProcessor struct{}
|
|
|
-//
|
|
|
-// func (p *OilDemandAnalysisScenarioProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilDemandAnalysisScenarioProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Scenario"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Demand Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Demand Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Demand Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-2]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-1], 64)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// dataTime := rowData[0]
|
|
|
-// format, err := utils.ConvertDateFormat3(dataTime)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-//
|
|
|
-// indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
-// IndexName: indexName,
|
|
|
-// IndexCode: indexCode,
|
|
|
-// Value: value,
|
|
|
-// DataTime: format,
|
|
|
-// })
|
|
|
-//
|
|
|
-// indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisScenarioProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilDemandAnalysisScenarioProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-// }
|
|
|
-//
|
|
|
// // UpstreamSupplyOilQualityApiProcessor
|
|
|
// // @Description: UpstreamSupplyOilQualityApiProcessor处理器
|
|
|
// type UpstreamSupplyOilQualityApiProcessor struct{}
|