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
d66b7cfd
Commit
d66b7cfd
authored
May 14, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
c6d00769
7a4404c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
0 deletions
+75
-0
ClassModule.cs
Edu.Module.Course/ClassModule.cs
+9
-0
RB_ClassRepository.cs
Edu.Repository/Course/RB_ClassRepository.cs
+41
-0
ClassController.cs
Edu.WebApi/Controllers/Course/ClassController.cs
+25
-0
No files found.
Edu.Module.Course/ClassModule.cs
View file @
d66b7cfd
...
...
@@ -117,6 +117,15 @@ namespace Edu.Module.Course
return
classRepository
.
GetClassListRepository
(
query
);
}
/// <summary>
/// 获取班级列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Class_ViewModel
>
GetClassListForProperty
(
RB_Class_ViewModel
query
)
{
return
classRepository
.
GetClassListForProperty
(
query
);
}
/// <summary>
/// 获取班级课程名称以及老师信息列表
...
...
Edu.Repository/Course/RB_ClassRepository.cs
View file @
d66b7cfd
...
...
@@ -123,6 +123,47 @@ WHERE 1=1
return
Get
<
RB_Class_ViewModel
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取班级列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Class_ViewModel
>
GetClassListForProperty
(
RB_Class_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.CourseName
FROM rb_class AS A
left join rb_course AS B ON A.CouseId=B.CourseId
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
builder
.
AppendFormat
(
" AND A.{0} in(1,2,3) "
,
nameof
(
RB_Class_ViewModel
.
ClassStatus
));
// 未开班 + 学习中的
if
(
query
!=
null
)
{
if
(
query
.
CouseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
CouseId
),
query
.
CouseId
);
}
if
(
query
.
Group_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
Group_Id
),
query
.
Group_Id
);
}
if
(
query
.
ClassId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
ClassId
),
query
.
ClassId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Q_ClassIds
))
{
builder
.
AppendFormat
(
" AND A.{0} in({1}) "
,
nameof
(
RB_Class_ViewModel
.
ClassId
),
query
.
Q_ClassIds
);
}
if
(
query
.
ClassStatus
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Class_ViewModel
.
ClassStatus
),
(
int
)
query
.
ClassStatus
);
}
}
return
Get
<
RB_Class_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 获取班级分页列表
...
...
Edu.WebApi/Controllers/Course/ClassController.cs
View file @
d66b7cfd
...
...
@@ -82,6 +82,31 @@ namespace Edu.WebApi.Controllers.Course
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 获取班级列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetClassListForProperty
()
{
var
query
=
new
RB_Class_ViewModel
()
{
CouseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
School_Id
=
base
.
ParmJObj
.
GetInt
(
"School_Id"
,
-
1
)
};
query
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
var
list
=
classModule
.
GetClassListForProperty
(
query
);
if
(
list
==
null
)
{
list
=
new
List
<
RB_Class_ViewModel
>();
}
return
ApiResult
.
Success
(
data
:
list
.
Select
(
qitem
=>
new
{
qitem
.
ClassId
,
qitem
.
ClassName
,
qitem
.
CourseName
}));
}
/// <summary>
/// 获取班级列表
/// </summary>
...
...
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