- continue refactoring...
This commit is contained in:
@@ -144,3 +144,50 @@ func (v *OrderStatus) TableIndex() [][]string {
|
||||
[]string{"VendorOrderID", "Status", "VendorStatus"},
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
LockStatus: order.LockStatus,
|
||||
}
|
||||
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,
|
||||
Remark: bill.Remark,
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user