This commit is contained in:
邹宗楠
2024-05-17 18:17:05 +08:00
parent 9c54c8a986
commit 9eb744874b
2 changed files with 6 additions and 9 deletions

View File

@@ -813,16 +813,14 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
} }
successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList)) successList := putils.UnselectStoreSkuSyncListByVendorSkuIDs(batchedStoreSkuList, GetVendorSkuIDList(failedList))
if len(successList) > 0 { if len(successList) > 0 {
_, err := updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagNewMask) _, err = updateStoreSku(dao.GetDB(), vendorID, successList, model.SyncFlagNewMask)
if err != nil {
globals.SugarLogger.Debugf("20.sth wrong on updateStoreSku: %v", err)
} }
if vendorID == model.VendorIDDD {
_, err = updateStoreSku(dao.GetDB(), vendorID, batchedStoreSkuList, model.SyncFlagNewMask)
} }
return nil, len(successList), err return nil, len(successList), err
}, ctx, task, createList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkus), isContinueWhenError2) }, ctx, task, createList, singleStoreHandler.GetStoreSkusBatchSize(partner.FuncUpdateStoreSkus), isContinueWhenError2)
if err != nil {
globals.SugarLogger.Debug("create sku wrong on ", err)
}
} }
case 2: case 2:
if len(updateList) > 0 { if len(updateList) > 0 {

View File

@@ -318,8 +318,7 @@ func UnselectStoreSkuSyncListByVendorSkuIDs(storeSkuList []*dao.StoreSkuSyncInfo
if len(vendorSkuIDs) > 0 { if len(vendorSkuIDs) > 0 {
vendorSkuIDMap := jxutils.StringList2Map(vendorSkuIDs) vendorSkuIDMap := jxutils.StringList2Map(vendorSkuIDs)
for _, v := range storeSkuList { for _, v := range storeSkuList {
//if vendorSkuIDMap[v.VendorSkuID] == 0 { if vendorSkuIDMap[v.VendorSkuID] == 0 {
if vendorSkuIDMap[v.VendorSkuID] == 0 || v.VendorID == model.VendorIDDD { // 抖音商品失败之后也当做成功,更新失败原因已经同步状态,防止定时任务一直更新(图片,经营类目等错误)
selectedStoreSkuList = append(selectedStoreSkuList, v) selectedStoreSkuList = append(selectedStoreSkuList, v)
} }
} }