From 1f3c4c0105292cdee147979ca9acd33d253126f9 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 9 Mar 2026 10:14:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A0=E4=B8=8A=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/cast/report.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/service/cast/report.go b/pkg/service/cast/report.go index f67b66fa..d8640f93 100644 --- a/pkg/service/cast/report.go +++ b/pkg/service/cast/report.go @@ -1444,8 +1444,9 @@ func ImportPdfBatch(ctx *gin.Context) { continue } - // 下载 PDF(保存到 runtime 目录,上传后 URL 不包含 pdf_import 路径) - fullPath, err := utils.SaveUrlFileDisk(pdfUrl, "runtime", newFileName+".pdf") + // 下载 PDF(保存到 runtime 目录,加入时间戳避免文件名冲突,上传后 URL 不包含 pdf_import 路径) + timestamp := time.Now().UnixMicro() + fullPath, err := utils.SaveUrlFileDisk(pdfUrl, "runtime", fmt.Sprintf("%s_%d.pdf", newFileName, timestamp)) if err != nil { 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()))