2026-03-18 10:18:03 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
|
"assets/consts/public"
|
|
|
|
|
|
"assets/consts/stock"
|
|
|
|
|
|
|
2026-06-10 15:40:17 +08:00
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
2026-03-18 10:18:03 +08:00
|
|
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
|
|
|
|
"go.mongodb.org/mongo-driver/v2/bson"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// InventoryCount 库存盘点主表实体(盘点任务执行时冻结所选盘点范围的库存)
|
|
|
|
|
|
type InventoryCount struct {
|
|
|
|
|
|
beans.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
|
|
|
|
|
|
|
|
|
|
|
// 基本信息
|
|
|
|
|
|
CountNo string `bson:"countNo" json:"countNo"` // 盘点单号
|
|
|
|
|
|
Title string `bson:"title" json:"title"` // 盘点标题
|
|
|
|
|
|
Description string `bson:"description" json:"description"` // 盘点描述
|
|
|
|
|
|
WarehouseIDs []*bson.ObjectID `bson:"warehouseIds" json:"warehouseIds"` // 仓库ID列表
|
|
|
|
|
|
ZoneIDs []*bson.ObjectID `bson:"zoneIds" json:"zoneIds"` // 库区ID列表
|
|
|
|
|
|
LocationIDs []*bson.ObjectID `bson:"locationIds" json:"locationIds"` // 库位ID列表
|
|
|
|
|
|
AssetSkuIDs []*bson.ObjectID `bson:"assetSkuIds" json:"assetSkuIds"` // 资产SKU ID列表
|
|
|
|
|
|
|
|
|
|
|
|
// 盘点范围
|
|
|
|
|
|
IsFrozen bool `bson:"isFrozen" json:"isFrozen"` //是否冻结(冻结时不允许修改)
|
|
|
|
|
|
CountType stock.InventoryCountType `bson:"countType" json:"countType"` // 盘点类型
|
|
|
|
|
|
Scope stock.InventoryCountScope `bson:"scope" json:"scope"` // 盘点范围
|
|
|
|
|
|
|
|
|
|
|
|
// 时间信息
|
|
|
|
|
|
ActualStartTime *gtime.Time `bson:"actualStartTime" json:"actualStartTime"` // 实际开始时间
|
|
|
|
|
|
ActualEndTime *gtime.Time `bson:"actualEndTime" json:"actualEndTime"` // 实际结束时间
|
|
|
|
|
|
|
|
|
|
|
|
// 状态信息
|
|
|
|
|
|
Status stock.InventoryCountStatus `bson:"status" json:"status"` // 盘点状态
|
|
|
|
|
|
Progress float64 `bson:"progress" json:"progress"` // 进度百分比 0-100
|
|
|
|
|
|
|
|
|
|
|
|
// 人员信息
|
|
|
|
|
|
CreatorID string `bson:"creatorId" json:"creatorId"` // 创建人ID
|
|
|
|
|
|
AssigneeID string `bson:"assigneeId" json:"assigneeId"` // 负责人ID
|
|
|
|
|
|
AssigneeName string `bson:"assigneeName" json:"assigneeName"` // 负责人名称
|
|
|
|
|
|
Participants []string `bson:"participants" json:"participants"` // 参与人员ID列表
|
|
|
|
|
|
|
|
|
|
|
|
// 统计信息
|
|
|
|
|
|
TotalItems int `bson:"totalItems" json:"totalItems"` // 盘点条目总数
|
|
|
|
|
|
CompletedItems int `bson:"completedItems" json:"completedItems"` // 已完成条目数
|
|
|
|
|
|
DiscrepancyItems int `bson:"discrepancyItems" json:"discrepancyItems"` // 有差异条目数
|
|
|
|
|
|
|
|
|
|
|
|
// 备注信息
|
|
|
|
|
|
Remark string `bson:"remark" json:"remark"` // 备注
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// CollectionName 获取集合名称
|
|
|
|
|
|
func (InventoryCount) CollectionName() string {
|
|
|
|
|
|
return public.InventoryCountCollection
|
|
|
|
|
|
}
|