- 处理小费时,对于定时达特殊处理
This commit is contained in:
@@ -977,16 +977,22 @@ func (s *DefScheduler) autoPickupGood(savedOrderInfo *WatchOrderInfo) (err error
|
|||||||
|
|
||||||
func (s *DefScheduler) getWaybillTip(order *model.GoodsOrder) (tipFee int64) {
|
func (s *DefScheduler) getWaybillTip(order *model.GoodsOrder) (tipFee int64) {
|
||||||
if order.Status == model.OrderStatusFinishedPickup {
|
if order.Status == model.OrderStatusFinishedPickup {
|
||||||
startTime := order.StatusTime.Add(minAddWaybillTipMinute * time.Minute)
|
statusTime := order.StatusTime
|
||||||
if order.DeliveryFlag&model.OrderDeliveryFlagMaskAutoPickup != 0 {
|
if order.BusinessType != model.BusinessTypeImmediate {
|
||||||
startTime = startTime.Add(5 * time.Minute)
|
statusTime = order.PickDeadline
|
||||||
}
|
}
|
||||||
timeGap1 := time.Now().Sub(startTime)
|
if !utils.IsTimeZero(statusTime) {
|
||||||
if timeGap1 > 0 {
|
startTime := order.StatusTime.Add(minAddWaybillTipMinute * time.Minute)
|
||||||
timeGap := int64(timeGap1/(5*time.Minute)) + 1
|
if order.DeliveryFlag&model.OrderDeliveryFlagMaskAutoPickup != 0 {
|
||||||
tipFee = timeGap * 100
|
startTime = startTime.Add(5 * time.Minute)
|
||||||
if tipFee > 600 {
|
}
|
||||||
tipFee = 600
|
timeGap1 := time.Now().Sub(startTime)
|
||||||
|
if timeGap1 > 0 {
|
||||||
|
timeGap := int64(timeGap1/(5*time.Minute)) + 1
|
||||||
|
tipFee = timeGap * 100
|
||||||
|
if tipFee > 600 {
|
||||||
|
tipFee = 600
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user