增加价格排序

This commit is contained in:
qiyunfanbo126.com 2024-07-31 14:17:48 +08:00
parent 214b2a5c96
commit 556d62ac22
2 changed files with 7 additions and 2 deletions

View File

@ -164,7 +164,7 @@ func OrderRefundService(userId int, orderId int) (code int) {
if err != nil || !has {
return errorcode.NotFound
}
if order.State >= common.ORDER_STATUS_PAY {
if order.State != common.ORDER_STATUS_PAY {
return errorcode.OrderNOTAuthREFUND
}
code, response := YouChuOrderRefund(order)
@ -215,6 +215,8 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN
utils.Log(nil, "notify err", err, YouChuOrderNotifyRequest.ReqTraceId, YouChuOrderNotifyRequest.OrderNo)
return front.YouChuOrderNotifyResponse{RespCode: "000003", RespMsg: "订单不存在"}
}
ordersmodel.GetInstance().GetDb().Where("id = ?", order.Id).Update(ordersmodel.Orders{ExchangeTime: time.Now()})
var productDetail productsmodel.Products
has, err = productsmodel.GetInstance().GetDb().Where("id = ?", orderDetail.ProductId).Get(&productDetail)
if err != nil || !has {
@ -237,6 +239,7 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN
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)

View File

@ -2,6 +2,7 @@ package youchu
import (
"encoding/json"
"fmt"
"qteam/app/constants/errorcode"
"qteam/app/http/entities/front"
"qteam/app/models/ordersmodel"
@ -122,7 +123,7 @@ func (this *YouChuClient) OrderRefund(order ordersmodel.Orders) (code int, respo
},
Body: front.RefundRequestBody{
BusiMainId: BusiMainId,
ReqTransTime: order.CreateTime.Format("2006-01-02 15:04:05"),
ReqTransTime: order.CreateTime.Format("20060102150405"),
Data: front.RefundRequestData{
TxnCode: "1003",
SourceId: "16",
@ -145,6 +146,7 @@ func (this *YouChuClient) OrderRefund(order ordersmodel.Orders) (code int, respo
post, err := this.doPost(url, request.Body.BusiMainId, "b2c.gatewaypay.orderRefund", bytes)
utils.Log(nil, "b2c.orderRefund", post)
if err != nil {
fmt.Println(err)
return errorcode.YouChuOrderRefundFail, response
}
responseData := DecryptResponse(string(post), false)