资产增加批次库存管理模式

This commit is contained in:
2026-01-04 12:20:45 +08:00
parent 1ce24a84cd
commit 30eb8bcf89
3 changed files with 69 additions and 15 deletions

View File

@@ -32,9 +32,19 @@ type OrderItemReq struct {
// OrderItemStockReq 创建订单商品项库存明细请求
type OrderItemStockReq struct {
StockID string `json:"stock_id" binding:"required"` // 库存ID
Price int64 `json:"price" binding:"required,min=1"` // 单价(分)
StockAttrs map[string]interface{} `json:"stock_attrs"` // 库存项属性(动态字段
// 库存ID(明细模式必填,批次模式为空)
StockID string `json:"stock_id,omitempty"` // 库存ID
// 批次信息(批次模式必填,明细模式为空
BatchID string `json:"batch_id,omitempty"` // 批次ID
BatchNo string `json:"batch_no,omitempty"` // 批次号
// 数量
Quantity int `json:"quantity" binding:"required,min=1"` // 使用数量
// 价格信息
Price int64 `json:"price" binding:"required,min=1"` // 单价(分)
// 库存管理模式
StockMode int `json:"stock_mode" binding:"required"` // 库存管理模式1-明细模式2-批次模式
// 库存项属性
StockAttrs map[string]interface{} `json:"stock_attrs"` // 库存项属性(动态字段)
}
// ShippingInfoReq 收货信息请求
@@ -136,8 +146,18 @@ type OrderItem struct {
// OrderItemStock 订单商品项库存明细(响应)
type OrderItemStock struct {
StockID string `json:"stock_id"` // 库存ID
Price int64 `json:"price"` // 单价(分)
// 库存ID(明细模式)
StockID string `json:"stock_id,omitempty"` // 库存ID
// 批次信息(批次模式)
BatchID string `json:"batch_id,omitempty"` // 批次ID
BatchNo string `json:"batch_no,omitempty"` // 批次号
// 数量
Quantity int `json:"quantity"` // 使用数量
// 价格信息
Price int64 `json:"price"` // 单价(分)
// 库存管理模式
StockMode int `json:"stock_mode"` // 库存管理模式1-明细模式2-批次模式
// 库存项属性
StockAttrs map[string]interface{} `json:"stock_attrs"` // 库存项属性(动态字段)
}