exprefix索引,order修改

This commit is contained in:
苏尹岚
2019-12-20 14:32:14 +08:00
parent fc588aec60
commit 0a8a0faec4
6 changed files with 29 additions and 29 deletions

View File

@@ -165,20 +165,13 @@ func syncStoreSku() {
if (time.Now().Unix()/24*3600)%10 == 0 {
syncFlag |= model.SyncFlagSaleMask
}
db := dao.GetDB()
task := tasksch.NewParallelTask("同步京西与平台数据", nil, jxcontext.AdminCtx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
step := batchItemList[0].(int)
errList := errlist.New()
switch step {
case 0:
//清除skuname中额外前缀过期的时间
err = cms.DeleteSkuNameExPrefixOverdue(db)
//为sku和storeSkuBind打上要更新商品额外前缀的标记
err = cms.SetMultiStoreSkuSyncModifyStatus(db, partner.GetMultiStoreVendorIDs())
err = cms.SetSingleStoreSkuSyncModifyStatus(db, partner.GetSingleStoreVendorIDs())
case 1:
_, err = cms.CurVendorSync.LoopMultiStoresVendors(jxcontext.AdminCtx, db, "同步多门店平台商品库", false, true,
_, err = cms.CurVendorSync.LoopMultiStoresVendors(jxcontext.AdminCtx, dao.GetDB(), "同步多门店平台商品库", false, true,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
vendorInfo := batchItemList[0].(*cms.MultiStoreVendorInfo)
_, err = cms.FullSyncVendorStuff(jxcontext.AdminCtx, task, vendorInfo.VendorID, vendorInfo.OrgCode, false, true)
@@ -187,20 +180,20 @@ func syncStoreSku() {
errList.AddErr(err)
// cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, dao.GetDB(), partner.GetMultiStoreVendorIDs(), nil, false, nil, []int{27379}, syncFlag, true, true)
_, err = cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, db, partner.GetMultiStoreVendorIDs(), nil, false, []int{27379}, true, true)
_, err = cms.CurVendorSync.FullSyncStoresSkus(jxcontext.AdminCtx, dao.GetDB(), partner.GetMultiStoreVendorIDs(), nil, false, []int{27379}, true, true)
errList.AddErr(err)
case 2:
case 1:
_, err = cms.CurVendorSync.AmendAndPruneStoreStuff(jxcontext.AdminCtx, partner.GetSingleStoreVendorIDs(), nil, false, true, cms.AmendPruneAll, false)
errList.AddErr(err)
SaveImportantTaskID(TaskNameSyncStoreSku, SpecialTaskID)
taskID, err2 := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, db, partner.GetSingleStoreVendorIDs(), nil, false, nil, nil, syncFlag, true, true)
taskID, err2 := cms.CurVendorSync.SyncStoresSkus2(jxcontext.AdminCtx, dao.GetDB(), partner.GetSingleStoreVendorIDs(), nil, false, nil, nil, syncFlag, true, true)
errList.AddErr(err2)
SaveImportantTaskID(TaskNameSyncStoreSku, taskID)
}
err = errList.GetErrListAsOne()
return retVal, err
}, []int{0, 1, 2})
}, []int{0, 1})
tasksch.HandleTask(task, nil, true).Run()
}