多门店平台同步门店商品时,处理商品库没有创建的情况

This commit is contained in:
gazebo
2019-12-13 21:24:27 +08:00
parent fb7e3566ea
commit 99efedfd92

View File

@@ -355,6 +355,13 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
} else if model.IsSyncStatusNew(sku.SkuSyncStatus) { } else if model.IsSyncStatusNew(sku.SkuSyncStatus) {
calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)) calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage))
if singleStoreHandler == nil { if singleStoreHandler == nil {
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
err = fmt.Errorf("门店:%d修改没有创建的商品:%d", storeID, sku.SkuID)
if parentTask == nil {
return err
}
parentTask.AddBatchErr(err)
} else {
sku.SkuSyncStatus |= model.SyncFlagSaleMask | model.SyncFlagPriceMask sku.SkuSyncStatus |= model.SyncFlagSaleMask | model.SyncFlagPriceMask
bareSku = storeSkuSyncInfo2Bare(sku) bareSku = storeSkuSyncInfo2Bare(sku)
stockList = append(stockList, bareSku) stockList = append(stockList, bareSku)
@@ -364,6 +371,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
} else { } else {
offlineList = append(offlineList, bareSku) offlineList = append(offlineList, bareSku)
} }
}
} else { } else {
if sku.MergedStatus == model.SkuStatusNormal { if sku.MergedStatus == model.SkuStatusNormal {
if dao.IsVendorThingIDEmpty(sku.VendorCatID) { if dao.IsVendorThingIDEmpty(sku.VendorCatID) {