1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
package wangdian
import (
"context"
"github.com/gogf/gf/encoding/gjson"
jsoniter "github.com/json-iterator/go"
)
var OrderRefund = new(orderRefund)
type orderRefund struct {
}
type SalesRefundPushReq struct {
Tid string `json:"tid"`
ShopNo string `json:"shop_no"`
PlatformId int `json:"platform_id"`
RefundNo int `json:"refund_no"`
Type int `json:"type"`
Status string `json:"status"`
RefundFee float64 `json:"refund_fee"`
BuyerNick string `json:"buyer_nick"`
RefundTime string `json:"refund_time"`
Reason string `json:"reason"`
Desc string `json:"desc"`
RefundVersion string `json:"refund_version"`
OrderList []*RefundOrderList `json:"order_list"`
}
type RefundOrderList struct {
Oid string `json:"oid"`
Num int `json:"num"`
}
type SalesRefundPushRes struct {
Code int `json:"code"`
Message string `json:"message"`
}
/**
创建原始退款单
*/
func (s *orderRefund) SalesRefundPush(ctx context.Context, req *SalesRefundPushReq) (res *SalesRefundPushRes, err error) {
params := make(map[string]interface{})
json, _ := jsoniter.MarshalToString(req)
params["api_refund_list"] = json
result, err := post(ctx, "/openapi2/sales_refund_push.php", params)
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
return
}
type RefundQueryReq struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
PageSize string `json:"page_size"`
PageNo string `json:"page_no"`
Tid string `json:"tid"`
LogisticsNo string `json:"logistics_no"`
SrcRefundNo string `json:"src_refund_no"`
RefundNo string `json:"refund_no"`
}
type RefundQueryRes struct {
Code int `json:"code"`
Message string `json:"message"`
TotalCount string `json:"total_count"`
Refunds []struct {
RefundId string `json:"refund_id"`
RefundNo string `json:"refund_no"`
Created string `json:"created"`
SrcNo string `json:"src_no"`
Type string `json:"type"`
ProcessStatus string `json:"process_status"`
SwapTradeId string `json:"swap_trade_id"`
Status string `json:"status"`
PayAccount string `json:"pay_account"`
PayNo string `json:"pay_no"`
GoodsAmount string `json:"goods_amount"`
RefundAmount string `json:"refund_amount"`
GuaranteeMode string `json:"guarantee_mode"`
CsStatus string `json:"cs_status"`
SalesTid string `json:"sales_tid"`
PostAmount string `json:"post_amount"`
OtherAmount string `json:"other_amount"`
Paid string `json:"paid"`
Tid string `json:"tid"`
SalesTradeId string `json:"sales_trade_id"`
BuyerNick string `json:"buyer_nick"`
ReceiverName string `json:"receiver_name"`
ReceiverAddress string `json:"receiver_address"`
ReceiverTelno string `json:"receiver_telno"`
ReturnName string `json:"return_name"`
ReturnMobile string `json:"return_mobile"`
ReturnTelno string `json:"return_telno"`
ExchangeAmount string `json:"exchange_amount"`
ReturnAddress string `json:"return_address"`
SwapReceiver string `json:"swap_receiver"`
SwapMobile string `json:"swap_mobile"`
SwapTelno string `json:"swap_telno"`
SwapProvince string `json:"swap_province"`
SwapCity string `json:"swap_city"`
SwapDistrict string `json:"swap_district"`
SwapArea string `json:"swap_area"`
SwapAddress string `json:"swap_address"`
RefundTime string `json:"refund_time"`
Remark string `json:"remark"`
Modified string `json:"modified"`
ActualRefundAmount string `json:"actual_refund_amount"`
GuaranteRefundAmount string `json:"guarante_refund_amount"`
OuterNo string `json:"outer_no"`
ReturnLogisticsName string `json:"return_logistics_name"`
ReturnLogisticsNo string `json:"return_logistics_no"`
DirectRefundAmount string `json:"direct_refund_amount"`
FinishTime string `json:"finish_time"`
ShopNo string `json:"shop_no"`
ShopName string `json:"shop_name"`
PlatformId string `json:"platform_id"`
ApiOuterNo string `json:"api_outer_no"`
CustomerNo string `json:"customer_no"`
CustomerName string `json:"customer_name"`
SwapZip interface{} `json:"swap_zip"`
SwapLogisticsType string `json:"swap_logistics_type"`
SwapLogisticsName string `json:"swap_logistics_name"`
WarehouseNo string `json:"warehouse_no"`
CreatorName string `json:"creator_name"`
SwapWarehouseNo string `json:"swap_warehouse_no"`
RefundReason string `json:"refund_reason"`
SwapTradeNo string `json:"swap_trade_no"`
RefundOrderList []struct {
OrderId string `json:"order_id"`
RefundId string `json:"refund_id"`
Oid string `json:"oid"`
Tid string `json:"tid"`
ProcessStatus string `json:"process_status"`
OrderNum string `json:"order_num"`
CostPrice string `json:"cost_price"`
Price string `json:"price"`
OriginalPrice string `json:"original_price"`
Discount string `json:"discount"`
Paid string `json:"paid"`
RefundNum string `json:"refund_num"`
TotalAmount string `json:"total_amount"`
RefundOrderAmount string `json:"refund_order_amount"`
SpecNo string `json:"spec_no"`
SpecId string `json:"spec_id"`
GoodsName string `json:"goods_name"`
SpecName string `json:"spec_name"`
SuiteNo string `json:"suite_no"`
SuiteName string `json:"suite_name"`
SuiteNum string `json:"suite_num"`
StockinNum string `json:"stockin_num"`
Remark string `json:"remark"`
MarketPrice string `json:"market_price"`
SpecCode string `json:"spec_code"`
IsSnEnable string `json:"is_sn_enable"`
GoodsNo string `json:"goods_no"`
SalesTid string `json:"sales_tid"`
} `json:"refund_order_list"`
} `json:"refunds"`
}
/**
查询退换管理
*/
func (s *orderRefund) RefundQuery(ctx context.Context, req *RefundQueryReq) (res *RefundQueryRes, err error) {
result, err := post(ctx, "/openapi2/refund_query.php", req)
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
return
}
type StockRefundLogisticsQueryReq struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
PageSize string `json:"page_size"`
PageNo string `json:"page_no"`
LogisticsNo string `json:"logistics_no"`
}
type StockRefundLogisticsQueryRes struct {
Code int `json:"code"`
Message string `json:"message"`
Trades []struct {
RecId string `json:"rec_id"`
ShopNo string `json:"shop_no"`
Tid string `json:"tid"`
LogisticsType string `json:"logistics_type"`
LogisticsNo string `json:"logistics_no"`
DeliveryTerm string `json:"delivery_term"`
ConsignTime string `json:"consign_time"`
Oids string `json:"oids"`
IsPartSync string `json:"is_part_sync"`
PlatformId string `json:"platform_id"`
TradeId string `json:"trade_id"`
LogisticsNameErp string `json:"logistics_name_erp"`
LogisticsCodeErp string `json:"logistics_code_erp"`
LogisticsName string `json:"logistics_name"`
} `json:"trades"`
}
/**
查询退货物流单号
*/
func (s *orderRefund) StockRefundLogisticsQuery(ctx context.Context, req *StockRefundLogisticsQueryReq) (res *StockRefundLogisticsQueryRes, err error) {
result, err := post(ctx, "/openapi2/stock_refund_logistics_query.php", req)
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
return
}
type StockinRefundPushReq struct {
RefundNo string `json:"refund_no"`
OuterNo string `json:"outer_no"`
WarehouseNo string `json:"warehouse_no"`
LogisticsCode string `json:"logistics_code"`
DetailList []struct {
SpecNo string `json:"spec_no"`
StockinNum int `json:"stockin_num"`
BatchNo string `json:"batch_no"`
StockinPrice float64 `json:"stockin_price"`
} `json:"detail_list"`
}
type StockinRefundPushRes struct {
Code int `json:"code"`
Message string `json:"message"`
}
/**
创建退货入库单
*/
func (s *orderRefund) StockinRefundPush(ctx context.Context, req *StockinRefundPushReq) (res *StockinRefundPushRes, err error) {
result, err := post(ctx, "/openapi2/stockin_refund_push.php", req)
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
return
}