- 门店商品可售时更新库存

This commit is contained in:
gazebo
2019-08-05 12:25:29 +08:00
parent c20f7bb360
commit f9b578f0ae

View File

@@ -298,6 +298,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
if model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) && singleStoreHandler != nil {
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
} else {
isAddedStock := false
if model.IsSyncStatusPrice(sku.StoreSkuSyncStatus) {
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
priceList = append(priceList, bareSku)
@@ -307,6 +308,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
bareSku = storeSkuSyncInfo2Bare(sku)
}
stockList = append(stockList, bareSku)
isAddedStock = true
}
if model.IsSyncStatusSale(sku.StoreSkuSyncStatus) {
if bareSku == nil {
@@ -314,6 +316,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
}
if sku.MergedStatus == model.SkuStatusNormal {
onlineList = append(onlineList, bareSku)
if !isAddedStock {
stockList = append(stockList, bareSku)
isAddedStock = true
}
} else {
offlineList = append(offlineList, bareSku)
}