测试拆单
This commit is contained in:
@@ -332,6 +332,9 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
|
||||
order.VendorStatus = utils.Int2Str(model.OrderStatusNew)
|
||||
order.StatusTime = *orderPay.PayFinishedAt
|
||||
err = callNewOrder(order)
|
||||
if order.FromStoreID != 0 {
|
||||
PickupGoods(order, false, "jxadmin")
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -761,6 +764,7 @@ func AdjustOrder(ctx *jxcontext.Context, order *model.GoodsOrder, removedSkuList
|
||||
|
||||
func PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error) {
|
||||
err = changeOrderStatus(order.VendorOrderID, model.OrderStatusFinishedPickup, "")
|
||||
err = orderSolutionForWuLiao(order)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -839,10 +843,12 @@ func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
|
||||
outOrders, _, _ := tryToSplitMatterOrder(jxOrder)
|
||||
for _, v := range outOrders {
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder6,[%v]", utils.Format4Output(v, false))
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder9,[%v]", utils.Format4Output(order, false))
|
||||
outJxOrder, deliveryAddress, err := generateOrder(jxcontext.AdminCtx, v, order.AddressID, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder10")
|
||||
outJxOrder.OrderID = GenOrderNo(jxcontext.AdminCtx)
|
||||
outJxOrder.FromStoreID = order.FromStoreID
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder7,[%v]", utils.Format4Output(outJxOrder, false))
|
||||
@@ -851,9 +857,8 @@ func orderSolutionForWuLiao(order *model.GoodsOrder) (err error) {
|
||||
order2.AddressID = order.AddressID
|
||||
order2.Status = model.OrderStatusDelivering
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder8,[%v]", utils.Format4Output(order2, false))
|
||||
partner.CurOrderManager.OnOrderNew(order2, model.Order2Status(order2))
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("tryToSplitMatterOrder5,[%v]", err)
|
||||
partner.CurOrderManager.SaveOrder(order2, false, db)
|
||||
orderSolutionForWuLiao(order2)
|
||||
}
|
||||
}
|
||||
//刷新一下库存
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
@@ -109,10 +108,6 @@ func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) {
|
||||
if call.TrxStatus == tonglianpayapi.TrxStatusSuccess {
|
||||
err = OnPayFinished(orderPay)
|
||||
}
|
||||
order, _ := partner.CurOrderManager.LoadOrder(call.CusorderID, model.VendorIDJX)
|
||||
if order.FromStoreID != 0 {
|
||||
err = orderSolutionForWuLiao(order)
|
||||
}
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("onTLpayFinished msg:%s, err:%v", utils.Format4Output(call, true), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user