33 lines
2.6 KiB
Go
33 lines
2.6 KiB
Go
package models
|
|
|
|
// SalesOrder 销售订单主表
|
|
type SalesOrder struct {
|
|
ID int64 `json:"id" gorm:"primarykey;comment:销售单ID"`
|
|
SoNo string `json:"so_no" gorm:"size:100;not null;default:'';uniqueIndex;comment:销售订单号"`
|
|
AssociationOrderId int64 `json:"association_order_id" gorm:"not null;default:0;index;comment:关联订单ID"`
|
|
AssociationOrderNo string `json:"association_order_no" gorm:"not null;default:'';index;comment:关联订单号"`
|
|
FromType int8 `json:"from_type" gorm:"not null;default:1;comment:来源类型 0-预留 1-erp订单"`
|
|
ShopType int8 `json:"shop_type" gorm:"not null;default:1;comment:店铺类型 1-拼多多 2-孔夫子 5-闲鱼"`
|
|
CustomerID int64 `json:"customer_id" gorm:"not null;default:0;index;comment:客户ID"`
|
|
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;comment:发货仓库ID"`
|
|
OrderDate int64 `json:"order_date" gorm:"not null;default:0;comment:订单日期时间戳(秒)"`
|
|
RequiredDeliveryDate int64 `json:"required_delivery_date" gorm:"not null;default:0;comment:要求送达日期时间戳(秒)"`
|
|
TotalAmount int64 `json:"total_amount" gorm:"not null;default:0;comment:订单总金额(分)"`
|
|
Status int8 `json:"status" gorm:"not null;default:1;index;comment:状态(1:草稿/draft,2:已确认/confirmed,3:已分配库存/allocated,4:拣货完成/picking,5:已发货/shipped,6:已取消/cancelled)"`
|
|
SalesPerson string `json:"sales_person" gorm:"size:100;not null;default:'';comment:店铺名称"`
|
|
SalesPersonID int64 `json:"sales_person_id" gorm:"not null;default:0;index:idx_so_del_person_time;priority:2;comment:店铺ID"`
|
|
Remark string `json:"remark" gorm:"size:255;not null;default:'';comment:备注"`
|
|
IsDistribution int8 `json:"is_distribution" gorm:"not null;default:0;comment:是否分销 0-正常 1-分销"`
|
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;index:idx_so_del_person_time;priority:3;index:idx_so_del_time;priority:2;comment:创建时间戳(秒)"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"`
|
|
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;index:idx_so_del_person_time;priority:1;index:idx_so_del_time;priority:1;comment:逻辑删除标记(0:未删除,1:已删除)"`
|
|
}
|
|
|
|
func (SalesOrder) TableName() string {
|
|
return "sales_order"
|
|
}
|
|
|
|
func (SalesOrder) TableOptions() string {
|
|
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售订单主表'"
|
|
}
|