- 修复美团外卖售后单的处理bug,对于notifyType与resType的处理
This commit is contained in:
@@ -16,16 +16,24 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
AfsVendorStatus2StatusMap = map[int]int{
|
||||
mtwmapi.ResTypePending: model.AfsOrderStatusWait4Approve,
|
||||
mtwmapi.ResTypeMerchantRefused: model.AfsOrderStatusFailed,
|
||||
mtwmapi.ResTypeMerchantAgreed: model.AfsOrderStatusFinished,
|
||||
mtwmapi.ResTypeCSRefused: model.AfsOrderStatusFailed,
|
||||
mtwmapi.ResTypeCSAgreed: model.AfsOrderStatusFinished,
|
||||
mtwmapi.ResTypeTimeoutAutoAgreed: model.AfsOrderStatusFinished,
|
||||
mtwmapi.ResTypeAutoAgreed: model.AfsOrderStatusFinished,
|
||||
mtwmapi.ResTypeUserCancelApply: model.AfsOrderStatusFailed,
|
||||
mtwmapi.ResTypeUserCancelComplain: model.AfsOrderStatusFailed,
|
||||
// AfsVendorStatus2StatusMap = map[int]int{
|
||||
// mtwmapi.ResTypePending: model.AfsOrderStatusWait4Approve,
|
||||
// mtwmapi.ResTypeMerchantRefused: model.AfsOrderStatusFailed,
|
||||
// mtwmapi.ResTypeMerchantAgreed: model.AfsOrderStatusFinished,
|
||||
// mtwmapi.ResTypeCSRefused: model.AfsOrderStatusFailed,
|
||||
// mtwmapi.ResTypeCSAgreed: model.AfsOrderStatusFinished,
|
||||
// mtwmapi.ResTypeTimeoutAutoAgreed: model.AfsOrderStatusFinished,
|
||||
// mtwmapi.ResTypeAutoAgreed: model.AfsOrderStatusFinished,
|
||||
// mtwmapi.ResTypeUserCancelApply: model.AfsOrderStatusFailed,
|
||||
// mtwmapi.ResTypeUserCancelComplain: model.AfsOrderStatusFailed,
|
||||
// }
|
||||
AfsVendorStatus2StatusMap = map[string]int{
|
||||
mtwmapi.NotifyTypeApply: model.AfsOrderStatusWait4Approve,
|
||||
mtwmapi.NotifyTypePartyApply: model.AfsOrderStatusWait4Approve,
|
||||
mtwmapi.NotifyTypeSuccess: model.AfsOrderStatusFinished,
|
||||
mtwmapi.NotifyTypeReject: model.AfsOrderStatusFailed,
|
||||
mtwmapi.NotifyTypeCancelRefund: model.AfsOrderStatusFailed,
|
||||
mtwmapi.NotifyTypeCancelRefundComplaint: model.AfsOrderStatusFailed,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -138,8 +146,8 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *mtwmapi.CallbackMsg) (order
|
||||
OrderType: model.OrderTypeAfsOrder,
|
||||
RefVendorOrderID: utils.Int64ToStr(refundData.OrderID),
|
||||
RefVendorID: model.VendorIDMTWM,
|
||||
VendorStatus: utils.Int2Str(refundData.ResType),
|
||||
Status: c.GetAfsStatusFromVendorStatus(refundData.ResType),
|
||||
VendorStatus: fmt.Sprintf("%s:%d", refundData.NotifyType, refundData.ResType),
|
||||
Status: c.GetAfsStatusFromVendorStatus(refundData.ResType, refundData.NotifyType),
|
||||
StatusTime: utils.Timestamp2Time(refundData.Timestamp),
|
||||
Remark: refundData.Reason,
|
||||
}
|
||||
@@ -149,8 +157,12 @@ func (c *PurchaseHandler) callbackAfsMsg2Status(msg *mtwmapi.CallbackMsg) (order
|
||||
return orderStatus
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(vendorStatus int) int {
|
||||
return AfsVendorStatus2StatusMap[vendorStatus]
|
||||
func (c *PurchaseHandler) GetAfsStatusFromVendorStatus(resType int, notifyType string) int {
|
||||
status := AfsVendorStatus2StatusMap[notifyType]
|
||||
if status == model.AfsOrderStatusWait4Approve && resType != mtwmapi.ResTypePending {
|
||||
status = model.AfsOrderStatusNew
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
// 审核售后单申请
|
||||
|
||||
Reference in New Issue
Block a user