|
@@ -11,6 +11,7 @@ import (
|
|
|
"io"
|
|
|
"os"
|
|
|
"path/filepath"
|
|
|
+ "regexp"
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
@@ -273,7 +274,10 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
|
|
|
}
|
|
|
|
|
|
companyName := getCompanyName(apictx)
|
|
|
- planName := plan.Name
|
|
|
+ _planName := plan.Name
|
|
|
+ r := regexp.MustCompile(`/`)
|
|
|
+ planName := r.ReplaceAllString(_planName, `&`)
|
|
|
+ // fmt.Println(planName)
|
|
|
// 打包pdf的缓存目录
|
|
|
saveTmpDir := fmt.Sprintf("tmp1/%s", planName)
|
|
|
|
|
@@ -384,7 +388,12 @@ func DownLoadPlanBillsPdf(c *gin.Context, apictx *ApiSession) (interface{}, erro
|
|
|
billExcel.SetIsPdf("true")
|
|
|
billExcel.Draws()
|
|
|
buf, _ := f.WriteToBuffer()
|
|
|
- targePdfName := fmt.Sprintf("%s-%s.pdf", productName, supplierName)
|
|
|
+
|
|
|
+ // r := regexp.MustCompile(`/`)
|
|
|
+ _productName := r.ReplaceAllString(productName, `&`)
|
|
|
+ _supplierName := r.ReplaceAllString(supplierName, `&`)
|
|
|
+ targePdfName := fmt.Sprintf("%s-%s.pdf", _productName, _supplierName)
|
|
|
+ // fmt.Println(targePdfName)
|
|
|
|
|
|
wg.Add(1)
|
|
|
go toPdfAndSaveTask(buf, apictx.Svc.Conf.PdfApiAddr, saveTmpDir, targePdfName, c1, &wg)
|