From 8ae052e4a266d6ed31cfec429ea07ed1b74bad13 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 09:40:09 +0800 Subject: [PATCH 01/11] 111 --- supply/sku.go | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 4ada021..b03ec0a 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -3,6 +3,7 @@ package supply import ( "context" "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" ) @@ -28,6 +29,13 @@ const ( SkuAuditStatusWait = 1 // 待审核 SkuAuditStatusAdopt = 2 // 审核通过 SkuAuditStatusReject = 3 // 审核驳回 + + ProfitGtZero = 1 // 利润比大于0 + ProfitEqZero = 2 // 利润比等于0 + ProfitLtZero = 3 // 利润比小于0 + + PlatformStatusOn = 1 // 平台上架状态 + PlatformStatusDown = 2 // 平台下架状态 ) type ArgsSkuAdd struct { @@ -81,3 +89,74 @@ func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error { reply := 0 return client.GetClient(s).Call(ctx, "Adjust", args, &reply) } + +type ArgsSkuLists struct { + Search skuListsSearch + Page bean.Page +} + +type skuListsSearch struct { + Name string // 商品名称 + Source uint // 所属供应商 1=京东 + Id uint // 瑞库客id + SourceSkuId uint // 供应商skuId + BrandId uint // 品牌Id + ThridCategoryId uint // 三级分类Id + AdjustType uint // 加价规则 + MaxSupplyPrice decimal.Decimal // 最大采购价格 + MinSupplyPrice decimal.Decimal // 最小采购价格 + CustomerProfitRate uint // 客户利润比 1=大于0 2=等于0 3=小于0 + Handle uint // 处理状态 + AuditStatus uint // 审核状态 + SourceStatus uint // 供应商下架状态 + PlatformStatus uint // 平台下架状态 +} + +type ReplySkuList struct { + Lists []SkuItem + Total int64 +} + +type SkuItem struct { + Id uint + Name string // 名称 + BrandId uint // 品牌id + FirstCategoryId uint // 一级分类id + SecondCategoryId uint // 二级分类id + ThirdCategoryId uint // 三级分类id + SupplyPrice decimal.Decimal // 采购价 + GuidePrice decimal.Decimal // 指导价 + ImgUrl string // 商品主图 + PlatformStatus uint // 平台状态 1=上架 2=下架 + Source uint // 来源 1=京东 + SourceSkuId string // 源skuId + SourceStatus uint // 供应商状态 1=上架 2=下架 + CustomerPrice decimal.Decimal // 供货最高价 + CustomerProfitRate decimal.Decimal // 供货利润率 供货利润/供货最高价% + AdjustType uint // 加价类型 + AdjustPrice decimal.Decimal // 加价金额 + Handle uint // 1=未处理 2=已处理 + Imgs []SkuImg +} + +// Lists @Title 商品列表 +func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) error { + reply := 0 + return client.GetClient(s).Call(ctx, "Lists", args, &reply) +} + +type ArgsSkuOnShelves struct { + SkuIds []uint +} + +// OnShelves @Title 上架 +func (s *sku) OnShelves(ctx context.Context, args ArgsSkuLists) error { + reply := 0 + return client.GetClient(s).Call(ctx, "OnShelves", args, &reply) +} + +// DownShelves @Title 下架 +func (s *sku) DownShelves(ctx context.Context, args ArgsSkuLists) error { + reply := 0 + return client.GetClient(s).Call(ctx, "DownShelves", args, &reply) +} From b042a4f95a6e2b4b934b345a19af4d690ab46fab Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 11:40:27 +0800 Subject: [PATCH 02/11] bug --- jd/sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jd/sku.go b/jd/sku.go index 2189032..5e9bcbe 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -142,7 +142,7 @@ type AdoptItem struct { } // Adopt @Title 入库 -func (s *sku) Adopt(ctx context.Context, skuIds []uint) (reply AdoptItem, err error) { - err = client.GetClient(s).Call(ctx, "Adopt", skuIds, &reply) - return +func (s *sku) Adopt(ctx context.Context, skuIds []uint) (err error) { + reply := 0 + return client.GetClient(s).Call(ctx, "Adopt", skuIds, &reply) } From 6508b9e29c1a0873f3cccd6b8675a7960d698775 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 11:53:24 +0800 Subject: [PATCH 03/11] bug --- supply/sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 6a3810d..8b95df8 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -136,9 +136,9 @@ type SkuItem struct { } // Lists @Title 商品列表 -func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) error { - reply := 0 - return client.GetClient(s).Call(ctx, "Lists", args, &reply) +func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) (reply ReplySkuList, err error) { + err = client.GetClient(s).Call(ctx, "Lists", args, &reply) + return } type ArgsSkuOnShelves struct { From 0d130f79801fd52fa573e7a7e0c149ddc4a63502 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 13:42:19 +0800 Subject: [PATCH 04/11] bug --- supply/sku.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 8b95df8..4bddb93 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -145,14 +145,18 @@ type ArgsSkuOnShelves struct { SkuIds []uint } +type ArgsSkuDownShelves struct { + SkuIds []uint +} + // OnShelves @Title 上架 -func (s *sku) OnShelves(ctx context.Context, args ArgsSkuLists) error { +func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error { reply := 0 return client.GetClient(s).Call(ctx, "OnShelves", args, &reply) } // DownShelves @Title 下架 -func (s *sku) DownShelves(ctx context.Context, args ArgsSkuLists) error { +func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { reply := 0 return client.GetClient(s).Call(ctx, "DownShelves", args, &reply) } From 79d5a8bcf628e8b6db271882db2805552a0283be Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 13:47:39 +0800 Subject: [PATCH 05/11] bug --- supply/sku.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 4bddb93..7188216 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -87,11 +87,11 @@ func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error { } type ArgsSkuLists struct { - Search skuListsSearch + Search SkuListsSearch Page bean.Page } -type skuListsSearch struct { +type SkuListsSearch struct { Name string // 商品名称 Source uint // 所属供应商 1=京东 Id uint // 瑞库客id From 382080b882295e87ce2da390f4af7b8a139dea29 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 14:19:16 +0800 Subject: [PATCH 06/11] bug --- supply/sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/sku.go b/supply/sku.go index 7188216..49fbef1 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -93,7 +93,7 @@ type ArgsSkuLists struct { type SkuListsSearch struct { Name string // 商品名称 - Source uint // 所属供应商 1=京东 + SourceId uint // 所属供应商 1=京东 Id uint // 瑞库客id SourceSkuId uint // 供应商skuId BrandId uint // 品牌Id From dc1f2d4231e4610721dca218dd534cfd920ff9ca Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 15:01:17 +0800 Subject: [PATCH 07/11] bug --- supply/skuAudit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/skuAudit.go b/supply/skuAudit.go index ff7cacd..78f7c63 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -28,7 +28,7 @@ type ReplySkuAuditLists struct { } // Lists @Title 审核列表 -func (s *skuAudit) Lists(ctx context.Context, args ArgsBrandList) (result ReplySkuAuditLists, err error) { +func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (result ReplySkuAuditLists, err error) { err = client.GetClient(s).Call(ctx, "Lists", args, &result) return } From 8e0a112f188e169db98811a8505bd742ddde0427 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 15:30:17 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=88=97=E8=A1=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/skuAudit.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/supply/skuAudit.go b/supply/skuAudit.go index 78f7c63..43a61f0 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -4,6 +4,7 @@ import ( "context" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" ) type skuAudit struct { @@ -20,7 +21,10 @@ type SkuAuditSearch struct { Status uint // 状态 1=未审核 2=通过 3=驳回 } type SkuAuditItem struct { - Id uint `json:"id"` + Id uint `json:"id"` + SkuId uint `json:"skuId"` + AfterAdjustType uint `json:"afterAdjustType"` + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` } type ReplySkuAuditLists struct { Lists []SkuAuditItem `json:"lists"` From 671323e4661f7720c9e201450cc32387cfa3b1c0 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 22 Jul 2022 18:06:49 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9lists=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 6 +++--- supply/skuAudit.go | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 49fbef1..e8b4df3 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -93,7 +93,7 @@ type ArgsSkuLists struct { type SkuListsSearch struct { Name string // 商品名称 - SourceId uint // 所属供应商 1=京东 + SourceId uint // 所属供应商 1=京东 Id uint // 瑞库客id SourceSkuId uint // 供应商skuId BrandId uint // 品牌Id @@ -116,7 +116,7 @@ type ReplySkuList struct { type SkuItem struct { Id uint Name string // 名称 - BrandId uint // 品牌id + BrandName string // 品牌名称 FirstCategoryId uint // 一级分类id SecondCategoryId uint // 二级分类id ThirdCategoryId uint // 三级分类id @@ -124,7 +124,7 @@ type SkuItem struct { GuidePrice decimal.Decimal // 指导价 ImgUrl string // 商品主图 PlatformStatus uint // 平台状态 1=上架 2=下架 - SourceId uint // 来源 1=京东 + SourceName string // 供应商名称 SourceSkuId string // 源skuId SourceStatus uint // 供应商状态 1=上架 2=下架 CustomerPrice decimal.Decimal // 供货最高价 diff --git a/supply/skuAudit.go b/supply/skuAudit.go index 43a61f0..9299925 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -20,15 +20,25 @@ type SkuAuditSearch struct { AdjustType uint // 加价类型 Status uint // 状态 1=未审核 2=通过 3=驳回 } -type SkuAuditItem struct { - Id uint `json:"id"` +type SkuAndAuditItem struct { + AuditId uint `json:"auditId"` SkuId uint `json:"skuId"` AfterAdjustType uint `json:"afterAdjustType"` AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` + Name string `json:"name"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + GuidePrice decimal.Decimal `json:"guidePrice"` + AdjustType uint `json:"adjustType"` + AdjustPrice decimal.Decimal `json:"adjustPrice"` + CustomerPrice decimal.Decimal `json:"customerPrice"` + ThirdCategoryId uint `json:"thirdCategoryId"` + BrandName string `json:"brandName"` + SourceName string `json:"sourceName"` } + type ReplySkuAuditLists struct { - Lists []SkuAuditItem `json:"lists"` - Total int64 `json:"total"` + Lists []SkuAndAuditItem `json:"lists"` + Total int64 `json:"total"` } // Lists @Title 审核列表 From 6d63cf4fd95a289b30014841bf266c81c154ff4f Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 25 Jul 2022 11:10:45 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=88=97=E8=A1=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 7 +++++++ supply/skuAudit.go | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index e8b4df3..93d0fc8 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -181,3 +181,10 @@ func (s *sku) Stock(ctx context.Context, args ArgsSkuStock) (reply []ReplySkuSto err = client.GetClient(s).Call(ctx, "Stock", args, &reply) return } + +type ArgsSkuAdjustType struct { + SkuId uint + AdjustType uint + AdjustPrice decimal.Decimal + ApplyUserId uint +} diff --git a/supply/skuAudit.go b/supply/skuAudit.go index 9299925..4dc5ec5 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -2,9 +2,11 @@ package supply import ( "context" + "database/sql" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" + "time" ) type skuAudit struct { @@ -31,9 +33,14 @@ type SkuAndAuditItem struct { AdjustType uint `json:"adjustType"` AdjustPrice decimal.Decimal `json:"adjustPrice"` CustomerPrice decimal.Decimal `json:"customerPrice"` - ThirdCategoryId uint `json:"thirdCategoryId"` + Category string `json:"category"` BrandName string `json:"brandName"` SourceName string `json:"sourceName"` + AuditUserId uint `json:"auditUserId"` + AuditAt sql.NullTime `json:"auditAt"` + ImgUrl string `json:"imgUrl"` + Reason string `json:"reason"` + CreatedAt time.Time `json:"createdAt"` } type ReplySkuAuditLists struct { @@ -42,8 +49,8 @@ type ReplySkuAuditLists struct { } // Lists @Title 审核列表 -func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (result ReplySkuAuditLists, err error) { - err = client.GetClient(s).Call(ctx, "Lists", args, &result) +func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (reply ReplySkuAuditLists, err error) { + err = client.GetClient(s).Call(ctx, "Lists", args, &reply) return } From f8dcf5dccb2c9bcbd5ca6e12d10530533ee4d6c7 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 25 Jul 2022 11:43:59 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=94=B9=E4=BB=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 93d0fc8..a9334c7 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -188,3 +188,9 @@ type ArgsSkuAdjustType struct { AdjustPrice decimal.Decimal ApplyUserId uint } + +// EditAdjust @Title 修改改价类型 +func (s *sku) EditAdjust(ctx context.Context, args ArgsSkuAdjustType) error { + reply := 0 + return client.GetClient(s).Call(ctx, "EditAdjust", args, &reply) +}