From aee70d3f2b1ac5fccd7bdccb8689937eb392cf95 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 15 Aug 2022 14:27:07 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E5=BA=9F=E5=BC=83=E5=95=86=E5=93=81=E8=BF=94=E5=9B=9E=E5=BE=85?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd/sku.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jd/sku.go b/jd/sku.go index 79574e2..8830e71 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -238,3 +238,13 @@ func (s *sku) ReplaceImgJdSku(ctx context.Context, args ArgsSkuReplaceImgJdSku) } return xClient.Call(ctx, "ReplaceImgJdSku", args, &reply) } + +// ReHandle @Title 重新处理商品 +func (s *sku) ReHandle(ctx context.Context, skuId uint) error { + reply := 0 + xClient, err := client.GetClient(s) + if err != nil { + return err + } + return xClient.Call(ctx, "ReHandle", skuId, &reply) +} From 5932d9d04e03b28fe930e53d3879c05775538b0e Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 16 Aug 2022 13:49:42 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E6=9B=B4=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/sku.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 4a7beb5..356788f 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -239,9 +239,9 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro } type ArgsReplaceImg struct { - SkuId uint - Id uint - Path string + SkuId uint + Id uint + ReplacePath string } // ReplaceImg @Title 替换图片 @@ -254,3 +254,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 ad0b30d4cc8f5d62bf70db828d91e61f1bcf541b Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 16 Aug 2022 13:53:07 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E6=9B=B4=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/sku.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supply/sku.go b/supply/sku.go index 356788f..12a66d7 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -239,9 +239,9 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro } type ArgsReplaceImg struct { - SkuId uint - Id uint - ReplacePath string + SkuId uint + Id uint + Path string } // ReplaceImg @Title 替换图片 From 25d8333f0aa070c247ca30b38e080f23171526cf Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 17 Aug 2022 15:47:48 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=B7=E6=A0=BC?= =?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/channel/sku.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 55ce82c..44e0986 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -119,6 +119,30 @@ func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails 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 ArgsSkuStock struct { Address string // 地址 Skus []SkuStockItem // sku信息 From 508fb8ea5480e2341162f1e0df1b50c1c3122224 Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 18 Aug 2022 11:27:49 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=BB=84?= =?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/channel/sku.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 44e0986..265225f 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -143,6 +143,25 @@ func (s *sku) Prices(ctx context.Context, channelId string, args ArgsSkuPrices) 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信息 From 24285c22025aeea253a5b6abe015548ffeeb7f3a Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 19 Aug 2022 09:02:28 +0800 Subject: [PATCH 06/13] =?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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go index 368109e..bcaed84 100644 --- a/customer/service/audit/supply.go +++ b/customer/service/audit/supply.go @@ -82,3 +82,20 @@ func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySuppl 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 +} From c70fd572050ea658defe192ebf522cf0c95fa533 Mon Sep 17 00:00:00 2001 From: sian Date: Fri, 19 Aug 2022 09:36:54 +0800 Subject: [PATCH 07/13] =?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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/customer/service/service.go b/customer/service/service.go index 3eaf512..6a5b359 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -16,10 +16,11 @@ type ArgsServiceLists struct { } type ReplyServiceLists struct { - ServiceId uint `json:"serviceId"` - ServiceName string `json:"serviceName"` - EndTime int64 `json:"endTime"` - AuditStatus uint `json:"auditStatus"` + UserServiceId uint `json:"userServiceId"` + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + EndTime int64 `json:"endTime"` + AuditStatus uint `json:"auditStatus"` } type service struct { From 96877af57292819d999ebdff091cfe912ee0a83e Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 19 Aug 2022 19:09:20 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B6=88=E8=B4=B9?= =?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/user/wallet.go | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/customer/user/wallet.go b/customer/user/wallet.go index 1136b89..58a56ca 100644 --- a/customer/user/wallet.go +++ b/customer/user/wallet.go @@ -36,3 +36,52 @@ func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error } return xClient.Call(ctx, "Direct", args, &reply) } + +type ArgsWalletCreate struct { + UserId uint // 客户id + WalletType walletType // 收支类型 + Amount decimal.Decimal // 金额 正数 + ServiceId uint // 服务id + Remark string // 备注信息 + CancelSecond int64 // 自动取消秒 +} + +// Create @Title 创建消费 +func (w *wallet) Create(ctx context.Context, args ArgsWalletCreate) (walletId uint, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "Create", args, &walletId) + return +} + +type ArgsWalletSuccess struct { + UserId uint // 客户id + WalletId uint // 消费id +} + +// Success @Title 成功 +func (w *wallet) Success(ctx context.Context, args ArgsWalletSuccess) (walletId uint, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "Success", args, &walletId) + return +} + +type ArgsWalletFail struct { + UserId uint // 客户id + WalletId uint // 消费id +} + +// Fail @Title 失败 +func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) (walletId uint, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "Fail", args, &walletId) + return +} From d1065c38b4b3e0a2d67c5c5c78b368e068513290 Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Aug 2022 09:42:17 +0800 Subject: [PATCH 09/13] =?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 --- customer/user/wallet.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/customer/user/wallet.go b/customer/user/wallet.go index 58a56ca..50aea1f 100644 --- a/customer/user/wallet.go +++ b/customer/user/wallet.go @@ -62,13 +62,13 @@ type ArgsWalletSuccess struct { } // Success @Title 成功 -func (w *wallet) Success(ctx context.Context, args ArgsWalletSuccess) (walletId uint, err error) { +func (w *wallet) Success(ctx context.Context, args ArgsWalletSuccess) error { + reply := 0 xClient, err := client.GetClient(w) if err != nil { - return + return err } - err = xClient.Call(ctx, "Success", args, &walletId) - return + return xClient.Call(ctx, "Success", args, &reply) } type ArgsWalletFail struct { @@ -77,11 +77,11 @@ type ArgsWalletFail struct { } // Fail @Title 失败 -func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) (walletId uint, err error) { +func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) error { + reply := 0 xClient, err := client.GetClient(w) if err != nil { - return + return err } - err = xClient.Call(ctx, "Fail", args, &walletId) - return + return xClient.Call(ctx, "Fail", args, &reply) } From a5f552c6770e5249fece86c0710c2b97805dcb7e Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Aug 2022 11:22:56 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=87=A0=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 6e3a5aa..4a6d991 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -10,6 +10,17 @@ import ( const ( ReplyOrderFreightFeeErrCodeNone = 0 // 无错误 ReplyOrderFreightFeeErrCodeErr = 1 // 有错误 + + OrderStatusLock = 1 // 锁单待确认 + OrderStatusLadingBill = 2 // 提单 + OrderStatusClose = 3 // 关闭 + + OrderSubStatusLock = 1 // 锁单 + OrderSubStatusLadingBill = 2 // 提单 + OrderSubStatusSendOutGoods = 3 // 出库/发货 + OrderSubStatusDelivered = 4 // 妥投 + OrderSubStatusFinal = 5 // 完成 + OrderSubStatusCancel = 6 // 取消 ) type order struct { @@ -82,3 +93,26 @@ func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubm err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) return } + +// LadingBill @Title 提单 +func (o *order) LadingBill(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) + return +} + +type ArgsOrderClose struct { +} + +// Close @Title 关闭 +func (o *order) Close(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) + return +} From d614dde4edecd810139e34504a929edf5fe8d5fe Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Aug 2022 15:20:44 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/error.go | 6 ++++++ supply/interface/order.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/rpc/error.go b/rpc/error.go index 80f924b..37aad59 100644 --- a/rpc/error.go +++ b/rpc/error.go @@ -11,6 +11,9 @@ const ( ErrorOrderShipment Error = 11005 // 无法配送 ErrorOrderSkuPrice Error = 11006 // 商品价格错误 ErrorOrderAmount Error = 11007 // 订单金额错误 + ErrorOrderLadingBill Error = 11008 // 订单已提单 + ErrorOrderClose Error = 11009 // 订单已关闭 + ErrorOrderTimeOut Error = 11010 // 订单超时 ) var ErrorCodes = map[Error]string{ @@ -21,6 +24,9 @@ var ErrorCodes = map[Error]string{ ErrorOrderShipment: "无法配送", ErrorOrderSkuPrice: "商品价格错误", ErrorOrderAmount: "订单金额错误", + ErrorOrderLadingBill: "订单已提单", + ErrorOrderClose: "订单已关闭", + ErrorOrderTimeOut: "订单超时", } func (e Error) Error() string { diff --git a/supply/interface/order.go b/supply/interface/order.go index c8c5d4a..1630fc4 100644 --- a/supply/interface/order.go +++ b/supply/interface/order.go @@ -10,6 +10,10 @@ type OrderInterface interface { FreightFee(ctx context.Context, args ArgsOrderFreightFee, freightFee *decimal.Decimal) error // Submit 下单 Submit(ctx context.Context, args ArgsOrderSubmit, sourceOrderSn *string) error + // LadingBill @Title 提单 + LadingBill(ctx context.Context, orderSn string, reply *int) error + // Close @Title 关闭订单 + Close(ctx context.Context, orderSn string, reply *int) error } type ArgsOrderFreightFee struct { Skus []OrderFreightFeeSkuItem // 商品信息 From fa1dc184d51d5b4943eb1b6f165f2f222e259850 Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Aug 2022 16:08:46 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/error.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpc/error.go b/rpc/error.go index 37aad59..53999b0 100644 --- a/rpc/error.go +++ b/rpc/error.go @@ -14,6 +14,7 @@ const ( ErrorOrderLadingBill Error = 11008 // 订单已提单 ErrorOrderClose Error = 11009 // 订单已关闭 ErrorOrderTimeOut Error = 11010 // 订单超时 + ErrorOrderError Error = 11011 // 订单错误 ) var ErrorCodes = map[Error]string{ @@ -27,6 +28,7 @@ var ErrorCodes = map[Error]string{ ErrorOrderLadingBill: "订单已提单", ErrorOrderClose: "订单已关闭", ErrorOrderTimeOut: "订单超时", + ErrorOrderError: "订单错误", } func (e Error) Error() string { From dd412d9cbf7e68a299ee2f19a01541cfca3e0a4a Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Aug 2022 16:24:27 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user/wallet.go | 2 +- supply/channel/order.go | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/customer/user/wallet.go b/customer/user/wallet.go index 50aea1f..9df4525 100644 --- a/customer/user/wallet.go +++ b/customer/user/wallet.go @@ -28,7 +28,7 @@ type ArgsWalletDirect struct { } // Direct @Title 直接消费 -func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error { +func (w *wallet) Direct(ctx context.Context, args ArgsWalletDirect) error { reply := 0 xClient, err := client.GetClient(w) if err != nil { diff --git a/supply/channel/order.go b/supply/channel/order.go index 4a6d991..b3a2eaf 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -95,24 +95,21 @@ func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubm } // LadingBill @Title 提单 -func (o *order) LadingBill(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { +func (o *order) LadingBill(ctx context.Context, channelId string, orderSn string) (err error) { + reply := 0 xClient, err := client.GetClient(o) if err != nil { return } - err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) - return -} - -type ArgsOrderClose struct { + return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", orderSn, &reply) } // Close @Title 关闭 -func (o *order) Close(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { +func (o *order) Close(ctx context.Context, channelId string, orderSn string) (err error) { + reply := 0 xClient, err := client.GetClient(o) if err != nil { return } - err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) - return + return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", orderSn, &reply) }