xyxie 1 месяц назад
Родитель
Сommit
090f61c562
2 измененных файлов с 7 добавлено и 1 удалено
  1. 6 0
      services/base_from_kpler.go
  2. 1 1
      utils/constants.go

+ 6 - 0
services/base_from_kpler.go

@@ -6,6 +6,7 @@ import (
 	"eta/eta_data_analysis/services/kpler"
 	"eta/eta_data_analysis/utils"
 	"fmt"
+	"strings"
 	"time"
 
 	"github.com/patrickmn/go-cache"
@@ -88,6 +89,7 @@ func GetKplerDataByExcel(filePath string) {
 					productNames += productName.Name + ","
 				}
 			}
+			productNames = strings.TrimSuffix(productNames, ",")
 			fromZoneNameSlice := flowsRequestItem.Origins
 			fromZoneNames := ""
 			if len(fromZoneNameSlice) > 0 {
@@ -95,6 +97,7 @@ func GetKplerDataByExcel(filePath string) {
 					fromZoneNames += fromZoneName.Name + ","
 				}
 			}
+			fromZoneNames = strings.TrimSuffix(fromZoneNames, ",")
 			toZoneNames := ""
 			toZoneNameSlice := flowsRequestItem.Destinations
 			if len(toZoneNameSlice) > 0 {
@@ -102,6 +105,7 @@ func GetKplerDataByExcel(filePath string) {
 					toZoneNames += toZoneName.Name + ","
 				}
 			}
+			toZoneNames = strings.TrimSuffix(toZoneNames, ",")
 			flowDirection := flowsRequestItem.FlowDirection
 			granularity := flowsRequestItem.Granularity
 			split := flowsRequestItem.Split
@@ -121,6 +125,8 @@ func GetKplerDataByExcel(filePath string) {
 				FlowDirection: flowDirection,
 				Granularity: granularity,
 				Split: split,
+				SplitName: index.Name,
+				ExcelQueryUrl: index.Request,
 				ExcelDataMap: excelDataMap,
 			}
 			indexList = append(indexList, &tmp)

+ 1 - 1
utils/constants.go

@@ -274,7 +274,7 @@ const (
 	GET_RZD_EDB_INFO_BY_INDEX_CODE                    = "/rzd/get/rzd/edb/info/by/code"                         // 根据指标code获取指标信息
 	UPDATE_RZD_EDB_DATA                               = "/rzd/update/rzd/edb/data"                              // 修改指标库指标数据
 	LIB_ROUTE_CLARKSONS                               = "/clarksons/data"                                       // 克拉克森
-	LIB_ROUTE_KPLER_DATA                               = "/kpler/handle/excel_data"                                       // 克拉克森
+	LIB_ROUTE_KPLER_DATA                               = "kpler/handle/excel_data"                                       // 克拉克森
 )
 
 const (