- 门店商品可售时更新库存
This commit is contained in:
@@ -298,6 +298,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
|
|||||||
if model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) && singleStoreHandler != nil {
|
if model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) && singleStoreHandler != nil {
|
||||||
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||||
} else {
|
} else {
|
||||||
|
isAddedStock := false
|
||||||
if model.IsSyncStatusPrice(sku.StoreSkuSyncStatus) {
|
if model.IsSyncStatusPrice(sku.StoreSkuSyncStatus) {
|
||||||
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
bareSku = storeSkuSyncInfo2Bare(calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
|
||||||
priceList = append(priceList, bareSku)
|
priceList = append(priceList, bareSku)
|
||||||
@@ -307,6 +308,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
|
|||||||
bareSku = storeSkuSyncInfo2Bare(sku)
|
bareSku = storeSkuSyncInfo2Bare(sku)
|
||||||
}
|
}
|
||||||
stockList = append(stockList, bareSku)
|
stockList = append(stockList, bareSku)
|
||||||
|
isAddedStock = true
|
||||||
}
|
}
|
||||||
if model.IsSyncStatusSale(sku.StoreSkuSyncStatus) {
|
if model.IsSyncStatusSale(sku.StoreSkuSyncStatus) {
|
||||||
if bareSku == nil {
|
if bareSku == nil {
|
||||||
@@ -314,6 +316,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
|
|||||||
}
|
}
|
||||||
if sku.MergedStatus == model.SkuStatusNormal {
|
if sku.MergedStatus == model.SkuStatusNormal {
|
||||||
onlineList = append(onlineList, bareSku)
|
onlineList = append(onlineList, bareSku)
|
||||||
|
if !isAddedStock {
|
||||||
|
stockList = append(stockList, bareSku)
|
||||||
|
isAddedStock = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
offlineList = append(offlineList, bareSku)
|
offlineList = append(offlineList, bareSku)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user