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

finance
杨赟 2 years ago
commit 25554c0c32

@ -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,10 +16,11 @@ type ArgsServiceLists struct {
} }
type ReplyServiceLists struct { type ReplyServiceLists struct {
ServiceId uint `json:"serviceId"` UserServiceId uint `json:"userServiceId"`
ServiceName string `json:"serviceName"` ServiceId uint `json:"serviceId"`
EndTime int64 `json:"endTime"` ServiceName string `json:"serviceName"`
AuditStatus uint `json:"auditStatus"` EndTime int64 `json:"endTime"`
AuditStatus uint `json:"auditStatus"`
} }
type service struct { type service struct {

@ -49,16 +49,12 @@ func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) error {
return xClient.Call(ctx, "Edit", args, &reply) return xClient.Call(ctx, "Edit", args, &reply)
} }
type ArgsImport struct { // FindBrandByName @Title 根据品牌名称获取全部品牌
Name string // 品牌名称 func (b *brand) FindBrandByName(ctx context.Context, name string) (reply []BrandItem, err error) {
SupplyBrandId uint // 匹配的品牌Id
}
func (b *brand) Import(ctx context.Context, args []ArgsImport) error {
reply := 0
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return err return nil, err
} }
return xClient.Call(ctx, "Import", args, &reply) err = xClient.Call(ctx, "FindBrandByName", name, &reply)
return
} }

@ -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)
}

@ -49,6 +49,16 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) {
return 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 { type ArgsBrandAdd struct {
Name string // 品牌名称 Name string // 品牌名称
} }

@ -40,6 +40,8 @@ type SkuItem struct {
Tax string `json:"tax"` Tax string `json:"tax"`
Unit string `json:"unit"` Unit string `json:"unit"`
UpcCode string `json:"upcCode"` UpcCode string `json:"upcCode"`
TaxName string `json:"taxName"`
TaxCode string `json:"taxCode"`
Status uint `json:"status"` Status uint `json:"status"`
CreatedAt int64 `json:"createdAt"` CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"` UpdatedAt int64 `json:"updatedAt"`
@ -83,6 +85,8 @@ type SkuDetailItem struct {
Tax string `json:"tax"` Tax string `json:"tax"`
Unit string `json:"unit"` Unit string `json:"unit"`
UpcCode string `json:"upcCode"` UpcCode string `json:"upcCode"`
TaxName string `json:"taxName"`
TaxCode string `json:"taxCode"`
Status uint `json:"status"` Status uint `json:"status"`
CreatedAt int64 `json:"createdAt"` CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"` UpdatedAt int64 `json:"updatedAt"`
@ -115,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信息

@ -60,9 +60,8 @@ type ArgsSkuAdd struct {
} }
type SkuImg struct { type SkuImg struct {
Id uint `json:"id"` Id uint `json:"id"`
Path string `json:"path"` Path string `json:"path"`
ReplacePath string `json:"replacePath"`
} }
type SkuSpecification struct { type SkuSpecification struct {
@ -147,6 +146,8 @@ type SkuItem struct {
CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价% CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价%
AdjustType uint `json:"adjustType"` // 加价类型 AdjustType uint `json:"adjustType"` // 加价类型
AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额 AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额
AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型
AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额
Handle uint `json:"handle"` // 1=未处理 2=已处理 Handle uint `json:"handle"` // 1=未处理 2=已处理
Reason string `json:"reason"` // 驳回原因 Reason string `json:"reason"` // 驳回原因
} }
@ -238,8 +239,9 @@ func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err erro
} }
type ArgsReplaceImg struct { type ArgsReplaceImg struct {
Id uint SkuId uint
ReplacePath string Id uint
Path string
} }
// ReplaceImg @Title 替换图片 // ReplaceImg @Title 替换图片
@ -252,3 +254,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