去掉SkuCategoryWithVendor

This commit is contained in:
gazebo
2019-12-06 09:41:11 +08:00
parent 61eed7f9e2
commit 9c2c65d266
6 changed files with 42 additions and 33 deletions

View File

@@ -44,16 +44,16 @@ func SyncCategories(ctx *jxcontext.Context, parentTask tasksch.ITask, vendorIDs
// todo 按vendorID orgCode合并操作
task := tasksch.NewParallelTask(fmt.Sprintf("同步分类:%v", catIDs), nil, ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
catVendorInfo := batchItemList[0].(*dao.SkuCategoryWithVendor)
catVendorInfo := batchItemList[0].(*dao.SkuStoreCatInfo)
if multiStoresHandler, ok := partner.GetPurchasePlatformFromVendorID(catVendorInfo.VendorID).(partner.IMultipleStoresHandler); ok {
if model.IsSyncStatusDelete(catVendorInfo.SyncStatus) { //删除
if model.IsSyncStatusDelete(catVendorInfo.CatSyncStatus) { //删除
if !dao.IsVendorThingIDEmpty(catVendorInfo.VendorCatID) &&
model.IsSyncStatusNeedDelete(catVendorInfo.SyncStatus) {
model.IsSyncStatusNeedDelete(catVendorInfo.CatSyncStatus) {
err = multiStoresHandler.DeleteCategory2(ctx, catVendorInfo)
}
} else if model.IsSyncStatusNew(catVendorInfo.SyncStatus) { // 新增
} else if model.IsSyncStatusNew(catVendorInfo.CatSyncStatus) { // 新增
err = multiStoresHandler.CreateCategory2(ctx, catVendorInfo)
} else if model.IsSyncStatusUpdate(catVendorInfo.SyncStatus) { // 修改
} else if model.IsSyncStatusUpdate(catVendorInfo.CatSyncStatus) { // 修改
err = multiStoresHandler.UpdateCategory2(ctx, catVendorInfo)
}
} else {
@@ -94,7 +94,7 @@ func SyncReorderCategories(ctx *jxcontext.Context, parentCatID int, isAsync bool
}
}
if len(vendorCatIDList) > 0 {
if err = multiStoresHandler.ReorderCategories2(ctx, vendorInfo.OrgCode, catList[0].VendorParentCatID, vendorCatIDList); err == nil {
if err = multiStoresHandler.ReorderCategories2(ctx, vendorInfo.OrgCode, catList[0].ParentVendorCatID, vendorCatIDList); err == nil {
retVal = []int{len(vendorCatIDList)}
}
}
@@ -163,14 +163,14 @@ func OnDeleteThing(ctx *jxcontext.Context, db *dao.DaoDB, thingID int64, thingTy
return nil
}
func SkuCategoryVendor2ThingMap(cat *dao.SkuCategoryWithVendor) (thingMap *model.ThingMap) {
func SkuCategoryVendor2ThingMap(cat *dao.SkuStoreCatInfo) (thingMap *model.ThingMap) {
thingMap = &model.ThingMap{
ThingID: int64(cat.ID),
ThingType: model.ThingTypeCategory,
VendorID: cat.VendorID,
VendorOrgCode: cat.VendorOrgCode,
SyncStatus: cat.SyncStatus,
SyncStatus: cat.CatSyncStatus,
VendorThingID: cat.VendorCatID,
}
thingMap.ID = cat.MapID // 一定要赋值