Compare commits

..

No commits in common. "9219289db101a37c6a6803493357a92823fc405f" and "885dac4abca8bb8b79ec33ed80d9d24df8ec20cb" have entirely different histories.

10 changed files with 8308 additions and 4534 deletions

File diff suppressed because it is too large Load Diff

View File

@ -17,32 +17,6 @@ var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *QueryTheOrderSnapshotInformationReq) Validate() error {
return nil
}
func (this *QueryTheOrderSnapshotInformationResp) Validate() error {
for _, item := range this.BundleOrder {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleOrder", err)
}
}
}
for _, item := range this.AddBundleOrder {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleOrder", err)
}
}
}
return nil
}
func (this *ServiceInformation) Validate() error {
return nil
}
func (this *ReSignTheContractRequest) Validate() error {
return nil
}
func (this *DeleteValueAddServiceRequest) Validate() error {
return nil
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.5
// - protoc v6.32.0
// - protoc v5.26.0
// source: pb/bundle.proto
package bundle
@ -50,7 +50,6 @@ type BundleClient interface {
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
// 增值套餐
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
@ -117,7 +116,6 @@ type BundleClient interface {
MetricsBundlePurchaseExport(ctx context.Context, in *MetricsBundlePurchaseExportReq, opts ...grpc_go.CallOption) (*MetricsBundlePurchaseExportResp, common.ErrorWithAttachment)
MetricsArtistAccountExport(ctx context.Context, in *MetricsArtistAccountExportReq, opts ...grpc_go.CallOption) (*MetricsArtistAccountExportResp, common.ErrorWithAttachment)
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -147,7 +145,6 @@ type BundleClientImpl struct {
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
ReSignTheContract func(ctx context.Context, in *ReSignTheContractRequest) (*CommonResponse, error)
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
@ -206,7 +203,6 @@ type BundleClientImpl struct {
MetricsBundlePurchaseExport func(ctx context.Context, in *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
MetricsArtistAccountExport func(ctx context.Context, in *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
QueryTheOrderSnapshotInformation func(ctx context.Context, in *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -353,12 +349,6 @@ func (c *bundleClient) OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAd
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
}
func (c *bundleClient) ReSignTheContract(ctx context.Context, in *ReSignTheContractRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ReSignTheContract", in, out)
}
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
out := new(CreateValueAddBundleResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -707,12 +697,6 @@ func (c *bundleClient) MetricsVideoSubmitExport(ctx context.Context, in *Metrics
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MetricsVideoSubmitExport", in, out)
}
func (c *bundleClient) QueryTheOrderSnapshotInformation(ctx context.Context, in *QueryTheOrderSnapshotInformationReq, opts ...grpc_go.CallOption) (*QueryTheOrderSnapshotInformationResp, common.ErrorWithAttachment) {
out := new(QueryTheOrderSnapshotInformationResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/QueryTheOrderSnapshotInformation", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -739,7 +723,6 @@ type BundleServer interface {
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error)
// 增值套餐
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
@ -806,7 +789,6 @@ type BundleServer interface {
MetricsBundlePurchaseExport(context.Context, *MetricsBundlePurchaseExportReq) (*MetricsBundlePurchaseExportResp, error)
MetricsArtistAccountExport(context.Context, *MetricsArtistAccountExportReq) (*MetricsArtistAccountExportResp, error)
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error)
mustEmbedUnimplementedBundleServer()
}
@ -881,9 +863,6 @@ func (UnimplementedBundleServer) OrderListByOrderNo(context.Context, *OrderInfoB
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
}
func (UnimplementedBundleServer) ReSignTheContract(context.Context, *ReSignTheContractRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReSignTheContract not implemented")
}
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
}
@ -1058,9 +1037,6 @@ func (UnimplementedBundleServer) MetricsArtistAccountExport(context.Context, *Me
func (UnimplementedBundleServer) MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method MetricsVideoSubmitExport not implemented")
}
func (UnimplementedBundleServer) QueryTheOrderSnapshotInformation(context.Context, *QueryTheOrderSnapshotInformationReq) (*QueryTheOrderSnapshotInformationResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryTheOrderSnapshotInformation not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -1727,35 +1703,6 @@ func _Bundle_OnlyAddValueListByOrderNo_Handler(srv interface{}, ctx context.Cont
return interceptor(ctx, in, info, handler)
}
func _Bundle_ReSignTheContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ReSignTheContractRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ReSignTheContract", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateValueAddBundleRequest)
if err := dec(in); err != nil {
@ -3438,35 +3385,6 @@ func _Bundle_MetricsVideoSubmitExport_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
func _Bundle_QueryTheOrderSnapshotInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryTheOrderSnapshotInformationReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("QueryTheOrderSnapshotInformation", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -3562,10 +3480,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "OnlyAddValueListByOrderNo",
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
},
{
MethodName: "ReSignTheContract",
Handler: _Bundle_ReSignTheContract_Handler,
},
{
MethodName: "CreateValueAddBundle",
Handler: _Bundle_CreateValueAddBundle_Handler,
@ -3798,10 +3712,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "MetricsVideoSubmitExport",
Handler: _Bundle_MetricsVideoSubmitExport_Handler,
},
{
MethodName: "QueryTheOrderSnapshotInformation",
Handler: _Bundle_QueryTheOrderSnapshotInformation_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

View File

@ -69,7 +69,6 @@ func CheckLogin(provider *api.AccountFieeClientImpl) gin.HandlerFunc {
Domain: infoRes.Domain,
TelNum: jwt.Phone,
SubscriberNumber: infoRes.SubscriberNumber,
IdNumber: infoRes.IdNumber,
}
ctx.Set("jwtInfo", loginInfo)

View File

@ -2,7 +2,6 @@ package login
import (
"errors"
"github.com/gin-gonic/gin"
)
@ -28,7 +27,6 @@ type Info struct {
Domain string `json:"domain"`
TelNum string `json:"telNum"`
SubscriberNumber string `json:"subscriberNumber"`
IdNumber string `json:"idNumber"`
}
func GetUserInfoFromC(c *gin.Context) Info {

View File

@ -44,8 +44,6 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderAppRoute := bundleOrderRoute.Group("app")
{
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
bundleOrderAppRoute.POST("verification-signature", bundle.VerificationSignature) //校验签署
bundleOrderAppRoute.POST("restart-signature", bundle.RestartSignature) //重新签署
//bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
bundleOrderAppRoute.POST("order-del", bundle.DeleteBundleOrder)
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)

View File

@ -22,8 +22,6 @@ import (
"github.com/gin-gonic/gin/binding"
)
const ContractUrl = "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf"
func DeleteBundleOrder(c *gin.Context) {
var req bundle.DeleteValueAddServiceRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
@ -241,7 +239,7 @@ func CreateBundleOrderSignature(c *gin.Context) {
}
// 签合同(金额 + 有效期)
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
signContract, err := logic.SignContractV2(req.CustomerNum, bundleDetail.Contract, bundleDetail.Price+addTotalPrice, expirationDay)
if err != nil {
service.Error(c, err)
return
@ -259,129 +257,7 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Success(c, res)
return
}
func VerificationSignature(c *gin.Context) {
type VerificationSignature struct {
Signature bool `json:"signature"`
SignatureUrl string `json:"signature_url"`
}
res := VerificationSignature{Signature: false}
userInfo := login.GetUserInfoFromC(c)
// 添加用户信息验证
if userInfo.ID == 0 {
service.Success(c, res)
return
}
req := bundle.OrderRecordsDetailRequest{
CustomerID: strconv.FormatUint(userInfo.ID, 10),
}
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
if err != nil {
// 添加错误日志但继续返回false业务逻辑
service.Success(c, res)
return
}
// 优化空值判断链
if records == nil || records.OrderRecord == nil {
service.Success(c, res)
return
}
order := records.OrderRecord
customerID, err := strconv.ParseUint(order.CustomerID, 10, 64)
if err != nil || customerID != userInfo.ID {
service.Success(c, res)
return
}
//
//if order.Status != bundleModel.OrderPaid {
// service.Success(c, res)
// return
//}
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
if err != nil {
service.Success(c, res)
return
}
if expirationTime.Before(time.Now()) {
service.Success(c, res)
return
}
if order.ReSignature == 1 {
res.Signature = true
contract := ContractUrl
expirationDate := expirationTime.Format("2006-01-02")
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
if err != nil {
service.Error(c, err)
return
}
res.SignatureUrl = signContract
}
service.Success(c, res)
}
func RestartSignature(c *gin.Context) {
userInfo := login.GetUserInfoFromC(c)
req := bundle.OrderRecordsDetailRequest{
CustomerID: strconv.FormatUint(userInfo.ID, 10),
}
records, err := service.BundleProvider.OrderRecordsDetail(c, &req)
if err != nil {
service.Error(c, errors.New("获取订单信息失败"))
return
}
// 优化空值判断链
if records == nil || records.OrderRecord == nil {
service.Error(c, errors.New("获取订单信息失败"))
return
}
order := records.OrderRecord
expirationTime, err := time.Parse("2006-01-02 15:04:05", order.ExpirationTime)
if err != nil {
service.Error(c, errors.New("获取订单过期日期错误"))
return
}
if expirationTime.Before(time.Now()) {
service.Error(c, errors.New("订单已过期"))
return
}
expirationDate := expirationTime.Format("2006-01-02")
if order.ReSignature == 2 {
service.Error(c, errors.New("订单无需重新签署"))
return
}
// 获取最后一次合同编号
lastContractNo, err := logic.GetLastContractNo()
if err != nil {
service.Error(c, err)
return
}
contract := ContractUrl
signContract, err := logic.SignContractV2(userInfo.SubNum, contract, 0, expirationDate, userInfo.Name, userInfo.IdNumber, userInfo.PlaceOfResidence)
if err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.ReSignTheContract(c, &bundle.ReSignTheContractRequest{
OrderNo: records.OrderRecord.OrderNo,
ContractNo: lastContractNo,
SignContract: signContract,
})
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
return
}
func UpdateBundleOrderStatusPaid(c *gin.Context) {
var req bundle.OrderRecord

View File

@ -94,7 +94,6 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
expirationDay string
addUidService = make(map[string]bool)
bundleUidService = make(map[string]bool)
foundExpiration = false
)
// 分类权益
@ -150,15 +149,12 @@ func BuildServiceRecords(req *bundle.OrderCreateRecord, bundleDetail *bundle.Bun
addRecords = append(addRecords, buildAddRecord(addService, uid, 0, num, 1))
// 计算到期时间
if !foundExpiration && addService.ServiceType == 5 {
if addService.ServiceType == 5 {
expirationDay = calculateExpirationDate(time.Now(), num, addService.Unit)
foundExpiration = true
} else {
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
}
}
// 如果没有找到服务类型为5的使用默认值
if !foundExpiration {
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
}
return addRecords, addTotalPrice, expirationDay, nil
}

View File

@ -8,13 +8,14 @@ import (
"fonchain-fiee/pkg/service/upload"
"log"
"os"
"strconv"
"time"
"github.com/signintech/gopdf"
"go.uber.org/zap"
)
func SignContractV2(customerNum, contract string, price float32, expirationDate string, nickName string, idCard string, address string) (outputUrl string, err error) {
func SignContractV2(customerNum, contract string, price float32, expirationDate string) (outputUrl string, err error) {
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
downloadFileErr := DownloadFile(filePath, contract)
if downloadFileErr != nil {
@ -31,7 +32,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
return outputUrl, errors.New(common.ErrorInsertSignature)
}*/
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate, nickName, idCard, address)
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate)
if signErr != nil {
zap.L().Error("insert signature error: ", zap.Error(signErr))
return outputUrl, errors.New(common.ErrorInsertSignature)
@ -46,7 +47,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
return outputUrl, nil
}
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string, nickName string, idCard string, address string) error {
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string) error {
fmt.Println("================================templatePath:", templatePath)
fmt.Println("================================outputPath:", outputPath)
fmt.Println("================================price:", price)
@ -64,9 +65,9 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
totalPages := pdf.GetNumberOfPages()
fmt.Printf("模板文件的总页数: %d\n", totalPages)
onePage := 1
sixPage := 6
tenPage := 10
pricePage := 3
limitTimePage := 4
tffErr := pdf.AddTTFFont("simfang", "./data/simfang.ttf")
if tffErr != nil {
@ -81,54 +82,42 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
log.Fatalf("设置字体失败: %v", err)
}
// 填 金额
pdf.SetPage(pricePage)
pdf.SetX(383)
pdf.SetY(351)
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
pdf.SetX(345)
pdf.SetY(383)
pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
// 写 有效期
pdf.SetPage(limitTimePage)
// 英文格式的时间
parsedTime, err := time.Parse("2006-01-02", expirationDate)
if err != nil {
fmt.Println("时间解析错误: %v", err)
fmt.Println(expirationDate)
return errors.New("时间解析错误")
panic("日期格式错误!")
}
year := parsedTime.Format("2006") // "2006"
month := parsedTime.Format("01") // "01"
day := parsedTime.Format("02") // "02"
// 填 第一页 日期-姓名-身份证号
pdf.SetPage(onePage)
pdf.SetX(232)
pdf.SetY(152)
pdf.Cell(nil, year)
pdf.SetX(279)
pdf.SetY(152)
pdf.Cell(nil, month)
pdf.SetX(313)
pdf.SetY(152)
pdf.Cell(nil, day)
pdf.SetX(370)
pdf.SetY(152)
pdf.Cell(nil, nickName)
pdf.SetX(175)
pdf.SetY(170)
pdf.Cell(nil, idCard)
//pdf.Cell(nil, strconv.FormatFloat(float64(price), 'f', 2, 64))
pdf.SetX(160)
pdf.SetY(387)
pdf.Cell(nil, expirationDate)
// 写 第六页 日期
pdf.SetPage(sixPage)
pdf.SetX(343)
pdf.SetY(138)
pdf.SetX(330)
pdf.SetY(403)
pdf.Cell(nil, year)
pdf.SetX(401)
pdf.SetY(138)
pdf.SetX(396)
pdf.SetY(403)
pdf.Cell(nil, month)
pdf.SetX(447)
pdf.SetY(138)
pdf.SetX(443)
pdf.SetY(403)
pdf.Cell(nil, day)
// 写 第十页 地址 姓名 邮件
pdf.SetPage(tenPage)
pdf.SetX(195)
pdf.SetY(253)
pdf.Cell(nil, address)
pdf.SetX(215)
pdf.SetY(270)
pdf.Cell(nil, nickName)
// 生成新的 PDF
if err = pdf.WritePdf(outputPath); err != nil {
//zap.L().Error("WritePdf err", zap.Error(err))

View File

@ -385,10 +385,9 @@ func AutoCreateUserAndOrder(c *gin.Context) {
},
)
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
contract := ContractUrl
contract := "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf"
expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay, unfinishInfo.UserName, unfinishInfo.CardNum, unfinishInfo.PlaceOfResidence)
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay)
if signContractErr != nil {
service.Error(c, signContractErr)
return