李昊 4 年之前
父節點
當前提交
d22c1a7544

+ 2 - 0
gx_api/GxPress/Model/GxPress.Result/AddressBookGroup/AddressBookGroupResult.cs

@@ -28,5 +28,7 @@ namespace GxPress.Result.AddressBookGroup
         /// </summary>
         /// <value></value>
         public bool IsChildren{get;set;}
+
+        public int UserCount{get;set;}
     }
 }

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/User/UserResult.cs

@@ -116,6 +116,11 @@ namespace GxPress.Result.User
         /// </summary>
         /// <value></value>
         public int TypeValue { get; set; }
+        /// <summary>
+        /// 人数
+        /// </summary>
+        /// <value></value>
+        public int UserCount { get; set; }
     }
     /// <summary>
     /// 

+ 1 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/AddressBookGroupRepository.cs

@@ -87,6 +87,7 @@ namespace GxPress.Repository.Implement
                 {
                     addressBookGroupResults[i].IsChildren = await _repository.ExistsAsync(Q.Where(nameof(AddressBookGroup.UserId), request.UserId).Where(nameof(AddressBookGroup.ParentId), addressBookGroupResults[i].Id));
                 }
+                addressBookGroupResults[i].UserCount = await _addressBookGroupUserRepository.CountAsync(Q.Where(nameof(Entity.AddressBookGroupUser.AddressBookGroupId), addressBookGroupResults[i].Id));
             }
             return addressBookGroupResults;
         }

+ 0 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Department/DepartmentService.Delete.cs

@@ -1,7 +1,5 @@
-using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Threading.Tasks;
 using GxPress.Entity;
 using SqlKata;

+ 0 - 8
gx_api/GxPress/Service/GxPress.Service.Implement/Department/DepartmentService.cs

@@ -1,15 +1,7 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Threading.Tasks;
 using AutoMapper;
-using GxPress.Common.AppOptions;
-using GxPress.Entity;
 using GxPress.Repository.Interface;
 using GxPress.Service.Interface;
 using GxPress.Service.Interface.Department;
-using Microsoft.Extensions.Options;
-using Datory;
 
 namespace GxPress.Service.Implement.Department
 {

+ 18 - 5
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -354,12 +354,12 @@ namespace GxPress.Service.Implement
             var result = await _userRepository.GetUserCountAsync(userId);
             //工作我的审批未操作数量
             var request = new FlowListRequest();
-            result.FlowAuditUReadCount = await _flowTodoRepository.CountAsync(Q.Where(nameof(Entity.WorkFlow.FlowTodo.UserId),userId).Where(nameof(Entity.WorkFlow.FlowTodo.Type),"ApproverCheck").Where(nameof(Entity.WorkFlow.FlowTodo.IsRead),false));
+            result.FlowAuditUReadCount = await _flowTodoRepository.CountAsync(Q.Where(nameof(Entity.WorkFlow.FlowTodo.UserId), userId).Where(nameof(Entity.WorkFlow.FlowTodo.Type), "ApproverCheck").Where(nameof(Entity.WorkFlow.FlowTodo.IsRead), false));
             // 工作我发起的已批复未读数量
             // var flowState = new List<string> { FlowState.Checked.GetValue(), FlowState.Denied.GetValue() };
             // result.FlowSendUReadCount = await _flowRepository.CountAsync(Q.Where(nameof(Entity.WorkFlow.Flow.UserId), userId).WhereIn(nameof(Entity.WorkFlow.Flow.State), flowState).Where(nameof(Entity.WorkFlow.Flow.IsRead), false).Where(nameof(Entity.WorkFlow.Flow.ProcessId), ">", 0));
             // 工作抄送我的未读数量
-           // result.FlowCcUReadCount = await _flowTodoRepository.FlowCcUReadCountAsync(userId);
+            // result.FlowCcUReadCount = await _flowTodoRepository.FlowCcUReadCountAsync(userId);
             //待办事项未执行数量
             result.WaitHandleUFinishCount = await waitHandleRepository.GetUFinishAsync(userId);
             return result;
@@ -383,7 +383,15 @@ namespace GxPress.Service.Implement
                 {
                     var departments = await _departmentRepository.GetAllAsync(Q.Where(nameof(Entity.Department.Id), item));
                     foreach (var department in departments)
-                        userLinkModelAttributeResult.Add(new UserLinkModelAttributeResult { Id = department.Id, Name = department.Name });
+                    {
+                        var userInfoResults = await GetUserInfoByDepartentResult(department.Id);
+                        userLinkModelAttributeResult.Add(new UserLinkModelAttributeResult
+                        {
+                            Id = department.Id,
+                            Name = department.Name,
+                            UserCount = userInfoResults.Count()
+                        });
+                    }
                 }
                 userLinkResult.Add(new UserLinkModelResult
                 {
@@ -401,7 +409,7 @@ namespace GxPress.Service.Implement
                   Items = new List<UserLinkModelAttributeResult>{
                         new UserLinkModelAttributeResult{Id=0,Name="我的小组",TypeValue=1},
                         new UserLinkModelAttributeResult{Id=0,Name="我的群聊",TypeValue=2},
-                        new UserLinkModelAttributeResult{Id=0,Name="我的课程",TypeValue=3}
+                        //new UserLinkModelAttributeResult{Id=0,Name="我的课程",TypeValue=3}
                   }
               }
           );
@@ -410,7 +418,12 @@ namespace GxPress.Service.Implement
                 new AddressBookGroupSearchRequest { ParendId = 0, UserId = userId });
             var systemLinkModelAttributeResults = new List<UserLinkModelAttributeResult>();
             foreach (var item in addressBookGroupList)
-                systemLinkModelAttributeResults.Add(new UserLinkModelAttributeResult { Id = item.Id, Name = item.GroupName });
+                systemLinkModelAttributeResults.Add(new UserLinkModelAttributeResult
+                {
+                    Id = item.Id,
+                    Name = item.GroupName,
+                    UserCount = item.UserCount
+                });
             if (addressBookGroupList.Count() > 0)
                 userLinkResult.Add(
                     new UserLinkModelResult