diff --git a/business/partner/purchase/tao_vegetable/store_sku2.go b/business/partner/purchase/tao_vegetable/store_sku2.go index ccda265a4..5caf851b4 100644 --- a/business/partner/purchase/tao_vegetable/store_sku2.go +++ b/business/partner/purchase/tao_vegetable/store_sku2.go @@ -114,8 +114,6 @@ func (p *PurchaseHandler) IsErrCategoryNotExist(err error) (isNotExist bool) { func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) { api := getAPI(storeCat.VendorOrgCode, storeID, vendorStoreID) - globals.SugarLogger.Debugf("CreateStoreCategory===== := %s%s%d", vendorStoreID, storeCat.VendorOrgCode, storeID) - globals.SugarLogger.Debugf("storeCat===== := %s", utils.Format4Output(storeCat, false)) // 修改分类 if model.IsSyncStatusUpdate(storeCat.CatSyncStatus) { @@ -126,12 +124,12 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in if storeCat.CatSyncStatus&model.SyncFlagNewMask == 0 && p.IsErrCategoryNotExist(err) && storeCat.StoreCatName != "" { // 修改分类名,但分类不存在 storeCat.CatSyncStatus |= model.SyncFlagNewMask createCategory := &request.AlibabaWdkSkuCategoryAddRequest{Param: &domain.AlibabaWdkSkuCategoryAddCategoryDo{ - Code: utils.String2Pointer(utils.Int2Str(storeCat.StoreCatID)), - Name: &storeCat.StoreCatName, + Code: utils.String2Pointer(utils.Int2Str(storeCat.ID)), + Name: &storeCat.Name, Leaf: utils.Bool2Point(false), }} if storeCat.ParentID != model.NO { - createCategory.Param.ParentCode = utils.String2Pointer(storeCat.ParentVendorCatID) + createCategory.Param.ParentCode = utils.String2Pointer(utils.Int2Str(storeCat.ParentID)) createCategory.Param.Leaf = utils.Bool2Point(true) } @@ -145,12 +143,13 @@ func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, storeID in // 创建分类 if model.IsSyncStatusNeedCreate(storeCat.CatSyncStatus) { createCategoryParam := &request.AlibabaWdkSkuCategoryAddRequest{Param: &domain.AlibabaWdkSkuCategoryAddCategoryDo{ - Code: utils.String2Pointer(utils.Int2Str(storeCat.StoreCatID)), - Name: &storeCat.StoreCatName, + Code: utils.String2Pointer(utils.Int2Str(storeCat.ID)), + Name: &storeCat.Name, Leaf: utils.Bool2Point(false), }} + if storeCat.ParentID != model.NO { - createCategoryParam.Param.ParentCode = utils.String2Pointer(storeCat.ParentVendorCatID) + createCategoryParam.Param.ParentCode = utils.String2Pointer(utils.Int2Str(storeCat.ParentID)) createCategoryParam.Param.Leaf = utils.Bool2Point(true) }