- updateStoresSkusWithoutSync中的事务按单门店来
This commit is contained in:
@@ -619,6 +619,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
|||||||
|
|
||||||
userName := ctx.GetUserName()
|
userName := ctx.GetUserName()
|
||||||
needSyncIDMap := make(map[int]int)
|
needSyncIDMap := make(map[int]int)
|
||||||
|
for _, storeID := range storeIDs {
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
if r := recover(); r != nil {
|
if r := recover(); r != nil {
|
||||||
@@ -626,7 +627,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
|||||||
panic(r)
|
panic(r)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
for _, storeID := range storeIDs {
|
|
||||||
for _, skuBindInfo := range skuBindInfos {
|
for _, skuBindInfo := range skuBindInfos {
|
||||||
inSkuBinds := skuBindInfo.Skus
|
inSkuBinds := skuBindInfo.Skus
|
||||||
var allBinds []*tStoreSkuBindAndSpec
|
var allBinds []*tStoreSkuBindAndSpec
|
||||||
@@ -774,8 +774,8 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
dao.Commit(db)
|
dao.Commit(db)
|
||||||
|
}
|
||||||
skuIDs := jxutils.IntMap2List(needSyncIDMap)
|
skuIDs := jxutils.IntMap2List(needSyncIDMap)
|
||||||
return skuIDs, err
|
return skuIDs, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user