修改京东商城商品属性
This commit is contained in:
@@ -4,12 +4,12 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdshopapi"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/delivery"
|
||||
"github.com/360EntSecGroup-Skylar/excelize"
|
||||
@@ -1611,18 +1611,9 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
// continue
|
||||
// }
|
||||
// }
|
||||
request, _ := http.NewRequest(http.MethodGet, "https://stores.shop.jd.com/stores/updateStoreStatus?storeId=24339301&storeStatus=1", nil)
|
||||
c := &http.Cookie{
|
||||
Name: "thor",
|
||||
Value: "80FAF09E9A09B6E618A68057BDFCFCB88A0E4CE7743FBEC84F10D992F9C6A4119DF98DA3CAAE9C7F17BEB62884625B4E7BC82422A90F45F02EA293572D951B055EF0B5F603AEA568DFD4234138F841EC1AC1F67B30B48AAC9EAD5FBAE7943E1DCC99E99D8358C82F7832B71A2BCB31624E16BBF561720443DE966BDA3588406233A90224D9089710B102AA98B979B9B3",
|
||||
}
|
||||
request.AddCookie(c)
|
||||
client := &http.Client{}
|
||||
fmt.Println("test1", request.URL)
|
||||
fmt.Println("test1", request.RemoteAddr)
|
||||
response, _ := client.Do(request)
|
||||
defer response.Body.Close()
|
||||
bodyData, _ := ioutil.ReadAll(response.Body)
|
||||
fmt.Println("test1", string(bodyData))
|
||||
_, err = api.JdShopAPI.AllOrders(&jdshopapi.AllOrdersParam{
|
||||
Current: 1,
|
||||
PageSize: 10,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -137,9 +137,15 @@ func updateOrderBySettleMent(order *model.GoodsOrder, orderSettlement *jdapi.Ord
|
||||
// order.WaybillTipMoney = orderSettlement.VenderPaidTips
|
||||
order.TotalShopMoney = orderSettlement.SettlementAmount
|
||||
order.PmSubsidyMoney = orderSettlement.PlatOrderGoodsDiscountMoney + orderSettlement.PlatSkuGoodsDiscountMoney
|
||||
stores, _ := dao.GetStoreList(dao.GetDB(), []int{order.StoreID}, nil, nil, nil, "")
|
||||
if len(stores) > 0 {
|
||||
jxutils.RefreshOrderEarningPrice2(order, stores[0].PayPercentage)
|
||||
if order.TotalShopMoney > 0 {
|
||||
stores, _ := dao.GetStoreList(dao.GetDB(), []int{order.StoreID}, nil, nil, nil, "")
|
||||
if len(stores) > 0 {
|
||||
if stores[0].PayPercentage <= 50 {
|
||||
order.NewEarningPrice = order.TotalShopMoney * int64((100 - stores[0].PayPercentage/2)) / 100
|
||||
} else {
|
||||
order.NewEarningPrice = order.EarningPrice
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,10 +158,10 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
Key: "tssp", //支持自提
|
||||
Value: "4",
|
||||
},
|
||||
// &jdshopapi.CreateSkuParamFeatures{
|
||||
// Key: "isSds", //支持自提?
|
||||
// Value: "1",
|
||||
// },
|
||||
&jdshopapi.CreateSkuParamFeatures{
|
||||
Key: "fdms", //分单?
|
||||
Value: "1",
|
||||
},
|
||||
}
|
||||
updateWareParam.Features = features
|
||||
err = api.JdShopAPI.UpdateWare(updateWareParam)
|
||||
|
||||
Reference in New Issue
Block a user