Răsfoiți Sursa

终端编码

xyxie 1 an în urmă
părinte
comite
1ae91a0060
2 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 2 2
      services/base_from_yongyi.go
  2. 3 0
      utils/config.go

+ 2 - 2
services/base_from_yongyi.go

@@ -43,7 +43,7 @@ func HandleYongyiExcelDaily(cont context.Context) (err error) {
 		utils.FileLog.Info(fmt.Sprintf("打开文件:%s 失败, Err: %s", filePath, err))
 		return
 	}
-	terminalCode := ""
+	terminalCode := utils.TerminalCode
 	for _, sheet := range xlFile.Sheet {
 		var indexList []*models.YongyiExcelIndex
 		switch sheet.Name {
@@ -95,7 +95,7 @@ func HandleYongyiExcelWeekly(cont context.Context) (err error) {
 		utils.FileLog.Info(fmt.Sprintf("打开文件:%s 失败, Err: %s", filePath, err))
 		return
 	}
-	terminalCode := ""
+	terminalCode := utils.TerminalCode
 	for _, sheet := range xlFile.Sheet {
 		var indexList []*models.YongyiExcelIndex
 		switch sheet.Name {

+ 3 - 0
utils/config.go

@@ -42,6 +42,8 @@ var (
 	YongyiOpen     string //是否配置涌益生猪数据源,1已配置
 )
 
+var TerminalCode string
+
 func init() {
 	tmpRunMode, err := web.AppConfig.String("run_mode")
 	if err != nil {
@@ -84,6 +86,7 @@ func init() {
 		YongyiFilePath = config["yongyi_file_path"]
 		YongyiOpen = config["yongyi_open"]
 	}
+	TerminalCode = config["terminal_code"]
 }
 
 //修改接口文档