调整京西商城支付

This commit is contained in:
gazebo
2019-12-19 16:20:10 +08:00
parent 415cc834fc
commit 850c35c9d9
4 changed files with 36 additions and 22 deletions

View File

@@ -272,6 +272,10 @@ func GenOrderNo(ctx *jxcontext.Context) (orderNo int64) {
return orderNo
}
func GenPayOrderID(order *model.GoodsOrder) (payOrderID int64) {
return utils.Str2Int64(order.VendorOrderID)
}
func GenRefundID(order *model.GoodsOrder) (refundID int64) {
const suffix = 100000
refundID = utils.Str2Int64(order.VendorOrderID) * suffix
@@ -507,6 +511,10 @@ func AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName stri
return changeOrderStatus(order.VendorOrderID, status, "")
}
func AdjustOrder(ctx *jxcontext.Context, order *model.GoodsOrder, removedSkuList []*model.OrderSku, reason string) (err error) {
return err
}
func PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error) {
return changeOrderStatus(order.VendorOrderID, model.OrderStatusFinishedPickup, "")
}
@@ -527,8 +535,9 @@ func CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string)
errList := errlist.New()
for _, orderPay := range payList {
if orderPay.Status == model.PayStatusYes {
refundID := utils.Int64ToStr(GenRefundID(order))
orderPayRefund, err2 := refundOrderByWX(ctx, orderPay, refundID)
// refundID := utils.Int64ToStr(GenRefundID(order))
refundID := order.VendorOrderID
orderPayRefund, err2 := refundOrderByWX(ctx, orderPay, refundID, orderPay.TotalFee, reason)
if err2 == nil {
dao.WrapAddIDCULDEntity(orderPayRefund, ctx.GetUserName())
errList.AddErr(dao.CreateEntity(dao.GetDB(), orderPayRefund))