From 0e10dab1affe2253d56d06b50226bc1e06437cda Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 21 Sep 2026 16:13:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(shipment):=20=E6=9B=B4=E6=96=B0=E6=8A=A5?= =?UTF-8?q?=E5=85=B3=E4=BA=A7=E5=93=81=E6=8E=A5=E5=8F=A3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 ReplyCustomsProductItem 结构体,扩展 SaleProductItem 并增加报关产品字段 - 修改 Products 方法返回类型为 ReplyCustomsProductItem 切片 - 新增 ArgsCustomsProductsEdit 和 CustomsProduct 结构体用于产品编辑 - 添加 ProductsEdit 方法支持报关产品的批量编辑功能 - 在 ProductsEdit 中增加海关单位、海关数量等字段映射 --- erp/shipment/customs.go | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/erp/shipment/customs.go b/erp/shipment/customs.go index 6bd47a0..e1e4c24 100644 --- a/erp/shipment/customs.go +++ b/erp/shipment/customs.go @@ -77,8 +77,15 @@ func (c *customs) Info(ctx context.Context, customsId int64) (reply ReplyCustoms return } +type ReplyCustomsProductItem struct { + SaleProductItem + CustomsProductId int64 `json:"customsProductId"` + HsUnit string `json:"hsUnit"` + HsNum *int64 `json:"hsNum"` +} + // Products @TITLE 获取产品 -func (c *customs) Products(ctx context.Context, customsId int64) (reply []SaleProductItem, err error) { +func (c *customs) Products(ctx context.Context, customsId int64) (reply []ReplyCustomsProductItem, err error) { xClient, err := client.GetClient(c) if err != nil { return @@ -87,6 +94,27 @@ func (c *customs) Products(ctx context.Context, customsId int64) (reply []SalePr return } +type ArgsCustomsProductsEdit struct { + CustomsId int64 + Products []CustomsProduct +} +type CustomsProduct struct { + CustomsProductId int64 // 报关产品id + HsUnit string // 海关单位 + HsNum *int64 // 海关数量 +} + +// ProductsEdit @TITLE 产品编辑 +func (c *customs) ProductsEdit(ctx context.Context, args ArgsCustomsProductsEdit) (err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "ProductsEdit", args, &reply) + return +} + // Gifts @TITLE 获取赠品 func (c *customs) Gifts(ctx context.Context, customsId int64) (reply []GiftItem, err error) { xClient, err := client.GetClient(c)