diff --git a/platformapi/jdapi/jdapi_test.go b/platformapi/jdapi/jdapi_test.go index 28d5dd05..0b5340b1 100644 --- a/platformapi/jdapi/jdapi_test.go +++ b/platformapi/jdapi/jdapi_test.go @@ -34,11 +34,11 @@ func init() { // 京东白货 //api = New("9053e4fd-4e0e-4e9e-8ab1-f348e5cbf3e7", "4602bd4b84984186815dbc03299c7094", "386ab19719d9470487011217d0c57349") // 果切 379599 - //api = New("ad4061a1-6a5c-43f9-bf51-b1232fd9499d", "f2ed33075faf4773a47e065acd79532b", "aed14cbbecac4456843570e90c5f46ec") + api = New("8a843f5c-6c75-4604-9976-04c1aae3decc", "f2ed33075faf4773a47e065acd79532b", "aed14cbbecac4456843570e90c5f46ec") // 381564 //api = New("4d0c707a-54eb-4f05-8187-6cedf95827c7", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da") // 390558 - api = New("9053e4fd-4e0e-4e9e-8ab1-f348e5cbf3e7", "4602bd4b84984186815dbc03299c7094", "386ab19719d9470487011217d0c57349") + //api = New("9053e4fd-4e0e-4e9e-8ab1-f348e5cbf3e7", "4602bd4b84984186815dbc03299c7094", "386ab19719d9470487011217d0c57349") // 384633 ///api = New("02a3f772-89f3-46f1-bbd5-74be346cba54", "e496a0f9b88a407297fea283b8dc9e29", "9bb82ffbec144c4b8fc8d627e5ca6a35") diff --git a/platformapi/jdapi/store_sku.go b/platformapi/jdapi/store_sku.go index 34320a17..48dc1a19 100644 --- a/platformapi/jdapi/store_sku.go +++ b/platformapi/jdapi/store_sku.go @@ -395,3 +395,17 @@ type JDSkuList struct { FixedType int `json:"fixedType,omitempty"` SuperId int `json:"superId,omitempty"` } + +// UnBindStoreGoods 解绑商品 +func (a *API) UnBindStoreGoods(skuId int64) { + jdParams := map[string]interface{}{ + "skuId": skuId, + "stationNo": "14986394", + "opPin": "liulei", + } + data, err := a.AccessAPINoPage("StoreGoodsPlatformService/unBindStoreGoods", jdParams, nil, nil, genNoPageResultParser("code", "msg", "data", "0")) + if err != nil { + return + } + fmt.Println(data) +} diff --git a/platformapi/jdapi/store_sku_test.go b/platformapi/jdapi/store_sku_test.go index 40eb6af9..3801f287 100644 --- a/platformapi/jdapi/store_sku_test.go +++ b/platformapi/jdapi/store_sku_test.go @@ -60,17 +60,19 @@ func TestDelVipPrice(t *testing.T) { //} func TestBatchUpdateVendibility(t *testing.T) { - result, err := api.BatchUpdateVendibility("", "800302", "", []*StockVendibility{ - &StockVendibility{ - OutSkuId: "6042945", - DoSale: true, - }, - }, "test") - if err != nil { - t.Fatal(err) + data := []int64{1} + for _, v := range data { + _, err := api.BatchUpdateVendibility("liulei", "", "14986394", []*StockVendibility{ + &StockVendibility{ + OutSkuId: utils.Int64ToStr(v), + DoSale: false, + }, + }, "test") + if err != nil { + t.Fatal(err) + } + } - t.Log(utils.Format4Output(result, false)) - //baseapi.SugarLogger.Debug(utils.Format4Output(result, false)) } func TestUpdateVendibility(t *testing.T) { @@ -172,3 +174,7 @@ func (t *Object2222) getParam(key string) int { func TestGetSkuList(t *testing.T) { api.AuerySkuInfoList(0, 100) } + +func TestUnBindStoreGoods(t *testing.T) { + api.UnBindStoreGoods(31985) +} diff --git a/platformapi/jxprintapi/jxprintapi_test.go b/platformapi/jxprintapi/jxprintapi_test.go index 323eabab..8ac3a71e 100644 --- a/platformapi/jxprintapi/jxprintapi_test.go +++ b/platformapi/jxprintapi/jxprintapi_test.go @@ -3,12 +3,8 @@ package jxprintapi import ( "fmt" "git.rosy.net.cn/baseapi" - "git.rosy.net.cn/baseapi/utils" "go.uber.org/zap" - "net/http" - "strings" "testing" - "time" ) var ( @@ -115,25 +111,11 @@ func TestDoPrint(t *testing.T) { } func TestName23(t *testing.T) { - url := "https://www.jxc4.com/v2/store/sku/UpdateStoresSkus" - var storeList = []int64{100123, 100455, 666900, 102364, 102859, 669086, 102877, 102963, 669119, 667222, 668906, 667558, 102374, 103161, 102433, 667405, 102443, 102883, 103182, 668429, 668530, 100546, 668401, 667229, 668809, 666913, 102475, 666917, 100610, 669029, 102479, 669168, 100135, 667242, 668909, 100144, 100654, 667410, 102966, 103189, 668567, 102481, 668918, 100145, 667560, 102490, 103191, 667247, 102981, 667429, 100157, 668928, 103194, 666932, 102985, 668620, 100712, 667261, 666948, 667271, 668814, 100726, 667446, 103199, 102987, 667562, 669188, 102496, 100175, 102895, 667909, 667453, 100190, 669479, 669201, 666949, 667283, 668043, 102533, 102896, 100741, 668054, 103201, 669227, 100206, 667467, 668622, 100236, 102907, 668931, 103361, 669240, 102923, 102630, 103002, 669283, 667014, 668160, 668815, 100273, 668821, 101013, 667296, 102933, 668506, 103004, 667066, 103417, 101099, 669493, 668756, 667468, 668184, 100274, 103022, 667299, 667485, 103435, 668191, 668786, 102642, 101176, 667067, 100278, 667490, 103032, 667085, 666667, 669007, 667305, 100290, 102934, 101687, 668790, 102676, 103033, 666677, 667514, 666707, 101763, 667119, 668252, 103037, 101916, 102742, 101956, 667128, 668360, 667316, 103050, 666709, 100292, 102778, 669022, 103082, 100296, 100324, 667542, 102016, 102812, 102950, 667332, 102821, 666756, 668829, 102147, 667134, 102167, 668850, 103085, 100325, 667157, 666779, 668384, 102952, 103103, 102826, 668883, 100361, 667365, 669032, 102955, 669044, 102223, 667173, 100369, 666800, 102280, 102844, 667399, 103113, 100002, 666828, 669054, 102851, 102350, 669055, 666840, 100032, 102956, 100115, 667208, 668891, 100449, 668900, 667212, 103151, 668417, 100454, 102962} - - for _, v := range storeList { - payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"storeIDs\"\r\n\r\n[" + utils.Int64ToStr(v) + "]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"payload\"\r\n\r\n[{\"nameID\":8075899,\"unitPrice\":1600}]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"causeFlag\"\r\n\r\n16\r\n-----011000010111000001101001--\r\n\r\n") - - req, _ := http.NewRequest("PUT", url, payload) - - req.Header.Add("token", "TOKEN.V2.2452A93EEB9111EC9B06525400E86DC0.20240913-144538.localpass.C9588B01719B11EF95B3525400E86DC0.[18981810340]") - req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001") - - _, err := http.DefaultClient.Do(req) - if err != nil { - fmt.Println(v) - } else { - fmt.Println("=", v) - } - time.Sleep(1 * time.Second) + count := 236 / 50 + fmt.Println(count) + if 236%50 != 0 { + count += 1 } - + fmt.Println(count) } diff --git a/platformapi/mtwmapi/bill_list.go b/platformapi/mtwmapi/bill_list.go index 6bbd1b3c..c255a7d9 100644 --- a/platformapi/mtwmapi/bill_list.go +++ b/platformapi/mtwmapi/bill_list.go @@ -2,6 +2,7 @@ package mtwmapi import ( "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/globals" ) const ( @@ -59,6 +60,9 @@ func (a *API) GetStoreBillList(param *Bill) (map[string]*SettleOrderList, int64, if !ok { settle = &SettleOrderList{OrderId: v.WmOrderViewId} } + if v.WmOrderViewId == "2001521861299113073" { + globals.SugarLogger.Debugf("------%s:%s", v.WmOrderViewId, utils.Format4Output(v, false)) + } switch v.BillChargeType { case BillChargeTypeOrder: // 平台结算 settle.PlatformSettlement = v.SettleAmount diff --git a/platformapi/mtwmapi/bill_list_test.go b/platformapi/mtwmapi/bill_list_test.go index 4e27d445..994a0f55 100644 --- a/platformapi/mtwmapi/bill_list_test.go +++ b/platformapi/mtwmapi/bill_list_test.go @@ -11,7 +11,7 @@ func TestBillList(t *testing.T) { from := time.Date(now.Year(), now.Month(), now.Day()-2, 0, 0, 0, 0, time.Local) to := time.Date(now.Year(), now.Month(), now.Day()-1, 23, 59, 59, 59, time.Local) param := &Bill{ - AppPoiCode: "18833517", + AppPoiCode: "20046303", StartDate: from.Unix(), EndDate: to.Unix(), Offset: 0, diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index dfd567e5..5f58ff7b 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -23,10 +23,10 @@ func init() { //api = New("589", "a81eb3df418d83d6a1a4b7c572156d2f", "", "") // 果园 - //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") + api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_hGnQOvCSkfrCOXFLHA1NMQ") + //api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_hGnQOvCSkfrCOXFLHA1NMQ") //cookieStr := ` // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; //` diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index 0cf54532..a7d275a6 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -31,7 +31,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time { } func TestOrderGetOrderDetail(t *testing.T) { - result, err := api.OrderGetOrderDetail(4101460891740121194, false) + result, err := api.OrderGetOrderDetail(2001521861299113073, false) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/poi_test.go b/platformapi/mtwmapi/poi_test.go index cab93ad3..73dd2c6a 100644 --- a/platformapi/mtwmapi/poi_test.go +++ b/platformapi/mtwmapi/poi_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "git.rosy.net.cn/baseapi/utils" + "strings" "testing" ) @@ -23,7 +24,16 @@ func TestPoiGetIDs(t *testing.T) { } func Test1111(t *testing.T) { - fmt.Println(utils.Float64TwoInt(float64(1132) / float64(2441) * float64(805))) + result, err := api.PoiMGet([]string{"17821732"}) + if err != nil { + fmt.Println(err) + } + for _, v := range result { + if strings.Contains(v.Name, "京西") { + data := fmt.Sprintf("%s %s ", v.AppPoiCode, v.Name) + fmt.Sprintf("