55 lines
2.5 KiB
Go
55 lines
2.5 KiB
Go
|
|
package entity
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"assets/consts/public"
|
|||
|
|
"assets/consts/stock"
|
|||
|
|
|
|||
|
|
"gitea.com/red-future/common/beans"
|
|||
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|||
|
|
"go.mongodb.org/mongo-driver/v2/bson"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// InventoryWarning 库存预警实体
|
|||
|
|
type InventoryWarning struct {
|
|||
|
|
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
|||
|
|
|
|||
|
|
// 预警类型
|
|||
|
|
WarningType stock.WarningType `bson:"warningType" json:"warningType"` // 预警类型
|
|||
|
|
|
|||
|
|
// 关联信息
|
|||
|
|
BatchID *bson.ObjectID `bson:"batchId" json:"batchId"` // 关联批次ID
|
|||
|
|
AssetID *bson.ObjectID `bson:"assetId" json:"assetId"` // 关联资产ID
|
|||
|
|
AssetSkuID *bson.ObjectID `bson:"assetSkuId" json:"assetSkuId"` // 关联资产SKU ID
|
|||
|
|
SupplierID *bson.ObjectID `bson:"supplierId" json:"supplierId"` // 关联供应商ID
|
|||
|
|
BatchNo string `bson:"batchNo" json:"batchNo"` // 批次号
|
|||
|
|
BatchQty int `bson:"batchQty" json:"batchQty"` // 批次数量
|
|||
|
|
AvailableQty int `bson:"availableQty" json:"availableQty"` // 可用数量
|
|||
|
|
|
|||
|
|
// 时间信息(临期预警使用)
|
|||
|
|
ProductionDate *gtime.Time `bson:"productionDate" json:"productionDate"` // 生产日期
|
|||
|
|
ExpiryDate *gtime.Time `bson:"expiryDate" json:"expiryDate"` // 过期日期
|
|||
|
|
ExpiryWarningDate *gtime.Time `bson:"expiryWarningDate" json:"expiryWarningDate"` // 临期预警时间
|
|||
|
|
|
|||
|
|
// 库存信息(库存不足预警使用)
|
|||
|
|
MinStockThreshold int `bson:"minStockThreshold" json:"minStockThreshold"` // 最低库存阈值
|
|||
|
|
|
|||
|
|
// 消息状态
|
|||
|
|
Status stock.ExpiryMessageStatus `bson:"status" json:"status"` // 消息状态
|
|||
|
|
|
|||
|
|
// 处理信息
|
|||
|
|
ProcessedAt *gtime.Time `bson:"processedAt" json:"processedAt"` // 处理时间
|
|||
|
|
Processor string `bson:"processor" json:"processor"` // 处理人
|
|||
|
|
ProcessNote string `bson:"processNote" json:"processNote"` // 处理备注
|
|||
|
|
ProcessMethod *stock.ExpiryProcessMethod `bson:"processMethod" json:"processMethod"` // 处理方式
|
|||
|
|
PromotionPlanID string `bson:"promotionPlanId" json:"promotionPlanId"` // 促销方案ID
|
|||
|
|
|
|||
|
|
// 其他信息
|
|||
|
|
SupportsRecycle bool `bson:"supportsRecycle" json:"supportsRecycle"` // 是否支持回收
|
|||
|
|
Notes string `bson:"notes" json:"notes"` // 备注
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// CollectionName 获取集合名称
|
|||
|
|
func (InventoryWarning) CollectionName() string {
|
|||
|
|
return public.InventoryWarningCollection
|
|||
|
|
}
|