This commit is contained in:
邹宗楠
2025-03-24 15:40:21 +08:00
parent 2663099187
commit cf38acc037
12 changed files with 64 additions and 44 deletions

View File

@@ -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")

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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,

View File

@@ -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;
//`

View File

@@ -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)
}

View File

@@ -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("<table><img src=%s height=100 width=100></table>", v.PicURL)
fmt.Println(data)
}
}
}
func TestPoiMGet(t *testing.T) {
result, err := api.PoiMGet([]string{"17821732"})

View File

@@ -8,7 +8,7 @@ import (
)
// 京西速食(蔬菜)
var token1 = `{"access_token":"id7ygfjlbv1j7t4nq1hehos0000yhugi-11","expires_in":1740432711,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"277cnzg6t11j7t4nq1hehos0000yhugi-12","authority_id":""}`
var token1 = `{"access_token":"inj8cpkpri1j7t4nq1hehos0000yhugi-11","expires_in":1742841858,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"u4qcjoscrj1j7t4nq1hehos0000yhugi-12","authority_id":""}`
// 美好菜市
//var token1 = `{"access_token":"9a315a03-c737-4a82-ae52-c9a6ce827007","expires_in":1699490747,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"8334c006-5301-4d25-911b-4d8cc7b70ebb","authority_id":""}`

View File

@@ -20,7 +20,7 @@ func TestApi(t *testing.T) {
}
func TestQueryOrderDetail(t *testing.T) {
data, err := a.GetTiktokOrderDetail("6927155509817119974")
data, err := a.GetTiktokOrderDetail("6940698406196810794")
globals.SugarLogger.Debugf("=====%s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("=====%s", err)
}

View File

@@ -155,14 +155,18 @@ func (a *API) CleanWaitingQueue(sn string) error {
//打印小票
func (a *API) Print(sn, content, voice string) (string, error) {
resp, err := a.HttpPostJson("print", PrintReq{
param := PrintReq{
Sn: sn,
Content: content,
Voice: voice,
VoicePlayTimes: 1,
VoicePlayInterval: 3,
Copies: 1,
})
}
//if sn == "580011097147" { // 这个门店要三次
// param.VoicePlayTimes = 3
//}
resp, err := a.HttpPostJson("print", param)
if err != nil {
return "", err
}