- 梳理TIMER,去除TimerTypeBaseExpectedDeliveredTime
This commit is contained in:
@@ -23,11 +23,10 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
TimerTypeNoOverride = 0 // GetStatusActionConfig 返回表示不修改缺省配置
|
||||
TimerTypeByPass = 1
|
||||
TimerTypeBaseNow = 2
|
||||
TimerTypeBaseStatusTime = 3
|
||||
TimerTypeBaseExpectedDeliveredTime = 4 // 如果是定时达,以expected delivery time倒推的时间当成statusTime(之后与TimerTypeBaseStatusTime一样),否则与TimerTypeBaseStatusTime相同
|
||||
TimerTypeNoOverride = 0 // GetStatusActionConfig 返回表示不修改缺省配置
|
||||
TimerTypeByPass = 1
|
||||
TimerTypeBaseNow = 2
|
||||
TimerTypeBaseStatusTime = 3
|
||||
)
|
||||
|
||||
type StatusActionParams struct {
|
||||
@@ -36,6 +35,18 @@ type StatusActionParams struct {
|
||||
TimeoutGap int // 以秒为单位的随机时间,0在GetStatusActionConfig返回时表示不修改缺省
|
||||
}
|
||||
|
||||
func (s *StatusActionParams) GetRefTimeout(statusTime time.Time) (timeout time.Duration) {
|
||||
switch s.TimerType {
|
||||
case TimerTypeBaseNow:
|
||||
timeout = s.Timeout
|
||||
case TimerTypeBaseStatusTime:
|
||||
timeout = statusTime.Sub(time.Now()) + s.Timeout
|
||||
default:
|
||||
timeout = 0
|
||||
}
|
||||
return timeout
|
||||
}
|
||||
|
||||
var (
|
||||
CancelWaybillReasonStrNotAcceptIntime = "没有及时抢单"
|
||||
CancelWaybillReasonStrSwitch2SelfFailed = "转自送失败"
|
||||
|
||||
Reference in New Issue
Block a user