|
@@ -11,275 +11,6 @@ import (
|
|
|
"unicode"
|
|
|
)
|
|
|
|
|
|
-//
|
|
|
-//// OilSupplyAnalysisChartOneProcessor
|
|
|
-//// @Description: OilSupplyAnalysisChartOneProcessor处理器
|
|
|
-//type OilSupplyAnalysisChartOneProcessor struct{}
|
|
|
-//
|
|
|
-//func (p *OilSupplyAnalysisChartOneProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilSupplyAnalysisChartOne...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Oil And Gas Category"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Supply Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Supply Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Supply 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("OilSupplyAnalysisChartOneProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilSupplyAnalysisChartOneProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-//}
|
|
|
-//
|
|
|
-//// OilSupplyAnalysisChartTwoProcessor
|
|
|
-//// @Description: OilSupplyAnalysisChartTwoProcessor处理器
|
|
|
-//type OilSupplyAnalysisChartTwoProcessor struct{}
|
|
|
-//
|
|
|
-//func (p *OilSupplyAnalysisChartTwoProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilSupplyAnalysisChartTwoProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Region"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Supply Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Supply Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-1]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Supply Analysis "+indexNameColSuffix, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-1]), " ", ""), "")
|
|
|
-//
|
|
|
-// indexInfoMap := make(map[string]string)
|
|
|
-// indexInfoMap[indexCode] = indexName
|
|
|
-//
|
|
|
-// var indexInfoList []*models.IndexInfo
|
|
|
-// value, err := strconv.ParseFloat(rowData[len(rowData)-2], 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("OilSupplyAnalysisChartTwoProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilSupplyAnalysisChartTwoProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-//}
|
|
|
-//
|
|
|
-//// OilSupplyAnalysisChartThreeProcessor
|
|
|
-//// @Description: OilSupplyAnalysisChartThreeProcessor处理器
|
|
|
-//type OilSupplyAnalysisChartThreeProcessor struct{}
|
|
|
-//
|
|
|
-//func (p *OilSupplyAnalysisChartThreeProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilSupplyAnalysisChartThreeProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "CapacityDetail"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Supply Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Supply Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Supply 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("OilSupplyAnalysisChartThreeProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilSupplyAnalysisChartThreeProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-//}
|
|
|
-//
|
|
|
-//// OilSupplyAnalysisChartFourProcessor
|
|
|
-//// @Description: OilSupplyAnalysisChartFourProcessor处理器
|
|
|
-//type OilSupplyAnalysisChartFourProcessor struct{}
|
|
|
-//
|
|
|
-//func (p *OilSupplyAnalysisChartFourProcessor) Process(tableName string, sheetName string, rowIndex int, rowData []string) ([]models.BaseFromRzdData, error) {
|
|
|
-// utils.FileLog.Info("Processing OilSupplyAnalysisChartFourProcessor...")
|
|
|
-// if rowIndex < 1 {
|
|
|
-// return nil, nil
|
|
|
-// }
|
|
|
-//
|
|
|
-// frequency := "月度"
|
|
|
-// unit := "千桶每天"
|
|
|
-// indexNameColSuffix := "Oil Classification Group"
|
|
|
-// //indexNameColPrefix := "CountryRevisionGroup"
|
|
|
-//
|
|
|
-// // step_1: 分类
|
|
|
-// classifyId, err := dealClassify("cube dashboards", "Oil Supply Analysis")
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("classifyId: %v", classifyId)
|
|
|
-//
|
|
|
-// // step_2: 指标
|
|
|
-// // 指标名称
|
|
|
-// indexName := "Oil Supply Analysis" + "/" + indexNameColSuffix + "/" + rowData[len(rowData)-2]
|
|
|
-//
|
|
|
-// // 生成指标编码
|
|
|
-// indexCode, err := getIndexId("Oil Supply 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("OilSupplyAnalysisChartFourProcessor indexInfoList: %v", indexInfoList)
|
|
|
-//
|
|
|
-// // step_3: 指标数据
|
|
|
-// dataList, err := dealData(indexInfoList)
|
|
|
-// if err != nil {
|
|
|
-// return nil, err
|
|
|
-// }
|
|
|
-// utils.FileLog.Info("OilSupplyAnalysisChartFourProcessor dataList: %v", dataList)
|
|
|
-//
|
|
|
-// return dataList, err
|
|
|
-//}
|
|
|
-
|
|
|
// // OilDemandAnalysisContinentProcessor
|
|
|
// // @Description: OilDemandAnalysisContinentProcessor处理器
|
|
|
// type OilDemandAnalysisContinentProcessor struct{}
|