- continue refactoring...
This commit is contained in:
@@ -2,49 +2,23 @@ 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,
|
||||
LockStatus: order.LockStatus,
|
||||
}
|
||||
return retVal
|
||||
type ModelO struct {
|
||||
ID uint `gorm:"primary_key"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt *time.Time `sql:"index"`
|
||||
LastOperator string `gorm:"type:varchar(32)"` // 最后操作员
|
||||
}
|
||||
|
||||
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
|
||||
type ModelIDCU struct {
|
||||
ID uint `gorm:"primary_key"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
// 判断订单是否是临时的,不是真实收到了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
|
||||
type ModelIDCUO struct {
|
||||
ID uint `gorm:"primary_key"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
LastOperator string `gorm:"type:varchar(32)"` // 最后操作员
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user