- 新增OrderStatusUndoApplyCancel

This commit is contained in:
gazebo
2019-04-19 17:29:37 +08:00
parent b065c79ec3
commit 892cbd365a
5 changed files with 65 additions and 43 deletions

View File

@@ -22,6 +22,7 @@ const (
FakeMsgTypeOrderDelivering = "orderDelivering"
fakeUserApplyCancel = "fake_user_apply_cancel"
fakeUserUndoApplyCancel = "fake_user_undo_apply_cancel"
fakeOrderAdjustFinished = "fake_order_adjust_finished"
)
@@ -49,6 +50,7 @@ var (
fakeOrderAdjustFinished: model.OrderStatusAdjust,
fakeUserApplyCancel: model.OrderStatusApplyCancel,
fakeUserUndoApplyCancel: model.OrderStatusUndoApplyCancel,
}
)
@@ -187,7 +189,7 @@ func (c *PurchaseHandler) onOrderMsg(msg *mtwmapi.CallbackMsg) (response *mtwmap
func (c *PurchaseHandler) callbackMsg2Status(msg *mtwmapi.CallbackMsg) (orderStatus *model.OrderStatus) {
orderID := GetOrderIDFromMsg(msg)
vendorStatus := ""
vendorStatus := msg.Cmd
remark := ""
statusTime := utils.Str2Int64(msg.Data.Get("timestamp"))
switch msg.Cmd {
@@ -206,13 +208,15 @@ func (c *PurchaseHandler) callbackMsg2Status(msg *mtwmapi.CallbackMsg) (orderSta
remark = msg.Data.Get("reason")
if msg.Cmd == mtwmapi.MsgTypeOrderPartialRefund {
if notifyType == mtwmapi.NotifyTypePartyApply {
api.MtwmAPI.OrderRefundAgree(utils.Str2Int64(orderID), "bu") // todo 自动同意调整单
api.MtwmAPI.OrderRefundReject(utils.Str2Int64(orderID), "bu") // todo 京东与饿百都没有售前用户提出订单调整的,自动拒绝调整单
} else if notifyType == mtwmapi.NotifyTypeSuccess {
vendorStatus = fakeOrderAdjustFinished
}
} else if msg.Cmd == mtwmapi.MsgTypeOrderRefund {
if notifyType == mtwmapi.NotifyTypeApply {
vendorStatus = fakeUserApplyCancel
} else if notifyType == mtwmapi.NotifyTypeCancelRefund {
vendorStatus = fakeUserUndoApplyCancel
}
}
}