售后单

This commit is contained in:
苏尹岚
2020-09-21 17:14:02 +08:00
parent d377e40cbd
commit 1c4828e4c7
3 changed files with 33 additions and 19 deletions

View File

@@ -1500,8 +1500,8 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
if order.Status >= model.OrderStatusDelivering && order.Status != model.OrderStatusCanceled {
return "", fmt.Errorf("暂不支持此状态的订单进行转移!")
}
if order.VendorID != model.VendorIDJDShop {
return "", fmt.Errorf("暂不支持非京狗的订单进行转移!")
if order.VendorID != model.VendorIDJDShop || order.VendorID != model.VendorIDJX {
return "", fmt.Errorf("暂不支持该平台的订单进行转移!")
}
skus, err := dao.GetSimpleOrderSkus(db, vendorOrderID, nil)
if err != nil || order == nil {
@@ -1519,10 +1519,8 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
}
}
if waybill != nil {
if waybill.WaybillVendorID != model.VendorIDJDWL {
if handler := partner.GetDeliveryPlatformFromVendorID(waybill.WaybillVendorID); handler != nil {
err = handler.Handler.CancelWaybill(waybill, 0, "订单转移被取消")
}
if handler := partner.GetDeliveryPlatformFromVendorID(waybill.WaybillVendorID); handler != nil {
err = handler.Handler.CancelWaybill(waybill, 0, "订单转移被取消")
}
}
}
@@ -1533,12 +1531,12 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
//重新构建order的数据
storeMaps, err := dao.GetStoresMapList(db, []int{order.VendorID}, []int{storeID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
if err != nil || len(storeMaps) == 0 {
return "", fmt.Errorf("该门店未绑定京狗平台,请先绑定后再转移!门店:[%v]", storeID)
return "", fmt.Errorf("该门店未绑定平台,请先绑定后再转移!门店:[%v]", storeID)
}
stores, err := dao.GetStoreList(db, []int{storeID}, nil, nil, nil, "")
if len(storeMaps) > 0 && len(stores) > 0 {
if storeMaps[0].VendorStoreID == "" {
return "", fmt.Errorf("该门店未绑定京狗平台,或绑定有误,请联系技术部!门店:[%v]", storeID)
return "", fmt.Errorf("该门店未绑定平台,或绑定有误,请联系技术部!门店:[%v]", storeID)
}
order.StoreID = storeID
order.StoreName = stores[0].Name
@@ -1558,6 +1556,9 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
if store.OpenTime1 == 0 || store.CloseTime1 == 0 {
return "", fmt.Errorf("该门店没有营业时间,不能接单!门店:[%v]", storeID)
}
if opentime2.Sub(opentime1) <= time.Hour {
return "", fmt.Errorf("该门店营业时间间隔过小,请确认!门店:[%v]", storeID)
}
if !(orderCreatedAt.Sub(opentime1) >= 0 && orderCreatedAt.Sub(closetime1) <= 0) {
if store.OpenTime2 != 0 && store.CloseTime2 != 0 {
if !(orderCreatedAt.Sub(opentime2) >= 0 && orderCreatedAt.Sub(closetime2) <= 0) {