错误返回
This commit is contained in:
@@ -102,7 +102,7 @@ func tryCatName2Code(originName string) (catCodeStr string) {
|
||||
return catCodeStr
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
level := 1
|
||||
if storeCat.ParentCatName != "" {
|
||||
level = 2
|
||||
@@ -151,24 +151,27 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in
|
||||
Sequence: storeCat.Seq,
|
||||
}
|
||||
err = api.MtwmAPI.RetailCatUpdate(vendorStoreID, catName, param4Update)
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeID, model.VendorIDMTWM, "创建修改分类")
|
||||
}
|
||||
if storeCat.CatSyncStatus&model.SyncFlagNewMask == 0 && // 修改分类名,但分类不存在
|
||||
p.IsErrCategoryNotExist(err) && originName != "" {
|
||||
storeCat.CatSyncStatus |= model.SyncFlagNewMask
|
||||
err = p.CreateStoreCategory(ctx, storeID, vendorStoreID, storeCat)
|
||||
failedList, err = p.CreateStoreCategory(ctx, storeID, vendorStoreID, storeCat)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
// storeCat.VendorCatID = utils.FilterEmoji(storeCat.Name)
|
||||
storeCat.VendorCatID = utils.Int2Str(storeCat.ID)
|
||||
}
|
||||
return err
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
return p.CreateStoreCategory(ctx, storeID, vendorStoreID, storeCat)
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID, vendorCatID string, level int) (err error) {
|
||||
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID, vendorCatID string, level int) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
if false {
|
||||
if globals.EnableMtwmStoreWrite {
|
||||
err = api.MtwmAPI.RetailCatDelete(vendorStoreID, tryCatName2Code(vendorCatID), vendorCatID)
|
||||
@@ -184,9 +187,12 @@ func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID in
|
||||
} else {
|
||||
err = api.MtwmAPI.RetailCatSkuBatchDelete2(ctx.GetTrackInfo(), vendorStoreID, nil, nil, catCodes, []string{vendorCatID}, nil)
|
||||
}
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeID, model.VendorIDMTWM, "删除分类")
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
// 门店商品
|
||||
@@ -411,7 +417,7 @@ func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, vendorOrg
|
||||
if len(failedFoodList) > 0 {
|
||||
failedList = putils.SelectStoreSkuListByFoodList(storeSkuList, failedFoodList, storeID, model.VendorIDMTWM, "更新商品库存")
|
||||
}
|
||||
// if err = putils.GenPartialFailedErr(failedFoodList, len(failedFoodList)); err != nil {
|
||||
//if err = putils.GenPartialFailedErr(failedFoodList, len(failedFoodList)); err != nil {
|
||||
// successList = putils.UnselectStoreSkuListByVendorSkuIDs(storeSkuList, getAppFoodCodeList(failedFoodList))
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user