1
This commit is contained in:
@@ -2,6 +2,7 @@ package cms
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
|
||||||
@@ -49,16 +50,15 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
|
|||||||
//}
|
//}
|
||||||
case 2:
|
case 2:
|
||||||
// 同步分类
|
// 同步分类
|
||||||
fromCategoryList, err := fromApi.RetailCatList(utils.Int2Str(fromVendorStoreId))
|
fromCategoryList, _ := fromApi.RetailCatList(utils.Int2Str(fromVendorStoreId))
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
for _, v := range fromCategoryList {
|
for _, v := range fromCategoryList {
|
||||||
if err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
|
err := toApi.RetailCatUpdate(toStore.VendorStoreID, v.Name, &mtwmapi.Param4UpdateCat{
|
||||||
CategoryCode: v.Code,
|
CategoryCode: v.Code,
|
||||||
Sequence: v.Sequence,
|
Sequence: v.Sequence,
|
||||||
}); err != nil {
|
})
|
||||||
return nil, err
|
if err != nil {
|
||||||
|
globals.SugarLogger.Debug("err := RetailCatUpdate : %s", utils.Format4Output(err, false))
|
||||||
}
|
}
|
||||||
if v.Children != nil && len(v.Children) != 0 {
|
if v.Children != nil && len(v.Children) != 0 {
|
||||||
for _, c := range v.Children {
|
for _, c := range v.Children {
|
||||||
@@ -68,7 +68,7 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
|
|||||||
SecondaryCategoryName: c.Name,
|
SecondaryCategoryName: c.Name,
|
||||||
Sequence: c.Sequence,
|
Sequence: c.Sequence,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return nil, err
|
globals.SugarLogger.Debug("err := RetailCatUpdate Children : %s", utils.Format4Output(err, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,10 +78,10 @@ func CopyOnStoreSkuToOther(ctx *jxcontext.Context, fromVendorStoreId, toStoreId
|
|||||||
// 同步商品
|
// 同步商品
|
||||||
fromFoodList, err1 := fromApi.RetailListAll(utils.Int2Str(fromVendorStoreId))
|
fromFoodList, err1 := fromApi.RetailListAll(utils.Int2Str(fromVendorStoreId))
|
||||||
if err1 != nil {
|
if err1 != nil {
|
||||||
return nil, err1
|
globals.SugarLogger.Debug("RetailListAll : %s", utils.Format4Output(err, false))
|
||||||
}
|
}
|
||||||
if err := BatchInitData(ctx, fromFoodList, toApi, toStore.VendorStoreID); err != nil {
|
if err := BatchInitData(ctx, fromFoodList, toApi, toStore.VendorStoreID); err != nil {
|
||||||
return nil, err
|
globals.SugarLogger.Debug("BatchInitData : %s", utils.Format4Output(err, false))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user