订单转移规则修改

This commit is contained in:
苏尹岚
2020-06-04 16:30:23 +08:00
parent 98452fc3fc
commit 4f10721d59

View File

@@ -1119,8 +1119,8 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
if err != nil || order == nil {
return "", fmt.Errorf("未查询到该订单!订单号:[%v]", vendorOrderID)
}
if order.Status == model.OrderStatusFinished {
return "", fmt.Errorf("暂不支持已完成的订单进行转移!")
if order.Status >= model.OrderStatusDelivering {
return "", fmt.Errorf("暂不支持此状态的订单进行转移!")
}
if order.VendorID != model.VendorIDJDShop {
return "", fmt.Errorf("暂不支持非京狗的订单进行转移!")
@@ -1130,11 +1130,11 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
return "", fmt.Errorf("未查询到该订单商品!订单号:[%v]", vendorOrderID)
}
//将订单和运单取消
if order.Status == model.OrderStatusDelivering {
waybills, err := dao.GetWaybills(db, vendorOrderID)
if err != nil || len(waybills) == 0 {
return "", fmt.Errorf("未查询到该订单对应的运单信息!订单号:[%v]", vendorOrderID)
}
waybills, err := dao.GetWaybills(db, vendorOrderID)
if err != nil {
return "", err
}
if len(waybills) > 0 {
for _, v := range waybills {
if v.Status != model.WaybillStatusCanceled {
waybill = v