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

203 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"
)
// CreateInventoryCountReq 创建盘点任务请求
type CreateInventoryCountReq struct {
g.Meta `path:"/createInventoryCount" method:"post" tags:"盘点管理" summary:"创建盘点任务" dc:"创建新的盘点任务"`
Title string `json:"title" v:"required|max-length:200#盘点标题不能为空|盘点标题不能超过200个字符" dc:"盘点标题"`
Description string `json:"description" dc:"盘点描述"`
WarehouseIDs []string `json:"warehouseId" dc:"仓库ID列表按仓库/库区/库位盘点时必填)"`
ZoneIDs []string `json:"zoneId" dc:"库区ID列表可选"`
LocationIDs []string `json:"locationId" dc:"库位ID列表可选"`
AssetSkuIDs []string `json:"assetSkuId" dc:"资产SKU ID列表可选"`
CountType stock.InventoryCountType `json:"countType" v:"required" dc:"盘点类型"`
Scope stock.InventoryCountScope `json:"scope" v:"required" dc:"盘点范围"`
AssigneeID string `json:"assigneeId" v:"required" dc:"负责人ID"`
AssigneeName string `json:"assigneeName" dc:"负责人名称"`
Participants []string `json:"participants" dc:"参与人员ID列表"`
Remark string `json:"remark" dc:"备注"`
}
// CreateInventoryCountRes 创建盘点任务响应
type CreateInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
CountNo string `json:"countNo" dc:"盘点单号"`
}
// UpdateInventoryCountReq 更新盘点任务请求
type UpdateInventoryCountReq struct {
g.Meta `path:"/updateInventoryCount" method:"put" tags:"盘点管理" summary:"更新盘点任务" dc:"更新盘点任务信息"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
Title string `json:"title" dc:"盘点标题"`
Description string `json:"description" dc:"盘点描述"`
AssigneeID string `json:"assigneeId" dc:"负责人ID"`
AssigneeName string `json:"assigneeName" dc:"负责人名称"`
Participants []string `json:"participants" dc:"参与人员ID列表"`
Status *stock.InventoryCountStatus `json:"status" dc:"盘点状态"`
Remark string `json:"remark" dc:"备注"`
}
// UpdateInventoryCountRes 更新盘点任务响应
type UpdateInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
}
// DeleteInventoryCountReq 删除盘点任务请求
type DeleteInventoryCountReq struct {
g.Meta `path:"/deleteInventoryCount" method:"delete" tags:"盘点管理" summary:"删除盘点任务" dc:"删除盘点任务"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
}
// DeleteInventoryCountRes 删除盘点任务响应
type DeleteInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
}
// GetInventoryCountReq 获取盘点任务详情请求
type GetInventoryCountReq struct {
g.Meta `path:"/getInventoryCount" method:"get" tags:"盘点管理" summary:"获取盘点任务详情" dc:"获取盘点任务详情"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
}
// GetInventoryCountRes 获取盘点任务详情响应
type GetInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
CountNo string `json:"countNo" dc:"盘点单号"`
Title string `json:"title" dc:"盘点标题"`
Description string `json:"description" dc:"盘点描述"`
WarehouseIDs []*bson.ObjectID `json:"warehouseIds" dc:"仓库ID列表"`
WarehouseNames []string `json:"warehouseNames" dc:"仓库名称列表"`
ZoneIDs []*bson.ObjectID `json:"zoneIds" dc:"库区ID列表"`
ZoneNames []string `json:"zoneNames" dc:"库区名称列表"`
LocationIDs []*bson.ObjectID `json:"locationIds" dc:"库位ID列表"`
LocationNames []string `json:"locationNames" dc:"库位名称列表"`
AssetSkuIDs []*bson.ObjectID `json:"assetSkuIds" dc:"资产SKU ID列表"`
AssetSkuNames []string `json:"assetSkuNames" dc:"资产SKU名称列表"`
CountType stock.InventoryCountType `json:"countType" dc:"盘点类型"`
CountTypeText string `json:"countTypeText" dc:"盘点类型文本"`
Scope stock.InventoryCountScope `json:"scope" dc:"盘点范围"`
ScopeText string `json:"scopeText" dc:"盘点范围文本"`
ActualStartTime *gtime.Time `json:"actualStartTime" dc:"实际开始时间"`
ActualEndTime *gtime.Time `json:"actualEndTime" dc:"实际结束时间"`
Status stock.InventoryCountStatus `json:"status" dc:"盘点状态"`
StatusText string `json:"statusText" dc:"状态文本"`
Progress float64 `json:"progress" dc:"进度百分比"`
CreatorID string `json:"creatorId" dc:"创建人ID"`
CreatorName string `json:"creatorName" dc:"创建人名称"`
AssigneeID string `json:"assigneeId" dc:"负责人ID"`
AssigneeName string `json:"assigneeName" dc:"负责人名称"`
Participants []string `json:"participants" dc:"参与人员ID列表"`
ParticipantNames []string `json:"participantNames" dc:"参与人员名称列表"`
TotalItems int `json:"totalItems" dc:"盘点条目总数"`
CompletedItems int `json:"completedItems" dc:"已完成条目数"`
DiscrepancyItems int `json:"discrepancyItems" dc:"有差异条目数"`
Remark string `json:"remark" dc:"备注"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// ListInventoryCountReq 获取盘点任务列表请求
type ListInventoryCountReq struct {
g.Meta `path:"/listInventoryCounts" method:"get" tags:"盘点管理" summary:"获取盘点任务列表" dc:"分页查询盘点任务列表"`
*beans.Page
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
WarehouseID string `json:"warehouseId" dc:"仓库ID单个兼容旧版"`
WarehouseIDs []string `json:"warehouseIds" dc:"仓库ID列表批量查询"`
ZoneID string `json:"zoneId" dc:"库区ID单个兼容旧版"`
ZoneIDs []string `json:"zoneIds" dc:"库区ID列表批量查询"`
CountType *stock.InventoryCountType `json:"countType" dc:"盘点类型"`
Status *stock.InventoryCountStatus `json:"status" dc:"盘点状态"`
AssigneeID string `json:"assigneeId" dc:"负责人ID"`
StartDate string `json:"startDate" dc:"开始日期"`
EndDate string `json:"endDate" dc:"结束日期"`
Keyword string `json:"keyword" dc:"关键词搜索(单号/标题)"`
}
// ListInventoryCountRes 获取盘点任务列表响应
type ListInventoryCountRes struct {
List []InventoryCountListItem `json:"list" dc:"盘点任务列表"`
Total int64 `json:"total" dc:"总数"`
}
// InventoryCountListItem 盘点任务列表项
type InventoryCountListItem struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
CountNo string `json:"countNo" dc:"盘点单号"`
Title string `json:"title" dc:"盘点标题"`
WarehouseIDs []*bson.ObjectID `json:"warehouseIds" dc:"仓库ID列表"`
WarehouseNames []string `json:"warehouseNames" dc:"仓库名称列表"`
ZoneIDs []*bson.ObjectID `json:"zoneIds" dc:"库区ID列表"`
ZoneNames []string `json:"zoneNames" dc:"库区名称列表"`
CountType stock.InventoryCountType `json:"countType" dc:"盘点类型"`
CountTypeText string `json:"countTypeText" dc:"盘点类型文本"`
Scope stock.InventoryCountScope `json:"scope" dc:"盘点范围"`
ScopeText string `json:"scopeText" dc:"盘点范围文本"`
Status stock.InventoryCountStatus `json:"status" dc:"盘点状态"`
StatusText string `json:"statusText" dc:"状态文本"`
Progress float64 `json:"progress" dc:"进度百分比"`
AssigneeID string `json:"assigneeId" dc:"负责人ID"`
AssigneeName string `json:"assigneeName" dc:"负责人名称"`
ActualStartTime *gtime.Time `json:"actualStartTime" dc:"实际开始时间"`
ActualEndTime *gtime.Time `json:"actualEndTime" dc:"实际结束时间"`
TotalItems int `json:"totalItems" dc:"盘点条目总数"`
CompletedItems int `json:"completedItems" dc:"已完成条目数"`
DiscrepancyItems int `json:"discrepancyItems" dc:"有差异条目数"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
}
// CompleteInventoryCountReq 完成盘点请求
type CompleteInventoryCountReq struct {
g.Meta `path:"/completeInventoryCount" method:"post" tags:"盘点管理" summary:"完成盘点" dc:"完成盘点任务"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
}
// CompleteInventoryCountRes 完成盘点响应
type CompleteInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
}
// ExportInventoryCountTemplateReq 导出盘点模板请求
type ExportInventoryCountTemplateReq struct {
g.Meta `path:"/exportInventoryCountTemplate" method:"get" tags:"盘点管理" summary:"导出盘点模板" dc:"导出Excel盘点模板明盘/盲盘)"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
}
// CancelInventoryCountReq 取消盘点请求
type CancelInventoryCountReq struct {
g.Meta `path:"/cancelInventoryCount" method:"post" tags:"盘点管理" summary:"取消盘点" dc:"取消盘点任务"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
Reason string `json:"reason" dc:"取消原因"`
}
// CancelInventoryCountRes 取消盘点响应
type CancelInventoryCountRes struct {
Id *bson.ObjectID `json:"id" dc:"盘点任务ID"`
}
// ExportInventoryCountTemplateRes 导出盘点模板响应
type ExportInventoryCountTemplateRes struct {
FileName string `json:"fileName" dc:"文件名"`
FileData []byte `json:"fileData" dc:"文件数据(Base64编码)"`
}
// ImportInventoryCountReq 上传盘点Excel请求
type ImportInventoryCountReq struct {
g.Meta `path:"/importInventoryCount" method:"post" tags:"盘点管理" summary:"上传盘点Excel" dc:"上传盘点结果Excel"`
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点任务ID"`
}
// ImportInventoryCountRes 上传盘点Excel响应
type ImportInventoryCountRes struct {
SuccessCount int `json:"successCount" dc:"成功导入数量"`
FailCount int `json:"failCount" dc:"失败数量"`
}