diff --git a/jd/sku.go b/jd/sku.go index 2189032..5e9bcbe 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -142,7 +142,7 @@ type AdoptItem struct { } // Adopt @Title 入库 -func (s *sku) Adopt(ctx context.Context, skuIds []uint) (reply AdoptItem, err error) { - err = client.GetClient(s).Call(ctx, "Adopt", skuIds, &reply) - return +func (s *sku) Adopt(ctx context.Context, skuIds []uint) (err error) { + reply := 0 + return client.GetClient(s).Call(ctx, "Adopt", skuIds, &reply) } diff --git a/supply/sku.go b/supply/sku.go index 1feb9f6..ddba1b0 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -3,6 +3,7 @@ package supply import ( "context" "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" ) @@ -85,3 +86,91 @@ func (s *sku) Adjust(ctx context.Context, args ArgsSkuAdjust) error { reply := 0 return client.GetClient(s).Call(ctx, "Adjust", args, &reply) } + +type ArgsSkuLists struct { + Search SkuListsSearch + Page bean.Page +} + +type SkuListsSearch struct { + Name string // 商品名称 + SourceId 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 // 名称 + BrandName string // 品牌名称 + FirstCategoryId uint // 一级分类id + SecondCategoryId uint // 二级分类id + ThirdCategoryId uint // 三级分类id + SupplyPrice decimal.Decimal // 采购价 + GuidePrice decimal.Decimal // 指导价 + ImgUrl string // 商品主图 + PlatformStatus uint // 平台状态 1=上架 2=下架 + SourceName string // 供应商名称 + 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) (reply ReplySkuList, err error) { + err = client.GetClient(s).Call(ctx, "Lists", args, &reply) + return +} + +type ArgsSkuOnShelves struct { + SkuIds []uint +} + +type ArgsSkuDownShelves struct { + SkuIds []uint +} + +// OnShelves @Title 上架 +func (s *sku) OnShelves(ctx context.Context, args ArgsSkuOnShelves) error { + reply := 0 + return client.GetClient(s).Call(ctx, "OnShelves", args, &reply) +} + +// DownShelves @Title 下架 +func (s *sku) DownShelves(ctx context.Context, args ArgsSkuDownShelves) error { + reply := 0 + return client.GetClient(s).Call(ctx, "DownShelves", args, &reply) +} + +type ArgsSkuAdjustType struct { + SkuId uint + AdjustType uint + AdjustPrice decimal.Decimal + ApplyUserId uint +} + +// EditAdjust @Title 修改改价类型 +func (s *sku) EditAdjust(ctx context.Context, args ArgsSkuAdjustType) error { + reply := 0 + return client.GetClient(s).Call(ctx, "EditAdjust", args, &reply) +} diff --git a/supply/skuAudit.go b/supply/skuAudit.go index 162e0ca..4dc5ec5 100644 --- a/supply/skuAudit.go +++ b/supply/skuAudit.go @@ -2,8 +2,11 @@ package supply import ( "context" + "database/sql" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" + "time" ) type skuAudit struct { @@ -15,18 +18,39 @@ type ArgsSkuAuditLists struct { } type SkuAuditSearch struct { + SourceId uint // 供应商id + AdjustType uint // 加价类型 + Status uint // 状态 1=未审核 2=通过 3=驳回 } -type SkuAuditItem struct { - Id uint `json:"id"` +type SkuAndAuditItem struct { + AuditId uint `json:"auditId"` + SkuId uint `json:"skuId"` + AfterAdjustType uint `json:"afterAdjustType"` + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` + Name string `json:"name"` + SupplyPrice decimal.Decimal `json:"supplyPrice"` + GuidePrice decimal.Decimal `json:"guidePrice"` + AdjustType uint `json:"adjustType"` + AdjustPrice decimal.Decimal `json:"adjustPrice"` + CustomerPrice decimal.Decimal `json:"customerPrice"` + Category string `json:"category"` + BrandName string `json:"brandName"` + SourceName string `json:"sourceName"` + AuditUserId uint `json:"auditUserId"` + AuditAt sql.NullTime `json:"auditAt"` + ImgUrl string `json:"imgUrl"` + Reason string `json:"reason"` + CreatedAt time.Time `json:"createdAt"` } + type ReplySkuAuditLists struct { - Lists []SkuAuditItem `json:"lists"` - Total int64 `json:"total"` + Lists []SkuAndAuditItem `json:"lists"` + Total int64 `json:"total"` } // Lists @Title 审核列表 -func (s *skuAudit) Lists(ctx context.Context, args ArgsBrandList) (result ReplySkuAuditLists, err error) { - err = client.GetClient(s).Call(ctx, "Lists", args, &result) +func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (reply ReplySkuAuditLists, err error) { + err = client.GetClient(s).Call(ctx, "Lists", args, &reply) return } diff --git a/supply/source.go b/supply/source.go new file mode 100644 index 0000000..96cdc58 --- /dev/null +++ b/supply/source.go @@ -0,0 +1,9 @@ +package supply + +type Source struct { + Id uint `gorm:"primaryKey"` + Name string // 供货商名称 + Base string // rpc服务基础名称 + SkuName string // sku名称 + OrderName string // order名称 +}