1
This commit is contained in:
@@ -129,10 +129,11 @@ func TestSgin(t *testing.T) {
|
||||
|
||||
func TestBaokuanHuodong(t *testing.T) {
|
||||
// 获取门店所有的爆款活动
|
||||
storeId := 668887
|
||||
vendorStoreId := "17056471"
|
||||
storeId := 103201
|
||||
vendorStoreId := "8694421"
|
||||
|
||||
actList, _ := api.RetailDiscountList(vendorStoreId, 56)
|
||||
actList, err := api.RetailDiscountList(vendorStoreId, 56)
|
||||
fmt.Println(err)
|
||||
if len(actList) > 0 {
|
||||
allActivitySkuIdList := make([]string, 0, 0) // 此门店全部的折扣(爆款)活动商品
|
||||
activationActivitySkuIdList := make([]*StoreSkuInfo, 0, 0) // 此门店正在进行的折扣(爆款)活动商品
|
||||
|
||||
@@ -11,3 +11,16 @@ func TestGetConnectionToken(t *testing.T) {
|
||||
}
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestGetWayBillFee(t *testing.T) {
|
||||
//order, _ := api.OrderGetOrderDetail(1100486451772280163, false)
|
||||
//globals.SugarLogger.Debugf("order:==%s", utils.Format4Output(order, false)) 2002
|
||||
api.GetWayBillFee("1100486451772280163", 2)
|
||||
api.GetWayBillFee("1100486451772280163", 1)
|
||||
}
|
||||
|
||||
// 商家没有接入众包配送,无法进行众包配送相关操作
|
||||
func TestGetShippingFeeList(t *testing.T) {
|
||||
api.GetShippingFeeList("1300486314174032613,1100487300210228389", 1)
|
||||
api.GetShippingFeeList("1300486314174032613,1100487300210228389", 2)
|
||||
}
|
||||
|
||||
53
platformapi/mtwmapi/logistics_fee.go
Normal file
53
platformapi/mtwmapi/logistics_fee.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package mtwmapi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
// GetWayBillFee 获取美团众包配送费已经保险费
|
||||
func (a *API) GetWayBillFee(orderId string, serviceBrand int) (*GetOrderLogisticsFee, error) {
|
||||
data, err := a.AccessAPI("order/logistics/pt/preview", true, map[string]interface{}{"order_id": orderId, "service_brand": serviceBrand})
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %v", err)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(data)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
type GetOrderLogisticsFeeRes struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
data string `json:"data"`
|
||||
}
|
||||
|
||||
type GetOrderLogisticsFee struct {
|
||||
WmOrderId int64 `json:"wm_order_id"` // 订单id
|
||||
ShippingFee float64 `json:"shipping_fee"` // 配送费(基础+临时)
|
||||
OriginalPrice float64 `json:"original_price"` // 订单的总原价,单位为元此字段数据为未扣减所有优惠前订单的总金额,含打包袋、配送费等。
|
||||
LogisticsStatus int64 `json:"logistics_status"` // 美团配送订单状态code
|
||||
ShippingTips string `json:"shipping_tips"` // 配送费浮动说明
|
||||
PayAmount float64 `json:"pay_amount"` // 实付金额
|
||||
Distance int `json:"distance"` // 配送距离(m)
|
||||
CouponViewId string `json:"coupon_view_id"` // 配送费优惠券id
|
||||
CouponName string `json:"coupon_name"` // 优惠券名称
|
||||
CouponAmount float64 `json:"coupon_amount"` // 优惠券金额
|
||||
ReduceDetail ReduceDetailObj
|
||||
}
|
||||
|
||||
type ReduceDetailObj struct {
|
||||
UserTaskId int64 `json:"user_task_id"` // 立减活动id
|
||||
TaskId int64 `json:"task_id"` // 立减活动task id
|
||||
BmlAmount float64 `json:"bml_amount"` // 立减金额(元)
|
||||
}
|
||||
|
||||
func (a *API) GetShippingFeeList(orderIds string, serviceBrand int) (*GetOrderLogisticsFeeRes, error) {
|
||||
data, err := a.AccessAPI("order/zhongbao/shippingFee", true, map[string]interface{}{"order_id": orderIds, "service_brand": serviceBrand})
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %v", err)
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(data)
|
||||
return nil, nil
|
||||
}
|
||||
@@ -20,13 +20,13 @@ func init() {
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// 菜市
|
||||
api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
//api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "")
|
||||
|
||||
// 果园
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
// api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
||||
api = New("5873", "41c479790a76f86326f89e8048964739", "", "") //token_nH_IlcWQKAkZBqklwItNRw
|
||||
cookieStr := `
|
||||
acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
`
|
||||
@@ -60,7 +60,7 @@ func TestGetAccessToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetAccessToken2(t *testing.T) {
|
||||
result, err := api.GetAccessToken2("16708848") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
result, err := api.GetAccessToken2("17371124") //refresh_token_pLG7Jw7g9mu7oOzNSuJIUg
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -69,7 +69,7 @@ func TestGetAccessToken2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRefreshAccessToken(t *testing.T) {
|
||||
result, err := api.RefreshAccessToken("refresh_token_jOp7ekeHrzjBUvLdVuZHIg") //token_qbAyE3ajWYT8ecwoI-FMjw
|
||||
result, err := api.RefreshAccessToken("refresh_token_jajfdTMzYvB28v-3q4RFgQ") //token_qbAyE3ajWYT8ecwoI-FMjw
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package mtwmapi
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -19,14 +18,18 @@ func TestOrderViewStatus(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail(t *testing.T) {
|
||||
result, err := api.OrderGetOrderDetail(1100449970093397157, false)
|
||||
result, err := api.OrderGetOrderDetail(1300486314174032613, false)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(result) == 0 {
|
||||
t.Fatal("result should have value")
|
||||
}
|
||||
globals.SugarLogger.Debugf("%s", utils.Format4Output(result, false))
|
||||
|
||||
for k, v := range result {
|
||||
fmt.Println(fmt.Sprintf("%s=%v", k, v))
|
||||
}
|
||||
//globals.SugarLogger.Debugf("%s", utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestOrderGetOrderDetail2(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user