|
@@ -213,6 +213,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
return failRecords;
|
|
|
}
|
|
|
+ clearUser(schoolId);
|
|
|
for (int i = 0; i < userList.size(); i++) {
|
|
|
UserDomain cur = userList.get(i);
|
|
|
cur.setPasswd(DEFAULT_PASSWD);
|
|
@@ -243,6 +244,15 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void clearUser(Long schoolId) {
|
|
|
+ userCourseRelationService.clearBySchool(schoolId);
|
|
|
+ QueryWrapper<UserEntity> wrapper = new QueryWrapper<>();
|
|
|
+ LambdaQueryWrapper<UserEntity> lw = wrapper.lambda();
|
|
|
+ lw.eq(UserEntity::getSchoolId, schoolId);
|
|
|
+ lw.ne(UserEntity::getRoleId, Role.SUPER_ADMIN.getId());
|
|
|
+ this.remove(wrapper);
|
|
|
+ }
|
|
|
+
|
|
|
private String trimAndNullIfBlank(String s) {
|
|
|
if (StringUtils.isBlank(s)) {
|
|
|
return null;
|