From e940aba7570fc9a45859d0be89b94a7844af8803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Tue, 26 Sep 2023 15:36:00 +0800 Subject: [PATCH] 1 --- business/jxcallback/orderman/order.go | 4 +-- .../jxcallback/scheduler/basesch/basesch.go | 30 ++++++++----------- business/jxstore/misc/misc.go | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index f48170ef0..dba92d985 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -2703,10 +2703,10 @@ func UpdateTaoSettleInfo() { db := dao.GetDB() var count = 0 - timeStart := time.Now().Add(-24 * 14 * time.Hour) + timeStart := time.Now().Add(-24 * 4 * time.Hour) startTime := time.Date(timeStart.Year(), timeStart.Month(), timeStart.Day(), 0, 0, 0, 0, timeStart.Location()) - timeEnd := time.Now().Add(-24 * 2 * time.Hour) + timeEnd := time.Now().Add(-24 * 1 * time.Hour) endTime := time.Date(timeEnd.Year(), timeEnd.Month(), timeEnd.Day()-1, 23, 59, 59, 0, timeStart.Location()) storeMaps, err := dao.GetTaoOrderVendor(db, startTime, endTime) diff --git a/business/jxcallback/scheduler/basesch/basesch.go b/business/jxcallback/scheduler/basesch/basesch.go index 0f8e69309..18e3f02f0 100644 --- a/business/jxcallback/scheduler/basesch/basesch.go +++ b/business/jxcallback/scheduler/basesch/basesch.go @@ -142,26 +142,22 @@ func (c *BaseScheduler) SelfDeliverDelivering(order *model.GoodsOrder, userName localBill, _ := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID) // 获取抖音配送状态 tiktokWayBillStatus, _ := partner.GetPurchasePlatformFromVendorID(order.VendorID).OrderLogisticsStatus(order.VendorOrderID) - if tiktokWayBillStatus != nil { - if tiktokWayBillStatus.LogisticsStatus >= tiktokShop.ShipmentStatusReceived { - //取消抖音配送转自送 - err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel) - partner.CurOrderManager.OnOrderMsg(order, "取消抖音配送,转用门店自配送/三方配送", "抖音骑手已经接单,无法取消") + if tiktokWayBillStatus != nil && tiktokWayBillStatus.LogisticsStatus >= tiktokShop.ShipmentStatusReceived { + //取消抖音配送转自送 + err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel+"抖音骑手已经接单,无法取消") + partner.CurOrderManager.OnOrderMsg(order, "取消抖音配送,转用门店自配送/三方配送", "抖音骑手已经接单,无法取消") + return err + } else if tiktokWayBillStatus != nil && tiktokWayBillStatus.LogisticsStatus == -1 { // 先转自送,自送不成功取消平台配送. + if err := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName); err != nil { + partner.CurOrderManager.OnOrderMsg(order, "抖音转自送,平台无运力", "tiktokWayBillStatus = -1") + } + } else if err = partner.GetPurchasePlatformFromVendorID(order.VendorID).CancelLogisticsByWmOrderId(order, "", "", order.VendorStoreID, order.VendorOrderID); err != nil { + if err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel); err != nil { + partner.CurOrderManager.OnOrderMsg(order, "取消抖音平台运单错误,无法转自送", err.Error()) return err - } else if tiktokWayBillStatus.LogisticsStatus == -1 { // 先转自送,自送不成功取消平台配送. - if err := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName); err != nil { - partner.CurOrderManager.OnOrderMsg(order, "抖音转自送,平台无运力", "tiktokWayBillStatus = -1") - } } } else { - if err = partner.GetPurchasePlatformFromVendorID(order.VendorID).CancelLogisticsByWmOrderId(order, "", "", order.VendorStoreID, order.VendorOrderID); err != nil { - if err = c.CancelWaybill(localBill, partner.CancelWaybillReasonDYPSCancel, partner.CancelWaybillReasonStrDYPSCancel); err != nil { - partner.CurOrderManager.OnOrderMsg(order, "取消抖音平台运单错误,无法转自送", err.Error()) - return err - } - } else { - partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivering(order, "") - } + partner.GetPurchasePlatformFromVendorID(order.VendorID).SelfDeliverDelivering(order, "") } } else { if err := partner.GetPurchaseOrderHandlerFromVendorID(order.VendorID).SelfDeliverDelivering(order, userName); err != nil && (err != scheduler.ErrOrderStatusAlreadySatisfyCurOperation) { diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index efb389a0c..c61779c72 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -201,7 +201,7 @@ func Init() { orderman.UpdateTaoSettleInfo() }, []string{ "06:30:00", - "15:18:00", + "15:45:00", }) // 每分钟轮询一次,推送骑手信息(假的订单)