+ AcceptOrRefuseFailedGetOrder
+ CallPMCourier + ConfirmReceiveGoods
This commit is contained in:
@@ -11,6 +11,15 @@ import (
|
|||||||
"github.com/astaxie/beego/orm"
|
"github.com/astaxie/beego/orm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
waybillOrderStatusMap = map[int]int{
|
||||||
|
model.WaybillStatusApplyFailedGetGoods: model.WaybillStatusApplyFailedGetGoods,
|
||||||
|
model.WaybillStatusAgreeFailedGetGoods: model.WaybillStatusAgreeFailedGetGoods,
|
||||||
|
model.WaybillStatusRefuseFailedGetGoods: model.WaybillStatusRefuseFailedGetGoods,
|
||||||
|
model.WaybillStatusDeliverFailed: model.WaybillStatusDeliverFailed,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
func (w *OrderManager) LoadPendingWaybills() []*model.Waybill {
|
func (w *OrderManager) LoadPendingWaybills() []*model.Waybill {
|
||||||
db := orm.NewOrm()
|
db := orm.NewOrm()
|
||||||
var bills []*model.Waybill
|
var bills []*model.Waybill
|
||||||
@@ -108,6 +117,22 @@ func (w *OrderManager) OnWaybillStatusChanged(bill *model.Waybill) (err error) {
|
|||||||
} else {
|
} else {
|
||||||
dao.Rollback(db)
|
dao.Rollback(db)
|
||||||
}
|
}
|
||||||
|
if bill.VendorOrderID == bill.VendorWaybillID {
|
||||||
|
if status, ok := waybillOrderStatusMap[bill.Status]; ok {
|
||||||
|
fakeOrderStatus := &model.OrderStatus{
|
||||||
|
VendorOrderID: bill.VendorOrderID,
|
||||||
|
VendorID: bill.OrderVendorID,
|
||||||
|
OrderType: model.OrderTypeOrder,
|
||||||
|
RefVendorOrderID: bill.VendorOrderID,
|
||||||
|
RefVendorID: bill.OrderVendorID,
|
||||||
|
Status: status,
|
||||||
|
VendorStatus: bill.VendorStatus,
|
||||||
|
StatusTime: bill.StatusTime,
|
||||||
|
Remark: bill.Remark,
|
||||||
|
}
|
||||||
|
w.OnOrderStatusChanged(fakeOrderStatus)
|
||||||
|
}
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,3 +128,24 @@ func (c *BaseScheduler) CancelOrder(ctx *jxcontext.Context, order *model.GoodsOr
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *BaseScheduler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool, reason string) (err error) {
|
||||||
|
if c.IsReallyCallPlatformAPI {
|
||||||
|
err = partner.GetPurchasePlatformFromVendorID(order.VendorID).AcceptOrRefuseFailedGetOrder(ctx, order, isAcceptIt)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *BaseScheduler) CallPMCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) {
|
||||||
|
if c.IsReallyCallPlatformAPI {
|
||||||
|
err = partner.GetPurchasePlatformFromVendorID(order.VendorID).CallCourier(ctx, order)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *BaseScheduler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) {
|
||||||
|
if c.IsReallyCallPlatformAPI {
|
||||||
|
err = partner.GetPurchasePlatformFromVendorID(order.VendorID).ConfirmReceiveGoods(ctx, order)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ func (s *DefScheduler) OnOrderNew(order *model.GoodsOrder, isPending bool) (err
|
|||||||
|
|
||||||
// todo 这个接口应该可以直接传order的,因为在OrderManager中每次都生成了
|
// todo 这个接口应该可以直接传order的,因为在OrderManager中每次都生成了
|
||||||
func (s *DefScheduler) OnOrderStatusChanged(status *model.OrderStatus, isPending bool) (err error) {
|
func (s *DefScheduler) OnOrderStatusChanged(status *model.OrderStatus, isPending bool) (err error) {
|
||||||
if status.LockStatus != model.OrderStatusUnknown || status.Status > model.OrderStatusUnknown {
|
if status.LockStatus != model.OrderStatusUnknown || (status.Status > model.OrderStatusMsg && status.Status != model.OrderStatusUnknown) {
|
||||||
globals.SugarLogger.Debugf("OnOrderStatusChanged orderID:%s %s, status:%v", status.VendorOrderID, model.OrderStatusName[status.Status], status)
|
globals.SugarLogger.Debugf("OnOrderStatusChanged orderID:%s %s, status:%v", status.VendorOrderID, model.OrderStatusName[status.Status], status)
|
||||||
savedOrderInfo := s.loadSavedOrderFromMap(status, true)
|
savedOrderInfo := s.loadSavedOrderFromMap(status, true)
|
||||||
s.updateOrderByStatus(savedOrderInfo.order, status)
|
s.updateOrderByStatus(savedOrderInfo.order, status)
|
||||||
@@ -273,18 +273,26 @@ func (s *DefScheduler) OnOrderStatusChanged(status *model.OrderStatus, isPending
|
|||||||
if status.Status >= model.OrderStatusEndBegin {
|
if status.Status >= model.OrderStatusEndBegin {
|
||||||
s.orderMap.Delete(jxutils.GetUniversalOrderIDFromOrderStatus(status))
|
s.orderMap.Delete(jxutils.GetUniversalOrderIDFromOrderStatus(status))
|
||||||
}
|
}
|
||||||
|
} else if status.Status == model.OrderStatusRefuseFailedGetGoods {
|
||||||
|
// 将order状态设置为OrderStatusFinishedPickup
|
||||||
}
|
}
|
||||||
} else if status.LockStatus != model.OrderStatusUnknown {
|
}
|
||||||
|
if status.LockStatus != model.OrderStatusUnknown {
|
||||||
s.stopTimer(savedOrderInfo)
|
s.stopTimer(savedOrderInfo)
|
||||||
}
|
}
|
||||||
} else if status.Status == model.OrderStatusApplyCancel {
|
if model.IsOrderLockStatus(status.Status) ||
|
||||||
globals.SugarLogger.Debugf("OnOrderStatusChanged orderID:%s %s, status:%v", status.VendorOrderID, model.OrderStatusName[status.Status], status)
|
model.IsOrderUnlockStatus(status.Status) ||
|
||||||
savedOrderInfo := s.loadSavedOrderFromMap(status, true)
|
status.Status == model.OrderStatusApplyFailedGetGoods ||
|
||||||
s.updateOrderByStatus(savedOrderInfo.order, status)
|
status.Status == model.OrderStatusAgreeFailedGetGoods {
|
||||||
utils.CallFuncAsync(func() {
|
if isPending {
|
||||||
weixinmsg.NotifyUserApplyCancel(savedOrderInfo.order, status.Remark)
|
if status.Status == model.OrderStatusApplyCancel {
|
||||||
})
|
utils.CallFuncAsync(func() {
|
||||||
msghub.OnUserApplyCancel(savedOrderInfo.order)
|
weixinmsg.NotifyUserApplyCancel(savedOrderInfo.order, status.Remark)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
msghub.OnKeyOrderStatusChanged(savedOrderInfo.order)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,24 +67,29 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
OrderStatusName = map[int]string{
|
OrderStatusName = map[int]string{
|
||||||
OrderStatusMsg: "通知消息",
|
OrderStatusMsg: "通知消息",
|
||||||
|
OrderStatusRefuseFailedGetGoods: "取货失败审核驳回",
|
||||||
|
OrderStatusAdjust: "订单调整完成",
|
||||||
|
OrderStatusWait4Pay: "待付款",
|
||||||
|
OrderStatusApplyUrgeOrder: "催单",
|
||||||
|
|
||||||
OrderStatusWait4Pay: "待付款",
|
OrderStatusUnlocked: "解锁",
|
||||||
OrderStatusUnlocked: "解锁",
|
OrderStatusLocked: "锁定",
|
||||||
OrderStatusLocked: "锁定",
|
|
||||||
OrderStatusApplyUrgeOrder: "催单",
|
|
||||||
// OrderStatusApplyRefund: "申请退款",
|
// OrderStatusApplyRefund: "申请退款",
|
||||||
OrderStatusApplyCancel: "申请取消",
|
OrderStatusUndoApplyCancel: "取消申请取消",
|
||||||
|
OrderStatusApplyCancel: "申请取消",
|
||||||
|
|
||||||
OrderStatusUnknown: "一般事件",
|
OrderStatusUnknown: "一般事件",
|
||||||
|
|
||||||
OrderStatusNew: "新订单",
|
OrderStatusNew: "新订单",
|
||||||
OrderStatusAdjust: "调整单",
|
OrderStatusAccepted: "已接单",
|
||||||
OrderStatusAccepted: "已接单",
|
OrderStatusFinishedPickup: "已拣货",
|
||||||
OrderStatusFinishedPickup: "已拣货",
|
OrderStatusApplyFailedGetGoods: "取货失败待审核",
|
||||||
OrderStatusDelivering: "配送中",
|
OrderStatusAgreeFailedGetGoods: "取货失败",
|
||||||
OrderStatusFinished: "完成",
|
OrderStatusDelivering: "配送中",
|
||||||
OrderStatusCanceled: "取消",
|
OrderStatusDeliverFailed: "投递失败",
|
||||||
|
OrderStatusFinished: "完成",
|
||||||
|
OrderStatusCanceled: "取消",
|
||||||
}
|
}
|
||||||
WaybillStatusName = map[int]string{
|
WaybillStatusName = map[int]string{
|
||||||
WaybillStatusUnknown: "一般事件",
|
WaybillStatusUnknown: "一般事件",
|
||||||
@@ -159,9 +164,10 @@ const (
|
|||||||
const (
|
const (
|
||||||
OrderStatusMsg = -100
|
OrderStatusMsg = -100
|
||||||
|
|
||||||
OrderStatusAdjust = -65 // 原值-35 订单调整完成
|
OrderStatusRefuseFailedGetGoods = -70 // 取货失败审核驳回
|
||||||
OrderStatusWait4Pay = -60 // 原值-30 下单待支付,微盟在这个时间发新订单事件
|
OrderStatusAdjust = -65 // 原值-35 订单调整完成
|
||||||
OrderStatusApplyUrgeOrder = -55 // 原值-15
|
OrderStatusWait4Pay = -60 // 原值-30 下单待支付,微盟在这个时间发新订单事件
|
||||||
|
OrderStatusApplyUrgeOrder = -55 // 原值-15
|
||||||
|
|
||||||
OrderStatusUnlocked = -25
|
OrderStatusUnlocked = -25
|
||||||
OrderStatusLocked = -20
|
OrderStatusLocked = -20
|
||||||
@@ -174,7 +180,12 @@ const (
|
|||||||
OrderStatusNew = 5 // 新订单
|
OrderStatusNew = 5 // 新订单
|
||||||
OrderStatusAccepted = 10 // 已经接单,也即待出库,待拣货
|
OrderStatusAccepted = 10 // 已经接单,也即待出库,待拣货
|
||||||
OrderStatusFinishedPickup = 15 // 拣货完成
|
OrderStatusFinishedPickup = 15 // 拣货完成
|
||||||
OrderStatusDelivering = 20 // 开始配送,配送员已取货,从这里开始就是运单消息了
|
|
||||||
|
OrderStatusApplyFailedGetGoods = 17 // 取货失败待审核
|
||||||
|
OrderStatusAgreeFailedGetGoods = 18 // 取货失败
|
||||||
|
|
||||||
|
OrderStatusDelivering = 20 // 开始配送,配送员已取货,从这里开始就是运单消息了
|
||||||
|
OrderStatusDeliverFailed = 25 // 投递失败
|
||||||
|
|
||||||
OrderStatusEndBegin = 100 // 以下的状态就是结束状态
|
OrderStatusEndBegin = 100 // 以下的状态就是结束状态
|
||||||
OrderStatusFinished = 110 // 订单已完成
|
OrderStatusFinished = 110 // 订单已完成
|
||||||
@@ -187,18 +198,24 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
WaybillStatusUnknown = 0
|
WaybillStatusRefuseFailedGetGoods = -70
|
||||||
|
WaybillStatusUnknown = 0
|
||||||
|
|
||||||
WaybillStatusNew = 5
|
WaybillStatusNew = 5
|
||||||
WaybillStatusAcceptCanceled = 8
|
WaybillStatusAcceptCanceled = 8
|
||||||
WaybillStatusAccepted = 10
|
WaybillStatusAccepted = 10
|
||||||
WaybillStatusCourierArrived = 15 // 此状态是可选的,明确写出来是因为还是较重要的状态,但业务逻辑不应依赖此状态
|
WaybillStatusCourierArrived = 15 // 此状态是可选的,明确写出来是因为还是较重要的状态,但业务逻辑不应依赖此状态
|
||||||
WaybillStatusDelivering = 20
|
|
||||||
|
WaybillStatusApplyFailedGetGoods = 17 // 取货失败待审核
|
||||||
|
WaybillStatusAgreeFailedGetGoods = 18 // 取货失败
|
||||||
|
|
||||||
|
WaybillStatusDelivering = 20
|
||||||
|
WaybillStatusDeliverFailed = 25
|
||||||
|
|
||||||
WaybillStatusEndBegin = 100 // 以下的状态就是结束状态
|
WaybillStatusEndBegin = 100 // 以下的状态就是结束状态
|
||||||
WaybillStatusDelivered = 105
|
WaybillStatusDelivered = 105 // todo 这个应该改为110,与订单对应
|
||||||
WaybillStatusCanceled = 115
|
WaybillStatusCanceled = 115
|
||||||
WaybillStatusFailed = 120
|
WaybillStatusFailed = 120 // todo 这个应该要去掉
|
||||||
WaybillStatusNeverSend = 125 // 这个状态指的是平台方不愿意配送,门店自己想办法。与WaybillStatusAcceptCanceled不一样,WaybillStatusAcceptCanceled可能之后还会尝试配送
|
WaybillStatusNeverSend = 125 // 这个状态指的是平台方不愿意配送,门店自己想办法。与WaybillStatusAcceptCanceled不一样,WaybillStatusAcceptCanceled可能之后还会尝试配送
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ const (
|
|||||||
|
|
||||||
ServerMsgPing = "ping"
|
ServerMsgPing = "ping"
|
||||||
|
|
||||||
ServerMsgNewOrder = "newOrder"
|
ServerMsgNewOrder = "newOrder"
|
||||||
ServerMsgUserApplyCancel = "userApplyCancel"
|
ServerMsgKeyOrderStatusChanged = "keyOrderStatusChanged" // 重要订单状态变化
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -165,11 +165,11 @@ func OnNewOrder(order *model.GoodsOrder) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func OnUserApplyCancel(order *model.GoodsOrder) {
|
func OnKeyOrderStatusChanged(order *model.GoodsOrder) {
|
||||||
globals.SugarLogger.Debugf("msghub OnUserApplyCancel, order:%s", utils.Format4Output(order, false))
|
globals.SugarLogger.Debugf("msghub OnKeyOrderStatusChanged, order:%s", utils.Format4Output(order, false))
|
||||||
utils.CallFuncAsync(func() {
|
utils.CallFuncAsync(func() {
|
||||||
msgChan <- &ServerMsg{
|
msgChan <- &ServerMsg{
|
||||||
Type: ServerMsgUserApplyCancel,
|
Type: ServerMsgKeyOrderStatusChanged,
|
||||||
StoreID: jxutils.GetSaleStoreIDFromOrder(order),
|
StoreID: jxutils.GetSaleStoreIDFromOrder(order),
|
||||||
MsgData: 1,
|
MsgData: 1,
|
||||||
// MsgData: []*model.GoodsOrderExt{
|
// MsgData: []*model.GoodsOrderExt{
|
||||||
|
|||||||
@@ -142,6 +142,10 @@ type IPurchasePlatformHandler interface {
|
|||||||
AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error)
|
AcceptOrRefuseOrder(order *model.GoodsOrder, isAcceptIt bool, userName string) (err error)
|
||||||
PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error)
|
PickupGoods(order *model.GoodsOrder, isSelfDelivery bool, userName string) (err error)
|
||||||
|
|
||||||
|
AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error)
|
||||||
|
CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) // 取货失败后再次招唤平台配送
|
||||||
|
ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) // 投递失败后确认收到退货
|
||||||
|
|
||||||
// 将订单从购物平台配送转为自送
|
// 将订单从购物平台配送转为自送
|
||||||
Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error)
|
Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error)
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,18 @@ func (p *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 拣货失败后再次招唤平台配送
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 投递失败后确认收到退货
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// 将订单从购物平台配送转为自送
|
// 将订单从购物平台配送转为自送
|
||||||
func (p *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (p *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Debugf("ebai Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("ebai Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
||||||
|
|||||||
@@ -292,6 +292,18 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 拣货失败后再次招唤平台配送
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 投递失败后确认收到退货
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
// if globals.EnableElmStoreWrite {
|
// if globals.EnableElmStoreWrite {
|
||||||
// err = api.ElmAPI.DeliveryBySelfLite(order.VendorOrderID)
|
// err = api.ElmAPI.DeliveryBySelfLite(order.VendorOrderID)
|
||||||
|
|||||||
@@ -248,6 +248,27 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error) {
|
||||||
|
if globals.EnableStoreWrite {
|
||||||
|
err = api.JdAPI.ReceiveFailedAudit(order.VendorOrderID, isAcceptIt, ctx.GetUserName(), "")
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 拣货失败后再次招唤平台配送
|
||||||
|
if globals.EnableStoreWrite {
|
||||||
|
err = api.JdAPI.UrgeDispatching(order.VendorOrderID, ctx.GetUserName())
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 投递失败后确认收到退货
|
||||||
|
if globals.EnableStoreWrite {
|
||||||
|
err = api.JdAPI.ConfirmReceiveGoods(order.VendorOrderID)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Debugf("jd Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("jd Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
||||||
if globals.EnableStoreWrite {
|
if globals.EnableStoreWrite {
|
||||||
|
|||||||
@@ -34,12 +34,18 @@ func (c *PurchaseHandler) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (re
|
|||||||
order.Status = model.WaybillStatusAcceptCanceled
|
order.Status = model.WaybillStatusAcceptCanceled
|
||||||
case jdapi.DeliveryStatusCourierArrived:
|
case jdapi.DeliveryStatusCourierArrived:
|
||||||
order.Status = model.WaybillStatusCourierArrived
|
order.Status = model.WaybillStatusCourierArrived
|
||||||
|
// case jdapi.DeliveryStatusFailedGetGoodsWaiting:
|
||||||
|
// order.Status = model.WaybillStatusApplyFailedGetGoods
|
||||||
|
// case jdapi.DeliveryStatusFailedGetGoodsRejected:
|
||||||
|
// order.Status = model.WaybillStatusRefuseFailedGetGoods
|
||||||
|
// case jdapi.DeliveryStatusFailedGetGoods:
|
||||||
|
// order.Status = model.WaybillStatusAgreeFailedGetGoods
|
||||||
case jdapi.DeliveryStatusGotGoods:
|
case jdapi.DeliveryStatusGotGoods:
|
||||||
order.Status = model.WaybillStatusDelivering
|
order.Status = model.WaybillStatusDelivering
|
||||||
|
// case jdapi.DeliveryStatusFailedDelivery:
|
||||||
|
// order.Status = model.WaybillStatusDeliverFailed
|
||||||
case jdapi.DeliveryStatusFinished:
|
case jdapi.DeliveryStatusFinished:
|
||||||
order.Status = model.WaybillStatusDelivered
|
order.Status = model.WaybillStatusDelivered
|
||||||
case jdapi.DeliveryStatusFailedDelivery, jdapi.DeliveryStatusFailedGetGoods: // todo 取货失败需不需要当成运单失败?
|
|
||||||
order.Status = model.WaybillStatusFailed
|
|
||||||
default:
|
default:
|
||||||
order.Status = model.WaybillStatusUnknown
|
order.Status = model.WaybillStatusUnknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,6 +279,18 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 拣货失败后再次招唤平台配送
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 投递失败后确认收到退货
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (c *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Debugf("mtwm Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("mtwm Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
||||||
if globals.EnableMtwmStoreWrite {
|
if globals.EnableMtwmStoreWrite {
|
||||||
|
|||||||
@@ -198,6 +198,18 @@ func (p *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) AcceptOrRefuseFailedGetOrder(ctx *jxcontext.Context, order *model.GoodsOrder, isAcceptIt bool) (err error) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) CallCourier(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 拣货失败后再次招唤平台配送
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PurchaseHandler) ConfirmReceiveGoods(ctx *jxcontext.Context, order *model.GoodsOrder) (err error) { // 投递失败后确认收到退货
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// 将订单从购物平台配送转为自送
|
// 将订单从购物平台配送转为自送
|
||||||
func (p *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
func (p *PurchaseHandler) Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error) {
|
||||||
globals.SugarLogger.Debugf("wsc Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
globals.SugarLogger.Debugf("wsc Swtich2SelfDeliver orderID:%s", order.VendorOrderID)
|
||||||
|
|||||||
@@ -402,3 +402,59 @@ func (c *OrderController) CancelOrder() {
|
|||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Title 审核取货失败
|
||||||
|
// @Description 审核取货失败
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
|
// @Param vendorID formData int true "订单所属厂商ID)"
|
||||||
|
// @Param acceptIt formData bool true "是否批准"
|
||||||
|
// @Param reason formData string false "原因"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /AcceptOrRefuseFailedGetOrder [put]
|
||||||
|
func (c *OrderController) AcceptOrRefuseFailedGetOrder() {
|
||||||
|
c.callAcceptOrRefuseFailedGetOrder(func(params *tOrderAcceptOrRefuseFailedGetOrderParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
order, err := partner.CurOrderManager.LoadOrder(params.VendorOrderID, params.VendorID)
|
||||||
|
if err == nil {
|
||||||
|
err = defsch.FixedScheduler.AcceptOrRefuseFailedGetOrder(params.Ctx, order, params.AcceptIt, params.Reason)
|
||||||
|
}
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title 取货失败后再次招唤平台配送
|
||||||
|
// @Description 取货失败后再次招唤平台配送
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
|
// @Param vendorID formData int true "订单所属厂商ID)"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /CallPMCourier [put]
|
||||||
|
func (c *OrderController) CallPMCourier() {
|
||||||
|
c.callCallPMCourier(func(params *tOrderCallPMCourierParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
order, err := partner.CurOrderManager.LoadOrder(params.VendorOrderID, params.VendorID)
|
||||||
|
if err == nil {
|
||||||
|
err = defsch.FixedScheduler.CallPMCourier(params.Ctx, order)
|
||||||
|
}
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Title 投递失败后确认收到退货
|
||||||
|
// @Description 投递失败后确认收到退货
|
||||||
|
// @Param token header string true "认证token"
|
||||||
|
// @Param vendorOrderID formData string true "订单ID"
|
||||||
|
// @Param vendorID formData int true "订单所属厂商ID)"
|
||||||
|
// @Success 200 {object} controllers.CallResult
|
||||||
|
// @Failure 200 {object} controllers.CallResult
|
||||||
|
// @router /ConfirmReceiveGoods [put]
|
||||||
|
func (c *OrderController) ConfirmReceiveGoods() {
|
||||||
|
c.callConfirmReceiveGoods(func(params *tOrderConfirmReceiveGoodsParams) (retVal interface{}, errCode string, err error) {
|
||||||
|
order, err := partner.CurOrderManager.LoadOrder(params.VendorOrderID, params.VendorID)
|
||||||
|
if err == nil {
|
||||||
|
err = defsch.FixedScheduler.ConfirmReceiveGoods(params.Ctx, order)
|
||||||
|
}
|
||||||
|
return retVal, "", err
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -511,6 +511,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "AcceptOrRefuseFailedGetOrder",
|
||||||
|
Router: `/AcceptOrRefuseFailedGetOrder`,
|
||||||
|
AllowHTTPMethods: []string{"put"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "AdjustOrder",
|
Method: "AdjustOrder",
|
||||||
@@ -520,6 +529,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "CallPMCourier",
|
||||||
|
Router: `/CallPMCourier`,
|
||||||
|
AllowHTTPMethods: []string{"put"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "CancelAll3rdWaybills",
|
Method: "CancelAll3rdWaybills",
|
||||||
@@ -538,6 +556,15 @@ func init() {
|
|||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
|
beego.ControllerComments{
|
||||||
|
Method: "ConfirmReceiveGoods",
|
||||||
|
Router: `/ConfirmReceiveGoods`,
|
||||||
|
AllowHTTPMethods: []string{"put"},
|
||||||
|
MethodParams: param.Make(),
|
||||||
|
Filters: nil,
|
||||||
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "CreateWaybillOnProviders",
|
Method: "CreateWaybillOnProviders",
|
||||||
|
|||||||
Reference in New Issue
Block a user