- big refactor for scheduler.

This commit is contained in:
gazebo
2018-07-25 20:43:41 +08:00
parent f3df85c8e0
commit c0770e9ab5
16 changed files with 515 additions and 321 deletions

View File

@@ -158,6 +158,11 @@ func (c *OrderController) GetOrder(orderID string) (order *model.GoodsOrder, err
Skus: []*model.OrderSku{},
}
order.Status = c.GetStatusFromVendorStatus(order.VendorStatus)
if result["book"].(bool) {
order.BusinessType = model.BusinessTypeDingshida
} else {
order.BusinessType = model.BusinessTypeImmediate
}
deliveryGeo := strings.Split(utils.Interface2String(result["deliveryGeo"]), ",")
if len(deliveryGeo) == 2 {
order.CoordinateType = model.CoordinateTypeMars
@@ -273,8 +278,11 @@ func (c *OrderController) SelfDeliverDelievered(order *model.GoodsOrder) (err er
return api.ElmAPI.CompleteDeliveryBySelf(order.VendorOrderID, order.ConsigneeMobile)
}
func (c *OrderController) GetStatusActionConfig(status int) *scheduler.StatusActionConfig {
return &scheduler.StatusActionConfig{
Timeout: acceptOrderDelay, // 饿了么没有拣货状态,接单后就为拣货完成,所以要延迟接单,否则门店来不及备货
func (c *OrderController) GetStatusActionConfig(statusType, status int) *scheduler.StatusActionConfig {
if statusType == scheduler.TimerStatusTypeOrder && status == model.OrderStatusNew {
return &scheduler.StatusActionConfig{
Timeout: acceptOrderDelay, // 饿了么没有拣货状态,接单后就为拣货完成,所以要延迟接单,否则门店来不及备货
}
}
return nil
}