Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
L
library
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
stbz
library
Commits
a8e7146c
提交
a8e7146c
authored
11月 04, 2025
作者:
张立波
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
89db6f35
b2eb2041
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
660 行增加
和
138 行删除
+660
-138
message.go
notify/message.go
+6
-2
hcw.go
upstream/hcw/hcw.go
+2
-6
hcw_callback.go
upstream/hcw/hcw_callback.go
+7
-20
hcw_goods.go
upstream/hcw/hcw_goods.go
+7
-3
hcw_order.go
upstream/hcw/hcw_order.go
+32
-23
hcw_refund.go
upstream/hcw/hcw_refund.go
+74
-9
syh.go
upstream/syh/syh.go
+257
-0
wd_order.go
upstream/wangdian/wd_order.go
+77
-5
wd_refund.go
upstream/wangdian/wd_refund.go
+10
-4
wdt_order.go
upstream/wangdiantong/wdt_order.go
+14
-9
wdt_refund.go
upstream/wangdiantong/wdt_refund.go
+127
-11
yonghui_order.go
upstream/yonghui/yonghui_order.go
+47
-46
没有找到文件。
notify/message.go
浏览文件 @
a8e7146c
...
@@ -30,6 +30,10 @@ const (
...
@@ -30,6 +30,10 @@ const (
MsgGoodsUpdateTopic
=
"goodsUpdate"
MsgGoodsUpdateTopic
=
"goodsUpdate"
//云仓单独处理消息
//云仓单独处理消息
MsgGoodsCloudTopic
=
"messageGoodsCloud"
MsgGoodsCloudTopic
=
"messageGoodsCloud"
//慧聪网消息回调
HcwCallBackMsg
=
"hcwCallBackMsg"
//消息类型
//消息类型
//商品消息
//商品消息
...
...
upstream/hcw/hcw.go
浏览文件 @
a8e7146c
...
@@ -41,10 +41,6 @@ func New(req *Config) *HcwClient {
...
@@ -41,10 +41,6 @@ func New(req *Config) *HcwClient {
return
hcwClient
return
hcwClient
}
}
//const (
// secretKey = "b828a6aa972bcbe5e1e52ce4f24c467f" // 必须32字节
//)
type
EncryptedResponse
struct
{
type
EncryptedResponse
struct
{
Data
[]
byte
`json:"data"`
Data
[]
byte
`json:"data"`
Timestamp
int64
`json:"timestamp"`
Timestamp
int64
`json:"timestamp"`
...
@@ -65,7 +61,7 @@ func (s *HcwClient) EncryptWithSignature(data interface{}) (string, error) {
...
@@ -65,7 +61,7 @@ func (s *HcwClient) EncryptWithSignature(data interface{}) (string, error) {
signatureString
:=
string
(
jsonData
)
+
strconv
.
FormatInt
(
timestamp
,
10
)
signatureString
:=
string
(
jsonData
)
+
strconv
.
FormatInt
(
timestamp
,
10
)
// 计算HMAC-SHA256签名
// 计算HMAC-SHA256签名
signature
:=
calculateHMAC
([]
byte
(
s
.
Config
.
SecretKey
),
signatureString
)
signature
:=
calculateHMAC
([]
byte
(
s
.
Config
.
AppId
),
signatureString
)
// 构建加密数据结构
// 构建加密数据结构
encryptedData
:=
&
EncryptedResponse
{
encryptedData
:=
&
EncryptedResponse
{
...
@@ -81,7 +77,7 @@ func (s *HcwClient) EncryptWithSignature(data interface{}) (string, error) {
...
@@ -81,7 +77,7 @@ func (s *HcwClient) EncryptWithSignature(data interface{}) (string, error) {
}
}
// AES加密
// AES加密
block
,
err
:=
aes
.
NewCipher
([]
byte
(
s
.
Config
.
SecretKey
))
block
,
err
:=
aes
.
NewCipher
([]
byte
(
s
.
Config
.
AppId
))
if
err
!=
nil
{
if
err
!=
nil
{
return
""
,
fmt
.
Errorf
(
"创建加密器失败: %v"
,
err
)
return
""
,
fmt
.
Errorf
(
"创建加密器失败: %v"
,
err
)
}
}
...
...
upstream/hcw/hcw_callback.go
浏览文件 @
a8e7146c
...
@@ -7,24 +7,10 @@ import (
...
@@ -7,24 +7,10 @@ import (
"github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/util/gconv"
)
)
//notify_id string 唯一请求ID(用于幂等校验)示例:20240320140000_123456
//app_id string 平台分配的应用ID
//type string 业务类型标识,见下表
//data object 业务数据对象
//signature string 请求签名(验证方法见第四章)
type
OrderNotifyRes
struct
{
NotifyId
string
`json:"notify_id"`
AppId
string
`json:"app_id"`
Type
string
`json:"type"`
Data
OrderNotifyData
`json:"data"`
Signature
string
`json:"signature"`
}
// order_shipped 订单发货 { "order_no":"P123"}
// order_shipped 订单发货 { "order_no":"P123"}
// refund_result 发起售后成功 { "order_no":100.00}
// refund_result 发起售后成功 { "order_no":100.00}
// product_status 产品状态变更(1上架2下架) { "product_no":"SKU123"}
// product_status 产品状态变更(1上架2下架) { "product_no":"SKU123"}
type
OrderNotify
Data
struct
{
type
OrderNotify
Res
struct
{
OrderNo
string
`json:"order_no"`
OrderNo
string
`json:"order_no"`
ProductNo
string
`json:"product_no"`
ProductNo
string
`json:"product_no"`
RefundNo
string
`json:"refund_no"`
RefundNo
string
`json:"refund_no"`
...
@@ -42,15 +28,16 @@ func (s *HcwClient) CallBack(r *ghttp.Request) (res *OrderNotifyRes, err error)
...
@@ -42,15 +28,16 @@ func (s *HcwClient) CallBack(r *ghttp.Request) (res *OrderNotifyRes, err error)
if
nil
!=
err
{
if
nil
!=
err
{
return
return
}
}
err
=
s
.
CheckSign
(
res
)
signature
:=
r
.
GetHeader
(
"signature"
)
err
=
s
.
CheckSign
(
signature
,
res
)
return
return
}
}
func
(
s
*
HcwClient
)
CheckSign
(
req
*
OrderNotifyRes
)
(
err
error
)
{
func
(
s
*
HcwClient
)
CheckSign
(
signature
string
,
req
*
OrderNotifyRes
)
(
err
error
)
{
reqMap
:=
gconv
.
Map
(
req
.
Data
)
reqMap
:=
gconv
.
Map
(
req
)
signature
,
err
:=
s
.
EncryptWithSignature
(
reqMap
)
signature
Str
,
err
:=
s
.
EncryptWithSignature
(
reqMap
)
if
req
.
Signature
!=
signature
{
if
signature
!=
signatureStr
{
err
=
errors
.
New
(
"incorrect signature"
)
err
=
errors
.
New
(
"incorrect signature"
)
}
}
...
...
upstream/hcw/hcw_goods.go
浏览文件 @
a8e7146c
...
@@ -9,6 +9,10 @@ type GoodsListReq struct {
...
@@ -9,6 +9,10 @@ type GoodsListReq struct {
Page
string
`json:"page"`
//页数
Page
string
`json:"page"`
//页数
PageSize
string
`json:"page_size"`
//条数
PageSize
string
`json:"page_size"`
//条数
Source
string
`json:"source"`
//商品来源
Source
string
`json:"source"`
//商品来源
Name
string
`json:"name"`
//商品名称(支持模糊查询)
Status
string
`json:"status"`
//商品状态(1上架2下架)
ProductNo
string
`json:"product_no"`
//商品编码
Model
string
`json:"model"`
//商品型号(支持模糊查询)
}
}
type
GoodsListRes
struct
{
type
GoodsListRes
struct
{
...
...
upstream/hcw/hcw_order.go
浏览文件 @
a8e7146c
...
@@ -16,16 +16,16 @@ type OrderCreateReq struct {
...
@@ -16,16 +16,16 @@ type OrderCreateReq struct {
OrderRemark
string
`json:"order_remark"`
OrderRemark
string
`json:"order_remark"`
Source
string
`json:"source"`
Source
string
`json:"source"`
Address
*
OrderAddress
`json:"address"`
Address
*
OrderAddress
`json:"address"`
Goods
*
OrderGoods
`json:"goods
"`
Product
*
OrderGoods
`json:"product
"`
}
}
type
OrderGoods
struct
{
type
OrderGoods
struct
{
SpuNo
string
`json:"
goods
_no"`
//商品ID
SpuNo
string
`json:"
product
_no"`
//商品ID
Num
int
`json:"
goods
_num"`
//商品购买数量
Num
int
`json:"
product
_num"`
//商品购买数量
BuyPrice
int
`json:"
goods
_buy_price"`
//商品购买价格
BuyPrice
int
`json:"
product
_buy_price"`
//商品购买价格
PayPrice
string
`json:"
goods
_pay_price"`
//商品支付价格
PayPrice
string
`json:"
product
_pay_price"`
//商品支付价格
GoodsPrice
int
`json:"
goods
_price"`
//商品单价
GoodsPrice
int
`json:"
product
_price"`
//商品单价
SkuNo
string
`json:"
goods
_sku_no"`
//商品sku
SkuNo
string
`json:"
product
_sku_no"`
//商品sku
}
}
type
OrderAddress
struct
{
type
OrderAddress
struct
{
...
@@ -44,7 +44,7 @@ type OrderAddress struct {
...
@@ -44,7 +44,7 @@ type OrderAddress struct {
type
OrderGoodsDetailList
struct
{
type
OrderGoodsDetailList
struct
{
Id
int
`json:"id"`
Id
int
`json:"id"`
GoodsOrderSn
string
`json:"
goods
_order_sn"`
GoodsOrderSn
string
`json:"
product
_order_sn"`
GoodsId
int
`json:"goods_id"`
GoodsId
int
`json:"goods_id"`
Total
int
`json:"total"`
Total
int
`json:"total"`
CreatedTime
int
`json:"created_time"`
CreatedTime
int
`json:"created_time"`
...
@@ -142,24 +142,24 @@ type OrderDetailRes struct {
...
@@ -142,24 +142,24 @@ type OrderDetailRes struct {
CreatedAt
string
`json:"created_at"`
CreatedAt
string
`json:"created_at"`
UpdatedAt
string
`json:"updated_at"`
UpdatedAt
string
`json:"updated_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
Order
Goods
struct
{
Order
Product
struct
{
OrderGoodsId
int
`json:"order_goods_
id"`
Id
int
`json:"
id"`
OrderSn
string
`json:"order_sn"`
OrderSn
string
`json:"order_sn"`
PlatOrderSn
interface
{}
`json:"plat_order_sn"`
PlatOrderSn
interface
{}
`json:"plat_order_sn"`
SupplyType
string
`json:"supply_type"`
SupplyType
string
`json:"supply_type"`
GoodsCode
string
`json:"
goods
_code"`
GoodsCode
string
`json:"
product
_code"`
GoodsName
string
`json:"
goods
_name"`
GoodsName
string
`json:"
product
_name"`
GoodsNum
int
`json:"
goods
_num"`
GoodsNum
int
`json:"
product
_num"`
GoodsPrice
string
`json:"
goods
_price"`
GoodsPrice
string
`json:"
product
_price"`
GoodsBuyPrice
string
`json:"
goods
_buy_price"`
GoodsBuyPrice
string
`json:"
product
_buy_price"`
GoodsPayPrice
string
`json:"
goods
_pay_price"`
GoodsPayPrice
string
`json:"
product
_pay_price"`
GoodsSkuName
string
`json:"
goods
_sku_name"`
GoodsSkuName
string
`json:"
product
_sku_name"`
GoodsSkuNo
string
`json:"
goods
_sku_no"`
GoodsSkuNo
string
`json:"
product
_sku_no"`
GoodsImage
string
`json:"
goods
_image"`
GoodsImage
string
`json:"
product
_image"`
CreatedAt
string
`json:"created_at"`
CreatedAt
string
`json:"created_at"`
UpdatedAt
string
`json:"updated_at"`
UpdatedAt
string
`json:"updated_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
}
`json:"order_
goods
"`
}
`json:"order_
product
"`
OrderAddress
struct
{
OrderAddress
struct
{
OrderAddressId
int
`json:"order_address_id"`
OrderAddressId
int
`json:"order_address_id"`
OrderSn
string
`json:"order_sn"`
OrderSn
string
`json:"order_sn"`
...
@@ -178,13 +178,21 @@ type OrderDetailRes struct {
...
@@ -178,13 +178,21 @@ type OrderDetailRes struct {
UpdatedAt
string
`json:"updated_at"`
UpdatedAt
string
`json:"updated_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
}
`json:"order_address"`
}
`json:"order_address"`
OrderLogistics
interface
{}
`json:"order_logistics"`
OrderLogistics
struct
{
OrderLogisticsId
int
`json:"order_logistics_id"`
OrderSn
string
`json:"order_sn"`
LogisticsCompany
string
`json:"logistics_company"`
LogisticsNo
string
`json:"logistics_no"`
LogisticsCode
string
`json:"logistics_code"`
DeliveredTime
string
`json:"delivered_time"`
DeliveredRemark
string
`json:"delivered_remark"`
}
`json:"order_logistics"`
}
`json:"data"`
}
`json:"data"`
}
}
func
(
s
*
HcwClient
)
OrderDetail
(
ctx
context
.
Context
,
orderSn
string
)
(
res
*
OrderDetailRes
,
err
error
)
{
func
(
s
*
HcwClient
)
OrderDetail
(
ctx
context
.
Context
,
orderSn
string
)
(
res
*
OrderDetailRes
,
err
error
)
{
var
method
=
"/api/v1/order/"
+
orderSn
var
method
=
"/api/v1/order/"
+
orderSn
result
,
err
:=
s
.
get
(
ctx
,
method
,
g
.
Map
{})
result
,
err
:=
s
.
get
(
ctx
,
method
,
g
.
Map
{
"order_sn"
:
orderSn
})
if
nil
!=
err
{
if
nil
!=
err
{
return
return
}
}
...
@@ -193,13 +201,14 @@ func (s *HcwClient) OrderDetail(ctx context.Context, orderSn string) (res *Order
...
@@ -193,13 +201,14 @@ func (s *HcwClient) OrderDetail(ctx context.Context, orderSn string) (res *Order
}
}
type
OrderCheckReq
struct
{
type
OrderCheckReq
struct
{
GoodsNo
string
`json:"
goods
_no"`
GoodsNo
string
`json:"
product
_no"`
SkuNo
string
`json:"sku_no"`
SkuNo
string
`json:"sku_no"`
BuyNum
string
`json:"buy_num"`
BuyNum
string
`json:"buy_num"`
Source
string
`json:"source"`
Source
string
`json:"source"`
ProvinceID
string
`json:"province_id"`
ProvinceID
string
`json:"province_id"`
CityID
string
`json:"city_id"`
CityID
string
`json:"city_id"`
AreaID
string
`json:"area_id"`
AreaID
string
`json:"area_id"`
Price
int64
`json:"price"`
}
}
type
OrderCheckRes
struct
{
type
OrderCheckRes
struct
{
...
...
upstream/hcw/hcw_refund.go
浏览文件 @
a8e7146c
...
@@ -16,12 +16,16 @@ type RefundCreateReq struct {
...
@@ -16,12 +16,16 @@ type RefundCreateReq struct {
RefundVoucher
[]
string
`json:"refund_voucher"`
RefundVoucher
[]
string
`json:"refund_voucher"`
RefundPrice
int
`json:"refund_price"`
RefundPrice
int
`json:"refund_price"`
RefundGoods
struct
{
RefundGoods
struct
{
OrderGoodsCode
string
`json:"order_goods_code"`
OrderGoodsCode
string
`json:"order_product_no"`
RefundGoodsNum
int
`json:"refund_goods_num"`
RefundGoodsNum
int
`json:"refund_product_num"`
}
`json:"refund_goods"`
}
`json:"refund_product"`
Source
string
`json:"source"`
}
}
type
RefundCreateRes
struct
{
type
RefundCreateRes
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
interface
{}
`json:"data"`
}
}
func
(
s
*
HcwClient
)
OrderRefundCreate
(
ctx
context
.
Context
,
req
*
RefundCreateReq
)
(
res
*
RefundCreateRes
,
err
error
)
{
func
(
s
*
HcwClient
)
OrderRefundCreate
(
ctx
context
.
Context
,
req
*
RefundCreateReq
)
(
res
*
RefundCreateRes
,
err
error
)
{
...
@@ -34,17 +38,78 @@ func (s *HcwClient) OrderRefundCreate(ctx context.Context, req *RefundCreateReq)
...
@@ -34,17 +38,78 @@ func (s *HcwClient) OrderRefundCreate(ctx context.Context, req *RefundCreateReq)
return
return
}
}
type
RefundDetailReq
struct
{
type
OrderRefundDetailReq
struct
{
RefundNo
string
`json:"refundNo"`
//条数
Source
string
`json:"source"`
//商品来源
}
type
OrderRefundDetailRes
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Data
struct
{
RefundId
int
`json:"refund_id"`
OrderSn
string
`json:"order_sn"`
RefundOrderNo
string
`json:"refund_order_no"`
ThirdRefundOrderNo
string
`json:"third_refund_order_no"`
RefundPrice
int
`json:"refund_price"`
RefundApplyTime
string
`json:"refund_apply_time"`
RefundFinishTime
interface
{}
`json:"refund_finish_time"`
RefundType
int
`json:"refund_type"`
RefundStatus
int
`json:"refund_status"`
RefundAuditStatus
int
`json:"refund_audit_status"`
RefundFailMsg
interface
{}
`json:"refund_fail_msg"`
RefundReasonType
int
`json:"refund_reason_type"`
RefundReason
string
`json:"refund_reason"`
RefundRemark
string
`json:"refund_remark"`
RefundAddressMerchant
string
`json:"refund_address_merchant"`
FreightDeduction
string
`json:"freight_deduction"`
RefundVoucher
interface
{}
`json:"refund_voucher"`
Source
string
`json:"source"`
CreatedAt
string
`json:"created_at"`
UpdatedAt
string
`json:"updated_at"`
DeletedAt
interface
{}
`json:"deleted_at"`
OrderRefundGoods
struct
{
Id
int
`json:"id"`
OrderSn
string
`json:"order_sn"`
OrderSn
string
`json:"order_sn"`
RefundOrderNo
string
`json:"refund_order_no"`
RefundOrderNo
string
`json:"refund_order_no"`
OrderProductNo
string
`json:"order_product_no"`
RefundProductName
string
`json:"refund_product_name"`
RefundProductImage
string
`json:"refund_product_image"`
RefundProductNum
int
`json:"refund_product_num"`
RefundProductOriginalPrice
int
`json:"refund_product_original_price"`
RefundProductPrice
int
`json:"refund_product_price"`
RefundRemark
string
`json:"refund_remark"`
}
`json:"order_refund_goods"`
OrderRefundLogistics
interface
{}
`json:"order_refund_logistics"`
}
`json:"data"`
}
}
type
RefundDetailRes
struct
{
/*
*退款详情
*/
func
(
s
*
HcwClient
)
OrderRefundDetail
(
ctx
context
.
Context
,
req
*
OrderRefundDetailReq
)
(
res
*
OrderRefundDetailRes
,
err
error
)
{
var
method
=
"/api/v1/orderRefund/"
+
req
.
RefundNo
+
"/"
+
req
.
Source
result
,
err
:=
s
.
get
(
ctx
,
method
,
req
)
if
nil
!=
err
{
return
}
_
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
}
}
func
(
s
*
HcwClient
)
OrderRefundDetail
(
ctx
context
.
Context
,
req
*
RefundDetailReq
)
(
res
*
RefundDetailRes
,
err
error
)
{
type
OrderRefundDeliveryNoticeRes
struct
{
var
method
=
"/api/v1/orderRefund"
Code
int
`json:"code"`
result
,
err
:=
s
.
get
(
ctx
,
method
,
req
)
Message
string
`json:"message"`
Data
interface
{}
`json:"data"`
}
/*
*物流回传
*/
func
(
s
*
HcwClient
)
OrderRefundDeliveryNotice
(
ctx
context
.
Context
,
req
*
OrderRefundDetailReq
)
(
res
*
OrderRefundDeliveryNoticeRes
,
err
error
)
{
var
method
=
"/api/v1/orderRefund/delivery/"
+
req
.
RefundNo
+
"/"
+
req
.
Source
result
,
err
:=
s
.
post
(
ctx
,
method
,
req
)
if
nil
!=
err
{
if
nil
!=
err
{
return
return
}
}
...
...
upstream/syh/syh.go
0 → 100644
浏览文件 @
a8e7146c
package
syh
import
(
"crypto/md5"
"crypto/sha1"
"encoding/hex"
"encoding/json"
"net/url"
"regexp"
"strconv"
"strings"
"time"
"errors"
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"net/http"
"reflect"
"sort"
)
// APIResult APIResult
type
APIResult
struct
{
ID
string
`json:"id"`
Code
int
`json:"code"`
Msg
string
`json:"message"`
Data
interface
{}
`json:"data"`
}
// Config Config
type
Client
struct
{
AccessKey
string
SecretKey
string
Host
string
}
// NewConfig NewConfig
func
NewConfig
(
host
,
accessKey
,
secretKey
string
)
*
Client
{
config
:=
new
(
Client
)
config
.
AccessKey
=
accessKey
config
.
SecretKey
=
secretKey
config
.
Host
=
host
return
config
}
// API API
func
(
s
*
Client
)
API
(
method
int
,
api
string
,
queryMap
map
[
string
]
string
,
bodyMap
map
[
string
]
interface
{})
(
result
*
APIResult
,
err
error
)
{
header
:=
signV2
{}
header
.
AppKey
=
s
.
AccessKey
header
.
TimeStamp
=
uint64
(
time
.
Now
()
.
UnixNano
()
/
1e6
)
header
.
Nonce
=
strconv
.
Itoa
(
int
(
time
.
Now
()
.
UnixNano
()))
sign
:=
s
.
Sign
(
header
,
queryMap
,
bodyMap
,
s
.
SecretKey
)
// 宜供优品
header
.
Sign
=
sign
var
response
*
ghttp
.
ClientResponse
switch
method
{
case
2
:
response
,
err
=
g
.
Client
()
.
SetHeaderMap
(
s
.
toMap
(
header
))
.
ContentJson
()
.
Post
(
s
.
Host
+
api
,
bodyMap
)
if
nil
!=
err
{
return
}
case
1
:
queryString
:=
"?"
i
:=
0
for
k
,
v
:=
range
queryMap
{
if
0
!=
i
{
queryString
+=
"&"
}
queryString
+=
k
+
"="
+
url
.
QueryEscape
(
v
)
i
++
}
response
,
err
=
g
.
Client
()
.
ContentJson
()
.
SetHeaderMap
(
s
.
toMap
(
header
))
.
Get
(
s
.
Host
+
api
+
queryString
,
bodyMap
)
if
nil
!=
err
{
return
}
}
result
=
new
(
APIResult
)
err
=
json
.
Unmarshal
(
response
.
ReadAll
(),
result
)
response
.
Close
()
return
}
// Sign 签名
func
(
s
*
Client
)
Sign
(
params
signV2
,
queryMaps
map
[
string
]
string
,
bodyMaps
map
[
string
]
interface
{},
secretKey
string
)
string
{
bodyBytes
,
err
:=
json
.
Marshal
(
bodyMaps
)
if
nil
!=
err
{
return
""
}
body
:=
string
(
bodyBytes
)
// if len(bodyMaps) == 0 {
// body = ""
// }
return
s
.
createSignV2
(
params
,
queryMaps
,
body
,
secretKey
)
}
type
signV2
struct
{
AppKey
string
`header:"Api-App-Key"`
TimeStamp
uint64
`header:"Api-Time-Stamp"`
Nonce
string
`header:"Api-Nonce"`
Sign
string
`header:"Api-Sign"`
}
func
(
s
*
Client
)
toMap
(
req
signV2
)
(
maps
map
[
string
]
string
)
{
maps
=
make
(
map
[
string
]
string
)
rtype
:=
reflect
.
TypeOf
(
req
)
rvalue
:=
reflect
.
ValueOf
(
&
req
)
for
i
:=
0
;
i
<
rtype
.
NumField
();
i
++
{
field
:=
rtype
.
Field
(
i
)
// field.Type.Kind()
switch
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
type
)
{
case
string
:
maps
[
field
.
Tag
.
Get
(
"header"
)]
=
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
string
)
case
uint64
:
maps
[
field
.
Tag
.
Get
(
"header"
)]
=
strconv
.
FormatUint
(
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
uint64
),
10
)
}
}
return
}
func
(
s
*
Client
)
toParamsMap
(
req
signV2
)
(
maps
map
[
string
]
string
)
{
maps
=
make
(
map
[
string
]
string
)
rtype
:=
reflect
.
TypeOf
(
req
)
rvalue
:=
reflect
.
ValueOf
(
&
req
)
for
i
:=
0
;
i
<
rtype
.
NumField
();
i
++
{
field
:=
rtype
.
Field
(
i
)
// field.Type.Kind()
if
field
.
Name
==
"Sign"
{
continue
}
switch
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
type
)
{
case
string
:
maps
[
field
.
Tag
.
Get
(
"header"
)]
=
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
string
)
case
uint64
:
maps
[
field
.
Tag
.
Get
(
"header"
)]
=
strconv
.
FormatUint
(
rvalue
.
Elem
()
.
Field
(
i
)
.
Interface
()
.
(
uint64
),
10
)
}
}
return
}
func
(
s
*
Client
)
getSignv2Params
(
header
http
.
Header
)
(
params
signV2
,
err
error
)
{
rtype
:=
reflect
.
TypeOf
(
params
)
rvalue
:=
reflect
.
ValueOf
(
&
params
)
for
i
:=
0
;
i
<
rtype
.
NumField
();
i
++
{
field
:=
rtype
.
Field
(
i
)
headerTag
:=
field
.
Tag
.
Get
(
"header"
)
headerValue
:=
header
.
Get
(
headerTag
)
if
""
==
headerValue
{
err
=
errors
.
New
(
"必须传递 "
+
headerTag
)
return
}
switch
field
.
Type
.
Kind
()
.
String
()
{
case
"string"
:
rvalue
.
Elem
()
.
Field
(
i
)
.
Set
(
reflect
.
ValueOf
(
headerValue
))
case
"uint64"
:
headerIntValue
,
err2
:=
strconv
.
ParseUint
(
headerValue
,
10
,
64
)
if
nil
!=
err2
{
fmt
.
Println
(
err2
)
err
=
errors
.
New
(
"必须传递 合法的 "
+
headerTag
)
return
}
rvalue
.
Elem
()
.
Field
(
i
)
.
Set
(
reflect
.
ValueOf
(
headerIntValue
))
}
}
// queryParams := c.QueryParams()
// for k, _ := range queryParams {
// params[k] = queryParams.Get(k)
// }
// params["Api-App-Key"] = appKey
// params["Api-Time-Stamp"] = timestamp
// params["Api-Nonce"] = nonce
// params["Api-Sign"] = sign
// timestampInt, err := strconv.Atoi(timestamp)
// if nil != err {
// code = code.UnKnow()
// return
// }
// cstSh, _ := time.LoadLocation("Asia/Shanghai")
// currentTime := int(time.Now().In(cstSh).UnixNano() / 1e6)
// if nil != err || timestampInt > currentTime || timestampInt+600000 < currentTime {
// // code = code.SignErr("签名过期或时间还未到")
// // return
// }
// code = code.Success()
return
}
// 生成签名
func
(
s
*
Client
)
createSignV2
(
params
signV2
,
queryMaps
map
[
string
]
string
,
body
string
,
secretKey
string
)
(
sign
string
)
{
allMaps
:=
make
(
map
[
string
]
string
)
for
k
,
v
:=
range
queryMaps
{
allMaps
[
k
]
=
v
}
for
k
,
v
:=
range
s
.
toParamsMap
(
params
)
{
allMaps
[
k
]
=
v
}
keys
:=
make
([]
string
,
0
)
for
k
:=
range
allMaps
{
keys
=
append
(
keys
,
k
)
}
sort
.
Strings
(
keys
)
paramsString
:=
""
for
_
,
k
:=
range
keys
{
paramsString
+=
k
+
allMaps
[
k
]
}
re3
,
_
:=
regexp
.
Compile
(
`\s`
)
body
=
re3
.
ReplaceAllString
(
body
,
""
)
paramsString
+=
secretKey
+
body
sha1
:=
sha1
.
New
()
sha1
.
Write
([]
byte
(
paramsString
))
sha1String
:=
hex
.
EncodeToString
(
sha1
.
Sum
([]
byte
(
""
)))
md5
:=
md5
.
New
()
md5
.
Write
([]
byte
(
sha1String
))
md5String
:=
hex
.
EncodeToString
(
md5
.
Sum
([]
byte
(
""
)))
sign
=
strings
.
ToUpper
(
md5String
)
// fmt.Println("参与签名计算的参数:" + paramsString)
// fmt.Println("sha1结果:" + sha1String)
// fmt.Println("md5结果:" + md5String)
// fmt.Println("签名结果:" + sign)
return
}
upstream/wangdian/wd_order.go
浏览文件 @
a8e7146c
...
@@ -74,7 +74,8 @@ type TradePushRes struct {
...
@@ -74,7 +74,8 @@ type TradePushRes struct {
ChgCount
int
`json:"chg_count"`
ChgCount
int
`json:"chg_count"`
}
}
/**
/*
*
创建原始订单
创建原始订单
*/
*/
func
(
s
*
order
)
TradePush
(
ctx
context
.
Context
,
req
*
TradePushReq
)
(
res
*
TradePushRes
,
err
error
)
{
func
(
s
*
order
)
TradePush
(
ctx
context
.
Context
,
req
*
TradePushReq
)
(
res
*
TradePushRes
,
err
error
)
{
...
@@ -246,7 +247,8 @@ type TradeQueryRes struct {
...
@@ -246,7 +247,8 @@ type TradeQueryRes struct {
}
`json:"stockout_list"`
}
`json:"stockout_list"`
}
}
/**
/*
*
查询销售出库单
查询销售出库单
*/
*/
func
(
s
*
order
)
TradeQuery
(
ctx
context
.
Context
,
req
*
TradeQueryReq
)
(
res
*
TradeQueryRes
,
err
error
)
{
func
(
s
*
order
)
TradeQuery
(
ctx
context
.
Context
,
req
*
TradeQueryReq
)
(
res
*
TradeQueryRes
,
err
error
)
{
...
@@ -423,7 +425,8 @@ type SalesTradeQueryRes struct {
...
@@ -423,7 +425,8 @@ type SalesTradeQueryRes struct {
}
`json:"trades"`
}
`json:"trades"`
}
}
/**
/*
*
查询订单管理
查询订单管理
*/
*/
func
(
s
*
order
)
SalesTradeQuery
(
ctx
context
.
Context
,
req
*
SalesTradeQueryReq
)
(
res
*
SalesTradeQueryRes
,
err
error
)
{
func
(
s
*
order
)
SalesTradeQuery
(
ctx
context
.
Context
,
req
*
SalesTradeQueryReq
)
(
res
*
SalesTradeQueryRes
,
err
error
)
{
...
@@ -526,7 +529,8 @@ type SalesApiTradeQueryRes struct {
...
@@ -526,7 +529,8 @@ type SalesApiTradeQueryRes struct {
}
`json:"trade_list"`
}
`json:"trade_list"`
}
}
/**
/*
*
查询原始订单
查询原始订单
*/
*/
func
(
s
*
order
)
SalesApiTradeQuery
(
ctx
context
.
Context
,
req
*
SalesApiTradeQueryReq
)
(
res
*
SalesApiTradeQueryRes
,
err
error
)
{
func
(
s
*
order
)
SalesApiTradeQuery
(
ctx
context
.
Context
,
req
*
SalesApiTradeQueryReq
)
(
res
*
SalesApiTradeQueryRes
,
err
error
)
{
...
@@ -568,7 +572,8 @@ type LogisticsMultiQueryRes struct {
...
@@ -568,7 +572,8 @@ type LogisticsMultiQueryRes struct {
}
`json:"logistics_multi_list"`
}
`json:"logistics_multi_list"`
}
}
/**
/*
*
查询多物流单号
查询多物流单号
*/
*/
func
(
s
*
order
)
LogisticsMultiQuery
(
ctx
context
.
Context
,
req
*
LogisticsMultiQueryReq
)
(
res
*
LogisticsMultiQueryRes
,
err
error
)
{
func
(
s
*
order
)
LogisticsMultiQuery
(
ctx
context
.
Context
,
req
*
LogisticsMultiQueryReq
)
(
res
*
LogisticsMultiQueryRes
,
err
error
)
{
...
@@ -580,3 +585,70 @@ func (s *order) LogisticsMultiQuery(ctx context.Context, req *LogisticsMultiQuer
...
@@ -580,3 +585,70 @@ func (s *order) LogisticsMultiQuery(ctx context.Context, req *LogisticsMultiQuer
err
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
err
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
return
}
}
type
LogisticsSyncQueryReq
struct
{
Limit
int
`json:"limit"`
// 获取条数 100
ShopNo
string
`json:"shop_no"`
//店铺编号
}
type
LogisticsSyncQueryRes
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
*
order
)
LogisticsSyncQuery
(
ctx
context
.
Context
,
req
*
LogisticsSyncQueryReq
)
(
res
*
LogisticsSyncQueryRes
,
err
error
)
{
result
,
err
:=
post
(
ctx
,
"/openapi2/logistics_sync_query.php"
,
req
)
if
nil
!=
err
{
return
}
err
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
}
type
LogisticsSyncAckReq
struct
{
RecId
string
`json:"rec_id"`
Status
string
`json:"status"`
Message
string
`json:"message"`
}
type
LogisticsSyncAckRes
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
Errors
[]
struct
{
RecId
string
`json:"rec_id"`
Error
string
`json:"error"`
}
`json:"errors"`
}
/*
物流同步回写
*/
func
(
s
*
order
)
LogisticsSyncAck
(
ctx
context
.
Context
,
req
[]
*
LogisticsSyncAckReq
)
(
res
*
LogisticsSyncAckRes
,
err
error
)
{
result
,
err
:=
post
(
ctx
,
"/openapi2/logistics_sync_ack.php"
,
req
)
if
nil
!=
err
{
return
}
err
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
}
upstream/wangdian/wd_refund.go
浏览文件 @
a8e7146c
...
@@ -24,6 +24,8 @@ type SalesRefundPushReq struct {
...
@@ -24,6 +24,8 @@ type SalesRefundPushReq struct {
Reason
string
`json:"reason"`
Reason
string
`json:"reason"`
Desc
string
`json:"desc"`
Desc
string
`json:"desc"`
RefundVersion
string
`json:"refund_version"`
RefundVersion
string
`json:"refund_version"`
LogisticsNo
string
`json:"logistics_no"`
LogisticsName
string
`json:"logistics_name"`
OrderList
[]
*
RefundOrderList
`json:"order_list"`
OrderList
[]
*
RefundOrderList
`json:"order_list"`
}
}
...
@@ -39,7 +41,8 @@ type SalesRefundPushRes struct {
...
@@ -39,7 +41,8 @@ type SalesRefundPushRes struct {
NewCount
int
`json:"new_count"`
NewCount
int
`json:"new_count"`
}
}
/**
/*
*
创建原始退款单
创建原始退款单
*/
*/
func
(
s
*
orderRefund
)
SalesRefundPush
(
ctx
context
.
Context
,
req
*
SalesRefundPushReq
)
(
res
*
SalesRefundPushRes
,
err
error
)
{
func
(
s
*
orderRefund
)
SalesRefundPush
(
ctx
context
.
Context
,
req
*
SalesRefundPushReq
)
(
res
*
SalesRefundPushRes
,
err
error
)
{
...
@@ -214,7 +217,8 @@ type RefundQueryRes struct {
...
@@ -214,7 +217,8 @@ type RefundQueryRes struct {
}
`json:"refunds"`
}
`json:"refunds"`
}
}
/**
/*
*
查询退换管理
查询退换管理
*/
*/
func
(
s
*
orderRefund
)
RefundQuery
(
ctx
context
.
Context
,
req
*
RefundQueryReq
)
(
res
*
RefundQueryRes
,
err
error
)
{
func
(
s
*
orderRefund
)
RefundQuery
(
ctx
context
.
Context
,
req
*
RefundQueryReq
)
(
res
*
RefundQueryRes
,
err
error
)
{
...
@@ -256,7 +260,8 @@ type StockRefundLogisticsQueryRes struct {
...
@@ -256,7 +260,8 @@ type StockRefundLogisticsQueryRes struct {
}
`json:"trades"`
}
`json:"trades"`
}
}
/**
/*
*
查询退货物流单号
查询退货物流单号
*/
*/
func
(
s
*
orderRefund
)
StockRefundLogisticsQuery
(
ctx
context
.
Context
,
req
*
StockRefundLogisticsQueryReq
)
(
res
*
StockRefundLogisticsQueryRes
,
err
error
)
{
func
(
s
*
orderRefund
)
StockRefundLogisticsQuery
(
ctx
context
.
Context
,
req
*
StockRefundLogisticsQueryReq
)
(
res
*
StockRefundLogisticsQueryRes
,
err
error
)
{
...
@@ -287,7 +292,8 @@ type StockinRefundPushRes struct {
...
@@ -287,7 +292,8 @@ type StockinRefundPushRes struct {
Message
string
`json:"message"`
Message
string
`json:"message"`
}
}
/**
/*
*
创建退货入库单
创建退货入库单
*/
*/
func
(
s
*
orderRefund
)
StockinRefundPush
(
ctx
context
.
Context
,
req
*
StockinRefundPushReq
)
(
res
*
StockinRefundPushRes
,
err
error
)
{
func
(
s
*
orderRefund
)
StockinRefundPush
(
ctx
context
.
Context
,
req
*
StockinRefundPushReq
)
(
res
*
StockinRefundPushRes
,
err
error
)
{
...
...
upstream/wangdiantong/wdt_order.go
浏览文件 @
a8e7146c
...
@@ -3,6 +3,7 @@ package wangdiantong
...
@@ -3,6 +3,7 @@ package wangdiantong
import
(
import
(
"context"
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
)
type
OrderList
struct
{
type
OrderList
struct
{
...
@@ -590,17 +591,17 @@ type LogisticsSyncQueryRes struct {
...
@@ -590,17 +591,17 @@ type LogisticsSyncQueryRes struct {
Code
int
`json:"code"`
Code
int
`json:"code"`
Message
string
`json:"message"`
Message
string
`json:"message"`
Trades
[]
struct
{
Trades
[]
struct
{
RecId
string
`json:"rec_id"`
RecId
int
`json:"rec_id"`
ShopNo
string
`json:"shop_no"`
ShopNo
string
`json:"shop_no"`
Tid
string
`json:"tid"`
Tid
string
`json:"tid"`
LogisticsType
string
`json:"logistics_type"`
LogisticsType
int
`json:"logistics_type"`
LogisticsNo
string
`json:"logistics_no"`
LogisticsNo
string
`json:"logistics_no"`
DeliveryTerm
string
`json:"delivery_term"`
DeliveryTerm
int
`json:"delivery_term"`
ConsignTime
string
`json:"consign_time"`
ConsignTime
string
`json:"consign_time"`
Oids
string
`json:"oids"`
Oids
string
`json:"oids"`
IsPartSync
string
`json:"is_part_sync"`
IsPartSync
string
`json:"is_part_sync"`
PlatformId
string
`json:"platform_id"`
PlatformId
int
`json:"platform_id"`
TradeId
string
`json:"trade_id"`
TradeId
int
`json:"trade_id"`
LogisticsNameErp
string
`json:"logistics_name_erp"`
LogisticsNameErp
string
`json:"logistics_name_erp"`
LogisticsCodeErp
string
`json:"logistics_code_erp"`
LogisticsCodeErp
string
`json:"logistics_code_erp"`
LogisticsName
string
`json:"logistics_name"`
LogisticsName
string
`json:"logistics_name"`
...
@@ -621,8 +622,8 @@ func (s *WangDianTong) LogisticsSyncQuery(ctx context.Context, req *LogisticsSyn
...
@@ -621,8 +622,8 @@ func (s *WangDianTong) LogisticsSyncQuery(ctx context.Context, req *LogisticsSyn
}
}
type
LogisticsSyncAckReq
struct
{
type
LogisticsSyncAckReq
struct
{
RecId
string
`json:"rec_id"`
RecId
int
`json:"rec_id"`
Status
string
`json:"status"`
Status
int
`json:"status"`
Message
string
`json:"message"`
Message
string
`json:"message"`
}
}
...
@@ -630,7 +631,7 @@ type LogisticsSyncAckRes struct {
...
@@ -630,7 +631,7 @@ type LogisticsSyncAckRes struct {
Code
int
`json:"code"`
Code
int
`json:"code"`
Message
string
`json:"message"`
Message
string
`json:"message"`
Errors
[]
struct
{
Errors
[]
struct
{
RecId
string
`json:"rec_id"`
RecId
int
`json:"rec_id"`
Error
string
`json:"error"`
Error
string
`json:"error"`
}
`json:"errors"`
}
`json:"errors"`
}
}
...
@@ -640,7 +641,11 @@ type LogisticsSyncAckRes struct {
...
@@ -640,7 +641,11 @@ type LogisticsSyncAckRes struct {
*/
*/
func
(
s
*
WangDianTong
)
LogisticsSyncAck
(
ctx
context
.
Context
,
req
[]
*
LogisticsSyncAckReq
)
(
res
*
LogisticsSyncAckRes
,
err
error
)
{
func
(
s
*
WangDianTong
)
LogisticsSyncAck
(
ctx
context
.
Context
,
req
[]
*
LogisticsSyncAckReq
)
(
res
*
LogisticsSyncAckRes
,
err
error
)
{
result
,
err
:=
s
.
post
(
ctx
,
"/openapi2/logistics_sync_ack.php"
,
req
)
jsonStr
:=
gjson
.
New
(
req
)
paramas
:=
g
.
Map
{
"logistics_list"
:
jsonStr
.
MustToJsonString
(),
}
result
,
err
:=
s
.
post
(
ctx
,
"/openapi2/logistics_sync_ack.php"
,
paramas
)
if
nil
!=
err
{
if
nil
!=
err
{
return
return
}
}
...
...
upstream/wangdiantong/wdt_refund.go
浏览文件 @
a8e7146c
...
@@ -3,6 +3,7 @@ package wangdiantong
...
@@ -3,6 +3,7 @@ package wangdiantong
import
(
import
(
"context"
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
jsoniter
"github.com/json-iterator/go"
jsoniter
"github.com/json-iterator/go"
)
)
...
@@ -19,6 +20,8 @@ type SalesRefundPushReq struct {
...
@@ -19,6 +20,8 @@ type SalesRefundPushReq struct {
Reason
string
`json:"reason"`
Reason
string
`json:"reason"`
Desc
string
`json:"desc"`
Desc
string
`json:"desc"`
RefundVersion
string
`json:"refund_version"`
RefundVersion
string
`json:"refund_version"`
LogisticsNo
string
`json:"logistics_no"`
LogisticsName
string
`json:"logistics_name"`
OrderList
[]
*
RefundOrderList
`json:"order_list"`
OrderList
[]
*
RefundOrderList
`json:"order_list"`
}
}
...
@@ -271,13 +274,18 @@ type StockinRefundPushReq struct {
...
@@ -271,13 +274,18 @@ type StockinRefundPushReq struct {
RefundNo
string
`json:"refund_no"`
RefundNo
string
`json:"refund_no"`
OuterNo
string
`json:"outer_no"`
OuterNo
string
`json:"outer_no"`
WarehouseNo
string
`json:"warehouse_no"`
WarehouseNo
string
`json:"warehouse_no"`
Remark
string
`json:"remark"`
IsCheck
int
`json:"is_check"`
LogisticsNo
string
`json:"logistics_no"`
LogisticsCode
string
`json:"logistics_code"`
LogisticsCode
string
`json:"logistics_code"`
DetailList
[]
struct
{
DetailList
[]
*
StockinDetailList
`json:"detail_list"`
}
type
StockinDetailList
struct
{
SpecNo
string
`json:"spec_no"`
SpecNo
string
`json:"spec_no"`
StockinNum
int
`json:"stockin_num"`
StockinNum
int
`json:"stockin_num"`
BatchNo
string
`json:"batch_no"`
BatchNo
string
`json:"batch_no"`
StockinPrice
float64
`json:"stockin_price"`
StockinPrice
string
`json:"stockin_price"`
}
`json:"detail_list"`
}
}
type
StockinRefundPushRes
struct
{
type
StockinRefundPushRes
struct
{
...
@@ -291,7 +299,115 @@ type StockinRefundPushRes struct {
...
@@ -291,7 +299,115 @@ type StockinRefundPushRes struct {
*/
*/
func
(
s
*
WangDianTong
)
StockinRefundPush
(
ctx
context
.
Context
,
req
*
StockinRefundPushReq
)
(
res
*
StockinRefundPushRes
,
err
error
)
{
func
(
s
*
WangDianTong
)
StockinRefundPush
(
ctx
context
.
Context
,
req
*
StockinRefundPushReq
)
(
res
*
StockinRefundPushRes
,
err
error
)
{
result
,
err
:=
s
.
post
(
ctx
,
"/openapi2/stockin_refund_push.php"
,
req
)
jsonStr
:=
gjson
.
New
(
req
)
paramas
:=
g
.
Map
{
"stockin_refund_info"
:
jsonStr
.
MustToJsonString
(),
}
result
,
err
:=
s
.
post
(
ctx
,
"/openapi2/stockin_refund_push.php"
,
paramas
)
if
nil
!=
err
{
return
}
err
=
gjson
.
New
(
result
)
.
Scan
(
&
res
)
return
}
type
StockinRefundQueryReq
struct
{
StartTime
string
`json:"start_time"`
EndTime
string
`json:"end_time"`
PageSize
string
`json:"page_size"`
PageNo
string
`json:"page_no"`
ShopNo
string
`json:"shop_no"`
TimeType
string
`json:"time_type"`
SrcOrderNo
string
`json:"src_order_no"`
StockinNo
string
`json:"stockin_no"`
WarehouseNo
string
`json:"warehouse_no"`
}
type
StockinRefundQueryRes
struct
{
Code
int
`json:"code"`
Message
string
`json:"message"`
TotalCount
int
`json:"total_count"`
StockinList
[]
struct
{
Status
string
`json:"status"`
StockinId
string
`json:"stockin_id"`
OrderNo
string
`json:"order_no"`
WarehouseNo
string
`json:"warehouse_no"`
WarehouseName
string
`json:"warehouse_name"`
StockinTime
string
`json:"stockin_time"`
CreatedTime
string
`json:"created_time"`
OrderType
string
`json:"order_type"`
GoodsAmount
string
`json:"goods_amount"`
TotalPrice
string
`json:"total_price"`
AdjustPrice
string
`json:"adjust_price"`
RightPrice
string
`json:"right_price"`
Discount
string
`json:"discount"`
TaxAmount
string
`json:"tax_amount"`
PostFee
string
`json:"post_fee"`
OtherFee
string
`json:"other_fee"`
Remark
string
`json:"remark"`
LogisticsType
string
`json:"logistics_type"`
CheckTime
string
`json:"check_time"`
SrcOrderNo
string
`json:"src_order_no"`
GoodsCount
string
`json:"goods_count"`
LogisticsName
string
`json:"logistics_name"`
LogisticsCode
string
`json:"logistics_code"`
LogisticsNo
string
`json:"logistics_no"`
ActualRefundAmount
string
`json:"actual_refund_amount"`
RefundNo
string
`json:"refund_no"`
ProcessStatus
string
`json:"process_status"`
CustomerNo
string
`json:"customer_no"`
CustomerName
string
`json:"customer_name"`
NickName
string
`json:"nick_name"`
ShopName
string
`json:"shop_name"`
ShopNo
string
`json:"shop_no"`
ShopRemark
string
`json:"shop_remark"`
FlagName
string
`json:"flag_name"`
TradeNo
string
`json:"trade_no"`
TradeType
string
`json:"trade_type"`
StockinReason
string
`json:"stockin_reason"`
PlatformId
string
`json:"platform_id"`
OrderTypeName
string
`json:"order_type_name"`
DetailsList
[]
struct
{
StockinId
string
`json:"stockin_id"`
GoodsCount
string
`json:"goods_count"`
Discount
string
`json:"discount"`
CostPrice
string
`json:"cost_price"`
ProductionDate
string
`json:"production_date"`
ValidityDays
string
`json:"validity_days"`
ExpireDate
string
`json:"expire_date"`
SrcPrice
string
`json:"src_price"`
TaxPrice
string
`json:"tax_price"`
TaxAmount
string
`json:"tax_amount"`
Tax
string
`json:"tax"`
TotalCost
string
`json:"total_cost"`
Remark
string
`json:"remark"`
AdjustNum
string
`json:"adjust_num"`
AdjustPrice
string
`json:"adjust_price"`
RightNum
string
`json:"right_num"`
RightPrice
string
`json:"right_price"`
RightCost
string
`json:"right_cost"`
RecId
string
`json:"rec_id"`
SrcOrderDetailId
string
`json:"src_order_detail_id"`
GoodsName
string
`json:"goods_name"`
GoodsNo
string
`json:"goods_no"`
SpecNo
string
`json:"spec_no"`
Prop2
string
`json:"prop2"`
SpecName
string
`json:"spec_name"`
SpecCode
string
`json:"spec_code"`
BrandNo
string
`json:"brand_no"`
BrandName
string
`json:"brand_name"`
GoodsUnit
string
`json:"goods_unit"`
BatchNo
string
`json:"batch_no"`
}
`json:"details_list"`
}
`json:"stockin_list"`
}
/*
*查询出库单
*/
func
(
s
*
WangDianTong
)
StockinRefundQuery
(
ctx
context
.
Context
,
req
*
StockinRefundQueryReq
)
(
res
*
StockinRefundQueryRes
,
err
error
)
{
result
,
err
:=
s
.
post
(
ctx
,
"/openapi2/stockin_order_query_refund.php"
,
req
)
if
nil
!=
err
{
if
nil
!=
err
{
return
return
}
}
...
...
upstream/yonghui/yonghui_order.go
浏览文件 @
a8e7146c
...
@@ -45,7 +45,8 @@ type OrderCreateRes struct {
...
@@ -45,7 +45,8 @@ type OrderCreateRes struct {
Data
interface
{}
`json:"data"`
Data
interface
{}
`json:"data"`
}
}
/**
/*
*
创建订单
创建订单
*/
*/
func
(
s
*
order
)
Create
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
func
(
s
*
order
)
Create
(
ctx
context
.
Context
,
req
*
OrderCreateReq
)
(
res
*
OrderCreateRes
,
err
error
)
{
...
@@ -71,7 +72,8 @@ type OrderConfirmRes struct {
...
@@ -71,7 +72,8 @@ type OrderConfirmRes struct {
Data
string
`json:"data"`
Data
string
`json:"data"`
}
}
/**
/*
*
确认订单
确认订单
*/
*/
func
(
s
*
order
)
Confirm
(
ctx
context
.
Context
,
req
*
OrderConfirmReq
)
(
res
*
OrderConfirmRes
,
err
error
)
{
func
(
s
*
order
)
Confirm
(
ctx
context
.
Context
,
req
*
OrderConfirmReq
)
(
res
*
OrderConfirmRes
,
err
error
)
{
...
@@ -106,54 +108,48 @@ type OrderDetailRes struct {
...
@@ -106,54 +108,48 @@ type OrderDetailRes struct {
ReceiverAddress
string
`json:"receiverAddress"`
ReceiverAddress
string
`json:"receiverAddress"`
ReceiverName
string
`json:"receiverName"`
ReceiverName
string
`json:"receiverName"`
ReceiverPhone
string
`json:"receiverPhone"`
ReceiverPhone
string
`json:"receiverPhone"`
ShipTime
string
`json:"shipTime"`
UserName
string
`json:"userName"`
UserName
string
`json:"userName"`
UserTelephone
string
`json:"userTelephone"`
UserTelephone
string
`json:"userTelephone"`
OrderType
int
`json:"orderType"`
PushType
string
`json:"pushType"`
ShipTime
string
`json:"shipTime"`
GoodsDetails
[]
struct
{
GoodsDetails
[]
struct
{
ClassCode
string
`json:"classCode"`
ClassCode
string
`json:"classCode"`
ClassName
string
`json:"className"`
ClassName
string
`json:"className"`
GoodsCode
string
`json:"goodsCode"`
GoodsCode
string
`json:"goodsCode"`
GoodsQty
int
`json:"goodsQty"`
GoodsQty
string
`json:"goodsQty"`
GoodsImage
string
`json:"goodsImage"`
GoodsImage
string
`json:"goodsImage"`
GoodsName
string
`json:"goodsName"`
GoodsName
string
`json:"goodsName"`
GoodsPrice
int
`json:"goodsPrice"`
GoodsPrice
string
`json:"goodsPrice"`
GoodsSpec
string
`json:"goodsSpec"`
GoodsSpec
string
`json:"goodsSpec"`
GoodsUnit
string
`json:"goodsUnit"`
GoodsUnit
string
`json:"goodsUnit"`
NetPrice
float64
`json:"netPrice"`
NetPrice
string
`json:"netPrice"`
TaxPrice
int
`json:"taxPrice"`
TaxPrice
string
`json:"taxPrice"`
TaxRate
int
`json:"taxRate"`
TaxRate
int
`json:"taxRate"`
TotalPrice
int
`json:"totalPrice"`
TotalPrice
string
`json:"totalPrice"`
}
`json:"goodsDetails"`
}
`json:"goodsDetails"`
PayDetails
[]
struct
{
PayAmount
int
`json:"payAmount"`
PayCode
string
`json:"payCode"`
PayType
string
`json:"payType"`
}
`json:"payDetails"`
SubOrderDetails
[]
struct
{
SubOrderDetails
[]
struct
{
CsxSubOrderCode
string
`json:"csxS
ubOrderCode"`
SubOrderCode
string
`json:"s
ubOrderCode"`
OrderStatus
string
`json:"o
rderStatus"`
SubOrderStatus
string
`json:"subO
rderStatus"`
GoodsDetails
[]
struct
{
SubGoodsDetails
[]
struct
{
ClassCode
string
`json:"classCode"`
ClassCode
string
`json:"classCode"`
ClassName
string
`json:"className"`
ClassName
string
`json:"className"`
GoodsCode
string
`json:"goodsCode"`
GoodsCode
string
`json:"goodsCode"`
GoodsQty
int
`json:"goodsQty"`
GoodsQty
string
`json:"goodsQty"`
GoodsImage
string
`json:"goodsImage"`
GoodsImage
string
`json:"goodsImage"`
GoodsName
string
`json:"goodsName"`
GoodsName
string
`json:"goodsName"`
GoodsPrice
float64
`json:"goodsPrice"`
GoodsPrice
string
`json:"goodsPrice"`
GoodsSpec
string
`json:"goodsSpec"`
GoodsSpec
string
`json:"goodsSpec"`
GoodsUnit
string
`json:"goodsUnit"`
GoodsUnit
string
`json:"goodsUnit"`
NetPrice
float64
`json:"netPrice"`
NetPrice
string
`json:"netPrice"`
TaxPrice
float64
`json:"taxPrice"`
TaxPrice
string
`json:"taxPrice"`
TaxRate
int
`json:"taxRate"`
TaxRate
int
`json:"taxRate"`
TotalPrice
float64
`json:"totalPrice"`
TotalPrice
string
`json:"totalPrice"`
}
`json:"
g
oodsDetails"`
}
`json:"
subG
oodsDetails"`
}
`json:"subOrderDetails"`
}
`json:"subOrderDetails"`
}
`json:"data"`
}
`json:"data"`
}
}
/**
/*
*
订单详情
订单详情
*/
*/
func
(
s
*
order
)
Detail
(
ctx
context
.
Context
,
req
*
OrderDetailReq
)
(
res
*
OrderDetailRes
,
err
error
)
{
func
(
s
*
order
)
Detail
(
ctx
context
.
Context
,
req
*
OrderDetailReq
)
(
res
*
OrderDetailRes
,
err
error
)
{
...
@@ -177,7 +173,8 @@ type OrderQueryRes struct {
...
@@ -177,7 +173,8 @@ type OrderQueryRes struct {
Data
int64
`json:"data"`
Data
int64
`json:"data"`
}
}
/**
/*
*
反查订单
反查订单
*/
*/
func
(
s
*
order
)
Query
(
ctx
context
.
Context
,
req
*
OrderQueryReq
)
(
res
*
OrderQueryRes
,
err
error
)
{
func
(
s
*
order
)
Query
(
ctx
context
.
Context
,
req
*
OrderQueryReq
)
(
res
*
OrderQueryRes
,
err
error
)
{
...
@@ -202,7 +199,8 @@ type OrderReceiveRes struct {
...
@@ -202,7 +199,8 @@ type OrderReceiveRes struct {
Data
interface
{}
`json:"data"`
Data
interface
{}
`json:"data"`
}
}
/**
/*
*
签收订单
签收订单
*/
*/
func
(
s
*
order
)
Receive
(
ctx
context
.
Context
,
req
*
OrderReceiveReq
)
(
res
*
OrderReceiveRes
,
err
error
)
{
func
(
s
*
order
)
Receive
(
ctx
context
.
Context
,
req
*
OrderReceiveReq
)
(
res
*
OrderReceiveRes
,
err
error
)
{
...
@@ -236,7 +234,8 @@ type OrderCancelRes struct {
...
@@ -236,7 +234,8 @@ type OrderCancelRes struct {
}
`json:"data"`
}
`json:"data"`
}
}
/**
/*
*
取消订单
取消订单
*/
*/
func
(
s
*
order
)
Cancel
(
ctx
context
.
Context
,
req
*
OrderCancelReq
)
(
res
*
OrderCancelRes
,
err
error
)
{
func
(
s
*
order
)
Cancel
(
ctx
context
.
Context
,
req
*
OrderCancelReq
)
(
res
*
OrderCancelRes
,
err
error
)
{
...
@@ -285,7 +284,8 @@ type OrderLogisticsRes struct {
...
@@ -285,7 +284,8 @@ type OrderLogisticsRes struct {
}
`json:"data"`
}
`json:"data"`
}
}
/**
/*
*
查询物流
查询物流
*/
*/
func
(
s
*
order
)
Logistics
(
ctx
context
.
Context
,
req
*
OrderLogisticsReq
)
(
res
*
OrderLogisticsRes
,
err
error
)
{
func
(
s
*
order
)
Logistics
(
ctx
context
.
Context
,
req
*
OrderLogisticsReq
)
(
res
*
OrderLogisticsRes
,
err
error
)
{
...
@@ -342,7 +342,8 @@ type OrderFreightRes struct {
...
@@ -342,7 +342,8 @@ type OrderFreightRes struct {
}
`json:"data"`
}
`json:"data"`
}
}
/**
/*
*
订单运费
订单运费
*/
*/
func
(
s
*
order
)
Freight
(
ctx
context
.
Context
,
req
*
OrderFreightReq
)
(
res
*
OrderFreightRes
,
err
error
)
{
func
(
s
*
order
)
Freight
(
ctx
context
.
Context
,
req
*
OrderFreightReq
)
(
res
*
OrderFreightRes
,
err
error
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论