- IsSyncStatusSec fixed to IsSyncStatusSeq

- 修改(或创建)单平台门店商品时,如果没有平台分类ID,报警
This commit is contained in:
gazebo
2019-09-17 11:30:07 +08:00
parent 7bc963c31f
commit b54f86f00c
2 changed files with 15 additions and 7 deletions

View File

@@ -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 != "" {

View File

@@ -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
}