From 34d6b2fe889e9768921a27cecb5acdd07d997a71 Mon Sep 17 00:00:00 2001 From: zhoujunyao Date: Wed, 11 Mar 2026 09:26:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9C=89=E6=8A=A5=E9=94=99=EF=BC=8C?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E6=B3=A8=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/reconciliation.go | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/service/bundle/reconciliation.go b/pkg/service/bundle/reconciliation.go index da949c4d..725437db 100644 --- a/pkg/service/bundle/reconciliation.go +++ b/pkg/service/bundle/reconciliation.go @@ -493,24 +493,24 @@ func AutoCreateUserAndOrder(c *gin.Context) { } //生成发票 - //orderRecord, err := service.BundleProvider.GetOrderInfoByOrderNo(context.Background(), &bundle.GetOrderInfoByOrderNoReq{ - // Uuid: unfinishInfo.OrderNo, //因为需求更新,实际传入的是订单的uuid - //}) - //if err != nil { - // service.Error(c, err) - // return - //} - //amountType := strconv.FormatInt(orderRecord.AmountType, 10) - //applyTime := common.GetBeijingTime() - //payTime, _ := time.Parse("2006-01-02 15:04:05", applyTime) - //payTimeString := payTime.Format("20060102") - //fmt.Println("发票payTimeString :", payTimeString, "发票applyTime :", applyTime, "发票payTime :", payTime) - //fmt.Println("发票时间数据获取完成") - //err = createInvoice(orderRecord.UserId, orderRecord.UserNum, orderRecord.UserName, orderRecord.Address, orderRecord.Phone, orderRecord.BundleName, orderRecord.OrderNo, "1", amountType, orderRecord.TotalAmount, payTimeString, payTimeString, applyTime) - //if err != nil { - // service.Error(c, errors.New("生成发票失败")) - // return - //} + orderRecord, err := service.BundleProvider.GetOrderInfoByOrderNo(context.Background(), &bundle.GetOrderInfoByOrderNoReq{ + OrderNo: unfinishInfo.OrderNo, //因为需求更新,实际传入的是订单的uuid + }) + if err != nil { + service.Error(c, err) + return + } + amountType := strconv.FormatInt(orderRecord.AmountType, 10) + applyTime := common.GetBeijingTime() + payTime, _ := time.Parse("2006-01-02 15:04:05", applyTime) + payTimeString := payTime.Format("20060102") + fmt.Println("发票payTimeString :", payTimeString, "发票applyTime :", applyTime, "发票payTime :", payTime) + fmt.Println("发票时间数据获取完成") + err = createInvoice(orderRecord.UserId, orderRecord.UserNum, orderRecord.UserName, orderRecord.Address, orderRecord.Phone, orderRecord.BundleName, orderRecord.OrderNo, "1", amountType, orderRecord.TotalAmount, payTimeString, payTimeString, applyTime) + if err != nil { + service.Error(c, errors.New("生成发票失败")) + return + } //如果是购买套餐 1:创建新的余量信息CreateBundleBalance 2 添加扩展记录BundleExtend _, err = service.BundleProvider.CreateBundleBalance(context.Background(), &bundle.CreateBundleBalanceReq{