|
|
@ -3,6 +3,7 @@ package supply
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
|
|
|
|
"git.oa00.com/supply-chain/service/lib/bean"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
"github.com/shopspring/decimal"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -28,6 +29,13 @@ const (
|
|
|
|
SkuAuditStatusWait = 1 // 待审核
|
|
|
|
SkuAuditStatusWait = 1 // 待审核
|
|
|
|
SkuAuditStatusAdopt = 2 // 审核通过
|
|
|
|
SkuAuditStatusAdopt = 2 // 审核通过
|
|
|
|
SkuAuditStatusReject = 3 // 审核驳回
|
|
|
|
SkuAuditStatusReject = 3 // 审核驳回
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProfitGtZero = 1 // 利润比大于0
|
|
|
|
|
|
|
|
ProfitEqZero = 2 // 利润比等于0
|
|
|
|
|
|
|
|
ProfitLtZero = 3 // 利润比小于0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PlatformStatusOn = 1 // 平台上架状态
|
|
|
|
|
|
|
|
PlatformStatusDown = 2 // 平台下架状态
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuAdd struct {
|
|
|
|
type ArgsSkuAdd struct {
|
|
|
@ -81,3 +89,74 @@ func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error {
|
|
|
|
reply := 0
|
|
|
|
reply := 0
|
|
|
|
return client.GetClient(s).Call(ctx, "Adjust", args, &reply)
|
|
|
|
return client.GetClient(s).Call(ctx, "Adjust", args, &reply)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuLists struct {
|
|
|
|
|
|
|
|
Search skuListsSearch
|
|
|
|
|
|
|
|
Page bean.Page
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type skuListsSearch struct {
|
|
|
|
|
|
|
|
Name string // 商品名称
|
|
|
|
|
|
|
|
Source uint // 所属供应商 1=京东
|
|
|
|
|
|
|
|
Id uint // 瑞库客id
|
|
|
|
|
|
|
|
SourceSkuId uint // 供应商skuId
|
|
|
|
|
|
|
|
BrandId uint // 品牌Id
|
|
|
|
|
|
|
|
ThridCategoryId uint // 三级分类Id
|
|
|
|
|
|
|
|
AdjustType uint // 加价规则
|
|
|
|
|
|
|
|
MaxSupplyPrice decimal.Decimal // 最大采购价格
|
|
|
|
|
|
|
|
MinSupplyPrice decimal.Decimal // 最小采购价格
|
|
|
|
|
|
|
|
CustomerProfitRate uint // 客户利润比 1=大于0 2=等于0 3=小于0
|
|
|
|
|
|
|
|
Handle uint // 处理状态
|
|
|
|
|
|
|
|
AuditStatus uint // 审核状态
|
|
|
|
|
|
|
|
SourceStatus uint // 供应商下架状态
|
|
|
|
|
|
|
|
PlatformStatus uint // 平台下架状态
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ReplySkuList struct {
|
|
|
|
|
|
|
|
Lists []SkuItem
|
|
|
|
|
|
|
|
Total int64
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type SkuItem struct {
|
|
|
|
|
|
|
|
Id uint
|
|
|
|
|
|
|
|
Name string // 名称
|
|
|
|
|
|
|
|
BrandId uint // 品牌id
|
|
|
|
|
|
|
|
FirstCategoryId uint // 一级分类id
|
|
|
|
|
|
|
|
SecondCategoryId uint // 二级分类id
|
|
|
|
|
|
|
|
ThirdCategoryId uint // 三级分类id
|
|
|
|
|
|
|
|
SupplyPrice decimal.Decimal // 采购价
|
|
|
|
|
|
|
|
GuidePrice decimal.Decimal // 指导价
|
|
|
|
|
|
|
|
ImgUrl string // 商品主图
|
|
|
|
|
|
|
|
PlatformStatus uint // 平台状态 1=上架 2=下架
|
|
|
|
|
|
|
|
Source uint // 来源 1=京东
|
|
|
|
|
|
|
|
SourceSkuId string // 源skuId
|
|
|
|
|
|
|
|
SourceStatus uint // 供应商状态 1=上架 2=下架
|
|
|
|
|
|
|
|
CustomerPrice decimal.Decimal // 供货最高价
|
|
|
|
|
|
|
|
CustomerProfitRate decimal.Decimal // 供货利润率 供货利润/供货最高价%
|
|
|
|
|
|
|
|
AdjustType uint // 加价类型
|
|
|
|
|
|
|
|
AdjustPrice decimal.Decimal // 加价金额
|
|
|
|
|
|
|
|
Handle uint // 1=未处理 2=已处理
|
|
|
|
|
|
|
|
Imgs []SkuImg
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Lists @Title 商品列表
|
|
|
|
|
|
|
|
func (s *sku) Lists(ctx context.Context, args ArgsSkuLists) error {
|
|
|
|
|
|
|
|
reply := 0
|
|
|
|
|
|
|
|
return client.GetClient(s).Call(ctx, "Lists", args, &reply)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ArgsSkuOnShelves struct {
|
|
|
|
|
|
|
|
SkuIds []uint
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// OnShelves @Title 上架
|
|
|
|
|
|
|
|
func (s *sku) OnShelves(ctx context.Context, args ArgsSkuLists) error {
|
|
|
|
|
|
|
|
reply := 0
|
|
|
|
|
|
|
|
return client.GetClient(s).Call(ctx, "OnShelves", args, &reply)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DownShelves @Title 下架
|
|
|
|
|
|
|
|
func (s *sku) DownShelves(ctx context.Context, args ArgsSkuLists) error {
|
|
|
|
|
|
|
|
reply := 0
|
|
|
|
|
|
|
|
return client.GetClient(s).Call(ctx, "DownShelves", args, &reply)
|
|
|
|
|
|
|
|
}
|
|
|
|