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 {
var
Goods
=
goodsTmNew
{}
//type QueryItemDetailWithDivisionReq struct {
// ItemId string `json:"ItemId"`
// //SkuIdList []string `json:"SkuIdList"`
//}
type
QueryItemDetailWithDivisionRes
struct
{
Code
string
`json:"Code"`
Message
string
`json:"Message"`
...
...
@@ -88,7 +84,7 @@ type QueryItemDetailWithDivisionRes struct {
}
`json:"Model"`
RequestID
string
`json:"RequestId"`
Success
bool
`json:"Success"`
}
}
type
ListDistributionItemReq
struct
{
Page
string
`json:"page"`
...
...
@@ -190,50 +186,49 @@ type QueryItemGuIDeRetailPriceRes struct {
Code
string
`json:"Code"`
Success
bool
`json:"Success"`
}
//区域库存商品详情
func
(
s
*
goodsTmNew
)
QueryItemDetailWithDivision
(
ctx
context
.
Context
,
addr
string
,
item
string
)
(
res
*
QueryItemDetailWithDivisionRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
func
(
s
*
goodsTmNew
)
QueryItemDetailWithDivision
(
ctx
context
.
Context
,
addr
string
,
item
string
)
(
res
*
QueryItemDetailWithDivisionRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
QueryItemDetailWithDivision
(
&
link
.
QueryItemDetailWithDivisionRequest
{
result
,
err
:=
client
.
QueryItemDetailWithDivision
(
&
link
.
QueryItemDetailWithDivisionRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
LmItemId
:
tea
.
String
(
item
),
DivisionCode
:
tea
.
String
(
addr
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
if
result
==
nil
{
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
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
}
return
}
////商品列表
func
(
s
*
goodsTmNew
)
ListDistributionItem
(
ctx
context
.
Context
,
item
*
ListDistributionItemReq
)
(
res
*
ListDistributionItemRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
func
(
s
*
goodsTmNew
)
ListDistributionItem
(
ctx
context
.
Context
,
item
*
ListDistributionItemReq
)
(
res
*
ListDistributionItemRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
ListDistributionItemWithoutCache
(
&
link
.
ListDistributionItemWithoutCacheRequest
{
result
,
err
:=
client
.
ListDistributionItemWithoutCache
(
&
link
.
ListDistributionItemWithoutCacheRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
//LmItemId: tea.String(item),
...
...
@@ -241,52 +236,53 @@ func (s *goodsTmNew) ListDistributionItem(ctx context.Context,item *ListDistribu
PageNumber
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Page
)),
PageSize
:
tea
.
Int32
(
gconv
.
Int32
(
item
.
Limit
)),
})
if
result
==
nil
{
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"ListDistributionItem"
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
}
return
}
//查询零售价
func
(
s
*
goodsTmNew
)
QueryItemGuIDeRetailPrice
(
ctx
context
.
Context
,
item
[]
string
)
(
res
*
QueryItemGuIDeRetailPriceRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
func
(
s
*
goodsTmNew
)
QueryItemGuIDeRetailPrice
(
ctx
context
.
Context
,
item
[]
string
)
(
res
*
QueryItemGuIDeRetailPriceRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
QueryItemGuideRetailPrice
(
&
link
.
QueryItemGuideRetailPriceRequest
{
result
,
err
:=
client
.
QueryItemGuideRetailPrice
(
&
link
.
QueryItemGuideRetailPriceRequest
{
DistributionMallId
:
tea
.
String
(
server
.
DistributionMallId
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
LmItemIds
:
tea
.
StringSlice
(
item
),
})
if
result
==
nil
{
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryItemGuideRetailPrice"
)
log
(
ctx
,
gjson
.
New
(
item
)
.
MustToJsonString
(),
result
.
Body
,
err
)
if
err
!=
nil
{
return
}
if
*
result
.
Body
.
Success
==
false
{
return
}
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
if
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
);
err
!=
nil
{
return
}
return
}
//Detail 详情 todo 该接口正确通过,由于订单部分接口不通过天猫技术不支持对接,后续有时间再自己写
//func (*goodsTmNew) QueryItemDetailWithDivision(ctx context.Context, req string) (res *QueryItemDetailWithDivisionRes, err error) {
// method := "QueryItemDetailWithDivision"
...
...
upstream/tmNew/tm_order.go
浏览文件 @
10954cbe
差异被折叠。
点击展开。
upstream/tmNew/tm_refund.go
浏览文件 @
10954cbe
...
...
@@ -26,12 +26,11 @@ type RefundCancelRes struct {
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
Success
bool
`json:"Success"`
Model
struct
{
Model
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
DisputeStatus
int
`json:"DisputeStatus"`
DisputeType
int
`json:"DisputeType"`
}
`json:"Model"`
}
type
CommonRes
struct
{
Code
string
`json:" Code"`
...
...
@@ -40,7 +39,6 @@ type CommonRes struct {
Success
bool
`json:"Success"`
}
type
RefundBeforeReq
struct
{
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
BizClaimType
int32
`json:"BizClaimType"`
...
...
@@ -96,17 +94,18 @@ type RefundApplyRes struct {
}
`json:"Model"`
}
//Before 前置
func
(
s
*
refundTm
)
Before
(
ctx
context
.
Context
,
req
*
RefundBeforeReq
)
(
res
*
RefundBeforeRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
InitApplyRefund4Distribution
(
&
link
.
InitApplyRefund4DistributionRequest
{
result
,
err
:=
client
.
InitApplyRefund4Distribution
(
&
link
.
InitApplyRefund4DistributionRequest
{
BizClaimType
:
tea
.
Int32
(
req
.
BizClaimType
),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubDistributionOrderId
),
...
...
@@ -114,34 +113,32 @@ func (s *refundTm) Before(ctx context.Context, req *RefundBeforeReq) (res *Refun
GoodsStatus
:
tea
.
Int32
(
gconv
.
Int32
(
req
.
GoodsStatus
)),
})
if
result
==
nil
{
if
result
==
nil
{
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
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
}
//Apply 申请
func
(
s
*
refundTm
)
Apply
(
ctx
context
.
Context
,
req
*
RefundApplyReq
)
(
res
*
RefundApplyRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
ApplyRefund4Distribution
(
&
link
.
ApplyRefund4DistributionRequest
{
result
,
err
:=
client
.
ApplyRefund4Distribution
(
&
link
.
ApplyRefund4DistributionRequest
{
ApplyReasonTextId
:
tea
.
Int64
(
req
.
ApplyReasonTextId
),
ApplyRefundCount
:
tea
.
Int32
(
req
.
ApplyRefundCount
),
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
),
GoodsStatus
:
tea
.
Int32
(
req
.
GoodsStatus
),
//LeaveMessage: tea.String("测试退款"),
...
...
@@ -150,14 +147,14 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
result
==
nil
{
if
result
==
nil
{
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
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
}
...
...
@@ -166,7 +163,7 @@ type RefundInfoRes struct {
Code
string
`json:"Code"`
Message
string
`json:"Message"`
RequestId
string
`json:"RequestId"`
Model
struct
{
Model
struct
{
DistributionOrderId
string
`json:"DistributionOrderId"`
SubDistributionOrderId
string
`json:"SubDistributionOrderId"`
BizClaimType
int
`json:"BizClaimType"`
...
...
@@ -198,17 +195,18 @@ type RefundInfoRes struct {
RefunderZipCode
string
`json:"RefunderZipCode"`
}
`json:"Model"`
}
//Submit 提交退货物流信息接口
func
(
s
*
refundTm
)
Submit
(
ctx
context
.
Context
,
req
RefundSubmitReq
)
(
res
*
CommonRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
SubmitReturnGoodLogistics4Distribution
(
&
link
.
SubmitReturnGoodLogistics4DistributionRequest
{
result
,
err
:=
client
.
SubmitReturnGoodLogistics4Distribution
(
&
link
.
SubmitReturnGoodLogistics4DistributionRequest
{
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
req
.
DisputeId
)),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
req
.
SubLmOrderId
),
...
...
@@ -217,65 +215,68 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
CpCode
:
tea
.
String
(
req
.
CpCode
),
})
if
result
==
nil
{
if
result
==
nil
{
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
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
}
//Cancel 取消退款申请接口
func
(
s
*
refundTm
)
Cancel
(
ctx
context
.
Context
,
UserId
,
subLmOrderId
,
disputeId
string
)
(
res
*
RefundCancelRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
CancelRefund4Distribution
(
&
link
.
CancelRefund4DistributionRequest
{
result
,
err
:=
client
.
CancelRefund4Distribution
(
&
link
.
CancelRefund4DistributionRequest
{
DisputeId
:
tea
.
Int64
(
gconv
.
Int64
(
disputeId
)),
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
subLmOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
result
==
nil
{
if
result
==
nil
{
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
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
}
//Info 详情
func
(
s
*
refundTm
)
Detail
(
ctx
context
.
Context
,
subOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
func
(
s
*
refundTm
)
Detail
(
ctx
context
.
Context
,
subOrderId
string
)
(
res
*
RefundInfoRes
,
err
error
)
{
client
,
err
:=
initClient
()
if
err
!=
nil
{
return
}
if
client
==
nil
{
if
client
==
nil
{
return
}
result
,
err
:=
client
.
QueryRefundApplicationDetail4Distribution
(
&
link
.
QueryRefundApplicationDetail4DistributionRequest
{
result
,
err
:=
client
.
QueryRefundApplicationDetail4Distribution
(
&
link
.
QueryRefundApplicationDetail4DistributionRequest
{
DistributorId
:
tea
.
String
(
server
.
DistributorId
),
SubDistributionOrderId
:
tea
.
String
(
subOrderId
),
TenantId
:
tea
.
String
(
server
.
TenantId
),
})
if
result
==
nil
{
if
result
==
nil
{
return
}
log
(
ctx
,
gjson
.
New
(
subOrderId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
ctx
=
context
.
WithValue
(
ctx
,
"URI"
,
"QueryRefundApplicationDetail4Distribution"
)
log
(
ctx
,
gjson
.
New
(
subOrderId
)
.
MustToJsonString
(),
result
.
Body
,
err
)
a
,
_
:=
json
.
Marshal
(
result
.
Body
)
err
=
json
.
Unmarshal
([]
byte
(
a
),
&
res
)
return
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论