Files
assets/model/dto/stock/inventory_warning_dto.go

215 lines
12 KiB
Go
Raw Permalink Normal View History

2026-03-18 10:18:03 +08:00
package dto
import (
"assets/consts/stock"
"gitea.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"go.mongodb.org/mongo-driver/v2/bson"
)
// CreateInventoryWarningReq 创建库存预警请求
type CreateInventoryWarningReq struct {
g.Meta `path:"/createInventoryWarning" method:"post" tags:"库存预警管理" summary:"创建库存预警" dc:"创建新的库存预警"`
WarningType stock.WarningType `json:"warningType" v:"required" dc:"预警类型"`
BatchID *bson.ObjectID `json:"batchId" v:"required" dc:"关联批次ID"`
AssetID *bson.ObjectID `json:"assetId" dc:"关联资产ID"`
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"关联资产SKU ID"`
SupplierID *bson.ObjectID `json:"supplierId" dc:"关联供应商ID"`
BatchNo string `json:"batchNo" dc:"批次号"`
BatchQty int `json:"batchQty" dc:"批次数量"`
AvailableQty int `json:"availableQty" dc:"可用数量"`
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间"`
MinStockThreshold int `json:"minStockThreshold" dc:"最低库存阈值"`
Status stock.ExpiryMessageStatus `json:"status" dc:"消息状态"`
ProcessedAt *gtime.Time `json:"processedAt" dc:"处理时间"`
Processor string `json:"processor" dc:"处理人"`
ProcessNote string `json:"processNote" dc:"处理备注"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
PromotionPlanID string `json:"promotionPlanId" dc:"促销方案ID"`
SupportsRecycle bool `json:"supportsRecycle" dc:"是否支持回收"`
Notes string `json:"notes" dc:"备注"`
}
// CreateInventoryWarningRes 创建库存预警响应
type CreateInventoryWarningRes struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
}
// UpdateInventoryWarningReq 更新库存预警请求
type UpdateInventoryWarningReq struct {
g.Meta `path:"/updateInventoryWarning" method:"put" tags:"库存预警管理" summary:"更新库存预警" dc:"更新库存预警信息"`
Id *bson.ObjectID `json:"id" v:"required" dc:"预警ID"`
WarningType stock.WarningType `json:"warningType" v:"required" dc:"预警类型"`
BatchID *bson.ObjectID `json:"batchId" v:"required" dc:"关联批次ID"`
AssetID *bson.ObjectID `json:"assetId" dc:"关联资产ID"`
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"关联资产SKU ID"`
SupplierID *bson.ObjectID `json:"supplierId" dc:"关联供应商ID"`
BatchNo string `json:"batchNo" dc:"批次号"`
BatchQty int `json:"batchQty" dc:"批次数量"`
AvailableQty int `json:"availableQty" dc:"可用数量"`
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间"`
MinStockThreshold int `json:"minStockThreshold" dc:"最低库存阈值"`
Status stock.ExpiryMessageStatus `json:"status" dc:"消息状态"`
ProcessedAt *gtime.Time `json:"processedAt" dc:"处理时间"`
Processor string `json:"processor" dc:"处理人"`
ProcessNote string `json:"processNote" dc:"处理备注"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
PromotionPlanID string `json:"promotionPlanId" dc:"促销方案ID"`
SupportsRecycle bool `json:"supportsRecycle" dc:"是否支持回收"`
Notes string `json:"notes" dc:"备注"`
}
// UpdateInventoryWarningRes 更新库存预警响应
type UpdateInventoryWarningRes struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
}
// DeleteInventoryWarningReq 删除库存预警请求
type DeleteInventoryWarningReq struct {
g.Meta `path:"/deleteInventoryWarning" method:"delete" tags:"库存预警管理" summary:"删除库存预警" dc:"删除库存预警"`
Id *bson.ObjectID `json:"id" v:"required" dc:"预警ID"`
}
// DeleteInventoryWarningRes 删除库存预警响应
type DeleteInventoryWarningRes struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
}
// GetInventoryWarningReq 获取库存预警详情请求
type GetInventoryWarningReq struct {
g.Meta `path:"/getInventoryWarning" method:"get" tags:"库存预警管理" summary:"获取库存预警详情" dc:"获取库存预警详情"`
Id *bson.ObjectID `json:"id" v:"required" dc:"预警ID"`
}
// GetInventoryWarningRes 获取库存预警详情响应
type GetInventoryWarningRes struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
WarningType stock.WarningType `json:"warningType" dc:"预警类型"`
WarningTypeText string `json:"warningTypeText" dc:"预警类型文本"`
BatchID *bson.ObjectID `json:"batchId" dc:"关联批次ID"`
AssetID *bson.ObjectID `json:"assetId" dc:"关联资产ID"`
AssetName string `json:"assetName" dc:"资产名称"`
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"关联资产SKU ID"`
AssetSkuName string `json:"assetSkuName" dc:"资产SKU名称"`
SupplierID *bson.ObjectID `json:"supplierId" dc:"关联供应商ID"`
SupplierName string `json:"supplierName" dc:"供应商名称"`
BatchNo string `json:"batchNo" dc:"批次号"`
BatchQty int `json:"batchQty" dc:"批次数量"`
AvailableQty int `json:"availableQty" dc:"可用数量"`
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间"`
MinStockThreshold int `json:"minStockThreshold" dc:"最低库存阈值"`
Status stock.ExpiryMessageStatus `json:"status" dc:"消息状态"`
StatusText string `json:"statusText" dc:"状态文本"`
ProcessedAt *gtime.Time `json:"processedAt" dc:"处理时间"`
Processor string `json:"processor" dc:"处理人"`
ProcessorName string `json:"processorName" dc:"处理人名称"`
ProcessNote string `json:"processNote" dc:"处理备注"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
ProcessMethodText string `json:"processMethodText" dc:"处理方式文本"`
PromotionPlanID string `json:"promotionPlanId" dc:"促销方案ID"`
SupportsRecycle bool `json:"supportsRecycle" dc:"是否支持回收"`
Notes string `json:"notes" dc:"备注"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// ListInventoryWarningReq 获取库存预警列表请求
type ListInventoryWarningReq struct {
g.Meta `path:"/listInventoryWarnings" method:"get" tags:"库存预警管理" summary:"获取库存预警列表" dc:"分页查询库存预警列表"`
*beans.Page
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
WarningType *stock.WarningType `json:"warningType" dc:"预警类型"`
BatchID string `json:"batchId" dc:"关联批次ID单个兼容旧版"`
BatchIDs []string `json:"batchIds" dc:"批次ID列表批量查询"`
AssetID string `json:"assetId" dc:"关联资产ID单个兼容旧版"`
AssetIDs []string `json:"assetIds" dc:"资产ID列表批量查询"`
AssetSkuID string `json:"assetSkuId" dc:"关联资产SKU ID单个兼容旧版"`
AssetSkuIDs []string `json:"assetSkuIds" dc:"资产SKU ID列表批量查询"`
SupplierID string `json:"supplierId" dc:"关联供应商ID单个兼容旧版"`
SupplierIDs []string `json:"supplierIds" dc:"供应商ID列表批量查询"`
Status *stock.ExpiryMessageStatus `json:"status" dc:"消息状态"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
SupportsRecycle *bool `json:"supportsRecycle" dc:"是否支持回收"`
StartDate string `json:"startDate" dc:"开始日期"`
EndDate string `json:"endDate" dc:"结束日期"`
Keyword string `json:"keyword" dc:"关键词搜索(批次号/备注)"`
}
// ListInventoryWarningRes 获取库存预警列表响应
type ListInventoryWarningRes struct {
List []InventoryWarningListItem `json:"list" dc:"库存预警列表"`
Total int64 `json:"total" dc:"总数"`
}
// InventoryWarningListItem 库存预警列表项
type InventoryWarningListItem struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
WarningType stock.WarningType `json:"warningType" dc:"预警类型"`
WarningTypeText string `json:"warningTypeText" dc:"预警类型文本"`
BatchID *bson.ObjectID `json:"batchId" dc:"关联批次ID"`
BatchNo string `json:"batchNo" dc:"批次号"`
AssetID *bson.ObjectID `json:"assetId" dc:"关联资产ID"`
AssetName string `json:"assetName" dc:"资产名称"`
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"关联资产SKU ID"`
AssetSkuName string `json:"assetSkuName" dc:"资产SKU名称"`
SupplierID *bson.ObjectID `json:"supplierId" dc:"关联供应商ID"`
SupplierName string `json:"supplierName" dc:"供应商名称"`
BatchQty int `json:"batchQty" dc:"批次数量"`
AvailableQty int `json:"availableQty" dc:"可用数量"`
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
MinStockThreshold int `json:"minStockThreshold" dc:"最低库存阈值"`
Status stock.ExpiryMessageStatus `json:"status" dc:"消息状态"`
StatusText string `json:"statusText" dc:"状态文本"`
ProcessedAt *gtime.Time `json:"processedAt" dc:"处理时间"`
Processor string `json:"processor" dc:"处理人"`
ProcessorName string `json:"processorName" dc:"处理人名称"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
ProcessMethodText string `json:"processMethodText" dc:"处理方式文本"`
SupportsRecycle bool `json:"supportsRecycle" dc:"是否支持回收"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
}
// ProcessInventoryWarningReq 处理库存预警请求
type ProcessInventoryWarningReq struct {
g.Meta `path:"/processInventoryWarning" method:"post" tags:"库存预警管理" summary:"处理库存预警" dc:"处理库存预警"`
Id *bson.ObjectID `json:"id" v:"required" dc:"预警ID"`
Status stock.ExpiryMessageStatus `json:"status" v:"required" dc:"处理状态"`
Processor string `json:"processor" v:"required" dc:"处理人"`
ProcessNote string `json:"processNote" dc:"处理备注"`
ProcessMethod *stock.ExpiryProcessMethod `json:"processMethod" dc:"处理方式"`
PromotionPlanID string `json:"promotionPlanId" dc:"促销方案ID"`
}
// ProcessInventoryWarningRes 处理库存预警响应
type ProcessInventoryWarningRes struct {
Id *bson.ObjectID `json:"id" dc:"预警ID"`
}