feat(采购): 新增批次相关功能
- 在 product 服务中添加 BatchCount 方法,用于获取产品批次数量信息 - 在 purchase服务中添加 Batch 方法,用于获取采购合同的批次数据 - 更新 Purchase 结构,将 Batch 字段改为 Batches - 在 ArgsPurchaseEdit 结构中添加 BatchNo 字段,用于编辑批次号
This commit is contained in:
@@ -142,3 +142,23 @@ func (p *product) ListAccounting(ctx context.Context, args ArgsListAccounting) (
|
||||
err = xClient.Call(ctx, "ListAccounting", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ProductBatchCountItem struct {
|
||||
PurchaseProductId int64 `json:"purchaseProductId"`
|
||||
SaleCount int64 `json:"saleCount"`
|
||||
Batches []ProductBatchItem `json:"batch"`
|
||||
}
|
||||
type ProductBatchItem struct {
|
||||
BatchNo int64 `json:"batchNo"`
|
||||
PurchaseCount int64 `json:"purchaseCount"`
|
||||
}
|
||||
|
||||
// BatchCount @TITLE 批次数量
|
||||
func (p *product) BatchCount(ctx context.Context, purchaseProductIds []int64) (reply []ProductBatchCountItem, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "BatchCount", purchaseProductIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user