1
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user