- 继续重构新版同步逻辑
This commit is contained in:
@@ -26,7 +26,7 @@ func (p *PurchaseHandler) GetStoreSkusBatchSize(funcID int) (batchSize int) {
|
||||
}
|
||||
|
||||
// 门店分类
|
||||
func (p *PurchaseHandler) GetStoreAllCategories(ctx *jxcontext.Context, vendorStoreID string) (cats []*partner.BareCategoryInfo, err error) {
|
||||
func (p *PurchaseHandler) GetStoreAllCategories(ctx *jxcontext.Context, storeID int, vendorStoreID string) (cats []*partner.BareCategoryInfo, err error) {
|
||||
remoteCats, err := api.MtwmAPI.RetailCatList(vendorStoreID)
|
||||
if err == nil {
|
||||
cats = convertVendorCatList(remoteCats)
|
||||
@@ -48,7 +48,7 @@ func convertVendorCatList(remoteCats []*mtwmapi.RetailCategoryInfo) (cats []*par
|
||||
return cats
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
level := 1
|
||||
if storeCat.ParentCatName != "" {
|
||||
level = 2
|
||||
@@ -82,11 +82,11 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, vendorStor
|
||||
return err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
return p.CreateStoreCategory(ctx, vendorStoreID, storeCat)
|
||||
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
return p.CreateStoreCategory(ctx, storeID, vendorStoreID, storeCat)
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
||||
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID, vendorCatID string) (err error) {
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
err = api.MtwmAPI.RetailCatDelete(vendorStoreID, vendorCatID)
|
||||
}
|
||||
@@ -96,12 +96,12 @@ func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, vendorStor
|
||||
// 门店商品
|
||||
|
||||
// 多门店平台不需要实现这个接口
|
||||
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
return p.CreateStoreSkus(ctx, vendorStoreID, storeSkuList)
|
||||
func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
return p.CreateStoreSkus(ctx, storeID, vendorStoreID, storeSkuList)
|
||||
}
|
||||
|
||||
// 对于多门店平台来说,storeSkuList中只有SkuID与VendorSkuID有意义
|
||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
foodDataList := make([]map[string]interface{}, len(storeSkuList))
|
||||
for i, storeSku := range storeSkuList {
|
||||
foodData := make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user