生成门店商品备份表优化
This commit is contained in:
@@ -3863,13 +3863,6 @@ func BackUpStoreSkuBind(ctx *jxcontext.Context, isAsync, isContinueWhenError boo
|
|||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
store := batchItemList[0].(*model.Store)
|
store := batchItemList[0].(*model.Store)
|
||||||
storeSku, err := dao.GetStoresSkusInfo(db, []int{store.ID}, nil)
|
storeSku, err := dao.GetStoresSkusInfo(db, []int{store.ID}, nil)
|
||||||
dao.Begin(db)
|
|
||||||
defer func() {
|
|
||||||
if r := recover(); r != nil {
|
|
||||||
dao.Rollback(db)
|
|
||||||
panic(r)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
for _, v := range storeSku {
|
for _, v := range storeSku {
|
||||||
storeSkuBindHis := &model.StoreSkuBindHistory{}
|
storeSkuBindHis := &model.StoreSkuBindHistory{}
|
||||||
storeSkuBindHis.StoreSkuBind = *v
|
storeSkuBindHis.StoreSkuBind = *v
|
||||||
@@ -3877,7 +3870,6 @@ func BackUpStoreSkuBind(ctx *jxcontext.Context, isAsync, isContinueWhenError boo
|
|||||||
storeSkuBindHis.SnapshotAt = snapshotAt
|
storeSkuBindHis.SnapshotAt = snapshotAt
|
||||||
dao.CreateEntity(db, storeSkuBindHis)
|
dao.CreateEntity(db, storeSkuBindHis)
|
||||||
}
|
}
|
||||||
dao.Commit(db)
|
|
||||||
return retVal, err
|
return retVal, err
|
||||||
}, storeList)
|
}, storeList)
|
||||||
tasksch.HandleTask(task, nil, true).Run()
|
tasksch.HandleTask(task, nil, true).Run()
|
||||||
|
|||||||
Reference in New Issue
Block a user