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
8a5750d4
Commit
8a5750d4
authored
May 26, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/eduspider
parents
f0bf5e71
499151f8
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
326 additions
and
29 deletions
+326
-29
ICourseStudentRepository.cs
EduSpider.IRepository/ICourseStudentRepository.cs
+2
-1
IStuHomeWorkRepository.cs
EduSpider.IRepository/IStuHomeWorkRepository.cs
+10
-0
ICourseService.cs
EduSpider.IServices/ICourseService.cs
+5
-7
RB_Stu_HomeWork.cs
EduSpider.Model/Entity/RB_Stu_HomeWork.cs
+3
-3
ExamWorkResult.cs
EduSpider.Model/Extend/ExamWorkResult.cs
+92
-0
RB_Course_Student_Extend.cs
EduSpider.Model/Extend/RB_Course_Student_Extend.cs
+61
-0
RB_Stu_HomeWork_Extend.cs
EduSpider.Model/Extend/RB_Stu_HomeWork_Extend.cs
+30
-0
CourseQuery.cs
EduSpider.Model/Query/CourseQuery.cs
+14
-0
CourseStudentRepository.cs
EduSpider.Repository/CourseStudentRepository.cs
+10
-4
StuHomeWorkRepository.cs
EduSpider.Repository/StuHomeWorkRepository.cs
+35
-0
CourseService.cs
EduSpider.Services/CourseService.cs
+58
-11
CourseController.cs
EduSpider.WebApi/Controllers/CourseController.cs
+5
-2
HomeWorkManager.cs
EduSpider/Spiders/ClassInRule/HomeWorkManager.cs
+1
-1
No files found.
EduSpider.IRepository/ICourseStudentRepository.cs
View file @
8a5750d4
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
System.Collections.Generic
;
using
VTX.FW.Config
;
...
...
@@ -24,7 +25,7 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="courseQuery"></param>
/// <returns></returns>
public
List
<
RB_Course_Student
>
GetCourseStudentListRepository
(
CourseQuery
query
);
public
List
<
RB_Course_Student
_Extend
>
GetCourseStudentListRepository
(
CourseQuery
query
);
}
}
EduSpider.IRepository/IStuHomeWorkRepository.cs
View file @
8a5750d4
...
...
@@ -2,6 +2,10 @@
using
System.Collections.Generic
;
using
VTX.FW.Config
;
using
VTX.FW.DB
;
using
System.Text
;
using
System.Linq
;
using
EduSpider.Model.Query
;
using
EduSpider.Model.Extend
;
namespace
EduSpider.IRepository
{
...
...
@@ -16,5 +20,11 @@ namespace EduSpider.IRepository
/// <param name="homeWorks"></param>
/// <returns></returns>
public
bool
BatchSetStuHomeWorkRepository
(
List
<
RB_Stu_HomeWork
>
homeWorks
);
/// <summary>
/// 获取学生作业列表
/// </summary>
/// <returns></returns>
public
List
<
RB_Stu_HomeWork_Extend
>
GetStuHomeWorkListRepository
(
CourseQuery
query
);
}
}
EduSpider.IServices/ICourseService.cs
View file @
8a5750d4
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -15,20 +16,17 @@ namespace EduSpider.IServices
public
interface
ICourseService
:
IDependency
{
/// <summary>
/// 获取
课程分页
列表
/// 获取
学员课程
列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCoursePage
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
);
public
List
<
RB_Course
_Student_Extend
>
GetStuCourseList
(
CourseQuery
query
);
/// <summary>
/// 获取
课程
列表
/// 获取
学员考试和家庭作业
列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCourse
List
(
CourseQuery
query
);
public
List
<
object
>
GetStuWorkAndExam
List
(
CourseQuery
query
);
}
}
EduSpider.Model/Entity/RB_Stu_HomeWork.cs
View file @
8a5750d4
...
...
@@ -71,7 +71,7 @@ namespace EduSpider.Model.Entity
public
int
?
is_reform
{
get
;
set
;
}
/// <summary>
///
is_revised
///
是否补交(1-正常,2-补交)
/// </summary>
public
int
is_revised
{
get
;
set
;
}
...
...
@@ -126,9 +126,9 @@ namespace EduSpider.Model.Entity
public
DateTime
show_time
{
get
;
set
;
}
/// <summary>
///
status
///
作业状态(0-未提交,1-已提交,2-已批阅)
/// </summary>
public
string
status
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
/// <summary>
/// 学生作业分享Key
...
...
EduSpider.Model/Extend/ExamWorkResult.cs
0 → 100644
View file @
8a5750d4
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 学员作业和考试结果
/// </summary>
public
class
ExamWorkResult
{
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 类型(1-作业,2-考试,3-评语)
/// </summary>
public
int
ResultType
{
get
;
set
;
}
/// <summary>
/// 标题
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 评分机制(5-自定义,4-不评分,3-等第制,2-十分制,1-百分制)
/// </summary>
public
int
ScoreType
{
get
;
set
;
}
/// <summary>
/// 分数(ScoreType=5时使用)
/// </summary>
public
decimal
Score_Value
{
get
;
set
;
}
/// <summary>
/// 评分方式字符串
/// </summary>
public
string
ScoreTypeStr
{
get
{
string
str
=
""
;
switch
(
this
.
ScoreType
)
{
case
1
:
str
=
"百分制"
;
break
;
case
2
:
str
=
"十分制"
;
break
;
case
3
:
str
=
"等第制"
;
break
;
case
4
:
str
=
"不评分"
;
break
;
case
5
:
str
=
"自定义"
;
break
;
}
return
str
;
}
}
/// <summary>
/// 得分
/// </summary>
public
decimal
Score
{
get
;
set
;
}
/// <summary>
/// 得分率
/// </summary>
public
decimal
Score_p
{
get
;
set
;
}
/// <summary>
/// 作业状态状态
/// </summary>
public
int
HomeWorkStatus
{
get
;
set
;
}
/// <summary>
/// 作业状态字符串
/// </summary>
public
string
HomeWorkStatusStr
{
get
{
string
str
=
""
;
switch
(
this
.
HomeWorkStatus
)
{
case
0
:
str
=
"未交作业"
;
break
;
case
1
:
str
=
"未批阅"
;
break
;
case
2
:
str
=
"已批阅"
;
break
;
}
return
str
;
}
}
}
}
EduSpider.Model/Extend/RB_Course_Student_Extend.cs
0 → 100644
View file @
8a5750d4
using
EduSpider.Model.Entity
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 课程学员关联表扩展实体类
/// </summary>
public
class
RB_Course_Student_Extend
:
RB_Course_Student
{
/// <summary>
/// 课程名称
/// </summary>
public
string
courseName
{
get
;
set
;
}
/// <summary>
/// 教师编号
/// </summary>
public
int
teacherId
{
get
;
set
;
}
/// <summary>
/// 教师名称
/// </summary>
public
string
teacherName
{
get
;
set
;
}
/// <summary>
/// 教师头像
/// </summary>
public
string
teacherLogo
{
get
;
set
;}
/// <summary>
/// 课程图片
/// </summary>
public
string
courseWare
{
get
;
set
;
}
/// <summary>
/// 封面图
/// </summary>
public
string
CoverImg
{
get
;
set
;
}
/// <summary>
/// 课程状态
/// </summary>
public
int
courseStatus
{
get
;
set
;
}
/// <summary>
/// 完成次数
/// </summary>
public
int
completeNum
{
get
;
set
;
}
/// <summary>
/// 总次数
/// </summary>
public
int
totalClassNum
{
get
;
set
;
}
}
}
EduSpider.Model/Extend/RB_Stu_HomeWork_Extend.cs
0 → 100644
View file @
8a5750d4
using
EduSpider.Model.Entity
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
EduSpider.Model.Extend
{
/// <summary>
/// 学员作业扩展实体类
/// </summary>
public
class
RB_Stu_HomeWork_Extend
:
RB_Stu_HomeWork
{
/// <summary>
/// 作业名称
/// </summary>
public
string
homework_title
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
courseName
{
get
;
set
;
}
/// <summary>
/// 自定义分数
/// </summary>
public
decimal
score_value
{
get
;
set
;
}
}
}
EduSpider.Model/Query/CourseQuery.cs
View file @
8a5750d4
...
...
@@ -17,11 +17,25 @@ namespace EduSpider.Model.Query
/// </summary>
public
int
courseId
{
get
;
set
;
}
/// <summary>
/// 课程编号【多个】
/// </summary>
public
string
QCourseIds
{
get
;
set
;
}
/// <summary>
/// 课程名称
/// </summary>
public
string
courseName
{
get
;
set
;
}
/// <summary>
/// 学员编号
/// </summary>
public
string
StuIds
{
get
;
set
;
}
/// <summary>
/// 教师编号
/// </summary>
public
string
TeacherIds
{
get
;
set
;
}
}
}
EduSpider.Repository/CourseStudentRepository.cs
View file @
8a5750d4
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository.Base
;
using
System.Collections.Generic
;
...
...
@@ -30,13 +31,13 @@ namespace EduSpider.Repository
/// </summary>
/// <param name="courseQuery"></param>
/// <returns></returns>
public
List
<
RB_Course_Student
>
GetCourseStudentListRepository
(
CourseQuery
query
)
public
List
<
RB_Course_Student
_Extend
>
GetCourseStudentListRepository
(
CourseQuery
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Course_Student AS A
SELECT A.*
,B.courseName,B.teacherId,B.teacherName,B.teacherLogo,B.courseWare,B.CoverImg,B.courseStatus,B.completeNum,B.totalClassNum
FROM RB_Course_Student AS A
INNER JOIN RB_Course AS B ON A.courseId=B.courseId
WHERE 1=1
"
);
if
(
query
!=
null
)
...
...
@@ -46,8 +47,13 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Course_Student
.
courseId
),
query
.
courseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StuIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Course_Student
.
uid
),
query
.
StuIds
);
}
}
return
base
.
Get
<
RB_Course_Student
>(
builder
.
ToString
(),
parameters
).
ToList
();
builder
.
AppendFormat
(
" ORDER BY A.courseId DESC "
);
return
base
.
Get
<
RB_Course_Student_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
EduSpider.Repository/StuHomeWorkRepository.cs
View file @
8a5750d4
using
EduSpider.IRepository
;
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository.Base
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
EduSpider.Repository
{
...
...
@@ -21,5 +25,36 @@ namespace EduSpider.Repository
flag
=
base
.
BatchInsert
(
homeWorks
,
isReplace
:
true
);
return
flag
;
}
/// <summary>
/// 获取学生作业列表
/// </summary>
/// <returns></returns>
public
List
<
RB_Stu_HomeWork_Extend
>
GetStuHomeWorkListRepository
(
CourseQuery
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,B.homework_title,B.score_type,B.score_value,C.courseName
FROM RB_Stu_HomeWork AS A LEFT JOIN rb_homework AS B ON A.homework_id=B.homework_id
LEFT JOIN rb_course AS C ON A.course_id=C.courseId
WHERE 1=1
"
);
if
(
query
!=
null
)
{
if
(
query
.
courseId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Stu_HomeWork_Extend
.
course_id
),
query
.
courseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QCourseIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
course_id
),
query
.
QCourseIds
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
StuIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Stu_HomeWork_Extend
.
student_uid
),
query
.
StuIds
);
}
}
return
Get
<
RB_Stu_HomeWork_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
}
EduSpider.Services/CourseService.cs
View file @
8a5750d4
using
EduSpider.IRepository
;
using
EduSpider.IServices
;
using
EduSpider.Model.Entity
;
using
EduSpider.Model.Extend
;
using
EduSpider.Model.Query
;
using
EduSpider.Repository
;
using
System
;
...
...
@@ -18,32 +20,77 @@ namespace EduSpider.Services
public
class
CourseService
:
ICourseService
{
/// <summary>
/// 课程仓储接口
///
学员
课程仓储接口
/// </summary>
[
Autowired
]
public
ICourse
Repository
Course
Repository
{
get
;
set
;
}
public
ICourse
StudentRepository
CourseStudent
Repository
{
get
;
set
;
}
/// <summary>
/// 获取课程列表
/// 学员家庭作业仓储接口
/// </summary>
[
Autowired
]
public
IStuHomeWorkRepository
StuHomeWorkRepository
{
get
;
set
;
}
/// <summary>
/// 获取学员课程列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
Get
CourseList
(
CourseQuery
query
)
public
List
<
RB_Course
_Student_Extend
>
GetStu
CourseList
(
CourseQuery
query
)
{
return
CourseRepository
.
GetCourseListRepository
(
query
);
var
list
=
CourseStudentRepository
.
GetCourseStudentListRepository
(
query
);
return
list
;
}
/// <summary>
/// 获取
课程分页
列表
/// 获取
学员考试和家庭作业
列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Course
>
GetCoursePage
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
CourseQuery
query
)
public
List
<
object
>
GetStuWorkAndExamList
(
CourseQuery
query
)
{
return
CourseRepository
.
GetCoursePageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
List
<
object
>
list
=
new
List
<
object
>();
List
<
ExamWorkResult
>
dataList
=
new
List
<
ExamWorkResult
>();
var
homeWorkList
=
StuHomeWorkRepository
.
GetStuHomeWorkListRepository
(
query
);
if
(
homeWorkList
!=
null
&&
homeWorkList
.
Count
>
0
)
{
foreach
(
var
item
in
homeWorkList
)
{
ExamWorkResult
model
=
new
ExamWorkResult
()
{
CreateTime
=
item
.
add_time
,
ResultType
=
1
,
Title
=
item
.
homework_title
,
Score
=
item
.
score
,
Score_p
=
item
.
score_p
,
ScoreType
=
item
.
score_type
,
Score_Value
=
item
.
score_value
,
HomeWorkStatus
=
item
.
status
,
};
dataList
.
Add
(
model
);
}
}
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
foreach
(
var
item
in
dataList
)
{
list
.
Add
(
new
{
item
.
ResultType
,
item
.
Title
,
CreateTime
=
VTX
.
FW
.
Helper
.
ConvertHelper
.
FormatTime
(
item
.
CreateTime
),
item
.
Score
,
item
.
Score_p
,
item
.
ScoreType
,
item
.
ScoreTypeStr
,
item
.
Score_Value
,
item
.
HomeWorkStatus
,
item
.
HomeWorkStatusStr
,
});
}
}
return
list
;
}
}
}
EduSpider.WebApi/Controllers/CourseController.cs
View file @
8a5750d4
...
...
@@ -28,8 +28,11 @@ namespace EduSpider.WebApi.Controllers
public
ApiResult
GetCoursePage
()
{
var
list
=
CourseService
.
GetCoursePage
(
1
,
1000
,
out
_
,
new
Model
.
Query
.
CourseQuery
());
return
ApiResult
.
Success
(
data
:
list
,
message
:
"成功!"
);
var
query
=
new
Model
.
Query
.
CourseQuery
()
{
StuIds
=
"1976394"
};
var
list
=
CourseService
.
GetStuCourseList
(
query
);
query
.
StuIds
=
"14137510"
;
var
homeworkExamList
=
CourseService
.
GetStuWorkAndExamList
(
query
);
return
ApiResult
.
Success
(
data
:
homeworkExamList
,
message
:
"成功!"
);
}
}
}
EduSpider/Spiders/ClassInRule/HomeWorkManager.cs
View file @
8a5750d4
...
...
@@ -228,7 +228,7 @@ namespace EduSpider.Spiders.ClassInRule
score_p
=
lastObj
.
GetDecimal
(
"score_p"
),
score_type
=
lastObj
.
GetInt
(
"score_type"
),
show_time
=
ConvertHelper
.
UnixToDateTime
(
lastObj
.
GetInt
(
"show_time"
)),
status
=
lastObj
.
Get
String
(
"status"
),
status
=
lastObj
.
Get
Int
(
"status"
),
stu_homework_share_key
=
lastObj
.
GetString
(
"stu_homework_share_key"
),
student_account
=
lastObj
.
GetString
(
"student_account"
),
student_name
=
lastObj
.
GetString
(
"student_name"
),
...
...
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