|
@@ -460,10 +460,10 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
|
|
|
|
|
|
// 机构老师与学生互加好友关系
|
|
|
if (Optional.ofNullable(teacher.getTenantId()).orElse(-1L) > 0) {
|
|
|
- // 自动与机构老师成为好友
|
|
|
+ // 自动与机构学生成为好友
|
|
|
Set<Long> collect = studentService.lambdaQuery()
|
|
|
.eq(Student::getTenantId, teacher.getTenantId()).list().stream()
|
|
|
- .map(Student::getUserId).filter(next->!next.equals(teacher.getUserId())).collect(Collectors.toSet());
|
|
|
+ .map(Student::getUserId).collect(Collectors.toSet());
|
|
|
|
|
|
imUserFriendService.saveUserFriend(teacher.getUserId(), collect);
|
|
|
}
|
|
@@ -476,7 +476,7 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
|
|
|
queryWrapper.lambda().in(com.yonge.cooleshow.biz.dal.entity.SysUser::getPhone,phones);
|
|
|
List<com.yonge.cooleshow.biz.dal.entity.SysUser> sysUsers = sysUserMapper.selectList(queryWrapper);
|
|
|
Set<Long> userIds = sysUsers.stream().map(com.yonge.cooleshow.biz.dal.entity.SysUser::getId).collect(Collectors.toSet());
|
|
|
- if (userIds.isEmpty()) {
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
imUserFriendService.saveUserTeacherFriend(teacher.getUserId(), userIds);
|
|
|
}
|
|
|
}
|
|
@@ -1075,10 +1075,10 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
|
|
|
|
|
|
// 机构老师与学生互加好友关系
|
|
|
if (Optional.ofNullable(updateTenant.getTenantId()).orElse(-1L) > 0) {
|
|
|
- // 自动与机构老师成为好友
|
|
|
+ // 自动与机构学生成为好友
|
|
|
Set<Long> collect = studentService.lambdaQuery()
|
|
|
.eq(Student::getTenantId, updateTenant.getTenantId()).list().stream()
|
|
|
- .map(Student::getUserId).filter(next -> !next.equals(teacher.getUserId()))
|
|
|
+ .map(Student::getUserId)
|
|
|
.collect(Collectors.toSet());
|
|
|
|
|
|
if (!collect.isEmpty()) {
|