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.
35 lines
2.2 KiB
35 lines
2.2 KiB
2 months ago
|
package models
|
||
|
|
||
|
import (
|
||
|
"ims/util/db/dts"
|
||
|
"time"
|
||
|
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
// WarehouseLocation 仓位
|
||
|
type WarehouseLocation struct {
|
||
|
Id uint `json:"id" gorm:"primarykey"` // 仓位ID
|
||
|
Code string `json:"code"` // 仓位编码
|
||
|
WarehouseId uint `json:"warehouse_id" gorm:"index:,unique,composite:uni_code_with_warehouse_and_company"` // 所属仓库ID
|
||
|
Sequence string `json:"sequence" gorm:"index:,unique,composite:uni_code_with_warehouse_and_company"` // 仓位序号
|
||
|
Capacity int `json:"capacity"` // 仓位容量/立方
|
||
|
Remark string `json:"remark"` // 仓位备注
|
||
|
ManagerId dts.NullUint `json:"manager_id"` // 仓位主管编号
|
||
|
Status SimpleStatus `json:"status"` // 是否启用
|
||
|
|
||
|
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"` // 删除数据的员工
|
||
|
|
||
|
Warehouse *Warehouse `json:"warehouse,omitempty"` // 所属仓库
|
||
|
Manager *Employee `json:"manager" gorm:"foreignKey:ManagerId"` // 仓位主管
|
||
|
}
|