|
|
|
@ -14,6 +14,7 @@ import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.enums.SignInTypeEnum;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseMergeStudentQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.TeacherOpenCourseScheduleSessionQuery;
|
|
|
|
@ -40,6 +41,7 @@ import java.text.DateFormat;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 成绩 Service
|
|
|
|
@ -66,6 +68,22 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseScheduleSessionDao teacherOpenCourseScheduleSessionDao;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private QuestionLogSummaryDao questionLogSummaryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseQuestionSettingDao teacherOpenCourseQuestionSettingDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskVideoDao videoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskPptDao pptService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskStepDao stepService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskTheoryDao theoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskReportDao reportService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseScoreDashboard> queryByCondition(PageQuery query) {
|
|
|
|
|
PageQuery ret = teacherOpenCourseScoreDashboardDao.queryByCondition(query);
|
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
@ -419,11 +437,12 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
//班次数
|
|
|
|
|
Double classNum = null;
|
|
|
|
|
for (TeacherOpenCourseMergeStudent student : students) {
|
|
|
|
|
Long studentId = student.getStudentId();
|
|
|
|
|
TeacherOpenCourseScoreDashboard scoreDashboard = new TeacherOpenCourseScoreDashboard();
|
|
|
|
|
scoreDashboard.setStudentId(student.getStudentId());
|
|
|
|
|
scoreDashboard.setStudentId(studentId);
|
|
|
|
|
TeacherOpenCourseStudentSigninLogQuery logQuery = new TeacherOpenCourseStudentSigninLogQuery();
|
|
|
|
|
logQuery.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
|
|
|
logQuery.setStudentId(student.getStudentId());
|
|
|
|
|
logQuery.setStudentId(studentId);
|
|
|
|
|
logQuery.setTeacherOpenCourseStudentSigninLogTag(SignInTypeEnum.SIGN_IN);
|
|
|
|
|
List<TeacherOpenCourseStudentSigninLog> logs = studentSigninLogDao.getValuesByQueryNotWithPermission(logQuery);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(logs)) {
|
|
|
|
@ -439,40 +458,166 @@ public class TeacherOpenCourseScoreDashboardService extends CoreBaseService<Teac
|
|
|
|
|
long l = DateUtil.betweenWeek(DateUtil.parseDate(teacherOpenCourseScheduleSessionStartDate),
|
|
|
|
|
DateUtil.parseDate(teacherOpenCourseScheduleSessionEndDate), true);
|
|
|
|
|
classNum = NumberUtil.mul(l, teacherOpenCourseScheduleSession.getTeacherOpenCourseScheduleSessionWeekNum().longValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
classNum = 0D;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
double div = NumberUtil.div(logs.size(), classNum.intValue());
|
|
|
|
|
double score = NumberUtil.mul(div, 100);
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.valueOf(score));
|
|
|
|
|
} else if (weight != null && "1".equals(weight.getSignInResultSetting())) {
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.valueOf(NumberUtil.mul(logs.size(), Integer.parseInt(weight.getSignInScore()))));
|
|
|
|
|
} else {
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.valueOf(logs.size()));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
//章节练习
|
|
|
|
|
List<TeacherOpenCourseQuestionSetting> select = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.CHAPTER_EXERCISE).select();
|
|
|
|
|
if (CollectionUtil.isEmpty(select)) {
|
|
|
|
|
scoreDashboard.setCourseScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
List<Long> collect = select.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
|
|
|
|
|
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery().andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
|
|
|
|
|
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
|
|
|
|
|
if (CollectionUtil.isEmpty(select1)) {
|
|
|
|
|
scoreDashboard.setCourseScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal b = BigDecimal.ZERO;
|
|
|
|
|
for (QuestionLogSummary questionLogSummary : select1) {
|
|
|
|
|
b = b.add(questionLogSummary.getQuestionLogSummarySuccessRate());
|
|
|
|
|
}
|
|
|
|
|
BigDecimal div = NumberUtil.div(b, select1.size());
|
|
|
|
|
BigDecimal mul = NumberUtil.mul(div, 100);
|
|
|
|
|
scoreDashboard.setCourseScore(mul);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
BigDecimal b = BigDecimal.ZERO;
|
|
|
|
|
for (QuestionLogSummary questionLogSummary : select1) {
|
|
|
|
|
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
|
|
|
|
|
}
|
|
|
|
|
scoreDashboard.setCourseScore(b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//实操成绩
|
|
|
|
|
List<StudentHandsOnTaskVideo> single = videoService.createLambdaQuery()
|
|
|
|
|
.andEq(StudentHandsOnTaskVideo::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(StudentHandsOnTaskVideo::getStudentId, studentId).select();
|
|
|
|
|
List<StudentHandsOnTaskPpt> single2 = pptService.createLambdaQuery()
|
|
|
|
|
.andEq(StudentHandsOnTaskPpt::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(StudentHandsOnTaskPpt::getStudentId, studentId).select();
|
|
|
|
|
List<StudentHandsOnTaskStep> single3 = stepService.createLambdaQuery()
|
|
|
|
|
.andEq(StudentHandsOnTaskStep::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(StudentHandsOnTaskStep::getStudentId, studentId).select();
|
|
|
|
|
List<StudentHandsOnTaskReport> single4 = reportService.createLambdaQuery()
|
|
|
|
|
.andEq(StudentHandsOnTaskReport::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(StudentHandsOnTaskReport::getStudentId, studentId).select();
|
|
|
|
|
List<StudentHandsOnTaskTheory> single5 = theoryService.createLambdaQuery()
|
|
|
|
|
.andEq(StudentHandsOnTaskTheory::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(StudentHandsOnTaskTheory::getStudentId, studentId).select();
|
|
|
|
|
BigDecimal realOperationScore = BigDecimal.ZERO;
|
|
|
|
|
if (CollectionUtil.isNotEmpty(single)) {
|
|
|
|
|
for (StudentHandsOnTaskVideo studentHandsOnTaskVideo : single) {
|
|
|
|
|
try {
|
|
|
|
|
realOperationScore = NumberUtil.add(realOperationScore,
|
|
|
|
|
NumberUtil.toBigDecimal(studentHandsOnTaskVideo.getVideoScore()));
|
|
|
|
|
} catch (Exception ee) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(single2)) {
|
|
|
|
|
for (StudentHandsOnTaskPpt studentHandsOnTaskPpt : single2) {
|
|
|
|
|
try {
|
|
|
|
|
realOperationScore = NumberUtil.add(realOperationScore,
|
|
|
|
|
NumberUtil.toBigDecimal(studentHandsOnTaskPpt.getPptScore()));
|
|
|
|
|
} catch (Exception ee) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(single3)) {
|
|
|
|
|
for (StudentHandsOnTaskStep studentHandsOnTaskStep : single3) {
|
|
|
|
|
try {
|
|
|
|
|
realOperationScore = NumberUtil.add(realOperationScore,
|
|
|
|
|
NumberUtil.toBigDecimal(studentHandsOnTaskStep.getTheoryScore()));
|
|
|
|
|
} catch (Exception ee) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if (weight != null && "1".equals(weight.getSignInResultSetting())){
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.valueOf(NumberUtil.mul(logs.size(), Integer.parseInt(weight.getSignInScore()))));
|
|
|
|
|
}else{
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.valueOf(logs.size()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(single4)) {
|
|
|
|
|
for (StudentHandsOnTaskReport studentHandsOnTaskReport : single4) {
|
|
|
|
|
try {
|
|
|
|
|
realOperationScore = NumberUtil.add(realOperationScore,
|
|
|
|
|
NumberUtil.toBigDecimal(studentHandsOnTaskReport.getReportScore()));
|
|
|
|
|
} catch (Exception ee) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
scoreDashboard.setSigninScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(single5)) {
|
|
|
|
|
for (StudentHandsOnTaskTheory studentHandsOnTaskTheory : single5) {
|
|
|
|
|
try {
|
|
|
|
|
realOperationScore = NumberUtil.add(realOperationScore,
|
|
|
|
|
NumberUtil.toBigDecimal(studentHandsOnTaskTheory.getTheoryScore()));
|
|
|
|
|
} catch (Exception ee) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BigDecimal courseScore = BigDecimal.valueOf(new Random().nextInt(100));
|
|
|
|
|
scoreDashboard.setCourseScore(courseScore);
|
|
|
|
|
BigDecimal realOperationScore = BigDecimal.valueOf(new Random().nextInt(100));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scoreDashboard.setRealOperationScore(realOperationScore);
|
|
|
|
|
BigDecimal questionHomeworkScore = BigDecimal.valueOf(new Random().nextInt(100));
|
|
|
|
|
scoreDashboard.setQuestionHomeworkScore(questionHomeworkScore);
|
|
|
|
|
BigDecimal examScore = BigDecimal.valueOf(new Random().nextInt(100));
|
|
|
|
|
scoreDashboard.setExamScore(examScore);
|
|
|
|
|
|
|
|
|
|
//作业
|
|
|
|
|
List<TeacherOpenCourseQuestionSetting> select2 = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.HOMEWORK_QUESTION).select();
|
|
|
|
|
if (CollectionUtil.isEmpty(select2)) {
|
|
|
|
|
scoreDashboard.setQuestionHomeworkScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
List<Long> collect = select2.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
|
|
|
|
|
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery().andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
|
|
|
|
|
if (CollectionUtil.isEmpty(select1)) {
|
|
|
|
|
scoreDashboard.setCourseScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal b = BigDecimal.ZERO;
|
|
|
|
|
for (QuestionLogSummary questionLogSummary : select1) {
|
|
|
|
|
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
|
|
|
|
|
}
|
|
|
|
|
scoreDashboard.setQuestionHomeworkScore(b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//考试
|
|
|
|
|
List<TeacherOpenCourseQuestionSetting> select3 = teacherOpenCourseQuestionSettingDao.createLambdaQuery()
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseId, teacherOpenCourseId)
|
|
|
|
|
.andEq(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingType, ResourcesQuestionSnapshotFromTypeEnum.EXAM).select();
|
|
|
|
|
if (CollectionUtil.isEmpty(select3)) {
|
|
|
|
|
scoreDashboard.setCourseScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
if (weight == null || "1".equals(weight.getCoursePracticeResultSetting())) {
|
|
|
|
|
List<Long> collect = select3.stream().map(TeacherOpenCourseQuestionSetting::getTeacherOpenCourseQuestionSettingId).collect(Collectors.toList());
|
|
|
|
|
List<QuestionLogSummary> select1 = questionLogSummaryService.createLambdaQuery().andIn(QuestionLogSummary::getQuestionSettingId, collect).select();
|
|
|
|
|
if (CollectionUtil.isEmpty(select1)) {
|
|
|
|
|
scoreDashboard.setCourseScore(BigDecimal.ZERO);
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal b = BigDecimal.ZERO;
|
|
|
|
|
for (QuestionLogSummary questionLogSummary : select1) {
|
|
|
|
|
b = b.add(questionLogSummary.getQuestionLogSummaryStudentTotalScore());
|
|
|
|
|
}
|
|
|
|
|
scoreDashboard.setExamScore(b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//互动
|
|
|
|
|
BigDecimal chatScore = BigDecimal.valueOf(new Random().nextInt(100));
|
|
|
|
|
scoreDashboard.setChatScore(chatScore);
|
|
|
|
|
BigDecimal totalScore = scoreDashboard.getSigninScore().add(courseScore)
|
|
|
|
|
.add(realOperationScore)
|
|
|
|
|
.add(questionHomeworkScore)
|
|
|
|
|
.add(examScore)
|
|
|
|
|
BigDecimal totalScore = scoreDashboard.getSigninScore().add(scoreDashboard.getCourseScore())
|
|
|
|
|
.add(scoreDashboard.getRealOperationScore())
|
|
|
|
|
.add(scoreDashboard.getQuestionHomeworkScore())
|
|
|
|
|
.add(scoreDashboard.getExamScore())
|
|
|
|
|
.add(chatScore);
|
|
|
|
|
scoreDashboard.setTotalScore(totalScore);
|
|
|
|
|
if (weight != null) {
|
|
|
|
|