commit
46b185d67a
@ -1,5 +0,0 @@
|
||||
package audit
|
||||
|
||||
type Audit struct {
|
||||
Supply supply
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
package audit
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type supply struct {
|
||||
}
|
||||
|
||||
type ArgsSupplyApply struct {
|
||||
ApplyUserId uint // 申请人id
|
||||
CustomerId uint // 客户id
|
||||
RateId uint // 费率id
|
||||
ExpirationAt int64 // 到期时间
|
||||
Enclosure string // 附件
|
||||
}
|
||||
|
||||
// Apply @Title 申请
|
||||
func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Apply", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsSupplyAdopt struct {
|
||||
AuditUserId uint // 审核人id
|
||||
UserServiceId uint // 客户服务id
|
||||
}
|
||||
|
||||
// Adopt @Title 审核通过
|
||||
func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Adopt", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsSupplyReject struct {
|
||||
AuditUserId uint // 审核人id
|
||||
UserServiceId uint // 客户服务id
|
||||
Reason string // 驳回原因
|
||||
}
|
||||
|
||||
// Reject @Title 驳回
|
||||
func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Reject", args, &reply)
|
||||
}
|
||||
|
||||
type ReplySupplyInfo struct {
|
||||
Id uint `json:"id"`
|
||||
UserName string `json:"userName"`
|
||||
ApplyUserId uint `json:"applyUserId"`
|
||||
ApplyAt int64 `json:"applyAt"`
|
||||
ServiceId uint `json:"serviceId"`
|
||||
ServiceName string `json:"serviceName"`
|
||||
ExpirationAt int64 `json:"expirationAt"`
|
||||
RateId uint `json:"rateId"`
|
||||
Enclosure string `json:"enclosure"`
|
||||
AuditStatus uint `json:"auditStatus"`
|
||||
AuditAt int64 `json:"auditAt"`
|
||||
Reason string `json:"reason"`
|
||||
AuditUserId uint `json:"auditUserId"`
|
||||
}
|
||||
|
||||
// Info @Title 详情
|
||||
func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
package jd
|
||||
|
||||
import "git.oa00.com/supply-chain/service/jd/jdsdk"
|
||||
|
||||
type Jd struct {
|
||||
Task task
|
||||
Brand brand
|
||||
Category category
|
||||
Sku sku
|
||||
Jdsdk jdsdk.Jdsdk
|
||||
}
|
||||
|
@ -0,0 +1,20 @@
|
||||
package jdsdk
|
||||
|
||||
import (
|
||||
"context"
|
||||
order2 "git.oa00.com/go/jdsdk/order"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type afterSale struct {
|
||||
}
|
||||
|
||||
// Info @Title 售后详情
|
||||
func (a *afterSale) Info(ctx context.Context, afsServiceId uint64) (reply order2.AfterSaleInfo, err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", afsServiceId, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package jdsdk
|
||||
|
||||
type Jdsdk struct {
|
||||
Order order
|
||||
Sku sku
|
||||
AfterSale afterSale
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package jdsdk
|
||||
|
||||
import (
|
||||
"context"
|
||||
order2 "git.oa00.com/go/jdsdk/order"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type order struct {
|
||||
}
|
||||
|
||||
// Cancel @Title 订单取消 京东订单id
|
||||
func (o *order) Cancel(ctx context.Context, orderId string) (reply order2.OrderInfo, err error) {
|
||||
xClient, err := client.GetClient(o)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Cancel", orderId, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package jdsdk
|
||||
|
||||
import (
|
||||
"context"
|
||||
sku2 "git.oa00.com/go/jdsdk/sku"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type sku struct {
|
||||
}
|
||||
|
||||
// GetDetail @Title 获取商品详情 sku最大20
|
||||
func (s *sku) GetDetail(ctx context.Context, jdSkuIds []uint64) (reply []sku2.Detail, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "GetDetail", jdSkuIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// GetPriceList @Title 获取商品价格列表 最大100
|
||||
func (s *sku) GetPriceList(ctx context.Context, jdSkuIds []uint64) (reply []sku2.PriceItem, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "GetPriceList", jdSkuIds, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,195 @@
|
||||
package supplier
|
||||
|
||||
import (
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"git.oa00.com/supply-chain/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type afs struct {
|
||||
}
|
||||
|
||||
type ArgsAfsLists struct {
|
||||
Search AfsSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type AfsSearch struct {
|
||||
Status uint
|
||||
AfsSn string
|
||||
OrderSubSn string
|
||||
CreatedStartDate string
|
||||
CreatedEndDate string
|
||||
}
|
||||
|
||||
type ReplyAfsLists struct {
|
||||
Lists []AfsItem
|
||||
Total int64
|
||||
}
|
||||
|
||||
type AfsItem struct {
|
||||
Id uint `json:"id"`
|
||||
AfsSn string `json:"afsSn"`
|
||||
OrderSubSn string `json:"orderSubSn"`
|
||||
SkuName string `json:"skuName"`
|
||||
Quantity uint `json:"quantity"`
|
||||
Status uint `json:"status"`
|
||||
Result string `json:"result"`
|
||||
OrderFee decimal.Decimal `json:"orderFee"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
ReturnAddress []ReturnAddressItem `json:"returnAddress"`
|
||||
}
|
||||
|
||||
// Lists @Title 售后列表
|
||||
func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists, err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Lists", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyAfsDetail struct {
|
||||
Id uint `json:"id"`
|
||||
AfsSn string `json:"afsSn"`
|
||||
Status uint `json:"status"`
|
||||
ApproveNotes string `json:"approveNotes"`
|
||||
Result string `json:"result"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
SkuName string `json:"skuName"`
|
||||
ImgUrl string `json:"imgUrl"`
|
||||
SkuId uint `json:"skuId"`
|
||||
Price decimal.Decimal `json:"price"`
|
||||
Quantity uint `json:"quantity"`
|
||||
HopeTypeName string `json:"hopeTypeName"`
|
||||
TypeReasonName string `json:"typeReasonName"`
|
||||
Imgs []string `json:"imgs"`
|
||||
LogisticsCompany string `json:"logisticsCompany"`
|
||||
WaybillCode string `json:"waybillCode"`
|
||||
SendAt int64 `json:"sendAt"`
|
||||
NewOrderSn string `json:"newOrderSn"`
|
||||
RefundFee decimal.Decimal `json:"refundFee"`
|
||||
PackageSend uint `json:"packageSend"`
|
||||
AfsPackageSend AfsPackageSend `json:"afsPackageSend"`
|
||||
ReturnAddress []ReturnAddressItem `json:"returnAddress"`
|
||||
}
|
||||
|
||||
type AfsPackageSend struct {
|
||||
Name string `json:"name"`
|
||||
Mobile string `json:"mobile"`
|
||||
LogisticsCompany string `json:"logisticsCompany"`
|
||||
WaybillCode string `json:"waybillCode"`
|
||||
SendGoodsDate int64 `json:"sendGoodsDate"`
|
||||
}
|
||||
|
||||
// Detail @Title 售后详情
|
||||
func (a *afs) Detail(ctx context.Context, afsSn uint64) (reply ReplyAfsDetail, err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Detail", afsSn, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsReject struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// Reject @Title 审核驳回
|
||||
func (a *afs) Reject(ctx context.Context, args ArgsAfsReject) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Reject", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsDeliver struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
ReturnAddressId uint `json:"returnAddressId"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// Deliver @Title 待客户发货
|
||||
func (a *afs) Deliver(ctx context.Context, args ArgsAfsDeliver) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Deliver", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsRefund struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// Refund @Title 退款
|
||||
func (a *afs) Refund(ctx context.Context, args ArgsAfsRefund) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Refund", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsCompensate struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
RefundFee decimal.Decimal `json:"refundFee"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// Compensate @Title 订单赔偿
|
||||
func (a *afs) Compensate(ctx context.Context, args ArgsAfsCompensate) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Compensate", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsCompensateSku struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// CompensateSku @Title 直赔商品
|
||||
func (a *afs) CompensateSku(ctx context.Context, args ArgsAfsCompensateSku) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "CompensateSku", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsAfsReissue struct {
|
||||
AfsSn string `json:"afsSn"`
|
||||
Notes string `json:"notes"`
|
||||
}
|
||||
|
||||
// Reissue @Title 补发商品
|
||||
func (a *afs) Reissue(ctx context.Context, args ArgsAfsReissue) (err error) {
|
||||
xClient, err := client.GetClient(a)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Reissue", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,200 @@
|
||||
package batch
|
||||
|
||||
import (
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"git.oa00.com/supply-chain/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type Goods struct {
|
||||
goods
|
||||
}
|
||||
|
||||
type goods struct {
|
||||
}
|
||||
|
||||
type GoodsSearch struct {
|
||||
Name string // 商品名称
|
||||
CategoryIds []uint // 类目id
|
||||
BrandName string // 品牌名
|
||||
UpcCode string // 商品条码
|
||||
Handle uint // 处理状态 1=待处理 2=入库 3=废弃
|
||||
SkuId uint // 供应商skuId
|
||||
MinSupplyPrice decimal.Decimal // 最小采购价
|
||||
MaxSupplyPrice decimal.Decimal // 最大采购价
|
||||
}
|
||||
type ArgsGoodsList struct {
|
||||
Search GoodsSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type GoodsItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Img string `json:"img"`
|
||||
GoodsNum string `json:"goodsNum"`
|
||||
CategoryId uint `json:"categoryId"`
|
||||
BrandId uint `json:"brandId"`
|
||||
BrandName string `json:"brandName"`
|
||||
SkuItems []GoodsItemLists `json:"skuItems"`
|
||||
UpcCodes []string `json:"upcCodes"`
|
||||
StockCount uint `json:"stockCount"`
|
||||
GuidePrices []decimal.Decimal `json:"guidePrices"`
|
||||
SupplyPrices []decimal.Decimal `json:"supplyPrices"`
|
||||
Status uint `json:"status"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
type GoodsItemLists struct {
|
||||
Id uint `json:"id"`
|
||||
Specifications []SkuSpecificationItem `json:"specifications"`
|
||||
Stock uint `json:"stock"`
|
||||
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
||||
GoodsId uint `json:"goodsId"`
|
||||
Img string `json:"img"`
|
||||
UpcCode string `json:"upcCode"`
|
||||
}
|
||||
|
||||
type GoodsSpecificationItem struct {
|
||||
Name string `json:"name"`
|
||||
Values []string `json:"values"`
|
||||
}
|
||||
|
||||
type SkuSpecificationItem struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type ReplyGoodsLists struct {
|
||||
List []GoodsItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
// Lists @Title 获取商品列表
|
||||
func (g *goods) Lists(ctx context.Context, args ArgsGoodsList) (reply ReplyGoodsLists, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Lists", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsGoodsInfo struct {
|
||||
SkuId uint
|
||||
}
|
||||
|
||||
type ReplyGoodsInfo struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
SupplierId uint `json:"supplierId"`
|
||||
SupplierName string `json:"supplierName"`
|
||||
CategoryId uint `json:"categoryId"`
|
||||
BrandId uint `json:"brandId"`
|
||||
Imgs []string `json:"imgs"`
|
||||
Content string `json:"content"`
|
||||
Attributes []GoodsAttributeItem `json:"attributes"`
|
||||
Skus []SkuItem `json:"skus"`
|
||||
Status uint `json:"status"`
|
||||
}
|
||||
|
||||
type GoodsAttributeItem struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
GroupName string `json:"groupName"`
|
||||
}
|
||||
|
||||
type SkuSpecItem struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type SkuItem struct {
|
||||
SkuId uint `json:"skuId"`
|
||||
Color string `json:"color"`
|
||||
Size string `json:"size"`
|
||||
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
||||
MarketPrice decimal.Decimal `json:"marketPrice"`
|
||||
UpcCode string `json:"upcCode"`
|
||||
UnitId uint `json:"uintId"`
|
||||
TaxCategoryId uint `json:"taxCategoryId"`
|
||||
TaxName string `json:"taxName"`
|
||||
TaxCode string `json:"taxCode"`
|
||||
Unit string `json:"uint"`
|
||||
Tax decimal.Decimal `json:"tax"`
|
||||
Img string `json:"img"`
|
||||
}
|
||||
|
||||
// Info @Title 商品详情
|
||||
func (g *goods) Info(ctx context.Context, goodsId uint) (reply ReplyGoodsInfo, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", goodsId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// GetImgs @Title 获取商品主图
|
||||
func (g *goods) GetImgs(ctx context.Context, goodsId uint) (reply []string, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "GetImgs", goodsId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type AdoptItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
// Adopt @Title 批量入库
|
||||
func (g *goods) Adopt(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Adopt", goodsIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// Discard @Title 批量废弃
|
||||
func (g *goods) Discard(ctx context.Context, goodsIds []uint) (err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
err = xClient.Call(ctx, "Discard", goodsIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// ReHandle @Title 重新处理商品
|
||||
func (g *goods) ReHandle(ctx context.Context, goodsIds []uint) (reply []AdoptItem, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = xClient.Call(ctx, "ReHandle", goodsIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyByIdItem struct {
|
||||
SkuId uint `json:"skuId"`
|
||||
SupplierId uint `json:"supplierIds"`
|
||||
SupplierName string `json:"supplierName"`
|
||||
}
|
||||
|
||||
// FindBySkuIds @Title 根据商品Ids获取商品信息
|
||||
func (g *goods) FindBySkuIds(ctx context.Context, skuIds []uint) (reply []ReplyByIdItem, err error) {
|
||||
xClient, err := client.GetClient(g)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = xClient.Call(ctx, "FindBySkuIds", skuIds, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package supplier
|
||||
|
||||
import (
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type logisticsCompany struct {
|
||||
}
|
||||
|
||||
type CompanyItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Select @Title 物流公司筛选
|
||||
func (l *logisticsCompany) Select(ctx context.Context) (reply []CompanyItem, err error) {
|
||||
xClient, err := client.GetClient(l)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args := 0
|
||||
err = xClient.Call(ctx, "Select", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package supplier
|
||||
|
||||
import (
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
type returnAddress struct {
|
||||
}
|
||||
|
||||
type ReplyReturnAddressAll struct {
|
||||
SupplierId uint `json:"supplierId"`
|
||||
Item []ReturnAddressItem `json:"item"`
|
||||
}
|
||||
|
||||
type ReturnAddressItem struct {
|
||||
Id uint `json:"id"`
|
||||
Address string `json:"name"`
|
||||
}
|
||||
|
||||
// All @Title 全部退货地址
|
||||
func (r *returnAddress) All(ctx context.Context) (reply []ReplyReturnAddressAll, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
args := 0
|
||||
err = xClient.Call(ctx, "All", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package wholesale
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"git.oa00.com/supply-chain/service/lib/bean"
|
||||
)
|
||||
|
||||
type brand struct {
|
||||
}
|
||||
|
||||
type ArgsBrandList struct {
|
||||
Search BrandSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type BrandItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
type ReplyBrandList struct {
|
||||
Lists []BrandItem `json:"lists"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
type BrandSearch struct {
|
||||
Name string // 品牌名称
|
||||
}
|
||||
|
||||
// Lists @Title 品牌列表
|
||||
func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBrandList, err error) {
|
||||
xClient, err := client.GetClient(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Lists", args, &result)
|
||||
return
|
||||
}
|
||||
|
||||
// All @Title 全部品牌
|
||||
func (b *brand) All(ctx context.Context) (result []BrandItem, err error) {
|
||||
xClient, err := client.GetClient(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", 0, &result)
|
||||
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 // 品牌名称
|
||||
}
|
||||
|
||||
// Add @Title 添加品牌
|
||||
func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(b)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsBrandEdit struct {
|
||||
BrandId uint // 品牌id
|
||||
Name string // 品牌名称
|
||||
}
|
||||
|
||||
// Edit @Title 编辑品牌
|
||||
func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(b)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsBrandFindByIds struct {
|
||||
BrandIds []uint // 品牌id数组
|
||||
}
|
||||
|
||||
// FindByIds @Title 品牌获取
|
||||
func (b *brand) FindByIds(ctx context.Context, args ArgsBrandFindByIds) (result []BrandItem, err error) {
|
||||
xClient, err := client.GetClient(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "FindByIds", args, &result)
|
||||
return
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package wholesale
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type category struct {
|
||||
}
|
||||
|
||||
type CategoryItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentId uint `json:"parentId"`
|
||||
Children []CategoryItem `json:"children"`
|
||||
}
|
||||
|
||||
// All @Title 获取分类
|
||||
func (c *category) All(ctx context.Context) (result []CategoryItem, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", 0, &result)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsCategoryAdd struct {
|
||||
Name string // 分类名称
|
||||
ParentId uint // 上级id
|
||||
}
|
||||
|
||||
// Add @Title 添加分类
|
||||
func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCategoryEdit struct {
|
||||
CategoryId uint // 分类id
|
||||
Name string // 分类名称
|
||||
ParentId uint // 上级id
|
||||
}
|
||||
|
||||
// Edit @Title 编辑分类
|
||||
func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCategoryFindByIds struct {
|
||||
ThirdCategoryIds []uint // 三级分类id数组
|
||||
}
|
||||
type ThirdCategoryItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentId uint `json:"parentId"`
|
||||
Parent *ThirdCategoryItem `json:"parent"`
|
||||
}
|
||||
|
||||
// FindByIds @Title 三级分类获取
|
||||
func (c *category) FindByIds(ctx context.Context, args ArgsCategoryFindByIds) (result []ThirdCategoryItem, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "FindByIds", args, &result)
|
||||
return
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package channel
|
||||
|
||||
type Channel struct {
|
||||
Sku sku
|
||||
Mq mq
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package channel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"github.com/smallnest/rpcx/share"
|
||||
)
|
||||
|
||||
const (
|
||||
MqSubscribeNameSkuPriceChange = "sku_price_change" // sku价格变动
|
||||
MqSubscribeNameSkuChange = "sku_change" // sku信息变动
|
||||
)
|
||||
|
||||
type mq struct {
|
||||
}
|
||||
type ArgsMqSubscribe struct {
|
||||
Name string // 队列名称
|
||||
AppKey string // 队列名称
|
||||
}
|
||||
|
||||
// Subscribe @Title 订阅mq
|
||||
func (m *mq) Subscribe(ctx context.Context, channelId string, args ArgsMqSubscribe) (key string, err error) {
|
||||
xClient, err := client.GetClient(m)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Subscribe", args, &key)
|
||||
return
|
||||
}
|
||||
|
||||
// SubscribeCancel @Title 订阅取消
|
||||
func (m *mq) SubscribeCancel(ctx context.Context, channelId string, args ArgsMqSubscribe) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(m)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "SubscribeCancel", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsMqUser struct {
|
||||
AppKey string
|
||||
AppSecret string
|
||||
}
|
||||
|
||||
// User @Title Mq用户
|
||||
func (m *mq) User(ctx context.Context, channelId string, args ArgsMqUser) (err error) {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(m)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "User", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package _interface
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type skuState uint
|
||||
|
||||
const (
|
||||
SkuStateIn = 1 // 有货
|
||||
SkuStateOut = 2 // 无货
|
||||
SkuStateDone = 3 // 下架商品
|
||||
)
|
||||
|
||||
type Sku interface {
|
||||
// Stock 库存查询
|
||||
Stock(ctx context.Context, args ArgsSkuStock, reply *[]ReplySkuStock) error
|
||||
}
|
||||
|
||||
type ArgsSkuStock struct {
|
||||
Address string // 地址
|
||||
Skus []SkuStockItem // sku信息
|
||||
}
|
||||
|
||||
type SkuStockItem struct {
|
||||
SourceSkuId string // 源skuId
|
||||
Quantity uint // 数量
|
||||
}
|
||||
type ReplySkuStock struct {
|
||||
SourceSkuId string `json:"sourceSkuId"` // 源skuId
|
||||
State uint `json:"state"` // 库存状态
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package setting
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type rate struct {
|
||||
}
|
||||
|
||||
type RateItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Rate decimal.Decimal `json:"rate"`
|
||||
}
|
||||
|
||||
// All @Title 全部利率
|
||||
func (r *rate) All(ctx context.Context) (result []RateItem, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", 0, &result)
|
||||
return
|
||||
}
|
||||
|
||||
// Get @Title 获取利率信息
|
||||
func (r *rate) Get(ctx context.Context, rateId uint) (result RateItem, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Get", rateId, &result)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsRateChannel struct {
|
||||
ChannelId uint // 渠道id
|
||||
RateId uint // 费率id
|
||||
}
|
||||
|
||||
// Channel @Title 设置渠道利率
|
||||
func (r *rate) Channel(ctx context.Context, args ArgsRateChannel) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Channel", args, &reply)
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package setting
|
||||
|
||||
type Setting struct {
|
||||
Rate rate
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
package wholesale
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"git.oa00.com/supply-chain/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type skuAudit struct {
|
||||
}
|
||||
|
||||
type ArgsSkuAuditLists struct {
|
||||
Search SkuAuditSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type SkuAuditSearch struct {
|
||||
SourceId uint // 供应商id
|
||||
AdjustType uint // 加价类型
|
||||
Status uint // 状态 1=未审核 2=通过 3=驳回
|
||||
}
|
||||
|
||||
type ArgsSkuAuditEsLists struct {
|
||||
Search SkuAuditEsSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type SkuAuditEsSearch struct {
|
||||
SourceId uint // 供应商id
|
||||
SourceSonId uint // 沙马供应商的供应商
|
||||
AdjustType uint // 加价类型
|
||||
Status uint // 状态 1=未审核 2=通过 3=驳回
|
||||
AfterMinDiscount decimal.Decimal // 加价后最低折扣
|
||||
AfterMaxDiscount decimal.Decimal // 加价后最高折扣
|
||||
}
|
||||
|
||||
type SkuAndAuditItem struct {
|
||||
Id uint `json:"id"`
|
||||
SkuId uint `json:"skuId"`
|
||||
Name string `json:"name"`
|
||||
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
||||
GuidePrice decimal.Decimal `json:"guidePrice"`
|
||||
AdjustType uint `json:"adjustType"`
|
||||
AdjustPrice decimal.Decimal `json:"adjustPrice"`
|
||||
AfterPrice decimal.Decimal `json:"afterPrice"`
|
||||
AfterDiscount decimal.Decimal `json:"afterDiscount"`
|
||||
BrandName string `json:"brandName"`
|
||||
SourceName string `json:"sourceName"`
|
||||
AuditUserId uint `json:"auditUserId"`
|
||||
AuditAt int64 `json:"auditAt"`
|
||||
ImgUrl string `json:"imgUrl"`
|
||||
Reason string `json:"reason"`
|
||||
FirstCategoryName string `json:"firstCategoryName"`
|
||||
SecondCategoryName string `json:"secondCategoryName"`
|
||||
ThirdCategoryName string `json:"thirdCategoryName"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
Length decimal.Decimal `json:"length"` // 长
|
||||
Width decimal.Decimal `json:"width"` // 宽
|
||||
Height decimal.Decimal `json:"height"` // 高
|
||||
Weight decimal.Decimal `json:"weight"` // 重
|
||||
PackingRate uint `json:"packingRate"` // 装箱率
|
||||
StartingBatch uint `json:"startingBatch"` // 起批量
|
||||
InitialFreight decimal.Decimal `json:"initialFreight"` // 起批运费
|
||||
}
|
||||
|
||||
type ReplySkuAuditLists struct {
|
||||
Lists []SkuAndAuditItem `json:"lists"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
// Lists @Title 审核列表
|
||||
func (s *skuAudit) Lists(ctx context.Context, args ArgsSkuAuditLists) (reply ReplySkuAuditLists, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Lists", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// ListsEs @Title 审核列表
|
||||
func (s *skuAudit) ListsEs(ctx context.Context, args ArgsSkuAuditEsLists) (reply ReplySkuAuditLists, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "ListsEs", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsSkuAuditAdopt struct {
|
||||
AuditUserId uint // 审核人
|
||||
AuditIds []uint // 审核单id
|
||||
}
|
||||
|
||||
// Adopt @Title 通过
|
||||
func (s *skuAudit) Adopt(ctx context.Context, args ArgsSkuAuditAdopt) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Adopt", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsSkuAuditReject struct {
|
||||
AuditUserId uint // 审核人
|
||||
AuditIds []uint // 审核单id
|
||||
Reason string // 驳回原因
|
||||
}
|
||||
|
||||
// Reject @Title 驳回
|
||||
func (s *skuAudit) Reject(ctx context.Context, args ArgsSkuAuditReject) error {
|
||||
reply := 0
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return xClient.Call(ctx, "Reject", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsApplyHistory struct {
|
||||
Search ApplyHistorySearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type ApplyHistorySearch struct {
|
||||
Id uint // 瑞库客id
|
||||
Name string // 商品名称
|
||||
SourceId uint // 所属供应商 1=京东
|
||||
SourceSonId uint // 沙马供应商的供应商
|
||||
SourceSkuId uint // 供应商skuId
|
||||
BrandId uint // 品牌Id
|
||||
ThirdCategoryId uint // 三级分类Id
|
||||
AdjustType uint // 加价规则
|
||||
MaxSupplyPrice decimal.Decimal // 最大采购价格
|
||||
MinSupplyPrice decimal.Decimal // 最小采购价格
|
||||
CustomerProfitRate uint // 折扣 0=全部 1=5折以下 2=6 3=7 4=8 5=9折以下
|
||||
Handle uint // 处理状态
|
||||
AuditStatus uint // 审核状态
|
||||
SourceStatus uint // 供应商下架状态
|
||||
PlatformStatus uint // 平台下架状态
|
||||
}
|
||||
|
||||
type ApplyHistoryItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"` // 名称
|
||||
BrandName string `json:"brandName"` // 品牌名称
|
||||
FirstCategoryId uint `json:"firstCategoryId"` // 一级分类id
|
||||
SecondCategoryId uint `json:"secondCategoryId"` // 二级分类id
|
||||
ThirdCategoryId uint `json:"thirdCategoryId"` // 三级分类id
|
||||
SupplyPrice decimal.Decimal `json:"supplyPrice"` // 采购价
|
||||
GuidePrice decimal.Decimal `json:"guidePrice"` // 指导价
|
||||
ImgUrl string `json:"imgUrl"` // 商品主图
|
||||
PlatformStatus uint `json:"platformStatus"` // 平台状态 1=上架 2=下架
|
||||
SourceName string `json:"sourceName"` // 供应商名称
|
||||
SourceSkuId string `json:"sourceSkuId"` // 源skuId
|
||||
SourceStatus uint `json:"sourceStatus"` // 供应商状态 1=上架 2=下架
|
||||
CustomerPrice decimal.Decimal `json:"customerPrice"` // 供货最高价
|
||||
CustomerProfitRate decimal.Decimal `json:"customerProfitRate"` // 供货利润率 供货利润/供货最高价%
|
||||
CustomerDiscount decimal.Decimal `json:"customerDiscount"` // 折扣
|
||||
AdjustType uint `json:"adjustType"` // 加价类型
|
||||
AdjustPrice decimal.Decimal `json:"adjustPrice"` // 加价金额
|
||||
AfterAdjustType uint `json:"afterAdjustType"` // 改价后加价类型
|
||||
AfterAdjustPrice decimal.Decimal `json:"afterAdjustPrice"` // 改价后加价金额
|
||||
AfterPrice decimal.Decimal `json:"afterPrice"` // 改价记录
|
||||
Length decimal.Decimal `json:"length"` // 长
|
||||
Width decimal.Decimal `json:"width"` // 宽
|
||||
Height decimal.Decimal `json:"height"` // 高
|
||||
Weight decimal.Decimal `json:"weight"` // 重
|
||||
PackingRate uint `json:"packingRate"` // 装箱率
|
||||
StartingBatch uint `json:"startingBatch"` // 起批量
|
||||
InitialFreight decimal.Decimal `json:"initialFreight"` // 起批运费
|
||||
Reason string // 改价驳回原因
|
||||
}
|
||||
|
||||
type ReplyApplyHistoryLists struct {
|
||||
Lists []ApplyHistoryItem `json:"lists"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
// ApplyHistory @Title 改价申请记录
|
||||
func (s *skuAudit) ApplyHistory(ctx context.Context, args ArgsApplyHistory) (reply []ReplyApplyHistoryLists, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = xClient.Call(ctx, "ApplyHistory", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package wholesale
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
)
|
||||
|
||||
type sourceRpc struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
Name string // 供货商名称
|
||||
Base string // rpc服务基础名称
|
||||
SkuName string // sku名称
|
||||
OrderName string // order名称
|
||||
}
|
||||
|
||||
type SourceItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Select @Title 供应商列表
|
||||
func (s *sourceRpc) Select(ctx context.Context) (reply []SourceItem, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
args := 0
|
||||
err = xClient.Call(ctx, "Select", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package wholesale
|
||||
|
||||
import (
|
||||
"git.oa00.com/supply-chain/service/wholesale/channel"
|
||||
"git.oa00.com/supply-chain/service/wholesale/setting"
|
||||
)
|
||||
|
||||
type Wholesale struct {
|
||||
Brand brand
|
||||
Category category
|
||||
Source sourceRpc
|
||||
Sku sku
|
||||
SkuAudit skuAudit
|
||||
Setting setting.Setting
|
||||
Channel channel.Channel
|
||||
}
|
Loading…
Reference in new issue