Merge remote-tracking branch 'origin/mark' into yonghui

This commit is contained in:
苏尹岚
2019-12-19 18:40:58 +08:00
7 changed files with 62 additions and 48 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))