|
@@ -68,10 +68,9 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
|
|
|
return imGroupMemberDao;
|
|
|
}
|
|
|
|
|
|
- public void joinGroup(Long imGroupId, Integer userId, String roleType, boolean isAdmin){
|
|
|
+ public void joinGroup(Long imGroupId, Integer userId, String roleType, boolean isAdmin,Map<Integer,String> userRoleMap){
|
|
|
ClassGroup classGroup = classGroupDao.get(imGroupId.intValue());
|
|
|
String tags = classGroup.getName();
|
|
|
- Map<Integer,String> userRoleMap = new HashMap<>();
|
|
|
//相关用户加入群组
|
|
|
//获取班级关联的老师列表
|
|
|
Set<Integer> teacherIds = classGroupTeacherMapperDao.queryTeacherIdsByClassGroupId(imGroupId.intValue(),null,null);
|
|
@@ -104,8 +103,10 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
|
|
|
userRoleMap.put(vipGroup.getEducationalTeacherId(), "乐团主管");
|
|
|
tags = vipGroup.getName();
|
|
|
}
|
|
|
- imGroupService.create(imGroupId, null, classGroup.getName(), null, null, tags, null, classGroup.getGroupType().getCode());
|
|
|
- join(imGroupId,userId,roleType,isAdmin);
|
|
|
+ imGroupService.create(imGroupId, null, classGroup.getName(), tags, tags, tags, null, classGroup.getGroupType().getCode());
|
|
|
+ if(userId != null){
|
|
|
+ join(imGroupId,userId,roleType,isAdmin);
|
|
|
+ }
|
|
|
join(imGroupId,userRoleMap);
|
|
|
}
|
|
|
|
|
@@ -114,7 +115,7 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
|
|
|
public boolean join(Long imGroupId, Integer userId, String roleType, boolean isAdmin) {
|
|
|
ImGroup imGroup = imGroupDao.getLocked(imGroupId);
|
|
|
if (imGroup == null) {
|
|
|
- joinGroup(imGroupId,userId,roleType,isAdmin);
|
|
|
+ joinGroup(imGroupId,userId,roleType,isAdmin,new HashMap<>());
|
|
|
return true;
|
|
|
}
|
|
|
//检查用户是否已存在
|
|
@@ -159,13 +160,7 @@ public class ImGroupMemberServiceImpl extends BaseServiceImpl<Long, ImGroupMembe
|
|
|
public boolean join(Long imGroupId, Map<Integer, String> userRoleMap) {
|
|
|
ImGroup imGroup = imGroupDao.getLocked(imGroupId);
|
|
|
if (imGroup == null) {
|
|
|
- ClassGroup classGroup = classGroupDao.get(imGroupId.intValue());
|
|
|
- String tags = classGroup.getName();
|
|
|
- if(classGroup.getGroupType() == GroupType.MUSIC){
|
|
|
- MusicGroup musicGroup = musicGroupDao.get(classGroup.getMusicGroupId());
|
|
|
- tags = musicGroup.getName();
|
|
|
- }
|
|
|
- imGroup = imGroupService.create(imGroupId, null, classGroup.getName(), null, null, tags, null, classGroup.getGroupType().getCode());
|
|
|
+ joinGroup(imGroupId,null,null,false,userRoleMap);
|
|
|
}
|
|
|
//检查用户是否已存在
|
|
|
List<Integer> existUserIdList = imGroupMemberDao.queryByImGroupIdAndUserId(imGroupId.toString(), userRoleMap.keySet().stream().filter(Objects::nonNull).map(Objects::toString)
|