From d05ca78fd59fc3920420004c361ceb3e65a2eda3 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 6 Apr 2023 11:44:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/batchSku/batchSku.go | 10 ++-- customer/batchSku/hotItem.go | 96 +++++++++++++++++++++++++++++++++++ customer/batchSku/hotType.go | 60 ++++++++++++++++++++++ 3 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 customer/batchSku/hotItem.go create mode 100644 customer/batchSku/hotType.go 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 +} From a6864087b0cfa9e3cef33727f95a82d5b4deebdb Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 6 Apr 2023 11:51:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=B9=E5=8F=91?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/channel/sku.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/wholesale/channel/sku.go b/wholesale/channel/sku.go index e8dc048..6f92044 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 // 商品名称 @@ -87,7 +95,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 { From 77a16f04c0f314d6e0fa9a344997f5f78c1be0e3 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 6 Apr 2023 13:20:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=B9=E5=8F=91?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/channel/sku.go | 73 ++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/wholesale/channel/sku.go b/wholesale/channel/sku.go index 6f92044..10d7d0b 100644 --- a/wholesale/channel/sku.go +++ b/wholesale/channel/sku.go @@ -27,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 { @@ -112,8 +116,13 @@ type CustomerSearch struct { BrandName string } +type SkuEsConfig struct { + Highlight bool +} + type ArgsSkuListsEs struct { Search SkuEsSearch + Config SkuEsConfig Page bean.Page }