|
@@ -21,6 +21,7 @@ var (
|
|
IndexNameColOne: "Index",
|
|
IndexNameColOne: "Index",
|
|
IndexNameColTwo: "Index 7DMA",
|
|
IndexNameColTwo: "Index 7DMA",
|
|
IndexPrefix: "Road Index",
|
|
IndexPrefix: "Road Index",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 5,
|
|
Rows: 5,
|
|
IndexRow: 2,
|
|
IndexRow: 2,
|
|
DataOneRow: 3,
|
|
DataOneRow: 3,
|
|
@@ -33,6 +34,7 @@ var (
|
|
IndexNameColOne: "Active Fleet",
|
|
IndexNameColOne: "Active Fleet",
|
|
IndexNameColTwo: "Active Fleet 7DMA",
|
|
IndexNameColTwo: "Active Fleet 7DMA",
|
|
IndexPrefix: "Road Active Fleet",
|
|
IndexPrefix: "Road Active Fleet",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 5,
|
|
Rows: 5,
|
|
IndexRow: 2,
|
|
IndexRow: 2,
|
|
DataOneRow: 3,
|
|
DataOneRow: 3,
|
|
@@ -45,6 +47,7 @@ var (
|
|
IndexNameColOne: "Index",
|
|
IndexNameColOne: "Index",
|
|
IndexNameColTwo: "Index 7DMA",
|
|
IndexNameColTwo: "Index 7DMA",
|
|
IndexPrefix: "Aviation Index",
|
|
IndexPrefix: "Aviation Index",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 5,
|
|
Rows: 5,
|
|
IndexRow: 2,
|
|
IndexRow: 2,
|
|
DataOneRow: 3,
|
|
DataOneRow: 3,
|
|
@@ -57,6 +60,7 @@ var (
|
|
IndexNameColOne: "Active Fleet",
|
|
IndexNameColOne: "Active Fleet",
|
|
IndexNameColTwo: "Active Fleet 7DMA",
|
|
IndexNameColTwo: "Active Fleet 7DMA",
|
|
IndexPrefix: "Aviation Active Fleet",
|
|
IndexPrefix: "Aviation Active Fleet",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 5,
|
|
Rows: 5,
|
|
IndexRow: 2,
|
|
IndexRow: 2,
|
|
DataOneRow: 3,
|
|
DataOneRow: 3,
|
|
@@ -69,6 +73,7 @@ var (
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexPrefix: "Gasoline Demand",
|
|
IndexPrefix: "Gasoline Demand",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 6,
|
|
Rows: 6,
|
|
IndexRow: 3,
|
|
IndexRow: 3,
|
|
DataOneRow: 4,
|
|
DataOneRow: 4,
|
|
@@ -81,6 +86,7 @@ var (
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexPrefix: "Demand Diesel",
|
|
IndexPrefix: "Demand Diesel",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 6,
|
|
Rows: 6,
|
|
IndexRow: 3,
|
|
IndexRow: 3,
|
|
DataOneRow: 4,
|
|
DataOneRow: 4,
|
|
@@ -93,6 +99,7 @@ var (
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexPrefix: "Demand Jet Fuel",
|
|
IndexPrefix: "Demand Jet Fuel",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 6,
|
|
Rows: 6,
|
|
IndexRow: 3,
|
|
IndexRow: 3,
|
|
DataOneRow: 4,
|
|
DataOneRow: 4,
|
|
@@ -105,6 +112,7 @@ var (
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColOne: "Demand",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexNameColTwo: "Demand 7DMA",
|
|
IndexPrefix: "Demand Maritime Bunker",
|
|
IndexPrefix: "Demand Maritime Bunker",
|
|
|
|
+ BeginRow: 4,
|
|
Rows: 6,
|
|
Rows: 6,
|
|
IndexRow: 3,
|
|
IndexRow: 3,
|
|
DataOneRow: 4,
|
|
DataOneRow: 4,
|
|
@@ -120,6 +128,7 @@ type config struct {
|
|
IndexNameColOne string
|
|
IndexNameColOne string
|
|
IndexNameColTwo string
|
|
IndexNameColTwo string
|
|
IndexPrefix string
|
|
IndexPrefix string
|
|
|
|
+ BeginRow int
|
|
Rows int
|
|
Rows int
|
|
IndexRow int
|
|
IndexRow int
|
|
DataOneRow int
|
|
DataOneRow int
|
|
@@ -129,12 +138,12 @@ type config struct {
|
|
type OilDemandSignalsWeeklyReportProcessor struct {
|
|
type OilDemandSignalsWeeklyReportProcessor struct {
|
|
}
|
|
}
|
|
|
|
|
|
-func (p *OilDemandSignalsWeeklyReportProcessor) Process(tableName string) (list []models.BaseFromRzdData, err error) {
|
|
+func (p *OilDemandSignalsWeeklyReportProcessor) Process(tableName string) (err error) {
|
|
var fileName string
|
|
var fileName string
|
|
|
|
|
|
fileName = tableName + "_" + utils.GetCurrentYearMonth() + ".xlsx"
|
|
fileName = tableName + "_" + utils.GetCurrentYearMonth() + ".xlsx"
|
|
filePath := filepath.Join(excelDir, fileName)
|
|
filePath := filepath.Join(excelDir, fileName)
|
|
- if _, err := os.Stat(filePath); os.IsNotExist(err) {
|
|
+ if _, err = os.Stat(filePath); os.IsNotExist(err) {
|
|
utils.FileLog.Error("文件不存在: %v", err)
|
|
utils.FileLog.Error("文件不存在: %v", err)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -151,7 +160,9 @@ func (p *OilDemandSignalsWeeklyReportProcessor) Process(tableName string) (list
|
|
utils.FileLog.Error("获取分类Id失败: %v", err)
|
|
utils.FileLog.Error("获取分类Id失败: %v", err)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
for _, sheetName := range sheetNames {
|
|
for _, sheetName := range sheetNames {
|
|
|
|
+ var indexMap = make(map[string]*models.IndexInfo)
|
|
if sheetName == "Content" {
|
|
if sheetName == "Content" {
|
|
utils.FileLog.Info("跳过工作表:", sheetName)
|
|
utils.FileLog.Info("跳过工作表:", sheetName)
|
|
continue
|
|
continue
|
|
@@ -163,190 +174,161 @@ func (p *OilDemandSignalsWeeklyReportProcessor) Process(tableName string) (list
|
|
utils.FileLog.Error("获取工作表数据时出错: %v", excelErr)
|
|
utils.FileLog.Error("获取工作表数据时出错: %v", excelErr)
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
- var indexData []models.BaseFromRzdData
|
|
+ sheetConfig := OilDemandSignalsWeeklyReportConfigMap[sheetName]
|
|
- for rowIndex, rowData := range dataRows[:] {
|
|
+ for _, rowData := range dataRows[sheetConfig.BeginRow:] {
|
|
- if rowIndex < 4 {
|
|
+
|
|
- return nil, nil
|
|
+ less := sheetConfig.Rows - len(rowData)
|
|
|
|
+ if less > 0 {
|
|
|
|
+ for i := 0; i < less; i++ {
|
|
|
|
+ rowData = append(rowData, "")
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
+
|
|
- frequency := "日度"
|
|
+ re := regexp.MustCompile(`^\d*\.?\d*\s*$`)
|
|
- unit := "辆"
|
|
+ if !re.MatchString(strings.TrimSpace(rowData[sheetConfig.DataOneRow])) || !re.MatchString(strings.TrimSpace(rowData[sheetConfig.DataTwoRow])) {
|
|
- indexNameColOne := "Active Fleet"
|
|
+ utils.FileLog.Error("数据格式错误:", fmt.Sprintf("%v", rowData))
|
|
- indexNameColTwo := "Active Fleet 7DMA"
|
|
+ continue
|
|
-
|
|
|
|
-
|
|
|
|
- classifyId, err := dealClassify(tableName, sheetName)
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
}
|
|
}
|
|
- utils.FileLog.Info("classifyId: %v", classifyId)
|
|
+ classifyId := classifyIds[sheetName]
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
- indexNameOne := sheetName + "/" + rowData[len(rowData)-3] + "/" + indexNameColOne
|
|
+ indexNameOne := sheetName + "/" + rowData[sheetConfig.IndexRow] + "/" + sheetConfig.IndexNameColOne
|
|
- indexNameTwo := sheetName + "/" + rowData[len(rowData)-3] + "/" + indexNameColTwo
|
|
+ indexNameTwo := sheetName + "/" + rowData[sheetConfig.IndexRow] + "/" + sheetConfig.IndexNameColTwo
|
|
-
|
|
|
|
|
|
|
|
- indexCodeOne, err := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), indexNameColOne)
|
|
+ indexCodeOne := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), sheetConfig.IndexNameColOne)
|
|
- indexCodeTwo, err := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), indexNameColTwo)
|
|
+ indexCodeTwo := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), sheetConfig.IndexNameColTwo)
|
|
-
|
|
+ dataTime := rowData[sheetConfig.DateRow]
|
|
- var indexInfoList []*models.IndexInfo
|
|
+ date, _, convertErr := utils.ConvertDateFormat(dataTime)
|
|
- valueOne, err := strconv.ParseFloat(strings.ReplaceAll(rowData[len(rowData)-2], ",", ""), 64)
|
|
+ if convertErr != nil {
|
|
- if err != nil {
|
|
+ utils.FileLog.Error(fmt.Sprintf("转换时间数据失败,index_code:%s,time_value:%s err:%v", indexCodeOne, dataTime, convertErr))
|
|
- utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeOne, rowData[len(rowData)-2], err))
|
|
+ continue
|
|
- return nil, err
|
|
|
|
}
|
|
}
|
|
-
|
|
+ if rowData[sheetConfig.DataOneRow] != "" {
|
|
- dataTimeOne := rowData[1]
|
|
+ valueOne, parseErr := strconv.ParseFloat(strings.ReplaceAll(rowData[sheetConfig.DataOneRow], ",", ""), 64)
|
|
- formatOne, err := utils.ConvertDateFormat(dataTimeOne)
|
|
+ if parseErr != nil {
|
|
- if err != nil {
|
|
+ utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeOne, rowData[sheetConfig.DataOneRow], err))
|
|
- utils.FileLog.Error(fmt.Sprintf("转换时间数据失败,index_code:%s,time_value:%s err:%v", indexCodeOne, dataTimeOne, err))
|
|
+ } else {
|
|
- return nil, err
|
|
+ if index, ok := indexMap[indexCodeOne]; ok {
|
|
- }
|
|
+ if index.StartDate.After(date) {
|
|
-
|
|
+ index.StartDate = date
|
|
- indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
+ }
|
|
- IndexName: indexNameOne,
|
|
+ if index.EndDate.Before(date) {
|
|
- IndexCode: indexCodeOne,
|
|
+ index.EndDate = date
|
|
- Value: valueOne,
|
|
+ index.LatestValue = valueOne
|
|
- DataTime: formatOne,
|
|
+ }
|
|
- })
|
|
+ index.DataList = append(index.DataList, models.IndexData{
|
|
- valueTwo, err := strconv.ParseFloat(strings.ReplaceAll(rowData[len(rowData)-1], ",", ""), 64)
|
|
+ DataTime: date,
|
|
- if err != nil {
|
|
+ Value: valueOne,
|
|
- utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeTwo, rowData[len(rowData)-1], err))
|
|
+ })
|
|
- return nil, err
|
|
+ } else {
|
|
- }
|
|
+ indexMap[indexCodeOne] = &models.IndexInfo{
|
|
- indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
+ IndexName: indexNameOne,
|
|
- IndexName: indexNameTwo,
|
|
+ IndexCode: indexCodeOne,
|
|
- IndexCode: indexCodeTwo,
|
|
+ Frequency: sheetConfig.Frequency,
|
|
- Value: valueTwo,
|
|
+ Unit: sheetConfig.Unit,
|
|
- DataTime: formatOne,
|
|
+ StartDate: date,
|
|
- })
|
|
+ EndDate: date,
|
|
-
|
|
+ LatestValue: valueOne,
|
|
- indexInfoList, err = dealIndex(indexInfoList, frequency, unit, classifyId)
|
|
+ ClassifyId: classifyId,
|
|
- if err != nil {
|
|
+ DataList: []models.IndexData{
|
|
- return nil, err
|
|
+ {
|
|
|
|
+ DataTime: date,
|
|
|
|
+ Value: valueOne,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- utils.FileLog.Info("AviationActiveFleetProcessor indexInfoList: %v", indexInfoList)
|
|
+ if rowData[sheetConfig.DataTwoRow] != "" {
|
|
-
|
|
+ valueTwo, parseErr := strconv.ParseFloat(strings.ReplaceAll(rowData[sheetConfig.DataTwoRow], ",", ""), 64)
|
|
-
|
|
+ if parseErr != nil {
|
|
- dataList, err := dealData(indexInfoList)
|
|
+ utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeTwo, rowData[sheetConfig.DataTwoRow], err))
|
|
- if err != nil {
|
|
+ } else {
|
|
- return nil, err
|
|
+ if index, ok := indexMap[indexCodeTwo]; ok {
|
|
|
|
+ if index.StartDate.After(date) {
|
|
|
|
+ index.StartDate = date
|
|
|
|
+ }
|
|
|
|
+ if index.EndDate.Before(date) {
|
|
|
|
+ index.EndDate = date
|
|
|
|
+ index.LatestValue = valueTwo
|
|
|
|
+ }
|
|
|
|
+ index.DataList = append(index.DataList, models.IndexData{
|
|
|
|
+ DataTime: date,
|
|
|
|
+ Value: valueTwo,
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ indexMap[indexCodeTwo] = &models.IndexInfo{
|
|
|
|
+ IndexName: indexNameTwo,
|
|
|
|
+ IndexCode: indexCodeTwo,
|
|
|
|
+ Frequency: sheetConfig.Frequency,
|
|
|
|
+ Unit: sheetConfig.Unit,
|
|
|
|
+ StartDate: date,
|
|
|
|
+ EndDate: date,
|
|
|
|
+ LatestValue: valueTwo,
|
|
|
|
+ ClassifyId: classifyId,
|
|
|
|
+ DataList: []models.IndexData{
|
|
|
|
+ {
|
|
|
|
+ DataTime: date,
|
|
|
|
+ Value: valueTwo,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- utils.FileLog.Info("AviationActiveFleetProcessor dataList: %v", dataList)
|
|
|
|
-
|
|
|
|
- return dataList, err
|
|
|
|
- indexData = append(indexData, baseFromRzdDataList...)
|
|
|
|
}
|
|
}
|
|
- fmt.Printf("读取工作表完成: %s\n", sheetName)
|
|
|
|
utils.FileLog.Info("读取工作表完成:", sheetName)
|
|
utils.FileLog.Info("读取工作表完成:", sheetName)
|
|
|
|
|
|
- if len(indexData) > 0 {
|
|
+ if len(indexMap) > 0 {
|
|
- for i := 0; i < len(indexData); i += rzdBatchSize {
|
|
+ for _, index := range indexMap {
|
|
-
|
|
+ pars := chunkIndexData(index, rzdBatchSize)
|
|
- end := i + rzdBatchSize
|
|
+ for _, par := range pars {
|
|
- if end > len(indexData) {
|
|
+
|
|
- end = len(indexData)
|
|
+ marshal, parseErr := json.Marshal(par)
|
|
- }
|
|
+ if parseErr != nil {
|
|
-
|
|
+ utils.FileLog.Error("json.Marshal err: %v", parseErr)
|
|
-
|
|
+ return parseErr
|
|
- batchData := indexData[i:end]
|
|
+ }
|
|
-
|
|
+
|
|
-
|
|
+ _, err = utils.HttpPostRequest(utils.EDB_LIB_URL+utils.ADD_BATCH_RZD_DATA, string(marshal), "application/json")
|
|
- marshal, err := json.Marshal(batchData)
|
|
+ if err != nil {
|
|
- if err != nil {
|
|
+ utils.FileLog.Error("postEdbLib err: %v", err)
|
|
- utils.FileLog.Error("json.Marshal err: %v", err)
|
|
+ return err
|
|
- return err
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- _, err = utils.HttpPostRequest(utils.EDB_LIB_URL+utils.ADD_BATCH_RZD_DATA, string(marshal), "application/json")
|
|
|
|
- if err != nil {
|
|
|
|
- utils.FileLog.Error("postEdbLib err: %v", err)
|
|
|
|
- return err
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- utils.FileLog.Info("Processing AnalyticsLibrary...")
|
|
|
|
- sheetConfig := OilDemandSignalsWeeklyReportConfigMap[sheetName]
|
|
|
|
- if tableName == "Content" {
|
|
|
|
- return nil, nil
|
|
|
|
- }
|
|
|
|
- if rowIndex < 4 {
|
|
|
|
- return nil, nil
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- less := sheetConfig.Rows - len(rowData)
|
|
|
|
- if less > 0 {
|
|
|
|
- for i := 0; i < less; i++ {
|
|
|
|
- rowData = append(rowData, "")
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
+ }
|
|
- re := regexp.MustCompile(`^\d*\.?\d*\s*$`)
|
|
+ return
|
|
- if !re.MatchString(strings.TrimSpace(rowData[sheetConfig.DataOneRow])) || !re.MatchString(strings.TrimSpace(rowData[sheetConfig.DataTwoRow])) {
|
|
+}
|
|
- utils.FileLog.Warn("数据格式错误:", fmt.Sprintf("%v", rowData))
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- indexNameOne := sheetName + "/" + rowData[len(rowData)-3] + "/" + sheetConfig.IndexNameColOne
|
|
|
|
- indexNameTwo := sheetName + "/" + rowData[len(rowData)-3] + "/" + sheetConfig.IndexNameColTwo
|
|
|
|
-
|
|
|
|
- indexCodeOne, err := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), sheetConfig.IndexNameColOne)
|
|
|
|
- indexCodeTwo, err := getIndexId(sheetName, strings.ReplaceAll(strings.ToLower(rowData[len(rowData)-3]), " ", ""), sheetConfig.IndexNameColTwo)
|
|
|
|
-
|
|
|
|
- indexInfoMap := make(map[string]string)
|
|
|
|
- indexInfoMap[indexCodeOne] = indexNameOne
|
|
|
|
- indexInfoMap[indexCodeTwo] = indexNameTwo
|
|
|
|
|
|
|
|
- dataTime := rowData[1]
|
|
+func chunkIndexData(index *models.IndexInfo, rzdBatchSize int) (pars []models.IndexInfo) {
|
|
- formatDate, err := utils.ConvertDateFormat(dataTime)
|
|
+ var chunks int
|
|
- if err != nil {
|
|
+ total := len(index.DataList)
|
|
- return nil, err
|
|
+ count := total % rzdBatchSize
|
|
- }
|
|
+ if count > 0 {
|
|
- var indexInfoList []*models.IndexInfo
|
|
+ chunks = (total + rzdBatchSize - count) / rzdBatchSize
|
|
- dataOneStr := strings.TrimSpace(rowData[3])
|
|
+ } else {
|
|
- if strings.TrimSpace(dataOneStr) != "" {
|
|
+ chunks = total / rzdBatchSize
|
|
- valueOne, err := strconv.ParseFloat(strings.ReplaceAll(dataOneStr, ",", ""), 64)
|
|
+ }
|
|
- if err != nil {
|
|
+ for i := 0; i < chunks; i++ {
|
|
- utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeOne, rowData[3], err))
|
|
+ start := i * rzdBatchSize
|
|
- return nil, err
|
|
+ end := start + rzdBatchSize
|
|
- }
|
|
+ if end > total {
|
|
- indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
+ end = total
|
|
- IndexName: indexNameOne,
|
|
|
|
- IndexCode: indexCodeOne,
|
|
|
|
- Value: valueOne,
|
|
|
|
- DataTime: formatDate,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- dataTwoStr := strings.TrimSpace(rowData[4])
|
|
|
|
- if strings.TrimSpace(dataTwoStr) != "" {
|
|
|
|
- valueTwo, err := strconv.ParseFloat(rowData[4], 64)
|
|
|
|
- if err != nil {
|
|
|
|
- utils.FileLog.Error(fmt.Sprintf("转换data数据失败,index_code:%s,data_value:%s err:%v", indexCodeTwo, rowData[4], err))
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
- indexInfoList = append(indexInfoList, &models.IndexInfo{
|
|
|
|
- IndexName: indexNameTwo,
|
|
|
|
- IndexCode: indexCodeTwo,
|
|
|
|
- Value: valueTwo,
|
|
|
|
- DataTime: formatDate,
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- indexInfoList, err = dealIndex(indexInfoList, sheetConfig.Frequency, sheetConfig.Unit, classifyId)
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
- utils.FileLog.Info("indexInfoList: %v", indexInfoList)
|
|
|
|
-
|
|
|
|
- dataList, err := dealData(indexInfoList)
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
}
|
|
}
|
|
- utils.FileLog.Info("dataList: %v", dataList)
|
|
+ pars = append(pars, models.IndexInfo{
|
|
- return dataList, err
|
|
+ IndexName: index.IndexName,
|
|
|
|
+ IndexCode: index.IndexCode,
|
|
|
|
+ LatestValue: index.LatestValue,
|
|
|
|
+ StartDate: index.StartDate,
|
|
|
|
+ EndDate: index.EndDate,
|
|
|
|
+ Frequency: index.Frequency,
|
|
|
|
+ Unit: index.Unit,
|
|
|
|
+ ClassifyId: index.ClassifyId,
|
|
|
|
+ DataList: index.DataList[start:end],
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- return nil, nil
|
|
+ return
|
|
}
|
|
}
|