diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 374999657..dcee5ff63 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -336,8 +336,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo offlineList = append(offlineList, bareSku) } } else { - if sku.MergedStatus == model.SkuStatusNormal /*&& !dao.IsVendorThingIDEmpty(sku.VendorCatID)*/ { - createList = append(createList, sku) + if sku.MergedStatus == model.SkuStatusNormal { + if dao.IsVendorThingIDEmpty(sku.VendorCatID) { + globals.SugarLogger.Warnf("syncStoreSkuNew 创建门店:%d商品:%d,但没有平台分类ID", sku.StoreID, sku.SkuID) + } else { + createList = append(createList, sku) + } } } isNeedReorder = true @@ -351,9 +355,13 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo } else { isAdded2Update := false // 修改商品信息时不改价(以免活动引起的失败),而用单独的改价来改 - if (model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) || (model.IsSyncStatusSec(sku.StoreSkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil { - isAdded2Update = true - updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))) + if (model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) || (model.IsSyncStatusSeq(sku.StoreSkuSyncStatus) && reorderHandler == nil)) && singleStoreHandler != nil { + if dao.IsVendorThingIDEmpty(sku.VendorCatID) { + globals.SugarLogger.Warnf("syncStoreSkuNew 修改门店:%d商品:%d,但没有平台分类ID", sku.StoreID, sku.SkuID) + } else { + isAdded2Update = true + updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))) + } } if model.IsSyncStatusPrice(sku.StoreSkuSyncStatus) { bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))) @@ -378,7 +386,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo } } } - isNeedReorder = model.IsSyncStatusSec(sku.StoreSkuSyncStatus) + isNeedReorder = model.IsSyncStatusSeq(sku.StoreSkuSyncStatus) } } if isNeedReorder && reorderHandler != nil && sku.VendorCatID != "" { diff --git a/business/model/model.go b/business/model/model.go index d49ac05bc..e52ed3b1d 100644 --- a/business/model/model.go +++ b/business/model/model.go @@ -114,7 +114,7 @@ func IsSyncStatusPrice(syncStatus int8) bool { return (syncStatus & SyncFlagPriceMask) != 0 } -func IsSyncStatusSec(syncStatus int8) bool { +func IsSyncStatusSeq(syncStatus int8) bool { return (syncStatus & SyncFlagSeqMask) != 0 }