|
@@ -21,6 +21,8 @@ import com.yonge.cooleshow.biz.dal.dto.search.QueryMyFollowSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.ImGroupMemberRoleType;
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.ImGroupType;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantAlbumPurchaseMapper;
|
|
@@ -621,6 +623,33 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
if (student == null) {
|
|
|
throw new BizException("学生信息不存在");
|
|
|
}
|
|
|
+ // 是否有修改机构
|
|
|
+ Long newTenantId = studentInfo.getTenantId();
|
|
|
+ if(newTenantId != null && !newTenantId.equals(student.getTenantId())){
|
|
|
+ // 退群
|
|
|
+ List<ImGroupMember> groupMembers = imGroupMemberService.lambdaQuery()
|
|
|
+ .eq(ImGroupMember::getRoleType, ImGroupMemberRoleType.STUDENT)
|
|
|
+ .eq(ImGroupMember::getIsAdmin, false)
|
|
|
+ .eq(ImGroupMember::getUserId, student.getUserId())
|
|
|
+ .list();
|
|
|
+ List<String> groupIdList = groupMembers.stream().map(ImGroupMember::getGroupId)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+ if(groupIdList.isEmpty()){
|
|
|
+// imGroupService.listByIds(groupIdList).stream().filter(next-> ImGroupType.ORG.equals(next.getType())).map(next->)
|
|
|
+
|
|
|
+ }
|
|
|
+ groupIdList.forEach(groupId -> {
|
|
|
+ try {
|
|
|
+ imGroupService.quit(groupId, student.getUserId(), ClientEnum.STUDENT);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("学生注册,切换机构退群失败:{}", e.getMessage());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 删除好友
|
|
|
+// imUserFriendService.delTeacherFriendByTenantId(tenantId, one.getUserId(),ClientEnum.TEACHER.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 手机号码修改
|
|
|
if (!student.getPhone().equals(studentInfo.getPhone())) {
|
|
|
com.yonge.cooleshow.biz.dal.entity.SysUser sysUser = getOrCreateAccount(studentInfo);
|