提交 9cbfe24e authored 作者: gukai's avatar gukai

Merge remote-tracking branch 'origin/master'

## stbz/library
胜天半子内部调用库
## 地址
https://gitlab.jxhh.com/stbz/library
## 限制
golang版本 >= 1.16
## 使用方法
```golang
package main
import (
"github.com/gogf/gf/net/ghttp"
"gitlab.jxhh.com/stbz/library.git/upstream/jingdong"
)
//初始化配置【可在boot使用】
var conf *jingdong.Config
_ = g.Cfg().GetStruct("jd", &conf)
jingdong.New(conf)
//订单详情
InfoRes,err:=jingdong.Order.GetOrderInfo(ctx, "236317795961")
g.Dump(InfoRes)
g.Dump(err)
//地址解析
ParseRes, err := jingdong.Address.Parse(ctx, "四川省成都市武侯区天府四街保利星座5栋")
g.Dump(ParseRes)
g.Dump(err)
```
......@@ -15,9 +15,9 @@ type goodsJD struct {
var Goods = goodsJD{}
type CheckSaleRes struct {
*CommonRes
CommonRes
Result []struct {
SkuId int `json:"skuid"` //商品编号
SkuId int64 `json:"skuid"` //商品编号
Name string `json:"name"` //商品名称
SaleState int `json:"saleState"` //是否可售 1:是,0:否
IsCanVAT int `json:"isCanVAT"` //是否可开增票,1:支持,0:不支持
......@@ -26,21 +26,21 @@ type CheckSaleRes struct {
}
type CheckOnSaleRes struct {
*CommonRes
CommonRes
Result []struct {
Sku int `json:"sku"` //商品编号
State int `json:"state"` //1:上架,0:下架
Sku int64 `json:"sku"` //商品编号
State int `json:"state"` //1:上架,0:下架
} `json:"result"`
}
type GetStockMidRes struct {
*CommonRes
CommonRes
Result string `json:"result"`
}
type GetStockRes struct {
*CommonRes
CommonRes
Result []struct {
SkuID int `json:"skuId"` //商品编号
SkuID int64 `json:"skuId"` //商品编号
AreaID string `json:"areaId"` //入参时传入的区域码area。因京东目前是3、4级地址均支持,存在areaId在传入的3级地址后填充4级地址“_0“后返回的情况。
StockStateID int `json:"stockStateId"` //存状态编号。 参考枚举值: 33,39,40,36,34,99
StockStateDesc string `json:"StockStateDesc"` /*库存状态描述。以下为stockStateId不同时,此字段不同的返回值:
......@@ -54,22 +54,22 @@ type GetStockRes struct {
}
type CheckAreaMidRes struct {
*CommonRes
CommonRes
Result string `json:"result"`
}
type CheckAreaLimitRes struct {
*CommonRes
CommonRes
Result []struct {
SkuID int `json:"skuId"` //商品编码
IsAreaRestrict bool `json:"isAreaRestrict"` //true 代表区域受限 false 区域不受限
SkuID int64 `json:"skuId"` //商品编码
IsAreaRestrict bool `json:"isAreaRestrict"` //true 代表区域受限 false 区域不受限
} `json:"result"`
}
type GetProductsPriceRes struct {
*CommonRes
CommonRes
Result []struct {
SkuID int `json:"skuId"` //商品编码
SkuID int64 `json:"skuId"` //商品编码
Price float64 `json:"price"` //京东销售价
JdPrice float64 `json:"jdPrice"` //京东价
MarketPrice float64 `json:"marketPrice"` //京东的前台划线价
......@@ -77,7 +77,7 @@ type GetProductsPriceRes struct {
}
type GetDetailRes struct {
*CommonRes
CommonRes
Result struct {
SaleUnit string `json:"saleUnit"` //售卖单位
Weight string `json:"weight"` //重量
......@@ -85,7 +85,7 @@ type GetDetailRes struct {
WareQD string `json:"wareQD"` //包装清单
ImagePath string `json:"imagePath"` //主图
State int `json:"state"` //状态
Sku int `json:"sku"` //商品编号
Sku int64 `json:"sku"` //商品编号
BrandName string `json:"brandName"` //品牌名称
Category string `json:"category"` //分类 示例"670;729;4837"
Name string `json:"name"` //商品名称
......@@ -98,8 +98,8 @@ type GetDetailRes struct {
}
type GetCategoryRes struct {
*CommonRes //异常代码(3422:获取分类列表信息失败;3423:分类列表不存在;1003:参数值不正确;5001:服务异常,请稍后重试;)
Result struct {
CommonRes //异常代码(3422:获取分类列表信息失败;3423:分类列表不存在;1003:参数值不正确;5001:服务异常,请稍后重试;)
Result struct {
TotalRows int `json:"totalRows"`
PageNo int `json:"pageNo"`
PageSize int `json:"pageSize"`
......@@ -114,8 +114,8 @@ type GetCategoryRes struct {
}
type GetSkuImageRes struct {
*CommonRes //异常代码(0010:返回数据为空;1001:参数为空;1003:参数值不正确/sku数量过多,目前最大支持100个商品)
Result map[string][]struct {
CommonRes //异常代码(0010:返回数据为空;1001:参数为空;1003:参数值不正确/sku数量过多,目前最大支持100个商品)
Result map[string][]struct {
Id int `json:"id"` //编号
SkuId int `json:"skuId"` //商品编号
Path string `json:"path"` //图片路径
......@@ -123,14 +123,14 @@ type GetSkuImageRes struct {
}
type GetSimilarSkuRes struct {
*CommonRes
CommonRes
Result []struct {
Dim int `json:"dim"` //维度
SaleName string `json:"saleName"` //销售名称
SaleAttrList []struct { //商品销售标签 销售属性下可能只有一个标签,此种场景可以选择显示销售名称和标签,也可以不显示
ImagePath string `json:"imagePath"` //标签图片地址
SaleValue string `json:"saleValue"` //标签名称
SkuIds []int `json:"skuIds"` //当前标签下的同类商品skuId
ImagePath string `json:"imagePath"` //标签图片地址
SaleValue string `json:"saleValue"` //标签名称
SkuIds []int64 `json:"skuIds"` //当前标签下的同类商品skuId
} `json:"saleAttrList"` //
......@@ -166,7 +166,7 @@ func (*goodsJD) CheckOnSale(ctx context.Context, req *garray.Array) (res *CheckO
return
}
//GetStock 查询商品库存
// GetStock 查询商品库存
func (*goodsJD) GetStock(ctx context.Context, req []*SkuNums, area string) (res *GetStockRes, err error) {
method := "stock/getNewStockById"
param := g.Map{
......@@ -218,7 +218,7 @@ func (*goodsJD) CheckAreaLimit(ctx context.Context, skuIds *garray.Array, provin
return
}
//GetProductsPrice 查询商品价格
// GetProductsPrice 查询商品价格
func (*goodsJD) GetProductsPrice(ctx context.Context, skus *garray.Array) (res *GetProductsPriceRes, err error) {
method := "price/getSellPrice"
param := g.Map{
......@@ -233,7 +233,7 @@ func (*goodsJD) GetProductsPrice(ctx context.Context, skus *garray.Array) (res *
return
}
//GetDetail 查询商品详情
// GetDetail 查询商品详情
func (*goodsJD) GetDetail(ctx context.Context, skus interface{}) (res *GetDetailRes, err error) {
method := "product/getDetail"
param := g.Map{
......@@ -248,7 +248,7 @@ func (*goodsJD) GetDetail(ctx context.Context, skus interface{}) (res *GetDetail
return
}
//GetCategory 查询分类列表
// GetCategory 查询分类列表
func (*goodsJD) GetCategory(ctx context.Context, pageNo, pageSize interface{}) (res *GetCategoryRes, err error) {
method := "product/getCategorys"
param := g.Map{
......@@ -263,7 +263,7 @@ func (*goodsJD) GetCategory(ctx context.Context, pageNo, pageSize interface{}) (
return
}
//GetSkuImage 查询商品图片
// GetSkuImage 查询商品图片
func (*goodsJD) GetSkuImage(ctx context.Context, skus *garray.Array) (res *GetSkuImageRes, err error) {
method := "product/skuImage"
param := g.Map{
......@@ -277,7 +277,7 @@ func (*goodsJD) GetSkuImage(ctx context.Context, skus *garray.Array) (res *GetSk
return
}
//GetSimilarSku 查询同类商品
// GetSimilarSku 查询同类商品
func (*goodsJD) GetSimilarSku(ctx context.Context, skus interface{}) (res *GetSimilarSkuRes, err error) {
method := "product/getSimilarSku"
param := g.Map{
......@@ -301,7 +301,7 @@ type GetPageNumRes struct {
} `json:"result"`
}
//GetPageNum 查询商品池编号
// GetPageNum 查询商品池编号
func (*goodsJD) GetPageNum(ctx context.Context) (res *GetPageNumRes, err error) {
method := "product/getPageNum"
param := g.Map{}
......@@ -324,7 +324,7 @@ type QueryByPageRes struct {
} `json:"result"`
}
//QueryByPage 查询池内商品编号
// QueryByPage 查询池内商品编号
func (*goodsJD) QueryByPage(ctx context.Context, pageNum, pageNo, offset interface{}) (res *QueryByPageRes, err error) {
method := "product/querySkuByPage"
param := g.Map{
......@@ -425,7 +425,7 @@ type GoodsSearchRes struct {
} `json:"result"`
}
//Search 搜索商品
// Search 搜索商品
func (*goodsJD) Search(ctx context.Context, req GoodsSearchReq) (res *GoodsSearchRes, err error) {
method := "/search/search"
result, err := server.requestApi(ctx, method, gconv.Map(req))
......@@ -437,7 +437,7 @@ func (*goodsJD) Search(ctx context.Context, req GoodsSearchReq) (res *GoodsSearc
}
type GoodsBeforeReq struct {
SkuId int `json:"skuId"`
SkuId int64 `json:"skuId"`
Num int `json:"num"`
Price float64 `json:"price"`
}
......
......@@ -4,16 +4,17 @@ import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
type deliveryJD struct {
type logisticsLogic struct {
}
var Delivery = deliveryJD{}
var Logistics = logisticsLogic{}
//DeliveryDetailRes 物流轨迹
type DeliveryDetailRes struct {
*CommonRes
// LogisticsTraceRes 物流轨迹
type LogisticsTraceRes struct {
CommonRes
Result struct {
OrderTrack []struct {
Content string `json:"content"` //操作内容明细
......@@ -21,8 +22,8 @@ type DeliveryDetailRes struct {
Operator string `json:"operator"` //操作员名称
} `json:"orderTrack"`
WaybillCode []struct {
OrderID string `json:"orderId"` //订单号
ParentID string `json:"parentId"` //父订单号。 此字段为0 未拆单
OrderID int64 `json:"orderId"` //订单号
ParentID int64 `json:"parentId"` //父订单号。 此字段为0 未拆单
Carrier string `json:"carrier"` //承运商
DeliveryOrderID string `json:"deliveryOrderId"` //运单号
} `json:"waybillCode"`
......@@ -30,11 +31,11 @@ type DeliveryDetailRes struct {
} `json:"result"`
}
// Detail 物流信息
func (*deliveryJD) Detail(ctx context.Context, OrderID string) (res *DeliveryDetailRes, err error) {
// Trace 物流轨迹
func (*logisticsLogic) Trace(ctx context.Context, OrderID string) (res *LogisticsTraceRes, err error) {
method := "order/orderTrack"
param := g.Map{
"jdOrderId": OrderID,
"jdOrderId": gconv.Int64(OrderID),
"waybillCode": "1",
}
result, err := server.requestApi(ctx, method, param)
......
......@@ -4,21 +4,22 @@ import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/util/gconv"
)
type orderJD struct {
}
//Order 订单
// Order 订单
var Order = orderJD{}
//PriceSnap 商品价格
// PriceSnap 商品价格
type PriceSnap struct {
SkuID int `json:"skuId"` //商品编号
SkuID int64 `json:"skuId"` //商品编号
Price float64 `json:"price"` //商品价格 格式:21.30
}
//OrderCreateReq 下单
// OrderCreateReq 下单
type OrderCreateReq struct {
OrderSn string //订单单号
SkuNums []*SkuNums
......@@ -29,7 +30,7 @@ type OrderCreateReq struct {
InvoiceType InvoiceType
}
//PlaceOrderAddress 下单地址
// PlaceOrderAddress 下单地址
type PlaceOrderAddress struct {
Province string //一级地址编码
City string //二级地址编码
......@@ -38,7 +39,7 @@ type PlaceOrderAddress struct {
Desc string //收货人详细地址,最多100个字符
}
//OrderCreateRes 下单
// OrderCreateRes 下单
type OrderCreateRes struct {
*CommonRes
Result struct {
......@@ -50,16 +51,16 @@ type OrderCreateRes struct {
} `json:"result"`
}
//OrderSkuItem 订单商品
// OrderSkuItem 订单商品
type OrderSkuItem struct {
SkuID int `json:"skuId"` //商品编号
SkuID int64 `json:"skuId"` //商品编号
Num int `json:"num"` //商品数量
Price float64 `json:"price"` //商品单价
Name string `json:"name"` //商品名称
NakedPrice float64 `json:"nakedPrice"` //商品未税价
}
//OrderReflectRes 反查订单
// OrderReflectRes 反查订单
type OrderReflectRes struct {
*CommonRes
Result string `json:"result"` //第三方订单号(非京东订单号)
......@@ -73,7 +74,7 @@ type OrderDetailBase struct {
}
}
//OrderDetailRes 订单详情
// OrderDetailRes 订单详情
// jdOrderState 京东状态
// 1.新单 2.等待支付 3.等待支付确认 4.延迟付款确认 5.订单暂停 6.店长最终审核 7.等待打印 8.等待出库 9.等待打包 10.等待发货
// 11.自提途中 12.上门提货 13.自提退货 14.确认自提 16.等待确认收货 17.配送退货 18.货到付款确认 19.已完成 21.收款确认 22.锁定
......@@ -123,7 +124,7 @@ type OrderDetailChild struct {
} `json:"result"`
}
//OrderFreightRes 运费
// OrderFreightRes 运费
type OrderFreightRes struct {
*CommonRes
Result struct {
......@@ -133,10 +134,10 @@ type OrderFreightRes struct {
} `json:"result"`
}
//SkuNums 商品数量
// SkuNums 商品数量
type SkuNums struct {
SkuID int `json:"skuId"` //商品编号
Num int `json:"num"` //商品数量
SkuID int64 `json:"skuId"` //商品编号
Num int `json:"num"` //商品数量
}
// Create 下单
......@@ -187,11 +188,11 @@ func (*orderJD) Reflect(ctx context.Context, thirdOrder string) (res *OrderRefle
return
}
//Detail 订单详情
// Detail 订单详情
func (*orderJD) Detail(ctx context.Context, OrderID string) (res *OrderDetailRes, err error) {
method := "order/selectJdOrder"
param := g.Map{
"jdOrderId": OrderID,
"jdOrderId": gconv.Int64(OrderID),
"queryExts": "jdOrderState",
}
......@@ -229,7 +230,7 @@ func (*orderJD) Detail(ctx context.Context, OrderID string) (res *OrderDetailRes
return
}
//Freight 查询运费
// Freight 查询运费
func (*orderJD) Freight(ctx context.Context, sku []*SkuNums, province, city, county, town string) (res *OrderFreightRes, err error) {
method := "order/getFreight"
param := g.Map{
......@@ -252,7 +253,7 @@ func (*orderJD) Freight(ctx context.Context, sku []*SkuNums, province, city, cou
func (*orderJD) Confirm(ctx context.Context, OrderID string) (res *CommonRes, err error) {
method := "order/confirmReceived"
param := g.Map{
"jdOrderId": OrderID,
"jdOrderId": gconv.Int64(OrderID),
}
result, err := server.requestApi(ctx, method, param)
if err != nil {
......
......@@ -18,7 +18,7 @@ type RefundCancelRes struct {
}
type ApplyReq struct {
JdOrderId uint `json:"jdOrderId"` //京东订单号
JdOrderId int64 `json:"jdOrderId"` //京东订单号
CustomerExpect uint `json:"customerExpect"` //售后类型:退货(10)、换货(20)、维修(30)
QuestionDesc string `json:"questionDesc"` //产品问题描述,最多1000字符
IsNeedDetectionReport bool `json:"isNeedDetectionReport"` //是否需要检测报告
......@@ -56,14 +56,14 @@ type AfterSaleReturnwareDto struct {
}
type AfterSaleDetailDto struct {
Id int `json:"skuId"` //商品编号
Num uint `json:"skuNum"` //商品申请数量
Id int64 `json:"skuId"` //商品编号
Num uint `json:"skuNum"` //商品申请数量
}
type GetServiceListReq struct {
JdOrderID string `json:"jdOrderId"` //京东订单号
PageIndex int `json:"pageIndex"` //页码,1代表第一页
PageSize int `json:"pageSize"` //每页记录数, 大小取值范围[1,100]
JdOrderID int64 `json:"jdOrderId"` //京东订单号
PageIndex int `json:"pageIndex"` //页码,1代表第一页
PageSize int `json:"pageSize"` //每页记录数, 大小取值范围[1,100]
}
type RefundListRes struct {
......@@ -74,12 +74,12 @@ type RefundListRes struct {
PageNum int `json:"pageNum"` //总页数
PageIndex int `json:"pageIndex"` //当前页数
ServiceInfoList []struct {
AfsServiceId int `json:"afsServiceId"` //服务单号
AfsServiceId int64 `json:"afsServiceId"` //服务单号
CustomerExpect int `json:"customerExpect"`
CustomerExpectName string `json:"customerExpectName"`
AfsApplyTime string `json:"afsApplyTime"`
OrderId int64 `json:"orderId"`
WareId int `json:"wareId"` //商品编号
WareId int64 `json:"wareId"` //商品编号
WareName string `json:"wareName"`
AfsServiceStep int `json:"afsServiceStep"`
AfsServiceStepName string `json:"afsServiceStepName"`
......@@ -91,10 +91,10 @@ type RefundListRes struct {
type RefundDetailRes struct {
CommonRes
Result struct {
AfsServiceId int `json:"afsServiceId"` //京东售后服务单号
AfsServiceId int64 `json:"afsServiceId"` //京东售后服务单号
CustomerExpect int `json:"customerExpect"` //服务类型码:退货(10)、换货(20)、维修(20)
AfsApplyTime string `json:"afsApplyTime"` //服务单申请时间:格式为yyyy-MM-dd HH:mm:ss
OrderId int `json:"orderId"` //京东订单号
OrderId int64 `json:"orderId"` //京东订单号
IsHasInvoice int `json:"isHasInvoice"`
IsNeedDetectionReport int `json:"isNeedDetectionReport"`
IsHasPackage int `json:"isHasPackage"`
......@@ -118,7 +118,7 @@ type RefundDetailRes struct {
RefundPrice float64 `json:"refundPrice"` //退款金额
} `json:"serviceFinanceDetailInfoDTOs"` //退款明细
ServiceTrackInfoDTOs []struct {
AfsServiceId int `json:"afsServiceId"`
AfsServiceId int64 `json:"afsServiceId"`
Title string `json:"title"`
Context string `json:"context"`
CreateDate string `json:"createDate"`
......@@ -140,12 +140,12 @@ type ServiceFinanceDetailInfoDTO struct {
Status int `json:"status"` //状态
StatusName string `json:"statusName"` //状态名称
WareName string `json:"wareName"` //商品名称
WareId int `json:"wareId"` //商品编号
WareId int64 `json:"wareId"` //商品编号
}
type RefundCommonReq struct {
OrderID string `json:"jdOrderId"` //订单编号
SkuID string `json:"skuId"` //商品编号
OrderID int64 `json:"jdOrderId"` //订单编号
SkuID int64 `json:"skuId"` //商品编号
}
type RefundIsSupportRes struct {
......@@ -169,14 +169,14 @@ type RefundReturnTypeRes struct {
}
type RefundSendReq struct {
AfsServiceId string `json:"afsServiceId"`
AfsServiceId int64 `json:"afsServiceId"`
DeliverDate string `json:"deliverDate"`
ExpressCode string `json:"expressCode"`
ExpressCompany string `json:"expressCompany"`
FreightMoney int `json:"freightMoney"`
}
//Send 根据填写单号
// Send 根据填写单号
func (*refundJD) Send(ctx context.Context, req *RefundSendReq) (res *CommonRes, err error) {
method := "afterSale/updateSendSku"
param := g.Map{
......@@ -190,7 +190,7 @@ func (*refundJD) Send(ctx context.Context, req *RefundSendReq) (res *CommonRes,
return
}
//Cancel 取消售后
// Cancel 取消售后
func (*refundJD) Cancel(ctx context.Context, id interface{}) (res *RefundCancelRes, err error) {
method := "afterSale/auditCancel"
req := g.Map{
......@@ -222,12 +222,12 @@ func (*refundJD) Apply(ctx context.Context, req *ApplyReq) (res *CommonRes, err
return
}
//List 查询服务单根据客户账号和订单号分页查询服务单概要信息
// List 查询服务单根据客户账号和订单号分页查询服务单概要信息
func (*refundJD) List(ctx context.Context, OrderSn string) (res *RefundListRes, err error) {
method := "afterSale/getServiceListPage"
param := g.Map{
"param": gjson.New(&GetServiceListReq{
JdOrderID: OrderSn,
JdOrderID: gconv.Int64(OrderSn),
PageIndex: 1,
PageSize: 100,
}).MustToJsonString(),
......@@ -240,11 +240,11 @@ func (*refundJD) List(ctx context.Context, OrderSn string) (res *RefundListRes,
return
}
//Detail 根据服务单号查询服务单明细信息
// Detail 根据服务单号查询服务单明细信息
func (*refundJD) Detail(ctx context.Context, req string) (res *RefundDetailRes, err error) {
method := "afterSale/getServiceDetailInfo"
var reqJson = gjson.New("")
_ = reqJson.Set("afsServiceId", req)
_ = reqJson.Set("afsServiceId", gconv.Int64(req))
_ = reqJson.Set("appendInfoSteps", []int{1, 4, 5}) //1、代表增加获取售后地址信息; 2、代表增加获取客户发货信息; 3、代表增加获取退款明细; 4、代表增加获取跟踪信息; 5、代表增加获取允许的操作信息
param := g.Map{
......
package tm
import (
"context"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
// serviceTm 客服
type serviceTm struct {
}
var Service = serviceTm{}
type ServiceUrlRes struct {
Message string `json:"Message"`
UrlData struct {
ReturnUrl string `json:"ReturnUrl"`
} `json:"UrlData"`
Code string `json:"Code"`
}
// Url 客服链接
func (s *serviceTm) Url(ctx context.Context, SellerId, UserId interface{}) (res *ServiceUrlRes, err error) {
method := "getCustomServiceUrl"
request := map[string]string{
"BizUid": server.BizUid,
"SellerId": gconv.String(SellerId),
"AccountType": "ANONY",
"ThirdPartyUserId": gconv.String(UserId),
}
result, err := post(ctx, method, request)
_ = json.Unmarshal([]byte(result), &res)
return
}
......@@ -47,7 +47,9 @@ func (s *category) QueryMallCategoryList(ctx context.Context,item int64) (res *Q
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
return
......
......@@ -211,6 +211,9 @@ func (s *goodsTmNew) QueryItemDetailWithDivision(ctx context.Context,addr string
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
if *result.Body.Success ==false{
return
}
......@@ -238,12 +241,13 @@ 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{
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
return
......@@ -269,8 +273,10 @@ func (s *goodsTmNew) QueryItemGuIDeRetailPrice(ctx context.Context,item []string
if result==nil{
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
if *result.Body.Success ==false{
return
}
......
......@@ -55,7 +55,9 @@ func (s *logisticsTmNew) QueryLogistics4Distribution(ctx context.Context,orderSn
return
}
log(ctx,gjson.New(orderSn).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_:=json.Marshal(result.Body)
err =json.Unmarshal([]byte(a),&res)
......
......@@ -300,7 +300,9 @@ func (s *orderTm) Before(ctx context.Context,itemInfo *RenderDistributionOrderRe
}
log(ctx,gjson.New(itemInfo).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
return
......@@ -332,7 +334,9 @@ func (s *orderTm) List(ctx context.Context,item *OrderListReq) (res *OrderListRe
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
panic(err)
......@@ -367,7 +371,9 @@ func (s *orderTm) Create(ctx context.Context,item *OrderCreateReq) (res *OrderCr
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
return
......@@ -394,7 +400,9 @@ func (s *orderTm) Detail(ctx context.Context,item *OrderInfoReq) (res *OrderInfo
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
panic(err)
......@@ -422,7 +430,9 @@ func (s *orderTm) Status(ctx context.Context,item *OrderStatusReq) (res *OrderSt
return
}
log(ctx,gjson.New(item).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
panic(err)
......@@ -451,7 +461,9 @@ func (s *orderTm) AddrInfo(ctx context.Context,itemInfo *AddrInfoReq) (res *Addr
return
}
log(ctx,gjson.New(itemInfo).MustToJsonString(),result.Body,err)
if err!=nil{
return
}
a,_ :=json.Marshal(result.Body)
if err = json.Unmarshal([]byte(a), &res); err != nil {
panic(err)
......
......@@ -109,13 +109,13 @@ func GetUpstreamName(source int) string {
case Tm:
return "天猫"
case Cloud:
return "云仓"
return "生态云仓"
case Sn:
return "苏宁"
case Gome:
return "国美"
case Schl:
return "华南一仓"
return "自营云仓"
case Wpc:
return "特卖一仓"
case Ikc:
......@@ -125,7 +125,7 @@ func GetUpstreamName(source int) string {
case Itao:
return "淘宝"
case Hdh:
return "会订货"
return "跨境一仓"
case TmNew:
return "天猫精选"
case AliNew:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论