Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
10954cbe
提交
10954cbe
authored
3月 14, 2024
作者:
张立波
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
天猫精选
上级
ead31c49
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
362 行增加
和
364 行删除
+362
-364
tm_goods.go
upstream/tmNew/tm_goods.go
+124
-128
tm_order.go
upstream/tmNew/tm_order.go
+135
-134
tm_refund.go
upstream/tmNew/tm_refund.go
+103
-102
没有找到文件。
upstream/tmNew/tm_goods.go
浏览文件 @
10954cbe
...
@@ -14,10 +14,6 @@ type goodsTmNew struct {
...
@@ -14,10 +14,6 @@ type goodsTmNew struct {
var
Goods
=
goodsTmNew
{}
var
Goods
=
goodsTmNew
{}
//type QueryItemDetailWithDivisionReq struct {
// ItemId string `json:"ItemId"`
// //SkuIdList []string `json:"SkuIdList"`
//}
type
QueryItemDetailWithDivisionRes
struct
{
type
QueryItemDetailWithDivisionRes
struct
{
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
...
@@ -41,23 +37,23 @@ type QueryItemDetailWithDivisionRes struct {
...
@@ -41,23 +37,23 @@ type QueryItemDetailWithDivisionRes struct {
Key
string
`json:"key"`
Key
string
`json:"key"`
Value
string
`json:"value"`
Value
string
`json:"value"`
}
`json:"IforestProps"`
}
`json:"IforestProps"`
ItemID
int64
`json:"ItemId"`
ItemID
int64
`json:"ItemId"`
ItemImages
[]
string
`json:"ItemImages"`
ItemImages
[]
string
`json:"ItemImages"`
ItemTitle
string
`json:"ItemTitle"`
ItemTitle
string
`json:"ItemTitle"`
ItemTotalSimpleValue
string
`json:"ItemTotalSimpleValue"`
ItemTotalSimpleValue
string
`json:"ItemTotalSimpleValue"`
ItemTotalValue
int
`json:"ItemTotalValue"`
ItemTotalValue
int
`json:"ItemTotalValue"`
LmItemCategory
string
`json:"LmItemCategory"`
LmItemCategory
string
`json:"LmItemCategory"`
LmItemID
string
`json:"LmItemId"`
LmItemID
string
`json:"LmItemId"`
MainPicURL
string
`json:"MainPicUrl"`
MainPicURL
string
`json:"MainPicUrl"`
MinPrice
int
`json:"MinPrice"`
MinPrice
int
`json:"MinPrice"`
Properties
map
[
string
][]
string
`json:"Properties"`
Properties
map
[
string
][]
string
`json:"Properties"`
Prov
string
`json:"Prov"`
Prov
string
`json:"Prov"`
Quantity
int
`json:"Quantity"`
Quantity
int
`json:"Quantity"`
ReservePrice
int
`json:"ReservePrice"`
ReservePrice
int
`json:"ReservePrice"`
SecuredTransactions
int
`json:"SecuredTransactions"`
SecuredTransactions
int
`json:"SecuredTransactions"`
SellerPayPostfee
bool
`json:"SellerPayPostfee"`
SellerPayPostfee
bool
`json:"SellerPayPostfee"`
SimpleQuantity
string
`json:"SimpleQuantity"`
SimpleQuantity
string
`json:"SimpleQuantity"`
SkuModels
[]
struct
{
SkuModels
[]
struct
{
DistributionMallID
string
`json:"DistributionMallId"`
DistributionMallID
string
`json:"DistributionMallId"`
ExtJSON
string
`json:"ExtJson"`
ExtJSON
string
`json:"ExtJson"`
HasQuantity
bool
`json:"HasQuantity"`
HasQuantity
bool
`json:"HasQuantity"`
...
@@ -88,82 +84,82 @@ type QueryItemDetailWithDivisionRes struct {
...
@@ -88,82 +84,82 @@ type QueryItemDetailWithDivisionRes struct {
}
`json:"Model"`
}
`json:"Model"`
RequestID
string
`json:"RequestId"`
RequestID
string
`json:"RequestId"`
Success
bool
`json:"Success"`
Success
bool
`json:"Success"`
}
}
type
ListDistributionItemReq
struct
{
type
ListDistributionItemReq
struct
{
Page
string
`json:"page"`
Page
string
`json:"page"`
Limit
string
`json:"limit"`
Limit
string
`json:"limit"`
LmItemId
string
`json:"LmItemId"`
LmItemId
string
`json:"LmItemId"`
}
}
type
ListDistributionItemRes
struct
{
type
ListDistributionItemRes
struct
{
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
Model
[]
struct
{
Model
[]
struct
{
CategoryID
int
`json:"CategoryId"`
CategoryID
int
`json:"CategoryId"`
CategoryIds
[]
int
`json:"CategoryIds"`
CategoryIds
[]
int
`json:"CategoryIds"`
City
string
`json:"City"`
City
string
`json:"City"`
Current
string
`json:"Current"`
Current
string
`json:"Current"`
DescPath
string
`json:"DescPath"`
DescPath
string
`json:"DescPath"`
DistributionMallID
string
`json:"DistributionMallId"`
Features
struct
{
DeliveryVersion
string
`json:"delivery_version"`
TaxInvoice
string
`json:"tax_invoice"`
TaxRateCode
string
`json:"tax_rate_code"`
}
`json:"Features"`
FirstPicURL
string
`json:"FirstPicUrl"`
HasQuantity
bool
`json:"HasQuantity"`
IforestProps
[]
struct
{
Key
string
`json:"key"`
Value
string
`json:"value"`
}
`json:"IforestProps"`
IsCanSell
bool
`json:"IsCanSell"`
IsSellerPayPostfee
bool
`json:"IsSellerPayPostfee"`
ItemID
int64
`json:"ItemId"`
ItemImages
[]
string
`json:"ItemImages"`
ItemTitle
string
`json:"ItemTitle"`
ItemTotalSimpleValue
string
`json:"ItemTotalSimpleValue"`
ItemTotalValue
int
`json:"ItemTotalValue"`
LmItemAttributeMap
struct
{
TaxInvoice
string
`json:"taxInvoice"`
TaxRateCode
string
`json:"taxRateCode"`
}
`json:"LmItemAttributeMap"`
LmItemCategory
string
`json:"LmItemCategory"`
LmItemID
string
`json:"LmItemId"`
MainPicURL
string
`json:"MainPicUrl"`
Properties
map
[
string
][]
string
`json:"Properties"`
Prov
string
`json:"Prov"`
Quantity
int
`json:"Quantity"`
ReservedPrice
int
`json:"ReservedPrice"`
SecuredTransactions
int
`json:"SecuredTransactions"`
SimpleQuantity
string
`json:"SimpleQuantity"`
SkuModels
[]
struct
{
DistributionMallID
string
`json:"DistributionMallId"`
DistributionMallID
string
`json:"DistributionMallId"`
Features
struct
{
HasQuantity
bool
`json:"HasQuantity"`
DeliveryVersion
string
`json:"delivery_version"`
ItemID
int64
`json:"ItemId"`
TaxInvoice
string
`json:"tax_invoice"`
LmItemID
string
`json:"LmItemId"`
TaxRateCode
string
`json:"tax_rate_code"`
LmSkuAttributeMap
struct
{
}
`json:"Features"`
FirstPicURL
string
`json:"FirstPicUrl"`
HasQuantity
bool
`json:"HasQuantity"`
IforestProps
[]
struct
{
Key
string
`json:"key"`
Value
string
`json:"value"`
}
`json:"IforestProps"`
IsCanSell
bool
`json:"IsCanSell"`
IsSellerPayPostfee
bool
`json:"IsSellerPayPostfee"`
ItemID
int64
`json:"ItemId"`
ItemImages
[]
string
`json:"ItemImages"`
ItemTitle
string
`json:"ItemTitle"`
ItemTotalSimpleValue
string
`json:"ItemTotalSimpleValue"`
ItemTotalValue
int
`json:"ItemTotalValue"`
LmItemAttributeMap
struct
{
TaxInvoice
string
`json:"taxInvoice"`
TaxInvoice
string
`json:"taxInvoice"`
TaxRateCode
string
`json:"taxRateCode"`
TaxRateCode
string
`json:"taxRateCode"`
}
`json:"LmItemAttributeMap"`
}
`json:"LmSkuAttributeMap"`
LmItemCategory
string
`json:"LmItemCategory"`
PriceCent
int
`json:"PriceCent"`
LmItemID
string
`json:"LmItemId"`
Quantity
int
`json:"Quantity"`
MainPicURL
string
`json:"MainPicUrl"`
ReservedPrice
int
`json:"ReservedPrice"`
Properties
map
[
string
][]
string
`json:"Properties"`
SimpleQuantity
string
`json:"SimpleQuantity"`
Prov
string
`json:"Prov"`
SkuID
int
`json:"SkuId"`
Quantity
int
`json:"Quantity"`
SkuPicURL
string
`json:"SkuPicUrl"`
ReservedPrice
int
`json:"ReservedPrice"`
SkuPvs
string
`json:"SkuPvs"`
SecuredTransactions
int
`json:"SecuredTransactions"`
Status
int
`json:"Status"`
SimpleQuantity
string
`json:"SimpleQuantity"`
SupplierPrice
int
`json:"SupplierPrice"`
SkuModels
[]
struct
{
}
`json:"SkuModels"`
DistributionMallID
string
`json:"DistributionMallId"`
UserType
int
`json:"UserType"`
HasQuantity
bool
`json:"HasQuantity"`
VideoPicURL
string
`json:"VideoPicUrl"`
ItemID
int64
`json:"ItemId"`
VideoURL
string
`json:"VideoUrl"`
LmItemID
string
`json:"LmItemId"`
}
`json:"Model"`
LmSkuAttributeMap
struct
{
PageNumber
int
`json:"PageNumber"`
TaxInvoice
string
`json:"taxInvoice"`
PageSize
int
`json:"PageSize"`
TaxRateCode
string
`json:"taxRateCode"`
RequestID
string
`json:"RequestId"`
}
`json:"LmSkuAttributeMap"`
Success
bool
`json:"Success"`
PriceCent
int
`json:"PriceCent"`
TotalCount
int
`json:"TotalCount"`
Quantity
int
`json:"Quantity"`
ReservedPrice
int
`json:"ReservedPrice"`
SimpleQuantity
string
`json:"SimpleQuantity"`
SkuID
int
`json:"SkuId"`
SkuPicURL
string
`json:"SkuPicUrl"`
SkuPvs
string
`json:"SkuPvs"`
Status
int
`json:"Status"`
SupplierPrice
int
`json:"SupplierPrice"`
}
`json:"SkuModels"`
UserType
int
`json:"UserType"`
VideoPicURL
string
`json:"VideoPicUrl"`
VideoURL
string
`json:"VideoUrl"`
}
`json:"Model"`
PageNumber
int
`json:"PageNumber"`
PageSize
int
`json:"PageSize"`
RequestID
string
`json:"RequestId"`
Success
bool
`json:"Success"`
TotalCount
int
`json:"TotalCount"`
}
}
type
QueryItemGuIDeRetailPriceRes
struct
{
type
QueryItemGuIDeRetailPriceRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
...
@@ -190,103 +186,103 @@ type QueryItemGuIDeRetailPriceRes struct {
...
@@ -190,103 +186,103 @@ type QueryItemGuIDeRetailPriceRes struct {
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Success
bool
`json:"Success"`
Success
bool
`json:"Success"`
}
}
//区域库存商品详情
//区域库存商品详情
func
(
s
*
goodsTmNew
)
QueryItemDetailWithDivision
(
ctx
context
.
Context
,
addr
string
,
item
string
)
(
res
*
QueryItemDetailWithDivisionRes
,
err
error
)
{
func
(
s
*
goodsTmNew
)
QueryItemDetailWithDivision
(
ctx
context
.
Context
,
addr
string
,
item
string
)
(
res
*
QueryItemDetailWithDivisionRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryItemDetailWithDivision
(
&
link
.
QueryItemDetailWithDivisionRequest
{
result
,
err
:=
client
.
QueryItemDetailWithDivision
(
&
link
.
QueryItemDetailWithDivisionRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
LmItemId
:
tea
.
String
(
item
),
LmItemId
:
tea
.
String
(
item
),
DivisionCode
:
tea
.
String
(
addr
),
DivisionCode
:
tea
.
String
(
addr
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
if
*
result
.
Body
.
Success
==
false
{
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryItemDetailWithDivision"
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
}
}
return
return
}
}
////商品列表
////商品列表
func
(
s
*
goodsTmNew
)
ListDistributionItem
(
ctx
context
.
Context
,
item
*
ListDistributionItemReq
)
(
res
*
ListDistributionItemRes
,
err
error
)
{
func
(
s
*
goodsTmNew
)
ListDistributionItem
(
ctx
context
.
Context
,
item
*
ListDistributionItemReq
)
(
res
*
ListDistributionItemRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
ListDistributionItemWithoutCache
(
&
link
.
ListDistributionItemWithoutCacheRequest
{
result
,
err
:=
client
.
ListDistributionItemWithoutCache
(
&
link
.
ListDistributionItemWithoutCacheRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
//LmItemId: tea.String(item),
//LmItemId: tea.String(item),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
PageNumber
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Page
)),
PageNumber
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Page
)),
PageSize
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Limit
)),
PageSize
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Limit
)),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"ListDistributionItem"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
}
}
return
return
}
}
//查询零售价
//查询零售价
func
(
s
*
goodsTmNew
)
QueryItemGuIDeRetailPrice
(
ctx
context
.
Context
,
item
[]
string
)
(
res
*
QueryItemGuIDeRetailPriceRes
,
err
error
)
{
func
(
s
*
goodsTmNew
)
QueryItemGuIDeRetailPrice
(
ctx
context
.
Context
,
item
[]
string
)
(
res
*
QueryItemGuIDeRetailPriceRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryItemGuideRetailPrice
(
&
link
.
QueryItemGuideRetailPriceRequest
{
result
,
err
:=
client
.
QueryItemGuideRetailPrice
(
&
link
.
QueryItemGuideRetailPriceRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
LmItemIds
:
tea
.
StringSlice
(
item
),
LmItemIds
:
tea
.
StringSlice
(
item
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
if
*
result
.
Body
.
Success
==
false
{
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryItemGuideRetailPrice"
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
}
}
return
return
}
}
//Detail 详情 todo 该接口正确通过,由于订单部分接口不通过天猫技术不支持对接,后续有时间再自己写
//Detail 详情 todo 该接口正确通过,由于订单部分接口不通过天猫技术不支持对接,后续有时间再自己写
//func (*goodsTmNew) QueryItemDetailWithDivision(ctx context.Context, req string) (res *QueryItemDetailWithDivisionRes, err error) {
//func (*goodsTmNew) QueryItemDetailWithDivision(ctx context.Context, req string) (res *QueryItemDetailWithDivisionRes, err error) {
// method := "QueryItemDetailWithDivision"
// method := "QueryItemDetailWithDivision"
...
@@ -320,4 +316,4 @@ func (s *goodsTmNew) QueryItemGuIDeRetailPrice(ctx context.Context,item []string
...
@@ -320,4 +316,4 @@ func (s *goodsTmNew) QueryItemGuIDeRetailPrice(ctx context.Context,item []string
// StrNumber: true,
// StrNumber: true,
// }).Scan(&res)
// }).Scan(&res)
// return
// return
//}
//}
\ No newline at end of file
upstream/tmNew/tm_order.go
浏览文件 @
10954cbe
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
link
"github.com/alibabacloud-go/linkedmall-20220531/v2/client"
"github.com/alibabacloud-go/tea/tea"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gjson"
)
)
type
orderTm
struct
{
type
orderTm
struct
{
...
@@ -15,18 +14,18 @@ type orderTm struct {
...
@@ -15,18 +14,18 @@ type orderTm struct {
var
Order
=
orderTm
{}
var
Order
=
orderTm
{}
type
OrderAddress
struct
{
type
OrderAddress
struct
{
AddressDetail
string
`json:"AddressDetail"`
AddressDetail
string
`json:"AddressDetail"`
DivisionCode
string
`json:"DivisionCode"`
DivisionCode
string
`json:"DivisionCode"`
FullName
string
`json:"FullName"`
FullName
string
`json:"FullName"`
Mobile
string
`json:"Mobile"`
Mobile
string
`json:"Mobile"`
TownDivisionCode
string
`json:"TownDivisionCode"`
TownDivisionCode
string
`json:"TownDivisionCode"`
}
}
type
RenderDistributionOrderReq
struct
{
type
RenderDistributionOrderReq
struct
{
ItemInfoLists
[]
*
ItemInfo
`json:"ItemInfoLists"`
ItemInfoLists
[]
*
ItemInfo
`json:"ItemInfoLists"`
BuyerId
string
`json:"BuyerId"`
BuyerId
string
`json:"BuyerId"`
Addr
string
`json:"Addr"`
Addr
string
`json:"Addr"`
}
}
type
ItemInfo
struct
{
type
ItemInfo
struct
{
DistributionMallId
string
`json:"DistributionMallId,omitempty" xml:"DistributionMallId,omitempty"`
DistributionMallId
string
`json:"DistributionMallId,omitempty" xml:"DistributionMallId,omitempty"`
LmItemId
string
`json:"LmItemId,omitempty" xml:"LmItemId,omitempty"`
LmItemId
string
`json:"LmItemId,omitempty" xml:"LmItemId,omitempty"`
Quantity
int32
`json:"Quantity,omitempty" xml:"Quantity,omitempty"`
Quantity
int32
`json:"Quantity,omitempty" xml:"Quantity,omitempty"`
...
@@ -101,11 +100,10 @@ type OrderCreateReq struct {
...
@@ -101,11 +100,10 @@ type OrderCreateReq struct {
ItemLists
[]
OrderGoodsItem
ItemLists
[]
OrderGoodsItem
}
}
type
OrderGoodsItem
struct
{
type
OrderGoodsItem
struct
{
LmItemId
string
`json:"LmItemId"`
LmItemId
string
`json:"LmItemId"`
Quantity
string
`json:"Quantity"`
Quantity
string
`json:"Quantity"`
SkuId
string
`json:"SkuId"`
SkuId
string
`json:"SkuId"`
DistributionMallId
string
`json:"DistributionMallId"`
DistributionMallId
string
`json:"DistributionMallId"`
}
}
type
OrderCreateRes
struct
{
type
OrderCreateRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
...
@@ -115,10 +113,10 @@ type OrderCreateRes struct {
...
@@ -115,10 +113,10 @@ type OrderCreateRes struct {
Success
bool
`json:"Success"`
Success
bool
`json:"Success"`
}
}
type
OrderFilter
struct
{
type
OrderFilter
struct
{
DistributionTradeId
string
`json:"DistributionTradeId,omitempty"`
DistributionTradeId
string
`json:"DistributionTradeId,omitempty"`
OrderList
[]
string
`json:"OrderList,omitempty"`
OrderList
[]
string
`json:"OrderList,omitempty"`
LogisticsStatus
string
`json:"LogisticsStatus,omitempty"`
LogisticsStatus
string
`json:"LogisticsStatus,omitempty"`
OrderStatus
string
`json:"OrderStatus,omitempty"`
OrderStatus
string
`json:"OrderStatus,omitempty"`
}
}
type
T
struct
{
type
T
struct
{
CreateDate
string
`json:"createDate"`
CreateDate
string
`json:"createDate"`
...
@@ -144,12 +142,12 @@ type T struct {
...
@@ -144,12 +142,12 @@ type T struct {
}
`json:"subOrderList"`
}
`json:"subOrderList"`
}
}
type
OrderListRes
struct
{
type
OrderListRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
PageSize
int
`json:"PageSize"`
PageSize
int
`json:"PageSize"`
PageNumber
int
`json:"PageNumber"`
PageNumber
int
`json:"PageNumber"`
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Model
[]
struct
{
Model
[]
struct
{
CreateDate
string
`json:"CreateDate"`
CreateDate
string
`json:"CreateDate"`
DistributionOrderId
string
`json:"DistributionOrderId"`
DistributionOrderId
string
`json:"DistributionOrderId"`
DistributorId
string
`json:"DistributorId"`
DistributorId
string
`json:"DistributorId"`
...
@@ -175,32 +173,30 @@ type OrderListRes struct {
...
@@ -175,32 +173,30 @@ type OrderListRes struct {
}
}
type
OrderListReq
struct
{
type
OrderListReq
struct
{
DistributorId
string
`json:"DistributorId"`
DistributorId
string
`json:"DistributorId"`
FilterOption
struct
{
FilterOption
struct
{
DistributionTradeId
string
`json:"DistributionTradeId"`
DistributionTradeId
string
`json:"DistributionTradeId"`
OrderList
[]
string
`json:"OrderList"`
OrderList
[]
string
`json:"OrderList"`
}
`json:"FilterOption"`
}
`json:"FilterOption"`
PageNumber
int32
`json:"PageNumber"`
PageNumber
int32
`json:"PageNumber"`
PageSize
int32
`json:"PageSize"`
PageSize
int32
`json:"PageSize"`
LogisticsStatus
string
`json:"LogisticsStatus"`
LogisticsStatus
string
`json:"LogisticsStatus"`
OrderStatus
string
`json:"OrderStatus"`
OrderStatus
string
`json:"OrderStatus"`
}
}
type
FilterOption
struct
{
type
FilterOption
struct
{
}
}
type
OrderInfoReq
struct
{
type
OrderInfoReq
struct
{
MainDistributionOrderId
string
`json:"MainDistributionOrderId"`
MainDistributionOrderId
string
`json:"MainDistributionOrderId"`
UserId
string
`json:"UserId"`
UserId
string
`json:"UserId"`
LmOrderId
string
`json:"LmOrderId"`
LmOrderId
string
`json:"LmOrderId"`
LogisticsStatus
string
`json:"LogisticsStatus"`
LogisticsStatus
string
`json:"LogisticsStatus"`
OrderStatus
string
`json:"OrderStatus"`
OrderStatus
string
`json:"OrderStatus"`
}
}
type
OrderInfoRes
struct
{
type
OrderInfoRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Model
struct
{
Model
struct
{
CreateDate
string
`json:"CreateDate"`
CreateDate
string
`json:"CreateDate"`
DistributionOrderId
string
`json:"DistributionOrderId"`
DistributionOrderId
string
`json:"DistributionOrderId"`
DistributorId
string
`json:"DistributorId"`
DistributorId
string
`json:"DistributorId"`
...
@@ -228,10 +224,10 @@ type OrderStatusReq struct {
...
@@ -228,10 +224,10 @@ type OrderStatusReq struct {
DistributionTradeId
string
`json:"DistributionTradeId"`
DistributionTradeId
string
`json:"DistributionTradeId"`
}
}
type
OrderStatusRes
struct
{
type
OrderStatusRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Model
string
`json:"Model"`
Model
string
`json:"Model"`
//1:分销单创建中
//1:分销单创建中
//
//
//10:采购中
//10:采购中
...
@@ -255,14 +251,14 @@ type OrderStatusRes struct {
...
@@ -255,14 +251,14 @@ type OrderStatusRes struct {
//99:交易成功
//99:交易成功
}
}
type
AddrInfoReq
struct
{
type
AddrInfoReq
struct
{
DivisionCode
string
`json:"DivisionCode"`
DivisionCode
string
`json:"DivisionCode"`
}
}
type
AddrInfoRes
struct
{
type
AddrInfoRes
struct
{
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Model
struct
{
Model
struct
{
DivisionList
[]
AddrInfo
`json:"DivisionList"`
DivisionList
[]
AddrInfo
`json:"DivisionList"`
}
`json:"Model"`
}
`json:"Model"`
}
}
type
AddrInfo
struct
{
type
AddrInfo
struct
{
...
@@ -272,38 +268,39 @@ type AddrInfo struct {
...
@@ -272,38 +268,39 @@ type AddrInfo struct {
Pinyin
string
`json:"Pinyin"`
Pinyin
string
`json:"Pinyin"`
DivisionCode
int
`json:"DivisionCode"`
DivisionCode
int
`json:"DivisionCode"`
}
}
//Before 验证订单商品
//Before 验证订单商品
func
(
s
*
orderTm
)
Before
(
ctx
context
.
Context
,
itemInfo
*
RenderDistributionOrderReq
)
(
res
*
RenderDistributionOrderRes
,
err
error
)
{
func
(
s
*
orderTm
)
Before
(
ctx
context
.
Context
,
itemInfo
*
RenderDistributionOrderReq
)
(
res
*
RenderDistributionOrderRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
if
itemInfo
==
nil
{
if
itemInfo
==
nil
{
return
return
}
}
var
itemInfoLists
[]
*
link
.
RenderDistributionOrderRequestItemInfoLists
var
itemInfoLists
[]
*
link
.
RenderDistributionOrderRequestItemInfoLists
err
=
gjson
.
New
(
itemInfo
.
ItemInfoLists
)
.
Scan
(
&
itemInfoLists
)
err
=
gjson
.
New
(
itemInfo
.
ItemInfoLists
)
.
Scan
(
&
itemInfoLists
)
result
,
err
:=
client
.
RenderDistributionOrder
(
&
link
.
RenderDistributionOrderRequest
{
result
,
err
:=
client
.
RenderDistributionOrder
(
&
link
.
RenderDistributionOrderRequest
{
BuyerId
:
tea
.
String
(
itemInfo
.
BuyerId
),
BuyerId
:
tea
.
String
(
itemInfo
.
BuyerId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
ItemInfoLists
:
itemInfoLists
,
ItemInfoLists
:
itemInfoLists
,
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
DeliveryAddress
:
tea
.
String
(
itemInfo
.
Addr
),
DeliveryAddress
:
tea
.
String
(
itemInfo
.
Addr
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"RenderDistributionOrder"
)
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
}
}
...
@@ -312,16 +309,16 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
...
@@ -312,16 +309,16 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
}
}
//订单列表
//订单列表
func
(
s
*
orderTm
)
List
(
ctx
context
.
Context
,
item
*
OrderListReq
)
(
res
*
OrderListRes
,
err
error
)
{
func
(
s
*
orderTm
)
List
(
ctx
context
.
Context
,
item
*
OrderListReq
)
(
res
*
OrderListRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryOrderList4Distribution
(
&
link
.
QueryOrderList4DistributionRequest
{
result
,
err
:=
client
.
QueryOrderList4Distribution
(
&
link
.
QueryOrderList4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
FilterOption
:
tea
.
String
(
gjson
.
New
(
item
.
FilterOption
)
.
MustToJsonString
()),
FilterOption
:
tea
.
String
(
gjson
.
New
(
item
.
FilterOption
)
.
MustToJsonString
()),
PageNumber
:
tea
.
Int32
(
item
.
PageNumber
),
PageNumber
:
tea
.
Int32
(
item
.
PageNumber
),
...
@@ -329,148 +326,156 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
...
@@ -329,148 +326,156 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryOrderList4Distribution"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
return
}
}
//创建订单
//创建订单
func
(
s
*
orderTm
)
Create
(
ctx
context
.
Context
,
item
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
func
(
s
*
orderTm
)
Create
(
ctx
context
.
Context
,
item
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
if
item
==
nil
{
if
item
==
nil
{
return
return
}
}
var
itemInfoLists
[]
*
link
.
ApplyCreateDistributionOrderRequestItemInfoLists
var
itemInfoLists
[]
*
link
.
ApplyCreateDistributionOrderRequestItemInfoLists
err
=
gjson
.
New
(
item
.
ItemLists
)
.
Scan
(
&
itemInfoLists
)
err
=
gjson
.
New
(
item
.
ItemLists
)
.
Scan
(
&
itemInfoLists
)
result
,
err
:=
client
.
ApplyCreateDistributionOrder
(
&
link
.
ApplyCreateDistributionOrderRequest
{
result
,
err
:=
client
.
ApplyCreateDistributionOrder
(
&
link
.
ApplyCreateDistributionOrderRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
BuyerId
:
tea
.
String
(
item
.
UserId
),
BuyerId
:
tea
.
String
(
item
.
UserId
),
ItemInfoLists
:
itemInfoLists
,
ItemInfoLists
:
itemInfoLists
,
DeliveryAddress
:
tea
.
String
(
item
.
Address
),
DeliveryAddress
:
tea
.
String
(
item
.
Address
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"ApplyCreateDistributionOrder"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
return
}
}
return
return
}
}
//订单详情
//订单详情
func
(
s
*
orderTm
)
Detail
(
ctx
context
.
Context
,
item
*
OrderInfoReq
)
(
res
*
OrderInfoRes
,
err
error
)
{
func
(
s
*
orderTm
)
Detail
(
ctx
context
.
Context
,
item
*
OrderInfoReq
)
(
res
*
OrderInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryOrderDetail4Distribution
(
&
link
.
QueryOrderDetail4DistributionRequest
{
result
,
err
:=
client
.
QueryOrderDetail4Distribution
(
&
link
.
QueryOrderDetail4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
MainDistributionOrderId
:
tea
.
String
(
item
.
MainDistributionOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryOrderDetail4Distribution"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
return
}
}
//订单交易状态
//订单交易状态
func
(
s
*
orderTm
)
Status
(
ctx
context
.
Context
,
item
*
OrderStatusReq
)
(
res
*
OrderStatusRes
,
err
error
)
{
func
(
s
*
orderTm
)
Status
(
ctx
context
.
Context
,
item
*
OrderStatusReq
)
(
res
*
OrderStatusRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryDistributionTradeStatus
(
&
link
.
QueryDistributionTradeStatusRequest
{
result
,
err
:=
client
.
QueryDistributionTradeStatus
(
&
link
.
QueryDistributionTradeStatusRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributionTradeId
:
tea
.
String
(
item
.
DistributionTradeId
),
DistributionTradeId
:
tea
.
String
(
item
.
DistributionTradeId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
DistributionSupplierId
:
tea
.
String
(
server
.
DistributionSupplierId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryDistributionTradeStatus"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
return
}
}
//地址
//地址
func
(
s
*
orderTm
)
AddrInfo
(
ctx
context
.
Context
,
itemInfo
*
AddrInfoReq
)
(
res
*
AddrInfoRes
,
err
error
)
{
func
(
s
*
orderTm
)
AddrInfo
(
ctx
context
.
Context
,
itemInfo
*
AddrInfoReq
)
(
res
*
AddrInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryChildDivisionCodeById
(
&
link
.
QueryChildDivisionCodeByIdRequest
{
result
,
err
:=
client
.
QueryChildDivisionCodeById
(
&
link
.
QueryChildDivisionCodeByIdRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DivisionCode
:
tea
.
String
(
itemInfo
.
DivisionCode
),
DivisionCode
:
tea
.
String
(
itemInfo
.
DivisionCode
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryChildDivisionCodeById"
)
if
err
!=
nil
{
log
(
ctx
,
gjson
.
New
(
itemInfo
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
return
}
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
return
return
}
}
//订单详情
//订单详情
//func (s *orderTm) Detail(ctx context.Context,req OrderInfoReq) (res OrderInfoRes,err error) {
//func (s *orderTm) Detail(ctx context.Context,req OrderInfoReq) (res OrderInfoRes,err error) {
//
//
...
@@ -527,8 +532,6 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
...
@@ -527,8 +532,6 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
// return
// return
//}
//}
//
//
//type OrderListReq struct {
//type OrderListReq struct {
// UserId string
// UserId string
...
@@ -539,7 +542,6 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
...
@@ -539,7 +542,6 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
//}
//}
//
//
//List 列表
//List 列表
//func (s *orderTm) QueryOrderList4Distribution(ctx context.Context,req OrderListReq) (res OrderListRes,err error) {
//func (s *orderTm) QueryOrderList4Distribution(ctx context.Context,req OrderListReq) (res OrderListRes,err error) {
// method := "QueryOrderList4Distribution"
// method := "QueryOrderList4Distribution"
...
@@ -576,4 +578,3 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
...
@@ -576,4 +578,3 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
// LmOrderId string
// LmOrderId string
//}
//}
//
//
upstream/tmNew/tm_refund.go
浏览文件 @
10954cbe
...
@@ -22,36 +22,34 @@ type RefundSubmitReq struct {
...
@@ -22,36 +22,34 @@ type RefundSubmitReq struct {
LogisticsNo
string
//物流单号
LogisticsNo
string
//物流单号
}
}
type
RefundCancelRes
struct
{
type
RefundCancelRes
struct
{
Code
string
`json:" Code"`
Code
string
`json:" Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Success
bool
`json:"Success"`
Success
bool
`json:"Success"`
Model
struct
{
Model
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
DisputeStatus
int
`json:"DisputeStatus"`
DisputeStatus
int
`json:"DisputeStatus"`
DisputeType
int
`json:"DisputeType"`
DisputeType
int
`json:"DisputeType"`
}
`json:"Model"`
}
`json:"Model"`
}
}
type
CommonRes
struct
{
type
CommonRes
struct
{
Code
string
`json:" Code"`
Code
string
`json:" Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Success
bool
`json:"Success"`
Success
bool
`json:"Success"`
}
}
type
RefundBeforeReq
struct
{
type
RefundBeforeReq
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
BizClaimType
int32
`json:"BizClaimType"`
BizClaimType
int32
`json:"BizClaimType"`
GoodsStatus
string
`json:"GoodsStatus"`
GoodsStatus
string
`json:"GoodsStatus"`
}
}
type
RefundBeforeRes
struct
{
type
RefundBeforeRes
struct
{
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Model
struct
{
Model
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
BizClaimType
int
`json:"BizClaimType"`
BizClaimType
int
`json:"BizClaimType"`
MainOrderRefund
bool
`json:"MainOrderRefund"`
MainOrderRefund
bool
`json:"MainOrderRefund"`
...
@@ -65,18 +63,18 @@ type RefundBeforeRes struct {
...
@@ -65,18 +63,18 @@ type RefundBeforeRes struct {
ProofRequired
bool
`json:"ProofRequired"`
ProofRequired
bool
`json:"ProofRequired"`
RefundDescRequired
bool
`json:"RefundDescRequired"`
RefundDescRequired
bool
`json:"RefundDescRequired"`
}
`json:"RefundReasonList"`
}
`json:"RefundReasonList"`
}
}
}
}
type
RefundApplyReq
struct
{
type
RefundApplyReq
struct
{
UserId
string
UserId
string
SubLmOrderId
string
//子订单号
SubLmOrderId
string
//子订单号
BizClaimType
string
//退款类型
BizClaimType
string
//退款类型
ApplyRefundFee
int64
//申请退款金额
ApplyRefundFee
int64
//申请退款金额
ApplyRefundCount
int32
//退货数量
ApplyRefundCount
int32
//退货数量
ApplyReasonTextId
int64
//退款原因ID
ApplyReasonTextId
int64
//退款原因ID
LeaveMessage
string
//留言
LeaveMessage
string
//留言
LeavePictureList
[]
*
RefundApplyPicture
//凭证,某些原因要求必须有凭证。
LeavePictureList
[]
*
RefundApplyPicture
//凭证,某些原因要求必须有凭证。
GoodsStatus
int32
//当退款类型:仅退款时,货物状态:为4未 发货。所有状态:4: 未发货, 6: 已发货, 1: 未收到货, 2: 已收到货, 3:已寄回, 5: 卖家确 认收货
GoodsStatus
int32
//当退款类型:仅退款时,货物状态:为4未 发货。所有状态:4: 未发货, 6: 已发货, 1: 未收到货, 2: 已收到货, 3:已寄回, 5: 卖家确 认收货
}
}
type
RefundApplyPicture
struct
{
type
RefundApplyPicture
struct
{
...
@@ -85,88 +83,87 @@ type RefundApplyPicture struct {
...
@@ -85,88 +83,87 @@ type RefundApplyPicture struct {
}
}
type
RefundApplyRes
struct
{
type
RefundApplyRes
struct
{
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Model
struct
{
Model
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
//当前发起逆向的子订单号
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
//当前发起逆向的子订单号
DisputeStatus
int
`json:"DisputeStatus"`
//逆向的状态
DisputeStatus
int
`json:"DisputeStatus"`
//逆向的状态
DisputeType
int
`json:"DisputeType"`
//任意退款类型
DisputeType
int
`json:"DisputeType"`
//任意退款类型
DisputeId
int64
`json:"DisputeId"`
//shou
DisputeId
int64
`json:"DisputeId"`
//shou
}
`json:"Model"`
}
`json:"Model"`
}
}
//Before 前置
//Before 前置
func
(
s
*
refundTm
)
Before
(
ctx
context
.
Context
,
req
*
RefundBeforeReq
)
(
res
*
RefundBeforeRes
,
err
error
)
{
func
(
s
*
refundTm
)
Before
(
ctx
context
.
Context
,
req
*
RefundBeforeReq
)
(
res
*
RefundBeforeRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
InitApplyRefund4Distribution
(
&
link
.
InitApplyRefund4DistributionRequest
{
result
,
err
:=
client
.
InitApplyRefund4Distribution
(
&
link
.
InitApplyRefund4DistributionRequest
{
BizClaimType
:
tea
.
Int32
(
req
.
BizClaimType
),
BizClaimType
:
tea
.
Int32
(
req
.
BizClaimType
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubDistributionOrderId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubDistributionOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"InitApplyRefund4Distribution"
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
//Apply 申请
//Apply 申请
func
(
s
*
refundTm
)
Apply
(
ctx
context
.
Context
,
req
*
RefundApplyReq
)
(
res
*
RefundApplyRes
,
err
error
)
{
func
(
s
*
refundTm
)
Apply
(
ctx
context
.
Context
,
req
*
RefundApplyReq
)
(
res
*
RefundApplyRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
ApplyRefund4Distribution
(
&
link
.
ApplyRefund4DistributionRequest
{
result
,
err
:=
client
.
ApplyRefund4Distribution
(
&
link
.
ApplyRefund4DistributionRequest
{
ApplyReasonTextId
:
tea
.
Int64
(
req
.
ApplyReasonTextId
),
ApplyReasonTextId
:
tea
.
Int64
(
req
.
ApplyReasonTextId
),
ApplyRefundCount
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
ApplyRefundCount
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
ApplyRefundFee
:
tea
.
Int64
(
req
.
ApplyRefundFee
),
ApplyRefundFee
:
tea
.
Int64
(
req
.
ApplyRefundFee
),
BizClaimType
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
BizClaimType
)),
//gconv.Int32(req.BizClaimType)
BizClaimType
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
BizClaimType
)),
//gconv.Int32(req.BizClaimType)
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
GoodsStatus
:
tea
.
Int32
(
req
.
GoodsStatus
),
GoodsStatus
:
tea
.
Int32
(
req
.
GoodsStatus
),
//LeaveMessage: tea.String("测试退款"),
//LeaveMessage: tea.String("测试退款"),
LeavePictureLists
:
nil
,
LeavePictureLists
:
nil
,
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"ApplyRefund4Distribution"
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
type
RefundInfoRes
struct
{
type
RefundInfoRes
struct
{
Code
string
`json:"Code"`
Code
string
`json:"Code"`
Message
string
`json:"Message"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
RequestId
string
`json:"RequestId"`
Model
struct
{
Model
struct
{
DistributionOrderId
string
`json:"DistributionOrderId"`
DistributionOrderId
string
`json:"DistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
BizClaimType
int
`json:"BizClaimType"`
BizClaimType
int
`json:"BizClaimType"`
...
@@ -198,84 +195,88 @@ type RefundInfoRes struct {
...
@@ -198,84 +195,88 @@ type RefundInfoRes struct {
RefunderZipCode
string
`json:"RefunderZipCode"`
RefunderZipCode
string
`json:"RefunderZipCode"`
}
`json:"Model"`
}
`json:"Model"`
}
}
//Submit 提交退货物流信息接口
//Submit 提交退货物流信息接口
func
(
s
*
refundTm
)
Submit
(
ctx
context
.
Context
,
req
RefundSubmitReq
)
(
res
*
CommonRes
,
err
error
)
{
func
(
s
*
refundTm
)
Submit
(
ctx
context
.
Context
,
req
RefundSubmitReq
)
(
res
*
CommonRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
SubmitReturnGoodLogistics4Distribution
(
&
link
.
SubmitReturnGoodLogistics4DistributionRequest
{
result
,
err
:=
client
.
SubmitReturnGoodLogistics4Distribution
(
&
link
.
SubmitReturnGoodLogistics4DistributionRequest
{
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
req
.
DisputeId
)),
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
req
.
DisputeId
)),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
LogisticsNo
:
tea
.
String
(
req
.
LogisticsNo
),
LogisticsNo
:
tea
.
String
(
req
.
LogisticsNo
),
CpCode
:
tea
.
String
(
req
.
CpCode
),
CpCode
:
tea
.
String
(
req
.
CpCode
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"SubmitReturnGoodLogistics4Distribution"
)
log
(
ctx
,
gjson
.
New
(
req
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
//Cancel 取消退款申请接口
//Cancel 取消退款申请接口
func
(
s
*
refundTm
)
Cancel
(
ctx
context
.
Context
,
UserId
,
subLmOrderId
,
disputeId
string
)
(
res
*
RefundCancelRes
,
err
error
)
{
func
(
s
*
refundTm
)
Cancel
(
ctx
context
.
Context
,
UserId
,
subLmOrderId
,
disputeId
string
)
(
res
*
RefundCancelRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
CancelRefund4Distribution
(
&
link
.
CancelRefund4DistributionRequest
{
result
,
err
:=
client
.
CancelRefund4Distribution
(
&
link
.
CancelRefund4DistributionRequest
{
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
disputeId
)),
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
disputeId
)),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
subLmOrderId
),
SubDistributionOrderId
:
tea
.
String
(
subLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
disputeId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"CancelRefund4Distribution"
)
log
(
ctx
,
gjson
.
New
(
disputeId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
//Info 详情
//Info 详情
func
(
s
*
refundTm
)
Detail
(
ctx
context
.
Context
,
subOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
func
(
s
*
refundTm
)
Detail
(
ctx
context
.
Context
,
subOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
client
,
err
:=
initClient
()
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
client
==
nil
{
if
client
==
nil
{
return
return
}
}
result
,
err
:=
client
.
QueryRefundApplicationDetail4Distribution
(
&
link
.
QueryRefundApplicationDetail4DistributionRequest
{
result
,
err
:=
client
.
QueryRefundApplicationDetail4Distribution
(
&
link
.
QueryRefundApplicationDetail4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
subOrderId
),
SubDistributionOrderId
:
tea
.
String
(
subOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
})
if
result
==
nil
{
if
result
==
nil
{
return
return
}
}
log
(
ctx
,
gjson
.
New
(
subOrderId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryRefundApplicationDetail4Distribution"
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
log
(
ctx
,
gjson
.
New
(
subOrderId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
return
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论