diff --git a/customer/batchSku/batchSku.go b/customer/batchSku/batchSku.go index d4eea51..c90075b 100644 --- a/customer/batchSku/batchSku.go +++ b/customer/batchSku/batchSku.go @@ -1,8 +1,10 @@ package batchSku type BatchSku struct { - Banner banner - Type skuType - Sale sale - Item item + Banner banner + Type skuType + Sale sale + Item item + HotType skuHotType + HotItem hotItem } diff --git a/customer/batchSku/hotItem.go b/customer/batchSku/hotItem.go new file mode 100644 index 0000000..bb5a484 --- /dev/null +++ b/customer/batchSku/hotItem.go @@ -0,0 +1,96 @@ +package batchSku + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +type hotItem struct { +} + +type ReplySkuHotItemHandle struct { + SkuId uint `json:"skuId"` + Error string `json:"error"` +} + +type ArgsSkuHotItemAdd struct { + SkuTypeId uint + SkuIds []uint +} + +// Add @Title 添加商品 +func (i *hotItem) Add(ctx context.Context, args ArgsSkuHotItemAdd) (reply []ReplySkuHotItemHandle, err error) { + xClient, err := client.GetClient(i) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "Add", args, &reply) + return +} + +type ArgsSkuHotItemDel struct { + SkuTypeId uint + SkuIds []uint +} + +// Del @Title 删除商品 +func (i *hotItem) Del(ctx context.Context, args ArgsSkuHotItemDel) error { + xClient, err := client.GetClient(i) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Del", args, &reply) +} + +type ArgsSkuHotItemLists struct { + SkuTypeId uint + SkuId uint + Page bean.Page +} + +type ReplySkuHotItemLists struct { + Total int64 `json:"total"` + Lists []SkuHotItem `json:"lists"` +} + +type SkuHotItem struct { + Id uint `json:"id"` + SkuId uint `json:"skuId"` +} + +// Lists @Title 商品列表 +func (i *hotItem) Lists(ctx context.Context, args ArgsSkuHotItemLists) (reply ReplySkuHotItemLists, err error) { + xClient, err := client.GetClient(i) + if err != nil { + return ReplySkuHotItemLists{}, err + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +// DelAll @Title 删除全部商品 +func (i *hotItem) DelAll(ctx context.Context, skuTypeId uint) error { + xClient, err := client.GetClient(i) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "DelAll", skuTypeId, &reply) +} + +type ArgsBySkuHotIds struct { + SkuIds []uint + SkuTypeId uint +} + +// FindBySkuIds @Title 根据SkuId查询数据 +func (i *hotItem) FindBySkuIds(ctx context.Context, args ArgsBySkuHotIds) (reply []SkuHotItem, err error) { + xClient, err := client.GetClient(i) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "FindBySkuIds", args, &reply) + return +} diff --git a/customer/batchSku/hotType.go b/customer/batchSku/hotType.go new file mode 100644 index 0000000..17875e2 --- /dev/null +++ b/customer/batchSku/hotType.go @@ -0,0 +1,60 @@ +package batchSku + +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + +type skuHotType struct { +} + +type ArgsSkuHotTypeEdit struct { + Id uint + Name string +} + +// Edit @Title 编辑分类 +func (s *skuHotType) Edit(ctx context.Context, args ArgsSkuHotTypeEdit) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Edit", args, &reply) +} + +// Add @Title 添加分类 +func (s *skuHotType) Add(ctx context.Context, name string) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Add", name, &reply) +} + +// Del @Title 删除分类 +func (s *skuHotType) Del(ctx context.Context, id uint) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Del", id, &reply) +} + +type HotTypeItem struct { + Id uint `json:"id"` + Name string `json:"name"` +} + +// All @Title 全部分类 +func (s *skuHotType) All(ctx context.Context) (reply []HotTypeItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + args := 0 + err = xClient.Call(ctx, "All", args, &reply) + return +} diff --git a/wholesale/channel/sku.go b/wholesale/channel/sku.go index e8dc048..10d7d0b 100644 --- a/wholesale/channel/sku.go +++ b/wholesale/channel/sku.go @@ -11,6 +11,14 @@ import ( type sku struct { } +const ( + SkuOrderTypePrice = 1 // 价格排序 + SkuOrderTypeDiscount = 2 // 价格折扣 + + SkuOrderSortUp = 1 // 升序 + SkuOrderSortDown = 2 // 降序 +) + type SkuSearch struct { Status uint // 1=上架 2=下架 SkuName string // 商品名称 @@ -19,40 +27,44 @@ type ArgsSkuList struct { Search SkuSearch Page bean.Page } +type SkuItemHighlight struct { + Name string `json:"name"` +} type SkuItem struct { - Id uint `json:"id"` - Name string `json:"name"` - BrandId uint `json:"brandId"` - BrandName string `json:"brandName"` - FirstCategoryId uint `json:"firstCategoryId"` - FirstCategoryName string `json:"firstCategoryName"` - SecondCategoryId uint `json:"secondCategoryId"` - SecondCategoryName string `json:"secondCategoryName"` - ThirdCategoryId uint `json:"thirdCategoryId"` - ThirdCategoryName string `json:"thirdCategoryName"` - Price decimal.Decimal `json:"price"` - Discount decimal.Decimal `json:"discount"` - GuidePrice decimal.Decimal `json:"guidePrice"` - ImgUrl string `json:"imgUrl"` - Profit decimal.Decimal `json:"profit"` - Size string `json:"size"` - Color string `json:"color"` - Tax string `json:"tax"` - Unit string `json:"unit"` - UpcCode string `json:"upcCode"` - TaxName string `json:"taxName"` - TaxCode string `json:"taxCode"` - Status uint `json:"status"` - Length decimal.Decimal `json:"length"` // 长 - Width decimal.Decimal `json:"width"` // 宽 - Height decimal.Decimal `json:"height"` // 高 - Weight decimal.Decimal `json:"weight"` // 重 - PackingRate uint `json:"packingRate"` // 装箱率 - StartingBatch uint `json:"startingBatch"` // 起批量 - InitialFreight decimal.Decimal `json:"initialFreight"` // 起批运费 - CreatedAt int64 `json:"createdAt"` - UpdatedAt int64 `json:"updatedAt"` + Id uint `json:"id"` + Name string `json:"name"` + BrandId uint `json:"brandId"` + BrandName string `json:"brandName"` + FirstCategoryId uint `json:"firstCategoryId"` + FirstCategoryName string `json:"firstCategoryName"` + SecondCategoryId uint `json:"secondCategoryId"` + SecondCategoryName string `json:"secondCategoryName"` + ThirdCategoryId uint `json:"thirdCategoryId"` + ThirdCategoryName string `json:"thirdCategoryName"` + Price decimal.Decimal `json:"price"` + Discount decimal.Decimal `json:"discount"` + GuidePrice decimal.Decimal `json:"guidePrice"` + ImgUrl string `json:"imgUrl"` + Profit decimal.Decimal `json:"profit"` + Size string `json:"size"` + Color string `json:"color"` + Tax string `json:"tax"` + Unit string `json:"unit"` + UpcCode string `json:"upcCode"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` + Status uint `json:"status"` + Length decimal.Decimal `json:"length"` // 长 + Width decimal.Decimal `json:"width"` // 宽 + Height decimal.Decimal `json:"height"` // 高 + Weight decimal.Decimal `json:"weight"` // 重 + PackingRate uint `json:"packingRate"` // 装箱率 + StartingBatch uint `json:"startingBatch"` // 起批量 + InitialFreight decimal.Decimal `json:"initialFreight"` // 起批运费 + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` + Highlight SkuItemHighlight `json:"highlight"` } type ReplySkuList struct { @@ -87,7 +99,15 @@ type SkuEsSearch struct { MinDiscount decimal.Decimal // 最低折扣 MaxDiscount decimal.Decimal // 最高折扣 Expand []map[string]interface{} // 拓展查询 - CustomerSearch CustomerSearch // 客户筛选条件 + CustomerSearch string // 客户系统搜索参数 + MinGuidePrice decimal.Decimal // 市场参考价 + MaxGuidePrice decimal.Decimal // 市场参考价 + Source uint // 所属供应商 + ThirdCategoryIds []uint // 三级分类Ids + TagIds []uint // 标签Ids + + OrderType uint // 排序类型 + OrderSort uint // 排序顺序 } type CustomerSearch struct { @@ -96,8 +116,13 @@ type CustomerSearch struct { BrandName string } +type SkuEsConfig struct { + Highlight bool +} + type ArgsSkuListsEs struct { Search SkuEsSearch + Config SkuEsConfig Page bean.Page }