Merge branch 'master' of git.oa00.com:supply-chain/service

finance
黄伟 2 years ago
commit 09a5b9d21b

@ -6,17 +6,21 @@ const (
ErrorSystem Error = 11001 // 系统错误 ErrorSystem Error = 11001 // 系统错误
ErrorOrderRepeat Error = 11002 // 重复下单 ErrorOrderRepeat Error = 11002 // 重复下单
ErrorOrderFreightFee Error = 11003 // 运费获取失败 ErrorOrderFreightFee Error = 11003 // 运费错误
ErrorOrderSubmit Error = 11004 // 下单失败 ErrorOrderSubmit Error = 11004 // 下单失败
ErrorOrderShipment Error = 11005 // 无法配送 ErrorOrderShipment Error = 11005 // 无法配送
ErrorOrderSkuPrice Error = 11006 // 商品价格错误
ErrorOrderAmount Error = 11007 // 订单金额错误
) )
var ErrorCodes = map[Error]string{ var ErrorCodes = map[Error]string{
ErrorSystem: "系统错误", ErrorSystem: "系统错误",
ErrorOrderRepeat: "重复下单", ErrorOrderRepeat: "重复下单",
ErrorOrderFreightFee: "运费获取失败", ErrorOrderFreightFee: "运费错误",
ErrorOrderSubmit: "下单失败", ErrorOrderSubmit: "下单失败",
ErrorOrderShipment: "无法配送", ErrorOrderShipment: "无法配送",
ErrorOrderSkuPrice: "商品价格错误",
ErrorOrderAmount: "订单金额错误",
} }
func (e Error) Error() string { func (e Error) Error() string {

@ -41,13 +41,23 @@ func (o *order) FreightFee(ctx context.Context, channelId string, args ArgsOrder
return return
} }
type SkuOrderItem struct {
SkuId uint // skuId
Price decimal.Decimal // 单价
Quantity uint // 数量
}
type ArgsOrderSubmit struct { type ArgsOrderSubmit struct {
Address string // 地址 Address string // 地址
Skus []SkuFreightFeeItem // sku信息 Skus []SkuOrderItem // sku信息
Receiver Receiver // 收件信息 Receiver Receiver // 收件信息
OrderFee decimal.Decimal // 订单金额-不含运费 OrderFee decimal.Decimal // 订单金额-不含运费
FreightFee decimal.Decimal // 运费 FreightFees []OrderFreightFee // 运费
UserIp string // 下单用户ip UserIp string // 下单用户ip
}
type OrderFreightFee struct {
SkuIds []uint `json:"skuIds"`
FreightFee decimal.Decimal `json:"freightFee"`
} }
type Receiver struct { type Receiver struct {

@ -23,11 +23,12 @@ type OrderFreightFeeSkuItem struct {
} }
type ArgsOrderSubmit struct { type ArgsOrderSubmit struct {
OrderSn uint64 // 订单号 OrderSn uint64 // 订单号
Skus []OrderFreightFeeSkuItem // 商品信息 Skus []OrderFreightFeeSkuItem // 商品信息
Address string // 地址 Address string // 地址
Receiver OrderReceiver // 收件信息 FreightFee decimal.Decimal // 运费
UserIp string // 用户ip Receiver OrderReceiver // 收件信息
UserIp string // 用户ip
} }
type OrderReceiver struct { type OrderReceiver struct {

Loading…
Cancel
Save