增加价格排序
This commit is contained in:
parent
214b2a5c96
commit
556d62ac22
|
@ -164,7 +164,7 @@ func OrderRefundService(userId int, orderId int) (code int) {
|
||||||
if err != nil || !has {
|
if err != nil || !has {
|
||||||
return errorcode.NotFound
|
return errorcode.NotFound
|
||||||
}
|
}
|
||||||
if order.State >= common.ORDER_STATUS_PAY {
|
if order.State != common.ORDER_STATUS_PAY {
|
||||||
return errorcode.OrderNOTAuthREFUND
|
return errorcode.OrderNOTAuthREFUND
|
||||||
}
|
}
|
||||||
code, response := YouChuOrderRefund(order)
|
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)
|
utils.Log(nil, "notify err", err, YouChuOrderNotifyRequest.ReqTraceId, YouChuOrderNotifyRequest.OrderNo)
|
||||||
return front.YouChuOrderNotifyResponse{RespCode: "000003", RespMsg: "订单不存在"}
|
return front.YouChuOrderNotifyResponse{RespCode: "000003", RespMsg: "订单不存在"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ordersmodel.GetInstance().GetDb().Where("id = ?", order.Id).Update(ordersmodel.Orders{ExchangeTime: time.Now()})
|
||||||
var productDetail productsmodel.Products
|
var productDetail productsmodel.Products
|
||||||
has, err = productsmodel.GetInstance().GetDb().Where("id = ?", orderDetail.ProductId).Get(&productDetail)
|
has, err = productsmodel.GetInstance().GetDb().Where("id = ?", orderDetail.ProductId).Get(&productDetail)
|
||||||
if err != nil || !has {
|
if err != nil || !has {
|
||||||
|
@ -237,6 +239,7 @@ func OrderNotify(request front.YouChuRequest) (NotifyResponse front.YouChuOrderN
|
||||||
utils.Log(nil, "notify err", err)
|
utils.Log(nil, "notify err", err)
|
||||||
return front.YouChuOrderNotifyResponse{RespCode: "000004", RespMsg: "库存不足"}
|
return front.YouChuOrderNotifyResponse{RespCode: "000004", RespMsg: "库存不足"}
|
||||||
}
|
}
|
||||||
|
|
||||||
client := market.NewMarketClient(config.GetConf().OpenApiMarketConfig)
|
client := market.NewMarketClient(config.GetConf().OpenApiMarketConfig)
|
||||||
send, err := client.MarketSend(orderDetail.OrderNo, strconv.Itoa(orderDetail.VoucherId), "", "2")
|
send, err := client.MarketSend(orderDetail.OrderNo, strconv.Itoa(orderDetail.VoucherId), "", "2")
|
||||||
utils.Log(nil, "OrderNotify-MarketSend", send, err)
|
utils.Log(nil, "OrderNotify-MarketSend", send, err)
|
||||||
|
|
|
@ -2,6 +2,7 @@ package youchu
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"qteam/app/constants/errorcode"
|
"qteam/app/constants/errorcode"
|
||||||
"qteam/app/http/entities/front"
|
"qteam/app/http/entities/front"
|
||||||
"qteam/app/models/ordersmodel"
|
"qteam/app/models/ordersmodel"
|
||||||
|
@ -122,7 +123,7 @@ func (this *YouChuClient) OrderRefund(order ordersmodel.Orders) (code int, respo
|
||||||
},
|
},
|
||||||
Body: front.RefundRequestBody{
|
Body: front.RefundRequestBody{
|
||||||
BusiMainId: BusiMainId,
|
BusiMainId: BusiMainId,
|
||||||
ReqTransTime: order.CreateTime.Format("2006-01-02 15:04:05"),
|
ReqTransTime: order.CreateTime.Format("20060102150405"),
|
||||||
Data: front.RefundRequestData{
|
Data: front.RefundRequestData{
|
||||||
TxnCode: "1003",
|
TxnCode: "1003",
|
||||||
SourceId: "16",
|
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)
|
post, err := this.doPost(url, request.Body.BusiMainId, "b2c.gatewaypay.orderRefund", bytes)
|
||||||
utils.Log(nil, "b2c.orderRefund", post)
|
utils.Log(nil, "b2c.orderRefund", post)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
return errorcode.YouChuOrderRefundFail, response
|
return errorcode.YouChuOrderRefundFail, response
|
||||||
}
|
}
|
||||||
responseData := DecryptResponse(string(post), false)
|
responseData := DecryptResponse(string(post), false)
|
||||||
|
|
Loading…
Reference in New Issue