Browse Source

1.更新创建小组不创建IM群,小组学生没有修改

yuanliang 1 year ago
parent
commit
b3b6e2f06d

+ 8 - 4
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TenantGroupServiceImpl.java

@@ -161,12 +161,16 @@ public class TenantGroupServiceImpl extends ServiceImpl<TenantGroupMapper, Tenan
                     log.error("加入机构小组群失败", e);
                     throw new BizException("加入机构小组群失败");
                 }
-                studentDao.update(null, Wrappers.<Student>lambdaUpdate()
-                        .in(Student::getUserId, userIds)
-                        .eq(Student::getTenantId, tenantGroup.getTenantId())
-                        .set(Student::getTenantGroupId, entity.getId()));
             }
         }
+        // 加群成员
+        List<Long> userIds = tenantGroup.getUserIds();
+        if (CollectionUtils.isNotEmpty(userIds)) {
+            studentDao.update(null, Wrappers.<Student>lambdaUpdate()
+                    .in(Student::getUserId, userIds)
+                    .eq(Student::getTenantId, tenantGroup.getTenantId())
+                    .set(Student::getTenantGroupId, entity.getId()));
+        }
         return true;
     }