- AddStoreVendorMap同步失败后回滚本地数据

This commit is contained in:
gazebo
2019-08-13 19:56:06 +08:00
parent f8a5e1bc8d
commit 18ad339e0c
2 changed files with 8 additions and 3 deletions

View File

@@ -796,7 +796,6 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID
}
}()
if err = dao.CreateEntity(db, storeMap); err == nil {
dao.Commit(db)
outStoreMap = storeMap
if store != nil {
_, err = CurVendorSync.SyncStore(ctx, db, storeMap.VendorID, storeID, false, userName)
@@ -804,6 +803,8 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendorID
}
if err != nil {
dao.Rollback(db)
} else {
dao.Commit(db)
}
}
} else {