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
12d721e2
Commit
12d721e2
authored
Dec 28, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增统计
parent
64d4ce23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
TeacherClassStatic_ViewModel.cs
Edu.Model/ViewModel/Course/TeacherClassStatic_ViewModel.cs
+22
-0
TeacherModule.cs
Edu.Module.User/TeacherModule.cs
+14
-0
RB_ClassRepository.cs
Edu.Repository/Course/RB_ClassRepository.cs
+17
-0
No files found.
Edu.Model/ViewModel/Course/TeacherClassStatic_ViewModel.cs
0 → 100644
View file @
12d721e2
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Model.ViewModel.Course
{
/// <summary>
/// 教师班级统计
/// </summary>
public
class
TeacherClassStatic_ViewModel
{
/// <summary>
/// 教师编号
/// </summary>
public
int
Teacher_Id
{
get
;
set
;
}
/// <summary>
/// 带班数量
/// </summary>
public
int
ClassCount
{
get
;
set
;
}
}
}
Edu.Module.User/TeacherModule.cs
View file @
12d721e2
...
@@ -4,8 +4,10 @@ using Edu.Common.Enum;
...
@@ -4,8 +4,10 @@ using Edu.Common.Enum;
using
Edu.Common.Enum.User
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.CacheModel
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.Course
;
using
Edu.Model.ViewModel.User
;
using
Edu.Model.ViewModel.User
;
using
Edu.Module.Log
;
using
Edu.Module.Log
;
using
Edu.Repository.Course
;
using
Edu.Repository.User
;
using
Edu.Repository.User
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -44,6 +46,11 @@ namespace Edu.Module.User
...
@@ -44,6 +46,11 @@ namespace Edu.Module.User
/// </summary>
/// </summary>
private
readonly
UserChangeLogModule
userChangeLogModule
=
new
UserChangeLogModule
();
private
readonly
UserChangeLogModule
userChangeLogModule
=
new
UserChangeLogModule
();
/// <summary>
/// 班级仓储层对象
/// </summary>
private
readonly
RB_ClassRepository
classRepository
=
new
RB_ClassRepository
();
/// <summary>
/// <summary>
/// 获取讲师列表
/// 获取讲师列表
/// </summary>
/// </summary>
...
@@ -70,8 +77,10 @@ namespace Edu.Module.User
...
@@ -70,8 +77,10 @@ namespace Edu.Module.User
{
{
string
postIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
Post_Id
>
0
).
Select
(
qitem
=>
qitem
.
Post_Id
));
string
postIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
Post_Id
>
0
).
Select
(
qitem
=>
qitem
.
Post_Id
));
string
deptIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
Dept_Id
>
0
).
Select
(
qitem
=>
qitem
.
Dept_Id
));
string
deptIds
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
Dept_Id
>
0
).
Select
(
qitem
=>
qitem
.
Dept_Id
));
string
ids
=
string
.
Join
(
","
,
list
.
Where
(
qitem
=>
qitem
.
TId
>
0
).
Select
(
qitem
=>
qitem
.
TId
));
List
<
RB_Post_ViewModel
>
postList
=
new
List
<
RB_Post_ViewModel
>();
List
<
RB_Post_ViewModel
>
postList
=
new
List
<
RB_Post_ViewModel
>();
List
<
RB_Department_ViewModel
>
deptList
=
new
List
<
RB_Department_ViewModel
>();
List
<
RB_Department_ViewModel
>
deptList
=
new
List
<
RB_Department_ViewModel
>();
List
<
TeacherClassStatic_ViewModel
>
teacherClassList
=
new
List
<
TeacherClassStatic_ViewModel
>();
if
(!
string
.
IsNullOrEmpty
(
postIds
))
if
(!
string
.
IsNullOrEmpty
(
postIds
))
{
{
postList
=
postRepository
.
GetPostListRepository
(
new
RB_Post_ViewModel
()
{
QPostIds
=
postIds
});
postList
=
postRepository
.
GetPostListRepository
(
new
RB_Post_ViewModel
()
{
QPostIds
=
postIds
});
...
@@ -80,10 +89,15 @@ namespace Edu.Module.User
...
@@ -80,10 +89,15 @@ namespace Edu.Module.User
{
{
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
QDeptIds
=
deptIds
});
deptList
=
departmentRepository
.
GetDepartmentListRepository
(
new
RB_Department_ViewModel
()
{
QDeptIds
=
deptIds
});
}
}
if
(!
string
.
IsNullOrEmpty
(
ids
))
{
teacherClassList
=
classRepository
.
GetTeacherClassCountRepository
(
ids
);
}
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
item
.
DeptName
=
deptList
?.
Where
(
qitem
=>
qitem
.
DeptId
==
item
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
;
item
.
DeptName
=
deptList
?.
Where
(
qitem
=>
qitem
.
DeptId
==
item
.
Dept_Id
)?.
FirstOrDefault
()?.
DeptName
??
""
;
item
.
PostName
=
postList
?.
Where
(
qitem
=>
qitem
.
PostId
==
item
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
;
item
.
PostName
=
postList
?.
Where
(
qitem
=>
qitem
.
PostId
==
item
.
Post_Id
)?.
FirstOrDefault
()?.
PostName
??
""
;
item
.
CourseCount
=
teacherClassList
?.
Where
(
qitem
=>
qitem
.
Teacher_Id
==
item
.
TId
)?.
FirstOrDefault
()?.
ClassCount
??
0
;
}
}
}
}
return
list
;
return
list
;
...
...
Edu.Repository/Course/RB_ClassRepository.cs
View file @
12d721e2
...
@@ -312,5 +312,22 @@ WHERE c.`Status`=0 and c.Group_Id ={GroupId} and c.ClassStatus =3 and c.EndClass
...
@@ -312,5 +312,22 @@ WHERE c.`Status`=0 and c.Group_Id ={GroupId} and c.ClassStatus =3 and c.EndClass
return
Get
<
RB_Class_ViewModel
>(
sql
).
ToList
();
return
Get
<
RB_Class_ViewModel
>(
sql
).
ToList
();
}
}
/// <summary>
/// 统计教师带班数量
/// </summary>
/// <param name="teacherIds"></param>
/// <returns></returns>
public
List
<
TeacherClassStatic_ViewModel
>
GetTeacherClassCountRepository
(
string
teacherIds
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT Teacher_Id,COUNT(1) AS ClassCount
FROM rb_class
WHERE status=0 AND ClassStatus<>4 AND Teacher_Id IN({0})
GROUP BY Teacher_Id
"
,
teacherIds
);
return
Get
<
TeacherClassStatic_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
}
}
}
}
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