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 {