Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
practical_train
Commits
6aa0dc38
Commit
6aa0dc38
authored
Aug 10, 2026
by
王蔡翾
Browse files
Merge remote-tracking branch 'origin/dev-v1.0' into dev-v1.0
parents
0b2419f1
1499ed50
Changes
20
Show whitespace changes
Inline
Side-by-side
practical-api/practical-business-api/src/main/java/com/platform/business/model/entity/TheoreticalPaperStudentDetailEntity.java
View file @
6aa0dc38
...
@@ -76,6 +76,10 @@ public class TheoreticalPaperStudentDetailEntity {
...
@@ -76,6 +76,10 @@ public class TheoreticalPaperStudentDetailEntity {
@ApiModelProperty
(
"结果"
)
@ApiModelProperty
(
"结果"
)
private
Boolean
result
;
private
Boolean
result
;
@ApiModelProperty
(
"是否部分对"
)
@TableField
(
"is_partially_right"
)
private
Boolean
isPartiallyRight
;
@ApiModelProperty
(
"实际选择"
)
@ApiModelProperty
(
"实际选择"
)
@TableField
(
"actual_choice"
)
@TableField
(
"actual_choice"
)
private
String
actualChoice
;
private
String
actualChoice
;
...
@@ -103,4 +107,7 @@ public class TheoreticalPaperStudentDetailEntity {
...
@@ -103,4 +107,7 @@ public class TheoreticalPaperStudentDetailEntity {
@ApiModelProperty
(
"分数"
)
@ApiModelProperty
(
"分数"
)
private
Double
score
;
private
Double
score
;
@ApiModelProperty
(
"实际分数"
)
@TableField
(
"actual_score"
)
private
Double
actualScore
;
}
}
practical-api/practical-business-api/src/main/java/com/platform/business/model/vo/ExamStudentVO.java
View file @
6aa0dc38
...
@@ -47,4 +47,25 @@ public class ExamStudentVO extends ExamStudentEntity {
...
@@ -47,4 +47,25 @@ public class ExamStudentVO extends ExamStudentEntity {
private
Integer
finishNum
;
private
Integer
finishNum
;
private
String
lev
;
private
String
lev
;
@ApiModelProperty
(
value
=
"成绩标签/考试结果"
)
private
String
scoreLabel
;
@ApiModelProperty
(
value
=
"班级人数"
)
private
Integer
classNum
;
@ApiModelProperty
(
value
=
"答对数量"
)
private
Integer
rightNum
;
@ApiModelProperty
(
value
=
"答错数量"
)
private
Integer
wrongNum
;
@ApiModelProperty
(
value
=
"部分对数量"
)
private
Integer
partiallyRightNum
;
@ApiModelProperty
(
value
=
"正确率"
)
private
String
correctRate
;
@ApiModelProperty
(
value
=
"得分率"
)
private
String
scoreRate
;
}
}
practical-api/practical-business-api/src/main/java/com/platform/business/model/vo/TheoreticalPaperStudentDetailVO.java
View file @
6aa0dc38
...
@@ -30,4 +30,7 @@ public class TheoreticalPaperStudentDetailVO extends TheoreticalPaperStudentDeta
...
@@ -30,4 +30,7 @@ public class TheoreticalPaperStudentDetailVO extends TheoreticalPaperStudentDeta
@ApiModelProperty
(
"该题型得分"
)
@ApiModelProperty
(
"该题型得分"
)
private
Double
sameScore
;
private
Double
sameScore
;
@ApiModelProperty
(
"结果描述"
)
private
String
resultDesc
;
}
}
practical-business/src/main/java/com/platform/business/controller/ClassController.java
View file @
6aa0dc38
...
@@ -46,45 +46,57 @@ public class ClassController extends BaseController {
...
@@ -46,45 +46,57 @@ public class ClassController extends BaseController {
return
toAjax
(
classService
.
deleteStu
(
studentId
));
return
toAjax
(
classService
.
deleteStu
(
studentId
));
}
}
@ApiOperation
(
"学生端-我的课程-日历"
)
@ApiOperation
(
"学生端-
学习中心-
我的课程-日历"
)
@PostMapping
(
"/schedule"
)
@PostMapping
(
"/schedule"
)
public
Result
<
List
<
ClassVO
>>
schedule
(
@RequestBody
ClassDTO
classDTO
)
{
public
Result
<
List
<
ClassVO
>>
schedule
(
@RequestBody
ClassDTO
classDTO
)
{
return
Result
.
data
(
classService
.
schedule
(
classDTO
));
return
Result
.
data
(
classService
.
schedule
(
classDTO
));
}
}
@ApiOperation
(
"学生端-我的课程-日历-详情"
)
@ApiOperation
(
"学生端-
学习中心-
我的课程-日历-详情"
)
@PostMapping
(
"/schedule/detail"
)
@PostMapping
(
"/schedule/detail"
)
public
Result
<
ClassSubjectVO
>
scheduleDetail
(
@RequestBody
ClassSubjectDTO
classSubjectDTO
)
{
public
Result
<
ClassSubjectVO
>
scheduleDetail
(
@RequestBody
ClassSubjectDTO
classSubjectDTO
)
{
return
Result
.
data
(
classService
.
scheduleDetail
(
classSubjectDTO
));
return
Result
.
data
(
classService
.
scheduleDetail
(
classSubjectDTO
));
}
}
@ApiOperation
(
"课程安排表-教师端"
)
@ApiOperation
(
"学生端-学习中心-我的课程-今日课程"
)
@GetMapping
(
"/today/course/{userId}"
)
public
Result
<
List
<
CalendarVO
>>
todayCourse
(
@PathVariable
String
userId
)
{
return
Result
.
data
(
classService
.
todayCourse
(
userId
));
}
@ApiOperation
(
"教师端-教学管理-我的课程-日历"
)
@PostMapping
(
"/schedule/teacher"
)
@PostMapping
(
"/schedule/teacher"
)
public
Result
<
List
<
ClassVO
>>
scheduleTeacher
(
@RequestBody
ClassDTO
classDTO
)
{
public
Result
<
List
<
ClassVO
>>
scheduleTeacher
(
@RequestBody
ClassDTO
classDTO
)
{
return
Result
.
data
(
classService
.
scheduleTeacher
(
classDTO
));
return
Result
.
data
(
classService
.
scheduleTeacher
(
classDTO
));
}
}
@ApiOperation
(
"教师端-教学管理-我的课程-详情"
)
@PostMapping
(
"/schedule/teacher/detail"
)
public
Result
<
ClassSubjectVO
>
scheduleTeacherDetail
(
@RequestBody
ClassSubjectDTO
classSubjectDTO
)
{
return
Result
.
data
(
classService
.
scheduleTeacherDetail
(
classSubjectDTO
));
}
@ApiOperation
(
"班级列表"
)
@ApiOperation
(
"班级列表"
)
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
public
Result
list
()
{
public
Result
list
()
{
return
Result
.
data
(
classService
.
list
());
return
Result
.
data
(
classService
.
list
());
}
}
@ApiOperation
(
"今日课程"
)
@ApiOperation
(
"今日课程-签到"
)
@GetMapping
(
"/today/course/{userId}"
)
public
Result
<
List
<
CalendarVO
>>
todayCourse
(
@PathVariable
String
userId
)
{
return
Result
.
data
(
classService
.
todayCourse
(
userId
));
}
@ApiModelProperty
(
"今日课程-签到"
)
@PostMapping
(
"/today/course/signIn"
)
@PostMapping
(
"/today/course/signIn"
)
public
Result
<
Boolean
>
todayCourseSignIn
(
@RequestBody
CalendarDTO
calendarDTO
)
{
public
Result
<
Boolean
>
todayCourseSignIn
(
@RequestBody
CalendarDTO
calendarDTO
)
{
return
Result
.
data
(
classService
.
todayCourseSignIn
(
calendarDTO
));
return
Result
.
data
(
classService
.
todayCourseSignIn
(
calendarDTO
));
}
}
@Api
ModelProperty
(
"学生端
-我的课程-汇总"
)
@Api
Operation
(
"学生端-学习中心
-我的课程-汇总"
)
@PostMapping
(
"/student/course/summary"
)
@PostMapping
(
"/student/course/summary"
)
public
Result
<
Map
<
String
,
Integer
>>
studentCourseSummary
(
@RequestBody
ClassDTO
classDTO
)
{
public
Result
<
Map
<
String
,
Integer
>>
studentCourseSummary
(
@RequestBody
ClassDTO
classDTO
)
{
return
Result
.
data
(
classService
.
studentCourseSummary
(
classDTO
));
return
Result
.
data
(
classService
.
studentCourseSummary
(
classDTO
));
}
}
@ApiOperation
(
"教师端-教学管理-我的课程-汇总"
)
@PostMapping
(
"/teacher/course/summary"
)
public
Result
<
Map
<
String
,
Integer
>>
teacherCourseSummary
(
@RequestBody
ClassDTO
classDTO
)
{
return
Result
.
data
(
classService
.
teacherCourseSummary
(
classDTO
));
}
}
}
practical-business/src/main/java/com/platform/business/controller/ExamController.java
View file @
6aa0dc38
...
@@ -119,4 +119,34 @@ public class ExamController extends BaseController {
...
@@ -119,4 +119,34 @@ public class ExamController extends BaseController {
public
Result
<
ExamStudentVO
>
gradesDetail
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
public
Result
<
ExamStudentVO
>
gradesDetail
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesDetail
(
id
));
return
Result
.
data
(
examService
.
gradesDetail
(
id
));
}
}
@ApiOperation
(
value
=
"学生端-学习中心-我的成绩-详情-汇总"
)
@GetMapping
(
"/grades/summary/{id}"
)
public
Result
<
ExamStudentVO
>
gradesSummary
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesSummary
(
id
));
}
@ApiOperation
(
value
=
"学生端-学习中心-我的成绩-详情-成绩分析"
)
@GetMapping
(
"/grades/analysis/{id}"
)
public
Result
<
Map
<
String
,
ExamStudentVO
>>
gradesAnalysis
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesAnalysis
(
id
));
}
@ApiOperation
(
value
=
"学生端-学习中心-我的成绩-详情-考试统计"
)
@GetMapping
(
"/grades/statistics/{id}"
)
public
Result
<
ExamStudentVO
>
gradesStatistics
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesStatistics
(
id
));
}
@ApiOperation
(
value
=
"学生端-学习中心-我的成绩-详情-题目导航"
)
@GetMapping
(
"/grades/navigation/{id}"
)
public
Result
<
List
<
TheoreticalPaperStudentDetailVO
>>
gradesNavigation
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesNavigation
(
id
));
}
@ApiOperation
(
value
=
"学生端-学习中心-我的成绩-详情-列表"
)
@GetMapping
(
"/grades/list/{id}"
)
public
Result
<
List
<
TheoreticalPaperStudentDetailVO
>>
gradesList
(
@PathVariable
(
name
=
"id"
)
String
id
)
{
return
Result
.
data
(
examService
.
gradesList
(
id
));
}
}
}
practical-business/src/main/java/com/platform/business/controller/ExamStudentController.java
View file @
6aa0dc38
...
@@ -19,14 +19,14 @@ public class ExamStudentController extends BaseController {
...
@@ -19,14 +19,14 @@ public class ExamStudentController extends BaseController {
@Resource
@Resource
private
ExamStudentService
examStudentService
;
private
ExamStudentService
examStudentService
;
@ApiOperation
(
value
=
"我的成绩-成绩明细"
)
@ApiOperation
(
value
=
"
学生端-学习中心-
我的成绩-成绩明细"
)
@PostMapping
(
"/page"
)
@PostMapping
(
"/page"
)
public
TableDataInfo
page
(
@RequestBody
ExamStudentDTO
examStudentDTO
)
{
public
TableDataInfo
page
(
@RequestBody
ExamStudentDTO
examStudentDTO
)
{
startPage
(
examStudentDTO
.
getPageNum
(),
examStudentDTO
.
getPageSize
());
startPage
(
examStudentDTO
.
getPageNum
(),
examStudentDTO
.
getPageSize
());
return
getDataTable
(
examStudentService
.
page
(
examStudentDTO
));
return
getDataTable
(
examStudentService
.
page
(
examStudentDTO
));
}
}
@ApiOperation
(
value
=
"我的成绩-汇总"
)
@ApiOperation
(
value
=
"
学生端-学习中心-
我的成绩-汇总"
)
@GetMapping
(
"/summary/{studentId}"
)
@GetMapping
(
"/summary/{studentId}"
)
public
Result
<
Map
<
String
,
String
>>
summary
(
@PathVariable
String
studentId
)
{
public
Result
<
Map
<
String
,
String
>>
summary
(
@PathVariable
String
studentId
)
{
return
Result
.
data
(
examStudentService
.
summary
(
studentId
));
return
Result
.
data
(
examStudentService
.
summary
(
studentId
));
...
...
practical-business/src/main/java/com/platform/business/mapper/ClassSubjectMapper.java
View file @
6aa0dc38
...
@@ -30,4 +30,9 @@ public interface ClassSubjectMapper extends BaseMapper<ClassSubjectEntity> {
...
@@ -30,4 +30,9 @@ public interface ClassSubjectMapper extends BaseMapper<ClassSubjectEntity> {
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryListByUserIdAndDateTeacher
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryTeacherCourse
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"startDate"
)
Date
startDate
,
@Param
(
"endDate"
)
Date
endDate
);
}
}
practical-business/src/main/java/com/platform/business/mapper/ExamMapper.java
View file @
6aa0dc38
...
@@ -32,4 +32,10 @@ public interface ExamMapper extends BaseMapper<ExamEntity> {
...
@@ -32,4 +32,10 @@ public interface ExamMapper extends BaseMapper<ExamEntity> {
TheoreticalPaperStudentDetailVO
same
(
@Param
(
"examId"
)
Integer
examId
,
@Param
(
"studentId"
)
String
studentId
,
@Param
(
"type"
)
String
type
);
TheoreticalPaperStudentDetailVO
same
(
@Param
(
"examId"
)
Integer
examId
,
@Param
(
"studentId"
)
String
studentId
,
@Param
(
"type"
)
String
type
);
ExamStudentVO
gradesSummary
(
@Param
(
"id"
)
String
id
);
ExamStudentVO
gradesStatistics
(
@Param
(
"id"
)
String
id
);
List
<
ExamStudentVO
>
gradesAnalysis
(
@Param
(
"examId"
)
int
examId
,
@Param
(
"studentId"
)
String
studentId
);
}
}
practical-business/src/main/java/com/platform/business/mapper/TheoreticalPaperStudentDetailMapper.java
View file @
6aa0dc38
...
@@ -25,4 +25,9 @@ public interface TheoreticalPaperStudentDetailMapper extends BaseMapper<Theoreti
...
@@ -25,4 +25,9 @@ public interface TheoreticalPaperStudentDetailMapper extends BaseMapper<Theoreti
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
@Param
(
"id"
)
String
id
);
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
@Param
(
"id"
)
String
id
);
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
);
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesNavigation
(
@Param
(
"examId"
)
int
examId
,
@Param
(
"studentId"
)
String
studentId
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesList
(
@Param
(
"examId"
)
int
examId
,
@Param
(
"studentId"
)
String
studentId
);
}
}
practical-business/src/main/java/com/platform/business/service/ClassService.java
View file @
6aa0dc38
...
@@ -27,10 +27,16 @@ public interface ClassService extends IService<ClassEntity> {
...
@@ -27,10 +27,16 @@ public interface ClassService extends IService<ClassEntity> {
List
<
ClassVO
>
scheduleTeacher
(
ClassDTO
classDTO
);
List
<
ClassVO
>
scheduleTeacher
(
ClassDTO
classDTO
);
ClassSubjectVO
scheduleTeacherDetail
(
ClassSubjectDTO
classSubjectDTO
);
List
<
CalendarVO
>
todayCourse
(
String
userId
);
List
<
CalendarVO
>
todayCourse
(
String
userId
);
Boolean
todayCourseSignIn
(
CalendarDTO
calendarDTO
);
Boolean
todayCourseSignIn
(
CalendarDTO
calendarDTO
);
Map
<
String
,
Integer
>
studentCourseSummary
(
ClassDTO
classDTO
);
Map
<
String
,
Integer
>
studentCourseSummary
(
ClassDTO
classDTO
);
Map
<
String
,
Integer
>
teacherCourseSummary
(
ClassDTO
classDTO
);
}
}
practical-business/src/main/java/com/platform/business/service/ClassSubjectService.java
View file @
6aa0dc38
...
@@ -35,4 +35,9 @@ public interface ClassSubjectService extends IService<ClassSubjectEntity> {
...
@@ -35,4 +35,9 @@ public interface ClassSubjectService extends IService<ClassSubjectEntity> {
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryListByUserIdAndDateTeacher
(
ClassSubjectDTO
classSubjectDTO
);
List
<
ClassSubjectVO
>
queryTeacherCourse
(
String
userId
,
Date
startDate
,
Date
endDate
);
}
}
practical-business/src/main/java/com/platform/business/service/ExamService.java
View file @
6aa0dc38
...
@@ -46,4 +46,15 @@ public interface ExamService extends IService<ExamEntity> {
...
@@ -46,4 +46,15 @@ public interface ExamService extends IService<ExamEntity> {
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
String
id
);
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
String
id
);
ExamStudentVO
gradesDetail
(
String
id
);
ExamStudentVO
gradesDetail
(
String
id
);
ExamStudentVO
gradesSummary
(
String
id
);
Map
<
String
,
ExamStudentVO
>
gradesAnalysis
(
String
id
);
ExamStudentVO
gradesStatistics
(
String
id
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesNavigation
(
String
id
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesList
(
String
id
);
}
}
practical-business/src/main/java/com/platform/business/service/TheoreticalPaperStudentDetailService.java
View file @
6aa0dc38
...
@@ -20,6 +20,11 @@ public interface TheoreticalPaperStudentDetailService extends IService<Theoretic
...
@@ -20,6 +20,11 @@ public interface TheoreticalPaperStudentDetailService extends IService<Theoretic
TheoreticalPaperStudentDetailVO
questionDetail
(
String
id
);
TheoreticalPaperStudentDetailVO
questionDetail
(
String
id
);
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
String
id
);
TheoreticalPaperStudentDetailVO
gradesQuestionDetail
(
String
id
);
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
);
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesNavigation
(
int
examId
,
String
studentId
);
List
<
TheoreticalPaperStudentDetailVO
>
gradesList
(
int
examId
,
String
studentId
);
}
}
practical-business/src/main/java/com/platform/business/service/impl/ClassServiceImpl.java
View file @
6aa0dc38
...
@@ -255,6 +255,25 @@ public class ClassServiceImpl extends ServiceImpl<ClassMapper, ClassEntity> impl
...
@@ -255,6 +255,25 @@ public class ClassServiceImpl extends ServiceImpl<ClassMapper, ClassEntity> impl
return
result
;
return
result
;
}
}
@Override
public
ClassSubjectVO
scheduleTeacherDetail
(
ClassSubjectDTO
classSubjectDTO
)
{
Date
now
=
new
Date
();
ClassSubjectVO
result
=
new
ClassSubjectVO
();
List
<
ClassSubjectVO
>
data
=
classSubjectService
.
queryListByUserIdAndDateTeacher
(
classSubjectDTO
);
for
(
ClassSubjectVO
classSubjectVO
:
data
)
{
if
(
now
.
before
(
classSubjectVO
.
getDate
())){
classSubjectVO
.
setStatus
(
"未开始"
);
}
else
if
(
now
.
after
(
classSubjectVO
.
getDate
()))
{
classSubjectVO
.
setStatus
(
"已结束"
);
}
else
{
classSubjectVO
.
setStatus
(
"进行中"
);
}
}
result
.
setData
(
data
);
result
.
setSubjectNum
(
data
.
size
());
return
result
;
}
@Override
@Override
public
List
<
CalendarVO
>
todayCourse
(
String
userId
)
{
public
List
<
CalendarVO
>
todayCourse
(
String
userId
)
{
//获取学生的班级id
//获取学生的班级id
...
@@ -336,6 +355,26 @@ public class ClassServiceImpl extends ServiceImpl<ClassMapper, ClassEntity> impl
...
@@ -336,6 +355,26 @@ public class ClassServiceImpl extends ServiceImpl<ClassMapper, ClassEntity> impl
return
result
;
return
result
;
}
}
@Override
public
Map
<
String
,
Integer
>
teacherCourseSummary
(
ClassDTO
classDTO
)
{
HashMap
<
String
,
Integer
>
result
=
new
HashMap
<>();
Date
date
=
new
Date
();
//查询课程信息
List
<
ClassSubjectVO
>
classSubjectList
=
classSubjectService
.
queryTeacherCourse
(
classDTO
.
getUserId
(),
classDTO
.
getStartDate
(),
classDTO
.
getEndDate
());
//本月课时
result
.
put
(
"本月课时"
,
classSubjectList
.
size
());
//已完成课程
int
completed
=
0
;
for
(
ClassSubjectVO
subject
:
classSubjectList
)
{
if
(
subject
.
getDate
().
before
(
date
))
completed
++;
}
result
.
put
(
"已完成课程"
,
completed
);
//待完成课程
result
.
put
(
"待完成课程"
,
classSubjectList
.
size
()
-
completed
);
//平均出勤率
return
result
;
}
private
static
String
displayAttendanceStatus
(
String
status
)
{
private
static
String
displayAttendanceStatus
(
String
status
)
{
if
(
AttendanceConstants
.
STATUS_NORMAL
.
equals
(
status
))
return
"已签到"
;
if
(
AttendanceConstants
.
STATUS_NORMAL
.
equals
(
status
))
return
"已签到"
;
if
(
AttendanceConstants
.
STATUS_LATE
.
equals
(
status
))
return
"迟到"
;
if
(
AttendanceConstants
.
STATUS_LATE
.
equals
(
status
))
return
"迟到"
;
...
...
practical-business/src/main/java/com/platform/business/service/impl/ClassSubjectServiceImpl.java
View file @
6aa0dc38
...
@@ -272,4 +272,14 @@ public class ClassSubjectServiceImpl extends ServiceImpl<ClassSubjectMapper, Cla
...
@@ -272,4 +272,14 @@ public class ClassSubjectServiceImpl extends ServiceImpl<ClassSubjectMapper, Cla
public
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
)
{
public
List
<
ClassSubjectVO
>
queryListByUserIdAndDate
(
ClassSubjectDTO
classSubjectDTO
)
{
return
baseMapper
.
queryListByUserIdAndDate
(
classSubjectDTO
);
return
baseMapper
.
queryListByUserIdAndDate
(
classSubjectDTO
);
}
}
@Override
public
List
<
ClassSubjectVO
>
queryListByUserIdAndDateTeacher
(
ClassSubjectDTO
classSubjectDTO
)
{
return
baseMapper
.
queryListByUserIdAndDateTeacher
(
classSubjectDTO
);
}
@Override
public
List
<
ClassSubjectVO
>
queryTeacherCourse
(
String
userId
,
Date
startDate
,
Date
endDate
)
{
return
baseMapper
.
queryTeacherCourse
(
userId
,
startDate
,
endDate
);
}
}
}
practical-business/src/main/java/com/platform/business/service/impl/ExamServiceImpl.java
View file @
6aa0dc38
...
@@ -357,4 +357,137 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, ExamEntity> impleme
...
@@ -357,4 +357,137 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, ExamEntity> impleme
public
ExamStudentVO
gradesDetail
(
String
id
)
{
public
ExamStudentVO
gradesDetail
(
String
id
)
{
return
baseMapper
.
gradesDetail
(
id
);
return
baseMapper
.
gradesDetail
(
id
);
}
}
@Override
public
ExamStudentVO
gradesSummary
(
String
id
)
{
//考试名称,考试类型,考试时间,班级名称,本次成绩,班级排名
ExamStudentVO
result
=
baseMapper
.
gradesSummary
(
id
);
//成绩标签
Double
score
=
judgeExamResult
(
result
);
//班级均分
List
<
ExamStudentEntity
>
examStudentList
=
examStudentService
.
list
(
new
LambdaQueryWrapper
<
ExamStudentEntity
>()
.
eq
(
ExamStudentEntity:
:
getExamId
,
result
.
getExamId
()));
double
totalScore
=
0
;
for
(
ExamStudentEntity
examStudentEntity
:
examStudentList
)
{
if
(
examStudentEntity
.
getScore
()
!=
null
)
{
totalScore
+=
examStudentEntity
.
getScore
();
}
}
result
.
setAvgScore
(
totalScore
/
examStudentList
.
size
());
//和班级均分比较
if
(
result
.
getAvgScore
()
!=
null
&&
score
!=
null
)
{
if
(
result
.
getScore
()
>
result
.
getAvgScore
())
{
result
.
setScoreLabel
(
"高于均分"
+
(
result
.
getScore
()
-
result
.
getAvgScore
()));
}
else
if
(
result
.
getScore
().
equals
(
result
.
getAvgScore
()))
{
result
.
setScoreLabel
(
"等于均分"
);
}
else
{
result
.
setScoreLabel
(
"低于均分"
+
(
result
.
getAvgScore
()
-
result
.
getScore
()));
}
}
//班级人数
result
.
setClassNum
(
examStudentList
.
size
());
int
rightNum
=
0
;
int
wrongNum
=
0
;
int
partiallyRightNum
=
0
;
int
totalNum
=
0
;
List
<
TheoreticalPaperStudentDetailEntity
>
list
=
theoreticalPaperStudentDetailService
.
list
(
new
LambdaQueryWrapper
<
TheoreticalPaperStudentDetailEntity
>()
.
eq
(
TheoreticalPaperStudentDetailEntity:
:
getExamId
,
result
.
getExamId
())
.
eq
(
TheoreticalPaperStudentDetailEntity:
:
getStudentId
,
result
.
getStudentId
()));
for
(
TheoreticalPaperStudentDetailEntity
theoreticalPaperStudentDetail
:
list
)
{
if
(!
"主观题"
.
equals
(
theoreticalPaperStudentDetail
.
getType
())){
if
(
theoreticalPaperStudentDetail
.
getIsPartiallyRight
())
{
partiallyRightNum
++;
}
else
{
if
(
theoreticalPaperStudentDetail
.
getResult
()){
rightNum
++;
}
else
{
wrongNum
++;
}
}
totalNum
++;
}
}
//答对题数
result
.
setRightNum
(
rightNum
);
//部分对题数
result
.
setPartiallyRightNum
(
partiallyRightNum
);
//答错题数
result
.
setWrongNum
(
wrongNum
);
//正确率
result
.
setCorrectRate
(
String
.
format
(
"%.2f%%"
,
(
double
)
rightNum
/
totalNum
*
100
));
return
result
;
}
@Override
public
Map
<
String
,
ExamStudentVO
>
gradesAnalysis
(
String
id
)
{
//获取考试基础信息
ExamStudentEntity
examStudent
=
examStudentService
.
getById
(
id
);
//个人
List
<
ExamStudentVO
>
personal
=
baseMapper
.
gradesAnalysis
(
examStudent
.
getExamId
(),
examStudent
.
getStudentId
());
//班级
List
<
ExamStudentVO
>
classList
=
baseMapper
.
gradesAnalysis
(
examStudent
.
getExamId
(),
null
);
Map
<
String
,
ExamStudentVO
>
result
=
new
HashMap
<>();
result
.
put
(
"个人"
,
personal
.
get
(
0
));
result
.
put
(
"班级"
,
classList
.
get
(
0
));
return
result
;
}
@Override
public
ExamStudentVO
gradesStatistics
(
String
id
)
{
ExamStudentVO
result
=
baseMapper
.
gradesStatistics
(
id
);
//考试结果
judgeExamResult
(
result
);
return
result
;
}
@Override
public
List
<
TheoreticalPaperStudentDetailVO
>
gradesNavigation
(
String
id
)
{
//获取考试基础信息
ExamStudentEntity
examStudent
=
examStudentService
.
getById
(
id
);
List
<
TheoreticalPaperStudentDetailVO
>
result
=
theoreticalPaperStudentDetailService
.
gradesNavigation
(
examStudent
.
getExamId
(),
examStudent
.
getStudentId
());
//判断答题结果
judgeAnswerResult
(
result
);
return
result
;
}
@Override
public
List
<
TheoreticalPaperStudentDetailVO
>
gradesList
(
String
id
)
{
//获取考试基础信息
ExamStudentEntity
examStudent
=
examStudentService
.
getById
(
id
);
List
<
TheoreticalPaperStudentDetailVO
>
result
=
theoreticalPaperStudentDetailService
.
gradesList
(
examStudent
.
getExamId
(),
examStudent
.
getStudentId
());
//判断答题结果
judgeAnswerResult
(
result
);
return
result
;
}
private
static
void
judgeAnswerResult
(
List
<
TheoreticalPaperStudentDetailVO
>
result
)
{
for
(
TheoreticalPaperStudentDetailVO
theoreticalPaperStudentDetailVO
:
result
)
{
if
(
theoreticalPaperStudentDetailVO
.
getIsPartiallyRight
())
{
theoreticalPaperStudentDetailVO
.
setResultDesc
(
"部分对"
);
}
else
{
if
(
theoreticalPaperStudentDetailVO
.
getResult
()){
theoreticalPaperStudentDetailVO
.
setResultDesc
(
"答对"
);
}
else
{
theoreticalPaperStudentDetailVO
.
setResultDesc
(
"答错"
);
}
}
}
}
private
static
Double
judgeExamResult
(
ExamStudentVO
result
)
{
Double
score
=
result
.
getScore
();
if
(
score
!=
null
)
{
if
(
score
>=
90
)
{
result
.
setScoreLabel
(
"优秀"
);
}
else
if
(
score
>=
80
)
{
result
.
setScoreLabel
(
"良好"
);
}
else
if
(
score
>=
60
)
{
result
.
setScoreLabel
(
"及格"
);
}
else
{
result
.
setScoreLabel
(
"不合格"
);
}
}
return
score
;
}
}
}
practical-business/src/main/java/com/platform/business/service/impl/TheoreticalPaperStudentDetailServiceImpl.java
View file @
6aa0dc38
...
@@ -38,4 +38,14 @@ public class TheoreticalPaperStudentDetailServiceImpl extends ServiceImpl<Theore
...
@@ -38,4 +38,14 @@ public class TheoreticalPaperStudentDetailServiceImpl extends ServiceImpl<Theore
public
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
)
{
public
Boolean
leaveBlank
(
TheoreticalPaperStudentDetailDTO
theoreticalPaperStudentDetailDTO
)
{
return
baseMapper
.
leaveBlank
(
theoreticalPaperStudentDetailDTO
);
return
baseMapper
.
leaveBlank
(
theoreticalPaperStudentDetailDTO
);
}
}
@Override
public
List
<
TheoreticalPaperStudentDetailVO
>
gradesNavigation
(
int
examId
,
String
studentId
)
{
return
baseMapper
.
gradesNavigation
(
examId
,
studentId
);
}
@Override
public
List
<
TheoreticalPaperStudentDetailVO
>
gradesList
(
int
examId
,
String
studentId
)
{
return
baseMapper
.
gradesList
(
examId
,
studentId
);
}
}
}
practical-business/src/main/resources/com/platform/business/mapper/ClassSubjectMapper.xml
View file @
6aa0dc38
...
@@ -154,5 +154,53 @@
...
@@ -154,5 +154,53 @@
#{item}
#{item}
</foreach>
</foreach>
</select>
</select>
<select
id=
"queryTeacherCourse"
resultType=
"com.platform.business.model.vo.ClassSubjectVO"
>
select
cs.id,
cs.class_id,
cs.subject_times,
cs.date,
cs.week,
cs.time_frame,
cs.subject_hour,
cs.subject_name,
cs.teacher_id,
cs.remark,
cs.location,
cs.type,
c.name as className
from
class_subject cs
left join
class c
on
cs.class_id = c.id
where
cs.teacher_id = #{userId}
and
cs.date
between
#{startDate}
and
#{endDate}
</select>
<select
id=
"queryListByUserIdAndDateTeacher"
resultType=
"com.platform.business.model.vo.ClassSubjectVO"
>
select
cs.time_frame,
cs.subject_name,
u.nick_name,
cs.type,
cs.date
from
class_subject c
left join
user u
on
cs.teacher_id = u.id
where
date = #{date}
and
cs.teacher_id = #{teacherId}
</select>
</mapper>
</mapper>
practical-business/src/main/resources/com/platform/business/mapper/ExamMapper.xml
View file @
6aa0dc38
...
@@ -196,4 +196,60 @@
...
@@ -196,4 +196,60 @@
and type = #{type}
and type = #{type}
and result = true
and result = true
</select>
</select>
<select
id=
"gradesSummary"
resultType=
"com.platform.business.model.vo.ExamStudentVO"
>
SELECT
e.name AS exam_name,
e.type AS exam_type,
e.exam_time,
c.name AS class_name,
es.score,
es.exam_id,
rank_table.score_rank AS rank,
es.student_id AS studentId
FROM
exam_student es
LEFT JOIN
exam e
ON
es.exam_id = e.id
LEFT JOIN
class c
ON
es.class_id = c.id
LEFT JOIN (SELECT exam_id,
student_id,
DENSE_RANK() OVER (PARTITION BY exam_id ORDER BY score DESC NULLS LAST) AS score_rank
FROM exam_student) rank_table
ON es.exam_id = rank_table.exam_id AND es.student_id = rank_table.student_id
WHERE es.student_id = #{id}
</select>
<select
id=
"gradesStatistics"
resultType=
"com.platform.business.model.vo.ExamStudentVO"
>
select
answer_time,
score,
tp.sum
from
exam_student es
left join
exam e
on
es.exam_id = e.id
left join
theoretical_paper tp
on
e.paper_id = tp.id
where
es.id = #{id}
</select>
<select
id=
"gradesAnalysis"
resultType=
"com.platform.business.model.vo.ExamStudentVO"
>
SELECT
type,
(SUM(IF(result = 1, score, 0)) / SUM(score)) * 100 AS scoreRate
FROM theoretical_paper_student_detail
WHERE type IS NOT NULL
AND exam_id = #{examId}
AND student_id = #{studentId}
AND score IS NOT NULL
GROUP BY type;
</select>
</mapper>
</mapper>
practical-business/src/main/resources/com/platform/business/mapper/TheoreticalPaperStudentDetailMapper.xml
View file @
6aa0dc38
...
@@ -54,6 +54,39 @@
...
@@ -54,6 +54,39 @@
where
where
id = #{id}
id = #{id}
</select>
</select>
<select
id=
"gradesNavigation"
resultType=
"com.platform.business.model.vo.TheoreticalPaperStudentDetailVO"
>
SELECT
id,
is_partially_right as isPartiallyRight,
result
FROM
theoretical_paper_student_detail
WHERE
student_id = #{studentId}
AND
exam_id = #{examId}
</select>
<select
id=
"gradesList"
resultType=
"com.platform.business.model.vo.TheoreticalPaperStudentDetailVO"
>
select
type,
problem,
option_a as optionA,
option_b as optionB,
option_c as optionC,
option_d as optionD,
option_e as optionE,
answer,
result,
is_partially_right as isPartiallyRight,
score,
actual_score as actualScore
from
theoretical_paper_student_detail
where
student_id = #{studentId}
and
exam_id = #{examId}
</select>
<update
id=
"leaveBlank"
>
<update
id=
"leaveBlank"
>
update
update
theoretical_paper_student_detail
theoretical_paper_student_detail
...
...
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