- delivery fee added.

- fixed scheduler bug
This commit is contained in:
gazebo
2018-07-19 18:05:40 +08:00
parent 56fcb4f4ed
commit a56cb64f8e
8 changed files with 111 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ import (
"git.rosy.net.cn/jx-callback/business/controller"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/globals/api"
)
type WaybillController struct {
@@ -23,6 +24,10 @@ func (c *WaybillController) OnWaybillStatusMsg(msg *elmapi.CallbackWaybillStatus
func (c *WaybillController) onWaybillStatusMsg(msg *elmapi.CallbackWaybillStatusMsg) (retVal *elmapi.CallbackResponse) {
order := c.callbackMsg2Waybill(msg)
if msg.MsgType == elmapi.MsgTypeWaybillWait4DeliveryVendor {
if result, err := api.ElmAPI.GetOrder(msg.OrderID); err == nil {
order.DesiredFee = controller.StandardPrice2Int(utils.Interface2FloatWithDefault(result["deliverFee"], 0.0) +
utils.Interface2FloatWithDefault(result["vipDeliveryFeeDiscount"], 0.0))
}
order.Status = model.WaybillStatusNew
} else if msg.MsgType == elmapi.MsgTypeWaybillPickingUp {
order.Status = model.WaybillStatusAccepted