- updateStoresSkusWithoutSync中的事务按单门店来

This commit is contained in:
gazebo
2019-06-13 18:10:06 +08:00
parent ca62926d3f
commit f20a112fc5

View File

@@ -619,14 +619,14 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
userName := ctx.GetUserName()
needSyncIDMap := make(map[int]int)
dao.Begin(db)
defer func() {
if r := recover(); r != nil {
dao.Rollback(db)
panic(r)
}
}()
for _, storeID := range storeIDs {
dao.Begin(db)
defer func() {
if r := recover(); r != nil {
dao.Rollback(db)
panic(r)
}
}()
for _, skuBindInfo := range skuBindInfos {
inSkuBinds := skuBindInfo.Skus
var allBinds []*tStoreSkuBindAndSpec
@@ -774,8 +774,8 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBind
return nil, err
}
}
dao.Commit(db)
}
dao.Commit(db)
skuIDs := jxutils.IntMap2List(needSyncIDMap)
return skuIDs, err
}