From cab7b8fbe7160055541145ceff36a6337a3c4b09 Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 9 Aug 2022 10:13:19 +0800 Subject: [PATCH 01/25] =?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 --- jd/sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jd/sku.go b/jd/sku.go index a802798..79574e2 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -236,5 +236,5 @@ func (s *sku) ReplaceImgJdSku(ctx context.Context, args ArgsSkuReplaceImgJdSku) if err != nil { return err } - return xClient.Call(ctx, "ReplaceImg", args, &reply) + return xClient.Call(ctx, "ReplaceImgJdSku", args, &reply) } From 4b1c825e77bc102cfb5c4794ca53e943107fe964 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 10 Aug 2022 13:53:13 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/supply/sku.go b/supply/sku.go index ccd360e..f6e5a15 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -60,6 +60,7 @@ type ArgsSkuAdd struct { } type SkuImg struct { + Id uint `json:"id"` Path string `json:"path"` } @@ -224,3 +225,28 @@ func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { } return xClient.Call(ctx, "DownShelves", args, &reply) } + +// GetImgs @Title 获取预览图 +func (s *sku) GetImgs(ctx context.Context, skuId uint) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "GetImgs", skuId, &reply) +} + +type ArgsReplaceImg struct { + Id uint + ReplacePath string +} + +// ReplaceImg @Title 替换图片 +func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (reply []SkuImg, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return nil, err + } + err = xClient.Call(ctx, "ReplaceImg", args, &reply) + return +} From c3d2805afbefbe6a5f0f186c8f116763d1e935e6 Mon Sep 17 00:00:00 2001 From: sian Date: Wed, 10 Aug 2022 13:58:13 +0800 Subject: [PATCH 03/25] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/sku.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index f6e5a15..cfa63b0 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -227,13 +227,13 @@ func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { } // GetImgs @Title 获取预览图 -func (s *sku) GetImgs(ctx context.Context, skuId uint) error { - reply := 0 +func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err error) { xClient, err := client.GetClient(s) if err != nil { - return err + return nil, err } - return xClient.Call(ctx, "GetImgs", skuId, &reply) + err = xClient.Call(ctx, "GetImgs", skuId, &reply) + return } type ArgsReplaceImg struct { @@ -242,10 +242,11 @@ type ArgsReplaceImg struct { } // ReplaceImg @Title 替换图片 -func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (reply []SkuImg, err error) { +func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) { + reply := 0 xClient, err := client.GetClient(s) if err != nil { - return nil, err + return err } err = xClient.Call(ctx, "ReplaceImg", args, &reply) return From 7bb01961f28381a64c03c4fbe3b0980636ce49ab Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 10 Aug 2022 16:25:48 +0800 Subject: [PATCH 04/25] =?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 --- jd/task.go | 10 ++++++++++ rpc/error.go | 24 ++++++++++++++++++++++++ supply/interface/order.go | 9 +++++---- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 rpc/error.go diff --git a/jd/task.go b/jd/task.go index 5a3b0a6..9017f45 100644 --- a/jd/task.go +++ b/jd/task.go @@ -27,3 +27,13 @@ func (t *task) SkuAdd(ctx context.Context) error { } return xClient.Call(ctx, "SkuAdd", 0, &a) } + +// RefreshToken @Title 更新token +func (t *task) RefreshToken(ctx context.Context) error { + a := 0 + xClient, err := client.GetClient(t) + if err != nil { + return err + } + return xClient.Call(ctx, "RefreshToken", 0, &a) +} diff --git a/rpc/error.go b/rpc/error.go new file mode 100644 index 0000000..0525ee9 --- /dev/null +++ b/rpc/error.go @@ -0,0 +1,24 @@ +package rpc + +type Error uint + +const ( + ErrorSystem Error = 11001 // 系统错误 + + ErrorOrderRepeat Error = 11002 // 重复下单 + ErrorOrderFreightFee Error = 11003 // 运费获取失败 + ErrorOrderSubmit Error = 11004 // 下单失败 + ErrorOrderShipment Error = 11005 // 无法配送 +) + +var ErrorCodes = map[Error]string{ + ErrorSystem: "系统错误", + ErrorOrderRepeat: "重复下单", + ErrorOrderFreightFee: "运费获取失败", + ErrorOrderSubmit: "下单失败", + ErrorOrderShipment: "无法配送", +} + +func (e Error) Error() string { + return ErrorCodes[e] +} diff --git a/supply/interface/order.go b/supply/interface/order.go index bd97851..db83557 100644 --- a/supply/interface/order.go +++ b/supply/interface/order.go @@ -23,10 +23,11 @@ type OrderFreightFeeSkuItem struct { } type ArgsOrderSubmit struct { - OrderSn string // 订单号 - Skus []OrderFreightFeeSkuItem // 商品信息 - Address string // 地址 - FreightFee decimal.Decimal // 运费 + OrderSn uint64 // 订单号 + Skus []OrderFreightFeeSkuItem // 商品信息 + Address string // 地址 + Receiver OrderReceiver // 收件信息 + UserIp string // 用户ip } type OrderReceiver struct { From 023212fe1bc85fe6f09608500dcca76a646897d2 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 09:42:02 +0800 Subject: [PATCH 05/25] =?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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/customer/service/service.go b/customer/service/service.go index 6a8ec8c..c93011f 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -1,5 +1,26 @@ package service +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + type Service struct { Audit audit } + +type ReplyServiceAll struct { + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + EndTime int64 `json:"endTime"` +} + +// All @Title 全部服务 +func (s *Service) All(ctx context.Context, customerId uint) (reply []ReplyServiceAll, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "All", customerId, &reply) + return +} From 413e2b0d9cbb9d7f3f9ca284b1237aac793eb410 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 11 Aug 2022 10:20:11 +0800 Subject: [PATCH 06/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/error.go | 8 ++++++-- supply/channel/order.go | 22 ++++++++++++++++------ supply/interface/order.go | 11 ++++++----- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/rpc/error.go b/rpc/error.go index 0525ee9..80f924b 100644 --- a/rpc/error.go +++ b/rpc/error.go @@ -6,17 +6,21 @@ const ( ErrorSystem Error = 11001 // 系统错误 ErrorOrderRepeat Error = 11002 // 重复下单 - ErrorOrderFreightFee Error = 11003 // 运费获取失败 + ErrorOrderFreightFee Error = 11003 // 运费错误 ErrorOrderSubmit Error = 11004 // 下单失败 ErrorOrderShipment Error = 11005 // 无法配送 + ErrorOrderSkuPrice Error = 11006 // 商品价格错误 + ErrorOrderAmount Error = 11007 // 订单金额错误 ) var ErrorCodes = map[Error]string{ ErrorSystem: "系统错误", ErrorOrderRepeat: "重复下单", - ErrorOrderFreightFee: "运费获取失败", + ErrorOrderFreightFee: "运费错误", ErrorOrderSubmit: "下单失败", ErrorOrderShipment: "无法配送", + ErrorOrderSkuPrice: "商品价格错误", + ErrorOrderAmount: "订单金额错误", } func (e Error) Error() string { diff --git a/supply/channel/order.go b/supply/channel/order.go index e5eab07..c2f2300 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -41,13 +41,23 @@ func (o *order) FreightFee(ctx context.Context, channelId string, args ArgsOrder return } +type SkuOrderItem struct { + SkuId uint // skuId + Price decimal.Decimal // 单价 + Quantity uint // 数量 +} type ArgsOrderSubmit struct { - Address string // 地址 - Skus []SkuFreightFeeItem // sku信息 - Receiver Receiver // 收件信息 - OrderFee decimal.Decimal // 订单金额-不含运费 - FreightFee decimal.Decimal // 运费 - UserIp string // 下单用户ip + Address string // 地址 + Skus []SkuOrderItem // sku信息 + Receiver Receiver // 收件信息 + OrderFee decimal.Decimal // 订单金额-不含运费 + FreightFees []OrderFreightFee // 运费 + UserIp string // 下单用户ip +} + +type OrderFreightFee struct { + SkuIds []uint `json:"skuIds"` + FreightFee decimal.Decimal `json:"freightFee"` } type Receiver struct { diff --git a/supply/interface/order.go b/supply/interface/order.go index db83557..c8c5d4a 100644 --- a/supply/interface/order.go +++ b/supply/interface/order.go @@ -23,11 +23,12 @@ type OrderFreightFeeSkuItem struct { } type ArgsOrderSubmit struct { - OrderSn uint64 // 订单号 - Skus []OrderFreightFeeSkuItem // 商品信息 - Address string // 地址 - Receiver OrderReceiver // 收件信息 - UserIp string // 用户ip + OrderSn uint64 // 订单号 + Skus []OrderFreightFeeSkuItem // 商品信息 + Address string // 地址 + FreightFee decimal.Decimal // 运费 + Receiver OrderReceiver // 收件信息 + UserIp string // 用户ip } type OrderReceiver struct { From e18b1713e76ea31cfdbb73715bd9800e0de1b836 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 10:57:14 +0800 Subject: [PATCH 07/25] =?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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/customer/service/service.go b/customer/service/service.go index c93011f..13a8458 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -13,6 +13,9 @@ type ReplyServiceAll struct { ServiceId uint `json:"serviceId"` ServiceName string `json:"serviceName"` EndTime int64 `json:"endTime"` + AppKey string `json:"appKey"` + AppSecret string `json:"appSecret"` + AuditStatus uint `json:"auditStatus"` } // All @Title 全部服务 From 3f7f6d9e9ccce7a5d3043b861ce1c5198c946e93 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 11:13:59 +0800 Subject: [PATCH 08/25] =?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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/customer/service/service.go b/customer/service/service.go index 13a8458..18b569d 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -9,7 +9,12 @@ type Service struct { Audit audit } -type ReplyServiceAll struct { +type ArgsServiceLists struct { + CustomerId uint + Status uint +} + +type ReplyServiceLists struct { ServiceId uint `json:"serviceId"` ServiceName string `json:"serviceName"` EndTime int64 `json:"endTime"` @@ -18,12 +23,12 @@ type ReplyServiceAll struct { AuditStatus uint `json:"auditStatus"` } -// All @Title 全部服务 -func (s *Service) All(ctx context.Context, customerId uint) (reply []ReplyServiceAll, err error) { +// Lists @Title 全部服务 +func (s *Service) Lists(ctx context.Context, args ArgsAuditLists) (reply []ReplyServiceLists, err error) { xClient, err := client.GetClient(s) if err != nil { return } - err = xClient.Call(ctx, "All", customerId, &reply) + err = xClient.Call(ctx, "Lists", args, &reply) return } From fbcac03aee421a47562bea4936f4fcd876bea4c7 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 11:16:27 +0800 Subject: [PATCH 09/25] =?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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/customer/service/service.go b/customer/service/service.go index 18b569d..e771599 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -24,7 +24,7 @@ type ReplyServiceLists struct { } // Lists @Title 全部服务 -func (s *Service) Lists(ctx context.Context, args ArgsAuditLists) (reply []ReplyServiceLists, err error) { +func (s *Service) Lists(ctx context.Context, args ArgsServiceLists) (reply []ReplyServiceLists, err error) { xClient, err := client.GetClient(s) if err != nil { return From aa1f4b912cd6a5410c5de357fcbbbdf91beefc41 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 11:38:11 +0800 Subject: [PATCH 10/25] =?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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/customer/service/service.go b/customer/service/service.go index e771599..b72a1ab 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -18,17 +18,15 @@ type ReplyServiceLists struct { ServiceId uint `json:"serviceId"` ServiceName string `json:"serviceName"` EndTime int64 `json:"endTime"` - AppKey string `json:"appKey"` - AppSecret string `json:"appSecret"` AuditStatus uint `json:"auditStatus"` } -// Lists @Title 全部服务 -func (s *Service) Lists(ctx context.Context, args ArgsServiceLists) (reply []ReplyServiceLists, err error) { +// All @Title 全部服务 +func (s *Service) All(ctx context.Context, customerId uint) (reply []ReplyServiceLists, err error) { xClient, err := client.GetClient(s) if err != nil { return } - err = xClient.Call(ctx, "Lists", args, &reply) + err = xClient.Call(ctx, "All", customerId, &reply) return } From dd10194a0461ad52eb2146541600afa7ffe53e46 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 11 Aug 2022 14:22:15 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/supply/channel/order.go b/supply/channel/order.go index c2f2300..db2609e 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -47,12 +47,13 @@ type SkuOrderItem struct { Quantity uint // 数量 } type ArgsOrderSubmit struct { - Address string // 地址 - Skus []SkuOrderItem // sku信息 - Receiver Receiver // 收件信息 - OrderFee decimal.Decimal // 订单金额-不含运费 - FreightFees []OrderFreightFee // 运费 - UserIp string // 下单用户ip + ChannelOrderSn string // 渠道订单编号 + Address string // 地址 + Skus []SkuOrderItem // sku信息 + Receiver Receiver // 收件信息 + OrderFee decimal.Decimal // 订单金额-不含运费 + FreightFees []OrderFreightFee // 运费 + UserIp string // 下单用户ip } type OrderFreightFee struct { @@ -68,6 +69,8 @@ type Receiver struct { } type ReplyOrderSubmit struct { + OrderSn string + ChannelOrderSn string } // Submit @Title 下单 From ffd52da52d1a235cda6573ce7b7f7fa26b267a4e Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 14:22:28 +0800 Subject: [PATCH 12/25] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/brand.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/supply/brand.go b/supply/brand.go index d4516ff..150824c 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -91,3 +91,13 @@ func (b *brand) FindByIds(ctx context.Context, args ArgsBrandFindByIds) (result err = xClient.Call(ctx, "FindByIds", args, &result) return } + +// Export @Title 导出品牌 +func (b *brand) Export(ctx context.Context, name string) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByIds", name, &result) + return +} From 4b7686fd63474c67948c407e31422cf2af1ad37d Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 14:25:01 +0800 Subject: [PATCH 13/25] =?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/brand.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/brand.go b/supply/brand.go index 150824c..f9a54ca 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -98,6 +98,6 @@ func (b *brand) Export(ctx context.Context, name string) (result []BrandItem, er if err != nil { return } - err = xClient.Call(ctx, "FindByIds", name, &result) + err = xClient.Call(ctx, "Export", name, &result) return } From 3abbea37175bc018a2651935f02a762e0770d2d1 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 15:03:23 +0800 Subject: [PATCH 14/25] =?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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index cfa63b0..4d7dbae 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -60,8 +60,9 @@ type ArgsSkuAdd struct { } type SkuImg struct { - Id uint `json:"id"` - Path string `json:"path"` + Id uint `json:"id"` + Path string `json:"path"` + ReplacePath string `json:"replacePath"` } type SkuSpecification struct { @@ -238,6 +239,7 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro type ArgsReplaceImg struct { Id uint + SkuId uint ReplacePath string } From e1485bd83fe5a0c269905629285d10cb85066ebc Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 11 Aug 2022 15:12:53 +0800 Subject: [PATCH 15/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=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 | 2 +- supply/sku.go | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/supply/channel/order.go b/supply/channel/order.go index db2609e..6e3a5aa 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -74,7 +74,7 @@ type ReplyOrderSubmit struct { } // Submit @Title 下单 -func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply []ReplyOrderSubmit, err error) { +func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { xClient, err := client.GetClient(o) if err != nil { return diff --git a/supply/sku.go b/supply/sku.go index cfa63b0..d9ad63f 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -251,3 +251,49 @@ func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) { 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 // 商品参数信息 +} + +// 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 +} From c69e3468ef591efb9db3f51ca4fafc673906bc7e Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 16:55:48 +0800 Subject: [PATCH 16/25] =?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 4d7dbae..93daafe 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -147,6 +147,8 @@ type SkuItem struct { CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% AdjustType uint `json:"adjustType"` // 加价类型 AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 + AfterAdjustType uint `json:"afterType"` // 改价后加价类型 + AfterAdjustPrice decimal.Decimal `json:"afterPrice"` // 改价后加价金额 Handle uint `json:"handle"` // 1=未处理 2=已处理 Reason string `json:"reason"` // 驳回原因 } From 24e3ab7ac4d923e67f21d6237c0a690d268f5c29 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 13:55:42 +0800 Subject: [PATCH 17/25] =?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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/customer/service/service.go b/customer/service/service.go index b72a1ab..3eaf512 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -6,7 +6,8 @@ import ( ) type Service struct { - Audit audit + Audit audit + Service service } type ArgsServiceLists struct { @@ -21,8 +22,11 @@ type ReplyServiceLists struct { AuditStatus uint `json:"auditStatus"` } +type service struct { +} + // All @Title 全部服务 -func (s *Service) All(ctx context.Context, customerId uint) (reply []ReplyServiceLists, err error) { +func (s *service) All(ctx context.Context, customerId uint) (reply []ReplyServiceLists, err error) { xClient, err := client.GetClient(s) if err != nil { return From 2c2b6059dcb04e8e8887c9cb0c512c34811bffe4 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 12 Aug 2022 14:12:57 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user/user.go | 1 + supply/brand.go | 10 --------- supply/sku.go | 49 ------------------------------------------- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/customer/user/user.go b/customer/user/user.go index 0c35d60..d77dbca 100644 --- a/customer/user/user.go +++ b/customer/user/user.go @@ -3,4 +3,5 @@ package user type User struct { Deposit deposit // 充值 DepositAudit depositAudit // 充值审核 + Wallet wallet // 钱包 } diff --git a/supply/brand.go b/supply/brand.go index f9a54ca..d4516ff 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -91,13 +91,3 @@ func (b *brand) FindByIds(ctx context.Context, args ArgsBrandFindByIds) (result err = xClient.Call(ctx, "FindByIds", args, &result) return } - -// Export @Title 导出品牌 -func (b *brand) Export(ctx context.Context, name string) (result []BrandItem, err error) { - xClient, err := client.GetClient(b) - if err != nil { - return - } - err = xClient.Call(ctx, "Export", name, &result) - return -} diff --git a/supply/sku.go b/supply/sku.go index 47e364d..10f21da 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -147,8 +147,6 @@ type SkuItem struct { CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% AdjustType uint `json:"adjustType"` // 加价类型 AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 - AfterAdjustType uint `json:"afterType"` // 改价后加价类型 - AfterAdjustPrice decimal.Decimal `json:"afterPrice"` // 改价后加价金额 Handle uint `json:"handle"` // 1=未处理 2=已处理 Reason string `json:"reason"` // 驳回原因 } @@ -241,7 +239,6 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro type ArgsReplaceImg struct { Id uint - SkuId uint ReplacePath string } @@ -255,49 +252,3 @@ func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) { 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 // 商品参数信息 -} - -// 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 -} From 326319ebc598eaee714ca254f0c52873f4d17837 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 14:39:20 +0800 Subject: [PATCH 19/25] =?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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 47e364d..6d4f171 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -60,9 +60,8 @@ type ArgsSkuAdd struct { } type SkuImg struct { - Id uint `json:"id"` - Path string `json:"path"` - ReplacePath string `json:"replacePath"` + Id uint `json:"id"` + Path string `json:"path"` } type SkuSpecification struct { From 3408c0bb26abeab24245f34cfc31c876ff44ad32 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 15:04:24 +0800 Subject: [PATCH 20/25] =?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, 5 insertions(+), 2 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index cfa63b0..4a7beb5 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -146,6 +146,8 @@ type SkuItem struct { 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"` // 驳回原因 } @@ -237,8 +239,9 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro } type ArgsReplaceImg struct { - Id uint - ReplacePath string + SkuId uint + Id uint + Path string } // ReplaceImg @Title 替换图片 From c43960d9c86c81450d15bfb0cbe49bd1e21a26cc Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 15:16:07 +0800 Subject: [PATCH 21/25] =?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/brand.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/supply/brand.go b/supply/brand.go index d4516ff..e804eec 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -49,6 +49,16 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { return } +// All2 @Title 品牌名称筛选品牌 +func (b *brand) All2(ctx context.Context, name string) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "All2", 0, &result) + return +} + type ArgsBrandAdd struct { Name string // 品牌名称 } From f68613e0668d7b9cd7260bcb8d9e83d0f0c6237b Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 15:26:36 +0800 Subject: [PATCH 22/25] =?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/brand.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supply/brand.go b/supply/brand.go index e804eec..436e0eb 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -55,7 +55,7 @@ func (b *brand) All2(ctx context.Context, name string) (result []BrandItem, err if err != nil { return } - err = xClient.Call(ctx, "All2", 0, &result) + err = xClient.Call(ctx, "All2", name, &result) return } From 6fc1826e4dd2a79d85037fc2e927d5098b6fc626 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 12 Aug 2022 15:51:21 +0800 Subject: [PATCH 23/25] =?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/brand.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supply/brand.go b/supply/brand.go index 436e0eb..8ac4215 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -49,13 +49,13 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { return } -// All2 @Title 品牌名称筛选品牌 -func (b *brand) All2(ctx context.Context, name string) (result []BrandItem, err error) { +// 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, "All2", name, &result) + err = xClient.Call(ctx, "FindByNameAll", name, &result) return } From 09944b0a82f9a6262d64536dd411a16c0d6ec9de Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 12 Aug 2022 17:01:44 +0800 Subject: [PATCH 24/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/sku.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index ee277f6..6a3c8a6 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -43,6 +43,8 @@ type SkuItem struct { Status uint `json:"status"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` } type ReplySkuList struct { Lists []SkuItem `json:"lists"` @@ -90,6 +92,8 @@ type SkuDetailItem struct { Imgs []SkuImg `json:"imgs"` Specifications []SkuSpecification `json:"specifications"` GroupSkuIds []uint `json:"groupSkuIds"` + TaxName string + TaxCode string } type SkuImg struct { Path string `json:"path"` From 59390276a7e41987080c9a4360ad2079e02ee662 Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 12 Aug 2022 17:02:54 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply/channel/sku.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 6a3c8a6..55ce82c 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -40,11 +40,11 @@ type SkuItem struct { 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"` - TaxName string `json:"taxName"` - TaxCode string `json:"taxCode"` } type ReplySkuList struct { Lists []SkuItem `json:"lists"` @@ -85,6 +85,8 @@ type SkuDetailItem struct { 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"` @@ -92,8 +94,6 @@ type SkuDetailItem struct { Imgs []SkuImg `json:"imgs"` Specifications []SkuSpecification `json:"specifications"` GroupSkuIds []uint `json:"groupSkuIds"` - TaxName string - TaxCode string } type SkuImg struct { Path string `json:"path"`