This commit is contained in:
richboo111
2023-09-26 18:32:04 +08:00
9 changed files with 46 additions and 19 deletions

View File

@@ -33,8 +33,8 @@ func init() {
// 果切
//api = New("3ef42248-1247-4efa-8624-43cd3a3b97ae", "5d5577a2506f41b8b4ec520ba83490f5", "0b01b9eeb15b41dab1c3d05d95c17a26")
// 京东超市 381564
api = New("f99d25b8-33a6-4251-a97c-5e24b80b0005", "d2d1e2e3213d4320bc2712a684307831", "1750f5b9848d4a6492c1c20b487074da")
// 京东超市 359459
api = New("21ff22c5-0716-4c05-9468-8e4dde2b1cd6", "21b627c23ea04c69b64b48d0b361213e", "51cd27a748e64c829b4b7f83f4844610")
//prod zs
// api = New("6f8d3290-0120-4ad7-8b53-943c67c84f3f", "789279b9ae814ba091ac52815566b54d", "5d668cd227644637bb0fd73ed8118ec8")
// const cookieValue = "YYJV3NHVBPHLD36FWP6F3EM5PTXJ2XZQS7U4HWRIDPP4IWGUKUIB4XG5N26CZRDLDF7PKOXBPD6BNTUAJLETLZOIWMCVFI3K6MYZIY4QBIXIMXYDJNUKFGJVQTN5356SAD6WPCIHWNQAG7DDMF7L7S3SHCT3RM3CQG7IJIPUQ3THS5UIUYWMKINM7ETUOQB7OBPOPZVCT3ZJY55243TDVXLO25PP4UYSPTTPMNQ7HPMWOJKJ3BJWGVHD243MXH7NZWW264TKN5UOCJBSSSOKD2QQII"

View File

@@ -1033,12 +1033,14 @@ func (a *API) GetJdUpcCodeByName(name, upcCode string, pageNo, pageSize int) (pr
for _, vv := range ImgStr {
ImgList = append(ImgList, "http://img20.360buyimg.com/vc/"+vv.(string))
}
category, _ := utils.TryInterface2Int64(v.(map[string]interface{})["thirdCategoryId"])
productInfo := &ProductInfo{
OriginalName: v.(map[string]interface{})["name"].(string),
UpcCode: v.(map[string]interface{})["upcCode"].(string),
Weight: float32(utils.Interface2Float64WithDefault(v.(map[string]interface{})["weight"], 0) * 1000),
ImgList: ImgList,
BrandName: v.(map[string]interface{})["brandName"].(string),
Categories: []string{utils.Int64ToStr(category)},
}
productInfos = append(productInfos, productInfo)
}

File diff suppressed because one or more lines are too long

View File

@@ -36,6 +36,8 @@ const (
MsgTypeStoreAuditStatusChanged = "storeAuditStatusChanged"
MsgTypeSkuDelete = "skuDelete"
MsgTypeStoreBind = "storeBind"
MsgTypeOrderAgree = "agree" // 同意退款回调
)
type CallbackResponse struct {

View File

@@ -93,7 +93,7 @@ func TestRetailCatDelete(t *testing.T) {
}
func TestRetailList(t *testing.T) {
result, err := api.RetailList("18900165", 2100, 100)
result, err := api.RetailList("18900165", 1, 100)
if err != nil {
t.Fatal(err)
}

View File

@@ -241,12 +241,8 @@ func (a *API) QueryBillList(req *request591.AlibabaWdkBillListRequest) (*domain5
globals.SugarLogger.Debugf("进入 QueryBillList : %s", utils.Format4Output(req, false))
client := ability591.NewAbility591(&a.client)
data, err := client.AlibabaWdkBillList(req, a.token)
if err != nil {
globals.SugarLogger.Debugf("requestId[%s],err[%s]", data.RequestId, utils.Format4Output(err, false))
return nil, err
}
if !*data.ApiResult.Success {
data, _ := client.AlibabaWdkBillList(req, a.token)
if data != nil && !*data.ApiResult.Success {
globals.SugarLogger.Debugf("requestId[%s],err[%s]", data.RequestId, utils.Format4Output(data, false))
return nil, fmt.Errorf(*data.ApiResult.ErrMsg)
}

View File

@@ -228,10 +228,10 @@ func TestDeliveryTrajectory(t *testing.T) {
func TestQueryBillList(t *testing.T) {
queryData := time.Now()
create := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-90, 0, 0, 0, 0, queryData.Location())
end := time.Date(queryData.Year(), queryData.Month(), queryData.Day(), 23, 59, 59, 59, queryData.Location())
create := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-26, 0, 0, 0, 0, queryData.Location())
end := time.Date(queryData.Year(), queryData.Month(), queryData.Day()-14, 23, 59, 59, 59, queryData.Location())
data, err := GetOrderTotalShopMoney("", "JX100002", create, end)
data, err := GetOrderTotalShopMoney("", "JX668429", create, end)
globals.SugarLogger.Debugf("data:= %s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("data:= %s", utils.Format4Output(err, false))
@@ -262,7 +262,10 @@ func GetOrderTotalShopMoney(appOrgCode string, vendorStoreID string, start, end
}
var totalIndex int64 = 0
result, _ := api.QueryBillList(param)
result, err := api.QueryBillList(param)
if err != nil {
return nil, err
}
for _, v := range *result.TxdBillDetailBOS {
if *v.OrderType == "positive" {
settlement[*v.BizOrderId] = *v.ReceivableAmount

View File

@@ -144,7 +144,7 @@ func (a *API) GetShipmentInfo(shopOrderID, afterSaleID, shipmentType int64) (*su
return nil, err
}
if strings.Contains(response.SubMsg, "当前查询单据不存在:订单不存在") || strings.Contains(response.SubMsg, "未找到当前物流订单, LO") {
if strings.Contains(response.SubMsg, "订单不存在") || strings.Contains(response.SubMsg, "未找到当前物流订单, LO") {
return &superm_getShipmentInfo_response.ShipmentInfo{
ShopOrderID: shopOrderID,
AfterSaleID: 0,
@@ -160,9 +160,6 @@ func (a *API) GetShipmentInfo(shopOrderID, afterSaleID, shipmentType int64) (*su
}, nil
}
if response.Code != RequestSuccessCode {
return nil, errors.New(response.SubMsg + ":" + response.LogId)
}
return response.Data.ShipmentInfo, err
}

View File

@@ -3,6 +3,8 @@ package tiktok_api
import (
"encoding/json"
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-print/globals"
"testing"
)
@@ -37,7 +39,11 @@ func Test(t *testing.T) {
}
func TestGetShipmentInfo(t *testing.T) {
a.GetShipmentInfo(6921428072500696298, 0, ShipmentTypeInvoice)
var token = `{"access_token":"719db06b-3fbf-461b-8cf2-e5ae70293cdc","expires_in":1695876413,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8c478de3-8fbd-4535-a78c-06792b8a20a4","authority_id":""}`
var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token)
data, err := a.GetShipmentInfo(6922112012008166892, 0, ShipmentTypeInvoice)
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("======data := %s", utils.Format4Output(err, false))
}
func TestGetStoreAutoCallRiderInfo(t *testing.T) {