From 023212fe1bc85fe6f09608500dcca76a646897d2 Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 11 Aug 2022 09:42:02 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/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 2/7] =?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 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/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 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 7/7] =?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 下单