diff --git a/go.mod b/go.mod index 14ab0bf..2a55a1b 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ go 1.18 //github.com/fonchain_enterprise/utils/ipAddrQuery => ../utils/ipAddrQuery //github.com/fonchain_enterprise/utils/jwt => ../utils/jwt //github.com/fonchain_enterprise/utils/logger => ../utils/logger -replace github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage +replace github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage require ( dubbo.apache.org/dubbo-go/v3 v3.0.2 diff --git a/pkg/service/bundle/logic/signContract.go b/pkg/service/bundle/logic/signContract.go index 4dac802..e39b69f 100644 --- a/pkg/service/bundle/logic/signContract.go +++ b/pkg/service/bundle/logic/signContract.go @@ -213,6 +213,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co signImgB, _err := io.ReadAll(signImgResp.Body) if _err != nil { + fmt.Printf("读取签名图片失败: %v\n", _err) return errors.New("error reading signature image") } @@ -220,6 +221,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co signImgReader := bytes.NewReader(signImgB) signImg, _, err := image.DecodeConfig(signImgReader) if err != nil { + fmt.Printf("解码签名图片失败: %v\n", err) return errors.New("error decoding signature image") } @@ -228,7 +230,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co imgH1, _err := gopdf.ImageHolderByBytes(signImgB) if _err != nil { - //zap.L().Error("SignContract err", zap.Error(err)) + fmt.Printf("处理签名图片失败: %v\n", _err) return errors.New("error processing signature image") } newSignWidth := 80.0 @@ -237,7 +239,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co // buyer sign err = pdf.ImageByHolder(imgH1, 180, 560, &gopdf.Rect{W: newSignWidth, H: newSignHeight}) if err != nil { - //zap.L().Error("SignContract err", zap.Error(err)) + fmt.Printf("插入签名失败: %v\n", err) return errors.New("error inserting signature") } @@ -247,12 +249,14 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co companyImgResp, companyImageErr := http.Get(companyImgPath) if companyImageErr != nil { + fmt.Printf("下载公司章图片失败: %v\n", companyImageErr) return errors.New("error downloading signature image") } defer companyImgResp.Body.Close() companyImgB, _err := io.ReadAll(companyImgResp.Body) if _err != nil { + fmt.Printf("读取公司章图片失败: %v\n", _err) return errors.New("error reading signature image") } @@ -260,6 +264,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co companyImgReader := bytes.NewReader(companyImgB) companyImg, _, err := image.DecodeConfig(companyImgReader) if err != nil { + fmt.Printf("解码公司章图片失败: %v\n", err) return errors.New("error decoding signature image") } @@ -268,7 +273,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co companyImgH1, _err := gopdf.ImageHolderByBytes(companyImgB) if _err != nil { - //zap.L().Error("SignContract err", zap.Error(err)) + fmt.Printf("处理公司章图片失败: %v\n", _err) return errors.New("error processing signature image") } newCompanyWidth := 80.0 @@ -277,7 +282,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co // seller sign err = pdf.ImageByHolder(companyImgH1, 180, 610, &gopdf.Rect{W: newCompanyWidth, H: newCompanyHeight}) if err != nil { - //zap.L().Error("SignContract err", zap.Error(err)) + fmt.Printf("插入公司章失败: %v\n", err) return errors.New("error inserting signature") } @@ -287,7 +292,7 @@ func InsertSignatureV1(templatePath, outputPath, signImgPath, companyImgPath, co // 生成新的 PDF if err = pdf.WritePdf(outputPath); err != nil { - //zap.L().Error("WritePdf err", zap.Error(err)) + fmt.Printf("写入 PDF 失败: %v\n", err) return errors.New("error writing final PDF") }