Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop

This commit is contained in:
邹宗楠
2023-02-16 14:22:35 +08:00
2 changed files with 11 additions and 12 deletions

View File

@@ -343,7 +343,7 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
}
}
if globals.EnableEbaiStoreWrite {
fBaiduIDs, fShopIDs, err1 := FilterStoreRel(baiduShopIDs, shopIDs)
fBaiduIDs, fShopIDs, err1 := FilterStoreRel(baiduShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID FilterStoreRel fBaiduIDs====%d fShopIDs====%d err====%v", fBaiduIDs, fShopIDs, err1)
err = api.EbaiAPI.ShopIDBatchUpdate(fBaiduIDs, fShopIDs)
globals.SugarLogger.Debugf("RefreshAllStoresID baiduShopIDs====%s,shopIDs====%s", baiduShopIDs, shopIDs)
@@ -364,12 +364,10 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
}
//过滤ebai平台与本地门店ID映射关系是否正确对应修改
func FilterStoreRel(baiduShopIDs []string, shopIDs []string) (fBaiduShopIDs []string, fShopIDs []string, err error) {
func FilterStoreRel(baiduShopIDs []string) (fBaiduShopIDs []string, fShopIDs []string, err error) {
//线上获取映射关系
if len(baiduShopIDs) > 0 && len(shopIDs) > 0 {
relInfo := utils.Params2Map("baidu_shop_ids", baiduShopIDs, "shop_ids", shopIDs)
globals.SugarLogger.Debugf("FilterStoreRel relInfo====%s", utils.Format4Output(relInfo, false))
for k, _ := range relInfo {
if len(baiduShopIDs) > 0 {
for _, k := range baiduShopIDs {
remoteRel, err := api.EbaiAPI.ShopGet2("", utils.Str2Int64(k))
if err != nil {
return nil, nil, err
@@ -671,7 +669,7 @@ func (c *PurchaseHandler) GetAllStoresVendorID(ctx *jxcontext.Context, vendorOrg
func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorOrgCode string, vendorStoreID string, storeID int64) (err error) {
if globals.EnableJdStoreWrite {
fBaiduIDs, fShopIDs, err1 := FilterStoreRel([]string{vendorStoreID}, []string{utils.Int64ToStr(storeID)})
fBaiduIDs, fShopIDs, err1 := FilterStoreRel([]string{vendorStoreID})
if err1 != nil {
globals.SugarLogger.Debugf("UpdateStoreCustomID err1====%v", err1)
}

View File

@@ -2,6 +2,11 @@ package tiktok_store
import (
"encoding/json"
"io/ioutil"
"net/http"
"strings"
"time"
tiktokShop "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -9,10 +14,6 @@ import (
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api"
"io/ioutil"
"net/http"
"strings"
"time"
)
// 同一账号下,菜市消息推送到果园
@@ -91,7 +92,7 @@ func HttpToGuoYuan(param map[string]interface{}, requestType string) (*http.Resp
case CaiShiPushGyTagDeliveryDetail: // 配送查询详情
url = "http://callback-jxgy.jxc4.com/logistics/logisticsQuery"
case CaiShiPushGyTagWayBill: // 运单消息
url = "http://callback-jxgy.jxc4.com/tiktok/callbackTiktokOrderMsg"
}
httpReq, err := http.NewRequest(http.MethodPost, url, body)
if err != nil {