- 处理小费时,对于定时达特殊处理
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) {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user