- empty scheduler added.

This commit is contained in:
gazebo
2018-07-12 20:53:22 +08:00
parent 1c6ba2e43a
commit 52248ca427
13 changed files with 338 additions and 238 deletions

View File

@@ -10,10 +10,6 @@ import (
type WaybillController struct {
}
func init() {
controller.WaybillManager.RegisterDeliveryProvider(controller.VendorIDJD, new(WaybillController))
}
func (c *WaybillController) OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
controller.CallMsgHandler(func() {
retVal = c.onWaybillMsg(msg)
@@ -25,21 +21,21 @@ func (c *WaybillController) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (
order := c.callbackMsg2Waybill(msg)
switch msg.DeliveryStatus {
case jdapi.DeliveryStatusWait4Grap:
order.Status = controller.WaybillStatusNew
order.Status = model.WaybillStatusNew
case jdapi.DeliveryStatusAccepted:
order.Status = controller.WaybillStatusAccepted
order.Status = model.WaybillStatusAccepted
case jdapi.DeliveryStatusCourierCanceled:
order.Status = controller.WaybillStatusCanceled
order.Status = model.WaybillStatusCanceled
case jdapi.DeliveryStatusCourierArrived:
order.Status = controller.WaybillStatusCourierArrived
order.Status = model.WaybillStatusCourierArrived
case jdapi.DeliveryStatusGotGoods:
order.Status = controller.WaybillStatusDelivering
order.Status = model.WaybillStatusDelivering
case jdapi.DeliveryStatusFinished:
order.Status = controller.WaybillStatusDelivered
order.Status = model.WaybillStatusDelivered
case jdapi.DeliveryStatusFailedDelivery:
order.Status = controller.WaybillStatusFailed
order.Status = model.WaybillStatusFailed
default:
order.Status = controller.WaybillStatusUnknown
order.Status = model.WaybillStatusUnknown
}
return jdapi.Err2CallbackResponse(controller.WaybillManager.OnWaybillStatusChanged(order), order.VendorStatus)
}
@@ -47,9 +43,9 @@ func (c *WaybillController) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (
func (c *WaybillController) callbackMsg2Waybill(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *model.Waybill) {
retVal = &model.Waybill{
VendorOrderID: msg.OrderID,
OrderVendorID: controller.VendorIDJD,
OrderVendorID: model.VendorIDJD,
VendorWaybillID: msg.OrderID,
WaybillVendorID: controller.VendorIDJD,
WaybillVendorID: model.VendorIDJD,
CourierName: msg.DeliveryManName,
CourierMobile: msg.DeliveryManPhone,
VendorStatus: msg.DeliveryStatus,