This commit is contained in:
richboo111
2023-02-16 11:33:00 +08:00
parent 608ed255a3
commit 9b2bf30cf2
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)
}