Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
785f0ab5
Commit
785f0ab5
authored
Dec 04, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
f228d1c4
72e89725
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
DepartmentModule.cs
Edu.Module.User/DepartmentModule.cs
+18
-5
UserController.cs
Edu.WebApi/Controllers/User/UserController.cs
+5
-2
No files found.
Edu.Module.User/DepartmentModule.cs
View file @
785f0ab5
...
...
@@ -145,14 +145,26 @@ namespace Edu.Module.User
{
deptList
=
new
List
<
RB_Department_ViewModel
>();
}
if
(
isQueryEmployee
)
if
(
isQueryEmployee
)
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
Group_Id
=
query
.
Group_Id
});
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
Group_Id
=
query
.
Group_Id
,
School_Id
=
query
.
School_Id
});
}
if
(
deptList
!=
null
&&
deptList
.
Count
>
0
)
{
var
firstList
=
deptList
.
Where
(
qitem
=>
qitem
.
ParentId
==
0
&&
qitem
.
School_Id
==
0
).
ToList
();
var
firstList
=
new
List
<
RB_Department_ViewModel
>();
if
(
query
.
School_Id
==
0
)
{
firstList
=
deptList
.
Where
(
qitem
=>
qitem
.
ParentId
==
0
&&
qitem
.
School_Id
==
0
).
ToList
();
}
else
{
var
minParentId
=
deptList
.
Where
(
qitem
=>
qitem
.
School_Id
==
query
.
School_Id
).
Min
(
qitem
=>
qitem
.
ParentId
);
firstList
=
deptList
.
Where
(
qitem
=>
qitem
.
ParentId
==
minParentId
&&
qitem
.
School_Id
==
query
.
School_Id
).
ToList
();
}
if
(
firstList
!=
null
&&
firstList
.
Count
>
0
)
{
foreach
(
var
fItem
in
firstList
)
...
...
@@ -181,7 +193,7 @@ namespace Edu.Module.User
DeptName
=
eItem
.
EmployeeName
,
ParentId
=
0
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>(),
School_Id
=
eItem
.
School_Id
School_Id
=
eItem
.
School_Id
});
}
}
...
...
@@ -192,6 +204,7 @@ namespace Edu.Module.User
list
.
Add
(
tModel
);
}
}
}
return
list
;
}
...
...
Edu.WebApi/Controllers/User/UserController.cs
View file @
785f0ab5
...
...
@@ -897,8 +897,11 @@ namespace Edu.WebApi.Controllers.User
[
HttpPost
]
public
ApiResult
GetDeptTree
()
{
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Department_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
query
=
new
RB_Department_ViewModel
()
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
)
};
var
list
=
departmentModule
.
GetDepartmentTreeModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment