diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go index 368109e..bcaed84 100644 --- a/customer/service/audit/supply.go +++ b/customer/service/audit/supply.go @@ -82,3 +82,20 @@ func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySuppl err = xClient.Call(ctx, "Info", userServiceId, &reply) 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 +} diff --git a/customer/service/service.go b/customer/service/service.go index 3eaf512..6a5b359 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -16,10 +16,11 @@ type ArgsServiceLists struct { } type ReplyServiceLists struct { - ServiceId uint `json:"serviceId"` - ServiceName string `json:"serviceName"` - EndTime int64 `json:"endTime"` - AuditStatus uint `json:"auditStatus"` + UserServiceId uint `json:"userServiceId"` + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + EndTime int64 `json:"endTime"` + AuditStatus uint `json:"auditStatus"` } type service struct { diff --git a/jd/brand.go b/jd/brand.go index 3ad00d1..6a1e96b 100644 --- a/jd/brand.go +++ b/jd/brand.go @@ -49,16 +49,12 @@ func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) error { return xClient.Call(ctx, "Edit", args, &reply) } -type ArgsImport struct { - Name string // 品牌名称 - SupplyBrandId uint // 匹配的品牌Id -} - -func (b *brand) Import(ctx context.Context, args []ArgsImport) error { - reply := 0 +// FindBrandByName @Title 根据品牌名称获取全部品牌 +func (b *brand) FindBrandByName(ctx context.Context, name string) (reply []BrandItem, err error) { xClient, err := client.GetClient(b) if err != nil { - return err + return nil, err } - return xClient.Call(ctx, "Import", args, &reply) + err = xClient.Call(ctx, "FindBrandByName", name, &reply) + return } diff --git a/jd/sku.go b/jd/sku.go index 79574e2..8830e71 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -238,3 +238,13 @@ func (s *sku) ReplaceImgJdSku(ctx context.Context, args ArgsSkuReplaceImgJdSku) } 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) +} diff --git a/supply/brand.go b/supply/brand.go index d4516ff..8ac4215 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -49,6 +49,16 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { return } +// FindByNameAll @Title 品牌名称筛选品牌 +func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandItem, err error) { + xClient, err := client.GetClient(b) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByNameAll", name, &result) + return +} + type ArgsBrandAdd struct { Name string // 品牌名称 } diff --git a/supply/channel/sku.go b/supply/channel/sku.go index ee277f6..265225f 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -40,6 +40,8 @@ type SkuItem struct { Tax string `json:"tax"` Unit string `json:"unit"` UpcCode string `json:"upcCode"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` Status uint `json:"status"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` @@ -83,6 +85,8 @@ type SkuDetailItem struct { Tax string `json:"tax"` Unit string `json:"unit"` UpcCode string `json:"upcCode"` + TaxName string `json:"taxName"` + TaxCode string `json:"taxCode"` Status uint `json:"status"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` @@ -115,6 +119,49 @@ func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails 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 { Address string // 地址 Skus []SkuStockItem // sku信息 diff --git a/supply/sku.go b/supply/sku.go index 10f21da..12a66d7 100644 --- a/supply/sku.go +++ b/supply/sku.go @@ -60,9 +60,8 @@ type ArgsSkuAdd struct { } type SkuImg struct { - Id uint `json:"id"` - Path string `json:"path"` - ReplacePath string `json:"replacePath"` + Id uint `json:"id"` + Path string `json:"path"` } type SkuSpecification struct { @@ -147,6 +146,8 @@ type SkuItem struct { CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% AdjustType uint `json:"adjustType"` // 加价类型 AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 + AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型 + AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额 Handle uint `json:"handle"` // 1=未处理 2=已处理 Reason string `json:"reason"` // 驳回原因 } @@ -238,8 +239,9 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro } type ArgsReplaceImg struct { - Id uint - ReplacePath string + SkuId uint + Id uint + Path string } // ReplaceImg @Title 替换图片 @@ -252,3 +254,49 @@ func (s *sku) ReplaceImg(ctx context.Context, args ArgsReplaceImg) (err error) { err = xClient.Call(ctx, "ReplaceImg", args, &reply) 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 +}