animeic 2 years ago
parent
commit
7c7e2a873e
1 changed files with 1 additions and 24 deletions
  1. 1 24
      boxcost/api/plan.go

+ 1 - 24
boxcost/api/plan.go

@@ -423,29 +423,6 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
 		}
 	}
 
-	// wg.Wait()
-	// cnum := 0
-	// for {
-	// 	cnum++
-	// 	result := <-c1
-	// 	if !result.IsSucc {
-
-	// 		return nil, result.Err
-	// 	}
-	// 	fmt.Println("cnum:", cnum)
-	// 	fmt.Println("fileNum:", cnum)
-	// 	if cnum == fileNum {
-	// 		break
-	// 	}
-	// }
-	// select {
-	// case v := <-c1:
-	// 	fmt.Println(v)
-	// 	if !v.IsSucc {
-	// 		return nil, err
-	// 	}
-	// }
-
 	fmt.Println("fileNum: ", fileNum)
 	c.Header("Content-Type", "application/octet-stream")
 	c.Header("Content-Disposition", "attachment; filename="+planName+".zip")
@@ -531,7 +508,7 @@ func toPdfAndSaveTask(buf *bytes.Buffer, toPdfAddr, saveTmpDir, targetPdfName st
 		wg.Done()
 		return
 	}
-	if len(byteData) < 0 {
+	if len(byteData) < 1 {
 		fmt.Println("pdf内容为空")
 		log.Error("pdf内容为空")
 		toPdfResult <- -1