|
@@ -45,6 +45,7 @@ import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Optional;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -367,9 +368,10 @@ public class TenantGroupServiceImpl extends ServiceImpl<TenantGroupMapper, Tenan
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
String imGroupId = groupBy.get(detail.getTenantGroupId());
|
|
String imGroupId = groupBy.get(detail.getTenantGroupId());
|
|
|
|
+ ImGroup imGroup = imGroupService.getById(Optional.ofNullable(imGroupId).orElse("-1"));
|
|
if (toTeacher != null) {
|
|
if (toTeacher != null) {
|
|
// 更换群主
|
|
// 更换群主
|
|
- if (!StringUtils.isEmpty(imGroupId)) {
|
|
|
|
|
|
+ if (imGroup != null) {
|
|
// 新负责人加入群
|
|
// 新负责人加入群
|
|
try {
|
|
try {
|
|
SysUser newTeacher = sysUserService.getByUserId(toTeacher);
|
|
SysUser newTeacher = sysUserService.getByUserId(toTeacher);
|
|
@@ -400,11 +402,12 @@ public class TenantGroupServiceImpl extends ServiceImpl<TenantGroupMapper, Tenan
|
|
}
|
|
}
|
|
this.lambdaUpdate()
|
|
this.lambdaUpdate()
|
|
.set(TenantGroup::getAdminId, toTeacher)
|
|
.set(TenantGroup::getAdminId, toTeacher)
|
|
|
|
+ .set(imGroup == null, TenantGroup::getImGroupId, "-1")
|
|
.eq(TenantGroup::getId, detail.getTenantGroupId())
|
|
.eq(TenantGroup::getId, detail.getTenantGroupId())
|
|
.update();
|
|
.update();
|
|
} else if (Boolean.TRUE.equals(detail.getDismiss())) {
|
|
} else if (Boolean.TRUE.equals(detail.getDismiss())) {
|
|
// 解散群
|
|
// 解散群
|
|
- if (!StringUtils.isEmpty(imGroupId)) {
|
|
|
|
|
|
+ if (imGroup != null) {
|
|
try {
|
|
try {
|
|
imGroupCoreService.groupDismiss(imGroupId);
|
|
imGroupCoreService.groupDismiss(imGroupId);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|