浏览代码

Merge branch 'feature/yongyi_fix' of eta_server/eta_data_analysis into master

xyxie 7 月之前
父节点
当前提交
0a93f011f5
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      services/base_from_yongyi.go

+ 6 - 6
services/base_from_yongyi.go

@@ -217,8 +217,8 @@ func YongyiDownloadWeekyly(cont context.Context) (err error) {
 	fmt.Printf("endDate: %s\n", endDate)
 	dataFileExsit := false
 	chartFileExist := false
-	filePath := fmt.Sprintf("%s-%s%s", startDate, endDate, "涌益咨询 周度数据.xlsx")
-	filePath = filepath.Join(utils.YongyiReadFilePath, filePath)
+	fileName := fmt.Sprintf("%s-%s%s", startDate, endDate, "涌益咨询 周度数据.xlsx")
+	filePath := filepath.Join(utils.YongyiReadFilePath, fileName)
 
 	fmt.Println("YongyiDownloadWeekyly: " + filePath)
 
@@ -227,7 +227,7 @@ func YongyiDownloadWeekyly(cont context.Context) (err error) {
 	if e == nil { //文件或者目录存在
 		dataFileExsit = true
 	} else if os.IsNotExist(e) { //文件或者目录不存在
-		filePath = filepath.Join(utils.YongyiFilePath, filePath)
+		filePath = filepath.Join(utils.YongyiFilePath, fileName)
 
 		fmt.Println("YongyiDownloadWeekyly: " + filePath)
 
@@ -237,14 +237,14 @@ func YongyiDownloadWeekyly(cont context.Context) (err error) {
 			dataFileExsit = true
 		}
 	}
-	filePath = fmt.Sprintf("%s-%s%s", utils.YongyiReadFilePath, startDate, endDate, "周度图表版图.xlsx")
-	filePath = filepath.Join(utils.YongyiReadFilePath, filePath)
+	fileName = fmt.Sprintf("%s-%s%s", startDate, endDate, "周度图表版图.xlsx")
+	filePath = filepath.Join(utils.YongyiReadFilePath, fileName)
 	fmt.Println("YongyiDownloadWeekyly: " + filePath)
 	_, e = os.Stat(filePath)
 	if e == nil { //文件或者目录存在
 		chartFileExist = true
 	} else if os.IsNotExist(e) { //文件或者目录不存在
-		filePath = filepath.Join(utils.YongyiFilePath, filePath)
+		filePath = filepath.Join(utils.YongyiFilePath, fileName)
 		fmt.Println("YongyiDownloadWeekyly: " + filePath)
 		// 从已处理的表格中查询是否已存在,如果已存在,也无需下载
 		_, e = os.Stat(filePath)