Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EduSpider
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
viitto
EduSpider
Commits
c00b694e
Commit
c00b694e
authored
May 26, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
ada84f88
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
19 deletions
+73
-19
ICourseRepository.cs
EduSpider.IRepository/ICourseRepository.cs
+7
-0
RB_Course.cs
EduSpider.Model/Entity/RB_Course.cs
+3
-3
CourseQuery.cs
EduSpider.Model/Query/CourseQuery.cs
+6
-8
CourseRepository.cs
EduSpider.Repository/CourseRepository.cs
+20
-0
CourseTeacherRepository.cs
EduSpider.Repository/CourseTeacherRepository.cs
+13
-0
TeacherController.cs
EduSpider.WebApi/Controllers/Student/TeacherController.cs
+19
-3
CourseManager.cs
EduSpider/Spiders/ClassInRule/CourseManager.cs
+5
-5
No files found.
EduSpider.IRepository/ICourseRepository.cs
View file @
c00b694e
...
...
@@ -18,6 +18,13 @@ namespace EduSpider.Repository
/// <returns></returns>
public
bool
BatchSetCourseRepository
(
List
<
RB_Course
>
courses
);
/// <summary>
/// 批量新增修改课程指定字段
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseOtherRepository
(
List
<
RB_Course
>
courses
);
/// <summary>
/// 获取课程分页列表
/// </summary>
...
...
EduSpider.Model/Entity/RB_Course.cs
View file @
c00b694e
...
...
@@ -72,9 +72,9 @@ namespace EduSpider.Model.Entity
public
int
?
teacherNum
{
get
;
set
;
}
/// <summary>
/// 课程状态(
未结课,课程进度未完成,
已结课)
/// 课程状态(
1-未结课,2-课程进度未完成,3-
已结课)
/// </summary>
public
CourseStatusEnum
courseStatus
{
get
;
set
;
}
public
int
courseStatus
{
get
;
set
;
}
/// <summary>
/// 回放地址
...
...
@@ -109,7 +109,7 @@ namespace EduSpider.Model.Entity
/// <summary>
/// 课程类型(1-标准课,公开课)
/// </summary>
public
CourseTypeEnum
courseType
{
get
;
set
;
}
public
int
courseType
{
get
;
set
;
}
/// <summary>
/// 创建时间
...
...
EduSpider.Model/Query/CourseQuery.cs
View file @
c00b694e
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Model.Query
namespace
EduSpider.Model.Query
{
/// <summary>
/// 课程查询实体类
...
...
@@ -36,6 +29,11 @@ namespace EduSpider.Model.Query
/// 教师编号
/// </summary>
public
string
TeacherIds
{
get
;
set
;
}
/// <summary>
/// 课程状态(0-全部,1-进行中,2,-已完成)
/// </summary>
public
int
QCourseState
{
get
;
set
;
}
}
}
EduSpider.Repository/CourseRepository.cs
View file @
c00b694e
...
...
@@ -25,6 +25,26 @@ namespace EduSpider.Repository
return
flag
;
}
/// <summary>
/// 批量修改其他字段
/// </summary>
/// <param name="courses"></param>
/// <returns></returns>
public
bool
BatchSetCourseOtherRepository
(
List
<
RB_Course
>
courses
)
{
var
parameters
=
new
DynamicParameters
();
string
sql
=
@"
UPDATE RB_Course
SET courseWare=@courseWare,coverImg=@coverImg,courseType=@courseType,addTime=@addTime
WHERE courseId=@courseId "
;
parameters
.
Add
(
"courseWare"
,
courses
[
0
].
courseWare
);
parameters
.
Add
(
"coverImg"
,
courses
[
0
].
coverImg
);
parameters
.
Add
(
"courseType"
,
courses
[
0
].
courseType
);
parameters
.
Add
(
"addTime"
,
courses
[
0
].
addTime
);
parameters
.
Add
(
"courseId"
,
courses
[
0
].
courseId
);
return
Execute
(
sql
,
parameters
)
>
0
;
}
/// <summary>
/// 获取课程列表
/// </summary>
...
...
EduSpider.Repository/CourseTeacherRepository.cs
View file @
c00b694e
...
...
@@ -51,6 +51,19 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_Student
.
uid
),
query
.
TeacherIds
);
}
if
(
query
.
QCourseState
>
0
)
{
//进行中
if
(
query
.
QCourseState
==
1
)
{
builder
.
AppendFormat
(
" AND B.{0} IN({1}) AND B.totalClassNum<>B.completeNum "
,
nameof
(
RB_Course
.
courseStatus
),
1
);
}
//已完成
if
(
query
.
QCourseState
==
2
)
{
builder
.
AppendFormat
(
" AND B.{0} IN({1}) "
,
nameof
(
RB_Course
.
courseStatus
),
3
);
}
}
}
builder
.
AppendFormat
(
" ORDER BY A.courseId DESC "
);
return
Get
<
RB_Course_Teacher_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
...
...
EduSpider.WebApi/Controllers/Student/TeacherController.cs
View file @
c00b694e
...
...
@@ -31,13 +31,19 @@ namespace EduSpider.WebApi.Controllers
{
TeacherIds
=
base
.
BaseUserId
.
ToString
()
};
List
<
object
>
result
=
new
List
<
object
>();
//全部课程
List
<
object
>
AllCourseList
=
new
List
<
object
>();
//已结课
List
<
object
>
FinishList
=
new
List
<
object
>();
//进行中
List
<
object
>
NotFinishList
=
new
List
<
object
>();
var
list
=
CourseService
.
GetTeacherCourseList
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
result
.
Add
(
new
var
obj
=
new
{
item
.
courseId
,
item
.
courseName
,
...
...
@@ -45,9 +51,19 @@ namespace EduSpider.WebApi.Controllers
item
.
completeNum
,
item
.
totalClassNum
,
item
.
teacherName
,
});
};
AllCourseList
.
Add
(
obj
);
if
(
item
.
courseStatus
==
3
)
{
FinishList
.
Add
(
obj
);
}
if
(
item
.
courseStatus
==
1
&&
item
.
completeNum
!=
item
.
totalClassNum
)
{
NotFinishList
.
Add
(
obj
);
}
}
}
var
result
=
new
{
AllCourseList
,
FinishList
,
NotFinishList
};
return
ApiResult
.
Success
(
data
:
result
);
}
...
...
EduSpider/Spiders/ClassInRule/CourseManager.cs
View file @
c00b694e
...
...
@@ -133,14 +133,14 @@ namespace EduSpider.Spiders.ClassInRule
studentNum
=
courseObj
.
GetInt
(
"studentNum"
),
auditNum
=
courseObj
.
GetInt
(
"auditNum"
),
teacherNum
=
courseObj
.
GetInt
(
"teacherNum"
),
courseStatus
=
(
CourseStatusEnum
)
courseObj
.
GetInt
(
"courseStatus"
),
courseStatus
=
courseObj
.
GetInt
(
"courseStatus"
),
webCast
=
courseObj
.
GetString
(
"webCast"
),
teacherId
=
courseObj
.
GetInt
(
"teacherId"
),
teacherAccount
=
courseObj
.
GetString
(
"teacherAccount"
),
teacherUid
=
courseObj
.
GetInt
(
"teacherUid"
),
teacherName
=
courseObj
.
GetString
(
"teacherName"
),
teacherLogo
=
courseObj
.
GetString
(
"teacherLogo"
),
courseType
=
(
CourseTypeEnum
)
courseObj
.
GetInt
(
"courseType"
),
courseType
=
courseObj
.
GetInt
(
"courseType"
),
});
;
}
}
...
...
@@ -291,14 +291,14 @@ namespace EduSpider.Spiders.ClassInRule
studentNum
=
courseObj
.
GetInt
(
"studentNum"
),
auditNum
=
courseObj
.
GetInt
(
"auditNum"
),
teacherNum
=
courseObj
.
GetInt
(
"teacherNum"
),
courseStatus
=
(
CourseStatusEnum
)
courseObj
.
GetInt
(
"courseStatus"
),
courseStatus
=
courseObj
.
GetInt
(
"courseStatus"
),
webCast
=
courseObj
.
GetString
(
"webCast"
),
teacherId
=
courseObj
.
GetInt
(
"teacherId"
),
teacherAccount
=
courseObj
.
GetString
(
"teacherAccount"
),
teacherUid
=
courseObj
.
GetInt
(
"teacherUid"
),
teacherName
=
courseObj
.
GetString
(
"teacherName"
),
teacherLogo
=
courseObj
.
GetString
(
"teacherLogo"
),
courseType
=
(
CourseTypeEnum
)
courseObj
.
GetInt
(
"courseType"
),
courseType
=
courseObj
.
GetInt
(
"courseType"
),
addTime
=
ConvertHelper
.
UnixToDateTime
(
courseObj
.
GetInt
(
"addTime"
)),
courseWare
=
courseObj
.
GetString
(
"courseWare"
),
};
...
...
@@ -314,7 +314,7 @@ namespace EduSpider.Spiders.ClassInRule
}
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
courseRepository
.
BatchSetCourseRepository
(
list
);
courseRepository
.
BatchSetCourse
Other
Repository
(
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