diff --git a/customer/service/audit.go b/customer/service/audit.go index 4254ce1..db1bbdb 100644 --- a/customer/service/audit.go +++ b/customer/service/audit.go @@ -30,9 +30,11 @@ type ArgsAuditLists struct { type AuditItem struct { Id uint `json:"id"` ServiceId uint `json:"serviceId"` + UserId uint `json:"userId"` UserName string `json:"userName"` ServiceName string `json:"serviceName"` ApplyUserId uint `json:"applyUserId"` + ApplyType uint `json:"ApplyType"` ApplyAt int64 `json:"applyAt"` AuditStatus uint `json:"auditStatus"` AuditUserId uint `json:"auditUserId"` @@ -89,6 +91,7 @@ type ArgsAuditApply struct { ApplyUserId uint `json:"applyUserId"` // 申请人id CustomerId uint `json:"customerId"` // 客户id ExpirationAt time.Time `json:"expirationAt"` // 到期时间 + Enclosure string `json:"enclosure"` // 附件 Expand any `json:"expand"` // 拓展参数 } @@ -147,6 +150,8 @@ type ReplyAuditInfo struct { Reason string `json:"reason"` AuditUserId uint `json:"auditUserId"` Expand any `json:"expand"` + Enclosure string `json:"enclosure"` + ApplyType uint `json:"applyType"` } // Info @Title 详情 diff --git a/customer/user/deposit.go b/customer/user/deposit.go index 6f6419f..0817029 100644 --- a/customer/user/deposit.go +++ b/customer/user/deposit.go @@ -10,8 +10,8 @@ type deposit struct { } type applyType uint // 申请人类型 const ( - ApplyTypeCustomer = 1 // 客户 - ApplyTypePlatform = 2 // 平台 + ApplyTypePlatform = 1 // 平台 + ApplyTypeCustomer = 2 // 客户 DepositAuditStatusWait = 1 // 待审核 DepositAuditStatusAdopt = 2 // 审核通过 diff --git a/jd/category.go b/jd/category.go index 7ad32bb..414d287 100644 --- a/jd/category.go +++ b/jd/category.go @@ -10,6 +10,7 @@ type category struct { } type ArgsCategoryList struct { ThirdCategoryId uint + IsMatch uint // 是否匹配 0=全部 1=匹配 2=没匹配 Page bean.Page } diff --git a/jd/task.go b/jd/task.go index 9017f45..5175506 100644 --- a/jd/task.go +++ b/jd/task.go @@ -37,3 +37,19 @@ func (t *task) RefreshToken(ctx context.Context) error { } return xClient.Call(ctx, "RefreshToken", 0, &a) } + +type ReplySkuAddStatus struct { + Total uint + Count uint + StartTime int64 +} + +// GetSkuAddStatus @Title 获取同步状态 +func (t *task) GetSkuAddStatus(ctx context.Context) (reply ReplySkuAddStatus, err error) { + xClient, err := client.GetClient(t) + if err != nil { + return + } + err = xClient.Call(ctx, "GetSkuAddStatus", 0, &reply) + return +} diff --git a/supplier/afs.go b/supplier/afs.go index 24df47e..ec1b7b1 100644 --- a/supplier/afs.go +++ b/supplier/afs.go @@ -35,6 +35,7 @@ type AfsItem struct { SkuName string `json:"skuName"` Quantity uint `json:"quantity"` Status uint `json:"status"` + AuditStatus uint `json:"manageStatus"` Result string `json:"result"` OrderFee decimal.Decimal `json:"orderFee"` CreatedAt int64 `json:"createdAt"` @@ -54,8 +55,10 @@ func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists type ReplyAfsDetail struct { Id uint `json:"id"` + AuditId uint `json:"auditId"` AfsSn string `json:"afsSn"` Status uint `json:"status"` + AuditStatus uint `json:"auditStatus"` ApproveNotes string `json:"approveNotes"` Result string `json:"result"` CreatedAt int64 `json:"createdAt"` @@ -96,6 +99,33 @@ func (a *afs) Detail(ctx context.Context, afsSn uint64) (reply ReplyAfsDetail, e return } +type ReplyFindByAfsOrderInfo struct { + Id uint `json:"id"` + CreatedAt int64 `json:"createdAt"` // 申请时间 + UpdatedAt int64 `json:"updatedAt"` // 更新时间 + AfsSn string `json:"afsSn"` // 售后单号 + OrderSubSn string `json:"orderSubSn"` // 订单号 + HandleStatus uint `json:"handleStatus"` // 处理结果 + Status uint `json:"status"` // 售后状态 + ApproveNotes string `json:"approveNotes"` // 处理描述 + Result string `json:"result"` // 处理结果 + SkuName string `json:"skuName"` // 商品名称 + SkuId uint `json:"skuId"` // 供应商编码 + SupplyPrice decimal.Decimal `json:"price"` // 商品单价 + Quantity uint `json:"quantity"` // 售后数量 + UpcCode string `json:"upcCode"` // 商品条码 +} + +// FindByAfsOrderInfos @Title 根据售后单号批量查询信息 +func (a *afs) FindByAfsOrderInfos(ctx context.Context, afsSns []uint64) (reply []ReplyFindByAfsOrderInfo, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "FindByAfsOrderInfos", afsSns, &reply) + return +} + type ArgsAfsReject struct { AfsSn string `json:"afsSn"` Notes string `json:"notes"` @@ -146,9 +176,11 @@ func (a *afs) Refund(ctx context.Context, args ArgsAfsRefund) (err error) { } type ArgsAfsCompensate struct { - AfsSn string `json:"afsSn"` - RefundFee decimal.Decimal `json:"refundFee"` - Notes string `json:"notes"` + ApplyUserId uint `json:"applyUserId"` + AfsSn string `json:"afsSn"` + RefundFee decimal.Decimal `json:"refundFee"` + Notes string `json:"notes"` + RefundId uint `json:"refundId"` } // Compensate @Title 订单赔偿 diff --git a/supplier/afsAudit.go b/supplier/afsAudit.go new file mode 100644 index 0000000..c5af126 --- /dev/null +++ b/supplier/afsAudit.go @@ -0,0 +1,119 @@ +package supplier + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +const ( + AfsAuditSwitchOn = 1 // 开 + AfsAuditSwitchOff = 2 // 关 +) + +type afsAudit struct { +} +type ArgsAfsAuditLists struct { + Search AfsAuditSearch + Page bean.Page +} +type AfsAuditSearch struct { + Status uint // 0=全部 1=待审核 2=审核通过 3=审核驳回 + AfsSn string + OrderSubSn string + CreatedStartDate string + CreatedEndDate string +} + +type ReplyAfsAuditLists struct { + Lists []AfsAuditItem + Total int64 +} +type AfsAuditItem struct { + Id uint `json:"id"` + AfsSn uint64 `json:"afsSn"` + OrderSubSn uint64 `json:"orderSubSn"` + SkuName string `json:"skuName"` + Status uint `json:"status"` + Quantity uint `json:"quantity"` + OrderSubAfsId uint `json:"orderSubAfsId"` + RefundFee decimal.Decimal `json:"refundFee"` + Remark string `json:"remark"` + Result string `json:"result"` + Notes string `json:"notes"` + AuditAt int64 `json:"auditAt"` + CreatedAt int64 `json:"createdAt"` +} + +// Lists @Title 售后审核列表 +func (a *afsAudit) Lists(ctx context.Context, args ArgsAfsAuditLists) (reply ReplyAfsAuditLists, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +type ArgsAfsAuditAdopt struct { + AuditUserId uint + AfsAuditId uint +} + +// Adopt @Title 审核通过 +func (a *afsAudit) Adopt(ctx context.Context, args ArgsAfsAuditAdopt) error { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsAfsAuditReject struct { + AuditUserId uint + Remark string + AfsAuditId uint +} + +// Reject @Title 审核驳回 +func (a *afsAudit) Reject(ctx context.Context, args ArgsAfsAuditReject) error { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Reject", args, &reply) +} + +type ArgsSetAfsAuditPrice struct { + Price decimal.Decimal + Switch uint +} + +// SetAfsAuditConfig @Title 设置售后审核配置 +func (a *afsAudit) SetAfsAuditConfig(ctx context.Context, args ArgsSetAfsAuditPrice) error { + xClient, err := client.GetClient(a) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "SetAfsAuditConfig", args, &reply) +} + +type ReplyAfsAuditConfig struct { + Price decimal.Decimal + Switch uint +} + +// GetAfsAuditConfig @Title 获取售后审核配置 +func (a *afsAudit) GetAfsAuditConfig(ctx context.Context) (reply ReplyAfsAuditConfig, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + args := 0 + err = xClient.Call(ctx, "GetAfsAuditConfig", args, &reply) + return +} diff --git a/supplier/goods.go b/supplier/goods.go index 400d922..41a7929 100644 --- a/supplier/goods.go +++ b/supplier/goods.go @@ -180,7 +180,7 @@ func (g *goods) ReHandle(ctx context.Context, goodsIds []uint) (reply []AdoptIte type ReplyByIdItem struct { SkuId uint `json:"skuId"` - SupplierId uint `json:"supplierIds"` + SupplierId uint `json:"supplierId"` SupplierName string `json:"supplierName"` } diff --git a/supplier/supplier.go b/supplier/supplier.go index 746c54d..306f22f 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -17,6 +17,7 @@ type Supplier struct { LogisticsCompany logisticsCompany ReturnAddress returnAddress Afs afs + AfsAudit afsAudit BatchGoods batch.Goods } diff --git a/supply/afterService.go b/supply/afterService.go index fd07646..74cc598 100644 --- a/supply/afterService.go +++ b/supply/afterService.go @@ -291,3 +291,24 @@ func (a *afterService) FindByAfsId(ctx context.Context, afsId uint) (reply Reply err = xClient.Call(ctx, "FindByAfsId", afsId, &reply) return } + +type ReplySourceSkuIdsAfsInfos struct { + SourceId uint // 供应商Id + SourceName string // 供应商名称 + ChannelId uint // 客户Id + SkuId uint // 沙马skuId + SourceSkuId string // 供应商skuId + HopeTypeName string // 期望售后类型 + TypeReasonName string // 售后原因 + CustomerPrice decimal.Decimal // 销售价格 +} + +// FindBySourceSkuIdsAfsInfos @Title 根据sourceSkuId查询售后信息 +func (a *afterService) FindBySourceSkuIdsAfsInfos(ctx context.Context, sourceSkuIds []uint) (reply []ReplySourceSkuIdsAfsInfos, err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + err = xClient.Call(ctx, "FindBySourceSkuIdsAfsInfos", sourceSkuIds, &reply) + return +} diff --git a/supply/brand.go b/supply/brand.go index 8ac4215..975915a 100644 --- a/supply/brand.go +++ b/supply/brand.go @@ -73,6 +73,16 @@ func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) { return xClient.Call(ctx, "Add", args, &reply) } +// Adds @Title 添加品牌 +func (b *brand) Adds(ctx context.Context, brandNames []string) (err error) { + reply := 0 + xClient, err := client.GetClient(b) + if err != nil { + return err + } + return xClient.Call(ctx, "Adds", brandNames, &reply) +} + type ArgsBrandEdit struct { BrandId uint // 品牌id Name string // 品牌名称 diff --git a/supply/category.go b/supply/category.go index 0795cfc..7558947 100644 --- a/supply/category.go +++ b/supply/category.go @@ -40,6 +40,21 @@ func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) { return xClient.Call(ctx, "Add", args, &reply) } +type ReplyCategoryAddError struct { + CategoryName string `json:"categoryName"` + ErrMsg string `json:"errMsg"` +} + +// Adds @Title 添加分类 +func (c *category) Adds(ctx context.Context, args []ArgsCategoryAdd) (reply []ReplyCategoryAddError, err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + err = xClient.Call(ctx, "Adds", args, &reply) + return +} + type ArgsCategoryEdit struct { CategoryId uint // 分类id Name string // 分类名称 diff --git a/supply/channel/afterService.go b/supply/channel/afterService.go index befce94..010e569 100644 --- a/supply/channel/afterService.go +++ b/supply/channel/afterService.go @@ -202,6 +202,7 @@ type ReplyAfterServiceDetail struct { LogisticsCompany string `json:"logisticsCompany"` WaybillCode string `json:"waybillCode"` SendAt int64 `json:"sendAt"` + ReturnAddress string `json:"returnAddress"` PackageSend uint `json:"packageSend"` AfsPackageSend AfsPackageSend `json:"afsPackageSend"` } diff --git a/supply/channel/sku.go b/supply/channel/sku.go index deb1780..551335f 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -80,19 +80,17 @@ type SkuEsSearch struct { MinDiscount decimal.Decimal // 最低折扣 MaxDiscount decimal.Decimal // 最高折扣 Expand []map[string]interface{} // 拓展查询 - CustomerSearch CustomerSearch // 客户系统的搜索条件 + CustomerSearch string // 客户系统搜索参数 + MinGuidePrice decimal.Decimal // 市场参考价 + MaxGuidePrice decimal.Decimal // 市场参考价 + Source uint // 所属供应商 + ThirdCategoryIds []uint // 三级分类Ids } type ArgsSkuListsEs struct { Search SkuEsSearch Page bean.Page } -type CustomerSearch struct { - SkuName string - SkuId uint - BrandName string -} - // ListsEs @Title es商品列表 目前最大10000条数据,超出不显示 func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) { xClient, err := client.GetClient(s) diff --git a/wholesale/brand.go b/wholesale/brand.go index 231096b..dc75db1 100644 --- a/wholesale/brand.go +++ b/wholesale/brand.go @@ -3,34 +3,14 @@ package wholesale import ( "context" "git.oa00.com/supply-chain/service/client" - "git.oa00.com/supply-chain/service/lib/bean" + "git.oa00.com/supply-chain/service/supply" ) 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) { +func (b *brand) Lists(ctx context.Context, args supply.ArgsBrandList) (result supply.ReplyBrandList, err error) { xClient, err := client.GetClient(b) if err != nil { return @@ -40,7 +20,7 @@ func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBran } // All @Title 全部品牌 -func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { +func (b *brand) All(ctx context.Context) (result []supply.BrandItem, err error) { xClient, err := client.GetClient(b) if err != nil { return @@ -50,7 +30,7 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { } // FindByNameAll @Title 品牌名称筛选品牌 -func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandItem, err error) { +func (b *brand) FindByNameAll(ctx context.Context, name string) (result []supply.BrandItem, err error) { xClient, err := client.GetClient(b) if err != nil { return @@ -59,12 +39,8 @@ func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandI return } -type ArgsBrandAdd struct { - Name string // 品牌名称 -} - // Add @Title 添加品牌 -func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) { +func (b *brand) Add(ctx context.Context, args supply.ArgsBrandAdd) (err error) { reply := 0 xClient, err := client.GetClient(b) if err != nil { @@ -73,13 +49,8 @@ func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) { 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) { +func (b *brand) Edit(ctx context.Context, args supply.ArgsBrandEdit) (err error) { reply := 0 xClient, err := client.GetClient(b) if err != nil { @@ -88,12 +59,8 @@ func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) (err error) { 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) { +func (b *brand) FindByIds(ctx context.Context, args supply.ArgsBrandFindByIds) (result []supply.BrandItem, err error) { xClient, err := client.GetClient(b) if err != nil { return diff --git a/wholesale/category.go b/wholesale/category.go index 6d6295d..4e90bb7 100644 --- a/wholesale/category.go +++ b/wholesale/category.go @@ -3,20 +3,14 @@ package wholesale import ( "context" "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/supply" ) 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) { +func (c *category) All(ctx context.Context) (result []supply.CategoryItem, err error) { xClient, err := client.GetClient(c) if err != nil { return @@ -25,13 +19,8 @@ func (c *category) All(ctx context.Context) (result []CategoryItem, err error) { return } -type ArgsCategoryAdd struct { - Name string // 分类名称 - ParentId uint // 上级id -} - // Add @Title 添加分类 -func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) { +func (c *category) Add(ctx context.Context, args supply.ArgsCategoryAdd) (err error) { reply := 0 xClient, err := client.GetClient(c) if err != nil { @@ -40,14 +29,8 @@ func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) { 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) { +func (c *category) Edit(ctx context.Context, args supply.ArgsCategoryEdit) (err error) { reply := 0 xClient, err := client.GetClient(c) if err != nil { @@ -56,18 +39,8 @@ func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error) 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) { +func (c *category) FindByIds(ctx context.Context, args supply.ArgsCategoryFindByIds) (result []supply.ThirdCategoryItem, err error) { xClient, err := client.GetClient(c) if err != nil { return diff --git a/wholesale/channel/order.go b/wholesale/channel/order.go index 242a246..cf60c9f 100644 --- a/wholesale/channel/order.go +++ b/wholesale/channel/order.go @@ -4,6 +4,7 @@ import ( "context" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" + _interface "git.oa00.com/supply-chain/service/wholesale/interface" "github.com/shopspring/decimal" "github.com/smallnest/rpcx/share" ) @@ -202,3 +203,13 @@ func (o *order) Finish(ctx context.Context, channelId, orderSn string) error { err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Finish", orderSn, &reply) return err } + +// Trajectory @Title 获取订单物流信息 +func (o *order) Trajectory(ctx context.Context, channelId string, orderSn string) (reply []_interface.ReplyTrajectory, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Trajectory", orderSn, &reply) + return +}