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

78 lines
4.2 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 int64 `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 int64 `json:"assetId"`
AssetSkuId int64 `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 int64 `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:"备注"`
}