lihao лет назад: 4
Родитель
Сommit
96bc9a3973

+ 7 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/Note/NoteRepository.cs

@@ -126,7 +126,13 @@ namespace GxPress.Repository.Implement.Note
                                                                 INNER JOIN
                                                             tede_department_user b ON a.Id = b.DepartmentId
                                                         WHERE
-                                                            b.UserId = {request.UserId}) as DepartmentName
+                                                            b.UserId = {request.UserId}) as DepartmentName,
+                                                         (SELECT 
+                                                            FolderName
+                                                        FROM
+                                                            tede_middle
+                                                        WHERE
+                                                            id = a.FolderId) AS FolderName
                         FROM
                             tede_note a
                                 INNER JOIN

+ 8 - 6
gx_api/GxPress/Service/GxPress.Service.Implement/AdminVerify/AdminVerifyInsetService.cs

@@ -55,6 +55,11 @@ namespace GxPress.Service.Implement.AdminVerify
             var users = await _userRepository.GetAllAsync(Q.WhereIn(nameof(Entity.User.Id), request.UserIds));
             var departmentUsers = await departmentUserRepository.GetDepartmentUsersByUserIdsAsync(request.UserIds);
             var departments = await _departmentRepository.GetAllAsync(Q.WhereIn(nameof(Entity.Department.Id), departmentUsers.Select(n => n.DepartmentId)));
+            //获取小组
+            var group = await _groupRepository.GetAsync(request.SourceId);
+            var ids = new List<int> { GroupUserRoleTyeConst.Admin.GetHashCode(), GroupUserRoleTyeConst.SuperAdmin.GetHashCode() };
+            //创建人
+            var groupUsers = await _groupUserRepository.GetAllAsync(Q.Where(nameof(GroupUser.GroupId), group.Id).WhereIn(nameof(GroupUser.GroupUserRoleId), ids));
             foreach (var userId in request.UserIds)
             {
                 var adminVerify = new Entity.AdminVerify();
@@ -68,7 +73,7 @@ namespace GxPress.Service.Implement.AdminVerify
                 {
                     department = departments.FirstOrDefault(m => m.Id == departmentUsers.FirstOrDefault(n => n.UserId == user.Id).DepartmentId);
                 }
-                var group = await _groupRepository.GetAsync(request.SourceId);
+
                 var query = Q.NewQuery();
                 query.Where(nameof(Entity.AdminVerify.AdminId), userId);
                 query.Where(nameof(Entity.AdminVerify.SourceType), request.SourceType);
@@ -82,13 +87,10 @@ namespace GxPress.Service.Implement.AdminVerify
                 //申请
                 if (request.SourceType == 1)
                 {
-                    var ids = new List<int> { GroupUserRoleTyeConst.Admin.GetHashCode(), GroupUserRoleTyeConst.SuperAdmin.GetHashCode() };
-                    //创建人
-                    var groupUsers = await _groupUserRepository.GetAllAsync(Q.Where(nameof(GroupUser.GroupId), group.Id).WhereIn(nameof(GroupUser.GroupUserRoleId), ids));
                     foreach (var groupUser in groupUsers)
                     {
                         //设置群主验证
-                        await InsertMiddleVerify(groupUser.UserId);
+                        //await InsertMiddleVerify(groupUser.UserId);
                         adminVerifyDto.AvatarUrl = StringUtils.RemoveDomain(user.AvatarUrl);
                         adminVerifyDto.SourceName = group.Name;
                         adminVerifyDto.Name = user.Name;
@@ -125,7 +127,7 @@ namespace GxPress.Service.Implement.AdminVerify
                     adminVerify.Remark = department.Name + "-" + userDto.Name;
                     //await _adminVerifyRepository.InsertAsync(adminVerify);
                     adminVerifys.Add(adminVerify);
-                    await InsertMiddleVerify(userId);
+                    //await InsertMiddleVerify(userId);
                 }
             }
             await _adminVerifyRepository.InsertAsync(adminVerifys);

+ 2 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

@@ -618,8 +618,8 @@ namespace GxPress.Service.Implement.Note
                 var middleInsertTypes = new MiddleInsertTypeRequest
                 {
                     FolderId = note.FolderId,
-                    MiddleId = note.Id,
-                    FolderType = note.IsTopic ? AllTypeConst.TopicNote.GetHashCode() : AllTypeConst.Note.GetHashCode(),
+                    MiddleId = entity.Id,
+                    FolderType = entity.IsTopic ? AllTypeConst.TopicNote.GetHashCode() : AllTypeConst.Note.GetHashCode(),
                     UserId = entity.UserId,
                     MiddleSonId = 0,
                     AttributeValue = 1,