You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ims/app/models/purchase_product.go

33 lines
1.7 KiB

2 months ago
package models
import (
"ims/util/db/dts"
"time"
"gorm.io/gorm"
)
// PurchaseProduct 管理产品
type PurchaseProduct struct {
ID uint `json:"id" gorm:"primarykey"` // 入库ID
RequisitionID dts.NullUint `json:"requisition_id"` // 采购请求ID
OrderID dts.NullUint `json:"order_id"` // 采购订单ID
ProductID uint `json:"product_id"` // 采购的商品ID
Amount uint `json:"amount"` // 采购数量需求
Requisition *PurchaseRequisition `json:"requisition,omitempty" gorm:"foreignKey:RequisitionID"` // 所属采购请求
Order *PurchaseOrder `json:"order,omitempty" gorm:"foreignKey:OrderID"` // 采购订单
Product *Product `json:"product,omitempty" gorm:"foreignKey:ProductID"` // 采购的商品
CreatedBy uint `json:"created_by"` // 创建者(员工编号)
CreatedAt time.Time `json:"created_at"` // 创建时间
UpdatedBy dts.NullUint `json:"updated_by"` // 创建者(员工编号)
UpdatedAt dts.NullTime `json:"updated_at" gorm:"autoUpdateTime:false"` // 上次操作时间
DeletedBy dts.NullUint `json:"deleted_by"` // 删除者(员工编号)
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` // 删除数据时间
Creator *Employee `json:"creator,omitempty" gorm:"foreignKey:CreatedBy"` // 创建数据的员工
Updater *Employee `json:"updater,omitempty" gorm:"foreignKey:UpdatedBy"` // 上次更新数据的员工
Deleter *Employee `json:"deleter,omitempty" gorm:"foreignKey:DeletedBy"` // 删除数据的员工
}