From 59638f6042ef1b2dd26e6fc86b685efbde4e0773 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 21 Feb 2023 11:35:11 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/setting/setting.go | 1 + supply/setting/tag.go | 113 ++++++++++++++++++++++++++++++++++++++ supply/skuTag.go | 38 +++++++++++++ supply/supply.go | 1 + 4 files changed, 153 insertions(+) create mode 100644 supply/setting/tag.go create mode 100644 supply/skuTag.go diff --git a/supply/setting/setting.go b/supply/setting/setting.go index 50e35c9..272055c 100644 --- a/supply/setting/setting.go +++ b/supply/setting/setting.go @@ -2,4 +2,5 @@ package setting type Setting struct { Rate rate + Tag tag } diff --git a/supply/setting/tag.go b/supply/setting/tag.go new file mode 100644 index 0000000..0568efc --- /dev/null +++ b/supply/setting/tag.go @@ -0,0 +1,113 @@ +package setting + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +type tag struct { +} + +type ArgsTagList struct { + Search TagSearch + Page bean.Page +} + +type TagItem struct { + Id uint `json:"id"` + Name string `json:"name"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` +} +type ReplyTagList struct { + Lists []TagItem `json:"lists"` + Total int64 `json:"total"` +} + +type TagSearch struct { + Name string // 标签名称 +} + +// Lists @Title 标签列表 +func (b *tag) Lists(ctx context.Context, args ArgsTagList) (result ReplyTagList, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &result) + return +} + +// All @Title 全部标签 +func (b *tag) All(ctx context.Context) (result []TagItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "All", 0, &result) + return +} + +// FindByNameAll @Title 标签名称筛选标签 +func (b *tag) FindByNameAll(ctx context.Context, name string) (result []TagItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByNameAll", name, &result) + return +} + +type ArgsTagAdd struct { + Name string // 标签名称 +} + +// Add @Title 添加标签 +func (b *tag) Add(ctx context.Context, args ArgsTagAdd) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Add", args, &reply) +} + +// Adds @Title 添加标签 +func (b *tag) Adds(ctx context.Context, tagNames []string) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Adds", tagNames, &reply) +} + +type ArgsTagEdit struct { + TagId uint // 标签id + Name string // 标签名称 +} + +// Edit @Title 编辑标签 +func (b *tag) Edit(ctx context.Context, args ArgsTagEdit) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Edit", args, &reply) +} + +type ArgsTagFindByIds struct { + TagIds []uint // 标签id数组 +} + +// FindByIds @Title 标签获取 +func (b *tag) FindByIds(ctx context.Context, args ArgsTagFindByIds) (result []TagItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByIds", args, &result) + return +} diff --git a/supply/skuTag.go b/supply/skuTag.go new file mode 100644 index 0000000..cd99988 --- /dev/null +++ b/supply/skuTag.go @@ -0,0 +1,38 @@ +package supply + +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + +type skuTag struct { +} +type ArgsSkuTagAdds struct { + SkuIds []uint // skuIds + TagIds []uint // tagIds +} + +// Adds @Title 添加标签 +func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Adds", args, &reply) +} + +type ArgsSkuTagDel struct { + SkuId uint // skuId + TagIds []uint // tagIds +} + +// Del @Title 删除标签 +func (s *skuTag) Del(ctx context.Context, args ArgsSkuTagDel) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Del", args, &reply) +} diff --git a/supply/supply.go b/supply/supply.go index 0686fc6..66373ad 100644 --- a/supply/supply.go +++ b/supply/supply.go @@ -15,4 +15,5 @@ type Supply struct { Order order Source sourceRpc AfterService afterService + SkuTag skuTag } From 29154949dd656e39d6de393f07a44b035b92e3f6 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 21 Feb 2023 14:16:45 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/sku.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 551335f..57ea7d7 100644 --- a/supply/channel/sku.go +++ b/supply/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 // 商品名称 @@ -85,6 +93,9 @@ type SkuEsSearch struct { MaxGuidePrice decimal.Decimal // 市场参考价 Source uint // 所属供应商 ThirdCategoryIds []uint // 三级分类Ids + + OrderType uint // 排序类型 + OrderSort uint // 排序顺序 } type ArgsSkuListsEs struct { Search SkuEsSearch From f77dc6c64bddda5e078a3bd662c9a2f5cbf35dce Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 22 Feb 2023 10:15:50 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=94=AE=E5=90=8E=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supply/afterService.go b/supply/afterService.go index 74cc598..6599b80 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -229,6 +229,9 @@ type ReplyAfterServiceDetail struct { SendAt int64 `json:"sendAt"` PackageSend uint `json:"packageSend"` AfsPackageSend AfsPackageSend `json:"afsPackageSend"` + OrderSubSn uint64 `json:"orderSubSn"` + SourceId uint `json:"sourceId"` + ChannelId uint `json:"channelId"` } type AfsPackageSend struct { Name string `json:"name"` From b162c6d421ca85475d52e28803c1de40000071c1 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 23 Feb 2023 09:28:36 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/skuTag.go | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/supply/skuTag.go b/supply/skuTag.go index cd99988..30cf199 100644 --- a/supply/skuTag.go +++ b/supply/skuTag.go @@ -3,16 +3,17 @@ package supply import ( "context" "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" ) type skuTag struct { } type ArgsSkuTagAdds struct { SkuIds []uint // skuIds - TagIds []uint // tagIds + TagId uint // tagId } -// Adds @Title 添加标签 +// Adds @Title 添加商品 func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { reply := 0 xClient, err := client.GetClient(s) @@ -23,16 +24,42 @@ func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { } type ArgsSkuTagDel struct { - SkuId uint // skuId - TagIds []uint // tagIds + SkuIds []uint // skuIds + TagId []uint // tagId } -// Del @Title 删除标签 -func (s *skuTag) Del(ctx context.Context, args ArgsSkuTagDel) error { +// Dels @Title 删除商品 +func (s *skuTag) Dels(ctx context.Context, args ArgsSkuTagDel) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { return err } - return xClient.Call(ctx, "Del", args, &reply) + return xClient.Call(ctx, "Dels", args, &reply) +} + +type ArgsTagSkuLists struct { + TagId uint + Page bean.Page +} + +type TagSkuItem struct { + Id uint `json:"id"` + SkuId uint `json:"skuId"` + SkuName string `json:"skuName"` +} + +type ReplyTagSkuLists struct { + Total int64 `json:"total"` + Lists []TagSkuItem `json:"lists"` +} + +// SkuLists @Title 标签商品列表 +func (s *skuTag) SkuLists(ctx context.Context, args ArgsTagSkuLists) (reply ReplyTagSkuLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "SkuLists", args, &reply) + return } From 435884afbbb89168bfba5c34eee9054fafef38e2 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 23 Feb 2023 09:37:54 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/skuTag.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supply/skuTag.go b/supply/skuTag.go index 30cf199..215bdc8 100644 --- a/supply/skuTag.go +++ b/supply/skuTag.go @@ -23,13 +23,13 @@ func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error { return xClient.Call(ctx, "Adds", args, &reply) } -type ArgsSkuTagDel struct { +type ArgsSkuTagDels struct { SkuIds []uint // skuIds - TagId []uint // tagId + TagId uint // tagId } // Dels @Title 删除商品 -func (s *skuTag) Dels(ctx context.Context, args ArgsSkuTagDel) error { +func (s *skuTag) Dels(ctx context.Context, args ArgsSkuTagDels) error { reply := 0 xClient, err := client.GetClient(s) if err != nil { From 65d6128e37cb05702ba7c95e0504c59c055cb669 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 23 Feb 2023 11:27:31 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/sku.go | 1 + supply/sku.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 57ea7d7..bd16149 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -93,6 +93,7 @@ type SkuEsSearch struct { MaxGuidePrice decimal.Decimal // 市场参考价 Source uint // 所属供应商 ThirdCategoryIds []uint // 三级分类Ids + TagIds []uint // 标签Ids OrderType uint // 排序类型 OrderSort uint // 排序顺序 diff --git a/supply/sku.go b/supply/sku.go index 7d18c5a..e0007d6 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -116,6 +116,7 @@ type SkuListsSearch struct { SourceSkuId uint // 供应商skuId BrandId uint // 品牌Id BrandIds []uint // 品牌Ids + TagIds []uint // 商品标签Ids FirstCategoryId uint // 一级分类Id FirstCategoryIds []uint // 一级分类ids SecondCategoryId uint // 二级分类Id @@ -168,6 +169,7 @@ type SkuItem struct { Color string `json:"color"` // 颜色 Size string `json:"size"` // 尺寸 Attributes []AttributeItem `json:"attributes"` // 商品属性 + TagIds []uint `json:"tagIds"` // 商品标签ids } type AttributeItem struct { From 06ee2776e5b7945add87abb632059ed1eeed72bc Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 23 Feb 2023 15:32:08 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/sku/banner.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/customer/sku/banner.go b/customer/sku/banner.go index 4dfa398..a2eb163 100644 --- a/customer/sku/banner.go +++ b/customer/sku/banner.go @@ -51,6 +51,16 @@ func (b *banner) Del(ctx context.Context, id uint) (err error) { return xClient.Call(ctx, "Del", id, &reply) } +// DelBySkuId @Title 根据skuId删除 +func (b *banner) DelBySkuId(ctx context.Context, skuId uint) (err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "DelBySkuId", skuId, &reply) +} + type ArgsSkuBannerAdd struct { SkuId uint Img string