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
0c150ed5
Commit
0c150ed5
authored
Dec 03, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门调整
parent
fca9d00e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
66 deletions
+18
-66
DepartmentTree_ViewModel.cs
Edu.Model/ViewModel/User/DepartmentTree_ViewModel.cs
+5
-0
DepartmentModule.cs
Edu.Module.User/DepartmentModule.cs
+9
-65
RB_DepartmentRepository.cs
Edu.Repository/User/RB_DepartmentRepository.cs
+4
-0
WorkFlowController.cs
Edu.WebApi/Controllers/User/WorkFlowController.cs
+0
-1
No files found.
Edu.Model/ViewModel/User/DepartmentTree_ViewModel.cs
View file @
0c150ed5
...
...
@@ -28,6 +28,11 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public
int
School_Id
{
get
;
set
;
}
/// <summary>
/// 是否校区 1是
/// </summary>
public
int
IsCompany
{
get
;
set
;
}
/// <summary>
/// 下级部门列表
...
...
Edu.Module.User/DepartmentModule.cs
View file @
0c150ed5
...
...
@@ -140,7 +140,6 @@ namespace Edu.Module.User
List
<
DepartmentTree_ViewModel
>
list
=
new
List
<
DepartmentTree_ViewModel
>();
//所有的部门列表
var
deptList
=
GetDepartmentListModule
(
query
);
var
schoolList
=
schoolRepository
.
GetSchoolListRepository
(
new
RB_School_ViewModel
()
{
Group_Id
=
query
.
Group_Id
});
var
empList
=
new
List
<
Employee_ViewModel
>();
if
(
deptList
==
null
)
{
...
...
@@ -150,46 +149,6 @@ namespace Edu.Module.User
{
empList
=
accountRepository
.
GetEmployeeListRepository
(
new
Employee_ViewModel
()
{
Group_Id
=
query
.
Group_Id
});
}
//校区部门
List
<
DepartmentTree_ViewModel
>
schoolDeptList
=
new
List
<
DepartmentTree_ViewModel
>();
if
(
schoolList
!=
null
)
{
foreach
(
var
item
in
schoolList
)
{
DepartmentTree_ViewModel
tModel
=
new
DepartmentTree_ViewModel
()
{
DeptId
=
item
.
SId
+
10000
,
DeptName
=
item
.
SName
,
ParentId
=
item
.
Dept_Id
,
School_Id
=
item
.
SId
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>()
};
#
region
添加员工信息
if
(
isQueryEmployee
&&
item
.
ManagerId
>
0
)
{
var
empModel
=
empList
?.
Where
(
qitem
=>
qitem
.
Id
==
item
.
ManagerId
)?.
FirstOrDefault
();
if
(
empModel
!=
null
&&
!
string
.
IsNullOrEmpty
(
empModel
.
EmployeeName
))
{
tModel
.
ChildList
.
Add
(
new
DepartmentTree_ViewModel
()
{
DeptId
=
empModel
.
Id
,
DeptName
=
empModel
.
EmployeeName
,
ParentId
=
0
,
School_Id
=
empModel
.
School_Id
,
});
}
}
#
endregion
var
currentSchoolDeptList
=
deptList
.
Where
(
qitem
=>
qitem
.
School_Id
==
item
.
SId
).
ToList
();
if
(
currentSchoolDeptList
!=
null
&&
currentSchoolDeptList
.
Count
>
0
)
{
var
currentSchoolDeptId
=
currentSchoolDeptList
?.
Min
(
qitem
=>
qitem
.
ParentId
)
??
0
;
tModel
.
ChildList
=
GetDeptTreeList
(
currentSchoolDeptId
,
currentSchoolDeptList
,
SchoolId
:
item
.
SId
,
schoolDeptList
:
null
,
empList
:
empList
);
}
schoolDeptList
.
Add
(
tModel
);
}
}
if
(
deptList
!=
null
&&
deptList
.
Count
>
0
)
{
...
...
@@ -204,7 +163,8 @@ namespace Edu.Module.User
DeptName
=
fItem
.
DeptName
,
ParentId
=
fItem
.
ParentId
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>(),
School_Id
=
fItem
.
School_Id
School_Id
=
fItem
.
School_Id
,
IsCompany
=
fItem
.
IsCompany
};
#
region
添加员工信息
...
...
@@ -228,15 +188,7 @@ namespace Edu.Module.User
}
#
endregion
tModel
.
ChildList
=
GetDeptTreeList
(
fItem
.
DeptId
,
deptList
.
Where
(
qitem
=>
qitem
.
School_Id
==
0
).
ToList
(),
SchoolId
:
0
,
schoolDeptList
:
schoolDeptList
,
empList
:
empList
);
//if (schoolDeptList != null)
//{
// var newSchoolDeptList = schoolDeptList.Where(qitem => qitem.DeptId == fItem.DeptId)?.ToList();
// if (newSchoolDeptList != null && newSchoolDeptList.Count>0)
// {
// tModel.ChildList.AddRange(newSchoolDeptList);
// }
//}
tModel
.
ChildList
=
GetDeptTreeList
(
fItem
.
DeptId
,
deptList
,
empList
:
empList
);
list
.
Add
(
tModel
);
}
}
...
...
@@ -250,13 +202,11 @@ namespace Edu.Module.User
/// </summary>
/// <param name="parentId">父节点编号</param>
/// <param name="sourceList">数据源列表</param>
/// <param name="SchoolId">学校编号</param>
/// <param name="schoolDeptList">学校部门列表</param>
/// <param name="empList">员工列表</param>
private
List
<
DepartmentTree_ViewModel
>
GetDeptTreeList
(
int
parentId
,
List
<
RB_Department_ViewModel
>
sourceList
,
int
SchoolId
=
0
,
List
<
DepartmentTree_ViewModel
>
schoolDeptList
=
null
,
List
<
Employee_ViewModel
>
empList
=
null
)
private
List
<
DepartmentTree_ViewModel
>
GetDeptTreeList
(
int
parentId
,
List
<
RB_Department_ViewModel
>
sourceList
,
List
<
Employee_ViewModel
>
empList
=
null
)
{
List
<
DepartmentTree_ViewModel
>
treeList
=
new
List
<
DepartmentTree_ViewModel
>();
foreach
(
var
item
in
sourceList
.
Where
(
qitem
=>
qitem
.
ParentId
==
parentId
&&
qitem
.
School_Id
==
SchoolId
))
foreach
(
var
item
in
sourceList
.
Where
(
qitem
=>
qitem
.
ParentId
==
parentId
))
{
DepartmentTree_ViewModel
model
=
new
DepartmentTree_ViewModel
()
{
...
...
@@ -264,7 +214,8 @@ namespace Edu.Module.User
DeptName
=
item
.
DeptName
,
ParentId
=
item
.
ParentId
,
ChildList
=
new
List
<
DepartmentTree_ViewModel
>(),
School_Id
=
item
.
School_Id
School_Id
=
item
.
School_Id
,
IsCompany
=
item
.
IsCompany
};
#
region
添加员工信息
if
(
empList
!=
null
&&
empList
.
Count
>
0
)
...
...
@@ -287,15 +238,7 @@ namespace Edu.Module.User
}
#
endregion
model
.
ChildList
=
GetDeptTreeList
(
item
.
DeptId
,
sourceList
,
SchoolId
,
schoolDeptList
);
if
(
schoolDeptList
!=
null
)
{
var
newSchoolDeptList
=
schoolDeptList
.
Where
(
qitem
=>
qitem
.
ParentId
==
item
.
DeptId
)?.
ToList
();
if
(
newSchoolDeptList
!=
null
)
{
model
.
ChildList
.
AddRange
(
newSchoolDeptList
);
}
}
model
.
ChildList
=
GetDeptTreeList
(
item
.
DeptId
,
sourceList
);
treeList
.
Add
(
model
);
}
return
treeList
;
...
...
@@ -391,6 +334,7 @@ namespace Edu.Module.User
{
nameof
(
RB_Department_ViewModel
.
School_Id
),
extModel
.
School_Id
},
{
nameof
(
RB_Department_ViewModel
.
DeptTier
),
extModel
.
DeptTier
},
{
nameof
(
RB_Department_ViewModel
.
DeptSort
),
extModel
.
DeptSort
},
{
nameof
(
RB_Department_ViewModel
.
IsCompany
),
extModel
.
IsCompany
}
};
flag
=
departmentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Department_ViewModel
.
DeptId
),
extModel
.
DeptId
));
}
...
...
Edu.Repository/User/RB_DepartmentRepository.cs
View file @
0c150ed5
...
...
@@ -55,6 +55,10 @@ WHERE 1=1
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Department_ViewModel
.
DeptId
)}
=
{
query
.
DeptId
}
"
);
}
if
(
query
.
IsCompany
==
1
)
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Department_ViewModel
.
IsCompany
)}
=1 "
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
DeptName
))
{
builder
.
Append
(
$" AND A.
{
nameof
(
RB_Department_ViewModel
.
DeptName
)}
LIKE @DeptName "
);
...
...
Edu.WebApi/Controllers/User/WorkFlowController.cs
View file @
0c150ed5
...
...
@@ -652,7 +652,6 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns>
public
ApiResult
AskForLeaveSubmit
()
{
//RequestParm.Uid = "1972";
int
empId
=
Convert
.
ToInt32
(
RequestParm
.
Uid
);
Rb_Workflow_Askforleave_Extend
askforleave
=
JsonConvert
.
DeserializeObject
<
Rb_Workflow_Askforleave_Extend
>(
RequestParm
.
Msg
.
ToString
());
if
(
askforleave
.
StartTime
>
askforleave
.
EndTime
)
...
...
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