animeic 2 years ago
parent
commit
49bae53a97
1 changed files with 0 additions and 21 deletions
  1. 0 21
      boxcost/api/plan.go

+ 0 - 21
boxcost/api/plan.go

@@ -281,7 +281,6 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
 		os.RemoveAll(saveTmpDir)
 	}
 	// 记录文件数量
-	fileNum := 0
 	var wg sync.WaitGroup
 	c1 := make(chan int)
 	for _, tId := range typeBillIds {
@@ -385,28 +384,9 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
 		billExcel.SetIsPdf("true")
 		billExcel.Draws()
 		buf, _ := f.WriteToBuffer()
-		// res, err := excelToPdf(buf, apictx.Svc.Conf.PdfApiAddr)
-		// if err != nil {
-		// 	fmt.Println(err)
-		// 	log.Error(err)
-		// 	return nil, errors.New("转化pdf失败")
-		// }
-		// body := res.Body
-		// byteData, err := io.ReadAll(body)
-		// if err != nil {
-		// 	fmt.Println(err)
-		// 	return nil, err
-		// }
 		targePdfName := fmt.Sprintf("%s-%s.pdf", productName, supplierName)
-		// err = savePdfToTmp(saveTmpDir, targePdfName, byteData)
-		// if err != nil {
-		// 	return nil, err
-		// }
-		fileNum++
 
 		wg.Add(1)
-		// fmt.Println(1)
-
 		go toPdfAndSaveTask(buf, apictx.Svc.Conf.PdfApiAddr, saveTmpDir, targePdfName, c1, &wg)
 
 	}
@@ -423,7 +403,6 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
 		}
 	}
 
-	fmt.Println("fileNum: ", fileNum)
 	c.Header("Content-Type", "application/octet-stream")
 	c.Header("Content-Disposition", "attachment; filename="+planName+".zip")
 	c.Header("Content-Transfer-Encoding", "binary")