From c52b5e2cc80942651479a57d4266874aa3770106 Mon Sep 17 00:00:00 2001 From: jhc Date: Sat, 22 Feb 2025 19:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleOrder.go | 2 +- pkg/service/bundle/logic/signContract.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/service/bundle/bundleOrder.go b/pkg/service/bundle/bundleOrder.go index 4f07ae8..d6a96ea 100644 --- a/pkg/service/bundle/bundleOrder.go +++ b/pkg/service/bundle/bundleOrder.go @@ -54,7 +54,7 @@ func CreateBundleOrderSignature(c *gin.Context) { req.AmountType = bundleDetail.Bundle.PriceType // 当前 未将 签名 写入合同中 - signContract, signContractErr := logic.SignContract(req.CustomerName, bundleDetail.Bundle.Contract, req.Signature) + signContract, signContractErr := logic.SignContract(req.CustomerNum, bundleDetail.Bundle.Contract, req.Signature) if signContractErr != nil { service.Error(c, signContractErr) return diff --git a/pkg/service/bundle/logic/signContract.go b/pkg/service/bundle/logic/signContract.go index 49c293f..ff6cf36 100644 --- a/pkg/service/bundle/logic/signContract.go +++ b/pkg/service/bundle/logic/signContract.go @@ -16,8 +16,8 @@ import ( "time" ) -func SignContract(customerName string, contract string, signImgPath string) (outputUrl string, err error) { - filePath := customerName + "_" + time.Now().String() + ".pdf" +func SignContract(customerNum string, contract string, signImgPath string) (outputUrl string, err error) { + filePath := customerNum + time.Now().Format("20060102150405") + ".pdf" downloadFileErr := DownloadFile(filePath, contract) if downloadFileErr != nil { zap.L().Error("download file error: ", zap.Error(downloadFileErr)) @@ -25,7 +25,7 @@ func SignContract(customerName string, contract string, signImgPath string) (out return outputUrl, errors.New(common.ErrorDownloadFile) } - signFile := customerName + "signed" + "_" + time.Now().String() + ".pdf" + signFile := customerNum + "signed" + time.Now().Format("20060102150405") + ".pdf" signErr := InsertSignature(filePath, signFile, signImgPath) if signErr != nil {