package models // ReceivingOrderItem 入库单明细表 type ReceivingOrderItem struct { ID int64 `json:"id" gorm:"primarykey;comment:明细ID"` ReceivingOrderID int64 `json:"receiving_order_id" gorm:"not null;default:0;index;comment:入库单ID"` ProductID int64 `json:"product_id" gorm:"not null;default:0;index;comment:商品ID"` LocationID int64 `json:"location_id" gorm:"not null;default:0;index;comment:入库库位ID"` BatchNo string `json:"batch_no" gorm:"size:100;not null;default:'';comment:批次号"` ProductionDate int64 `json:"production_date" gorm:"not null;default:0;comment:生产日期时间戳(秒)"` ExpiryDate int64 `json:"expiry_date" gorm:"not null;default:0;comment:失效日期时间戳(秒)"` Quantity int64 `json:"quantity" gorm:"not null;comment:入库数量(最小单位)"` CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;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;comment:逻辑删除标记(0:未删除,1:已删除)"` } func (ReceivingOrderItem) TableName() string { return "receiving_order_item" } func (ReceivingOrderItem) TableOptions() string { return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='入库单明细表'" }