package mixed import ( "context" "git.kumo.work/shama/service/client" "github.com/shopspring/decimal" ) type box struct { } type BoxItem struct { Id int64 `json:"id"` Serial string `json:"serial"` CustomSerial string `json:"customSerial"` Po string `json:"po"` BlEngName string `json:"blEngName"` InnerNum int64 `json:"innerNum"` OuterBoxCount int64 `json:"outerBoxCount"` Length decimal.Decimal `json:"length"` Width decimal.Decimal `json:"width"` Height decimal.Decimal `json:"height"` Volume decimal.Decimal `json:"volume"` TotalVolume decimal.Decimal `json:"totalVolume"` OuterNum int64 `json:"outerNum"` Products []BoxProduct `json:"products"` } type BoxProduct struct { Id int64 `json:"id"` ShipmentProductId int64 `json:"shipmentProductId"` Serial string `json:"serial"` CustomSerial string `json:"customSerial"` Po string `json:"po"` Name string `json:"name"` BlEngName string `json:"blEngName"` ShipmentCount int64 `json:"shipmentCount"` OuterNum int64 `json:"outerNum"` OuterBoxCount int64 `json:"outerBoxCount"` } // All @TITLE 获取全部混装 func (b *box) All(ctx context.Context, mixedId int64) (reply []BoxItem, err error) { xClient, err := client.GetClient(b) if err != nil { return } err = xClient.Call(ctx, "All", mixedId, &reply) return } type ArgsBoxAdd struct { MixedId int64 // 混装单id BoxAdd } type BoxAdd struct { Serial string // 货号 CustomSerial string // 客户货号 Po string // PO BlEngName string // 提单英文名 InnerNum int64 // 内盒入数 OuterBoxCount int64 // 箱数 Length decimal.Decimal // 长 Width decimal.Decimal // 宽 Height decimal.Decimal // 高 Volume decimal.Decimal // 体积 TotalVolume decimal.Decimal // 总体积 OuterNum int64 // 外箱入数 Products []BoxProductItem // 箱内商品 } type BoxProductItem struct { ShipmentProductId int64 // 订舱产品id OuterNum int64 // 外箱入数 } // Add @TITLE 添加费用 func (b *box) Add(ctx context.Context, args ArgsBoxAdd) (err error) { xClient, err := client.GetClient(b) if err != nil { return } reply := 0 return xClient.Call(ctx, "Add", args, &reply) } type ArgsBoxEdit struct { BoxId int64 // 混装单id BoxAdd } // Edit @TITLE 编辑 func (b *box) Edit(ctx context.Context, args ArgsBoxEdit) (err error) { xClient, err := client.GetClient(b) if err != nil { return } reply := 0 return xClient.Call(ctx, "Edit", args, &reply) } // Delete @TITLE 删除 func (b *box) Delete(ctx context.Context, boxId int64) (err error) { xClient, err := client.GetClient(b) if err != nil { return } reply := 0 return xClient.Call(ctx, "Delete", boxId, &reply) }