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

finance
黄伟 2 years ago
commit edf6005bc8

@ -82,3 +82,20 @@ func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySuppl
err = xClient.Call(ctx, "Info", userServiceId, &reply) err = xClient.Call(ctx, "Info", userServiceId, &reply)
return 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
}

@ -16,6 +16,7 @@ type ArgsServiceLists struct {
} }
type ReplyServiceLists struct { type ReplyServiceLists struct {
UserServiceId uint `json:"userServiceId"`
ServiceId uint `json:"serviceId"` ServiceId uint `json:"serviceId"`
ServiceName string `json:"serviceName"` ServiceName string `json:"serviceName"`
EndTime int64 `json:"endTime"` EndTime int64 `json:"endTime"`

@ -28,7 +28,7 @@ type ArgsWalletDirect struct {
} }
// Direct @Title 直接消费 // Direct @Title 直接消费
func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error { func (w *wallet) Direct(ctx context.Context, args ArgsWalletDirect) error {
reply := 0 reply := 0
xClient, err := client.GetClient(w) xClient, err := client.GetClient(w)
if err != nil { if err != nil {
@ -36,3 +36,52 @@ func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error
} }
return xClient.Call(ctx, "Direct", args, &reply) 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) error {
reply := 0
xClient, err := client.GetClient(w)
if err != nil {
return err
}
return xClient.Call(ctx, "Success", args, &reply)
}
type ArgsWalletFail struct {
UserId uint // 客户id
WalletId uint // 消费id
}
// Fail @Title 失败
func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) error {
reply := 0
xClient, err := client.GetClient(w)
if err != nil {
return err
}
return xClient.Call(ctx, "Fail", args, &reply)
}

@ -238,3 +238,13 @@ func (s *sku) ReplaceImgJdSku(ctx context.Context, args ArgsSkuReplaceImgJdSku)
} }
return xClient.Call(ctx, "ReplaceImgJdSku", args, &reply) 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)
}

@ -11,6 +11,10 @@ const (
ErrorOrderShipment Error = 11005 // 无法配送 ErrorOrderShipment Error = 11005 // 无法配送
ErrorOrderSkuPrice Error = 11006 // 商品价格错误 ErrorOrderSkuPrice Error = 11006 // 商品价格错误
ErrorOrderAmount Error = 11007 // 订单金额错误 ErrorOrderAmount Error = 11007 // 订单金额错误
ErrorOrderLadingBill Error = 11008 // 订单已提单
ErrorOrderClose Error = 11009 // 订单已关闭
ErrorOrderTimeOut Error = 11010 // 订单超时
ErrorOrderError Error = 11011 // 订单错误
) )
var ErrorCodes = map[Error]string{ var ErrorCodes = map[Error]string{
@ -21,6 +25,10 @@ var ErrorCodes = map[Error]string{
ErrorOrderShipment: "无法配送", ErrorOrderShipment: "无法配送",
ErrorOrderSkuPrice: "商品价格错误", ErrorOrderSkuPrice: "商品价格错误",
ErrorOrderAmount: "订单金额错误", ErrorOrderAmount: "订单金额错误",
ErrorOrderLadingBill: "订单已提单",
ErrorOrderClose: "订单已关闭",
ErrorOrderTimeOut: "订单超时",
ErrorOrderError: "订单错误",
} }
func (e Error) Error() string { func (e Error) Error() string {

@ -10,6 +10,17 @@ import (
const ( const (
ReplyOrderFreightFeeErrCodeNone = 0 // 无错误 ReplyOrderFreightFeeErrCodeNone = 0 // 无错误
ReplyOrderFreightFeeErrCodeErr = 1 // 有错误 ReplyOrderFreightFeeErrCodeErr = 1 // 有错误
OrderStatusLock = 1 // 锁单待确认
OrderStatusLadingBill = 2 // 提单
OrderStatusClose = 3 // 关闭
OrderSubStatusLock = 1 // 锁单
OrderSubStatusLadingBill = 2 // 提单
OrderSubStatusSendOutGoods = 3 // 出库/发货
OrderSubStatusDelivered = 4 // 妥投
OrderSubStatusFinal = 5 // 完成
OrderSubStatusCancel = 6 // 取消
) )
type order struct { type order struct {
@ -82,3 +93,23 @@ 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) err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply)
return return
} }
// LadingBill @Title 提单
func (o *order) LadingBill(ctx context.Context, channelId string, orderSn string) (err error) {
reply := 0
xClient, err := client.GetClient(o)
if err != nil {
return
}
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, orderSn string) (err error) {
reply := 0
xClient, err := client.GetClient(o)
if err != nil {
return
}
return xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", orderSn, &reply)
}

@ -119,6 +119,49 @@ func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails
return 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 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 { type ArgsSkuStock struct {
Address string // 地址 Address string // 地址
Skus []SkuStockItem // sku信息 Skus []SkuStockItem // sku信息

@ -10,6 +10,10 @@ type OrderInterface interface {
FreightFee(ctx context.Context, args ArgsOrderFreightFee, freightFee *decimal.Decimal) error FreightFee(ctx context.Context, args ArgsOrderFreightFee, freightFee *decimal.Decimal) error
// Submit 下单 // Submit 下单
Submit(ctx context.Context, args ArgsOrderSubmit, sourceOrderSn *string) error 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 { type ArgsOrderFreightFee struct {
Skus []OrderFreightFeeSkuItem // 商品信息 Skus []OrderFreightFeeSkuItem // 商品信息

@ -255,3 +255,49 @@ func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) {
err = xClient.Call(ctx, "ReplaceImg", args, &reply) err = xClient.Call(ctx, "ReplaceImg", args, &reply)
return 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
}

Loading…
Cancel
Save