29 lines
2.0 KiB
Go
29 lines
2.0 KiB
Go
package models
|
||
|
||
// ReceivingOrder 入库单主表
|
||
type ReceivingOrder struct {
|
||
ID int64 `json:"id" gorm:"primarykey;comment:入库单ID"`
|
||
ReceivingNo string `json:"receiving_no" gorm:"size:100;not null;default:'';uniqueIndex;comment:入库单号"`
|
||
PurchaseOrderID int64 `json:"purchase_order_id" gorm:"not null;default:0;index;comment:关联采购单ID(可为空,支持无来源入库)"`
|
||
WaveTaskID int64 `json:"wave_task_id" gorm:"not null;default:0;index;comment:关联波次任务ID"`
|
||
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:入库仓库ID"`
|
||
ShopId int64 `json:"shop_id" gorm:"type:bigint(20);default:0;index:idx_ro_del_shop_time;priority:2;comment:店铺ID"`
|
||
SupplierID int64 `json:"supplier_id" gorm:"not null;default:0;comment:供应商ID"`
|
||
ReceivingDate int64 `json:"receiving_date" gorm:"not null;default:0;comment:入库日期时间戳(秒)"`
|
||
Status int8 `json:"status" gorm:"not null;default:1;index;comment:状态(1:待收货/pending, 2:验收中/checking, 3:已完成/completed, 4:已取消/cancelled)"`
|
||
Operator string `json:"operator" gorm:"size:100;not null;default:'';comment:操作人"`
|
||
OperatorID int64 `json:"operator_id" gorm:"not null;default:0;comment:操作人ID"`
|
||
Remark string `json:"remark" gorm:"size:255;not null;default:'';comment:备注"`
|
||
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;index:idx_ro_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_ro_del_shop_time;priority:1;index:idx_ro_del_time;priority:1;comment:逻辑删除标记(0:未删除,1:已删除)"`
|
||
}
|
||
|
||
func (ReceivingOrder) TableName() string {
|
||
return "receiving_order"
|
||
}
|
||
|
||
func (ReceivingOrder) TableOptions() string {
|
||
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='入库单主表'"
|
||
}
|