diff --git a/customer/service/service.go b/customer/service/service.go index 6a8ec8c..b72a1ab 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -1,5 +1,32 @@ package service +import ( + "context" + "git.oa00.com/supply-chain/service/client" +) + type Service struct { Audit audit } + +type ArgsServiceLists struct { + CustomerId uint + Status uint +} + +type ReplyServiceLists struct { + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + EndTime int64 `json:"endTime"` + AuditStatus uint `json:"auditStatus"` +} + +// 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, "All", customerId, &reply) + return +} 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..db2609e 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -41,13 +41,24 @@ 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 + ChannelOrderSn string // 渠道订单编号 + 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 { @@ -58,6 +69,8 @@ type Receiver struct { } type ReplyOrderSubmit struct { + OrderSn string + ChannelOrderSn string } // Submit @Title 下单 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 {