Dockerfile
This commit is contained in:
149
model/dto/asset/asset_dto.go
Normal file
149
model/dto/asset/asset_dto.go
Normal file
@@ -0,0 +1,149 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/asset"
|
||||
"assets/consts/stock"
|
||||
"assets/model/config"
|
||||
enumDto "assets/model/dto/enum"
|
||||
entity "assets/model/entity/asset"
|
||||
"time"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
// CreateAssetReq 创建资产请求
|
||||
type CreateAssetReq struct {
|
||||
g.Meta `path:"/createAsset" method:"post" tags:"资产管理" summary:"创建资产" dc:"创建新的资产"`
|
||||
// 基础信息
|
||||
Name string `json:"name" v:"required" dc:"资产名称"`
|
||||
Description string `json:"description" dc:"资产描述"`
|
||||
Type consts.AssetType `json:"type" v:"required" dc:"资产类型:physical实物/virtual虚拟/service服务"`
|
||||
CategoryId uint64 `json:"categoryId" v:"required" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images []string `json:"images" dc:"图片列表"`
|
||||
Status *consts.AssetStatus `json:"status" dc:"状态:1/0" d:"1"`
|
||||
UnlimitedStock bool `json:"unlimitedStock" dc:"是否无库存限制"`
|
||||
StockMode stock.StockMode `json:"stockMode" dc:"库存管理模式:1-明细模式 2-批次模式" d:"2"`
|
||||
// 上线和下线时间配置(由定时任务处理资产状态)
|
||||
OnlineTime *time.Time `json:"onlineTime,omitempty" dc:"上线时间(格式:2006-01-02 15:04:05)"`
|
||||
OfflineTime *time.Time `json:"offlineTime,omitempty" dc:"下线时间(格式:2006-01-02 15:04:05)"`
|
||||
// 类型专用配置 - 实物资产配置
|
||||
PhysicalAssetConfig *config.PhysicalAssetConfig `json:"physicalAssetConfig"`
|
||||
// 类型专用配置 - 服务资产配置
|
||||
ServiceAssetConfig *config.ServiceAssetConfig `json:"serviceAssetConfig"`
|
||||
// 类型专用配置 - 虚拟资产配置
|
||||
VirtualAssetConfig *config.VirtualAssetConfig `json:"virtualAssetConfig"`
|
||||
// 扩展字段
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
|
||||
TenantModuleType beans.TenantModuleType `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
}
|
||||
|
||||
// CreateAssetRes 创建资产响应
|
||||
type CreateAssetRes struct {
|
||||
Id uint64 `json:"id" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// ListAssetReq 获取资产列表请求
|
||||
type ListAssetReq struct {
|
||||
g.Meta `path:"/listAssets" method:"get" tags:"资产管理" summary:"获取资产列表" dc:"分页查询资产列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
Type consts.AssetType `json:"type" dc:"资产类型"`
|
||||
CategoryId string `json:"categoryId" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
Status *consts.AssetStatus `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListAssetRes 获取资产列表响应
|
||||
type ListAssetRes struct {
|
||||
List []AssetListItem `json:"list" dc:"资产列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type AssetListItem struct {
|
||||
// 基础信息
|
||||
Id uint64 `json:"id"` // 资产ID
|
||||
Name string `json:"name"` // 资产名称
|
||||
Type consts.AssetType `json:"type"` // 资产类型:physical实物/virtual虚拟/service服务
|
||||
TypeName string `json:"typeName"` // 资产类型:physical实物/virtual虚拟/service服务
|
||||
CategoryId uint64 `json:"categoryId"` // 分类ID
|
||||
UnlimitedStock bool `json:"unlimitedStock"` // 是否无库存限制
|
||||
Status *consts.AssetStatus `json:"status"` // 资产状态:active启用/inactive停用
|
||||
BasePrice int `json:"basePrice"` // 基础价格(分为单位)
|
||||
OnlineTime *gtime.Time `json:"onlineTime,omitempty"` // 上线时间
|
||||
OfflineTime *gtime.Time `json:"offlineTime,omitempty"` // 下线时间
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// GetAssetReq 获取资产详情请求
|
||||
type GetAssetReq struct {
|
||||
g.Meta `path:"/getAsset" method:"get" tags:"资产管理" summary:"获取资产详情" dc:"获取资产详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// GetAssetRes 获取资产详情响应
|
||||
type GetAssetRes struct {
|
||||
*entity.Asset
|
||||
CategoryName string `json:"categoryName" dc:"分类名称"`
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// GetAssetAndSkuReq 获取资产和Sku详情请求
|
||||
type GetAssetAndSkuReq struct {
|
||||
g.Meta `path:"/getAssetAndSku" method:"get" tags:"资产管理" summary:"获取资产和SKU详情" dc:"获取资产和SKU详情"`
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// GetAssetAndSkuRes 获取资产详情响应
|
||||
type GetAssetAndSkuRes struct {
|
||||
*entity.Asset
|
||||
Skus []entity.AssetSku `json:"skus" dc:"SKU列表"`
|
||||
TenantModuleType []enumDto.KeyValue `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// UpdateAssetReq 更新资产请求
|
||||
type UpdateAssetReq struct {
|
||||
g.Meta `path:"/updateAsset" method:"put" tags:"资产管理" summary:"更新资产" dc:"更新资产信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
// 基础信息
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
Description string `json:"description" dc:"资产描述"`
|
||||
Type consts.AssetType `json:"type" dc:"资产类型:physical实物/virtual虚拟/service服务"`
|
||||
CategoryId *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images []string `json:"images" dc:"图片列表"`
|
||||
Status *consts.AssetStatus `json:"status,omitempty" dc:"状态:1/0"`
|
||||
// 上线和下线时间配置(由定时任务处理资产状态)
|
||||
OnlineTime *time.Time `json:"onlineTime,omitempty" dc:"上线时间(格式:2006-01-02 15:04:05)"`
|
||||
OfflineTime *time.Time `json:"offlineTime,omitempty" dc:"下线时间(格式:2006-01-02 15:04:05)"`
|
||||
// 类型专用配置 - 实物资产配置
|
||||
PhysicalAssetConfig *config.PhysicalAssetConfig `json:"physicalAssetConfig"`
|
||||
// 类型专用配置 - 服务资产配置
|
||||
ServiceAssetConfig *config.ServiceAssetConfig `json:"serviceAssetConfig"`
|
||||
// 类型专用配置 - 虚拟资产配置
|
||||
VirtualAssetConfig *config.VirtualAssetConfig `json:"virtualAssetConfig"`
|
||||
// 扩展字段
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
}
|
||||
|
||||
// UpdateAssetStatusReq 更新资产状态请求
|
||||
type UpdateAssetStatusReq struct {
|
||||
g.Meta `path:"/updateAssetStatus" method:"put" tags:"资产管理" summary:"更新资产状态" dc:"更新资产状态"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
Status *consts.AssetStatus `json:"status" v:"required|in:1,0" dc:"状态:1启用/0停用"`
|
||||
}
|
||||
|
||||
// DeleteAssetReq 删除资产请求
|
||||
type DeleteAssetReq struct {
|
||||
g.Meta `path:"/deleteAsset" method:"delete" tags:"资产管理" summary:"删除资产" dc:"删除资产"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
}
|
||||
122
model/dto/asset/asset_sku_dto.go
Normal file
122
model/dto/asset/asset_sku_dto.go
Normal file
@@ -0,0 +1,122 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/asset"
|
||||
"assets/consts/stock"
|
||||
entity "assets/model/entity/asset"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
// CreateAssetSkuReq 创建SKU请求
|
||||
type CreateAssetSkuReq struct {
|
||||
g.Meta `path:"/createAssetSku" method:"post" tags:"SKU管理" summary:"创建SKU" dc:"创建新的资产SKU"`
|
||||
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"关联资产ID"`
|
||||
AssetName string `json:"assetName" v:"required" dc:"关联资产名称"`
|
||||
SkuName string `json:"skuName" v:"required" dc:"SKU名称"`
|
||||
SpecsCount int `json:"specsCount" v:"required|min:1" dc:"规格数量"`
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit" v:"required" dc:"规格单位"`
|
||||
SpecValues []map[string]interface{} `json:"specValues" dc:"规格值"`
|
||||
ImageURL string `json:"imageUrl" v:"required" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"required|min:0" dc:"价格(分为单位)"`
|
||||
Sort int `json:"sort" v:"required|min:0" dc:"排序"`
|
||||
Status *consts.AssetSkuStatus `json:"status" v:"required|in:1,0" dc:"状态"`
|
||||
UnlimitedStock bool `json:"unlimitedStock" v:"required" dc:"是否无库存限制"`
|
||||
StockMode stock.StockMode `json:"stockMode" dc:"库存管理模式:1-明细模式 2-批次模式"`
|
||||
CategoryId *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
TenantModuleType beans.TenantModuleType `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
}
|
||||
|
||||
// CreateAssetSkuRes 创建SKU响应
|
||||
type CreateAssetSkuRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// UpdateAssetSkuReq 更新SKU请求
|
||||
type UpdateAssetSkuReq struct {
|
||||
g.Meta `path:"/updateAssetSku" method:"put" tags:"SKU管理" summary:"更新SKU" dc:"更新SKU信息"`
|
||||
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
SkuName string `json:"skuName" dc:"SKU名称"`
|
||||
SpecsCount int `json:"specsCount" dc:"规格数量"`
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit" dc:"规格单位"`
|
||||
SpecValues []map[string]interface{} `json:"specValues" dc:"规格值"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" dc:"价格(分为单位)"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Stock int `json:"stock" dc:"库存数量"`
|
||||
Status *consts.AssetSkuStatus `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// DeleteAssetSkuReq 删除SKU请求
|
||||
type DeleteAssetSkuReq struct {
|
||||
g.Meta `path:"/deleteAssetSku" method:"delete" tags:"SKU管理" summary:"删除SKU" dc:"删除SKU"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuModuleReq 获取SKU详情请求
|
||||
type GetAssetSkuModuleReq struct {
|
||||
g.Meta `path:"/getAssetSkuModule" method:"get" tags:"SKU管理" summary:"获取SKU模块详情" dc:"获取SKU模块详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuModuleRes 获取SKU详情响应
|
||||
type GetAssetSkuModuleRes struct {
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
ExpireAt *gtime.Time `json:"expireAt"`
|
||||
}
|
||||
|
||||
// GetAssetSkuReq 获取SKU详情请求
|
||||
type GetAssetSkuReq struct {
|
||||
g.Meta `path:"/getAssetSku" method:"get" tags:"SKU管理" summary:"获取SKU详情" dc:"获取SKU详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuRes 获取SKU详情响应
|
||||
type GetAssetSkuRes struct {
|
||||
*entity.AssetSku
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// ListAssetSkuReq 获取SKU列表请求
|
||||
type ListAssetSkuReq struct {
|
||||
g.Meta `path:"/listAssetSkus" method:"get" tags:"SKU管理" summary:"获取SKU列表" dc:"分页查询SKU列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
Id *bson.ObjectID `json:"id" dc:"SKU ID"`
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
Status *consts.AssetSkuStatus `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
MinPrice int `json:"minPrice" dc:"最低价格"`
|
||||
MaxPrice int `json:"maxPrice" dc:"最高价格"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
}
|
||||
|
||||
// ListAssetSkuRes 获取SKU列表响应
|
||||
type ListAssetSkuRes struct {
|
||||
List []*AssetSkuListResItem `json:"list" dc:"SKU列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type AssetSkuListResItem struct {
|
||||
Id *bson.ObjectID `json:"id"` // SKU ID
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetName string `json:"assetName"` // 资产名称
|
||||
SkuName string `json:"skuName"` // SKU名称
|
||||
SpecsCount int `json:"specsCount"` // 规格数量
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit"` // 规格单位
|
||||
SpecValues []map[string]interface{} `json:"specValues"` // 规格值:{"颜色":"红色","尺寸":"L","时长":"1个月","平台":"抖音"}
|
||||
Price int `json:"price"` // 价格(分为单位)
|
||||
UnlimitedStock bool `json:"unlimitedStock"` // 是否无库存限制
|
||||
Stock int `json:"stock"` // 库存数量
|
||||
Sort int `json:"sort"` // 排序
|
||||
Status *consts.AssetSkuStatus `json:"status"` // 状态:active/inactive/disabled
|
||||
StockMode stock.StockMode `json:"stockMode"` // 库存管理模式:1-明细模式 2-批次模式
|
||||
CreatedAt *gtime.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"` // 更新时间
|
||||
}
|
||||
124
model/dto/asset/category_dto.go
Normal file
124
model/dto/asset/category_dto.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/category"
|
||||
entity "assets/model/entity/asset"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CreateCategoryReq 创建分类请求
|
||||
type CreateCategoryReq struct {
|
||||
g.Meta `path:"/createCategory" method:"post" tags:"分类管理" summary:"创建分类" dc:"创建新的分类"`
|
||||
Name string `json:"name" v:"required" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
Status consts.CategoryStatusType `json:"status" v:"in:1,0" default:"1" dc:"状态:1启用0禁用"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
}
|
||||
|
||||
// CreateCategoryRes 创建分类响应
|
||||
type CreateCategoryRes struct {
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// UpdateCategoryReq 更新分类请求
|
||||
type UpdateCategoryReq struct {
|
||||
g.Meta `path:"/updateCategory" method:"put" tags:"分类管理" summary:"更新分类" dc:"更新分类信息"`
|
||||
Id uint64 `json:"id" v:"required-without:Bid|integer#Id不能为空|Id必须是整数" dc:"分类ID"`
|
||||
Bid string `json:"bid" v:"required-without:Id|string#Bid不能为空|Bid必须是字符串" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
}
|
||||
|
||||
// UpdateCategoryStatusReq 更新分类状态请求
|
||||
type UpdateCategoryStatusReq struct {
|
||||
g.Meta `path:"/updateCategoryStatus" method:"put" tags:"分类管理" summary:"更新分类状态" dc:"更新分类状态"`
|
||||
Id string `json:"id" v:"required" dc:"分类ID"`
|
||||
Status consts.CategoryStatusType `json:"status" v:"in:1,0" dc:"状态:1启用0禁用"`
|
||||
}
|
||||
|
||||
// DeleteCategoryReq 删除分类请求
|
||||
type DeleteCategoryReq struct {
|
||||
g.Meta `path:"/deleteCategory" method:"delete" tags:"分类管理" summary:"删除分类" dc:"删除分类"`
|
||||
Bid string `json:"bid" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetCategoryTreeReq 获取分类树请求
|
||||
type GetCategoryTreeReq struct {
|
||||
g.Meta `path:"/getCategoryTree" method:"get" tags:"分类管理" summary:"获取分类树" dc:"获取分类树"`
|
||||
Name string `json:"name" dc:"名称"`
|
||||
}
|
||||
|
||||
// GetCategoryTreeRes 获取分类树响应
|
||||
type GetCategoryTreeRes struct {
|
||||
Tree []*CategoryTreeNode `json:"tree" dc:"分类树"`
|
||||
}
|
||||
|
||||
// CategoryTreeNode 分类树节点
|
||||
type CategoryTreeNode struct {
|
||||
Id uint64 `json:"id" dc:"分类ID"`
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
Type string `json:"type" dc:"分类类型"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
Children []*CategoryTreeNode `json:"children" dc:"子分类"`
|
||||
}
|
||||
|
||||
// ListCategoryReq 获取分类列表请求
|
||||
type ListCategoryReq struct {
|
||||
g.Meta `path:"/listCategories" method:"get" tags:"分类管理" summary:"获取分类列表" dc:"获取分类列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListCategoryRes 获取分类列表响应
|
||||
type ListCategoryRes struct {
|
||||
List []GetCategoryRes `json:"list" dc:"分类列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// GetCategoryReq 获取分类详情请求
|
||||
type GetCategoryReq struct {
|
||||
g.Meta `path:"/getCategory" method:"get" tags:"分类管理" summary:"获取分类详情" dc:"获取分类详情"`
|
||||
Id uint64 `json:"id" v:"required-without:Bid|integer#Id不能为空|Id必须是整数" dc:"分类ID"`
|
||||
Bid string `json:"bid" v:"required-without:Id|string#Bid不能为空|Bid必须是字符串" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetCategoryRes 获取分类详情响应
|
||||
type GetCategoryRes struct {
|
||||
Id uint64 `json:"id" dc:"分类ID"`
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
Creator string `json:"creator" dc:"创建人"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
Updater string `json:"updater" dc:"更新人"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
137
model/dto/asset/private_category_dto.go
Normal file
137
model/dto/asset/private_category_dto.go
Normal file
@@ -0,0 +1,137 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePrivateCategoryTestDataReq 生成私域分类测试数据请求
|
||||
type GeneratePrivateCategoryTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"私域分类管理" summary:"生成测试数据" dc:"生成私域分类测试数据"`
|
||||
}
|
||||
|
||||
// CreatePrivateCategoryReq 创建私域分类请求
|
||||
type CreatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/createPrivateCategory" method:"post" tags:"私域分类管理" summary:"创建私域分类" dc:"创建新的私域分类"`
|
||||
|
||||
Name string `json:"name" v:"required" dc:"分类名称"`
|
||||
ParentID *bson.ObjectID `json:"parentId" dc:"父分类ID,为空表示根分类"`
|
||||
Path string `json:"path" dc:"分类路径,如:/root/parent"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
}
|
||||
|
||||
// CreatePrivateCategoryRes 创建私域分类响应
|
||||
type CreatePrivateCategoryRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 分类ID
|
||||
}
|
||||
|
||||
// BatchCreatePrivateCategoryReq 批量创建私域分类请求
|
||||
type BatchCreatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/batchCreatePrivateCategory" method:"post" tags:"私域分类管理" summary:"批量创建私域分类" dc:"批量创建私域分类"`
|
||||
|
||||
Categories []CreatePrivateCategoryReq `json:"categories" v:"required" dc:"分类列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePrivateCategoryRes 批量创建私域分类响应
|
||||
type BatchCreatePrivateCategoryRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
|
||||
// UpdatePrivateCategoryReq 更新私域分类请求
|
||||
type UpdatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/updatePrivateCategory" method:"put" tags:"私域分类管理" summary:"更新私域分类" dc:"更新私域分类信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentID string `json:"parentId" dc:"父分类ID"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode *bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
}
|
||||
|
||||
// DeletePrivateCategoryReq 删除私域分类请求
|
||||
type DeletePrivateCategoryReq struct {
|
||||
g.Meta `path:"/deletePrivateCategory" method:"delete" tags:"私域分类管理" summary:"删除私域分类" dc:"删除私域分类"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryReq 获取私域分类详情请求
|
||||
type GetPrivateCategoryReq struct {
|
||||
g.Meta `path:"/getPrivateCategory" method:"get" tags:"私域分类管理" summary:"获取私域分类详情" dc:"获取私域分类详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryRes 获取私域分类详情响应
|
||||
type GetPrivateCategoryRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPrivateCategoryReq 获取私域分类列表请求
|
||||
type ListPrivateCategoryReq struct {
|
||||
g.Meta `path:"/listPrivateCategory" method:"get" tags:"私域分类管理" summary:"获取私域分类列表" dc:"分页查询私域分类列表"`
|
||||
|
||||
Name string `json:"name" dc:"分类名称(模糊查询)"`
|
||||
ParentID string `json:"parentId" dc:"父分类ID"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode *bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPrivateCategoryRes 获取私域分类列表响应
|
||||
type ListPrivateCategoryRes struct {
|
||||
List []*PrivateCategoryListItem `json:"list" dc:"分类列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PrivateCategoryListItem 私域分类列表项
|
||||
type PrivateCategoryListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryTreeReq 获取私域分类树请求
|
||||
type GetPrivateCategoryTreeReq struct {
|
||||
g.Meta `path:"/getPrivateCategoryTree" method:"get" tags:"私域分类管理" summary:"获取私域分类树" dc:"获取私域分类树"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryTreeRes 获取私域分类树响应
|
||||
type GetPrivateCategoryTreeRes struct {
|
||||
Tree []*PrivateCategoryTreeItem `json:"tree" dc:"分类树"`
|
||||
}
|
||||
|
||||
// PrivateCategoryTreeItem 私域分类树项
|
||||
type PrivateCategoryTreeItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
}
|
||||
124
model/dto/asset/private_sku_dto.go
Normal file
124
model/dto/asset/private_sku_dto.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/stock"
|
||||
"assets/model/config"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePrivateSkuTestDataReq 生成私域SKU测试数据请求
|
||||
type GeneratePrivateSkuTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"私域SKU管理" summary:"生成测试数据" dc:"生成私域SKU测试数据"`
|
||||
}
|
||||
|
||||
// CreatePrivateSkuReq 创建私域SKU请求
|
||||
type CreatePrivateSkuReq struct {
|
||||
g.Meta `path:"/createPrivateSku" method:"post" tags:"私域SKU管理" summary:"创建私域SKU" dc:"创建新的私域SKU"`
|
||||
|
||||
SkuName string `json:"skuName" v:"required" dc:"SKU名称"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"required|min:0" dc:"价格(分为单位)"`
|
||||
Stock int `json:"stock" v:"min:0" dc:"库存数量"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CapacityUnitType stock.CapacityUnitType `json:"capacityUnitType" v:"required" dc:"容量单位类型"`
|
||||
Capacity config.Capacity `json:"capacity" v:"required" dc:"容量信息"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
}
|
||||
|
||||
// CreatePrivateSkuRes 创建私域SKU响应
|
||||
type CreatePrivateSkuRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // SKU ID
|
||||
}
|
||||
|
||||
// BatchCreatePrivateSkuReq 批量创建私域SKU请求
|
||||
type BatchCreatePrivateSkuReq struct {
|
||||
g.Meta `path:"/batchCreatePrivateSku" method:"post" tags:"私域SKU管理" summary:"批量创建私域SKU" dc:"批量创建私域SKU"`
|
||||
|
||||
Skus []CreatePrivateSkuReq `json:"skus" v:"required" dc:"SKU列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePrivateSkuRes 批量创建私域SKU响应
|
||||
type BatchCreatePrivateSkuRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
|
||||
// UpdatePrivateSkuReq 更新私域SKU请求
|
||||
type UpdatePrivateSkuReq struct {
|
||||
g.Meta `path:"/updatePrivateSku" method:"put" tags:"私域SKU管理" summary:"更新私域SKU" dc:"更新私域SKU信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
SkuName string `json:"skuName" dc:"SKU名称"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"min:0" dc:"价格(分为单位)"`
|
||||
Stock int `json:"stock" v:"min:0" dc:"库存数量"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
}
|
||||
|
||||
// DeletePrivateSkuReq 删除私域SKU请求
|
||||
type DeletePrivateSkuReq struct {
|
||||
g.Meta `path:"/deletePrivateSku" method:"delete" tags:"私域SKU管理" summary:"删除私域SKU" dc:"删除私域SKU"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetPrivateSkuReq 获取私域SKU详情请求
|
||||
type GetPrivateSkuReq struct {
|
||||
g.Meta `path:"/getPrivateSku" method:"get" tags:"私域SKU管理" summary:"获取私域SKU详情" dc:"获取私域SKU详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetPrivateSkuRes 获取私域SKU详情响应
|
||||
type GetPrivateSkuRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
SkuName string `json:"skuName"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
Price int `json:"price"`
|
||||
Stock int `json:"stock"`
|
||||
Sort int `json:"sort"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPrivateSkuReq 获取私域SKU列表请求
|
||||
type ListPrivateSkuReq struct {
|
||||
g.Meta `path:"/listPrivateSku" method:"get" tags:"私域SKU管理" summary:"获取私域SKU列表" dc:"分页查询私域SKU列表"`
|
||||
|
||||
SkuName string `json:"skuName" dc:"SKU名称(模糊查询)"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"分类路径"`
|
||||
MinPrice int `json:"minPrice" dc:"最低价格"`
|
||||
MaxPrice int `json:"maxPrice" dc:"最高价格"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPrivateSkuRes 获取私域SKU列表响应
|
||||
type ListPrivateSkuRes struct {
|
||||
List []*PrivateSkuListItem `json:"list" dc:"SKU列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PrivateSkuListItem 私域SKU列表项
|
||||
type PrivateSkuListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
SkuName string `json:"skuName"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
Price int `json:"price"`
|
||||
Stock int `json:"stock"`
|
||||
Sort int `json:"sort"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// UpdatePrivateSkuStockReq 更新私域SKU库存请求
|
||||
type UpdatePrivateSkuStockReq struct {
|
||||
g.Meta `path:"/updatePrivateSkuStock" method:"put" tags:"私域SKU管理" summary:"更新私域SKU库存" dc:"更新私域SKU库存"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
StockChange int `json:"stockChange" v:"required" dc:"库存变化量(正数增加,负数减少)"`
|
||||
}
|
||||
73
model/dto/enum/enum_dto.go
Normal file
73
model/dto/enum/enum_dto.go
Normal file
@@ -0,0 +1,73 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/asset"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// GetAssetTypeReq 获取资产类型请求
|
||||
type GetAssetTypeReq struct {
|
||||
g.Meta `path:"/getAssetType" method:"get" tags:"资产管理" summary:"获取资产类型选项" dc:"获取所有资产类型的选项列表"`
|
||||
}
|
||||
|
||||
// GetAssetTypeRes 获取资产类型响应
|
||||
type GetAssetTypeRes struct {
|
||||
Options []KeyValue `json:"options" dc:"资产类型选项列表"`
|
||||
}
|
||||
|
||||
// GetCategoryAttrTypeReq 获取分类属性类型请求
|
||||
type GetCategoryAttrTypeReq struct {
|
||||
g.Meta `path:"/getCategoryAttrType" method:"get" tags:"枚举管理" summary:"获取分类属性类型" dc:"获取分类属性类型"`
|
||||
}
|
||||
|
||||
// GetCategoryAttrTypeRes 获取分类属性类型响应
|
||||
type GetCategoryAttrTypeRes struct {
|
||||
Options []KeyValue `json:"options" dc:"分类属性类型选项列表"`
|
||||
}
|
||||
|
||||
// GetSpecsUnitReq 获取规格单位
|
||||
type GetSpecsUnitReq struct {
|
||||
g.Meta `path:"/getSpecsUnit" method:"get" tags:"枚举管理" summary:"获取规格单位" dc:"获取规格单位"`
|
||||
AssetType *consts.AssetType `json:"assetType" v:"required|in:physical,virtual,service" dc:"资产类型"`
|
||||
}
|
||||
|
||||
// GetSpecsUnitRes 获取规格单位响应
|
||||
type GetSpecsUnitRes struct {
|
||||
Options []KeyValue `json:"options" dc:"规格单位选项列表"`
|
||||
}
|
||||
|
||||
// GetTenantModuleTypeReq 获取租户模块类型请求
|
||||
type GetTenantModuleTypeReq struct {
|
||||
g.Meta `path:"/getTenantModuleType" method:"get" tags:"枚举管理" summary:"获取租户模块类型" dc:"获取租户模块类型"`
|
||||
AssetId string `json:"assetId" v:"required|in:physical,virtual,service" dc:"资产id"`
|
||||
}
|
||||
|
||||
// GetTenantModuleTypeRes 获取租户模块类型响应
|
||||
type GetTenantModuleTypeRes struct {
|
||||
Options []KeyValue `json:"options" dc:"租户模块类型列表"`
|
||||
}
|
||||
|
||||
type KeyValue struct {
|
||||
Key interface{} `json:"key"` // 对应原有常量值
|
||||
Value interface{} `json:"value"` // 对应描述信息
|
||||
}
|
||||
|
||||
type GetDictRes struct {
|
||||
g.Meta `mime:"application/json"`
|
||||
Info *DictTypeRes `json:"info"`
|
||||
Values []*DictDataRes `json:"values"`
|
||||
}
|
||||
|
||||
type DictTypeRes struct {
|
||||
DictName string `json:"name"`
|
||||
DictType string `json:"type"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type DictDataRes struct {
|
||||
DictValue string `json:"key"`
|
||||
DictLabel string `json:"value"`
|
||||
DictType string `json:"type"`
|
||||
IsDefault int `json:"isDefault"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
96
model/dto/procurement/purchase_inbound_dto.go
Normal file
96
model/dto/procurement/purchase_inbound_dto.go
Normal file
@@ -0,0 +1,96 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// CreatePurchaseInboundReq 创建采购入库请求
|
||||
type CreatePurchaseInboundReq struct {
|
||||
g.Meta `path:"/createPurchaseInbound" method:"post" tags:"采购入库管理" summary:"创建采购入库" dc:"将采购订单明细入库到私域库存"`
|
||||
|
||||
OrderItemId *bson.ObjectID `json:"orderItemId" v:"required" dc:"采购订单明细ID"`
|
||||
InboundQty int `json:"inboundQty" v:"required|min:1" dc:"入库数量"`
|
||||
|
||||
// 仓储信息(非必填)
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
LocationId *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
|
||||
// 私域SKU和分类(必填)
|
||||
PrivateSkuId *bson.ObjectID `json:"privateSkuId" v:"required" dc:"私域SKU ID"`
|
||||
PrivateCategoryId *bson.ObjectID `json:"privateCategoryId" v:"required" dc:"私域分类ID"`
|
||||
|
||||
Remark string `json:"remark" dc:"入库备注"`
|
||||
}
|
||||
|
||||
// CreatePurchaseInboundRes 创建采购入库响应
|
||||
type CreatePurchaseInboundRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"入库记录ID"`
|
||||
InboundNo string `json:"inboundNo" dc:"入库单号"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
}
|
||||
|
||||
// GetPurchaseInboundReq 获取入库详情请求
|
||||
type GetPurchaseInboundReq struct {
|
||||
g.Meta `path:"/getPurchaseInbound" method:"get" tags:"采购入库管理" summary:"获取入库详情" dc:"根据ID获取入库记录详情"`
|
||||
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"入库记录ID"`
|
||||
}
|
||||
|
||||
// GetPurchaseInboundRes 获取入库详情响应
|
||||
type GetPurchaseInboundRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"入库记录ID"`
|
||||
InboundNo string `json:"inboundNo" dc:"入库单号"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
|
||||
// 关联信息
|
||||
OrderId *bson.ObjectID `json:"orderId" dc:"采购订单ID"`
|
||||
OrderItemId *bson.ObjectID `json:"orderItemId" dc:"采购订单明细ID"`
|
||||
|
||||
// 入库数量和时间
|
||||
InboundQty int `json:"inboundQty" dc:"本次入库数量"`
|
||||
InboundDate string `json:"inboundDate" dc:"入库日期"`
|
||||
|
||||
// 仓储信息
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationId *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
|
||||
// 私域SKU和分类
|
||||
PrivateSkuId *bson.ObjectID `json:"privateSkuId" dc:"私域SKU ID"`
|
||||
PrivateSkuName string `json:"privateSkuName" dc:"私域SKU名称"`
|
||||
PrivateCategoryId *bson.ObjectID `json:"privateCategoryId" dc:"私域分类ID"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
|
||||
// 生成的库存信息
|
||||
PrivateStockId *bson.ObjectID `json:"privateStockId" dc:"关联的私域库存ID"`
|
||||
|
||||
Remark string `json:"remark" dc:"入库备注"`
|
||||
CreatedAt string `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt string `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// ListPurchaseInboundReq 获取入库列表请求
|
||||
type ListPurchaseInboundReq struct {
|
||||
g.Meta `path:"/listPurchaseInbounds" method:"get" tags:"采购入库管理" summary:"获取入库列表" dc:"分页查询入库记录列表"`
|
||||
|
||||
OrderId *bson.ObjectID `json:"orderId" dc:"采购订单ID"`
|
||||
OrderItemId *bson.ObjectID `json:"orderItemId" dc:"采购订单明细ID"`
|
||||
InboundNo string `json:"inboundNo" dc:"入库单号"`
|
||||
StartDate string `json:"startDate" dc:"开始日期(YYYY-MM-DD)"`
|
||||
EndDate string `json:"endDate" dc:"结束日期(YYYY-MM-DD)"`
|
||||
|
||||
beans.Page `json:",inline"`
|
||||
beans.OrderBy `json:",inline"`
|
||||
}
|
||||
|
||||
// ListPurchaseInboundRes 获取入库列表响应
|
||||
type ListPurchaseInboundRes struct {
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
List []*GetPurchaseInboundRes `json:"list" dc:"列表"`
|
||||
}
|
||||
232
model/dto/procurement/purchase_order_dto.go
Normal file
232
model/dto/procurement/purchase_order_dto.go
Normal file
@@ -0,0 +1,232 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/procurement"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePurchaseOrderTestDataReq 生成采购订单测试数据请求
|
||||
type GeneratePurchaseOrderTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"采购订单管理" summary:"生成测试数据" dc:"生成采购订单测试数据"`
|
||||
}
|
||||
|
||||
// CreatePurchaseOrderReq 创建采购订单请求
|
||||
type CreatePurchaseOrderReq struct {
|
||||
g.Meta `path:"/createPurchaseOrder" method:"post" tags:"采购订单管理" summary:"创建采购订单" dc:"创建新的采购订单"`
|
||||
|
||||
// 基础订单信息
|
||||
OrderNo string `json:"orderNo" v:"required" dc:"订单编号"`
|
||||
Title string `json:"title" v:"required" dc:"订单标题"`
|
||||
Description string `json:"description" dc:"订单描述"`
|
||||
OrderType consts.PurchaseOrderType `json:"orderType" v:"required" dc:"订单类型:direct/assignment/bidding"`
|
||||
|
||||
// 需求方信息
|
||||
BuyerId *bson.ObjectID `json:"buyerId" v:"required" dc:"采购方ID(经销商/门店)"`
|
||||
BuyerName string `json:"buyerName" v:"required" dc:"采购方名称"`
|
||||
BuyerType string `json:"buyerType" v:"required" dc:"采购方类型"`
|
||||
|
||||
// 通用状态信息
|
||||
Priority int `json:"priority" dc:"优先级"`
|
||||
|
||||
// 通用字段
|
||||
ExpectedDelivery *gtime.Time `json:"expectedDelivery" dc:"期望交付时间"`
|
||||
ExpiryTime *gtime.Time `json:"expiryTime" dc:"订单有效期/竞价结束时间"`
|
||||
|
||||
// 模式特定信息
|
||||
DirectPurchase *CreateDirectPurchaseReq `json:"directPurchase" dc:"指定供应商模式信息"`
|
||||
BiddingInfo *CreateBiddingReq `json:"biddingInfo" dc:"竞价模式信息"`
|
||||
}
|
||||
|
||||
// CreateDirectPurchaseReq 指定供应商模式信息
|
||||
type CreateDirectPurchaseReq struct {
|
||||
SupplierId *bson.ObjectID `json:"supplierId" v:"required" dc:"指定供应商ID"`
|
||||
SupplierName string `json:"supplierName" dc:"指定供应商名称"`
|
||||
SupplierCode string `json:"supplierCode" dc:"供应商编码"`
|
||||
AssignReason string `json:"assignReason" dc:"指派原因"`
|
||||
DeliveryAddress string `json:"deliveryAddress" dc:"交付地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
}
|
||||
|
||||
// CreateBiddingReq 竞价模式信息
|
||||
type CreateBiddingReq struct {
|
||||
BidMode consts.BidMode `json:"bidMode" v:"required" dc:"竞价模式:price/quality/time/mixed"`
|
||||
MinSuppliers int `json:"minSuppliers" v:"min:1" dc:"最少参与供应商数"`
|
||||
MaxSuppliers int `json:"maxSuppliers" v:"min:1" dc:"最多参与供应商数"`
|
||||
BidDuration int `json:"bidDuration" v:"min:1" dc:"竞价持续时长(分钟)"`
|
||||
BidStartAt *gtime.Time `json:"bidStartAt" dc:"竞价开始时间"`
|
||||
BidEndAt *gtime.Time `json:"bidEndAt" dc:"竞价结束时间"`
|
||||
}
|
||||
|
||||
// CreatePurchaseOrderRes 创建采购订单响应
|
||||
type CreatePurchaseOrderRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 采购订单ID
|
||||
}
|
||||
|
||||
// UpdatePurchaseOrderReq 更新采购订单请求
|
||||
type UpdatePurchaseOrderReq struct {
|
||||
g.Meta `path:"/updatePurchaseOrder" method:"put" tags:"采购订单管理" summary:"更新采购订单" dc:"更新采购订单信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单ID"`
|
||||
|
||||
// 基础订单信息
|
||||
Title string `json:"title" dc:"订单标题"`
|
||||
Description string `json:"description" dc:"订单描述"`
|
||||
OrderType consts.PurchaseOrderType `json:"orderType" dc:"订单类型"`
|
||||
|
||||
// 需求方信息
|
||||
BuyerId *bson.ObjectID `json:"buyerId" dc:"采购方ID"`
|
||||
BuyerName string `json:"buyerName" dc:"采购方名称"`
|
||||
BuyerType string `json:"buyerType" dc:"采购方类型"`
|
||||
|
||||
// 通用状态信息
|
||||
Status consts.PurchaseOrderStatus `json:"status" dc:"订单状态"`
|
||||
Priority int `json:"priority" dc:"优先级"`
|
||||
|
||||
// 通用字段
|
||||
ExpectedDelivery *gtime.Time `json:"expectedDelivery" dc:"期望交付时间"`
|
||||
ExpiryTime *gtime.Time `json:"expiryTime" dc:"订单有效期/竞价结束时间"`
|
||||
|
||||
// 模式特定信息
|
||||
DirectPurchase *UpdateDirectPurchaseReq `json:"directPurchase" dc:"指定供应商模式信息"`
|
||||
BiddingInfo *UpdateBiddingReq `json:"biddingInfo" dc:"竞价模式信息"`
|
||||
}
|
||||
|
||||
// UpdateDirectPurchaseReq 更新指定供应商模式信息
|
||||
type UpdateDirectPurchaseReq struct {
|
||||
SupplierId *bson.ObjectID `json:"supplierId" dc:"指定供应商ID"`
|
||||
SupplierName string `json:"supplierName" dc:"指定供应商名称"`
|
||||
SupplierCode string `json:"supplierCode" dc:"供应商编码"`
|
||||
AssignReason string `json:"assignReason" dc:"指派原因"`
|
||||
DeliveryAddress string `json:"deliveryAddress" dc:"交付地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
ResponseStatus string `json:"responseStatus" dc:"供应商响应状态"`
|
||||
}
|
||||
|
||||
// UpdateBiddingReq 更新竞价模式信息
|
||||
type UpdateBiddingReq struct {
|
||||
BidMode consts.BidMode `json:"bidMode" dc:"竞价模式"`
|
||||
MinSuppliers int `json:"minSuppliers" dc:"最少参与供应商数"`
|
||||
MaxSuppliers int `json:"maxSuppliers" dc:"最多参与供应商数"`
|
||||
BidDuration int `json:"bidDuration" dc:"竞价持续时长(分钟)"`
|
||||
BidSupplierCount int `json:"bidSupplierCount" dc:"参与竞价的供应商数量"`
|
||||
BidStartAt *gtime.Time `json:"bidStartAt" dc:"竞价开始时间"`
|
||||
BidEndAt *gtime.Time `json:"bidEndAt" dc:"竞价结束时间"`
|
||||
}
|
||||
|
||||
// DeletePurchaseOrderReq 删除采购订单请求
|
||||
type DeletePurchaseOrderReq struct {
|
||||
g.Meta `path:"/deletePurchaseOrder" method:"delete" tags:"采购订单管理" summary:"删除采购订单" dc:"删除采购订单"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单ID"`
|
||||
}
|
||||
|
||||
// GetPurchaseOrderReq 获取采购订单详情请求
|
||||
type GetPurchaseOrderReq struct {
|
||||
g.Meta `path:"/getPurchaseOrder" method:"get" tags:"采购订单管理" summary:"获取采购订单详情" dc:"获取采购订单详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单ID"`
|
||||
}
|
||||
|
||||
// GetPurchaseOrderRes 获取采购订单详情响应
|
||||
type GetPurchaseOrderRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
OrderType consts.PurchaseOrderType `json:"orderType"`
|
||||
BuyerId *bson.ObjectID `json:"buyerId"`
|
||||
BuyerName string `json:"buyerName"`
|
||||
BuyerType string `json:"buyerType"`
|
||||
Status consts.PurchaseOrderStatus `json:"status"`
|
||||
StatusText string `json:"statusText"`
|
||||
Priority int `json:"priority"`
|
||||
DirectPurchase *DirectPurchaseInfoRes `json:"directPurchase"`
|
||||
BiddingInfo *BiddingInfoRes `json:"biddingInfo"`
|
||||
ExpectedDelivery string `json:"expectedDelivery"`
|
||||
ExpiryTime string `json:"expiryTime"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// DirectPurchaseInfoRes 指定供应商模式信息响应
|
||||
type DirectPurchaseInfoRes struct {
|
||||
SupplierId *bson.ObjectID `json:"supplierId"`
|
||||
SupplierName string `json:"supplierName"`
|
||||
SupplierCode string `json:"supplierCode"`
|
||||
AssignReason string `json:"assignReason"`
|
||||
DeliveryAddress string `json:"deliveryAddress"`
|
||||
ContactPerson string `json:"contactPerson"`
|
||||
ContactPhone string `json:"contactPhone"`
|
||||
ResponseStatus string `json:"responseStatus"`
|
||||
AssignedAt string `json:"assignedAt"`
|
||||
AcceptedAt string `json:"acceptedAt"`
|
||||
RejectedAt string `json:"rejectedAt"`
|
||||
DeliveredAt string `json:"deliveredAt"`
|
||||
}
|
||||
|
||||
// BiddingInfoRes 竞价模式信息响应
|
||||
type BiddingInfoRes struct {
|
||||
BidMode consts.BidMode `json:"bidMode"`
|
||||
BidModeText string `json:"bidModeText"`
|
||||
MinSuppliers int `json:"minSuppliers"`
|
||||
MaxSuppliers int `json:"maxSuppliers"`
|
||||
BidDuration int `json:"bidDuration"`
|
||||
BidSupplierCount int `json:"bidSupplierCount"`
|
||||
BidStartAt string `json:"bidStartAt"`
|
||||
BidEndAt string `json:"bidEndAt"`
|
||||
ResultPublishedAt string `json:"resultPublishedAt"`
|
||||
}
|
||||
|
||||
// ListPurchaseOrdersReq 获取采购订单列表请求
|
||||
type ListPurchaseOrdersReq struct {
|
||||
g.Meta `path:"/listPurchaseOrders" method:"get" tags:"采购订单管理" summary:"获取采购订单列表" dc:"分页查询采购订单列表"`
|
||||
|
||||
OrderNo string `json:"orderNo" dc:"订单编号(精确查询)"`
|
||||
Title string `json:"title" dc:"订单标题(模糊查询)"`
|
||||
BuyerId *bson.ObjectID `json:"buyerId" dc:"采购方ID(精确查询)"`
|
||||
OrderType consts.PurchaseOrderType `json:"orderType" dc:"订单类型"`
|
||||
Status *consts.PurchaseOrderStatus `json:"status" dc:"订单状态"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPurchaseOrdersRes 获取采购订单列表响应
|
||||
type ListPurchaseOrdersRes struct {
|
||||
List []*PurchaseOrderListItem `json:"list" dc:"采购订单列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PurchaseOrderListItem 采购订单列表项
|
||||
type PurchaseOrderListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
Title string `json:"title"`
|
||||
OrderType consts.PurchaseOrderType `json:"orderType"`
|
||||
OrderTypeText string `json:"orderTypeText"`
|
||||
BuyerName string `json:"buyerName"`
|
||||
BuyerType string `json:"buyerType"`
|
||||
Status consts.PurchaseOrderStatus `json:"status"`
|
||||
StatusText string `json:"statusText"`
|
||||
Priority int `json:"priority"`
|
||||
ExpectedDelivery string `json:"expectedDelivery"`
|
||||
ExpiryTime string `json:"expiryTime"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// BatchCreatePurchaseOrdersReq 批量创建采购订单请求
|
||||
type BatchCreatePurchaseOrdersReq struct {
|
||||
g.Meta `path:"/batchCreatePurchaseOrders" method:"post" tags:"采购订单管理" summary:"批量创建采购订单" dc:"批量创建采购订单"`
|
||||
|
||||
Orders []CreatePurchaseOrderReq `json:"orders" v:"required" dc:"采购订单列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePurchaseOrdersRes 批量创建采购订单响应
|
||||
type BatchCreatePurchaseOrdersRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
168
model/dto/procurement/purchase_order_item_dto.go
Normal file
168
model/dto/procurement/purchase_order_item_dto.go
Normal file
@@ -0,0 +1,168 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePurchaseOrderItemTestDataReq 生成采购订单明细测试数据请求
|
||||
type GeneratePurchaseOrderItemTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"采购订单明细管理" summary:"生成测试数据" dc:"生成采购订单明细测试数据"`
|
||||
}
|
||||
|
||||
// CreatePurchaseOrderItemReq 创建采购订单明细请求
|
||||
type CreatePurchaseOrderItemReq struct {
|
||||
g.Meta `path:"/createPurchaseOrderItem" method:"post" tags:"采购订单明细管理" summary:"创建采购订单明细" dc:"创建新的采购订单明细"`
|
||||
|
||||
// 关联信息
|
||||
OrderId *bson.ObjectID `json:"orderId" v:"required" dc:"订单ID"`
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" dc:"资产SKU ID"`
|
||||
|
||||
// 商品信息
|
||||
ProductName string `json:"productName" v:"required" dc:"商品名称"`
|
||||
Specification string `json:"specification" dc:"规格描述"`
|
||||
Brand string `json:"brand" dc:"品牌"`
|
||||
|
||||
// 数量和价格
|
||||
Quantity int `json:"quantity" v:"required|min:1" dc:"订购数量"`
|
||||
Unit string `json:"unit" v:"required" dc:"单位"`
|
||||
UnitPrice int `json:"unitPrice" v:"required|min:0" dc:"单价(分)"`
|
||||
TotalPrice int `json:"totalPrice" v:"required|min:0" dc:"总价(分)"`
|
||||
DiscountPrice int `json:"discountPrice" v:"min:0" dc:"折扣价(分)"`
|
||||
|
||||
// 要求信息
|
||||
RequirementDesc string `json:"requirementDesc" dc:"特殊要求描述"`
|
||||
DeliveryAddress string `json:"deliveryAddress" dc:"交付地址"`
|
||||
}
|
||||
|
||||
// CreatePurchaseOrderItemRes 创建采购订单明细响应
|
||||
type CreatePurchaseOrderItemRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 采购订单明细ID
|
||||
}
|
||||
|
||||
// UpdatePurchaseOrderItemReq 更新采购订单明细请求
|
||||
type UpdatePurchaseOrderItemReq struct {
|
||||
g.Meta `path:"/updatePurchaseOrderItem" method:"put" tags:"采购订单明细管理" summary:"更新采购订单明细" dc:"更新采购订单明细信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单明细ID"`
|
||||
|
||||
// 关联信息
|
||||
AssetId *bson.ObjectID `json:"assetId" dc:"资产ID"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" dc:"资产SKU ID"`
|
||||
|
||||
// 商品信息
|
||||
ProductName string `json:"productName" dc:"商品名称"`
|
||||
Specification string `json:"specification" dc:"规格描述"`
|
||||
Brand string `json:"brand" dc:"品牌"`
|
||||
|
||||
// 数量和价格
|
||||
Quantity int `json:"quantity" v:"min:1" dc:"订购数量"`
|
||||
Unit string `json:"unit" dc:"单位"`
|
||||
UnitPrice int `json:"unitPrice" v:"min:0" dc:"单价(分)"`
|
||||
TotalPrice int `json:"totalPrice" v:"min:0" dc:"总价(分)"`
|
||||
DiscountPrice int `json:"discountPrice" v:"min:0" dc:"折扣价(分)"`
|
||||
|
||||
// 签收和入库
|
||||
PassQuantity int `json:"passQuantity" dc:"签收数量"`
|
||||
InboundQty int `json:"inboundQty" dc:"已入库数量"`
|
||||
|
||||
// 要求信息
|
||||
RequirementDesc string `json:"requirementDesc" dc:"特殊要求描述"`
|
||||
DeliveryAddress string `json:"deliveryAddress" dc:"交付地址"`
|
||||
}
|
||||
|
||||
// UpdatePurchaseOrderItemRes 更新采购订单明细响应
|
||||
type UpdatePurchaseOrderItemRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 采购订单明细ID
|
||||
}
|
||||
|
||||
// DeletePurchaseOrderItemReq 删除采购订单明细请求
|
||||
type DeletePurchaseOrderItemReq struct {
|
||||
g.Meta `path:"/deletePurchaseOrderItem" method:"delete" tags:"采购订单明细管理" summary:"删除采购订单明细" dc:"删除采购订单明细"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单明细ID"`
|
||||
}
|
||||
|
||||
// DeletePurchaseOrderItemRes 删除采购订单明细响应
|
||||
type DeletePurchaseOrderItemRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 采购订单明细ID
|
||||
}
|
||||
|
||||
// GetPurchaseOrderItemReq 获取采购订单明细详情请求
|
||||
type GetPurchaseOrderItemReq struct {
|
||||
g.Meta `path:"/getPurchaseOrderItem" method:"get" tags:"采购订单明细管理" summary:"获取采购订单明细详情" dc:"获取采购订单明细详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"采购订单明细ID"`
|
||||
}
|
||||
|
||||
// GetPurchaseOrderItemRes 获取采购订单明细详情响应
|
||||
type GetPurchaseOrderItemRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
OrderId *bson.ObjectID `json:"orderId"`
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId"`
|
||||
ProductName string `json:"productName"`
|
||||
Specification string `json:"specification"`
|
||||
Brand string `json:"brand"`
|
||||
Quantity int `json:"quantity"`
|
||||
Unit string `json:"unit"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
TotalPrice int `json:"totalPrice"`
|
||||
DiscountPrice int `json:"discountPrice"`
|
||||
RequirementDesc string `json:"requirementDesc"`
|
||||
DeliveryAddress string `json:"deliveryAddress"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPurchaseOrderItemsReq 获取采购订单明细列表请求
|
||||
type ListPurchaseOrderItemsReq struct {
|
||||
g.Meta `path:"/listPurchaseOrderItems" method:"get" tags:"采购订单明细管理" summary:"获取采购订单明细列表" dc:"分页查询采购订单明细列表"`
|
||||
|
||||
OrderId *bson.ObjectID `json:"orderId" dc:"订单ID(精确查询)"`
|
||||
AssetId *bson.ObjectID `json:"assetId" dc:"资产ID(精确查询)"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" dc:"资产SKU ID(精确查询)"`
|
||||
ProductName string `json:"productName" dc:"商品名称(模糊查询)"`
|
||||
Brand string `json:"brand" dc:"品牌(模糊查询)"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPurchaseOrderItemsRes 获取采购订单明细列表响应
|
||||
type ListPurchaseOrderItemsRes struct {
|
||||
List []*PurchaseOrderItemListItem `json:"list" dc:"采购订单明细列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PurchaseOrderItemListItem 采购订单明细列表项
|
||||
type PurchaseOrderItemListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
OrderId *bson.ObjectID `json:"orderId"`
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId"`
|
||||
ProductName string `json:"productName"`
|
||||
Specification string `json:"specification"`
|
||||
Brand string `json:"brand"`
|
||||
Quantity int `json:"quantity"`
|
||||
Unit string `json:"unit"`
|
||||
UnitPrice int `json:"unitPrice"`
|
||||
TotalPrice int `json:"totalPrice"`
|
||||
DiscountPrice int `json:"discountPrice"`
|
||||
RequirementDesc string `json:"requirementDesc"`
|
||||
DeliveryAddress string `json:"deliveryAddress"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// BatchCreatePurchaseOrderItemsReq 批量创建采购订单明细请求
|
||||
type BatchCreatePurchaseOrderItemsReq struct {
|
||||
g.Meta `path:"/batchCreatePurchaseOrderItems" method:"post" tags:"采购订单明细管理" summary:"批量创建采购订单明细" dc:"批量创建采购订单明细"`
|
||||
|
||||
Items []CreatePurchaseOrderItemReq `json:"items" v:"required" dc:"采购订单明细列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePurchaseOrderItemsRes 批量创建采购订单明细响应
|
||||
type BatchCreatePurchaseOrderItemsRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
253
model/dto/procurement/supplier_dto.go
Normal file
253
model/dto/procurement/supplier_dto.go
Normal file
@@ -0,0 +1,253 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/procurement"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GenerateSupplierTestDataReq 生成供应商测试数据请求
|
||||
type GenerateSupplierTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"供应商管理" summary:"生成测试数据" dc:"生成供应商测试数据"`
|
||||
}
|
||||
|
||||
// CreateSupplierReq 创建供应商请求
|
||||
type CreateSupplierReq struct {
|
||||
g.Meta `path:"/createSupplier" method:"post" tags:"供应商管理" summary:"创建供应商" dc:"创建新的供应商(仅基础信息)"`
|
||||
|
||||
// 基础信息(最小必要字段)
|
||||
Name string `json:"name" v:"required|max-length:100#供应商名称不能为空|供应商名称不能超过100个字符" dc:"供应商名称(必填)"`
|
||||
Code string `json:"code" v:"required|max-length:50#供应商编码不能为空|供应商编码不能超过50个字符" dc:"供应商编码(必填)"`
|
||||
ShortName string `json:"shortName" dc:"供应商简称"`
|
||||
Alias []string `json:"alias" dc:"别名列表"`
|
||||
Logo string `json:"logo" dc:"供应商LOGO URL"`
|
||||
|
||||
// 联系信息
|
||||
Phone string `json:"phone" dc:"供应商电话"`
|
||||
Mobile string `json:"mobile" dc:"手机号码"`
|
||||
Email string `json:"email" dc:"邮箱地址"`
|
||||
Website string `json:"website" dc:"官网地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人姓名"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系人电话"`
|
||||
ContactEmail string `json:"contactEmail" dc:"联系人邮箱"`
|
||||
ContactPosition string `json:"contactPosition" dc:"联系人职位"`
|
||||
|
||||
// 地址信息
|
||||
Country string `json:"country" dc:"国家"`
|
||||
Province string `json:"province" dc:"省份"`
|
||||
City string `json:"city" dc:"城市"`
|
||||
District string `json:"district" dc:"区县"`
|
||||
Address string `json:"address" dc:"详细地址"`
|
||||
PostalCode string `json:"postalCode" dc:"邮政编码"`
|
||||
|
||||
// 企业资质信息
|
||||
BusinessLicense string `json:"businessLicense" dc:"营业执照号"`
|
||||
LegalPerson string `json:"legalPerson" dc:"法定代表人"`
|
||||
TaxNumber string `json:"taxNumber" dc:"税务登记号"`
|
||||
BankName string `json:"bankName" dc:"开户银行"`
|
||||
BankAccount string `json:"bankAccount" dc:"银行账号"`
|
||||
BankAccountName string `json:"bankAccountName" dc:"账户名称"`
|
||||
|
||||
// 业务合作信息
|
||||
SupplierLevel string `json:"supplierLevel" dc:"供应商等级"`
|
||||
PaymentMethod string `json:"paymentMethod" dc:"结算方式"`
|
||||
PaymentPeriod int `json:"paymentPeriod" dc:"付款周期(天)"`
|
||||
TaxRate float64 `json:"taxRate" dc:"税率(如0.13表示13%)"`
|
||||
MinOrderAmount int `json:"minOrderAmount" dc:"最小订货金额(分)"`
|
||||
|
||||
// 经营品类信息
|
||||
MainCategories []string `json:"mainCategories" dc:"主营品类ID列表"`
|
||||
BusinessScope string `json:"businessScope" dc:"经营范围"`
|
||||
|
||||
// 状态信息
|
||||
Status consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
||||
|
||||
// 备注和标签
|
||||
Remark string `json:"remark" dc:"备注信息"`
|
||||
Tags []string `json:"tags" dc:"标签列表"`
|
||||
}
|
||||
|
||||
// CreateSupplierRes 创建供应商响应
|
||||
type CreateSupplierRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 供应商ID
|
||||
}
|
||||
|
||||
// BatchCreateSuppliersReq 批量创建供应商请求
|
||||
type BatchCreateSuppliersReq struct {
|
||||
g.Meta `path:"/batchCreateSuppliers" method:"post" tags:"供应商管理" summary:"批量创建供应商" dc:"批量创建供应商"`
|
||||
|
||||
Suppliers []CreateSupplierReq `json:"suppliers" v:"required" dc:"供应商列表"`
|
||||
}
|
||||
|
||||
// BatchCreateSuppliersRes 批量创建供应商响应
|
||||
type BatchCreateSuppliersRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
|
||||
// UpdateSupplierReq 更新供应商请求
|
||||
type UpdateSupplierReq struct {
|
||||
g.Meta `path:"/updateSupplier" method:"put" tags:"供应商管理" summary:"更新供应商" dc:"更新供应商信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
||||
|
||||
// 基础信息
|
||||
Name string `json:"name" dc:"供应商名称"`
|
||||
Code string `json:"code" dc:"供应商编码"`
|
||||
ShortName string `json:"shortName" dc:"供应商简称"`
|
||||
Alias []string `json:"alias" dc:"别名列表"`
|
||||
Logo string `json:"logo" dc:"供应商LOGO URL"`
|
||||
|
||||
// 联系信息
|
||||
Phone string `json:"phone" dc:"供应商电话"`
|
||||
Mobile string `json:"mobile" dc:"手机号码"`
|
||||
Email string `json:"email" dc:"邮箱地址"`
|
||||
Website string `json:"website" dc:"官网地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人姓名"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系人电话"`
|
||||
ContactEmail string `json:"contactEmail" dc:"联系人邮箱"`
|
||||
ContactPosition string `json:"contactPosition" dc:"联系人职位"`
|
||||
|
||||
// 地址信息
|
||||
Country string `json:"country" dc:"国家"`
|
||||
Province string `json:"province" dc:"省份"`
|
||||
City string `json:"city" dc:"城市"`
|
||||
District string `json:"district" dc:"区县"`
|
||||
Address string `json:"address" dc:"详细地址"`
|
||||
PostalCode string `json:"postalCode" dc:"邮政编码"`
|
||||
|
||||
// 企业资质信息
|
||||
BusinessLicense string `json:"businessLicense" dc:"营业执照号"`
|
||||
LegalPerson string `json:"legalPerson" dc:"法定代表人"`
|
||||
TaxNumber string `json:"taxNumber" dc:"税务登记号"`
|
||||
BankName string `json:"bankName" dc:"开户银行"`
|
||||
BankAccount string `json:"bankAccount" dc:"银行账号"`
|
||||
BankAccountName string `json:"bankAccountName" dc:"账户名称"`
|
||||
|
||||
// 业务合作信息
|
||||
SupplierLevel string `json:"supplierLevel" dc:"供应商等级"`
|
||||
PaymentMethod string `json:"paymentMethod" dc:"结算方式"`
|
||||
PaymentPeriod int `json:"paymentPeriod" dc:"付款周期(天)"`
|
||||
TaxRate float64 `json:"taxRate" dc:"税率(如0.13表示13%)"`
|
||||
MinOrderAmount int `json:"minOrderAmount" dc:"最小订货金额(分)"`
|
||||
|
||||
// 经营品类信息
|
||||
MainCategories []string `json:"mainCategories" dc:"主营品类ID列表"`
|
||||
BusinessScope string `json:"businessScope" dc:"经营范围"`
|
||||
|
||||
// 状态信息
|
||||
Status consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
||||
|
||||
// 备注和标签
|
||||
Remark string `json:"remark" dc:"备注信息"`
|
||||
Tags []string `json:"tags" dc:"标签列表"`
|
||||
}
|
||||
|
||||
// DeleteSupplierReq 删除供应商请求
|
||||
type DeleteSupplierReq struct {
|
||||
g.Meta `path:"/deleteSupplier" method:"delete" tags:"供应商管理" summary:"删除供应商" dc:"删除供应商"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
||||
}
|
||||
|
||||
// GetSupplierReq 获取供应商详情请求
|
||||
type GetSupplierReq struct {
|
||||
g.Meta `path:"/getSupplier" method:"get" tags:"供应商管理" summary:"获取供应商详情" dc:"获取供应商详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"供应商ID"`
|
||||
}
|
||||
|
||||
// GetSupplierRes 获取供应商详情响应(简化版)
|
||||
type GetSupplierRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
ShortName string `json:"shortName"`
|
||||
Alias []string `json:"alias"`
|
||||
Logo string `json:"logo"`
|
||||
Phone string `json:"phone"`
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Website string `json:"website"`
|
||||
ContactPerson string `json:"contactPerson"`
|
||||
ContactPhone string `json:"contactPhone"`
|
||||
ContactEmail string `json:"contactEmail"`
|
||||
ContactPosition string `json:"contactPosition"`
|
||||
Country string `json:"country"`
|
||||
Province string `json:"province"`
|
||||
City string `json:"city"`
|
||||
District string `json:"district"`
|
||||
Address string `json:"address"`
|
||||
PostalCode string `json:"postalCode"`
|
||||
BusinessLicense string `json:"businessLicense"`
|
||||
LegalPerson string `json:"legalPerson"`
|
||||
TaxNumber string `json:"taxNumber"`
|
||||
BankName string `json:"bankName"`
|
||||
BankAccount string `json:"bankAccount"`
|
||||
BankAccountName string `json:"bankAccountName"`
|
||||
SupplierLevel string `json:"supplierLevel"`
|
||||
PaymentMethod string `json:"paymentMethod"`
|
||||
PaymentPeriod int `json:"paymentPeriod"`
|
||||
TaxRate float64 `json:"taxRate"`
|
||||
MinOrderAmount int `json:"minOrderAmount"`
|
||||
MainCategories []string `json:"mainCategories"`
|
||||
BusinessScope string `json:"businessScope"`
|
||||
Status consts.SupplierStatus `json:"status"`
|
||||
StatusText string `json:"statusText"`
|
||||
Rating float64 `json:"rating"`
|
||||
DeliveryRating float64 `json:"deliveryRating"`
|
||||
QualityRating float64 `json:"qualityRating"`
|
||||
ServiceRating float64 `json:"serviceRating"`
|
||||
TotalOrders int64 `json:"totalOrders"`
|
||||
TotalAmount int64 `json:"totalAmount"`
|
||||
Remark string `json:"remark"`
|
||||
Tags []string `json:"tags"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListSuppliersReq 获取供应商列表请求
|
||||
type ListSuppliersReq struct {
|
||||
g.Meta `path:"/listSuppliers" method:"get" tags:"供应商管理" summary:"获取供应商列表" dc:"分页查询供应商列表"`
|
||||
|
||||
Name string `json:"name" dc:"供应商名称(模糊查询)"`
|
||||
Code string `json:"code" dc:"供应商编码(精确查询)"`
|
||||
Status *consts.SupplierStatus `json:"status" dc:"供应商状态"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListSuppliersRes 获取供应商列表响应
|
||||
type ListSuppliersRes struct {
|
||||
List []*SupplierListItem `json:"list" dc:"供应商列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// GetSupplierOptionsReq 获取供应商选项请求
|
||||
type GetSupplierOptionsReq struct {
|
||||
g.Meta `path:"/getSupplierOptions" method:"get" tags:"供应商管理" summary:"获取供应商选项" dc:"获取供应商选项(用于下拉选择)"`
|
||||
}
|
||||
|
||||
// GetSupplierOptionsRes 获取供应商选项响应
|
||||
type GetSupplierOptionsRes struct {
|
||||
List []*SupplierListItem `json:"list" dc:"供应商选项列表"`
|
||||
}
|
||||
|
||||
// SupplierListItem 供应商列表项(简化版)
|
||||
type SupplierListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
ShortName string `json:"shortName"`
|
||||
Logo string `json:"logo"`
|
||||
Phone string `json:"phone"`
|
||||
Mobile string `json:"mobile"`
|
||||
Email string `json:"email"`
|
||||
Website string `json:"website"`
|
||||
Address string `json:"address"`
|
||||
Status consts.SupplierStatus `json:"status"`
|
||||
StatusText string `json:"statusText"`
|
||||
Rating float64 `json:"rating"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
110
model/dto/stock/inventory_count_adjust_history_dto.go
Normal file
110
model/dto/stock/inventory_count_adjust_history_dto.go
Normal file
@@ -0,0 +1,110 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"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"
|
||||
)
|
||||
|
||||
// CreateInventoryCountAdjustHistoryReq 创建盘点调整历史请求
|
||||
type CreateInventoryCountAdjustHistoryReq struct {
|
||||
g.Meta `path:"/createInventoryCountAdjustHistory" method:"post" tags:"盘点调整历史管理" summary:"创建盘点调整历史" dc:"创建新的盘点调整历史记录"`
|
||||
CountID *bson.ObjectID `json:"countId" v:"required" dc:"盘点任务ID"`
|
||||
DetailID *bson.ObjectID `json:"detailId" v:"required" dc:"盘点明细ID"`
|
||||
AssetSkuID *bson.ObjectID `json:"assetSkuId" v:"required" dc:"商品SKU ID"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" v:"required" dc:"仓库ID"`
|
||||
ZoneID *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
LocationID *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
BeforeQuantity int `json:"beforeQuantity" v:"required" dc:"调整前库存"`
|
||||
AfterQuantity int `json:"afterQuantity" v:"required" dc:"调整后库存"`
|
||||
Difference int `json:"difference" v:"required" dc:"差值"`
|
||||
Reason string `json:"reason" dc:"调整原因"`
|
||||
AdjustedBy string `json:"adjustedBy" dc:"调整人ID"`
|
||||
AdjustedByName string `json:"adjustedByName" dc:"调整人姓名"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
}
|
||||
|
||||
// CreateInventoryCountAdjustHistoryRes 创建盘点调整历史响应
|
||||
type CreateInventoryCountAdjustHistoryRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"历史记录ID"`
|
||||
}
|
||||
|
||||
// GetInventoryCountAdjustHistoryReq 获取盘点调整历史详情请求
|
||||
type GetInventoryCountAdjustHistoryReq struct {
|
||||
g.Meta `path:"/getInventoryCountAdjustHistory" method:"get" tags:"盘点调整历史管理" summary:"获取盘点调整历史详情" dc:"获取盘点调整历史详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"历史记录ID"`
|
||||
}
|
||||
|
||||
// GetInventoryCountAdjustHistoryRes 获取盘点调整历史详情响应
|
||||
type GetInventoryCountAdjustHistoryRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"历史记录ID"`
|
||||
CountID *bson.ObjectID `json:"countId" dc:"盘点任务ID"`
|
||||
DetailID *bson.ObjectID `json:"detailId" dc:"盘点明细ID"`
|
||||
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"商品SKU ID"`
|
||||
AssetSkuName string `json:"assetSkuName" dc:"商品SKU名称"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneID *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationID *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
BeforeQuantity int `json:"beforeQuantity" dc:"调整前库存"`
|
||||
AfterQuantity int `json:"afterQuantity" dc:"调整后库存"`
|
||||
Difference int `json:"difference" dc:"差值"`
|
||||
Reason string `json:"reason" dc:"调整原因"`
|
||||
AdjustedBy string `json:"adjustedBy" dc:"调整人ID"`
|
||||
AdjustedByName string `json:"adjustedByName" dc:"调整人姓名"`
|
||||
AdjustedAt *gtime.Time `json:"adjustedAt" dc:"调整时间"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
// DeleteInventoryCountAdjustHistoryReq 删除盘点调整历史请求
|
||||
type DeleteInventoryCountAdjustHistoryReq struct {
|
||||
g.Meta `path:"/deleteInventoryCountAdjustHistory" method:"delete" tags:"盘点调整历史管理" summary:"删除盘点调整历史" dc:"删除盘点调整历史记录"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"历史记录ID"`
|
||||
}
|
||||
|
||||
// DeleteInventoryCountAdjustHistoryRes 删除盘点调整历史响应
|
||||
type DeleteInventoryCountAdjustHistoryRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"历史记录ID"`
|
||||
}
|
||||
|
||||
// ListInventoryCountAdjustHistoryReq 获取盘点调整历史列表请求
|
||||
type ListInventoryCountAdjustHistoryReq struct {
|
||||
g.Meta `path:"/listInventoryCountAdjustHistories" method:"get" tags:"盘点调整历史管理" summary:"获取盘点调整历史列表" dc:"分页查询盘点调整历史列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
CountID string `json:"countId" dc:"盘点任务ID"`
|
||||
DetailID string `json:"detailId" dc:"盘点明细ID"`
|
||||
AssetSkuID string `json:"assetSkuId" dc:"商品SKU ID"`
|
||||
WarehouseID string `json:"warehouseId" dc:"仓库ID"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
}
|
||||
|
||||
// ListInventoryCountAdjustHistoryRes 获取盘点调整历史列表响应
|
||||
type ListInventoryCountAdjustHistoryRes struct {
|
||||
List []InventoryCountAdjustHistoryListItem `json:"list" dc:"调整历史列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// InventoryCountAdjustHistoryListItem 盘点调整历史列表项
|
||||
type InventoryCountAdjustHistoryListItem struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"历史记录ID"`
|
||||
CountID *bson.ObjectID `json:"countId" dc:"盘点任务ID"`
|
||||
DetailID *bson.ObjectID `json:"detailId" dc:"盘点明细ID"`
|
||||
AssetSkuID *bson.ObjectID `json:"assetSkuId" dc:"商品SKU ID"`
|
||||
AssetSkuName string `json:"assetSkuName" dc:"商品SKU名称"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
BeforeQuantity int `json:"beforeQuantity" dc:"调整前库存"`
|
||||
AfterQuantity int `json:"afterQuantity" dc:"调整后库存"`
|
||||
Difference int `json:"difference" dc:"差值"`
|
||||
Reason string `json:"reason" dc:"调整原因"`
|
||||
AdjustedBy string `json:"adjustedBy" dc:"调整人ID"`
|
||||
AdjustedByName string `json:"adjustedByName" dc:"调整人姓名"`
|
||||
AdjustedAt *gtime.Time `json:"adjustedAt" dc:"调整时间"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
179
model/dto/stock/inventory_count_detail_dto.go
Normal file
179
model/dto/stock/inventory_count_detail_dto.go
Normal file
@@ -0,0 +1,179 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CreateInventoryCountDetailReq 创建盘点明细请求
|
||||
type CreateInventoryCountDetailReq struct {
|
||||
g.Meta `path:"/createInventoryCountDetail" method:"post" tags:"盘点明细管理" summary:"创建盘点明细" dc:"创建新的盘点明细"`
|
||||
CountID string `json:"countId" v:"required" dc:"盘点单ID"`
|
||||
AssetID string `json:"assetId" v:"required" dc:"资产ID"`
|
||||
AssetSkuID string `json:"assetSkuId" v:"required" dc:"资产SKU ID"`
|
||||
WarehouseID string `json:"warehouseId" v:"required" dc:"仓库ID"`
|
||||
ZoneID string `json:"zoneId" dc:"库区ID"`
|
||||
LocationID string `json:"locationId" dc:"库位ID"`
|
||||
BookQuantity int `json:"bookQuantity" v:"required" dc:"账面数量"`
|
||||
BookBatchInfo map[string]int `json:"bookBatchInfo" dc:"账面批次信息"`
|
||||
ActualQuantity int `json:"actualQuantity" dc:"实盘数量"`
|
||||
ActualBatchInfo map[string]int `json:"actualBatchInfo" dc:"实盘批次信息"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateInventoryCountDetailRes 创建盘点明细响应
|
||||
type CreateInventoryCountDetailRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"盘点明细ID"`
|
||||
}
|
||||
|
||||
// UpdateInventoryCountDetailReq 更新盘点明细请求
|
||||
type UpdateInventoryCountDetailReq struct {
|
||||
g.Meta `path:"/updateInventoryCountDetail" method:"put" tags:"盘点明细管理" summary:"更新盘点明细" dc:"更新盘点明细信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点明细ID"`
|
||||
ActualQuantity *int `json:"actualQuantity" dc:"实盘数量"`
|
||||
ActualBatchInfo map[string]int `json:"actualBatchInfo" dc:"实盘批次信息"`
|
||||
DiscrepancyReason string `json:"discrepancyReason" dc:"差异原因"`
|
||||
Status *stock.InventoryDetailStatus `json:"status" dc:"明细状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// UpdateInventoryCountDetailRes 更新盘点明细响应
|
||||
type UpdateInventoryCountDetailRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"盘点明细ID"`
|
||||
}
|
||||
|
||||
// DeleteInventoryCountDetailReq 删除盘点明细请求
|
||||
type DeleteInventoryCountDetailReq struct {
|
||||
g.Meta `path:"/deleteInventoryCountDetail" method:"delete" tags:"盘点明细管理" summary:"删除盘点明细" dc:"删除盘点明细"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点明细ID"`
|
||||
}
|
||||
|
||||
// DeleteInventoryCountDetailRes 删除盘点明细响应
|
||||
type DeleteInventoryCountDetailRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"盘点明细ID"`
|
||||
}
|
||||
|
||||
// GetInventoryCountDetailReq 获取盘点明细详情请求
|
||||
type GetInventoryCountDetailReq struct {
|
||||
g.Meta `path:"/getInventoryCountDetail" method:"get" tags:"盘点明细管理" summary:"获取盘点明细详情" dc:"获取盘点明细详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"盘点明细ID"`
|
||||
}
|
||||
|
||||
// GetInventoryCountDetailRes 获取盘点明细详情响应
|
||||
type GetInventoryCountDetailRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"盘点明细ID"`
|
||||
CountID *bson.ObjectID `json:"countId" dc:"盘点单ID"`
|
||||
CountNo string `json:"countNo" 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名称"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneID *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationID *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
BookQuantity int `json:"bookQuantity" dc:"账面数量"`
|
||||
BookBatchInfo map[string]int `json:"bookBatchInfo" dc:"账面批次信息"`
|
||||
ActualQuantity int `json:"actualQuantity" dc:"实盘数量"`
|
||||
ActualBatchInfo map[string]int `json:"actualBatchInfo" dc:"实盘批次信息"`
|
||||
CountBy string `json:"countBy" dc:"盘点人ID"`
|
||||
CountByName string `json:"countByName" dc:"盘点人名称"`
|
||||
CountAt *gtime.Time `json:"countAt" dc:"盘点时间"`
|
||||
Difference int `json:"difference" dc:"差异数量"`
|
||||
DifferenceRate float64 `json:"differenceRate" dc:"差异率"`
|
||||
DiscrepancyType stock.DiscrepancyType `json:"discrepancyType" dc:"差异类型"`
|
||||
DiscrepancyTypeText string `json:"discrepancyTypeText" dc:"差异类型文本"`
|
||||
DiscrepancyReason string `json:"discrepancyReason" dc:"差异原因"`
|
||||
Status stock.InventoryDetailStatus `json:"status" dc:"明细状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
IsAdjusted bool `json:"isAdjusted" dc:"是否已调整"`
|
||||
AdjustedAt *gtime.Time `json:"adjustedAt" dc:"调整时间"`
|
||||
AdjustedBy string `json:"adjustedBy" dc:"调整人ID"`
|
||||
AdjustedByName string `json:"adjustedByName" dc:"调整人名称"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// ListInventoryCountDetailReq 获取盘点明细列表请求
|
||||
type ListInventoryCountDetailReq struct {
|
||||
g.Meta `path:"/listInventoryCountDetails" method:"get" tags:"盘点明细管理" summary:"获取盘点明细列表" dc:"分页查询盘点明细列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
CountID string `json:"countId" v:"required" dc:"盘点单ID"`
|
||||
AssetID string `json:"assetId" dc:"资产ID"`
|
||||
AssetSkuID string `json:"assetSkuId" dc:"资产SKU ID"`
|
||||
WarehouseID string `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneID string `json:"zoneId" dc:"库区ID"`
|
||||
LocationID string `json:"locationId" dc:"库位ID"`
|
||||
DiscrepancyType *stock.DiscrepancyType `json:"discrepancyType" dc:"差异类型"`
|
||||
Status *stock.InventoryDetailStatus `json:"status" dc:"明细状态"`
|
||||
IsAdjusted *bool `json:"isAdjusted" dc:"是否已调整"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListInventoryCountDetailRes 获取盘点明细列表响应
|
||||
type ListInventoryCountDetailRes struct {
|
||||
List []InventoryCountDetailListItem `json:"list" dc:"盘点明细列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// InventoryCountDetailListItem 盘点明细列表项
|
||||
type InventoryCountDetailListItem struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"盘点明细ID"`
|
||||
CountID *bson.ObjectID `json:"countId" 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名称"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneID *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationID *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
BookQuantity int `json:"bookQuantity" dc:"账面数量"`
|
||||
ActualQuantity int `json:"actualQuantity" dc:"实盘数量"`
|
||||
Difference int `json:"difference" dc:"差异数量"`
|
||||
DifferenceRate float64 `json:"differenceRate" dc:"差异率"`
|
||||
DiscrepancyType stock.DiscrepancyType `json:"discrepancyType" dc:"差异类型"`
|
||||
DiscrepancyTypeText string `json:"discrepancyTypeText" dc:"差异类型文本"`
|
||||
Status stock.InventoryDetailStatus `json:"status" dc:"明细状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
IsAdjusted bool `json:"isAdjusted" dc:"是否已调整"`
|
||||
CountBy string `json:"countBy" dc:"盘点人ID"`
|
||||
CountByName string `json:"countByName" dc:"盘点人名称"`
|
||||
CountAt *gtime.Time `json:"countAt" dc:"盘点时间"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// SearchSimilarAssetsReq 查询相似商品请求
|
||||
type SearchSimilarAssetsReq struct {
|
||||
g.Meta `path:"/searchSimilarAssets" method:"get" tags:"盘点明细管理" summary:"查询相似商品" dc:"单字模糊查询相似商品"`
|
||||
Keyword string `json:"keyword" v:"required" dc:"关键词"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// SearchSimilarAssetsRes 查询相似商品响应
|
||||
type SearchSimilarAssetsRes struct {
|
||||
List []SimilarAssetItem `json:"list" dc:"相似商品列表"`
|
||||
}
|
||||
|
||||
// SimilarAssetItem 相似商品项
|
||||
type SimilarAssetItem struct {
|
||||
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名称"`
|
||||
AvailableQty int `json:"availableQty" dc:"可用库存"`
|
||||
WarehouseID *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
}
|
||||
202
model/dto/stock/inventory_count_dto.go
Normal file
202
model/dto/stock/inventory_count_dto.go
Normal file
@@ -0,0 +1,202 @@
|
||||
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:"失败数量"`
|
||||
}
|
||||
1
model/dto/stock/inventory_traceability_dto.go
Normal file
1
model/dto/stock/inventory_traceability_dto.go
Normal file
@@ -0,0 +1 @@
|
||||
package dto
|
||||
1
model/dto/stock/inventory_transaction_dto.go
Normal file
1
model/dto/stock/inventory_transaction_dto.go
Normal file
@@ -0,0 +1 @@
|
||||
package dto
|
||||
214
model/dto/stock/inventory_warning_dto.go
Normal file
214
model/dto/stock/inventory_warning_dto.go
Normal file
@@ -0,0 +1,214 @@
|
||||
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"`
|
||||
}
|
||||
117
model/dto/stock/inventory_warning_history_dto.go
Normal file
117
model/dto/stock/inventory_warning_history_dto.go
Normal file
@@ -0,0 +1,117 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// GetInventoryWarningHistoryReq 获取预警历史详情请求
|
||||
type GetInventoryWarningHistoryReq struct {
|
||||
g.Meta `path:"/getInventoryWarningHistory" method:"get" tags:"预警历史管理" summary:"获取预警历史详情" dc:"获取预警历史详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"预警历史ID"`
|
||||
}
|
||||
|
||||
// GetInventoryWarningHistoryRes 获取预警历史详情响应
|
||||
type GetInventoryWarningHistoryRes 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:"过期日期"`
|
||||
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 *bson.ObjectID `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:"更新时间"`
|
||||
}
|
||||
|
||||
// ListInventoryWarningHistoryReq 获取预警历史列表请求
|
||||
type ListInventoryWarningHistoryReq struct {
|
||||
g.Meta `path:"/listInventoryWarningHistories" 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:"处理方式"`
|
||||
StartDate string `json:"startDate" dc:"开始日期"`
|
||||
EndDate string `json:"endDate" dc:"结束日期"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索(批次号)"`
|
||||
}
|
||||
|
||||
// ListInventoryWarningHistoryRes 获取预警历史列表响应
|
||||
type ListInventoryWarningHistoryRes struct {
|
||||
List []InventoryWarningHistoryListItem `json:"list" dc:"预警历史列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// InventoryWarningHistoryListItem 预警历史列表项
|
||||
type InventoryWarningHistoryListItem 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:"创建时间"`
|
||||
}
|
||||
|
||||
// DeleteInventoryWarningHistoryReq 删除预警历史请求
|
||||
type DeleteInventoryWarningHistoryReq struct {
|
||||
g.Meta `path:"/deleteInventoryWarningHistory" method:"delete" tags:"预警历史管理" summary:"删除预警历史" dc:"删除预警历史记录"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"预警历史ID"`
|
||||
}
|
||||
|
||||
// DeleteInventoryWarningHistoryRes 删除预警历史响应
|
||||
type DeleteInventoryWarningHistoryRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"预警历史ID"`
|
||||
}
|
||||
136
model/dto/stock/location_dto.go
Normal file
136
model/dto/stock/location_dto.go
Normal file
@@ -0,0 +1,136 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CreateLocationReq 创建库位请求
|
||||
type CreateLocationReq struct {
|
||||
g.Meta `path:"/createLocation" method:"post" tags:"库位管理" summary:"创建库位" dc:"创建新的库位"`
|
||||
WarehouseId string `json:"warehouseId" v:"required" dc:"仓库ID"`
|
||||
ZoneId string `json:"zoneId" v:"required" dc:"库区ID"`
|
||||
LocationCode string `json:"locationCode" v:"required|max-length:50#库位编码不能为空|库位编码不能超过50个字符" dc:"库位编码"`
|
||||
LocationName string `json:"locationName" v:"required|max-length:100#库位名称不能为空|库位名称不能超过100个字符" dc:"库位名称"`
|
||||
LocationType stock.LocationType `json:"locationType" v:"required" dc:"库位类型"`
|
||||
CapacityUnitType stock.CapacityUnitType `json:"capacityUnitType" v:"required" dc:"容量单位类型"`
|
||||
CapacityUnit string `json:"capacityUnit" v:"required" dc:"容量单位(如箱、托盘)"`
|
||||
MaxCapacity int `json:"maxCapacity" v:"required|min:1#最大容量不能为空|最大容量必须大于0" dc:"最大容量"`
|
||||
Status *stock.LocationStatus `json:"status" dc:"库位状态(可选,默认空闲)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateLocationRes 创建库位响应
|
||||
type CreateLocationRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库位ID"`
|
||||
}
|
||||
|
||||
// UpdateLocationReq 更新库位请求
|
||||
type UpdateLocationReq struct {
|
||||
g.Meta `path:"/updateLocation" method:"put" tags:"库位管理" summary:"更新库位" dc:"更新库位信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库位ID"`
|
||||
WarehouseId string `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneId string `json:"zoneId" dc:"库区ID"`
|
||||
LocationCode string `json:"locationCode" dc:"库位编码"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
LocationType *stock.LocationType `json:"locationType" dc:"库位类型"`
|
||||
CapacityUnitType *stock.CapacityUnitType `json:"capacityUnitType" dc:"容量单位类型"`
|
||||
CapacityUnit string `json:"capacityUnit" dc:"容量单位"`
|
||||
MaxCapacity *int `json:"maxCapacity" dc:"最大容量"`
|
||||
Status *stock.LocationStatus `json:"status" dc:"库位状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// UpdateLocationRes 更新库位响应
|
||||
type UpdateLocationRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库位ID"`
|
||||
}
|
||||
|
||||
// DeleteLocationReq 删除库位请求
|
||||
type DeleteLocationReq struct {
|
||||
g.Meta `path:"/deleteLocation" method:"delete" tags:"库位管理" summary:"删除库位" dc:"删除库位"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库位ID"`
|
||||
}
|
||||
|
||||
// UpdateLocationStatusReq 更新库位状态请求
|
||||
type UpdateLocationStatusReq struct {
|
||||
g.Meta `path:"/updateLocationStatus" method:"put" tags:"库位管理" summary:"更新库位状态" dc:"单独更新库位状态(空闲/占用/锁定/维护)"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库位ID"`
|
||||
Status stock.LocationStatus `json:"status" v:"required|in:idle,occupied,locked,maintenance#状态不能为空|状态值无效" dc:"库位状态"`
|
||||
}
|
||||
|
||||
// DeleteLocationRes 删除库位响应
|
||||
type DeleteLocationRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库位ID"`
|
||||
}
|
||||
|
||||
// GetLocationReq 获取库位详情请求
|
||||
type GetLocationReq struct {
|
||||
g.Meta `path:"/getLocation" method:"get" tags:"库位管理" summary:"获取库位详情" dc:"获取库位详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库位ID"`
|
||||
}
|
||||
|
||||
// GetLocationRes 获取库位详情响应
|
||||
type GetLocationRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库位ID"`
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationCode string `json:"locationCode" dc:"库位编码"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
LocationType stock.LocationType `json:"locationType" dc:"库位类型"`
|
||||
LocationTypeText string `json:"locationTypeText" dc:"库位类型文本"`
|
||||
MaxCapacity int `json:"maxCapacity" dc:"最大容量"`
|
||||
CurrentCapacity int `json:"currentCapacity" dc:"当前容量"`
|
||||
UsageRate float64 `json:"usageRate" dc:"使用率"`
|
||||
Status stock.LocationStatus `json:"status" dc:"库位状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// ListLocationReq 获取库位列表请求
|
||||
type ListLocationReq struct {
|
||||
g.Meta `path:"/listLocations" 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列表(批量查询)"`
|
||||
LocationType *stock.LocationType `json:"locationType" dc:"库位类型"`
|
||||
Status *stock.LocationStatus `json:"status" dc:"库位状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索(编码/名称)"`
|
||||
}
|
||||
|
||||
// ListLocationRes 获取库位列表响应
|
||||
type ListLocationRes struct {
|
||||
List []LocationListItem `json:"list" dc:"库位列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// LocationListItem 库位列表项
|
||||
type LocationListItem struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库位ID"`
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
LocationCode string `json:"locationCode" dc:"库位编码"`
|
||||
LocationName string `json:"locationName" dc:"库位名称"`
|
||||
LocationType stock.LocationType `json:"locationType" dc:"库位类型"`
|
||||
LocationTypeText string `json:"locationTypeText" dc:"库位类型文本"`
|
||||
MaxCapacity int `json:"maxCapacity" dc:"最大容量"`
|
||||
CurrentCapacity int `json:"currentCapacity" dc:"当前容量"`
|
||||
UsageRate float64 `json:"usageRate" dc:"使用率"`
|
||||
Status stock.LocationStatus `json:"status" dc:"库位状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
137
model/dto/stock/private_stock_dto.go
Normal file
137
model/dto/stock/private_stock_dto.go
Normal file
@@ -0,0 +1,137 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CreatePrivateStockReq 创建实物库存批次请求
|
||||
type CreatePrivateStockReq struct {
|
||||
g.Meta `path:"/createPrivateStock" method:"post" tags:"实物库存批次管理" summary:"创建实物库存批次" dc:"创建新的实物库存批次"`
|
||||
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" v:"required" dc:"仓库ID"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
LocationId *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
PrivateSkuID *bson.ObjectID `json:"privateSkuId" v:"required" dc:"私域SKU ID"`
|
||||
BatchNo string `json:"batchNo" v:"required" dc:"批次号"`
|
||||
BatchQty int `json:"batchQty" v:"required|min:1" dc:"批次总数量"`
|
||||
AvailableQty int `json:"availableQty" v:"required|min:0" dc:"可用数量"`
|
||||
BatchStatus *stock.BatchStatus `json:"batchStatus" dc:"批次状态"`
|
||||
StockStatus *stock.StockStatus `json:"stockStatus" dc:"库存状态"`
|
||||
SupplierID *bson.ObjectID `json:"supplierId" dc:"供应商ID"`
|
||||
SupportsRecycle bool `json:"supportsRecycle" dc:"是否支持回收"`
|
||||
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
StockType stock.StockLocationType `json:"stockType" dc:"库存类型"`
|
||||
}
|
||||
|
||||
// CreatePrivateStockRes 创建实物库存批次响应
|
||||
type CreatePrivateStockRes struct {
|
||||
Id *bson.ObjectID `json:"id"`
|
||||
}
|
||||
|
||||
// UpdatePrivateStockReq 更新实物库存批次请求
|
||||
type UpdatePrivateStockReq struct {
|
||||
g.Meta `path:"/updatePrivateStock" method:"put" tags:"实物库存批次管理" summary:"更新实物库存批次" dc:"更新实物库存批次信息"`
|
||||
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"实物库存批次ID"`
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
LocationId *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
PrivateSkuID *bson.ObjectID `json:"privateSkuId" dc:"私域SKU ID"`
|
||||
BatchNo string `json:"batchNo" dc:"批次号"`
|
||||
BatchQty int `json:"batchQty" dc:"批次总数量"`
|
||||
AvailableQty int `json:"availableQty" dc:"可用数量"`
|
||||
BatchStatus *stock.BatchStatus `json:"batchStatus" dc:"批次状态"`
|
||||
StockStatus *stock.StockStatus `json:"stockStatus" dc:"库存状态"`
|
||||
SupplierID *bson.ObjectID `json:"supplierId" dc:"供应商ID"`
|
||||
SupportsRecycle *bool `json:"supportsRecycle" dc:"是否支持回收"`
|
||||
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
StockType stock.StockLocationType `json:"stockType" dc:"库存类型"`
|
||||
}
|
||||
|
||||
// DeletePrivateStockReq 删除私域库存请求
|
||||
type DeletePrivateStockReq struct {
|
||||
g.Meta `path:"/deletePrivateStock" method:"delete" tags:"私域库存管理" summary:"删除私域库存" dc:"删除私域库存"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"私域库存ID"`
|
||||
}
|
||||
|
||||
// GetPrivateStockReq 获取私域库存详情请求
|
||||
type GetPrivateStockReq struct {
|
||||
g.Meta `path:"/getPrivateStock" method:"get" tags:"私域库存管理" summary:"获取私域库存详情" dc:"获取私域库存详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"私域库存ID"`
|
||||
}
|
||||
|
||||
// GetPrivateStockRes 获取私域库存详情响应
|
||||
type GetPrivateStockRes struct {
|
||||
Id *bson.ObjectID `json:"id"`
|
||||
StockType stock.StockLocationType `json:"stockType"`
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId"`
|
||||
WarehouseCode string `json:"warehouseCode"`
|
||||
WarehouseName string `json:"warehouseName"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId"`
|
||||
ZoneCode string `json:"zoneCode"`
|
||||
ZoneName string `json:"zoneName"`
|
||||
ZoneType stock.ZoneType `json:"zoneType"`
|
||||
LocationId *bson.ObjectID `json:"locationId"`
|
||||
LocationCode string `json:"locationCode"`
|
||||
LocationName string `json:"locationName"`
|
||||
LocationType stock.LocationType `json:"locationType"`
|
||||
PrivateSkuID *bson.ObjectID `json:"privateSkuId"`
|
||||
BatchNo string `json:"batchNo"`
|
||||
BatchQty int `json:"batchQty"`
|
||||
AvailableQty int `json:"availableQty"`
|
||||
BatchStatus stock.BatchStatus `json:"batchStatus"`
|
||||
OrderID *bson.ObjectID `json:"orderId"`
|
||||
SupplierID *bson.ObjectID `json:"supplierId"`
|
||||
SupportsRecycle bool `json:"supportsRecycle"`
|
||||
ProductionDate *gtime.Time `json:"productionDate"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath"`
|
||||
StockStatus stock.StockStatus `json:"stockStatus"`
|
||||
LastMovedAt *gtime.Time `json:"lastMovedAt"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPrivateStockReq 获取私域库存列表请求
|
||||
type ListPrivateStockReq struct {
|
||||
g.Meta `path:"/listPrivateStocks" method:"get" tags:"私域库存管理" summary:"获取私域库存列表" dc:"分页查询私域库存列表"`
|
||||
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
WarehouseId *bson.ObjectID `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneId *bson.ObjectID `json:"zoneId" dc:"库区ID"`
|
||||
LocationId *bson.ObjectID `json:"locationId" dc:"库位ID"`
|
||||
PrivateSkuID *bson.ObjectID `json:"privateSkuId" dc:"私域SKU ID"`
|
||||
BatchStatus *stock.BatchStatus `json:"batchStatus" dc:"批次状态"`
|
||||
StockStatus *stock.StockStatus `json:"stockStatus" dc:"库存状态"`
|
||||
SupplierID *bson.ObjectID `json:"supplierId" dc:"供应商ID"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
StockType stock.StockLocationType `json:"stockType" dc:"库存类型"`
|
||||
}
|
||||
|
||||
// ListPrivateStockRes 获取私域库存列表响应
|
||||
type ListPrivateStockRes struct {
|
||||
List []GetPrivateStockRes `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
// OutboundPrivateStockReq 实物库存批次出库请求
|
||||
type OutboundPrivateStockReq struct {
|
||||
g.Meta `path:"/outboundPrivateStock" method:"post" tags:"实物库存批次管理" summary:"实物库存批次出库" dc:"实物库存批次出库操作"`
|
||||
|
||||
StockId *bson.ObjectID `json:"stockId" v:"required" dc:"实物库存批次ID"`
|
||||
OutboundQty int `json:"outboundQty" v:"required|min:1" dc:"出库数量"`
|
||||
StockType stock.StockLocationType `json:"stockType" v:"required" dc:"库存类型(必须为PrivateStock)"`
|
||||
}
|
||||
90
model/dto/stock/stock_batch_dto.go
Normal file
90
model/dto/stock/stock_batch_dto.go
Normal file
@@ -0,0 +1,90 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CommonResp 通用响应
|
||||
type CommonResp struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
Message string `json:"message"` // 消息
|
||||
}
|
||||
|
||||
// --- 批次管理API相关结构 ---
|
||||
|
||||
// CreateBatchReq 创建批次请求
|
||||
type CreateBatchReq struct {
|
||||
g.Meta `path:"/createBatch" method:"post" tags:"库存批次管理" summary:"创建批次" dc:"创建新的库存批次"`
|
||||
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" v:"required" dc:"SKU ID"`
|
||||
BatchNo string `json:"batchNo" v:"required" dc:"批次号"`
|
||||
BatchQty int `json:"batchQty" v:"required|min:1" dc:"批次数量"`
|
||||
AvailableQty int `json:"availableQty" v:"required|min:1" dc:"可用数量"`
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"元数据"`
|
||||
Status stock.BatchStatus `json:"status" dc:"状态"`
|
||||
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期(格式:2006-01-02)"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期(格式:2006-01-02)"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间(格式:2006-01-02)"`
|
||||
}
|
||||
|
||||
// CreateBatchRes 创建批次响应
|
||||
type CreateBatchRes struct {
|
||||
Id *bson.ObjectID `json:"id"` // 批次ID
|
||||
}
|
||||
|
||||
// UpdateBatchReq 更新批次请求
|
||||
type UpdateBatchReq struct {
|
||||
g.Meta `path:"/updateBatch" method:"put" tags:"库存批次管理" summary:"更新批次" dc:"更新批次信息"`
|
||||
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"批次ID"`
|
||||
BatchQty int `json:"batchQty" v:"required|min:1" dc:"批次数量"`
|
||||
AvailableQty int `json:"availableQty" v:"required|min:1" dc:"可用数量"`
|
||||
}
|
||||
|
||||
// DeleteBatchReq 删除批次请求
|
||||
type DeleteBatchReq struct {
|
||||
g.Meta `path:"/deleteBatch" method:"delete" tags:"库存批次管理" summary:"删除批次" dc:"删除批次"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"批次ID"`
|
||||
}
|
||||
|
||||
// GetBatchReq 获取批次详情请求
|
||||
type GetBatchReq struct {
|
||||
g.Meta `path:"/getBatch" method:"get" tags:"库存批次管理" summary:"获取批次详情" dc:"获取批次详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"批次ID"`
|
||||
}
|
||||
|
||||
// GetBatchRes 获取批次详情响应
|
||||
type GetBatchRes struct {
|
||||
Id *bson.ObjectID `json:"id"`
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId"`
|
||||
BatchNo string `json:"batchNo"`
|
||||
BatchQty int `json:"batchQty"`
|
||||
AvailableQty int `json:"availableQty"`
|
||||
Metadata []map[string]interface{} `json:"metadata"`
|
||||
Status stock.BatchStatus `json:"status"`
|
||||
ProductionDate *gtime.Time `json:"productionDate"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate"`
|
||||
}
|
||||
|
||||
// ListBatchReq 获取批次列表请求
|
||||
type ListBatchReq struct {
|
||||
g.Meta `path:"/listBatches" method:"get" tags:"库存批次管理" summary:"获取批次列表" dc:"分页查询批次列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
AssetId *bson.ObjectID `json:"assetId" dc:"资产ID"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// ListBatchRes 获取批次列表响应
|
||||
type ListBatchRes struct {
|
||||
List []GetBatchRes `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
67
model/dto/stock/stock_details_dto.go
Normal file
67
model/dto/stock/stock_details_dto.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/stock"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GetStockDetailsReq 获取库存明细详情请求
|
||||
type GetStockDetailsReq struct {
|
||||
g.Meta `path:"/getStockDetails" method:"get" tags:"库存明细管理" summary:"获取库存明细详情" dc:"获取库存明细详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库存明细ID"`
|
||||
}
|
||||
|
||||
// GetStockDetailsRes 获取库存明细详情响应
|
||||
type GetStockDetailsRes struct {
|
||||
Id *bson.ObjectID `json:"id"`
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId"`
|
||||
Status stock.StockStatus `json:"status"`
|
||||
OrderId *bson.ObjectID `json:"orderId"`
|
||||
LockExpire string `json:"lockExpire"`
|
||||
Metadata map[string]interface{} `json:"metadata"`
|
||||
TokenId string `json:"tokenId"`
|
||||
AssignedChannel string `json:"assignedChannel"`
|
||||
ChannelSKU string `json:"channelSku"`
|
||||
AllocatedAt string `json:"allocatedAt"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListStockDetailsReq 获取库存明细列表请求
|
||||
type ListStockDetailsReq struct {
|
||||
g.Meta `path:"/listStockDetails" method:"get" tags:"库存明细管理" summary:"获取库存明细列表" dc:"分页查询库存明细列表,支持多条件筛选"`
|
||||
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
AssetId *bson.ObjectID `json:"assetId" dc:"资产ID"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" dc:"SKU ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
Status stock.StockStatus `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// ListStockDetailsRes 获取库存明细列表响应
|
||||
type ListStockDetailsRes struct {
|
||||
List []*StockDetailsListItem `json:"list" dc:"库存明细列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// StockDetailsListItem 库存明细列表项
|
||||
type StockDetailsListItem struct {
|
||||
Id *bson.ObjectID `json:"id"`
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId"`
|
||||
Status stock.StockStatus `json:"status"`
|
||||
OrderId *bson.ObjectID `json:"orderId"`
|
||||
LockExpire string `json:"lockExpire"`
|
||||
Metadata map[string]interface{} `json:"metadata"`
|
||||
TokenId *bson.ObjectID `json:"tokenId"`
|
||||
AssignedChannel string `json:"assignedChannel"`
|
||||
ChannelSKU string `json:"channelSku"`
|
||||
AllocatedAt string `json:"allocatedAt"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
77
model/dto/stock/stock_manage_dto.go
Normal file
77
model/dto/stock/stock_manage_dto.go
Normal file
@@ -0,0 +1,77 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/stock"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
type StockOperationReq struct {
|
||||
g.Meta `path:"/stockOperation" method:"post" tags:"库存管理" summary:"库存操作(创建/修改)" dc:"库存操作(创建/修改)"`
|
||||
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" v:"required" dc:"关联资产SKU ID"`
|
||||
Stock int `json:"stock" v:"required|min:1" dc:"库存数量"`
|
||||
// 批次模式专用字段
|
||||
BatchNo string `json:"batchNo" dc:"批次号(批次模式必填)"`
|
||||
ProductionDate *gtime.Time `json:"productionDate" dc:"生产日期(批次模式,格式:2006-01-02)"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate" dc:"过期日期(批次模式,格式:2006-01-02)"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate" dc:"临期预警时间(格式:2006-01-02)"`
|
||||
}
|
||||
|
||||
// StockPublishMessage 库存发布消息
|
||||
type StockPublishMessage struct {
|
||||
AssetId string `json:"assetId"`
|
||||
AssetSkuId string `json:"assetSkuId"`
|
||||
TenantId interface{} `json:"tenantId"`
|
||||
UserName interface{} `json:"userName"`
|
||||
StockCount int `json:"stockCount"`
|
||||
OperationType string `json:"operationType"`
|
||||
Metadata []map[string]interface{} `json:"metadata"`
|
||||
StockId string `json:"stockId"`
|
||||
StockMode int `json:"stockMode"`
|
||||
BatchNo string `json:"batchNo"`
|
||||
ProductionDate *gtime.Time `json:"productionDate"`
|
||||
ExpiryDate *gtime.Time `json:"expiryDate"`
|
||||
ExpiryWarningDate *gtime.Time `json:"expiryWarningDate"`
|
||||
}
|
||||
|
||||
// GetStockFormFieldsReq 获取库存表单字段请求
|
||||
type GetStockFormFieldsReq struct {
|
||||
g.Meta `path:"/getStockFormFields" method:"get" tags:"库存管理" summary:"获取库存操作表单字段" dc:"根据资产SKU的库存管理模式动态返回表单字段"`
|
||||
|
||||
AssetSkuId *bson.ObjectID `json:"assetSkuId" v:"required" dc:"关联资产ID"`
|
||||
}
|
||||
|
||||
// GetStockFormFieldsRes 获取库存表单字段响应
|
||||
type GetStockFormFieldsRes struct {
|
||||
StockMode stock.StockMode `json:"stockMode" dc:"库存管理模式:1-明细模式 2-批次模式"`
|
||||
Fields []map[string]interface{} `json:"fields" dc:"表单字段列表"`
|
||||
}
|
||||
|
||||
// MoveStockReq 移库请求(库位间移动)
|
||||
type MoveStockReq struct {
|
||||
g.Meta `path:"/moveStock" method:"post" tags:"库存管理" summary:"移库" dc:"将库存从一个库位移动到另一个库位(仅支持私域库存)"`
|
||||
|
||||
StockType stock.StockLocationType `json:"stockType" v:"required|in:2" dc:"库存类型(2-PrivateStock,仅支持私域库存)"`
|
||||
StockId *bson.ObjectID `json:"stockId" v:"required" dc:"私域库存ID"`
|
||||
FromLocationId *bson.ObjectID `json:"fromLocationId" v:"required" dc:"源库位ID"`
|
||||
ToLocationId *bson.ObjectID `json:"toLocationId" v:"required" dc:"目标库位ID"`
|
||||
Quantity int `json:"quantity" dc:"移动数量(保留字段,暂未使用)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// TransferStockReq 调拨请求(仓库间调拨)
|
||||
type TransferStockReq struct {
|
||||
g.Meta `path:"/transferStock" method:"post" tags:"库存管理" summary:"调拨" dc:"将库存从一个仓库调拨到另一个仓库(仅支持私域库存)"`
|
||||
|
||||
StockType stock.StockLocationType `json:"stockType" v:"required|in:2" dc:"库存类型(2-PrivateStock,仅支持私域库存)"`
|
||||
StockId *bson.ObjectID `json:"stockId" v:"required" dc:"私域库存ID"`
|
||||
FromWarehouseId *bson.ObjectID `json:"fromWarehouseId" v:"required" dc:"源仓库ID"`
|
||||
ToWarehouseId *bson.ObjectID `json:"toWarehouseId" v:"required" dc:"目标仓库ID"`
|
||||
ToZoneId *bson.ObjectID `json:"toZoneId" dc:"目标库区ID(可选)"`
|
||||
ToLocationId *bson.ObjectID `json:"toLocationId" dc:"目标库位ID(可选)"`
|
||||
Quantity int `json:"quantity" dc:"调拨数量(保留字段,暂未使用)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
1
model/dto/stock/stock_traceability_dto.go
Normal file
1
model/dto/stock/stock_traceability_dto.go
Normal file
@@ -0,0 +1 @@
|
||||
package dto
|
||||
1
model/dto/stock/stock_transaction_dto.go
Normal file
1
model/dto/stock/stock_transaction_dto.go
Normal file
@@ -0,0 +1 @@
|
||||
package dto
|
||||
56
model/dto/stock/unit_conversion_dto.go
Normal file
56
model/dto/stock/unit_conversion_dto.go
Normal file
@@ -0,0 +1,56 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/stock"
|
||||
entity "assets/model/entity/stock"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// CreateUnitConversionReq 创建单位换算请求
|
||||
type CreateUnitConversionReq struct {
|
||||
g.Meta `path:"/createUnitConversion" method:"post" tags:"单位换算" summary:"创建单位换算" dc:"创建新的单位换算规则"`
|
||||
ConversionCode string `json:"conversionCode" v:"required" dc:"换算编码"`
|
||||
ConversionName string `json:"conversionName" v:"required" dc:"换算名称"`
|
||||
UnitType stock.CapacityUnitType `json:"unitType" v:"required" dc:"单位类型"`
|
||||
FromUnit string `json:"fromUnit" v:"required" dc:"源单位"`
|
||||
ToUnit string `json:"toUnit" v:"required" dc:"目标单位"`
|
||||
ConversionFactor float64 `json:"conversionFactor" v:"required|min:0" dc:"换算系数"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
type CreateUnitConversionRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"换算规则ID"`
|
||||
}
|
||||
|
||||
// UpdateUnitConversionReq 更新单位换算请求
|
||||
type UpdateUnitConversionReq struct {
|
||||
g.Meta `path:"/updateUnitConversion" method:"put" tags:"单位换算" summary:"更新单位换算" dc:"更新单位换算规则"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"换算规则ID"`
|
||||
ConversionCode string `json:"conversionCode" dc:"换算编码"`
|
||||
ConversionName string `json:"conversionName" dc:"换算名称"`
|
||||
UnitType stock.CapacityUnitType `json:"unitType" dc:"单位类型"`
|
||||
FromUnit string `json:"fromUnit" dc:"源单位"`
|
||||
ToUnit string `json:"toUnit" dc:"目标单位"`
|
||||
ConversionFactor float64 `json:"conversionFactor" v:"min:0" dc:"换算系数"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// DeleteUnitConversionReq 删除单位换算请求
|
||||
type DeleteUnitConversionReq struct {
|
||||
g.Meta `path:"/deleteUnitConversion" method:"delete" tags:"单位换算" summary:"删除单位换算" dc:"删除单位换算规则"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"换算规则ID"`
|
||||
}
|
||||
|
||||
// ListUnitConversionReq 查询单位换算列表请求
|
||||
type ListUnitConversionReq struct {
|
||||
g.Meta `path:"/listUnitConversion" method:"get" tags:"单位换算" summary:"查询单位换算列表" dc:"查询单位换算规则列表"`
|
||||
UnitType *stock.CapacityUnitType `json:"unitType" dc:"过滤单位类型"`
|
||||
FromUnit string `json:"fromUnit" dc:"过滤源单位"`
|
||||
ToUnit string `json:"toUnit" dc:"过滤目标单位"`
|
||||
}
|
||||
|
||||
type ListUnitConversionRes struct {
|
||||
List []entity.UnitConversion `json:"list" dc:"换算规则列表"`
|
||||
}
|
||||
115
model/dto/stock/warehouse_dto.go
Normal file
115
model/dto/stock/warehouse_dto.go
Normal file
@@ -0,0 +1,115 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CreateWarehouseReq 创建仓库请求
|
||||
type CreateWarehouseReq struct {
|
||||
g.Meta `path:"/createWarehouse" method:"post" tags:"仓库管理" summary:"创建仓库" dc:"创建新的仓库"`
|
||||
WarehouseCode string `json:"warehouseCode" v:"required|max-length:50#仓库编码不能为空|仓库编码不能超过50个字符" dc:"仓库编码"`
|
||||
WarehouseName string `json:"warehouseName" v:"required|max-length:100#仓库名称不能为空|仓库名称不能超过100个字符" dc:"仓库名称"`
|
||||
Address string `json:"address" dc:"仓库地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
Status *stock.WarehouseStatus `json:"status" dc:"仓库状态(可选,默认启用)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateWarehouseRes 创建仓库响应
|
||||
type CreateWarehouseRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// UpdateWarehouseReq 更新仓库请求
|
||||
type UpdateWarehouseReq struct {
|
||||
g.Meta `path:"/updateWarehouse" method:"put" tags:"仓库管理" summary:"更新仓库" dc:"更新仓库信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"仓库ID"`
|
||||
WarehouseCode string `json:"warehouseCode" dc:"仓库编码"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
Address string `json:"address" dc:"仓库地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
Status *stock.WarehouseStatus `json:"status" dc:"仓库状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// UpdateWarehouseRes 更新仓库响应
|
||||
type UpdateWarehouseRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// DeleteWarehouseReq 删除仓库请求
|
||||
type DeleteWarehouseReq struct {
|
||||
g.Meta `path:"/deleteWarehouse" method:"delete" tags:"仓库管理" summary:"删除仓库" dc:"删除仓库"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// UpdateWarehouseStatusReq 更新仓库状态请求
|
||||
type UpdateWarehouseStatusReq struct {
|
||||
g.Meta `path:"/updateWarehouseStatus" method:"put" tags:"仓库管理" summary:"更新仓库状态" dc:"单独更新仓库状态(启用/停用)"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"仓库ID"`
|
||||
Status stock.WarehouseStatus `json:"status" v:"required|in:enable,disable#状态不能为空|状态值无效" dc:"仓库状态"`
|
||||
}
|
||||
|
||||
// DeleteWarehouseRes 删除仓库响应
|
||||
type DeleteWarehouseRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// GetWarehouseReq 获取仓库详情请求
|
||||
type GetWarehouseReq struct {
|
||||
g.Meta `path:"/getWarehouse" method:"get" tags:"仓库管理" summary:"获取仓库详情" dc:"获取仓库详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"仓库ID"`
|
||||
}
|
||||
|
||||
// GetWarehouseRes 获取仓库详情响应
|
||||
type GetWarehouseRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"仓库ID"`
|
||||
WarehouseCode string `json:"warehouseCode" dc:"仓库编码"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
Address string `json:"address" dc:"仓库地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
Status stock.WarehouseStatus `json:"status" dc:"仓库状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
ZoneCount int `json:"zoneCount" dc:"库区数量"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// ListWarehouseReq 获取仓库列表请求
|
||||
type ListWarehouseReq struct {
|
||||
g.Meta `path:"/listWarehouses" method:"get" tags:"仓库管理" summary:"获取仓库列表" dc:"分页查询仓库列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
Status *stock.WarehouseStatus `json:"status" dc:"仓库状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索(编码/名称)"`
|
||||
}
|
||||
|
||||
// ListWarehouseRes 获取仓库列表响应
|
||||
type ListWarehouseRes struct {
|
||||
List []WarehouseListItem `json:"list" dc:"仓库列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// WarehouseListItem 仓库列表项
|
||||
type WarehouseListItem struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"仓库ID"`
|
||||
WarehouseCode string `json:"warehouseCode" dc:"仓库编码"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
Address string `json:"address" dc:"仓库地址"`
|
||||
ContactPerson string `json:"contactPerson" dc:"联系人"`
|
||||
ContactPhone string `json:"contactPhone" dc:"联系电话"`
|
||||
Status stock.WarehouseStatus `json:"status" dc:"仓库状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
ZoneCount int `json:"zoneCount" dc:"库区数量"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
122
model/dto/stock/zone_dto.go
Normal file
122
model/dto/stock/zone_dto.go
Normal file
@@ -0,0 +1,122 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// CreateZoneReq 创建库区请求
|
||||
type CreateZoneReq struct {
|
||||
g.Meta `path:"/createZone" method:"post" tags:"库区管理" summary:"创建库区" dc:"创建新的库区"`
|
||||
WarehouseId string `json:"warehouseId" v:"required" dc:"仓库ID"`
|
||||
ZoneCode string `json:"zoneCode" v:"required|max-length:50#库区编码不能为空|库区编码不能超过50个字符" dc:"库区编码"`
|
||||
ZoneName string `json:"zoneName" v:"required|max-length:100#库区名称不能为空|库区名称不能超过100个字符" dc:"库区名称"`
|
||||
ZoneType stock.ZoneType `json:"zoneType" v:"required" dc:"库区类型"`
|
||||
Capacity int `json:"capacity" dc:"容量"`
|
||||
Status *stock.ZoneStatus `json:"status" dc:"库区状态(可选,默认启用)"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// CreateZoneRes 创建库区响应
|
||||
type CreateZoneRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库区ID"`
|
||||
}
|
||||
|
||||
// UpdateZoneReq 更新库区请求
|
||||
type UpdateZoneReq struct {
|
||||
g.Meta `path:"/updateZone" method:"put" tags:"库区管理" summary:"更新库区" dc:"更新库区信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库区ID"`
|
||||
WarehouseId string `json:"warehouseId" dc:"仓库ID"`
|
||||
ZoneCode string `json:"zoneCode" dc:"库区编码"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
ZoneType *stock.ZoneType `json:"zoneType" dc:"库区类型"`
|
||||
Capacity *int `json:"capacity" dc:"容量"`
|
||||
Status *stock.ZoneStatus `json:"status" dc:"库区状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// UpdateZoneRes 更新库区响应
|
||||
type UpdateZoneRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库区ID"`
|
||||
}
|
||||
|
||||
// DeleteZoneReq 删除库区请求
|
||||
type DeleteZoneReq struct {
|
||||
g.Meta `path:"/deleteZone" method:"delete" tags:"库区管理" summary:"删除库区" dc:"删除库区"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库区ID"`
|
||||
}
|
||||
|
||||
// UpdateZoneStatusReq 更新库区状态请求
|
||||
type UpdateZoneStatusReq struct {
|
||||
g.Meta `path:"/updateZoneStatus" method:"put" tags:"库区管理" summary:"更新库区状态" dc:"单独更新库区状态(启用/停用)"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库区ID"`
|
||||
Status stock.ZoneStatus `json:"status" v:"required|in:enable,disable#状态不能为空|状态值无效" dc:"库区状态"`
|
||||
}
|
||||
|
||||
// DeleteZoneRes 删除库区响应
|
||||
type DeleteZoneRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库区ID"`
|
||||
}
|
||||
|
||||
// GetZoneReq 获取库区详情请求
|
||||
type GetZoneReq struct {
|
||||
g.Meta `path:"/getZone" method:"get" tags:"库区管理" summary:"获取库区详情" dc:"获取库区详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"库区ID"`
|
||||
}
|
||||
|
||||
// GetZoneRes 获取库区详情响应
|
||||
type GetZoneRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库区ID"`
|
||||
WarehouseId string `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneCode string `json:"zoneCode" dc:"库区编码"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
ZoneType stock.ZoneType `json:"zoneType" dc:"库区类型"`
|
||||
ZoneTypeText string `json:"zoneTypeText" dc:"库区类型文本"`
|
||||
Capacity int `json:"capacity" dc:"容量"`
|
||||
Status stock.ZoneStatus `json:"status" dc:"库区状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
LocationCount int `json:"locationCount" dc:"库位数量"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// ListZoneReq 获取库区列表请求
|
||||
type ListZoneReq struct {
|
||||
g.Meta `path:"/listZones" 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列表(批量查询)"`
|
||||
ZoneType *stock.ZoneType `json:"zoneType" dc:"库区类型"`
|
||||
Status *stock.ZoneStatus `json:"status" dc:"库区状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索(编码/名称)"`
|
||||
}
|
||||
|
||||
// ListZoneRes 获取库区列表响应
|
||||
type ListZoneRes struct {
|
||||
List []ZoneListItem `json:"list" dc:"库区列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// ZoneListItem 库区列表项
|
||||
type ZoneListItem struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"库区ID"`
|
||||
WarehouseId string `json:"warehouseId" dc:"仓库ID"`
|
||||
WarehouseName string `json:"warehouseName" dc:"仓库名称"`
|
||||
ZoneCode string `json:"zoneCode" dc:"库区编码"`
|
||||
ZoneName string `json:"zoneName" dc:"库区名称"`
|
||||
ZoneType stock.ZoneType `json:"zoneType" dc:"库区类型"`
|
||||
ZoneTypeText string `json:"zoneTypeText" dc:"库区类型文本"`
|
||||
Capacity int `json:"capacity" dc:"容量"`
|
||||
Status stock.ZoneStatus `json:"status" dc:"库区状态"`
|
||||
StatusText string `json:"statusText" dc:"状态文本"`
|
||||
LocationCount int `json:"locationCount" dc:"库位数量"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
248
model/dto/sync/platform_dto.go
Normal file
248
model/dto/sync/platform_dto.go
Normal file
@@ -0,0 +1,248 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/public"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// AssetRequest 通用资产请求结构体
|
||||
type AssetRequest struct {
|
||||
ID *bson.ObjectID `json:"id" dc:"资产ID"`
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
CategoryID *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images interface{} `json:"images" dc:"图片列表"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
BasePrice float64 `json:"basePrice" dc:"基础价格"`
|
||||
SalePrice float64 `json:"salePrice" dc:"销售价格"`
|
||||
BrandID string `json:"brandId" dc:"品牌ID"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// AssetResponse 通用资产响应结构体
|
||||
type AssetResponse struct {
|
||||
ID *bson.ObjectID `json:"id" dc:"资产ID"`
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
CategoryID *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images interface{} `json:"images" dc:"图片列表"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
BasePrice float64 `json:"basePrice" dc:"基础价格"`
|
||||
SalePrice float64 `json:"salePrice" dc:"销售价格"`
|
||||
Platform string `json:"platform" dc:"平台"`
|
||||
}
|
||||
|
||||
// APIResponse 通用API响应结构体
|
||||
type APIResponse struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
ErrorCode int64 `json:"error_code,omitempty" dc:"错误码"`
|
||||
ErrorMsg string `json:"error_msg,omitempty" dc:"错误信息"`
|
||||
Data interface{} `json:"data,omitempty" dc:"响应数据"`
|
||||
}
|
||||
|
||||
// PlatformMapping 平台映射结构体
|
||||
type PlatformMapping struct {
|
||||
AssetID string `json:"asset_id" dc:"资产ID"`
|
||||
PlatformID string `json:"platform_id" dc:"平台ID"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
PlatformType string `json:"platform_type" dc:"平台类型"`
|
||||
}
|
||||
|
||||
// KuaishouAssetRequest 快手资产请求结构体
|
||||
type KuaishouAssetRequest struct {
|
||||
Title string `json:"title" dc:"商品标题"`
|
||||
CategoryID int64 `json:"category_id" dc:"分类ID"`
|
||||
MainImage string `json:"main_image" dc:"主图"`
|
||||
Images interface{} `json:"images" dc:"图片列表"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
}
|
||||
|
||||
// KuaishouAssetResponse 快手资产响应结构体
|
||||
type KuaishouAssetResponse struct {
|
||||
ItemID string `json:"item_id" dc:"商品ID"`
|
||||
Title string `json:"title" dc:"商品标题"`
|
||||
CategoryID int64 `json:"category_id" dc:"分类ID"`
|
||||
MainImage string `json:"main_image" dc:"主图"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// KuaishouSkuRequest 快手SKU请求结构体
|
||||
type KuaishouSkuRequest struct {
|
||||
SkuName string `json:"sku_name" dc:"SKU名称"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
||||
Specs interface{} `json:"specs" dc:"规格参数"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// KuaishouStockRequest 快手库存请求结构体
|
||||
type KuaishouStockRequest struct {
|
||||
SkuID string `json:"sku_id" dc:"SKU ID"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
||||
LockStockNum int64 `json:"lock_stock_num" dc:"锁定库存"`
|
||||
InTransitNum int64 `json:"in_transit_num" dc:"在途数量"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// DouyinAssetRequest 抖音资产请求结构体
|
||||
type DouyinAssetRequest struct {
|
||||
Goods struct {
|
||||
ProductName string `json:"product_name" dc:"商品名称"`
|
||||
SecCategoryID int64 `json:"sec_category_id" dc:"二级分类ID"`
|
||||
MainImg string `json:"main_img" dc:"主图"`
|
||||
Imgs interface{} `json:"imgs" dc:"图片列表"`
|
||||
DetailHTML string `json:"detail_html" dc:"详情HTML"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
DiscountPrice float64 `json:"discount_price" dc:"折扣价"`
|
||||
MobileDetail string `json:"mobile_detail" dc:"移动端详情"`
|
||||
PayType int `json:"pay_type" dc:"支付类型"`
|
||||
DeliveryInfo interface{} `json:"delivery_info" dc:"配送信息"`
|
||||
} `json:"goods" dc:"商品信息"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
}
|
||||
|
||||
// DouyinAssetResponse 抖音资产响应结构体
|
||||
type DouyinAssetResponse struct {
|
||||
GoodsID string `json:"goods_id" dc:"商品ID"`
|
||||
ProductName string `json:"product_name" dc:"商品名称"`
|
||||
SecCategoryID int64 `json:"sec_category_id" dc:"二级分类ID"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
DiscountPrice float64 `json:"discount_price" dc:"折扣价"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// DouyinSkuRequest 抖音SKU请求结构体
|
||||
type DouyinSkuRequest struct {
|
||||
SkuName string `json:"sku_name" dc:"SKU名称"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
||||
Specs interface{} `json:"specs" dc:"规格参数"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// DouyinStockRequest 抖音库存请求结构体
|
||||
type DouyinStockRequest struct {
|
||||
SkuID string `json:"sku_id" dc:"SKU ID"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
||||
LockStockNum int64 `json:"lock_stock_num" dc:"锁定库存"`
|
||||
InTransitNum int64 `json:"in_transit_num" dc:"在途数量"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// JDAssetRequest 京东资产请求结构体
|
||||
type JDAssetRequest struct {
|
||||
Product struct {
|
||||
Name string `json:"name" dc:"商品名称"`
|
||||
CategoryID string `json:"category_id" dc:"分类ID"`
|
||||
BrandID string `json:"brand_id" dc:"品牌ID"`
|
||||
MainImage string `json:"main_image" dc:"主图"`
|
||||
Images interface{} `json:"images" dc:"图片列表"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Specifications interface{} `json:"specifications" dc:"规格参数"`
|
||||
Logistics interface{} `json:"logistics" dc:"物流信息"`
|
||||
AfterSales interface{} `json:"after_sales" dc:"售后信息"`
|
||||
SupplyPrice float64 `json:"supply_price" dc:"供货价"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
} `json:"product" dc:"商品信息"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
}
|
||||
|
||||
// JDAssetResponse 京东资产响应结构体
|
||||
type JDAssetResponse struct {
|
||||
SkuID string `json:"sku_id" dc:"SKU ID"`
|
||||
WareID string `json:"ware_id" dc:"商品ID"`
|
||||
ProductName string `json:"product_name" dc:"商品名称"`
|
||||
CategoryID string `json:"category_id" dc:"分类ID"`
|
||||
SupplyPrice float64 `json:"supply_price" dc:"供货价"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
ExternalID string `json:"external_id" dc:"外部ID"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// JDSkuRequest 京东SKU请求结构体
|
||||
type JDSkuRequest struct {
|
||||
SkuName string `json:"sku_name" dc:"SKU名称"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
StockNum int64 `json:"stock_num" dc:"库存数量"`
|
||||
Specification string `json:"specification" dc:"规格"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// JDStockRequest 京东库存请求结构体
|
||||
type JDStockRequest struct {
|
||||
SkuID string `json:"sku_id" dc:"SKU ID"`
|
||||
OuterSkuID string `json:"outer_sku_id" dc:"外部SKU ID"`
|
||||
Quantity int64 `json:"quantity" dc:"库存数量"`
|
||||
LockQuantity int64 `json:"lock_quantity" dc:"锁定库存"`
|
||||
InTransit int64 `json:"in_transit" dc:"在途数量"`
|
||||
Location string `json:"location" dc:"仓库位置"`
|
||||
SyncPlatform string `json:"sync_platform" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// PinduoduoAssetRequest 拼多多资产请求结构体
|
||||
type PinduoduoAssetRequest struct {
|
||||
GoodsID string `json:"goods_id" dc:"商品ID"`
|
||||
GoodsName string `json:"goods_name" dc:"商品名称"`
|
||||
GoodsDesc string `json:"goods_desc" dc:"商品描述"`
|
||||
CatID string `json:"cat_id" dc:"分类ID"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
GoodsImageURL string `json:"goods_image_url" dc:"商品主图"`
|
||||
GoodsGalleryURLs interface{} `json:"goods_gallery_urls" dc:"商品轮播图"`
|
||||
}
|
||||
|
||||
// PinduoduoAssetResponse 拼多多资产响应结构体
|
||||
type PinduoduoAssetResponse struct {
|
||||
GoodsID string `json:"goods_id" dc:"商品ID"`
|
||||
GoodsName string `json:"goods_name" dc:"商品名称"`
|
||||
GoodsDesc string `json:"goods_desc" dc:"商品描述"`
|
||||
CatID string `json:"cat_id" dc:"分类ID"`
|
||||
MarketPrice float64 `json:"market_price" dc:"市场价"`
|
||||
GoodsImageURL string `json:"goods_image_url" dc:"商品主图"`
|
||||
}
|
||||
|
||||
// SkuRequest 通用SKU请求结构体
|
||||
type SkuRequest struct {
|
||||
ID string `json:"id" dc:"SKU ID"`
|
||||
SkuCode string `json:"skuCode" dc:"SKU编码"`
|
||||
Price float64 `json:"price" dc:"价格"`
|
||||
Stock int64 `json:"stock" dc:"库存"`
|
||||
Specification interface{} `json:"specification" dc:"规格"`
|
||||
}
|
||||
|
||||
// StockRequest 通用库存请求结构体
|
||||
type StockRequest struct {
|
||||
ID string `json:"id" dc:"库存ID"`
|
||||
AssetSkuID string `json:"assetSkuId" dc:"资产SKU ID"`
|
||||
AvailableQty int64 `json:"availableQty" dc:"可用数量"`
|
||||
LockedQty int64 `json:"lockedQty" dc:"锁定数量"`
|
||||
InTransitQty int64 `json:"inTransitQty" dc:"在途数量"`
|
||||
Location string `json:"location" dc:"位置"`
|
||||
}
|
||||
|
||||
// SyncResult 同步结果结构体
|
||||
type SyncResult struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
Message string `json:"message" dc:"消息"`
|
||||
Data interface{} `json:"data" dc:"数据"`
|
||||
Platform consts.SyncPlatform `json:"platform" dc:"平台"`
|
||||
ExternalID string `json:"external_id,omitempty" dc:"外部ID"`
|
||||
}
|
||||
142
model/dto/sync/sync_dto.go
Normal file
142
model/dto/sync/sync_dto.go
Normal file
@@ -0,0 +1,142 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/public"
|
||||
|
||||
"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"
|
||||
)
|
||||
|
||||
// CreateSyncTaskReq 创建同步任务请求
|
||||
type CreateSyncTaskReq struct {
|
||||
g.Meta `path:"/createSyncTask" method:"post" tags:"同步任务" summary:"创建同步任务" dc:"创建新的同步任务"`
|
||||
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
SyncType consts.SyncType `json:"syncType" v:"required" dc:"同步类型:full全量/incremental增量"`
|
||||
AssetID *bson.ObjectID `json:"assetId,omitempty" dc:"资产ID"`
|
||||
AssetSKUID *bson.ObjectID `json:"assetSkuId,omitempty" dc:"资产SKU ID"`
|
||||
StockID *bson.ObjectID `json:"stockId,omitempty" dc:"库存ID"`
|
||||
}
|
||||
|
||||
// CreateSyncTaskRes 创建同步任务响应
|
||||
type CreateSyncTaskRes struct {
|
||||
TaskID *bson.ObjectID `json:"taskId" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// ListSyncTaskReq 同步任务列表请求
|
||||
type ListSyncTaskReq struct {
|
||||
g.Meta `path:"/listSyncTasks" method:"get" tags:"同步任务" summary:"获取同步任务列表" dc:"分页查询同步任务列表,支持多条件筛选"`
|
||||
beans.Page
|
||||
Platform consts.SyncPlatform `json:"platform,omitempty" dc:"同步平台"`
|
||||
Status consts.SyncStatus `json:"status,omitempty" dc:"同步状态"`
|
||||
StartTime *gtime.Time `json:"startTime,omitempty" dc:"开始时间"`
|
||||
EndTime *gtime.Time `json:"endTime,omitempty" dc:"结束时间"`
|
||||
}
|
||||
|
||||
// ListSyncTaskRes 同步任务列表响应
|
||||
type ListSyncTaskRes struct {
|
||||
List []*SyncTaskItem `json:"list" dc:"同步任务列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// SyncTaskItem 同步任务项
|
||||
type SyncTaskItem struct {
|
||||
ID *bson.ObjectID `json:"id" dc:"任务ID"`
|
||||
Platform consts.SyncPlatform `json:"platform" dc:"同步平台"`
|
||||
SyncType consts.SyncType `json:"syncType" dc:"同步类型"`
|
||||
Status consts.SyncStatus `json:"status" dc:"同步状态"`
|
||||
AssetID *bson.ObjectID `json:"assetId,omitempty" dc:"资产ID"`
|
||||
AssetSKUID *bson.ObjectID `json:"assetSkuId,omitempty" dc:"资产SKU ID"`
|
||||
StockID *bson.ObjectID `json:"stockId,omitempty" dc:"库存ID"`
|
||||
ErrorMessage string `json:"errorMessage,omitempty" dc:"错误信息"`
|
||||
ErrorCount int `json:"errorCount" dc:"错误次数"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
StartedAt *gtime.Time `json:"startedAt,omitempty" dc:"开始时间"`
|
||||
FinishedAt *gtime.Time `json:"finishedAt,omitempty" dc:"完成时间"`
|
||||
}
|
||||
|
||||
// GetSyncTaskReq 获取同步任务详情请求
|
||||
type GetSyncTaskReq struct {
|
||||
g.Meta `path:"/getSyncTask" method:"get" tags:"同步任务" summary:"获取同步任务详情" dc:"获取同步任务详情"`
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// GetSyncTaskRes 获取同步任务详情响应
|
||||
type GetSyncTaskRes struct {
|
||||
SyncTaskItem
|
||||
}
|
||||
|
||||
// UpdateSyncTaskStatusReq 更新同步任务状态请求
|
||||
type UpdateSyncTaskStatusReq struct {
|
||||
g.Meta `path:"/updateSyncTaskStatus" method:"put" tags:"同步任务" summary:"更新同步任务状态" dc:"更新同步任务状态"`
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"任务ID"`
|
||||
Status consts.SyncStatus `json:"status" v:"required" dc:"同步状态"`
|
||||
ErrorMessage string `json:"errorMessage,omitempty" dc:"错误信息"`
|
||||
}
|
||||
|
||||
// SyncAssetReq 同步资产请求
|
||||
type SyncAssetReq struct {
|
||||
g.Meta `path:"/syncAsset" method:"post" tags:"资产同步" summary:"同步资产" dc:"同步资产到指定平台"`
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
AssetID *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// SyncAssetRes 同步资产响应
|
||||
type SyncAssetRes struct {
|
||||
TaskID *bson.ObjectID `json:"taskId" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// SyncAssetSkuReq 同步资产SKU请求
|
||||
type SyncAssetSkuReq struct {
|
||||
g.Meta `path:"/syncAssetSku" method:"post" tags:"SKU同步" summary:"同步资产SKU" dc:"同步资产SKU到指定平台"`
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
AssetSKUID *bson.ObjectID `json:"assetSkuId" v:"required" dc:"资产SKU ID"`
|
||||
}
|
||||
|
||||
// SyncAssetSkuRes 同步资产SKU响应
|
||||
type SyncAssetSkuRes struct {
|
||||
TaskID *bson.ObjectID `json:"taskId" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// SyncStockReq 同步库存请求
|
||||
type SyncStockReq struct {
|
||||
g.Meta `path:"/syncStock" method:"post" tags:"库存同步" summary:"同步库存" dc:"同步库存到指定平台"`
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
StockID *bson.ObjectID `json:"stockId" v:"required" dc:"库存ID"`
|
||||
}
|
||||
|
||||
// SyncStockRes 同步库存响应
|
||||
type SyncStockRes struct {
|
||||
TaskID *bson.ObjectID `json:"taskId" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// BatchSyncAssetsReq 批量同步资产请求
|
||||
type BatchSyncAssetsReq struct {
|
||||
g.Meta `path:"/batchSyncAssets" method:"post" tags:"批量同步" summary:"批量同步资产" dc:"批量同步资产到指定平台"`
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
AssetIDs []*bson.ObjectID `json:"assetIds" v:"required" dc:"资产ID列表"`
|
||||
}
|
||||
|
||||
// BatchSyncAssetsRes 批量同步资产响应
|
||||
type BatchSyncAssetsRes struct {
|
||||
TaskIDs []*bson.ObjectID `json:"taskIds" dc:"任务ID列表"`
|
||||
}
|
||||
|
||||
// GetPlatformSyncStatusReq 获取平台同步状态请求
|
||||
type GetPlatformSyncStatusReq struct {
|
||||
g.Meta `path:"/getPlatformSyncStatus" method:"get" tags:"平台状态" summary:"获取平台同步状态" dc:"获取指定平台的同步状态"`
|
||||
Platform consts.SyncPlatform `json:"platform" v:"required" dc:"同步平台"`
|
||||
}
|
||||
|
||||
// GetPlatformSyncStatusRes 获取平台同步状态响应
|
||||
type GetPlatformSyncStatusRes struct {
|
||||
Platform consts.SyncPlatform `json:"platform" dc:"同步平台"`
|
||||
IsEnabled bool `json:"isEnabled" dc:"是否启用"`
|
||||
LastSyncTime *gtime.Time `json:"lastSyncTime,omitempty" dc:"最后同步时间"`
|
||||
NextSyncTime *gtime.Time `json:"nextSyncTime,omitempty" dc:"下次同步时间"`
|
||||
SyncCount int64 `json:"syncCount" dc:"同步次数"`
|
||||
SuccessCount int64 `json:"successCount" dc:"成功次数"`
|
||||
FailedCount int64 `json:"failedCount" dc:"失败次数"`
|
||||
}
|
||||
Reference in New Issue
Block a user