feat(shipment): 更新报关产品接口功能
- 添加 ReplyCustomsProductItem 结构体,扩展 SaleProductItem 并增加报关产品字段 - 修改 Products 方法返回类型为 ReplyCustomsProductItem 切片 - 新增 ArgsCustomsProductsEdit 和 CustomsProduct 结构体用于产品编辑 - 添加 ProductsEdit 方法支持报关产品的批量编辑功能 - 在 ProductsEdit 中增加海关单位、海关数量等字段映射
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user