修复删除饿百活动商品失败的bug

在删除门店商品失败时,尝试设置不可售
This commit is contained in:
gazebo
2019-11-08 15:24:51 +08:00
parent c5a01f1e9b
commit 7d230ecf1e
3 changed files with 9 additions and 6 deletions

View File

@@ -447,6 +447,8 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, isFull bo
}
if err == nil {
successList = batchedStoreSkuList
} else {
offlineList = append(offlineList, batchedStoreSkuList...)
}
if len(successList) > 0 {
updateStoreSku(dao.GetDB(), vendorID, bareSku2Sync(successList), model.SyncFlagDeletedMask)
@@ -665,7 +667,10 @@ func amendAndPruneStoreStuff(ctx *jxcontext.Context, parentTask tasksch.ITask, v
case 1:
if (opType == AmendPruneOnlyPrune || opType == AmendPruneAll) && len(sku2Delete) > 0 {
_, err = putils.FreeBatchStoreSkuInfo("删除门店商品", func(task tasksch.ITask, batchedStoreSkuList []*partner.StoreSkuInfo) (result interface{}, successCount int, err error) {
_, err = handler.DeleteStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList)
if _, err = handler.DeleteStoreSkus(ctx, storeID, vendorStoreID, batchedStoreSkuList); err != nil {
// 如果删除失败尝试设置不可售假定删除批处理SIZE小于等于设置门店商品可售批处理SIZE
handler.UpdateStoreSkusStatus(ctx, storeID, vendorStoreID, batchedStoreSkuList, model.SkuStatusDontSale)
}
return nil, 0, err
}, ctx, task, sku2Delete, handler.GetStoreSkusBatchSize(partner.FuncDeleteStoreSkus), isContinueWhenError)
}