From 1a1a24bd34b1f69b139562288888e8d22d8f880f Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 14 Oct 2022 12:03:46 +0800 Subject: [PATCH 01/79] =?UTF-8?q?=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/interface/afterService.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supply/interface/afterService.go b/supply/interface/afterService.go index e25605e..120ba58 100644 --- a/supply/interface/afterService.go +++ b/supply/interface/afterService.go @@ -10,6 +10,8 @@ const ( AfterServiceNeedPictureTrue = 1 // 需要上传 AfterServiceNeedPictureFalse = 2 // 不需要上传 + + AfterServiceZipCodeNone = "000000" ) type AfterServiceInterface interface { From 544f3b1f5efd9e0c9333d27d6e14091375db07d3 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 14 Nov 2022 10:00:38 +0800 Subject: [PATCH 02/79] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E8=AE=A2=E5=8D=95=E5=85=B3=E9=97=AD=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 1 + supply/order.go | 1 + 2 files changed, 2 insertions(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index 279a381..ea21030 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -166,6 +166,7 @@ type OrderItem struct { Status uint `json:"status"` CancelStatus uint `json:"cancelStatus"` CreatedAt int64 `json:"createdAt"` + CloseAt int64 `json:"closeAt"` Skus []OrderSku `json:"skus"` Packages []OrderPackage `json:"packages"` } diff --git a/supply/order.go b/supply/order.go index 03514d9..ed147da 100644 --- a/supply/order.go +++ b/supply/order.go @@ -127,6 +127,7 @@ type RetailOrderItem struct { SupplyOrderFee decimal.Decimal `json:"supplyOrderFee"` PayTime int64 `json:"payTime"` FinishAt int64 `json:"finishAt"` + CloseAt int64 `json:"closeAt"` } type ReplyRetailOrderLists struct { From 58aae25cab5f51c300d00f849eb441731e1ba184 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 14 Nov 2022 14:51:57 +0800 Subject: [PATCH 03/79] =?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/service/audit/supply.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go index bcaed84..3113f90 100644 --- a/customer/service/audit/supply.go +++ b/customer/service/audit/supply.go @@ -12,7 +12,7 @@ type ArgsSupplyApply struct { ApplyUserId uint // 申请人id CustomerId uint // 客户id RateId uint // 费率id - ExpirationAt int64 // 到期时间 + ExpirationAt string // 到期时间 Enclosure string // 附件 } From 0eadf431dc094de95a98a5b6996d1bf33c093bde Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 15 Nov 2022 13:30:30 +0800 Subject: [PATCH 04/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service/audit.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/customer/service/audit.go b/customer/service/audit.go index 24333c9..13032f2 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -44,3 +44,31 @@ func (a *audit) Lists(ctx context.Context, args ArgsAuditLists) (reply ReplyAudi err = xClient.Call(ctx, "Lists", args, &reply) return } + +type ArgsHistory struct { + Page bean.Page + CustomerId uint +} + +type ReplyHistoryLists struct { + Lists []HistoryItem `json:"lists"` + Total int64 `json:"total"` +} + +type HistoryItem struct { + ServiceId uint `json:"serviceId"` + Remark string `json:"remark"` + ExpirationAt int64 `json:"expirationAt"` + ApplyAt int64 `json:"applyAt"` + AuditStatus uint `json:"auditStatus"` +} + +// History @Title 服务申请记录 +func (a *audit) History(ctx context.Context, args ArgsHistory) (reply ReplyHistoryLists, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "History", args, &reply) + return +} From f27f2ad0e72753864d5c6f1fbcc49eeaabfed6ac Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 15 Nov 2022 13:48:29 +0800 Subject: [PATCH 05/79] =?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/service/service.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/customer/service/service.go b/customer/service/service.go index 6a5b359..25054da 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -35,3 +35,19 @@ func (s *service) All(ctx context.Context, customerId uint) (reply []ReplyServic err = xClient.Call(ctx, "All", customerId, &reply) return } + +type ReplyServiceSelect struct { + Id uint `json:"id"` + Name string `json:"name"` +} + +// Select @Title 服务筛选 +func (s *service) Select(ctx context.Context) (reply []ReplyServiceSelect, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + args := 0 + err = xClient.Call(ctx, "Select", args, &reply) + return +} From e872079c21e259c74a6bdfa05427b2c49290dfc1 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 16 Nov 2022 10:59:27 +0800 Subject: [PATCH 06/79] =?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/sale.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/customer/sku/sale.go b/customer/sku/sale.go index 8e074c7..5ff9c86 100644 --- a/customer/sku/sale.go +++ b/customer/sku/sale.go @@ -90,3 +90,13 @@ func (s *sale) DelAll(ctx context.Context) error { reply := 0 return xClient.Call(ctx, "DelAll", args, &reply) } + +// FindBySkuIds @Title 根据SkuId查询数据 +func (s *sale) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []SaleSkuItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply) + return +} From c9bbbc971789072532848e355743a1ab931d1bfc Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 16 Nov 2022 13:30:52 +0800 Subject: [PATCH 07/79] =?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/user.go | 1 + 1 file changed, 1 insertion(+) diff --git a/customer/user.go b/customer/user.go index e42c7b6..e0e571f 100644 --- a/customer/user.go +++ b/customer/user.go @@ -36,6 +36,7 @@ type UserItem struct { Phone string `json:"phone"` Amount decimal.Decimal `json:"amount"` Status uint `json:"status"` + ServiceNames []string `json:"serviceNames"` CreatedType uint `json:"createdType"` CreatedUserId uint `json:"createdUserId"` CreatedAt int64 `json:"createdAt"` From c4a8e9ca71d45768070e2c524497e7972ec4e723 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 16 Nov 2022 14:08:34 +0800 Subject: [PATCH 08/79] =?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/item.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/customer/sku/item.go b/customer/sku/item.go index c553cca..ce4cebd 100644 --- a/customer/sku/item.go +++ b/customer/sku/item.go @@ -79,3 +79,18 @@ func (i *item) DelAll(ctx context.Context, skuTypeId uint) error { reply := 0 return xClient.Call(ctx, "DelAll", skuTypeId, &reply) } + +type ArgsBySKuIds struct { + SkuIds []uint + SkuTypeId uint +} + +// FindBySkuIds @Title 根据SkuId查询数据 +func (i *item) FindBySkuIds(ctx context.Context, args ArgsBySKuIds) (reply []SkuItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "FindBySkuIds", args, &reply) + return +} From ac1375ffa853be81d4d71b9e02ea8d0966f674a7 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 16 Nov 2022 14:08:56 +0800 Subject: [PATCH 09/79] =?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/item.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/customer/sku/item.go b/customer/sku/item.go index ce4cebd..a396683 100644 --- a/customer/sku/item.go +++ b/customer/sku/item.go @@ -87,7 +87,7 @@ type ArgsBySKuIds struct { // FindBySkuIds @Title 根据SkuId查询数据 func (i *item) FindBySkuIds(ctx context.Context, args ArgsBySKuIds) (reply []SkuItem, err error) { - xClient, err := client.GetClient(s) + xClient, err := client.GetClient(i) if err != nil { return nil, err } From 6c78eb68061053518d9a895c3e032622ddaf68d0 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 16 Nov 2022 14:14:37 +0800 Subject: [PATCH 10/79] =?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/item.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/customer/sku/item.go b/customer/sku/item.go index a396683..e627a60 100644 --- a/customer/sku/item.go +++ b/customer/sku/item.go @@ -80,13 +80,13 @@ func (i *item) DelAll(ctx context.Context, skuTypeId uint) error { return xClient.Call(ctx, "DelAll", skuTypeId, &reply) } -type ArgsBySKuIds struct { +type ArgsBySkuIds struct { SkuIds []uint SkuTypeId uint } // FindBySkuIds @Title 根据SkuId查询数据 -func (i *item) FindBySkuIds(ctx context.Context, args ArgsBySKuIds) (reply []SkuItem, err error) { +func (i *item) FindBySkuIds(ctx context.Context, args ArgsBySkuIds) (reply []SkuItem, err error) { xClient, err := client.GetClient(i) if err != nil { return nil, err From f571a35323bdd1481adce7a5be5cfc2d0231ff74 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 18 Nov 2022 13:25:53 +0800 Subject: [PATCH 11/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/goods.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supplier/goods.go b/supplier/goods.go index aa6311c..d136d68 100644 --- a/supplier/goods.go +++ b/supplier/goods.go @@ -37,6 +37,7 @@ type GoodsItem struct { StockCount uint `json:"stockCount"` GuidePrices []decimal.Decimal `json:"guidePrices"` SupplyPrices []decimal.Decimal `json:"supplyPrices"` + Status uint `json:"status"` CreatedAt int64 `json:"createdAt"` } From 977024344c935255ae7e757cd61b144ffc1e5d2c Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 14:07:35 +0800 Subject: [PATCH 12/79] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=E6=9D=A1=E7=A0=81=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 1562f8b..6837439 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -125,6 +125,7 @@ type SkuListsSearch struct { AuditStatus uint // 审核状态 SourceStatus uint // 供应商下架状态 PlatformStatus uint // 平台下架状态 + UpcCode string // 商品条码 } type ReplySkuList struct { @@ -180,6 +181,7 @@ type SkuEsSearch struct { SkuId uint // Sku编码 SupplySkuId uint // 供应商Sku编码 SkuName string // 商品名称 + UpcCode string // 商品条码 BrandId uint // 品牌id BrandName string // 品牌名称 全词匹配 FirstCategoryId uint // 一级分类id From de63024dd7aa226ba22f59ce667e66611f358159 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 14:12:45 +0800 Subject: [PATCH 13/79] =?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/sku.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/sku.go b/supply/sku.go index 6837439..bcd4309 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -159,6 +159,7 @@ type SkuItem struct { AfterDiscount decimal.Decimal `json:"afterDiscount"` // 改价后折扣 AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 Reason string // 改价驳回原因 + UpcCode string // 商品条码 } // Lists @Title 商品列表 From 43d4aea2782949aedcca81efb8543ad5a2849cd0 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 16:20:06 +0800 Subject: [PATCH 14/79] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index ed147da..8b0446b 100644 --- a/supply/order.go +++ b/supply/order.go @@ -128,6 +128,7 @@ type RetailOrderItem struct { PayTime int64 `json:"payTime"` FinishAt int64 `json:"finishAt"` CloseAt int64 `json:"closeAt"` + StockOutAt int64 `json:"stockOutAt"` } type ReplyRetailOrderLists struct { From a031039ec9150aed9f413efe1982e0be70652e7b Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 16:25:53 +0800 Subject: [PATCH 15/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index 8b0446b..1696445 100644 --- a/supply/order.go +++ b/supply/order.go @@ -160,6 +160,7 @@ type OrderInfo struct { Status uint `json:"status"` Skus []OrderSku `json:"skus"` Packages []OrderPackage `json:"packages"` + StockOutAt int64 `json:"stockOutAt"` } type OrderSku struct { From e30ce7da29bc39e22ba337405dfa19e51507ff5d Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 17:04:59 +0800 Subject: [PATCH 16/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index 1696445..8555f69 100644 --- a/supply/order.go +++ b/supply/order.go @@ -119,6 +119,7 @@ type RetailOrderSearch struct { type RetailOrderItem struct { Id uint `json:"id"` OrderSubSn string `json:"orderSubSn"` + SourceOrderSn string `json:"sourceOrderSn"` SourceName string `json:"sourceName"` CustomerName string `json:"customerName"` OrderStatus uint `json:"orderStatus"` From a5dbde176c0110e1bda39ec601e08ee1172bd25c Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 21 Nov 2022 17:12:09 +0800 Subject: [PATCH 17/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index 8555f69..c14eb7a 100644 --- a/supply/order.go +++ b/supply/order.go @@ -151,6 +151,7 @@ type OrderInfo struct { OrderId uint `json:"orderId"` CustomerId uint `json:"customerId"` OrderSn uint64 `json:"orderSn"` + SourceOrderSn uint64 `json:"sourceOrderSn"` ReceiverName string `json:"receiverName"` ReceiverMobile string `json:"receiverMobile"` Address string `json:"address"` From 5e0d16c89584c5f00c819c559e6313965c228f50 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 22 Nov 2022 11:09:21 +0800 Subject: [PATCH 18/79] =?UTF-8?q?=E4=BC=91=E6=80=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index bcd4309..0690fe7 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -158,8 +158,8 @@ type SkuItem struct { AfterPrice decimal.Decimal `json:"afterPrice"` // 改价后金额 AfterDiscount decimal.Decimal `json:"afterDiscount"` // 改价后折扣 AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 - Reason string // 改价驳回原因 - UpcCode string // 商品条码 + Reason string `json:"reason"` // 改价驳回原因 + UpcCode string `json:"upcCode"` // 商品条码 } // Lists @Title 商品列表 From e67a84365d40581f28537e279631f87bf6bedc61 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 22 Nov 2022 15:17:54 +0800 Subject: [PATCH 19/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8B=86=E5=8D=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index ea21030..da7b614 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -136,6 +136,40 @@ func (o *order) Cancel(ctx context.Context, channelId string, args ArgsOrderChan return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Cancel", args, &reply) } +type ArgsOrderSplit struct { + RootOrderSn string + ChannelOrderSn string +} +type ReplyOrderSplit struct { + OrderSn string `json:"orderSn"` + ChannelOrderSn string `json:"channelOrderSn"` + FreightFee decimal.Decimal `json:"freightFee"` + OrderFee decimal.Decimal `json:"orderFee"` + Skus []OrderSplitSkuItem `json:"skus"` + SubOrders []*OrderSubSplit `json:"subOrders"` +} +type OrderSubSplit struct { + OrderSn string `json:"orderSn"` + FreightFee decimal.Decimal `json:"freightFee"` + OrderFee decimal.Decimal `json:"orderFee"` + Skus []OrderSplitSkuItem `json:"skus"` + SubOrders []*OrderSubSplit `json:"subOrders"` +} +type OrderSplitSkuItem struct { + SkuId uint `json:"skuId"` + Quantity uint `json:"quantity"` +} + +// Split @Title 获取拆单信息 +func (o *order) Split(ctx context.Context, channelId string, args ArgsOrderSplit) (reply ReplyOrderSplit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Split", args, &reply) + return +} + type OrderListsSearch struct { SkuName string // 商品名称 Status []uint // 订单状态 From de98e52d0e7cea18780f6c9613d116965bec0d92 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 24 Nov 2022 16:52:02 +0800 Subject: [PATCH 20/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index da7b614..d98baf1 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -203,6 +203,7 @@ type OrderItem struct { CloseAt int64 `json:"closeAt"` Skus []OrderSku `json:"skus"` Packages []OrderPackage `json:"packages"` + StockOutAt int64 `json:"stockOutAt"` } type OrderSku struct { From e795c03373088584efdc1a07ba9ce96a5ea56ced Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 28 Nov 2022 10:18:19 +0800 Subject: [PATCH 21/79] =?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/order.go | 2 ++ supply/interface/sku.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/supply/channel/order.go b/supply/channel/order.go index d98baf1..c325c1d 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -12,6 +12,7 @@ import ( const ( ReplyOrderFreightFeeErrCodeNone = 0 // 无错误 ReplyOrderFreightFeeErrCodeErr = 1 // 有错误 + ReplyOrderFreightFeeErrCodeDone = 2 // 已下架 OrderStatusLock = 1 // 锁单待确认 OrderStatusLadingBill = 2 // 提单 @@ -171,6 +172,7 @@ func (o *order) Split(ctx context.Context, channelId string, args ArgsOrderSplit } type OrderListsSearch struct { + SkuIds []uint // 商品Ids SkuName string // 商品名称 Status []uint // 订单状态 CancelStatus uint // 订单取消状态 diff --git a/supply/interface/sku.go b/supply/interface/sku.go index 359cf9a..c003e0f 100644 --- a/supply/interface/sku.go +++ b/supply/interface/sku.go @@ -7,8 +7,9 @@ import ( type skuState uint const ( - SkuStateIn = 1 // 有货 - SkuStateOut = 2 // 无货 + SkuStateIn = 1 // 有货 + SkuStateOut = 2 // 无货 + SkuStateDone = 3 // 下架商品 ) type Sku interface { From 2ea85769792ed017da03a6ae628fa24b74a8afd7 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 28 Nov 2022 11:22:09 +0800 Subject: [PATCH 22/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index c14eb7a..682ea1e 100644 --- a/supply/order.go +++ b/supply/order.go @@ -106,6 +106,7 @@ type ArgsRetailOrderLists struct { type RetailOrderSearch struct { OrderSubSn uint64 `label:"订单号"` + SourceSubSn uint64 `label:"供应商订单号"` SupplierId uint `label:"供应商"` CustomerId uint `label:"客户"` WaybillCode string `label:"运单号"` From 83c11567ff4429ce24bb1e7cc121dfd173f68ed6 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 29 Nov 2022 14:01:39 +0800 Subject: [PATCH 23/79] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index da7b614..1cd69d4 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -236,6 +236,30 @@ func (o *order) Lists(ctx context.Context, channelId string, args ArgsOrderLists return } +type ArgsOrderDetail struct { + RootOrderSn string + ChannelOrderSn string +} +type ReplyOrderDetail struct { + ChannelOrderSn string + OrderSn string + OrderFee decimal.Decimal + FreightFee decimal.Decimal + Receiver OrderReceiver + CreatedAt int64 + LadingBillAt int64 + CloseAt int64 +} + +type OrderReceiver struct { + ReceiverName string + ReceiverMobile string + ReceiverEmail string + ReceiverZipCode string + Address string + UserIp string +} + // Detail @Title 订单详情 func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (reply OrderItem, err error) { xClient, err := client.GetClient(o) From 6315e9a9c57c4cd9ba9e298b0684aded9377e678 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 14:07:05 +0800 Subject: [PATCH 24/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index 682ea1e..86e60d7 100644 --- a/supply/order.go +++ b/supply/order.go @@ -153,6 +153,7 @@ type OrderInfo struct { CustomerId uint `json:"customerId"` OrderSn uint64 `json:"orderSn"` SourceOrderSn uint64 `json:"sourceOrderSn"` + SourceId uint `json:"sourceId"` ReceiverName string `json:"receiverName"` ReceiverMobile string `json:"receiverMobile"` Address string `json:"address"` From 3ba8588b12826189891bc47ba546d4525c92cb1f Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 14:14:09 +0800 Subject: [PATCH 25/79] =?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/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/order.go b/supply/order.go index 86e60d7..0deaee1 100644 --- a/supply/order.go +++ b/supply/order.go @@ -154,6 +154,7 @@ type OrderInfo struct { OrderSn uint64 `json:"orderSn"` SourceOrderSn uint64 `json:"sourceOrderSn"` SourceId uint `json:"sourceId"` + SourceName string `json:"sourceName"` ReceiverName string `json:"receiverName"` ReceiverMobile string `json:"receiverMobile"` Address string `json:"address"` From 9c9e69b23409bc8ef0983f13483eaf99685e9ec2 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 15:46:47 +0800 Subject: [PATCH 26/79] =?UTF-8?q?=E9=9C=80=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 0690fe7..2fa76f2 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -160,6 +160,8 @@ type SkuItem struct { AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 Reason string `json:"reason"` // 改价驳回原因 UpcCode string `json:"upcCode"` // 商品条码 + Color string `json:"color"` // 颜色 + Size string `json:"size"` // 尺寸 } // Lists @Title 商品列表 From 74226f5c55493f256e32e47c90abac54d216a388 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 16:42:13 +0800 Subject: [PATCH 27/79] =?UTF-8?q?iu=E8=AF=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 2fa76f2..0690fe7 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -160,8 +160,6 @@ type SkuItem struct { AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 Reason string `json:"reason"` // 改价驳回原因 UpcCode string `json:"upcCode"` // 商品条码 - Color string `json:"color"` // 颜色 - Size string `json:"size"` // 尺寸 } // Lists @Title 商品列表 From 4f422875ac8b24c125a848acae697c3e27bd9c75 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 16:47:35 +0800 Subject: [PATCH 28/79] =?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/sku.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 0690fe7..2fa76f2 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -160,6 +160,8 @@ type SkuItem struct { AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 Reason string `json:"reason"` // 改价驳回原因 UpcCode string `json:"upcCode"` // 商品条码 + Color string `json:"color"` // 颜色 + Size string `json:"size"` // 尺寸 } // Lists @Title 商品列表 From 05839ff5d37075fa1225b0721f197156f3b3ec74 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 29 Nov 2022 17:06:19 +0800 Subject: [PATCH 29/79] =?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/sku.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 2fa76f2..08de840 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -162,6 +162,13 @@ type SkuItem struct { UpcCode string `json:"upcCode"` // 商品条码 Color string `json:"color"` // 颜色 Size string `json:"size"` // 尺寸 + Attributes []AttributeItem `json:"attributes"` // 商品属性 +} + +type AttributeItem struct { + GroupName string `json:"groupName"` + Name string `json:"name"` + Value string `json:"value"` } // Lists @Title 商品列表 From 28f9c66044f5893c79a2aabba6775ac049411481 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 09:37:20 +0800 Subject: [PATCH 30/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index a209ac3..0e52ae0 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -29,6 +29,10 @@ const ( OrderSubIsSplitFalse = 1 // 无 OrderSubIsSplitTrue = 2 // 被拆单 + + OrderSubTypeApi = 1 // api接口下单 + OrderSubTypeCustomerWeb = 2 // 客户商城下单 + ) type order struct { @@ -73,6 +77,7 @@ type ArgsOrderSubmit struct { OrderFee decimal.Decimal // 订单金额-不含运费 FreightFees []OrderFreightFee // 运费 UserIp string // 下单用户ip + Type uint // 下单方式 } type OrderFreightFee struct { From 65be71bb0dae491a406838299ae85b9b2085a4ff Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 09:52:19 +0800 Subject: [PATCH 31/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index 0e52ae0..d72aba6 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -153,6 +153,7 @@ type ReplyOrderSplit struct { OrderFee decimal.Decimal `json:"orderFee"` Skus []OrderSplitSkuItem `json:"skus"` SubOrders []*OrderSubSplit `json:"subOrders"` + Type uint `json:"type"` } type OrderSubSplit struct { OrderSn string `json:"orderSn"` From b2c7d3260002efcb33f59173f6c37b5671f5f255 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 10:07:57 +0800 Subject: [PATCH 32/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/channel/order.go b/supply/channel/order.go index d72aba6..976e974 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -93,8 +93,8 @@ type Receiver struct { } type ReplyOrderSubmit struct { - OrderSn string - ChannelOrderSn string + OrderSn string `json:"orderSn"` + ChannelOrderSn string `json:"channelOrderSn"` } // Submit @Title 下单 From 2f4fe9f1e91793b539a8d38266c4727b4a20c453 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 16:25:22 +0800 Subject: [PATCH 33/79] =?UTF-8?q?=E6=94=B6=E8=B4=A7=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/error.go | 82 ++++++++++++++++++---------------- supply/channel/afterService.go | 4 ++ 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/rpc/error.go b/rpc/error.go index 4592d5d..203d156 100644 --- a/rpc/error.go +++ b/rpc/error.go @@ -5,48 +5,52 @@ type Error uint const ( ErrorSystem Error = 11001 // 系统错误 - ErrorOrderRepeat Error = 11002 // 重复下单 - ErrorOrderFreightFee Error = 11003 // 运费错误 - ErrorOrderSubmit Error = 11004 // 下单失败 - ErrorOrderShipment Error = 11005 // 无法配送 - ErrorOrderSkuPrice Error = 11006 // 商品价格错误 - ErrorOrderAmount Error = 11007 // 订单金额错误 - ErrorOrderLadingBill Error = 11008 // 订单已提单 - ErrorOrderClose Error = 11009 // 订单已关闭 - ErrorOrderTimeOut Error = 11010 // 订单超时 - ErrorOrderError Error = 11011 // 订单错误 - ErrorOrderUnPay Error = 11012 // 订单未支付 - ErrorOrderInvalid Error = 11013 // 订单失效 - ErrorOrderSkuInvalid Error = 11014 // 订单商品错误 - ErrorAfterServiceTypeError Error = 11015 // 售后类型错误 - ErrorAfterServiceReasonError Error = 11016 // 售后原因错误 - ErrorAfterServiceError Error = 11017 // 售后单错误 - ErrorAfterServiceCloseError Error = 11018 // 售后已关闭 - ErrorAfterServiceFinishError Error = 11019 // 售后已完成 - ErrorOrderCancelError Error = 11020 // 订单取消失败 + ErrorOrderRepeat Error = 11002 // 重复下单 + ErrorOrderFreightFee Error = 11003 // 运费错误 + ErrorOrderSubmit Error = 11004 // 下单失败 + ErrorOrderShipment Error = 11005 // 无法配送 + ErrorOrderSkuPrice Error = 11006 // 商品价格错误 + ErrorOrderAmount Error = 11007 // 订单金额错误 + ErrorOrderLadingBill Error = 11008 // 订单已提单 + ErrorOrderClose Error = 11009 // 订单已关闭 + ErrorOrderTimeOut Error = 11010 // 订单超时 + ErrorOrderError Error = 11011 // 订单错误 + ErrorOrderUnPay Error = 11012 // 订单未支付 + ErrorOrderInvalid Error = 11013 // 订单失效 + ErrorOrderSkuInvalid Error = 11014 // 订单商品错误 + ErrorAfterServiceTypeError Error = 11015 // 售后类型错误 + ErrorAfterServiceReasonError Error = 11016 // 售后原因错误 + ErrorAfterServiceError Error = 11017 // 售后单错误 + ErrorAfterServiceCloseError Error = 11018 // 售后已关闭 + ErrorAfterServiceFinishError Error = 11019 // 售后已完成 + ErrorOrderCancelError Error = 11020 // 订单取消失败 + ErrorAfterServiceLogisticsAddressError Error = 11021 // 售后寄回地址获取失败 + ErrorAfterServiceLogisticsAddressReturnError Error = 11022 // 售后寄回地址已回传 ) var ErrorCodes = map[Error]string{ - ErrorSystem: "系统错误", - ErrorOrderRepeat: "重复下单", - ErrorOrderFreightFee: "运费错误", - ErrorOrderSubmit: "下单失败", - ErrorOrderShipment: "无法配送", - ErrorOrderSkuPrice: "商品价格错误", - ErrorOrderAmount: "订单金额错误", - ErrorOrderLadingBill: "订单已提单", - ErrorOrderClose: "订单已关闭", - ErrorOrderTimeOut: "订单超时", - ErrorOrderError: "订单错误", - ErrorOrderUnPay: "订单未支付", - ErrorOrderInvalid: "订单失效", - ErrorOrderSkuInvalid: "订单商品错误", - ErrorAfterServiceTypeError: "售后类型错误", - ErrorAfterServiceReasonError: "售后原因错误", - ErrorAfterServiceError: "售后单错误", - ErrorAfterServiceCloseError: "售后已关闭", - ErrorAfterServiceFinishError: "售后已完成", - ErrorOrderCancelError: "订单取消失败", + ErrorSystem: "系统错误", + ErrorOrderRepeat: "重复下单", + ErrorOrderFreightFee: "运费错误", + ErrorOrderSubmit: "下单失败", + ErrorOrderShipment: "无法配送", + ErrorOrderSkuPrice: "商品价格错误", + ErrorOrderAmount: "订单金额错误", + ErrorOrderLadingBill: "订单已提单", + ErrorOrderClose: "订单已关闭", + ErrorOrderTimeOut: "订单超时", + ErrorOrderError: "订单错误", + ErrorOrderUnPay: "订单未支付", + ErrorOrderInvalid: "订单失效", + ErrorOrderSkuInvalid: "订单商品错误", + ErrorAfterServiceTypeError: "售后类型错误", + ErrorAfterServiceReasonError: "售后原因错误", + ErrorAfterServiceError: "售后单错误", + ErrorAfterServiceCloseError: "售后已关闭", + ErrorAfterServiceFinishError: "售后已完成", + ErrorOrderCancelError: "订单取消失败", + ErrorAfterServiceLogisticsAddressError: "售后寄回地址获取失败", + ErrorAfterServiceLogisticsAddressReturnError: "售后寄回地址已回传", } func (e Error) Error() string { diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index 8326048..e5e11c5 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -14,6 +14,10 @@ const ( AfterServiceStatusHandle = 3 // 收货处理中 AfterServiceStatusFinal = 4 // 售后完成 AfterServiceStatusClose = 5 // 售后关闭 + + AfterServicePackageSendNone = 1 // 无 + AfterServicePackageSendWait = 2 // 待客户发货 + AfterServicePackageSendAlready = 3 // 客户已发货 ) type afterService struct { From a5a4370cd39fe16914af26b894f8c039d7da9626 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 16:58:08 +0800 Subject: [PATCH 34/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=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/afterService.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/supply/afterService.go b/supply/afterService.go index 1644f56..85c9113 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -129,6 +129,17 @@ type ReplyAfterServiceDetail struct { LogisticsCompany string `json:"logisticsCompany"` WaybillCode string `json:"waybillCode"` SendAt int64 `json:"sendAt"` + PackageSend uint `json:"packageSend"` + AfsPackageSend AfsPackageSend `json:"afsPackageSend"` +} +type AfsPackageSend struct { + Name string `json:"name"` + Mobile string `json:"mobile"` + ZipCode string `json:"zipCode"` + Address string `json:"address"` + LogisticsCompany string `json:"logisticsCompany"` + WaybillCode string `json:"waybillCode"` + SendGoodsDate int64 `json:"sendGoodsDate"` } // Detail @Title 售后详情 From 76b432701e5dc94b4cd1e1f8c9d785e19015adfd Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 30 Nov 2022 17:11:45 +0800 Subject: [PATCH 35/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=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/channel/afterService.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index e5e11c5..eceb20a 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -185,8 +185,6 @@ func (a *afterService) Lists(ctx context.Context, channelId string, args ArgsAft type ReplyAfterServiceDetail struct { Id uint `json:"id"` AfsSn string `json:"afsSn"` - ReceiverName string `json:"receiverName"` - ReceiverMobile string `json:"receiverMobile"` Status uint `json:"status"` Result string `json:"result"` CreatedAt int64 `json:"createdAt"` @@ -202,6 +200,17 @@ type ReplyAfterServiceDetail struct { LogisticsCompany string `json:"logisticsCompany"` WaybillCode string `json:"waybillCode"` SendAt int64 `json:"sendAt"` + PackageSend uint `json:"packageSend"` + AfsPackageSend AfsPackageSend `json:"afsPackageSend"` +} +type AfsPackageSend struct { + Name string `json:"name"` + Mobile string `json:"mobile"` + ZipCode string `json:"zipCode"` + Address string `json:"address"` + LogisticsCompany string `json:"logisticsCompany"` + WaybillCode string `json:"waybillCode"` + SendGoodsDate int64 `json:"sendGoodsDate"` } // Detail @Title 售后详情 From a0485cb6fb3de590305946d73877fe8003800b0e Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 10:02:12 +0800 Subject: [PATCH 36/79] =?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/sku.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index 08de840..22a02f4 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -115,8 +115,11 @@ type SkuListsSearch struct { SourceSkuId uint // 供应商skuId BrandId uint // 品牌Id FirstCategoryId uint // 一级分类Id + FirstCategoryIds []uint // 一级分类ids SecondCategoryId uint // 二级分类Id + SecondCategoryIds []uint // 二级分类Ids ThirdCategoryId uint // 三级分类Id + ThirdCategoryIds []uint // 三级分类Ids AdjustType uint // 加价规则 MaxSupplyPrice decimal.Decimal // 最大采购价格 MinSupplyPrice decimal.Decimal // 最小采购价格 From 63062ca770dd303cefe704a4b449f26b5146f9a0 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 10:05:31 +0800 Subject: [PATCH 37/79] =?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/sku.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/sku.go b/supply/sku.go index 22a02f4..653560c 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -114,6 +114,7 @@ type SkuListsSearch struct { SourceId uint // 所属供应商 1=京东 SourceSkuId uint // 供应商skuId BrandId uint // 品牌Id + BrandIds []uint // 品牌Ids FirstCategoryId uint // 一级分类Id FirstCategoryIds []uint // 一级分类ids SecondCategoryId uint // 二级分类Id From 1973793f4af593225bacb7e0248a35d5fc8e465f Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 10:38:02 +0800 Subject: [PATCH 38/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=A9=E6=B5=81?= =?UTF-8?q?=E5=85=AC=E5=8F=B8rpc=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/logisticsCompany.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 supplier/logisticsCompany.go diff --git a/supplier/logisticsCompany.go b/supplier/logisticsCompany.go new file mode 100644 index 0000000..4182617 --- /dev/null +++ b/supplier/logisticsCompany.go @@ -0,0 +1,25 @@ +package supplier + +import ( + "git.oa00.com/supply-chain/service/client" + "golang.org/x/net/context" +) + +type logisticsCompany struct { +} + +type CompanyItem struct { + Id uint `json:"id"` + Name string `json:"name"` +} + +// Select @Title 物流公司筛选 +func (l *logisticsCompany) Select(ctx context.Context) (reply []CompanyItem, err error) { + xClient, err := client.GetClient(l) + if err != nil { + return nil, err + } + args := 0 + err = xClient.Call(ctx, "Select", args, &reply) + return +} From b0764187e6978674333a778e4bdc535a6aadbd54 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 10:40:50 +0800 Subject: [PATCH 39/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/supplier.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/supplier/supplier.go b/supplier/supplier.go index 64fafe3..ad462d1 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -95,15 +95,16 @@ func (s *supplier) Disabled(ctx context.Context, supplierId uint) error { } type ReplySupplierInfo struct { - SupplierId uint - SupplierName string // 供应商名称 - Account string // 账户名 - PayType uint // 结算方式 - Liaison string // 联系人 - Phone string // 手机号 - Annex string // 附件 - WarnStatus uint // 预警状态 - WarnValue decimal.Decimal // 预警值 + SupplierId uint + SupplierName string // 供应商名称 + Account string // 账户名 + PayType uint // 结算方式 + Liaison string // 联系人 + Phone string // 手机号 + Annex string // 附件 + WarnStatus uint // 预警状态 + WarnValue decimal.Decimal // 预警值 + LogisticsCompany logisticsCompany // 物流公司 } // Info @Title 供应商详情 From 6d713315a3f6687f8e32c8b4f5e8b0a40df5708d Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 10:42:58 +0800 Subject: [PATCH 40/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/supplier.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/supplier/supplier.go b/supplier/supplier.go index ad462d1..76a8c7e 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -11,8 +11,9 @@ type Supplier struct { Goods goods Apply supplierApply supplier - WarnLiaison warnLiaison - WalletApply supplierWalletApply + WarnLiaison warnLiaison + WalletApply supplierWalletApply + LogisticsCompany logisticsCompany } type supplier struct { @@ -95,16 +96,15 @@ func (s *supplier) Disabled(ctx context.Context, supplierId uint) error { } type ReplySupplierInfo struct { - SupplierId uint - SupplierName string // 供应商名称 - Account string // 账户名 - PayType uint // 结算方式 - Liaison string // 联系人 - Phone string // 手机号 - Annex string // 附件 - WarnStatus uint // 预警状态 - WarnValue decimal.Decimal // 预警值 - LogisticsCompany logisticsCompany // 物流公司 + SupplierId uint + SupplierName string // 供应商名称 + Account string // 账户名 + PayType uint // 结算方式 + Liaison string // 联系人 + Phone string // 手机号 + Annex string // 附件 + WarnStatus uint // 预警状态 + WarnValue decimal.Decimal // 预警值 } // Info @Title 供应商详情 From 96e06151b0b3d12b981b7050673c6218f547cc11 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Dec 2022 14:07:19 +0800 Subject: [PATCH 41/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=90=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85rpc=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/order.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/supply/channel/order.go b/supply/channel/order.go index 976e974..e07a39d 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -279,6 +279,16 @@ func (o *order) Detail(ctx context.Context, channelId string, orderSn string) (r return } +// SubDetail @Title 子订单详情 +func (o *order) SubDetail(ctx context.Context, channelId, orderSn string) (reply OrderItem, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubDetail", orderSn, &reply) + return +} + // Trajectory @Title 获取订单物流信息 func (o *order) Trajectory(ctx context.Context, channelId string, orderSn string) (reply []_interface.ReplyTrajectory, err error) { xClient, err := client.GetClient(o) From b5f043b55a541c4014d2d73b039d9194ae633b36 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 12:00:41 +0800 Subject: [PATCH 42/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 52 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index 85c9113..cb0a898 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -92,20 +92,62 @@ func (a *afterService) Receipt(ctx context.Context, args ArgsAfterServiceReceipt return } -type ArgsAfterServiceReject struct { +type ArgsAfterServiceClose struct { + Source source `json:"source"` SourceAfsSn string `json:"sourceAfsSn"` SourceSkuId string `json:"sourceSkuId"` - SourceOrderSN string `json:"sourceOrderSN"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` +} + +// Close @Title 关闭售后单 +func (a *afterService) Close(ctx context.Context, args ArgsAfterServiceClose) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + err = xClient.Call(ctx, "Close", args, &reply) + return +} + +type ArgsAfterServiceRefund struct { + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + RefundFee decimal.Decimal `json:"refundFee"` +} + +// Refund @Title 退款 +func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceClose) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + err = xClient.Call(ctx, "Refund", args, &reply) + return +} + +type ArgsAfterServiceNewOrder struct { + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + NewSourceOrderSn decimal.Decimal `json:"newSourceOrderSn"` } -// Reject @Title 驳回 -func (a *afterService) Reject(ctx context.Context, args ArgsAfterServiceReject) (err error) { +// NewOrder @Title 新订单 +func (a *afterService) NewOrder(ctx context.Context, args ArgsAfterServiceNewOrder) (err error) { xClient, err := client.GetClient(a) if err != nil { return err } reply := 0 - err = xClient.Call(ctx, "Reject", args, &reply) + err = xClient.Call(ctx, "NewOrder", args, &reply) return } From 977e3c6af8b0b6d04ce0b70a4caec3ce48e6efa9 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 13:48:14 +0800 Subject: [PATCH 43/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index cb0a898..1a52350 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -61,7 +61,7 @@ func (a *afterService) RetailAfsHistory(ctx context.Context, args ArgsRetailHist type ArgsAfterServiceDeliver struct { SourceAfsSn string `json:"sourceAfsSn"` SourceSkuId string `json:"sourceSkuId"` - SourceOrderSN string `json:"sourceOrderSN"` + SourceOrderSn string `json:"sourceOrderSn"` } // Deliver @Title 需要发货 @@ -121,7 +121,7 @@ type ArgsAfterServiceRefund struct { } // Refund @Title 退款 -func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceClose) (err error) { +func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceRefund) (err error) { xClient, err := client.GetClient(a) if err != nil { return err @@ -132,12 +132,12 @@ func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceClose) ( } type ArgsAfterServiceNewOrder struct { - Source source `json:"source"` - SourceAfsSn string `json:"sourceAfsSn"` - SourceSkuId string `json:"sourceSkuId"` - SourceOrderSn string `json:"sourceOrderSn"` - Result string `json:"result"` - NewSourceOrderSn decimal.Decimal `json:"newSourceOrderSn"` + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + NewSourceOrderSn string `json:"newSourceOrderSn"` } // NewOrder @Title 新订单 From 72707069f701e88ff8f92c4b4f0ae3fb8bd9d779 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 14:22:43 +0800 Subject: [PATCH 44/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index 1a52350..329aafe 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -132,12 +132,18 @@ func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceRefund) } type ArgsAfterServiceNewOrder struct { - Source source `json:"source"` - SourceAfsSn string `json:"sourceAfsSn"` - SourceSkuId string `json:"sourceSkuId"` - SourceOrderSn string `json:"sourceOrderSn"` - Result string `json:"result"` - NewSourceOrderSn string `json:"newSourceOrderSn"` + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + NewSourceOrderSn string `json:"newSourceOrderSn"` + Skus []NewOrderSku `json:"skus"` +} +type NewOrderSku struct { + SourceSkuId string `json:"sourceSkuId"` + Quantity uint `json:"quantity"` + Name string `json:"name"` } // NewOrder @Title 新订单 From 066f2f3e5cd5526546a8bc18bde074b3c6d7c6f5 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 15:24:11 +0800 Subject: [PATCH 45/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index 329aafe..44afb40 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -112,12 +112,14 @@ func (a *afterService) Close(ctx context.Context, args ArgsAfterServiceClose) (e } type ArgsAfterServiceRefund struct { - Source source `json:"source"` - SourceAfsSn string `json:"sourceAfsSn"` - SourceSkuId string `json:"sourceSkuId"` - SourceOrderSn string `json:"sourceOrderSn"` - Result string `json:"result"` - RefundFee decimal.Decimal `json:"refundFee"` + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + RefundFee decimal.Decimal `json:"refundFee"` + RefundOrderFee decimal.Decimal `json:"refundOrderFee"` + RefundFreightFee decimal.Decimal `json:"refundFreightFee"` } // Refund @Title 退款 From 9c45768c4ebb14e6749e4a597eabd8d4f8a74386 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 2 Dec 2022 17:18:46 +0800 Subject: [PATCH 46/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/afterService.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index 44afb40..965e117 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -62,6 +62,7 @@ type ArgsAfterServiceDeliver struct { SourceAfsSn string `json:"sourceAfsSn"` SourceSkuId string `json:"sourceSkuId"` SourceOrderSn string `json:"sourceOrderSn"` + ApproveNotes string `json:"approveNotes"` } // Deliver @Title 需要发货 @@ -98,6 +99,7 @@ type ArgsAfterServiceClose struct { SourceSkuId string `json:"sourceSkuId"` SourceOrderSn string `json:"sourceOrderSn"` Result string `json:"result"` + ApproveNotes string `json:"approveNotes"` } // Close @Title 关闭售后单 @@ -120,6 +122,7 @@ type ArgsAfterServiceRefund struct { RefundFee decimal.Decimal `json:"refundFee"` RefundOrderFee decimal.Decimal `json:"refundOrderFee"` RefundFreightFee decimal.Decimal `json:"refundFreightFee"` + ApproveNotes string `json:"approveNotes"` } // Refund @Title 退款 @@ -134,12 +137,13 @@ func (a *afterService) Refund(ctx context.Context, args ArgsAfterServiceRefund) } type ArgsAfterServiceNewOrder struct { - Source source `json:"source"` - SourceAfsSn string `json:"sourceAfsSn"` - SourceSkuId string `json:"sourceSkuId"` - SourceOrderSn string `json:"sourceOrderSn"` - Result string `json:"result"` - NewSourceOrderSn string `json:"newSourceOrderSn"` + Source source `json:"source"` + SourceAfsSn string `json:"sourceAfsSn"` + SourceSkuId string `json:"sourceSkuId"` + SourceOrderSn string `json:"sourceOrderSn"` + Result string `json:"result"` + NewSourceOrderSn string `json:"newSourceOrderSn"` + ApproveNotes string Skus []NewOrderSku `json:"skus"` } type NewOrderSku struct { From 6b15e8268d45825799487064b5fdcb15d8301d55 Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 5 Dec 2022 11:19:09 +0800 Subject: [PATCH 47/79] =?UTF-8?q?=E4=BA=AC=E4=B8=9Csdk=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 3 ++- go.sum | 2 ++ jd/jd.go | 3 +++ jd/jdsdk/afterSale.go | 20 ++++++++++++++++++++ jd/jdsdk/jdsdk.go | 7 +++++++ jd/jdsdk/order.go | 20 ++++++++++++++++++++ jd/jdsdk/sku.go | 30 ++++++++++++++++++++++++++++++ 7 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 jd/jdsdk/afterSale.go create mode 100644 jd/jdsdk/jdsdk.go create mode 100644 jd/jdsdk/order.go create mode 100644 jd/jdsdk/sku.go diff --git a/go.mod b/go.mod index 23c1b4e..0736edf 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,11 @@ module git.oa00.com/supply-chain/service go 1.18 require ( + git.oa00.com/go/jdsdk v1.0.0 github.com/rpcxio/rpcx-consul v0.0.0-20220730062257-1ff0472e730f github.com/shopspring/decimal v1.3.1 github.com/smallnest/rpcx v1.7.8 + golang.org/x/net v0.0.0-20220708220712-1185a9018129 ) require ( @@ -66,7 +68,6 @@ require ( github.com/xtaci/kcp-go v5.4.20+incompatible // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect golang.org/x/tools v0.1.11 // indirect diff --git a/go.sum b/go.sum index 6ab245b..ae46baf 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +git.oa00.com/go/jdsdk v1.0.0 h1:xsxZlcPrRoJ47PNU49Xtb+m8K/XaHu3pDljSSd9lYAo= +git.oa00.com/go/jdsdk v1.0.0/go.mod h1:ZLdq5OMaXWHO9wtXJflhysp3cSVLRJHbxHLE1DpKYdY= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/akutz/memconn v0.1.0 h1:NawI0TORU4hcOMsMr11g7vwlCdkYeLKXBcxWu2W/P8A= diff --git a/jd/jd.go b/jd/jd.go index aa5cb0f..7233742 100644 --- a/jd/jd.go +++ b/jd/jd.go @@ -1,8 +1,11 @@ package jd +import "git.oa00.com/supply-chain/service/jd/jdsdk" + type Jd struct { Task task Brand brand Category category Sku sku + Jdsdk jdsdk.Jdsdk } diff --git a/jd/jdsdk/afterSale.go b/jd/jdsdk/afterSale.go new file mode 100644 index 0000000..1a3999a --- /dev/null +++ b/jd/jdsdk/afterSale.go @@ -0,0 +1,20 @@ +package jdsdk + +import ( + "context" + order2 "git.oa00.com/go/jdsdk/order" + "git.oa00.com/supply-chain/service/client" +) + +type afterSale struct { +} + +// Info @Title 售后详情 +func (a *afterSale) Info(ctx context.Context, afsServiceId uint64) (reply order2.AfterSaleInfo, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "Info", afsServiceId, &reply) + return +} diff --git a/jd/jdsdk/jdsdk.go b/jd/jdsdk/jdsdk.go new file mode 100644 index 0000000..7f0e207 --- /dev/null +++ b/jd/jdsdk/jdsdk.go @@ -0,0 +1,7 @@ +package jdsdk + +type Jdsdk struct { + Order order + Sku sku + AfterSale afterSale +} diff --git a/jd/jdsdk/order.go b/jd/jdsdk/order.go new file mode 100644 index 0000000..caad38a --- /dev/null +++ b/jd/jdsdk/order.go @@ -0,0 +1,20 @@ +package jdsdk + +import ( + "context" + order2 "git.oa00.com/go/jdsdk/order" + "git.oa00.com/supply-chain/service/client" +) + +type order struct { +} + +// Cancel @Title 订单取消 京东订单id +func (o *order) Cancel(ctx context.Context, orderId string) (reply order2.OrderInfo, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(ctx, "Cancel", orderId, &reply) + return +} diff --git a/jd/jdsdk/sku.go b/jd/jdsdk/sku.go new file mode 100644 index 0000000..3b85219 --- /dev/null +++ b/jd/jdsdk/sku.go @@ -0,0 +1,30 @@ +package jdsdk + +import ( + "context" + sku2 "git.oa00.com/go/jdsdk/sku" + "git.oa00.com/supply-chain/service/client" +) + +type sku struct { +} + +// GetDetail @Title 获取商品详情 sku最大20 +func (s *sku) GetDetail(ctx context.Context, jdSkuIds []uint64) (reply []sku2.Detail, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "GetDetail", jdSkuIds, &reply) + return +} + +// GetPriceList @Title 获取商品价格列表 最大100 +func (s *sku) GetPriceList(ctx context.Context, jdSkuIds []uint64) (reply []sku2.PriceItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "GetPriceList", jdSkuIds, &reply) + return +} From cccc84c73e13306f06cf3b7634d62f55fc8d4285 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 5 Dec 2022 16:02:20 +0800 Subject: [PATCH 48/79] =?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/afterService.go | 1 + supply/channel/afterService.go | 1 + 2 files changed, 2 insertions(+) diff --git a/supply/afterService.go b/supply/afterService.go index 965e117..6ca3af4 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -167,6 +167,7 @@ type ReplyAfterServiceDetail struct { Id uint `json:"id"` AfsSn string `json:"afsSn"` Status uint `json:"status"` + ApproveNotes string `json:"approveNotes"` Result string `json:"result"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index eceb20a..bf76683 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -186,6 +186,7 @@ type ReplyAfterServiceDetail struct { Id uint `json:"id"` AfsSn string `json:"afsSn"` Status uint `json:"status"` + ApproveNotes string `json:"approveNotes"` Result string `json:"result"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` From 9ab6a30499315ec1271506131934fcd661168da5 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 09:53:09 +0800 Subject: [PATCH 49/79] =?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/afterService.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/supply/afterService.go b/supply/afterService.go index 6ca3af4..17a2096 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -58,6 +58,46 @@ func (a *afterService) RetailAfsHistory(ctx context.Context, args ArgsRetailHist return } +type ArgsAfsLists struct { + Search AfsListSearch `json:"search"` + Page bean.Page `json:"page"` +} + +type AfsListSearch struct { + Status uint `json:"status"` + AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` + CreatedStartDate string `json:"createdStartAt"` + CreatedEndDate string `json:"createdEndAt"` +} + +type ReplyAfsLists struct { + Lists []AfsItem `json:"lists"` + Total int64 `json:"total"` +} + +type AfsItem struct { + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` + SkuName string `json:"skuName"` + Quantity uint `json:"quantity"` + Status uint `json:"status"` + Result string `json:"result"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` +} + +// Lists @Title 售后列表 +func (a *afterService) Lists(ctx context.Context, args ArgsAfsLists) (reply []ReplyAfsLists, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + type ArgsAfterServiceDeliver struct { SourceAfsSn string `json:"sourceAfsSn"` SourceSkuId string `json:"sourceSkuId"` From cbfc157ef27a4d806e7f4a22312899f9c6b882d7 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 10:00:47 +0800 Subject: [PATCH 50/79] =?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/afterService.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/afterService.go b/supply/afterService.go index 17a2096..76080f7 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -89,7 +89,7 @@ type AfsItem struct { } // Lists @Title 售后列表 -func (a *afterService) Lists(ctx context.Context, args ArgsAfsLists) (reply []ReplyAfsLists, err error) { +func (a *afterService) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists, err error) { xClient, err := client.GetClient(a) if err != nil { return nil, err From aacb78510b6f1e8115d540c15620650e590594b3 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 10:01:29 +0800 Subject: [PATCH 51/79] =?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/afterService.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/afterService.go b/supply/afterService.go index 76080f7..887fb3c 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -92,7 +92,7 @@ type AfsItem struct { func (a *afterService) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists, err error) { xClient, err := client.GetClient(a) if err != nil { - return nil, err + return ReplyAfsLists{}, err } err = xClient.Call(ctx, "Lists", args, &reply) return From acb7f9a9c299271d93a78dc83db43cfc4585a982 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 11:21:42 +0800 Subject: [PATCH 52/79] =?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/afterService.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/supply/afterService.go b/supply/afterService.go index 887fb3c..ff37887 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -263,3 +263,28 @@ func (a *afterService) LogisticsAddress(ctx context.Context, afsSn string) (repl err = xClient.Call(ctx, "LogisticsAddress", afsSn, &reply) return } + +type ReplyAfsInfoById struct { + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + SourceAfsSn string `json:"sourceAfsSn"` + SkuId uint `json:"skuId"` + SourceSkuId string `json:"sourceSkuId"` + SourceId uint `json:"sourceId"` + OrderSn string `json:"orderSn"` + ChannelOrderSn string `json:"ChannelOrderSn"` + OrderFee decimal.Decimal `json:"orderFee"` + SourceOrderFee decimal.Decimal `json:"sourceOrderFee"` + FreightFee decimal.Decimal `json:"freightFee"` + ApproveNotes string `json:"approveNotes"` +} + +// FindByAfsId @Title 获取售后信息 +func (a *afterService) FindByAfsId(ctx context.Context, afsId uint) (reply ReplyAfsInfoById, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByAfsId", afsId, &reply) + return +} From 6c209fa4a5756b8a295a1ad9987ad8adf74d2a2c Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 11:30:47 +0800 Subject: [PATCH 53/79] =?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/afterService.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index ff37887..b5f90b1 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -271,8 +271,8 @@ type ReplyAfsInfoById struct { SkuId uint `json:"skuId"` SourceSkuId string `json:"sourceSkuId"` SourceId uint `json:"sourceId"` - OrderSn string `json:"orderSn"` - ChannelOrderSn string `json:"ChannelOrderSn"` + OrderSubSn string `json:"orderSn"` + SourceOrderSn string `json:"SourceOrderSn"` OrderFee decimal.Decimal `json:"orderFee"` SourceOrderFee decimal.Decimal `json:"sourceOrderFee"` FreightFee decimal.Decimal `json:"freightFee"` From a01196e9d2c1edaa2f95bad4ee9578d5b22c2c13 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 13:11:39 +0800 Subject: [PATCH 54/79] =?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/afterService.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/afterService.go b/supply/afterService.go index b5f90b1..af32f8a 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -80,6 +80,7 @@ type AfsItem struct { Id uint `json:"id"` AfsSn string `json:"afsSn"` OrderSubSn string `json:"orderSubSn"` + SourceId uint `json:"sourceId"` SkuName string `json:"skuName"` Quantity uint `json:"quantity"` Status uint `json:"status"` From 14a92a60f61aec52e43f79be183769cda44fb0d9 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 13:20:12 +0800 Subject: [PATCH 55/79] =?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/afterService.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index af32f8a..ad66beb 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -77,16 +77,17 @@ type ReplyAfsLists struct { } type AfsItem struct { - Id uint `json:"id"` - AfsSn string `json:"afsSn"` - OrderSubSn string `json:"orderSubSn"` - SourceId uint `json:"sourceId"` - SkuName string `json:"skuName"` - Quantity uint `json:"quantity"` - Status uint `json:"status"` - Result string `json:"result"` - CreatedAt int64 `json:"createdAt"` - UpdatedAt int64 `json:"updatedAt"` + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` + SourceId uint `json:"sourceId"` + SkuName string `json:"skuName"` + Quantity uint `json:"quantity"` + Status uint `json:"status"` + Result string `json:"result"` + Price decimal.Decimal `json:"price"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` } // Lists @Title 售后列表 From ed181e47d169d914777a5ed0dbb7e008e516f109 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 13:25:14 +0800 Subject: [PATCH 56/79] =?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/afterService.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/supply/afterService.go b/supply/afterService.go index ad66beb..fd07646 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -77,17 +77,18 @@ type ReplyAfsLists struct { } type AfsItem struct { - Id uint `json:"id"` - AfsSn string `json:"afsSn"` - OrderSubSn string `json:"orderSubSn"` - SourceId uint `json:"sourceId"` - SkuName string `json:"skuName"` - Quantity uint `json:"quantity"` - Status uint `json:"status"` - Result string `json:"result"` - Price decimal.Decimal `json:"price"` - CreatedAt int64 `json:"createdAt"` - UpdatedAt int64 `json:"updatedAt"` + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` + SourceId uint `json:"sourceId"` + SourceSkuId string `json:"sourceSkuId"` + SkuName string `json:"skuName"` + Quantity uint `json:"quantity"` + Status uint `json:"status"` + Result string `json:"result"` + Price decimal.Decimal `json:"price"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` } // Lists @Title 售后列表 From ddedf6096d5c8f385d224ce0e3b17c15885ab659 Mon Sep 17 00:00:00 2001 From: sian Date: Tue, 6 Dec 2022 13:50:49 +0800 Subject: [PATCH 57/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=80=E8=B4=A7?= =?UTF-8?q?=E5=9C=B0=E5=9D=80rpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/returnAddress.go | 30 ++++++++++++++++++++++++++++++ supplier/supplier.go | 1 + 2 files changed, 31 insertions(+) create mode 100644 supplier/returnAddress.go diff --git a/supplier/returnAddress.go b/supplier/returnAddress.go new file mode 100644 index 0000000..edc0f09 --- /dev/null +++ b/supplier/returnAddress.go @@ -0,0 +1,30 @@ +package supplier + +import ( + "git.oa00.com/supply-chain/service/client" + "golang.org/x/net/context" +) + +type returnAddress struct { +} + +type ReplyReturnAddressAll struct { + SupplierId uint `json:"supplierId"` + Item []ReturnAddressItem `json:"item"` +} + +type ReturnAddressItem struct { + Id uint `json:"id"` + Address string `json:"name"` +} + +// All @Title 全部退货地址 +func (r *returnAddress) All(ctx context.Context) (reply []ReplyReturnAddressAll, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return nil, err + } + args := 0 + err = xClient.Call(ctx, "All", args, &reply) + return +} diff --git a/supplier/supplier.go b/supplier/supplier.go index 76a8c7e..28ed1c9 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -14,6 +14,7 @@ type Supplier struct { WarnLiaison warnLiaison WalletApply supplierWalletApply LogisticsCompany logisticsCompany + ReturnAddress returnAddress } type supplier struct { From 6410e7bdb9dc4bbb1c1cd567b4891affa22c13de Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 7 Dec 2022 09:26:14 +0800 Subject: [PATCH 58/79] =?UTF-8?q?=E5=94=AE=E5=90=8E=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/mq.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supply/channel/mq.go b/supply/channel/mq.go index e5db283..4c2af00 100644 --- a/supply/channel/mq.go +++ b/supply/channel/mq.go @@ -13,6 +13,10 @@ const ( MqSubscribeNameOrderStockOut = "order_stock_out" // 订单出库 MqSubscribeNameOrderFinish = "order_finish" // 订单完成 MqSubscribeNameOrderCancel = "order_cancel" // 订单取消 + MqSubscribeNameAfsDeliver = "afs_deliver" // 需要客户发货 + MqSubscribeNameAfsWait = "afs_wait" // 等待收货处理 + MqSubscribeNameAfsClose = "afs_close" // 售后关闭 + MqSubscribeNameAfsFinish = "afs_finish" // 售后完成 ) type mq struct { From c195c6cd1d4beffb55b4f88b36a8baf2e95c5b26 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 7 Dec 2022 15:38:31 +0800 Subject: [PATCH 59/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 supplier/afs.go diff --git a/supplier/afs.go b/supplier/afs.go new file mode 100644 index 0000000..87bed24 --- /dev/null +++ b/supplier/afs.go @@ -0,0 +1,108 @@ +package supplier + +import ( + "git.oa00.com/supply-chain/service/client" + "github.com/shopspring/decimal" + "golang.org/x/net/context" +) + +type afs struct { +} + +type ArgsAfsReject struct { + AfsSn string `json:"afsSn"` + Notes string `json:"notes"` +} + +// Reject @Title 审核驳回 +func (a *afs) Reject(ctx context.Context, args ArgsAfsReject) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Reject", args, &reply) + return +} + +type ArgsAfsDeliver struct { + AfsSn string `json:"afsSn"` + ReturnAddressId uint `json:"returnAddressId"` + Notes string `json:"notes"` +} + +// Deliver @Title 待客户发货 +func (a *afs) Deliver(ctx context.Context, args ArgsAfsDeliver) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Deliver", args, &reply) + return +} + +type ArgsAfsRefund struct { + AfsSn string `json:"afsSn"` + Notes string `json:"notes"` +} + +// Refund @Title 退款 +func (a *afs) Refund(ctx context.Context, args ArgsAfsRefund) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Refund", args, &reply) + return +} + +type ArgsAfsCompensate struct { + AfsSn string `json:"afsSn"` + RefundFee decimal.Decimal `json:"refundFee"` + Notes string `json:"notes"` +} + +// Compensate @Title 订单赔偿 +func (a *afs) Compensate(ctx context.Context, args ArgsAfsCompensate) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Compensate", args, &reply) + return +} + +type ArgsAfsCompensateSku struct { + AfsSn string `json:"afsSn"` + Notes string `json:"notes"` +} + +// CompensateSku @Title 直赔商品 +func (a *afs) CompensateSku(ctx context.Context, args ArgsAfsCompensateSku) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "CompensateSku", args, &reply) + return +} + +type ArgsAfsReissue struct { + AfsSn string `json:"afsSn"` + Notes string `json:"notes"` +} + +// Reissue @Title 补发商品 +func (a *afs) Reissue(ctx context.Context, args ArgsAfsReissue) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Reissue", args, &reply) + return +} From 511392ecc5c6644102727e49b12a3e9537b38975 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 7 Dec 2022 15:41:18 +0800 Subject: [PATCH 60/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/supplier.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supplier/supplier.go b/supplier/supplier.go index 28ed1c9..9b6fc29 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -15,6 +15,7 @@ type Supplier struct { WalletApply supplierWalletApply LogisticsCompany logisticsCompany ReturnAddress returnAddress + Afs afs } type supplier struct { From 1d0c5bfc616bda48563269144c538aa5a91f3938 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 7 Dec 2022 16:25:05 +0800 Subject: [PATCH 61/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/supplier/afs.go b/supplier/afs.go index 87bed24..3a4d5f4 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -2,6 +2,7 @@ package supplier import ( "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" "golang.org/x/net/context" ) @@ -9,6 +10,47 @@ import ( type afs struct { } +type ArgsAfsLists struct { + Search AfsSearch + Page bean.Page +} + +type AfsSearch struct { + Status uint + AfsSn string + OrderSubSn string + CreatedStartDate string + CreatedEndDate string +} + +type ReplyAfsLists struct { + Lists []AfsItem + Total int64 +} + +type AfsItem struct { + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` + SkuName string `json:"skuName"` + Quantity uint `json:"quantity"` + Status uint `json:"status"` + Result string `json:"result"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` + ReturnAddress []ReturnAddressItem `json:"returnAddress"` +} + +// Lists @Title 售后列表 +func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + type ArgsAfsReject struct { AfsSn string `json:"afsSn"` Notes string `json:"notes"` From ec6c8b7370b629db826aad09c821dcaf4c357d91 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 7 Dec 2022 16:27:30 +0800 Subject: [PATCH 62/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E5=8F=91?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc.go | 10 +- wholesale/brand.go | 103 ++++++++ wholesale/category.go | 77 ++++++ wholesale/setting/rate.go | 41 +++ wholesale/setting/setting.go | 5 + wholesale/sku.go | 479 +++++++++++++++++++++++++++++++++++ wholesale/skuAudit.go | 191 ++++++++++++++ wholesale/source.go | 30 +++ wholesale/wholesale.go | 12 + 9 files changed, 944 insertions(+), 4 deletions(-) create mode 100644 wholesale/brand.go create mode 100644 wholesale/category.go create mode 100644 wholesale/setting/rate.go create mode 100644 wholesale/setting/setting.go create mode 100644 wholesale/sku.go create mode 100644 wholesale/skuAudit.go create mode 100644 wholesale/source.go create mode 100644 wholesale/wholesale.go diff --git a/rpc.go b/rpc.go index f53982f..3046df6 100644 --- a/rpc.go +++ b/rpc.go @@ -5,13 +5,15 @@ import ( "git.oa00.com/supply-chain/service/jd" "git.oa00.com/supply-chain/service/supplier" "git.oa00.com/supply-chain/service/supply" + "git.oa00.com/supply-chain/service/wholesale" ) var Rpc = &rpc{} type rpc struct { - Supply supply.Supply - Jd jd.Jd - Customer customer.Customer - Supplier supplier.Supplier + Supply supply.Supply + Jd jd.Jd + Customer customer.Customer + Supplier supplier.Supplier + Wholesale wholesale.Wholesale } diff --git a/wholesale/brand.go b/wholesale/brand.go new file mode 100644 index 0000000..231096b --- /dev/null +++ b/wholesale/brand.go @@ -0,0 +1,103 @@ +package wholesale + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +type brand struct { +} + +type ArgsBrandList struct { + Search BrandSearch + Page bean.Page +} + +type BrandItem struct { + Id uint `json:"id"` + Name string `json:"name"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` +} +type ReplyBrandList struct { + Lists []BrandItem `json:"lists"` + Total int64 `json:"total"` +} + +type BrandSearch struct { + Name string // 品牌名称 +} + +// Lists @Title 品牌列表 +func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBrandList, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &result) + return +} + +// All @Title 全部品牌 +func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "All", 0, &result) + return +} + +// FindByNameAll @Title 品牌名称筛选品牌 +func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByNameAll", name, &result) + return +} + +type ArgsBrandAdd struct { + Name string // 品牌名称 +} + +// Add @Title 添加品牌 +func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Add", args, &reply) +} + +type ArgsBrandEdit struct { + BrandId uint // 品牌id + Name string // 品牌名称 +} + +// Edit @Title 编辑品牌 +func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Edit", args, &reply) +} + +type ArgsBrandFindByIds struct { + BrandIds []uint // 品牌id数组 +} + +// FindByIds @Title 品牌获取 +func (b *brand) FindByIds(ctx context.Context, args ArgsBrandFindByIds) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByIds", args, &result) + return +} diff --git a/wholesale/category.go b/wholesale/category.go new file mode 100644 index 0000000..6d6295d --- /dev/null +++ b/wholesale/category.go @@ -0,0 +1,77 @@ +package wholesale + +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + +type category struct { +} + +type CategoryItem struct { + Id uint `json:"id"` + Name string `json:"name"` + ParentId uint `json:"parentId"` + Children []CategoryItem `json:"children"` +} + +// All @Title 获取分类 +func (c *category) All(ctx context.Context) (result []CategoryItem, err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + err = xClient.Call(ctx, "All", 0, &result) + return +} + +type ArgsCategoryAdd struct { + Name string // 分类名称 + ParentId uint // 上级id +} + +// Add @Title 添加分类 +func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) { + reply := 0 + xClient, err := client.GetClient(c) + if err != nil { + return + } + return xClient.Call(ctx, "Add", args, &reply) +} + +type ArgsCategoryEdit struct { + CategoryId uint // 分类id + Name string // 分类名称 + ParentId uint // 上级id +} + +// Edit @Title 编辑分类 +func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error) { + reply := 0 + xClient, err := client.GetClient(c) + if err != nil { + return + } + return xClient.Call(ctx, "Edit", args, &reply) +} + +type ArgsCategoryFindByIds struct { + ThirdCategoryIds []uint // 三级分类id数组 +} +type ThirdCategoryItem struct { + Id uint `json:"id"` + Name string `json:"name"` + ParentId uint `json:"parentId"` + Parent *ThirdCategoryItem `json:"parent"` +} + +// FindByIds @Title 三级分类获取 +func (c *category) FindByIds(ctx context.Context, args ArgsCategoryFindByIds) (result []ThirdCategoryItem, err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByIds", args, &result) + return +} diff --git a/wholesale/setting/rate.go b/wholesale/setting/rate.go new file mode 100644 index 0000000..8ffb1fa --- /dev/null +++ b/wholesale/setting/rate.go @@ -0,0 +1,41 @@ +package setting + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "github.com/shopspring/decimal" +) + +type rate struct { +} + +type RateItem struct { + Id uint `json:"id"` + Name string `json:"name"` + Rate decimal.Decimal `json:"rate"` +} + +// All @Title 全部利率 +func (r *rate) All(ctx context.Context) (result []RateItem, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + err = xClient.Call(ctx, "All", 0, &result) + return +} + +type ArgsRateChannel struct { + ChannelId uint // 渠道id + RateId uint // 费率id +} + +// Channel @Title 设置渠道利率 +func (r *rate) Channel(ctx context.Context, args ArgsRateChannel) error { + reply := 0 + xClient, err := client.GetClient(r) + if err != nil { + return err + } + return xClient.Call(ctx, "Channel", args, &reply) +} diff --git a/wholesale/setting/setting.go b/wholesale/setting/setting.go new file mode 100644 index 0000000..50e35c9 --- /dev/null +++ b/wholesale/setting/setting.go @@ -0,0 +1,5 @@ +package setting + +type Setting struct { + Rate rate +} diff --git a/wholesale/sku.go b/wholesale/sku.go new file mode 100644 index 0000000..0b7b8dc --- /dev/null +++ b/wholesale/sku.go @@ -0,0 +1,479 @@ +package wholesale + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type sku struct { +} + +type source uint + +const ( + SkuSourceSupplier source = 2 // 供应链供应商渠道 +) + +const ( + SkuAdjustTypeRate = 1 // 加价比例 + SkuAdjustTypeAmount = 2 // 加价金额 + + SkuPlatformStatusUp = 1 // 平台上架 + SkuPlatformStatusDown = 2 // 平台下架 + + SkuSourceStatusUp = 1 // 供应商上架 + SkuSourceStatusDown = 2 // 供应商下架 + + SkuHandleNone = 1 // 未处理 + SkuHandleFinal = 2 // 已处理 + + SkuAuditStatusNone = 0 // 无 + SkuAuditStatusWait = 1 // 待审核 + SkuAuditStatusAdopt = 2 // 审核通过 + SkuAuditStatusReject = 3 // 审核驳回 + + ProfitGtZero = 1 // 利润比大于0 + ProfitEqZero = 2 // 利润比等于0 + ProfitLtZero = 3 // 利润比小于0 +) + +type ArgsSkuAdd struct { + SourceSkuId string // 源skuId + SourceGroupSkuIds []string // 源skuId关系数组 + SourceStatus uint // 源状态 + Name string // 商品名称 + BrandId uint // 品牌id + ThirdCategoryId uint // 三级分类id + SupplyPrice decimal.Decimal // 采购价 + GuidePrice decimal.Decimal // 指导价-建议售价 + Size string // 尺码 + Color string // 颜色 + Tax string // 税率 + TaxName string // 税收名称 + TaxCode string // 税收编码 + Unit string // 销售单位 + UpcCode string // 商品条码 + Source source // 商品来源 + Content string // 商品详情 + Length decimal.Decimal // 长 + Width decimal.Decimal // 宽 + Height decimal.Decimal // 高 + Weight decimal.Decimal // 重 + PackingRate uint // 装箱率 + StartingBatch uint // 起批量 + InitialFreight decimal.Decimal // 起批运费 + Imgs []SkuImg // 商品图片 第一张主图 + Specifications []SkuSpecification // 商品参数信息 +} + +type SkuImg struct { + Path string `json:"path"` +} + +type SkuSpecification struct { + Name string `json:"name"` + Attributes []SkuAttribute `json:"attributes"` +} + +type SkuAttribute struct { + Name string `json:"name"` + Value []string `json:"value"` +} + +// Add @Title 添加商品 +func (s *sku) Add(ctx context.Context, args ArgsSkuAdd) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Add", args, &reply) +} + +type ArgsSkuAdjust struct { + ApplyUserId uint // 修改人 + SkuIds []uint // 商品id + AdjustType uint // 加价类型 + AdjustPrice decimal.Decimal // 加价金额 +} + +// Adjust @Title 加价 +func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Adjust", args, &reply) +} + +type ArgsSkuLists struct { + Search SkuListsSearch + Page bean.Page +} + +type SkuListsSearch struct { + Id uint // 瑞库客id + Name string // 商品名称 + SourceId uint // 所属供应商 1=京东 + SourceSkuId uint // 供应商skuId + BrandId uint // 品牌Id + BrandIds []uint // 品牌Ids + FirstCategoryId uint // 一级分类Id + FirstCategoryIds []uint // 一级分类ids + SecondCategoryId uint // 二级分类Id + SecondCategoryIds []uint // 二级分类Ids + ThirdCategoryId uint // 三级分类Id + ThirdCategoryIds []uint // 三级分类Ids + AdjustType uint // 加价规则 + MaxSupplyPrice decimal.Decimal // 最大采购价格 + MinSupplyPrice decimal.Decimal // 最小采购价格 + CustomerProfitRate uint // 客户利润比 1=大于0 2=等于0 3=小于0 + Handle uint // 处理状态 + AuditStatus uint // 审核状态 + SourceStatus uint // 供应商下架状态 + PlatformStatus uint // 平台下架状态 + UpcCode string // 商品条码 + Length decimal.Decimal // 长 + Width decimal.Decimal // 宽 + Height decimal.Decimal // 高 + Weight decimal.Decimal // 重 + PackingRate uint // 装箱率 + StartingBatch uint // 起批量 + InitialFreight decimal.Decimal // 起批运费 +} + +type ReplySkuList struct { + Lists []SkuItem `json:"lists"` + Total int64 `json:"total"` +} + +type SkuItem struct { + Id uint `json:"id"` + Name string `json:"name"` // 名称 + BrandName string `json:"brandName"` // 品牌名称 + FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id + SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id + ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id + SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价 + GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价 + ImgUrl string `json:"imgUrl"` // 商品主图 + PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架 + SourceId uint `json:"sourceId"` // 所属供应商 + SourceName string `json:"sourceName"` // 供应商名称 + SourceSkuId string `json:"sourceSkuId"` // 源skuId + SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架 + CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价 + CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% + CustomerDiscount decimal.Decimal `json:"customerDiscount"` // 折扣 + AdjustType uint `json:"adjustType"` // 加价类型 + AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 + AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型 + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额 + AfterPrice decimal.Decimal `json:"afterPrice"` // 改价后金额 + AfterDiscount decimal.Decimal `json:"afterDiscount"` // 改价后折扣 + AdjustAuditStatus uint `json:"adjustAuditStatus"` // 改价审核状态 + Reason string `json:"reason"` // 改价驳回原因 + UpcCode string `json:"upcCode"` // 商品条码 + Color string `json:"color"` // 颜色 + Size string `json:"size"` // 尺寸 + Attributes []AttributeItem `json:"attributes"` // 商品属性 + 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"` // 起批运费 +} + +type AttributeItem struct { + GroupName string `json:"groupName"` + Name string `json:"name"` + Value string `json:"value"` +} + +// Lists @Title 商品列表 +func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) (reply ReplySkuList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +type SkuEsSearch struct { + SourceId uint // 所属供应商 + SourceSonId uint // 沙马供应商的供应商Id + SourceSkuId uint // 供应商SkuId + SourceStatus uint // 供应商上下架状态 1=上架 2=下架 + PlatformStatus uint // 平台上下架状态 1=上架 2=下架 + AuditStatus uint // 改价审核状态 1=待审核 2=通过 3=驳回 + SkuId uint // Sku编码 + SupplySkuId uint // 供应商Sku编码 + SkuName string // 商品名称 + UpcCode string // 商品条码 + BrandId uint // 品牌id + BrandName string // 品牌名称 全词匹配 + FirstCategoryId uint // 一级分类id + FirstCategoryName string // 一级分类名称 全词匹配 + SecondCategoryId uint // 二级分类id + SecondCategoryName string // 二级分类名称 全词匹配 + ThirdCategoryId uint // 三级分类id + ThirdCategoryName string // 三级分类名称 全词匹配 + AdjustType uint // 加价规则 1=比例 2=金额 + Handel uint // 处理状态 + MaxSupplyPrice decimal.Decimal // 最高金额 + MinSupplyPrice decimal.Decimal // 最低金额 + MinDiscount decimal.Decimal // 最低折扣 + MaxDiscount decimal.Decimal // 最高折扣 + AdjustMinDiscount decimal.Decimal // 改价后最小折扣 + AdjustMaxDiscount decimal.Decimal // 改价后最大折扣 + Length decimal.Decimal // 长 + Width decimal.Decimal // 宽 + Height decimal.Decimal // 高 + Weight decimal.Decimal // 重 + PackingRate uint // 装箱率 + StartingBatch uint // 起批量 + InitialFreight decimal.Decimal // 起批运费 +} +type ArgsSkuListsEs struct { + Search SkuEsSearch + Page bean.Page +} + +// ListsEs @Title es商品列表 目前最大10000条数据,超出不显示 +func (s *sku) ListsEs(ctx context.Context, args ArgsSkuListsEs) (reply ReplySkuList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "ListsEs", args, &reply) + return +} + +type SkuInfo struct { + Id uint `json:"id"` + Name string `json:"name"` + SourceSkuId string `json:"jdSkuId"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + CustomerPrice decimal.Decimal `json:"customerPrice"` + GuidePrice decimal.Decimal `json:"guidePrice"` + Profit decimal.Decimal `json:"profit"` + CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` + UpcCode string `json:"upcCode"` + Color string `json:"color"` + Size string `json:"size"` + FirstCategoryName string `json:"firstCategoryName"` + SecondCategoryName string `json:"secondCategoryName"` + ThirdCategoryName string `json:"thirdCategoryName"` + BrandName string `json:"brandName"` + Content string `json:"content"` + Tax string `json:"tax"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` + Unit string `json:"unit"` + Imgs []SkuImgItem `json:"imgs"` + Reason string `json:"reason"` + Specifications []SkuSpecification `json:"specification"` + PlatformStatus uint `json:"platformStatus"` + SourceStatus uint `json:"sourceStatus"` + SourceName string `json:"sourceName"` + AdjustType uint `json:"adjustType"` + AdjustPrice decimal.Decimal `json:"adjustPrice"` + 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"` // 起批运费 +} + +type SkuImgItem struct { + Id uint `json:"id"` + Path string `json:"path"` +} + +// Info @Title 商品信息 +func (s *sku) Info(ctx context.Context, skuId uint) (reply SkuInfo, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Info", skuId, &reply) + return +} + +type ArgsSkuOnShelves struct { + SkuIds []uint +} + +type ArgsSkuDownShelves struct { + SkuIds []uint +} + +// OnShelves @Title 上架 +func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "OnShelves", args, &reply) +} + +// DownShelves @Title 下架 +func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "DownShelves", args, &reply) +} + +// GetImgs @Title 获取预览图 +func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImgItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "GetImgs", skuId, &reply) + return +} + +type ArgsReplaceImg struct { + SkuId uint + Id uint + Path string +} + +// ReplaceImg @Title 替换图片 +func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + err = xClient.Call(ctx, "ReplaceImg", args, &reply) + return +} + +type ArgsSkuChangePrice struct { + SourceSkuId string // 源skuId + SupplyPrice decimal.Decimal // 采购价 + GuidePrice decimal.Decimal // 指导价-建议售价 + Source source // 商品来源 +} + +// ChangePrice @Title 更新价格 +func (s *sku) ChangePrice(ctx context.Context, args ArgsSkuChangePrice) (err error) { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + err = xClient.Call(ctx, "ChangePrice", args, &reply) + return +} + +type ArgsSkuChangeData struct { + SourceSkuId string // 源skuId + SourceStatus uint // 源状态 + Name string // 商品名称 + BrandId uint // 品牌id + ThirdCategoryId uint // 三级分类id + SupplyPrice decimal.Decimal // 采购价 + GuidePrice decimal.Decimal // 指导价-建议售价 + Size string // 尺码 + Color string // 颜色 + Tax string // 税率 + Unit string // 销售单位 + UpcCode string // 商品条码 + Source source // 商品来源 + Specifications []SkuSpecification // 商品参数信息 + Length decimal.Decimal // 长 + Width decimal.Decimal // 宽 + Height decimal.Decimal // 高 + Weight decimal.Decimal // 重 + PackingRate uint // 装箱率 + StartingBatch uint // 起批量 + InitialFreight decimal.Decimal // 起批运费 +} + +// ChangeData @Title 更新商品信息 +func (s *sku) ChangeData(ctx context.Context, args ArgsSkuChangeData) (err error) { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + err = xClient.Call(ctx, "ChangeData", args, &reply) + return +} + +type ByIdsSkuItem struct { + Id uint `json:"id"` + Name string `json:"name"` // 名称 + BrandName string `json:"brandName"` // 品牌名称 + FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id + SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id + ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id + SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价 + GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价 + ImgUrl string `json:"imgUrl"` // 商品主图 + PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架 + SourceName string `json:"sourceName"` // 供应商名称 + SourceSkuId string `json:"sourceSkuId"` // 源skuId + SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架 + CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价 + CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% + AdjustType uint `json:"adjustType"` // 加价类型 + AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 + AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型 + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额 + Handle uint `json:"handle"` // 1=未处理 2=已处理 + Reason string `json:"reason"` // 驳回原因 + Size string `json:"size"` + Color string `json:"color"` + Specifications []SpecItem `json:"specifications"` + 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"` // 起批运费 +} + +type SpecItem struct { + Id uint `json:"id"` + SkuId uint `json:"skuId"` + Name string `json:"name"` + Value string `json:"value"` + GroupName string `json:"groupName"` +} + +// FindByIds @Title 根据Ids查询sku信息 +func (s *sku) FindByIds(ctx context.Context, ids []uint) (reply []ByIdsSkuItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "FindByIds", ids, &reply) + return +} + +// AuthPut @Title 根据sourceSkuId查询供应链是否入库 true=入库 false=没有入库 +func (s *sku) AuthPut(ctx context.Context, sourceSkuIds []uint) (reply bool) { + xClient, err := client.GetClient(s) + if err != nil { + return false + } + err = xClient.Call(ctx, "AuthPut", sourceSkuIds, &reply) + return +} diff --git a/wholesale/skuAudit.go b/wholesale/skuAudit.go new file mode 100644 index 0000000..20a21f6 --- /dev/null +++ b/wholesale/skuAudit.go @@ -0,0 +1,191 @@ +package wholesale + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type skuAudit struct { +} + +type ArgsSkuAuditLists struct { + Search SkuAuditSearch + Page bean.Page +} + +type SkuAuditSearch struct { + SourceId uint // 供应商id + AdjustType uint // 加价类型 + Status uint // 状态 1=未审核 2=通过 3=驳回 +} + +type ArgsSkuAuditEsLists struct { + Search SkuAuditEsSearch + Page bean.Page +} + +type SkuAuditEsSearch struct { + SourceId uint // 供应商id + SourceSonId uint // 沙马供应商的供应商 + AdjustType uint // 加价类型 + Status uint // 状态 1=未审核 2=通过 3=驳回 + AfterMinDiscount decimal.Decimal // 加价后最低折扣 + AfterMaxDiscount decimal.Decimal // 加价后最高折扣 +} + +type SkuAndAuditItem struct { + Id uint `json:"id"` + SkuId uint `json:"skuId"` + Name string `json:"name"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + GuidePrice decimal.Decimal `json:"guidePrice"` + AdjustType uint `json:"adjustType"` + AdjustPrice decimal.Decimal `json:"adjustPrice"` + AfterPrice decimal.Decimal `json:"afterPrice"` + AfterDiscount decimal.Decimal `json:"afterDiscount"` + BrandName string `json:"brandName"` + SourceName string `json:"sourceName"` + AuditUserId uint `json:"auditUserId"` + AuditAt int64 `json:"auditAt"` + ImgUrl string `json:"imgUrl"` + Reason string `json:"reason"` + FirstCategoryName string `json:"firstCategoryName"` + SecondCategoryName string `json:"secondCategoryName"` + ThirdCategoryName string `json:"thirdCategoryName"` + CreatedAt int64 `json:"createdAt"` + 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"` // 起批运费 +} + +type ReplySkuAuditLists struct { + Lists []SkuAndAuditItem `json:"lists"` + Total int64 `json:"total"` +} + +// Lists @Title 审核列表 +func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (reply ReplySkuAuditLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +// ListsEs @Title 审核列表 +func (s *skuAudit) ListsEs(ctx context.Context, args ArgsSkuAuditEsLists) (reply ReplySkuAuditLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "ListsEs", args, &reply) + return +} + +type ArgsSkuAuditAdopt struct { + AuditUserId uint // 审核人 + AuditIds []uint // 审核单id +} + +// Adopt @Title 通过 +func (s *skuAudit) Adopt(ctx context.Context, args ArgsSkuAuditAdopt) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsSkuAuditReject struct { + AuditUserId uint // 审核人 + AuditIds []uint // 审核单id + Reason string // 驳回原因 +} + +// Reject @Title 驳回 +func (s *skuAudit) Reject(ctx context.Context, args ArgsSkuAuditReject) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "Reject", args, &reply) +} + +type ArgsApplyHistory struct { + Search ApplyHistorySearch + Page bean.Page +} + +type ApplyHistorySearch struct { + Id uint // 瑞库客id + Name string // 商品名称 + SourceId uint // 所属供应商 1=京东 + SourceSonId uint // 沙马供应商的供应商 + SourceSkuId uint // 供应商skuId + BrandId uint // 品牌Id + ThirdCategoryId uint // 三级分类Id + AdjustType uint // 加价规则 + MaxSupplyPrice decimal.Decimal // 最大采购价格 + MinSupplyPrice decimal.Decimal // 最小采购价格 + CustomerProfitRate uint // 折扣 0=全部 1=5折以下 2=6 3=7 4=8 5=9折以下 + Handle uint // 处理状态 + AuditStatus uint // 审核状态 + SourceStatus uint // 供应商下架状态 + PlatformStatus uint // 平台下架状态 +} + +type ApplyHistoryItem struct { + Id uint `json:"id"` + Name string `json:"name"` // 名称 + BrandName string `json:"brandName"` // 品牌名称 + FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id + SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id + ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id + SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价 + GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价 + ImgUrl string `json:"imgUrl"` // 商品主图 + PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架 + SourceName string `json:"sourceName"` // 供应商名称 + SourceSkuId string `json:"sourceSkuId"` // 源skuId + SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架 + CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价 + CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% + CustomerDiscount decimal.Decimal `json:"customerDiscount"` // 折扣 + AdjustType uint `json:"adjustType"` // 加价类型 + AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 + AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型 + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额 + AfterPrice decimal.Decimal `json:"afterPrice"` // 改价记录 + 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"` // 起批运费 + Reason string // 改价驳回原因 +} + +type ReplyApplyHistoryLists struct { + Lists []ApplyHistoryItem `json:"lists"` + Total int64 `json:"total"` +} + +// ApplyHistory @Title 改价申请记录 +func (s *skuAudit) ApplyHistory(ctx context.Context, args ArgsApplyHistory) (reply []ReplyApplyHistoryLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "ApplyHistory", args, &reply) + return +} diff --git a/wholesale/source.go b/wholesale/source.go new file mode 100644 index 0000000..99f531d --- /dev/null +++ b/wholesale/source.go @@ -0,0 +1,30 @@ +package wholesale + +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + +type sourceRpc struct { + Id uint `gorm:"primaryKey"` + Name string // 供货商名称 + Base string // rpc服务基础名称 + SkuName string // sku名称 + OrderName string // order名称 +} + +type SourceItem struct { + Id uint `json:"id"` + Name string `json:"name"` +} + +// Select @Title 供应商列表 +func (s *sourceRpc) Select(ctx context.Context) (reply []SourceItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + args := 0 + err = xClient.Call(ctx, "Select", args, &reply) + return +} diff --git a/wholesale/wholesale.go b/wholesale/wholesale.go new file mode 100644 index 0000000..b30ccc0 --- /dev/null +++ b/wholesale/wholesale.go @@ -0,0 +1,12 @@ +package wholesale + +import "git.oa00.com/supply-chain/service/wholesale/setting" + +type Wholesale struct { + Brand brand + Category category + Source sourceRpc + Sku sku + SkuAudit skuAudit + Setting setting.Setting +} From 4ea94fb24f4541d6b868b95d0c6e0396cfdbd3bd Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 7 Dec 2022 16:29:33 +0800 Subject: [PATCH 63/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supplier/afs.go b/supplier/afs.go index 3a4d5f4..3d16e25 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -36,6 +36,7 @@ type AfsItem struct { Quantity uint `json:"quantity"` Status uint `json:"status"` Result string `json:"result"` + OrderFee decimal.Decimal `json:"orderFee"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` ReturnAddress []ReturnAddressItem `json:"returnAddress"` From f2565707e483516e6cc11c36aef6b9ece5e2d5bb Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 13:45:47 +0800 Subject: [PATCH 64/79] =?UTF-8?q?=E6=B8=A0=E9=81=93=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/channel/channel.go | 6 + wholesale/channel/mq.go | 56 +++++++++ wholesale/channel/sku.go | 237 +++++++++++++++++++++++++++++++++++ wholesale/interface/sku.go | 32 +++++ 4 files changed, 331 insertions(+) create mode 100644 wholesale/channel/channel.go create mode 100644 wholesale/channel/mq.go create mode 100644 wholesale/channel/sku.go create mode 100644 wholesale/interface/sku.go diff --git a/wholesale/channel/channel.go b/wholesale/channel/channel.go new file mode 100644 index 0000000..44d18f4 --- /dev/null +++ b/wholesale/channel/channel.go @@ -0,0 +1,6 @@ +package channel + +type Channel struct { + Sku sku + Mq mq +} diff --git a/wholesale/channel/mq.go b/wholesale/channel/mq.go new file mode 100644 index 0000000..91f8e57 --- /dev/null +++ b/wholesale/channel/mq.go @@ -0,0 +1,56 @@ +package channel + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "github.com/smallnest/rpcx/share" +) + +const ( + MqSubscribeNameSkuPriceChange = "sku_price_change" // sku价格变动 + MqSubscribeNameSkuChange = "sku_change" // sku信息变动 +) + +type mq struct { +} +type ArgsMqSubscribe struct { + Name string // 队列名称 + AppKey string // 队列名称 +} + +// Subscribe @Title 订阅mq +func (m *mq) Subscribe(ctx context.Context, channelId string, args ArgsMqSubscribe) (key string, err error) { + xClient, err := client.GetClient(m) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Subscribe", args, &key) + return +} + +// SubscribeCancel @Title 订阅取消 +func (m *mq) SubscribeCancel(ctx context.Context, channelId string, args ArgsMqSubscribe) (err error) { + reply := 0 + xClient, err := client.GetClient(m) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubscribeCancel", args, &reply) + return +} + +type ArgsMqUser struct { + AppKey string + AppSecret string +} + +// User @Title Mq用户 +func (m *mq) User(ctx context.Context, channelId string, args ArgsMqUser) (err error) { + reply := 0 + xClient, err := client.GetClient(m) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "User", args, &reply) + return +} diff --git a/wholesale/channel/sku.go b/wholesale/channel/sku.go new file mode 100644 index 0000000..6241268 --- /dev/null +++ b/wholesale/channel/sku.go @@ -0,0 +1,237 @@ +package channel + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" + "github.com/smallnest/rpcx/share" +) + +type sku struct { +} + +type SkuSearch struct { + Status uint // 1=上架 2=下架 + SkuName string // 商品名称 +} +type ArgsSkuList struct { + Search SkuSearch + Page bean.Page +} + +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"` +} + +type ReplySkuList struct { + Lists []SkuItem `json:"lists"` + Total int64 `json:"total"` +} + +// Lists @Title 商品列表 +func (s *sku) Lists(ctx context.Context, channelId string, args ArgsSkuList) (reply ReplySkuList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Lists", args, &reply) + return +} + +type SkuEsSearch struct { + SkuIds []uint // 商品SkuIds + Status uint // 1=上架 2=下架 + SkuName string // 商品名称 + BrandId uint // 品牌id + BrandName string // 品牌名称 全词匹配 + FirstCategoryId uint // 一级分类id + FirstCategoryName string // 一级分类名称 全词匹配 + SecondCategoryId uint // 二级分类id + SecondCategoryName string // 二级分类名称 全词匹配 + ThirdCategoryId uint // 三级分类id + ThirdCategoryName string // 三级分类名称 全词匹配 + MaxPrice decimal.Decimal // 最高金额 + MinPrice decimal.Decimal // 最低金额 + MinDiscount decimal.Decimal // 最低折扣 + MaxDiscount decimal.Decimal // 最高折扣 + Expand []map[string]interface{} // 拓展查询 +} +type ArgsSkuListsEs struct { + Search SkuEsSearch + Page bean.Page +} + +// ListsEs @Title es商品列表 目前最大10000条数据,超出不显示 +func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "ListsEs", args, &reply) + return +} + +type ArgsSkuDetails struct { + SkuIds []uint // sku数组 +} + +type SkuDetailItem 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"` + 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"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` + Content string `json:"content"` + Imgs []SkuImg `json:"imgs"` + Specifications []SkuSpecification `json:"specifications"` + GroupSkuIds []uint `json:"groupSkuIds"` + 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"` // 起批运费 +} +type SkuImg struct { + Path string `json:"path"` +} + +type SkuSpecification struct { + Name string `json:"name"` + Attributes []SkuAttribute `json:"attributes"` +} + +type SkuAttribute struct { + Name string `json:"name"` + Value []string `json:"value"` +} + +// Details @Title 获取sku详情 +func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails) (reply []SkuDetailItem, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Details", args, &reply) + return +} + +type ArgsSkuPrices struct { + SkuIds []uint // sku数组 +} +type SkuPrice struct { + Id uint `json:"id"` + Name string `json:"name"` + Price decimal.Decimal `json:"price"` + GuidePrice decimal.Decimal `json:"guidePrice"` + Profit decimal.Decimal `json:"profit"` + Status uint `json:"status"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` +} + +// Prices @Title 获取sku价格 +func (s *sku) Prices(ctx context.Context, channelId string, args ArgsSkuPrices) (reply []SkuPrice, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Prices", args, &reply) + return +} + +type ArgsSkuGroups struct { + SkuIds []uint // sku数组 +} + +type SkuGroup struct { + SkuId uint `json:"skuId"` + GroupSkuIds []uint `json:"groupSkuIds"` +} + +// Groups @Title 获取sku分组信息 +func (s *sku) Groups(ctx context.Context, channelId string, args ArgsSkuGroups) (reply []SkuGroup, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Groups", args, &reply) + return +} + +type ArgsSkuStock struct { + Address string // 地址 + Skus []SkuStockItem // sku信息 +} + +type SkuStockItem struct { + SkuId uint // skuId + Quantity uint // 数量 +} + +type ReplySkuStock struct { + SkuId uint `json:"skuId"` // skuId + State uint `json:"state"` // 库存状态 +} + +// Stock @Title 库存查询 +func (s *sku) Stock(ctx context.Context, channelId string, args ArgsSkuStock) (reply []ReplySkuStock, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Stock", args, &reply) + return +} diff --git a/wholesale/interface/sku.go b/wholesale/interface/sku.go new file mode 100644 index 0000000..c003e0f --- /dev/null +++ b/wholesale/interface/sku.go @@ -0,0 +1,32 @@ +package _interface + +import ( + "context" +) + +type skuState uint + +const ( + SkuStateIn = 1 // 有货 + SkuStateOut = 2 // 无货 + SkuStateDone = 3 // 下架商品 +) + +type Sku interface { + // Stock 库存查询 + Stock(ctx context.Context, args ArgsSkuStock, reply *[]ReplySkuStock) error +} + +type ArgsSkuStock struct { + Address string // 地址 + Skus []SkuStockItem // sku信息 +} + +type SkuStockItem struct { + SourceSkuId string // 源skuId + Quantity uint // 数量 +} +type ReplySkuStock struct { + SourceSkuId string `json:"sourceSkuId"` // 源skuId + State uint `json:"state"` // 库存状态 +} From b1cfdf8f34efaa01d1da9c9b4c3a7d817393f514 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 13:52:16 +0800 Subject: [PATCH 65/79] =?UTF-8?q?=E6=B8=A0=E9=81=93=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/wholesale.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wholesale/wholesale.go b/wholesale/wholesale.go index b30ccc0..95b0102 100644 --- a/wholesale/wholesale.go +++ b/wholesale/wholesale.go @@ -1,6 +1,9 @@ package wholesale -import "git.oa00.com/supply-chain/service/wholesale/setting" +import ( + "git.oa00.com/supply-chain/service/wholesale/channel" + "git.oa00.com/supply-chain/service/wholesale/setting" +) type Wholesale struct { Brand brand @@ -9,4 +12,5 @@ type Wholesale struct { Sku sku SkuAudit skuAudit Setting setting.Setting + Channel channel.Channel } From 6d22206a89f6835a2bf447fb21d6c2bcbdccde3f Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 8 Dec 2022 14:15:45 +0800 Subject: [PATCH 66/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/supplier/afs.go b/supplier/afs.go index 3d16e25..38a7ff5 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -52,6 +52,47 @@ func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists return } +type ReplyAfsDetail struct { + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + Status uint `json:"status"` + ApproveNotes string `json:"approveNotes"` + Result string `json:"result"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` + SkuName string `json:"skuName"` + ImgUrl string `json:"imgUrl"` + SkuId uint `json:"skuId"` + Price decimal.Decimal `json:"price"` + Quantity uint `json:"quantity"` + HopeTypeName string `json:"hopeTypeName"` + TypeReasonName string `json:"typeReasonName"` + Imgs []string `json:"imgs"` + LogisticsCompany string `json:"logisticsCompany"` + WaybillCode string `json:"waybillCode"` + SendAt int64 `json:"sendAt"` + PackageSend uint `json:"packageSend"` + AfsPackageSend AfsPackageSend `json:"afsPackageSend"` +} + +type AfsPackageSend struct { + Name string `json:"name"` + Mobile string `json:"mobile"` + LogisticsCompany string `json:"logisticsCompany"` + WaybillCode string `json:"waybillCode"` + SendGoodsDate int64 `json:"sendGoodsDate"` +} + +// Detail @Title 售后详情 +func (a *afs) Detail(ctx context.Context, afsSn uint64) (reply ReplyAfsDetail, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "Detail", afsSn, &reply) + return +} + type ArgsAfsReject struct { AfsSn string `json:"afsSn"` Notes string `json:"notes"` From 4ba04f52b4307d81d678bf697153fca4a90d4515 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 8 Dec 2022 15:28:40 +0800 Subject: [PATCH 67/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/supplier/afs.go b/supplier/afs.go index 38a7ff5..21538d9 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -53,26 +53,27 @@ func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists } type ReplyAfsDetail struct { - Id uint `json:"id"` - AfsSn string `json:"afsSn"` - Status uint `json:"status"` - ApproveNotes string `json:"approveNotes"` - Result string `json:"result"` - CreatedAt int64 `json:"createdAt"` - UpdatedAt int64 `json:"updatedAt"` - SkuName string `json:"skuName"` - ImgUrl string `json:"imgUrl"` - SkuId uint `json:"skuId"` - Price decimal.Decimal `json:"price"` - Quantity uint `json:"quantity"` - HopeTypeName string `json:"hopeTypeName"` - TypeReasonName string `json:"typeReasonName"` - Imgs []string `json:"imgs"` - LogisticsCompany string `json:"logisticsCompany"` - WaybillCode string `json:"waybillCode"` - SendAt int64 `json:"sendAt"` - PackageSend uint `json:"packageSend"` - AfsPackageSend AfsPackageSend `json:"afsPackageSend"` + Id uint `json:"id"` + AfsSn string `json:"afsSn"` + Status uint `json:"status"` + ApproveNotes string `json:"approveNotes"` + Result string `json:"result"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` + SkuName string `json:"skuName"` + ImgUrl string `json:"imgUrl"` + SkuId uint `json:"skuId"` + Price decimal.Decimal `json:"price"` + Quantity uint `json:"quantity"` + HopeTypeName string `json:"hopeTypeName"` + TypeReasonName string `json:"typeReasonName"` + Imgs []string `json:"imgs"` + LogisticsCompany string `json:"logisticsCompany"` + WaybillCode string `json:"waybillCode"` + SendAt int64 `json:"sendAt"` + PackageSend uint `json:"packageSend"` + AfsPackageSend AfsPackageSend `json:"afsPackageSend"` + ReturnAddress []ReturnAddressItem `json:"returnAddress"` } type AfsPackageSend struct { From 3354c1823a85625e6d6704868e7e63899624fdfe Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 8 Dec 2022 15:45:19 +0800 Subject: [PATCH 68/79] =?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/afterService.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index bf76683..befce94 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -185,6 +185,7 @@ func (a *afterService) Lists(ctx context.Context, channelId string, args ArgsAft type ReplyAfterServiceDetail struct { Id uint `json:"id"` AfsSn string `json:"afsSn"` + OrderSubSn string `json:"orderSubSn"` Status uint `json:"status"` ApproveNotes string `json:"approveNotes"` Result string `json:"result"` From 0653368a0099b6a9957de81a56d27afff5feddff Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 8 Dec 2022 15:56:30 +0800 Subject: [PATCH 69/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/afs.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supplier/afs.go b/supplier/afs.go index 21538d9..24df47e 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -71,6 +71,8 @@ type ReplyAfsDetail struct { LogisticsCompany string `json:"logisticsCompany"` WaybillCode string `json:"waybillCode"` SendAt int64 `json:"sendAt"` + NewOrderSn string `json:"newOrderSn"` + RefundFee decimal.Decimal `json:"refundFee"` PackageSend uint `json:"packageSend"` AfsPackageSend AfsPackageSend `json:"afsPackageSend"` ReturnAddress []ReturnAddressItem `json:"returnAddress"` From a0625be567468d1b2ce53e840c9900541bc7a2b5 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 17:18:12 +0800 Subject: [PATCH 70/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/setting/rate.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/supply/setting/rate.go b/supply/setting/rate.go index 8ffb1fa..5d4f688 100644 --- a/supply/setting/rate.go +++ b/supply/setting/rate.go @@ -25,6 +25,16 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { return } +// Get @Title 获取利率信息 +func (r *rate) Get(ctx context.Context) (result RateItem, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + err = xClient.Call(ctx, "Get", 0, &result) + return +} + type ArgsRateChannel struct { ChannelId uint // 渠道id RateId uint // 费率id From 6d6c9310098fd2cbf3ff7863e34d1434bc00f399 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Dec 2022 17:26:40 +0800 Subject: [PATCH 71/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/setting/rate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supply/setting/rate.go b/supply/setting/rate.go index 5d4f688..07717b5 100644 --- a/supply/setting/rate.go +++ b/supply/setting/rate.go @@ -26,12 +26,12 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { } // Get @Title 获取利率信息 -func (r *rate) Get(ctx context.Context) (result RateItem, err error) { +func (r *rate) Get(ctx context.Context, rateId uint) (result RateItem, err error) { xClient, err := client.GetClient(r) if err != nil { return } - err = xClient.Call(ctx, "Get", 0, &result) + err = xClient.Call(ctx, "Get", rateId, &result) return } From 5167292432fc877722480b883974dc6f1e9d5366 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 9 Dec 2022 10:09:15 +0800 Subject: [PATCH 72/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A9=E7=8E=87?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wholesale/setting/rate.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wholesale/setting/rate.go b/wholesale/setting/rate.go index 8ffb1fa..07717b5 100644 --- a/wholesale/setting/rate.go +++ b/wholesale/setting/rate.go @@ -25,6 +25,16 @@ func (r *rate) All(ctx context.Context) (result []RateItem, err error) { return } +// Get @Title 获取利率信息 +func (r *rate) Get(ctx context.Context, rateId uint) (result RateItem, err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + err = xClient.Call(ctx, "Get", rateId, &result) + return +} + type ArgsRateChannel struct { ChannelId uint // 渠道id RateId uint // 费率id From 8f6e6870509a6afb48fe5430b968659cb559c872 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 9 Dec 2022 10:59:05 +0800 Subject: [PATCH 73/79] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service.go | 3 +- customer/service/audit.go | 74 +++++++++++++++++++++- customer/service/audit/audit.go | 5 -- customer/service/audit/supply.go | 101 ------------------------------- customer/user.go | 1 - 5 files changed, 74 insertions(+), 110 deletions(-) delete mode 100644 customer/service/audit/audit.go delete mode 100644 customer/service/audit/supply.go diff --git a/customer/service.go b/customer/service.go index 1712f31..cbc50ab 100644 --- a/customer/service.go +++ b/customer/service.go @@ -3,7 +3,8 @@ package customer type serviceId uint const ( - ServiceSupply serviceId = 1 // 供应链 + ServiceSupply serviceId = 1 // 供应链 + ServiceWholesale serviceId = 2 // 批发 UserServiceStatusNone = 0 // 无 UserServiceStatusWait = 1 // 待审核 diff --git a/customer/service/audit.go b/customer/service/audit.go index 13032f2..8df40eb 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -3,12 +3,11 @@ package service import ( "context" "git.oa00.com/supply-chain/service/client" - audit2 "git.oa00.com/supply-chain/service/customer/service/audit" "git.oa00.com/supply-chain/service/lib/bean" + "time" ) type audit struct { - audit2.Audit } type AuditSearch struct { ApplyUserId uint // 申请人 @@ -72,3 +71,74 @@ func (a *audit) History(ctx context.Context, args ArgsHistory) (reply ReplyHisto err = xClient.Call(ctx, "History", args, &reply) return } + +type ArgsAuditApply struct { + ServiceId uint `json:"serviceId"` // 服务id + ApplyUserId uint `json:"applyUserId"` // 申请人id + CustomerId uint `json:"customerId"` // 客户id + ExpirationAt time.Time `json:"expirationAt"` // 到期时间 + Expand any `json:"expand"` // 拓展参数 +} + +// Apply @Title 申请 +func (a *audit) Apply(ctx context.Context, args ArgsAuditApply) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Apply", args, &reply) +} + +type ArgsAuditAdopt struct { + AuditUserId uint // 审核人id + UserServiceId uint // 客户服务id +} + +// Adopt @Title 审核通过 +func (a *audit) Adopt(ctx context.Context, args ArgsAuditAdopt) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsAuditReject struct { + AuditUserId uint // 审核人id + UserServiceId uint // 客户服务id + Reason string // 驳回原因 +} + +// Reject @Title 驳回 +func (a *audit) Reject(ctx context.Context, args ArgsAuditReject) error { + reply := 0 + xClient, err := client.GetClient(a) + if err != nil { + return err + } + return xClient.Call(ctx, "Reject", args, &reply) +} + +type ReplyAuditInfo struct { + Id uint `json:"id"` + UserName string `json:"userName"` + ApplyUserId uint `json:"applyUserId"` + ApplyAt int64 `json:"applyAt"` + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + ExpirationAt int64 `json:"expirationAt"` + AuditStatus uint `json:"auditStatus"` + AuditAt int64 `json:"auditAt"` + Reason string `json:"reason"` + AuditUserId uint `json:"auditUserId"` + Expand any `json:"expand"` +} + +type ReplyProof struct { + Name string `json:"name"` + ChannelId uint `json:"channelId"` // 用户Id + AppKey string `json:"appKey"` + AppSecret string `json:"appSecret"` +} diff --git a/customer/service/audit/audit.go b/customer/service/audit/audit.go deleted file mode 100644 index ccbd49d..0000000 --- a/customer/service/audit/audit.go +++ /dev/null @@ -1,5 +0,0 @@ -package audit - -type Audit struct { - Supply supply -} diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go deleted file mode 100644 index 3113f90..0000000 --- a/customer/service/audit/supply.go +++ /dev/null @@ -1,101 +0,0 @@ -package audit - -import ( - "context" - "git.oa00.com/supply-chain/service/client" -) - -type supply struct { -} - -type ArgsSupplyApply struct { - ApplyUserId uint // 申请人id - CustomerId uint // 客户id - RateId uint // 费率id - ExpirationAt string // 到期时间 - Enclosure string // 附件 -} - -// Apply @Title 申请 -func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.Call(ctx, "Apply", args, &reply) -} - -type ArgsSupplyAdopt struct { - AuditUserId uint // 审核人id - UserServiceId uint // 客户服务id -} - -// Adopt @Title 审核通过 -func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.Call(ctx, "Adopt", args, &reply) -} - -type ArgsSupplyReject struct { - AuditUserId uint // 审核人id - UserServiceId uint // 客户服务id - Reason string // 驳回原因 -} - -// Reject @Title 驳回 -func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error { - reply := 0 - xClient, err := client.GetClient(s) - if err != nil { - return err - } - return xClient.Call(ctx, "Reject", args, &reply) -} - -type ReplySupplyInfo struct { - Id uint `json:"id"` - UserName string `json:"userName"` - ApplyUserId uint `json:"applyUserId"` - ApplyAt int64 `json:"applyAt"` - ServiceId uint `json:"serviceId"` - ServiceName string `json:"serviceName"` - ExpirationAt int64 `json:"expirationAt"` - RateId uint `json:"rateId"` - Enclosure string `json:"enclosure"` - AuditStatus uint `json:"auditStatus"` - AuditAt int64 `json:"auditAt"` - Reason string `json:"reason"` - AuditUserId uint `json:"auditUserId"` -} - -// Info @Title 详情 -func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) { - xClient, err := client.GetClient(s) - if err != nil { - return - } - err = xClient.Call(ctx, "Info", userServiceId, &reply) - return -} - -type ReplyProof struct { - Name string `json:"name"` - ChannelId uint `json:"channelId"` // 用户Id - AppKey string `json:"appKey"` - AppSecret string `json:"appSecret"` -} - -// GetProof @Title 获取凭证 -func (s *supply) GetProof(ctx context.Context, userServiceId uint) (reply ReplyProof, err error) { - xClient, err := client.GetClient(s) - if err != nil { - return - } - err = xClient.Call(ctx, "GetProof", userServiceId, &reply) - return -} diff --git a/customer/user.go b/customer/user.go index e0e571f..4bfdabc 100644 --- a/customer/user.go +++ b/customer/user.go @@ -31,7 +31,6 @@ type UserItem struct { Id uint `json:"id"` Name string `json:"name"` Account string `json:"account"` - RateId uint `json:"rateId"` Liaison string `json:"liaison"` Phone string `json:"phone"` Amount decimal.Decimal `json:"amount"` From 965d9cfffe535ad6a911a93348490d9260e0880b Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 9 Dec 2022 11:00:04 +0800 Subject: [PATCH 74/79] =?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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 533ee30..deb1780 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -80,12 +80,19 @@ type SkuEsSearch struct { MinDiscount decimal.Decimal // 最低折扣 MaxDiscount decimal.Decimal // 最高折扣 Expand []map[string]interface{} // 拓展查询 + CustomerSearch CustomerSearch // 客户系统的搜索条件 } type ArgsSkuListsEs struct { Search SkuEsSearch Page bean.Page } +type CustomerSearch struct { + SkuName string + SkuId uint + BrandName string +} + // ListsEs @Title es商品列表 目前最大10000条数据,超出不显示 func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) { xClient, err := client.GetClient(s) From 0e58908b11fa5fd5e2ac0343c15f6b9c32352700 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 9 Dec 2022 11:17:58 +0800 Subject: [PATCH 75/79] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service/audit.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/customer/service/audit.go b/customer/service/audit.go index 8df40eb..66b68d1 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -136,9 +136,29 @@ type ReplyAuditInfo struct { Expand any `json:"expand"` } +// Info @Title 详情 +func (a *audit) Info(ctx context.Context, userServiceId uint) (reply ReplyAuditInfo, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "Info", userServiceId, &reply) + return +} + type ReplyProof struct { Name string `json:"name"` ChannelId uint `json:"channelId"` // 用户Id AppKey string `json:"appKey"` AppSecret string `json:"appSecret"` } + +// GetProof @Title 获取凭证 +func (a *audit) GetProof(ctx context.Context, userServiceId uint) (reply ReplyProof, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "GetProof", userServiceId, &reply) + return +} From aac029fe9b2822901c2cc0f7c7ffc83790a5cfe9 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 9 Dec 2022 14:43:42 +0800 Subject: [PATCH 76/79] =?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/skuAudit.go | 1 + 1 file changed, 1 insertion(+) diff --git a/supply/skuAudit.go b/supply/skuAudit.go index c49e7db..a041e55 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -31,6 +31,7 @@ type SkuAuditEsSearch struct { SourceSonId uint // 沙马供应商的供应商 AdjustType uint // 加价类型 Status uint // 状态 1=未审核 2=通过 3=驳回 + BrandName string // 品牌名称 AfterMinDiscount decimal.Decimal // 加价后最低折扣 AfterMaxDiscount decimal.Decimal // 加价后最高折扣 } From 5001a1c5f6e27d00e138173287745a132de83d2c Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 12 Dec 2022 09:49:41 +0800 Subject: [PATCH 77/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service/audit.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/customer/service/audit.go b/customer/service/audit.go index 66b68d1..c3fe360 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -45,8 +45,9 @@ func (a *audit) Lists(ctx context.Context, args ArgsAuditLists) (reply ReplyAudi } type ArgsHistory struct { - Page bean.Page - CustomerId uint + Page bean.Page + CustomerId uint + AuditStatus uint } type ReplyHistoryLists struct { From 2b61f996238a0c5cefb51731ec2deb7cf8cee636 Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 12 Dec 2022 09:57:54 +0800 Subject: [PATCH 78/79] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/service/audit.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/customer/service/audit.go b/customer/service/audit.go index c3fe360..7b2e262 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -7,6 +7,12 @@ import ( "time" ) +const ( + AuditHistoryAuditStatusNone = 1 // 待审核 + AuditHistoryAuditStatusAdopt = 2 // 审核通过 + AuditHistoryAuditStatusReject = 3 // 审核驳回 +) + type audit struct { } type AuditSearch struct { @@ -51,8 +57,9 @@ type ArgsHistory struct { } type ReplyHistoryLists struct { - Lists []HistoryItem `json:"lists"` - Total int64 `json:"total"` + Lists []HistoryItem `json:"lists"` + Total int64 `json:"total"` + AuditStatus uint `json:"auditStatus"` // 审核状态 } type HistoryItem struct { From 5a225deabae033276c78887597c4be82ee512e67 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 12 Dec 2022 14:31:24 +0800 Subject: [PATCH 79/79] =?UTF-8?q?=E6=89=B9=E5=8F=91=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=BA=93=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/batch/goods.go | 200 ++++++++++++++++++++++++++++++++++++++++ supplier/supplier.go | 2 + 2 files changed, 202 insertions(+) create mode 100644 supplier/batch/goods.go diff --git a/supplier/batch/goods.go b/supplier/batch/goods.go new file mode 100644 index 0000000..febf014 --- /dev/null +++ b/supplier/batch/goods.go @@ -0,0 +1,200 @@ +package batch + +import ( + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" + "golang.org/x/net/context" +) + +type Goods struct { + goods +} + +type goods struct { +} + +type GoodsSearch struct { + Name string // 商品名称 + CategoryIds []uint // 类目id + BrandName string // 品牌名 + UpcCode string // 商品条码 + Handle uint // 处理状态 1=待处理 2=入库 3=废弃 + SkuId uint // 供应商skuId + MinSupplyPrice decimal.Decimal // 最小采购价 + MaxSupplyPrice decimal.Decimal // 最大采购价 +} +type ArgsGoodsList struct { + Search GoodsSearch + Page bean.Page +} + +type GoodsItem struct { + Id uint `json:"id"` + Name string `json:"name"` + Img string `json:"img"` + GoodsNum string `json:"goodsNum"` + CategoryId uint `json:"categoryId"` + BrandId uint `json:"brandId"` + BrandName string `json:"brandName"` + SkuItems []GoodsItemLists `json:"skuItems"` + UpcCodes []string `json:"upcCodes"` + StockCount uint `json:"stockCount"` + GuidePrices []decimal.Decimal `json:"guidePrices"` + SupplyPrices []decimal.Decimal `json:"supplyPrices"` + Status uint `json:"status"` + CreatedAt int64 `json:"createdAt"` +} + +type GoodsItemLists struct { + Id uint `json:"id"` + Specifications []SkuSpecificationItem `json:"specifications"` + Stock uint `json:"stock"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + GoodsId uint `json:"goodsId"` + Img string `json:"img"` + UpcCode string `json:"upcCode"` +} + +type GoodsSpecificationItem struct { + Name string `json:"name"` + Values []string `json:"values"` +} + +type SkuSpecificationItem struct { + Name string `json:"name"` + Value string `json:"value"` +} + +type ReplyGoodsLists struct { + List []GoodsItem `json:"list"` + Total int64 `json:"total"` +} + +// Lists @Title 获取商品列表 +func (g *goods) Lists(ctx context.Context, args ArgsGoodsList) (reply ReplyGoodsLists, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +type ArgsGoodsInfo struct { + SkuId uint +} + +type ReplyGoodsInfo struct { + Id uint `json:"id"` + Name string `json:"name"` + SupplierId uint `json:"supplierId"` + SupplierName string `json:"supplierName"` + CategoryId uint `json:"categoryId"` + BrandId uint `json:"brandId"` + Imgs []string `json:"imgs"` + Content string `json:"content"` + Attributes []GoodsAttributeItem `json:"attributes"` + Skus []SkuItem `json:"skus"` + Status uint `json:"status"` +} + +type GoodsAttributeItem struct { + Name string `json:"name"` + Value string `json:"value"` + GroupName string `json:"groupName"` +} + +type SkuSpecItem struct { + Name string `json:"name"` + Value string `json:"value"` +} + +type SkuItem struct { + SkuId uint `json:"skuId"` + Color string `json:"color"` + Size string `json:"size"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + MarketPrice decimal.Decimal `json:"marketPrice"` + UpcCode string `json:"upcCode"` + UnitId uint `json:"uintId"` + TaxCategoryId uint `json:"taxCategoryId"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` + Unit string `json:"uint"` + Tax decimal.Decimal `json:"tax"` + Img string `json:"img"` +} + +// Info @Title 商品详情 +func (g *goods) Info(ctx context.Context, goodsId uint) (reply ReplyGoodsInfo, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return + } + err = xClient.Call(ctx, "Info", goodsId, &reply) + return +} + +// GetImgs @Title 获取商品主图 +func (g *goods) GetImgs(ctx context.Context, goodsId uint) (reply []string, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return + } + err = xClient.Call(ctx, "GetImgs", goodsId, &reply) + return +} + +type AdoptItem struct { + Id uint `json:"id"` + Name string `json:"name"` + Error string `json:"error"` +} + +// Adopt @Title 批量入库 +func (g *goods) Adopt(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return + } + err = xClient.Call(ctx, "Adopt", goodsIds, &reply) + return +} + +// Discard @Title 批量废弃 +func (g *goods) Discard(ctx context.Context, goodsIds []uint) (err error) { + xClient, err := client.GetClient(g) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Discard", goodsIds, &reply) + return +} + +// ReHandle @Title 重新处理商品 +func (g *goods) ReHandle(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "ReHandle", goodsIds, &reply) + return +} + +type ReplyByIdItem struct { + SkuId uint `json:"skuId"` + SupplierId uint `json:"supplierIds"` + SupplierName string `json:"supplierName"` +} + +// FindBySkuIds @Title 根据商品Ids获取商品信息 +func (g *goods) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []ReplyByIdItem, err error) { + xClient, err := client.GetClient(g) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply) + return +} diff --git a/supplier/supplier.go b/supplier/supplier.go index 9b6fc29..99591d1 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -4,6 +4,7 @@ import ( "context" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" + "git.oa00.com/supply-chain/service/supplier/batch" "github.com/shopspring/decimal" ) @@ -16,6 +17,7 @@ type Supplier struct { LogisticsCompany logisticsCompany ReturnAddress returnAddress Afs afs + BatchGoods batch.Goods } type supplier struct {