From ac222c0880a1fbaf6027698fa27def09f3fc2464 Mon Sep 17 00:00:00 2001 From: "qiyunfanbo126.com" <815699> Date: Thu, 18 Jul 2024 17:04:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0notifyurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/OrderService.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/OrderService.go b/app/services/OrderService.go index dbc7cdc..e81582f 100644 --- a/app/services/OrderService.go +++ b/app/services/OrderService.go @@ -216,6 +216,7 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN session := ordersmodel.GetInstance().GetDb().NewSession() defer func() { if err != nil { + utils.Log(nil, "notify err", err) _ = session.Rollback() return } @@ -225,12 +226,14 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN if YouChuOrderNotifyRequest.TxnFlag == "01" { _, err = session.Where("id = ?", orderDetail.ProductId).Where("stock >= ?", common.ORDER_STATUS_DEFAULT).Update(&productDetail) if err = session.Begin(); err != nil { + utils.Log(nil, "notify err", err) return front.YouChuOrderNotifyResponse{RespCode: "000004", RespMsg: "库存不足"} } client := market.NewMarketClient(config.GetConf().OpenApiMarketConfig) send, err := client.MarketSend(orderDetail.OrderNo, strconv.Itoa(orderDetail.VoucherId), "", "2") utils.Log(nil, "OrderNotify-MarketSend", send, err) if err != nil { + utils.Log(nil, "notify err", err) return front.YouChuOrderNotifyResponse{RespCode: "000004", RespMsg: "充值失败"} } order.OrgTxnSeq = YouChuOrderNotifyRequest.OrderNo @@ -239,6 +242,7 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN } else { order.State = common.ORDER_STATUS_FINISH order.VoucherLink = send.Data.ShortUrl + utils.Log(nil, "nitifydata", send.Data.ShortUrl, "***", send.Data.VoucherId) //Stock, _ := strconv.Atoi(productDetail.Stock) //productDetail.Stock = strconv.Itoa(Stock - 1) }