This commit is contained in:
gazebo
2019-07-18 09:49:30 +08:00
parent c8aea841a9
commit b1216abbfb

View File

@@ -145,7 +145,7 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo
if singleStoreHandler != nil {
_, err = SyncStoreSkuNew(ctx, task, vendorID, storeID, vendorStoreID, nil, nil, false, isContinueWhenError)
} else {
err = syncStoreSkuNew(ctx, task, false, vendorID, storeID, nil, nil, isContinueWhenError)
err = syncStoreSkuNew(ctx, task, true, vendorID, storeID, nil, nil, isContinueWhenError)
}
}
return retVal, err
@@ -277,7 +277,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
createList = append(createList, sku)
}
}
} else {
} else if !dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
if model.IsSyncStatusUpdate(sku.StoreSkuSyncStatus) {
if singleStoreHandler != nil {
updateList = append(updateList, calVendorPrice4StoreSku(sku, storeDetail.PricePercentagePackObj, int(storeDetail.PricePercentage)))
@@ -347,7 +347,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
case 3:
if len(stockList) > 0 {
_, err = putils.FreeBatchStoreSkuInfo(func(batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
if err = storeSkuHandler.UpdateStoreSkusStock(ctx, storeID, vendorStoreID, stockList); err == nil {
if err = storeSkuHandler.UpdateStoreSkusStock(ctx, storeID, vendorStoreID, batchedStoreSkuList); err == nil {
_, err = updateStoreSku(dao.GetDB(), vendorID, bareSku2Sync(batchedStoreSkuList), model.SyncFlagModifiedMask) // ?
}
return nil, err
@@ -356,7 +356,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
case 4:
if len(statusList) > 0 {
_, err = putils.FreeBatchStoreSkuInfo(func(batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
if err = storeSkuHandler.UpdateStoreSkusStatus(ctx, storeID, vendorStoreID, statusList); err == nil {
if err = storeSkuHandler.UpdateStoreSkusStatus(ctx, storeID, vendorStoreID, batchedStoreSkuList); err == nil {
_, err = updateStoreSku(dao.GetDB(), vendorID, bareSku2Sync(batchedStoreSkuList), model.SyncFlagSaleMask)
}
return nil, err
@@ -365,7 +365,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
case 5:
if len(priceList) > 0 {
_, err = putils.FreeBatchStoreSkuInfo(func(batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, err error) {
if err = storeSkuHandler.UpdateStoreSkusPrice(ctx, storeID, vendorStoreID, priceList); err == nil {
if err = storeSkuHandler.UpdateStoreSkusPrice(ctx, storeID, vendorStoreID, batchedStoreSkuList); err == nil {
_, err = updateStoreSku(dao.GetDB(), vendorID, bareSku2Sync(batchedStoreSkuList), model.SyncFlagPriceMask)
}
return nil, err