|
|
|
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"`
|
|
|
|
AuditStatus uint `json:"manageStatus"`
|
|
|
|
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"`
|
|
|
|
AuditId uint `json:"auditId"` // 审核Id
|
|
|
|
AfsSn string `json:"afsSn"` // 售后单号
|
|
|
|
Status uint `json:"status"` // 售后状态
|
|
|
|
AuditStatus uint `json:"auditStatus"` // 主管审核状态
|
|
|
|
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"` // 商品Id
|
|
|
|
Price decimal.Decimal `json:"price"` // 商品单价
|
|
|
|
Quantity uint `json:"quantity"` // 数量
|
|
|
|
HopeTypeName string `json:"hopeTypeName"` // 期望售后类型
|
|
|
|
TypeReasonName string `json:"typeReasonName"` // 售后原因
|
|
|
|
Imgs []string `json:"imgs"` // 售后图片
|
|
|
|
RefundFee decimal.Decimal `json:"refundFee"` // 退款金额
|
|
|
|
PackageSend uint `json:"packageSend"` // 发货状态
|
|
|
|
AfsPackageSend AfsPackageSend `json:"afsPackageSend"` // 售后物流信息
|
|
|
|
SourceName string `json:"sourceName"` // 所属供应商
|
|
|
|
OrderSubSn string `json:"orderSubSn"` // 沙马订单号
|
|
|
|
NewOrderSubSn string `json:"newOrderSubSn"` // 新订单号
|
|
|
|
SupplyOrderSubSn string `json:"supplyOrderSubSn"` // 供应链订单号
|
|
|
|
NewSupplyOrderSn string `json:"newSupplyOrderSn"` // 供应链新订单号
|
|
|
|
}
|
|
|
|
|
|
|
|
type AfsPackageSend struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Mobile string `json:"mobile"`
|
|
|
|
LogisticsCompany string `json:"logisticsCompany"`
|
|
|
|
WaybillCode string `json:"waybillCode"`
|
|
|
|
SendGoodsDate int64 `json:"sendGoodsDate"`
|
|
|
|
Address string `json:"address"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 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"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 ArgsAfterDeliverRefund struct {
|
|
|
|
AfsSn string
|
|
|
|
Notes string
|
|
|
|
RefundFee decimal.Decimal
|
|
|
|
ApplyUserId uint
|
|
|
|
}
|
|
|
|
|
|
|
|
// AfterDeliverRefund @Title 待客户发货后的赔偿
|
|
|
|
func (a *afs) AfterDeliverRefund(ctx context.Context, args ArgsAfterDeliverRefund) (err error) {
|
|
|
|
xClient, err := client.GetClient(a)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
reply := 0
|
|
|
|
err = xClient.Call(ctx, "AfterDeliverRefund", args, &reply)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type ArgsAfsOriginReturn struct {
|
|
|
|
AfsSn string `json:"afsSn"`
|
|
|
|
Notes string `json:"notes"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// OriginReturn @Title 原返
|
|
|
|
func (a *afs) OriginReturn(ctx context.Context, args ArgsAfsOriginReturn) (err error) {
|
|
|
|
xClient, err := client.GetClient(a)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
reply := 0
|
|
|
|
err = xClient.Call(ctx, "OriginReturn", 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 {
|
|
|
|
ApplyUserId uint `json:"applyUserId"`
|
|
|
|
AfsSn string `json:"afsSn"`
|
|
|
|
RefundFee decimal.Decimal `json:"refundFee"`
|
|
|
|
Notes string `json:"notes"`
|
|
|
|
RefundId uint `json:"refundId"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|