fix: 加上时间戳
This commit is contained in:
parent
2247cce068
commit
1f3c4c0105
@ -1444,8 +1444,9 @@ func ImportPdfBatch(ctx *gin.Context) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载 PDF(保存到 runtime 目录,上传后 URL 不包含 pdf_import 路径)
|
// 下载 PDF(保存到 runtime 目录,加入时间戳避免文件名冲突,上传后 URL 不包含 pdf_import 路径)
|
||||||
fullPath, err := utils.SaveUrlFileDisk(pdfUrl, "runtime", newFileName+".pdf")
|
timestamp := time.Now().UnixMicro()
|
||||||
|
fullPath, err := utils.SaveUrlFileDisk(pdfUrl, "runtime", fmt.Sprintf("%s_%d.pdf", newFileName, timestamp))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("下载PDF失败", zap.String("pdfUrl", pdfUrl), zap.Error(err))
|
zap.L().Error("下载PDF失败", zap.String("pdfUrl", pdfUrl), zap.Error(err))
|
||||||
excelData.SetCellValue("Sheet1", fmt.Sprintf("D%d", line+1), fmt.Sprintf("下载PDF失败: %s", err.Error()))
|
excelData.SetCellValue("Sheet1", fmt.Sprintf("D%d", line+1), fmt.Sprintf("下载PDF失败: %s", err.Error()))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user