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

@@ -1344,10 +1344,10 @@ func UpdateSkuNamesExPrefix(ctx *jxcontext.Context, nameIDs []int, exPrefix, fro
db = dao.GetDB()
)
if fromTime != "" {
fromTimeP = utils.Str2Time(fromTime)
fromTimeP = utils.Time2Date(utils.Str2Time(fromTime))
}
if toTime != "" {
toTimeP = utils.Str2Time(toTime)
toTimeP = utils.Time2Date(utils.Str2Time(toTime))
}
if toTimeP.Before(fromTimeP) {
return "", fmt.Errorf("结束时间不可以小于开始时间!开始时间:[%v],结束时间:[%v]", fromTimeP, toTimeP)

View File

@@ -2532,8 +2532,15 @@ func GetVendorStoreSkuPrice(ctx *jxcontext.Context, vendorIDs []int, skuID int,
storeDetail *dao.StoreDetail
inStoreSku = &partner.StoreSkuInfo{}
)
skuNameList, err := dao.GetSkus(dao.GetDB(), []int{skuID}, nil, nil, nil)
storeMap := &model.StoreMap{
VendorID: vendorID,
Status: model.SkuStatusNormal,
VendorStoreID: vendorStoreID,
}
db := dao.GetDB()
dao.GetEntity(db, storeMap, "StoreID")
fmt.Println(storeMap.StoreID)
skuNameList, err := dao.GetSkus(db, []int{skuID}, nil, nil, nil)
if err != nil {
return retVal, err
}

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()
}