@ -443,8 +443,11 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
}
public PageQuery getStudentScore ( StudentScoreParam studentScoreParam ) {
Long handsOnId = studentScoreParam . getHandsOnId ( ) ;
if ( handsOnId ! = null ) {
if ( handsOnId = = null ) {
throw new PlatformException ( "请选择实操任务" ) ;
}
TeacherOpenCourseHandsOnQuery handsOnQuery = new TeacherOpenCourseHandsOnQuery ( ) ;
handsOnQuery . setHandsOnId ( handsOnId ) ;
List < TeacherOpenCourseHandsOn > handsOns = teacherOpenCourseHandsOnDao . getValuesByQueryNotWithPermission ( handsOnQuery ) ;
@ -456,7 +459,6 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
String join = CollectionUtil . join ( collect , "," ) ;
studentScoreParam . setClassIds ( join ) ;
}
}
PageQuery pageQuery = studentScoreParam . getPageQuery ( ) ;
pageQuery . setPara ( "studentStatus" , 1 ) ;
PageQuery < Student > studentPageQuery = studentService . queryByCondition ( pageQuery ) ;
@ -466,9 +468,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
for ( Student student : list ) {
StudentHandsOnTaskVideoQuery studentHandsOnTaskVideoQuery = new StudentHandsOnTaskVideoQuery ( ) ;
studentHandsOnTaskVideoQuery . setStudentId ( student . getStudentId ( ) ) ;
if ( handsOnId ! = null ) {
studentHandsOnTaskVideoQuery . setHandsOnId ( handsOnId ) ;
}
List < StudentHandsOnTaskVideo > valuesByQuery = studentHandsOnTaskVideoService . getValuesByQuery ( studentHandsOnTaskVideoQuery ) ;
double sum = valuesByQuery . stream ( ) . mapToDouble ( v - > v . getVideoScore ( ) = = null ? 0 : v . getVideoScore ( ) . doubleValue ( ) ) . sum ( ) ;
student . set ( "sumScore" , sum ) ;
@ -478,9 +478,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
for ( Student student : list ) {
StudentHandsOnTaskPptQuery studentHandsOnTaskPptQuery = new StudentHandsOnTaskPptQuery ( ) ;
studentHandsOnTaskPptQuery . setStudentId ( student . getStudentId ( ) ) ;
if ( handsOnId ! = null ) {
studentHandsOnTaskPptQuery . setHandsOnId ( handsOnId ) ;
}
List < StudentHandsOnTaskPpt > valuesByQuery = studentHandsOnTaskPptService . getValuesByQuery ( studentHandsOnTaskPptQuery ) ;
double sum = valuesByQuery . stream ( ) . mapToDouble ( v - > v . getPptScore ( ) = = null ? 0 : v . getPptScore ( ) . doubleValue ( ) ) . sum ( ) ;
student . set ( "sumScore" , sum ) ;
@ -490,9 +488,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
for ( Student student : list ) {
StudentHandsOnTaskTheoryQuery studentHandsOnTaskTheoryQuery = new StudentHandsOnTaskTheoryQuery ( ) ;
studentHandsOnTaskTheoryQuery . setStudentId ( student . getStudentId ( ) ) ;
if ( handsOnId ! = null ) {
studentHandsOnTaskTheoryQuery . setHandsOnId ( handsOnId ) ;
}
List < StudentHandsOnTaskTheory > valuesByQuery = studentHandsOnTaskTheoryService . getValuesByQuery ( studentHandsOnTaskTheoryQuery ) ;
double sum = valuesByQuery . stream ( ) . mapToDouble ( v - > v . getTheoryScore ( ) = = null ? 0 : v . getTheoryScore ( ) . doubleValue ( ) ) . sum ( ) ;
student . set ( "sumScore" , sum ) ;
@ -502,9 +498,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
for ( Student student : list ) {
StudentHandsOnTaskStepQuery studentHandsOnTaskStepQuery = new StudentHandsOnTaskStepQuery ( ) ;
studentHandsOnTaskStepQuery . setStudentId ( student . getStudentId ( ) ) ;
if ( handsOnId ! = null ) {
studentHandsOnTaskStepQuery . setHandsOnId ( handsOnId ) ;
}
List < StudentHandsOnTaskStep > valuesByQuery = studentHandsOnTaskStepService . getValuesByQuery ( studentHandsOnTaskStepQuery ) ;
double sum = valuesByQuery . stream ( ) . mapToDouble ( v - > v . getTheoryScore ( ) = = null ? 0 : v . getTheoryScore ( ) . doubleValue ( ) ) . sum ( ) ;
student . set ( "sumScore" , sum ) ;
@ -514,14 +508,25 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
for ( Student student : list ) {
StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery = new StudentHandsOnTaskReportQuery ( ) ;
studentHandsOnTaskReportQuery . setStudentId ( student . getStudentId ( ) ) ;
if ( handsOnId ! = null ) {
studentHandsOnTaskReportQuery . setHandsOnId ( handsOnId ) ;
}
List < StudentHandsOnTaskReport > valuesByQuery = studentHandsOnTaskReportService . getValuesByQuery ( studentHandsOnTaskReportQuery ) ;
double sum = valuesByQuery . stream ( ) . mapToDouble ( v - > v . getReportScore ( ) = = null ? 0 : v . getReportScore ( ) . doubleValue ( ) ) . sum ( ) ;
student . set ( "sumScore" , sum ) ;
}
}
if ( "ALL" . equals ( studentScoreParam . getType ( ) ) ) {
for ( Student student : list ) {
HandsOnAchievement handsOnAchievement = new HandsOnAchievement ( ) ;
handsOnAchievement . setStudentId ( student . getStudentId ( ) ) ;
handsOnAchievement . setHandOnId ( handsOnId ) ;
handsOnAchievement . setHandOnAchievementStatus ( 1 ) ;
HandsOnAchievement res = studentHandsOnTaskReportService . queryObject ( handsOnAchievement ) ;
String totalScore = res . getTotalScore ( ) ;
student . set ( "sumScore" , totalScore ) ;
}
}
studentPageQuery . setList ( list ) ;
return studentPageQuery ;
}