|
|
@@ -229,6 +229,13 @@ public class UserService extends AbstractBaseEntityService<User, Long, UserRepos |
|
|
|
List<Map<String, Integer>> authBatchDeleteValues = req.getRemoveAuthIds().stream() |
|
|
|
.map(authId -> Map.of("userId", (int)id, "authId", authId)) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (!authBatchDeleteValues.isEmpty()) { |
|
|
|
jdbcDao.batchUpdate( |
|
|
|
"DELETE FROM user_authority" |
|
|
|
+ " WHERE userId = :userId ", |
|
|
|
// + "AND authId = :authId", |
|
|
|
authBatchDeleteValues); |
|
|
|
} |
|
|
|
if (!authBatchInsertValues.isEmpty()) { |
|
|
|
jdbcDao.batchUpdate( |
|
|
|
"INSERT IGNORE INTO user_authority (userId, authId)" |
|
|
@@ -236,13 +243,6 @@ public class UserService extends AbstractBaseEntityService<User, Long, UserRepos |
|
|
|
authBatchInsertValues); |
|
|
|
} |
|
|
|
|
|
|
|
if (!authBatchDeleteValues.isEmpty()) { |
|
|
|
jdbcDao.batchUpdate( |
|
|
|
"DELETE FROM user_authority" |
|
|
|
+ " WHERE userId = :userId ", |
|
|
|
// + "AND authId = :authId", |
|
|
|
authBatchDeleteValues); |
|
|
|
} |
|
|
|
return instance; |
|
|
|
} |
|
|
|
|
|
|
|