- continue refactoring...

This commit is contained in:
gazebo
2018-08-17 16:42:16 +08:00
parent d40186e930
commit c5db19045d
33 changed files with 656 additions and 178 deletions

View File

@@ -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)"` // 最后操作员
}