From b54f86f00c83ac0af6b19e089ad508150039cc57 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 17 Sep 2019 11:30:07 +0800 Subject: [PATCH] =?UTF-8?q?-=20IsSyncStatusSec=20fixed=20to=20IsSyncStatus?= =?UTF-8?q?Seq=20-=20=E4=BF=AE=E6=94=B9=EF=BC=88=E6=88=96=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=EF=BC=89=E5=8D=95=E5=B9=B3=E5=8F=B0=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=B9=B3=E5=8F=B0=E5=88=86=E7=B1=BBID=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync_store_sku.go | 20 ++++++++++++++------ business/model/model.go | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) 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 }