From 8ad7f9fa3b9e604082b8544717e0407cef65f587 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 31 Jul 2019 13:49:56 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A4=84=E7=90=86=E5=B0=8F=E8=B4=B9?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=AF=B9=E4=BA=8E=E5=AE=9A=E6=97=B6=E8=BE=BE?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jxcallback/scheduler/defsch/defsch.go | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/business/jxcallback/scheduler/defsch/defsch.go b/business/jxcallback/scheduler/defsch/defsch.go index ecf13a3d0..f3473f43a 100644 --- a/business/jxcallback/scheduler/defsch/defsch.go +++ b/business/jxcallback/scheduler/defsch/defsch.go @@ -977,16 +977,22 @@ func (s *DefScheduler) autoPickupGood(savedOrderInfo *WatchOrderInfo) (err error func (s *DefScheduler) getWaybillTip(order *model.GoodsOrder) (tipFee int64) { if order.Status == model.OrderStatusFinishedPickup { - startTime := order.StatusTime.Add(minAddWaybillTipMinute * time.Minute) - if order.DeliveryFlag&model.OrderDeliveryFlagMaskAutoPickup != 0 { - startTime = startTime.Add(5 * time.Minute) + statusTime := order.StatusTime + if order.BusinessType != model.BusinessTypeImmediate { + statusTime = order.PickDeadline } - timeGap1 := time.Now().Sub(startTime) - if timeGap1 > 0 { - timeGap := int64(timeGap1/(5*time.Minute)) + 1 - tipFee = timeGap * 100 - if tipFee > 600 { - tipFee = 600 + if !utils.IsTimeZero(statusTime) { + startTime := order.StatusTime.Add(minAddWaybillTipMinute * time.Minute) + if order.DeliveryFlag&model.OrderDeliveryFlagMaskAutoPickup != 0 { + startTime = startTime.Add(5 * time.Minute) + } + timeGap1 := time.Now().Sub(startTime) + if timeGap1 > 0 { + timeGap := int64(timeGap1/(5*time.Minute)) + 1 + tipFee = timeGap * 100 + if tipFee > 600 { + tipFee = 600 + } } } }