- bug fix for many sync operation.

This commit is contained in:
gazebo
2018-10-18 17:13:43 +08:00
parent 0db0dd4ca1
commit 294786cb4b
15 changed files with 169 additions and 129 deletions

View File

@@ -47,7 +47,7 @@ func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs [
// globals.SugarLogger.Debug(sql, sqlParams)
if err = dao.GetRows(db, &storeSkus, sql, sqlParams); err == nil {
outStationNo := utils.Int2Str(storeID)
task := tasksch.RunTask("", false, nil, 0, MaxSkuBatchSize, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
task := tasksch.RunTask("SyncStoresSkus inner", false, nil, 0, MaxSkuBatchSize, userName, func(batchItemList []interface{}, params ...interface{}) (interface{}, error) {
var skuPriceInfoList []*jdapi.SkuPriceInfo
var skuVendibilityList []*jdapi.StockVendibility
var skuStockList []*jdapi.SkuStock
@@ -79,6 +79,7 @@ func (p *PurchaseHandler) SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs [
if storeSku.DeletedAt != utils.DefaultTimeValue {
stock.StockQty = 0
}
skuStockList = append(skuStockList, stock)
}
}
}