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

+ 4 - 4
gx_api/GxPress/Repository/GxPress.Repository.Implement/DepartmentRepository.cs

@@ -416,7 +416,7 @@ namespace GxPress.Repository.Implement
                     Item = await GetDepartmentByPid(departmentId, new List<Entity.Department>(), allDepartment.ToList())
                 });
             }
-            if (departmentIds.Count() == 1)
+            if (departmentIds.Count() <= 2)
                 departmentIdsList.AddRange(departmentIds);
             for (int i = 0; i < result.Result.Count; i++)
             {
@@ -429,8 +429,8 @@ namespace GxPress.Repository.Implement
                     else if (result.Result[k].Item.Any(n => n.Id == result.Result[i].DepartmentId))
                     {
                         departmentIdsList.Add(result.Result[k].DepartmentId);
-                        result.Result[i].DepartmentId = result.Result[k].DepartmentId;
-                        result.Result[i].Item = result.Result[k].Item;
+                        // result.Result[i].DepartmentId = result.Result[k].DepartmentId;
+                        // result.Result[i].Item = result.Result[k].Item;
                     }
                     else
                     {
@@ -476,8 +476,8 @@ namespace GxPress.Repository.Implement
                     }
                     else
                     {
-                        //departmentIdsList.Add(result.Result[i].DepartmentId);
                         departmentIdsList.Add(result.Result[i].DepartmentId);
+                        departmentIdsList.Add(result.Result[k].DepartmentId);
                     }
                 }
             }

+ 4 - 4
gx_api/GxPress/Service/GxPress.Service.Implement/Department/DepartmentService.cs

@@ -118,7 +118,7 @@ namespace GxPress.Service.Implement.Department
                     Item = await _departmentRepository.GetDepartmentByPid(departmentId, new List<Entity.Department>(), allDepartment.ToList())
                 });
             }
-            if (departmentIds.Count() == 1)
+            if (departmentIds.Count() <= 2)
                 departmentIdsList.AddRange(departmentIds);
             for (int i = 0; i < result.Result.Count; i++)
             {
@@ -131,12 +131,12 @@ namespace GxPress.Service.Implement.Department
                     else if (result.Result[k].Item.Any(n => n.Id == result.Result[i].DepartmentId))
                     {
                         departmentIdsList.Add(result.Result[k].DepartmentId);
-                        result.Result[i].DepartmentId = result.Result[k].DepartmentId;
-                        result.Result[i].Item = result.Result[k].Item;
+                        // result.Result[i].DepartmentId = result.Result[k].DepartmentId;
+                        // result.Result[i].Item = result.Result[k].Item;
                     }
                     else
                     {
-                        //departmentIdsList.Add(result.Result[i].DepartmentId);
+                        // departmentIdsList.Add(result.Result[k].DepartmentId);
                         departmentIdsList.Add(result.Result[i].DepartmentId);
                     }
                 }

+ 0 - 1
gx_api/GxPress/Service/GxPress.Service.Implement/UserService.cs

@@ -382,7 +382,6 @@ namespace GxPress.Service.Implement
             if (departmentIds.Count() > 0)
             {
                 var userLinkModelAttributeResult = new List<UserLinkModelAttributeResult>();
-
                 var departments = await _departmentRepository.GetUserInDepartmentAsync(departmentIds.ToList());
                 foreach (var department in departments)
                 {