Files
jx-callback/business/model/model.go
gazebo a8c2e9991b - pending order use real status when calling scheduler.OnOrderNew.
- set the order status to the proper value when there is a early message camme(saveOrder).
2018-07-25 22:58:19 +08:00

49 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "time"
func Order2Status(order *GoodsOrder) (retVal *OrderStatus) {
retVal = &OrderStatus{
VendorOrderID: order.VendorOrderID,
VendorID: order.VendorID,
OrderType: OrderTypeOrder,
RefVendorOrderID: order.VendorOrderID,
RefVendorID: order.VendorID,
Status: order.Status,
VendorStatus: order.VendorStatus,
StatusTime: order.StatusTime,
}
return retVal
}
func Waybill2Status(bill *Waybill) (retVal *OrderStatus) {
retVal = &OrderStatus{
VendorOrderID: bill.VendorWaybillID,
VendorID: bill.WaybillVendorID,
OrderType: OrderTypeWaybill,
RefVendorOrderID: bill.VendorOrderID,
RefVendorID: bill.OrderVendorID,
Status: bill.Status,
VendorStatus: bill.VendorStatus,
StatusTime: bill.StatusTime,
}
return retVal
}
// 判断订单是否是临时的不是真实收到了new order消息后的订单
func IsOrderSolid(order *GoodsOrder) bool {
return !(order.ConsigneeName == "" && order.ID == 0)
}
func (o *GoodsOrder) GetStatusTime() time.Time {
return o.StatusTime
}
func (o *Waybill) GetStatusTime() time.Time {
return o.StatusTime
}
func (o *OrderStatus) GetStatusTime() time.Time {
return o.StatusTime
}