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

finance
黄伟 2 years ago
commit b1d7396507

@ -30,9 +30,11 @@ type ArgsAuditLists struct {
type AuditItem struct { type AuditItem struct {
Id uint `json:"id"` Id uint `json:"id"`
ServiceId uint `json:"serviceId"` ServiceId uint `json:"serviceId"`
UserId uint `json:"userId"`
UserName string `json:"userName"` UserName string `json:"userName"`
ServiceName string `json:"serviceName"` ServiceName string `json:"serviceName"`
ApplyUserId uint `json:"applyUserId"` ApplyUserId uint `json:"applyUserId"`
ApplyType uint `json:"ApplyType"`
ApplyAt int64 `json:"applyAt"` ApplyAt int64 `json:"applyAt"`
AuditStatus uint `json:"auditStatus"` AuditStatus uint `json:"auditStatus"`
AuditUserId uint `json:"auditUserId"` AuditUserId uint `json:"auditUserId"`
@ -89,6 +91,7 @@ type ArgsAuditApply struct {
ApplyUserId uint `json:"applyUserId"` // 申请人id ApplyUserId uint `json:"applyUserId"` // 申请人id
CustomerId uint `json:"customerId"` // 客户id CustomerId uint `json:"customerId"` // 客户id
ExpirationAt time.Time `json:"expirationAt"` // 到期时间 ExpirationAt time.Time `json:"expirationAt"` // 到期时间
Enclosure string `json:"enclosure"` // 附件
Expand any `json:"expand"` // 拓展参数 Expand any `json:"expand"` // 拓展参数
} }
@ -147,6 +150,8 @@ type ReplyAuditInfo struct {
Reason string `json:"reason"` Reason string `json:"reason"`
AuditUserId uint `json:"auditUserId"` AuditUserId uint `json:"auditUserId"`
Expand any `json:"expand"` Expand any `json:"expand"`
Enclosure string `json:"enclosure"`
ApplyType uint `json:"applyType"`
} }
// Info @Title 详情 // Info @Title 详情

@ -10,8 +10,8 @@ type deposit struct {
} }
type applyType uint // 申请人类型 type applyType uint // 申请人类型
const ( const (
ApplyTypeCustomer = 1 // 客户 ApplyTypePlatform = 1 // 平台
ApplyTypePlatform = 2 // 平台 ApplyTypeCustomer = 2 // 客户
DepositAuditStatusWait = 1 // 待审核 DepositAuditStatusWait = 1 // 待审核
DepositAuditStatusAdopt = 2 // 审核通过 DepositAuditStatusAdopt = 2 // 审核通过

@ -10,6 +10,7 @@ type category struct {
} }
type ArgsCategoryList struct { type ArgsCategoryList struct {
ThirdCategoryId uint ThirdCategoryId uint
IsMatch uint // 是否匹配 0=全部 1=匹配 2=没匹配
Page bean.Page Page bean.Page
} }

@ -37,3 +37,19 @@ func (t *task) RefreshToken(ctx context.Context) error {
} }
return xClient.Call(ctx, "RefreshToken", 0, &a) 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
}

@ -35,6 +35,7 @@ type AfsItem struct {
SkuName string `json:"skuName"` SkuName string `json:"skuName"`
Quantity uint `json:"quantity"` Quantity uint `json:"quantity"`
Status uint `json:"status"` Status uint `json:"status"`
AuditStatus uint `json:"manageStatus"`
Result string `json:"result"` Result string `json:"result"`
OrderFee decimal.Decimal `json:"orderFee"` OrderFee decimal.Decimal `json:"orderFee"`
CreatedAt int64 `json:"createdAt"` CreatedAt int64 `json:"createdAt"`
@ -54,8 +55,10 @@ func (a *afs) Lists(ctx context.Context, args ArgsAfsLists) (reply ReplyAfsLists
type ReplyAfsDetail struct { type ReplyAfsDetail struct {
Id uint `json:"id"` Id uint `json:"id"`
AuditId uint `json:"auditId"`
AfsSn string `json:"afsSn"` AfsSn string `json:"afsSn"`
Status uint `json:"status"` Status uint `json:"status"`
AuditStatus uint `json:"auditStatus"`
ApproveNotes string `json:"approveNotes"` ApproveNotes string `json:"approveNotes"`
Result string `json:"result"` Result string `json:"result"`
CreatedAt int64 `json:"createdAt"` CreatedAt int64 `json:"createdAt"`
@ -96,6 +99,33 @@ func (a *afs) Detail(ctx context.Context, afsSn uint64) (reply ReplyAfsDetail, e
return 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 { type ArgsAfsReject struct {
AfsSn string `json:"afsSn"` AfsSn string `json:"afsSn"`
Notes string `json:"notes"` Notes string `json:"notes"`
@ -146,9 +176,11 @@ func (a *afs) Refund(ctx context.Context, args ArgsAfsRefund) (err error) {
} }
type ArgsAfsCompensate struct { type ArgsAfsCompensate struct {
AfsSn string `json:"afsSn"` ApplyUserId uint `json:"applyUserId"`
RefundFee decimal.Decimal `json:"refundFee"` AfsSn string `json:"afsSn"`
Notes string `json:"notes"` RefundFee decimal.Decimal `json:"refundFee"`
Notes string `json:"notes"`
RefundId uint `json:"refundId"`
} }
// Compensate @Title 订单赔偿 // Compensate @Title 订单赔偿

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

@ -180,7 +180,7 @@ func (g *goods) ReHandle(ctx context.Context, goodsIds []uint) (reply []AdoptIte
type ReplyByIdItem struct { type ReplyByIdItem struct {
SkuId uint `json:"skuId"` SkuId uint `json:"skuId"`
SupplierId uint `json:"supplierIds"` SupplierId uint `json:"supplierId"`
SupplierName string `json:"supplierName"` SupplierName string `json:"supplierName"`
} }

@ -17,6 +17,7 @@ type Supplier struct {
LogisticsCompany logisticsCompany LogisticsCompany logisticsCompany
ReturnAddress returnAddress ReturnAddress returnAddress
Afs afs Afs afs
AfsAudit afsAudit
BatchGoods batch.Goods BatchGoods batch.Goods
} }

@ -291,3 +291,24 @@ func (a *afterService) FindByAfsId(ctx context.Context, afsId uint) (reply Reply
err = xClient.Call(ctx, "FindByAfsId", afsId, &reply) err = xClient.Call(ctx, "FindByAfsId", afsId, &reply)
return 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
}

@ -73,6 +73,16 @@ func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) {
return xClient.Call(ctx, "Add", args, &reply) 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 { type ArgsBrandEdit struct {
BrandId uint // 品牌id BrandId uint // 品牌id
Name string // 品牌名称 Name string // 品牌名称

@ -40,6 +40,21 @@ func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) {
return xClient.Call(ctx, "Add", args, &reply) 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 { type ArgsCategoryEdit struct {
CategoryId uint // 分类id CategoryId uint // 分类id
Name string // 分类名称 Name string // 分类名称

@ -202,6 +202,7 @@ type ReplyAfterServiceDetail struct {
LogisticsCompany string `json:"logisticsCompany"` LogisticsCompany string `json:"logisticsCompany"`
WaybillCode string `json:"waybillCode"` WaybillCode string `json:"waybillCode"`
SendAt int64 `json:"sendAt"` SendAt int64 `json:"sendAt"`
ReturnAddress string `json:"returnAddress"`
PackageSend uint `json:"packageSend"` PackageSend uint `json:"packageSend"`
AfsPackageSend AfsPackageSend `json:"afsPackageSend"` AfsPackageSend AfsPackageSend `json:"afsPackageSend"`
} }

@ -80,19 +80,17 @@ type SkuEsSearch struct {
MinDiscount decimal.Decimal // 最低折扣 MinDiscount decimal.Decimal // 最低折扣
MaxDiscount decimal.Decimal // 最高折扣 MaxDiscount decimal.Decimal // 最高折扣
Expand []map[string]interface{} // 拓展查询 Expand []map[string]interface{} // 拓展查询
CustomerSearch CustomerSearch // 客户系统的搜索条件 CustomerSearch string // 客户系统搜索参数
MinGuidePrice decimal.Decimal // 市场参考价
MaxGuidePrice decimal.Decimal // 市场参考价
Source uint // 所属供应商
ThirdCategoryIds []uint // 三级分类Ids
} }
type ArgsSkuListsEs struct { type ArgsSkuListsEs struct {
Search SkuEsSearch Search SkuEsSearch
Page bean.Page Page bean.Page
} }
type CustomerSearch struct {
SkuName string
SkuId uint
BrandName string
}
// ListsEs @Title es商品列表 目前最大10000条数据超出不显示 // ListsEs @Title es商品列表 目前最大10000条数据超出不显示
func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) { func (s *sku) ListsEs(ctx context.Context, channelId string, args ArgsSkuListsEs) (reply ReplySkuList, err error) {
xClient, err := client.GetClient(s) xClient, err := client.GetClient(s)

@ -3,34 +3,14 @@ package wholesale
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "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 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 品牌列表 // 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) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -40,7 +20,7 @@ func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBran
} }
// All @Title 全部品牌 // 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) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -50,7 +30,7 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) {
} }
// FindByNameAll @Title 品牌名称筛选品牌 // 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) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -59,12 +39,8 @@ func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandI
return return
} }
type ArgsBrandAdd struct {
Name string // 品牌名称
}
// Add @Title 添加品牌 // 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 reply := 0
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { 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) return xClient.Call(ctx, "Add", args, &reply)
} }
type ArgsBrandEdit struct {
BrandId uint // 品牌id
Name string // 品牌名称
}
// Edit @Title 编辑品牌 // 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 reply := 0
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { 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) return xClient.Call(ctx, "Edit", args, &reply)
} }
type ArgsBrandFindByIds struct {
BrandIds []uint // 品牌id数组
}
// FindByIds @Title 品牌获取 // 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) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return

@ -3,20 +3,14 @@ package wholesale
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/supply"
) )
type category struct { type category struct {
} }
type CategoryItem struct {
Id uint `json:"id"`
Name string `json:"name"`
ParentId uint `json:"parentId"`
Children []CategoryItem `json:"children"`
}
// All @Title 获取分类 // 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) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
return return
@ -25,13 +19,8 @@ func (c *category) All(ctx context.Context) (result []CategoryItem, err error) {
return return
} }
type ArgsCategoryAdd struct {
Name string // 分类名称
ParentId uint // 上级id
}
// Add @Title 添加分类 // 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 reply := 0
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { 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) return xClient.Call(ctx, "Add", args, &reply)
} }
type ArgsCategoryEdit struct {
CategoryId uint // 分类id
Name string // 分类名称
ParentId uint // 上级id
}
// Edit @Title 编辑分类 // 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 reply := 0
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { 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) 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 三级分类获取 // 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) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
return return

@ -4,6 +4,7 @@ import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean" "git.oa00.com/supply-chain/service/lib/bean"
_interface "git.oa00.com/supply-chain/service/wholesale/interface"
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"github.com/smallnest/rpcx/share" "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) err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Finish", orderSn, &reply)
return err 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
}

Loading…
Cancel
Save