修改一些实操和成绩的问题

beetlsql3-dev
xuliangtong 2 years ago
parent 7216ffb8c4
commit f8c7fb48db

@ -1,5 +1,6 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.util.NumberUtil;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@ -43,12 +44,16 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
@Autowired private HandsOnSimulationTasksAssessmentService handsOnSimulationTasksAssessmentService;
@Autowired private ResourcesQuestionDao mergeResourcesQuestionService;
public PageQuery<HandsOnSimulationTasks>queryByCondition(PageQuery query){
//查询任务排序
query.setOrderBy("task_order+0, add_time");
PageQuery ret = handsOnSimulationTasksDao.queryByCondition(query);
queryListAfter(ret.getList());
return ret;
}
public PageQuery<HandsOnSimulationTasks>queryByConditionQuery(PageQuery query){
//查询任务排序
query.setOrderBy("task_order+0, add_time");
PageQuery ret = handsOnSimulationTasksDao.queryByConditionQuery(query);
queryListAfter(ret.getList());
return ret;
@ -98,6 +103,7 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
public JsonResult add(HandsOnSimulationTasksQuery handsOnSimulationTasksQuery){
String msg = "";
HandsOnSimulationTasks handsOnSimulationTasks = handsOnSimulationTasksQuery.pojo();
Long handsOnId = handsOnSimulationTasks.getHandsOnId();
//分数
String handsOnTaskProblemVo = handsOnSimulationTasksQuery.getHandsOnTaskProblemVo();
if (StringUtils.isNotEmpty(handsOnTaskProblemVo)) {
@ -125,16 +131,31 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
}
}
}
//任务顺序
String taskOrder = handsOnSimulationTasks.getTaskOrder();
if (StringUtils.isEmpty(taskOrder) || !NumberUtil.isNumber(taskOrder)) {
HandsOnSimulationTasks single = handsOnSimulationTasksDao.createLambdaQuery().andEq(HandsOnSimulationTasks::getHandsOnId, handsOnId)
.desc(HandsOnSimulationTasks::getAddTime).single();
if (single == null) {
handsOnSimulationTasks.setTaskOrder("1");
}else {
String taskOrder1 = single.getTaskOrder();
if (!NumberUtil.isNumber(taskOrder)) {
handsOnSimulationTasks.setTaskOrder("2");
}else {
BigDecimal bigDecimal = NumberUtil.toBigDecimal(taskOrder1);
handsOnSimulationTasks.setTaskOrder(bigDecimal.add(BigDecimal.ONE).toString());
}
}
}
handsOnSimulationTasksDao.insert(handsOnSimulationTasks);
//考核题目
String handsOnSimulationTasksAssessment = handsOnSimulationTasks.getHandsOnSimulationTasksAssessment();
if (StringUtils.isNotEmpty(handsOnSimulationTasksAssessment)) {
List<HandsOnSimulationTasksAssessmentQuery> handsOnSimulationTasksAssessmentQueryList = JSONArray.parseArray(handsOnSimulationTasksAssessment, HandsOnSimulationTasksAssessmentQuery.class);
List<HandsOnSimulationTasksAssessment> tasksAssessments = new ArrayList<>();
for (HandsOnSimulationTasksAssessmentQuery handsOnSimulationTasksAssessmentQuery : handsOnSimulationTasksAssessmentQueryList) {
handsOnSimulationTasksAssessmentQuery.setHandsOnId(handsOnSimulationTasks.getHandsOnId());
handsOnSimulationTasksAssessmentQuery.setHandsOnId(handsOnId);
handsOnSimulationTasksAssessmentQuery.setHandsOnTaskId(handsOnSimulationTasks.getTaskId());
tasksAssessments.add(handsOnSimulationTasksAssessmentQuery.pojo());
}
@ -147,13 +168,12 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
List<HandsOnSimulationTasksFileQuery> handsOnSimulationTasksFileQueryList = JSONArray.parseArray(tasksFile, HandsOnSimulationTasksFileQuery.class);
List<HandsOnSimulationTasksFile> tasksFiles = new ArrayList<>();
for (HandsOnSimulationTasksFileQuery handsOnSimulationTasksFileQuery : handsOnSimulationTasksFileQueryList) {
handsOnSimulationTasksFileQuery.setHandsOnId(handsOnSimulationTasks.getHandsOnId());
handsOnSimulationTasksFileQuery.setHandsOnId(handsOnId);
handsOnSimulationTasksFileQuery.setTaskId(handsOnSimulationTasks.getTaskId());
tasksFiles.add(handsOnSimulationTasksFileQuery.pojo());
}
handsOnSimulationTasksFileService.insertBatch(tasksFiles);
}
JsonResult jsonResult = new JsonResult();
jsonResult.setData(handsOnSimulationTasks.getTaskId());//自增的ID丢进去
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());

@ -15,6 +15,7 @@ import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.util.map.MapUtil;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.StudentHandsOnTaskLogDao;
import com.ibeetl.jlw.dao.StudentHandsOnTaskPptDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.entity.*;
@ -54,6 +55,7 @@ public class StudentHandsOnTaskPptService extends CoreBaseService<StudentHandsOn
@Autowired private StudentService studentService;
@Autowired private TeacherOpenCourseHandsOnSimulationTasksDao tasksService;
@Autowired private TeacherOpenCourseHandsOnSimulationTasksFileService fileService;
@Autowired private StudentHandsOnTaskLogDao studentHandsOnTaskLogService;
public PageQuery<StudentHandsOnTaskPpt>queryByCondition(PageQuery query){
PageQuery ret = studentHandsOnTaskPptDao.queryByCondition(query);
@ -135,7 +137,37 @@ public class StudentHandsOnTaskPptService extends CoreBaseService<StudentHandsOn
schedules = NumberUtil.add(schedules, schedule);
}
}
studentHandsOnTaskPpt.setPptScore(BigDecimal.valueOf(NumberUtil.div(schedules, maps.size())));
//视频成绩 修改为查询观看日志
List<StudentHandsOnTaskLog> selectLog = studentHandsOnTaskLogService.createLambdaQuery()
.andEq(StudentHandsOnTaskLog::getHandsOnTaskId, studentHandsOnTaskPpt.getHandsOnTaskId()).select();
if (CollectionUtil.isNotEmpty(selectLog)) {
double mul = NumberUtil.mul(selectLog.size(), 10);
//分钟数
double v = mul / 60;
TeacherOpenCourseHandsOnSimulationTasks single = tasksService.createLambdaQuery()
.andEq(TeacherOpenCourseHandsOnSimulationTasks::getTaskId, studentHandsOnTaskPpt.getHandsOnTaskId()).single();
if (single != null) {
try{
String assessmentTime = single.getAssessmentTime();
int i2 = NumberUtil.parseInt(assessmentTime);
int compare = NumberUtil.compare(v, i2);
if (compare > 0) {
String taskScore = single.getTaskScore();
int i = NumberUtil.parseInt(taskScore);
studentHandsOnTaskPpt.setPptScore(BigDecimal.valueOf(i));
}else {
studentHandsOnTaskPpt.setPptScore(BigDecimal.ZERO);
}
}catch (Exception e) {
studentHandsOnTaskPpt.setPptScore(BigDecimal.ZERO);
}
}else {
studentHandsOnTaskPpt.setPptScore(BigDecimal.ZERO);
}
}else {
studentHandsOnTaskPpt.setPptScore(BigDecimal.ZERO);
}
}
}catch (Exception e) {
Console.log(e);

@ -1,6 +1,7 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
@ -10,11 +11,14 @@ import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.StudentHandsOnTaskReportDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.entity.StudentHandsOnTaskReport;
import com.ibeetl.jlw.entity.TeacherOpenCourseHandsOnSimulationTasks;
import com.ibeetl.jlw.web.query.StudentHandsOnTaskReportQuery;
import org.apache.commons.lang3.StringUtils;
import org.beetl.sql.core.SqlId;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@ -36,6 +40,8 @@ import java.util.Map;
public class StudentHandsOnTaskReportService extends CoreBaseService<StudentHandsOnTaskReport>{
@Resource private StudentHandsOnTaskReportDao studentHandsOnTaskReportDao;
@Autowired
private TeacherOpenCourseHandsOnSimulationTasksDao tasksService;
public PageQuery<StudentHandsOnTaskReport>queryByCondition(PageQuery query){
PageQuery ret = studentHandsOnTaskReportDao.queryByCondition(query);
@ -100,13 +106,32 @@ public class StudentHandsOnTaskReportService extends CoreBaseService<StudentHand
StudentHandsOnTaskReport studentHandsOnTaskReport1 = this.sqlManager.lambdaQuery(StudentHandsOnTaskReport.class)
.andEq(StudentHandsOnTaskReport::getHandsOnTaskId, handsOnTaskId).singleSimple();
if (studentHandsOnTaskReport1 != null) {
studentHandsOnTaskReport1.setReportScore(studentHandsOnTaskReportQuery.getReportScore());
BigDecimal reportScore = studentHandsOnTaskReportQuery.getReportScore();
TeacherOpenCourseHandsOnSimulationTasks single = tasksService.createLambdaQuery()
.andEq(TeacherOpenCourseHandsOnSimulationTasks::getTaskId, studentHandsOnTaskReport.getHandsOnTaskId()).single();
if (single != null) {
try{
String taskScore = single.getTaskScore();
int i = NumberUtil.parseInt(taskScore);
int compare = NumberUtil.compare(reportScore.intValue(), i);
if (compare > 0) {
studentHandsOnTaskReport1.setReportScore(BigDecimal.valueOf(i));
}else {
studentHandsOnTaskReport1.setReportScore(reportScore);
}
}catch (Exception e) {
studentHandsOnTaskReport1.setReportScore(reportScore);
}
}else {
studentHandsOnTaskReport1.setReportScore(reportScore);
}
studentHandsOnTaskReport1.setReportComment(studentHandsOnTaskReportQuery.getReportComment());
update(studentHandsOnTaskReport1);
return JsonResult.success();
}
if (StringUtils.isNotEmpty(studentHandsOnTaskReport.getReportFile())) {
studentHandsOnTaskReport.setReportScore(BigDecimal.valueOf(100));
studentHandsOnTaskReport.setReportScore(BigDecimal.ZERO);
}
studentHandsOnTaskReportDao.insert(studentHandsOnTaskReport);
studentHandsOnTaskReportQuery.setStudentHandsOnTaskReportId(studentHandsOnTaskReport.getStudentHandsOnTaskReportId());

@ -132,11 +132,24 @@ public class StudentHandsOnTaskStepService extends CoreBaseService<StudentHandsO
for (Map<String, Object> map : maps) {
if (map.containsKey("studentAnswer")) {
if (StringUtils.isNotEmpty(MapUtil.getStr(map, "studentAnswer"))) {
schedules = NumberUtil.add(schedules, 100);
schedules = NumberUtil.add(schedules, 1);
}
}
}
studentHandsOnTaskStep.setTheoryScore(BigDecimal.valueOf(NumberUtil.div(schedules, maps.size())));
TeacherOpenCourseHandsOnSimulationTasks single = tasksService.createLambdaQuery()
.andEq(TeacherOpenCourseHandsOnSimulationTasks::getTaskId, studentHandsOnTaskStep.getHandsOnTaskId()).single();
if (single != null) {
if (NumberUtil.compare(schedules, maps.size()) >= 0) {
String taskScore = single.getTaskScore();
int i = NumberUtil.parseInt(taskScore);
studentHandsOnTaskStep.setTheoryScore(BigDecimal.valueOf(i));
}else {
studentHandsOnTaskStep.setTheoryScore(BigDecimal.ZERO);
}
}else {
studentHandsOnTaskStep.setTheoryScore(BigDecimal.ZERO);
}
}
}catch (Exception e) {
Console.log(e);

@ -1,6 +1,7 @@
package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.NumberUtil;
import cn.jlw.util.ToolUtils;
@ -15,6 +16,7 @@ import com.ibeetl.admin.core.util.TimeTool;
import com.ibeetl.admin.core.util.map.MapUtil;
import com.ibeetl.admin.core.web.JsonResult;
import com.ibeetl.admin.core.web.JsonReturnCode;
import com.ibeetl.jlw.dao.StudentHandsOnTaskLogDao;
import com.ibeetl.jlw.dao.StudentHandsOnTaskVideoDao;
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
import com.ibeetl.jlw.entity.*;
@ -54,6 +56,7 @@ public class StudentHandsOnTaskVideoService extends CoreBaseService<StudentHands
@Autowired private TeacherOpenCourseHandsOnSimulationTasksFileService fileService;
@Autowired private StudentService studentService;
@Autowired private TeacherOpenCourseHandsOnSimulationTasksDao tasksService;
@Autowired private StudentHandsOnTaskLogDao studentHandsOnTaskLogService;
public PageQuery<StudentHandsOnTaskVideo>queryByCondition(PageQuery query){
PageQuery ret = studentHandsOnTaskVideoDao.queryByCondition(query);
@ -142,7 +145,38 @@ public class StudentHandsOnTaskVideoService extends CoreBaseService<StudentHands
schedules = NumberUtil.add(schedules, schedule);
}
}
studentHandsOnTaskVideo.setVideoScore(BigDecimal.valueOf(NumberUtil.div(schedules, maps.size())));
//视频成绩 修改为查询观看日志
List<StudentHandsOnTaskLog> selectLog = studentHandsOnTaskLogService.createLambdaQuery()
.andEq(StudentHandsOnTaskLog::getHandsOnTaskId, studentHandsOnTaskVideo.getHandsOnTaskId()).select();
if (CollectionUtil.isNotEmpty(selectLog)) {
double mul = NumberUtil.mul(selectLog.size(), 10);
//分钟数
double v = mul / 60;
TeacherOpenCourseHandsOnSimulationTasks single = tasksService.createLambdaQuery()
.andEq(TeacherOpenCourseHandsOnSimulationTasks::getTaskId, studentHandsOnTaskVideo.getHandsOnTaskId()).single();
if (single != null) {
try{
String assessmentTime = single.getAssessmentTime();
int i2 = NumberUtil.parseInt(assessmentTime);
int compare = NumberUtil.compare(v, i2);
if (compare > 0) {
String taskScore = single.getTaskScore();
int i = NumberUtil.parseInt(taskScore);
studentHandsOnTaskVideo.setVideoScore(BigDecimal.valueOf(i));
}else {
studentHandsOnTaskVideo.setVideoScore(BigDecimal.ZERO);
}
}catch (Exception e) {
studentHandsOnTaskVideo.setVideoScore(BigDecimal.ZERO);
}
}else {
studentHandsOnTaskVideo.setVideoScore(BigDecimal.ZERO);
}
}else {
studentHandsOnTaskVideo.setVideoScore(BigDecimal.ZERO);
}
}
}catch (Exception e) {
Console.log(e);

@ -3,6 +3,7 @@ package com.ibeetl.jlw.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.jlw.Interceptor.SCoreUser;
import cn.jlw.util.ToolUtils;
import com.alibaba.fastjson.JSON;
@ -82,12 +83,16 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
private StudentHandsOnTaskLogService logService;
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> queryByCondition(PageQuery query) {
//查询任务排序
query.setOrderBy("task_order+0, add_time");
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
queryListAfter(ret.getList());
return ret;
}
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> queryByConditionQuery(PageQuery query) {
//查询任务排序
query.setOrderBy("task_order+0, add_time");
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query);
queryListAfter(ret.getList());
return ret;
@ -140,6 +145,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
String msg = "";
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo();
String handsOnTaskProblemVo = teacherOpenCourseHandsOnSimulationTasksQuery.getHandsOnTaskProblemVo();
Long handsOnId = teacherOpenCourseHandsOnSimulationTasks.getHandsOnId();
//分数
if (StringUtils.isNotEmpty(handsOnTaskProblemVo)) {
List<HandsOnTaskProblemVO> list = JSONArray.parseArray(handsOnTaskProblemVo, HandsOnTaskProblemVO.class);
@ -166,6 +172,23 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
}
}
}
//任务顺序
String taskOrder = teacherOpenCourseHandsOnSimulationTasks.getTaskOrder();
if (StringUtils.isEmpty(taskOrder) || !NumberUtil.isNumber(taskOrder)) {
TeacherOpenCourseHandsOnSimulationTasks single = teacherOpenCourseHandsOnSimulationTasksDao.createLambdaQuery().andEq(TeacherOpenCourseHandsOnSimulationTasks::getHandsOnId, handsOnId)
.desc(TeacherOpenCourseHandsOnSimulationTasks::getAddTime).single();
if (single == null) {
teacherOpenCourseHandsOnSimulationTasks.setTaskOrder("1");
}else {
String taskOrder1 = single.getTaskOrder();
if (!NumberUtil.isNumber(taskOrder)) {
teacherOpenCourseHandsOnSimulationTasks.setTaskOrder("2");
}else {
BigDecimal bigDecimal = NumberUtil.toBigDecimal(taskOrder1);
teacherOpenCourseHandsOnSimulationTasks.setTaskOrder(bigDecimal.add(BigDecimal.ONE).toString());
}
}
}
teacherOpenCourseHandsOnSimulationTasksDao.insert(teacherOpenCourseHandsOnSimulationTasks);
teacherOpenCourseHandsOnSimulationTasksQuery.setTaskId(teacherOpenCourseHandsOnSimulationTasks.getTaskId());
//题目
@ -175,7 +198,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
List<TeacherOpenCourseHandsOnSimulationTasksAssessment> tasksAssessments = new ArrayList<>();
for (TeacherOpenCourseHandsOnSimulationTasksAssessmentQuery teacherOpenCourseHandsOnSimulationTasksAssessmentQuery : teacherOpenCourseHandsOnSimulationTasksAssessmentQueries) {
// teacherOpenCourseHandsOnSimulationTasksAssessmentQuery.setTeacherOpenCourseId(teacherOpenCourseHandsOnSimulationTasks.getTeacherOpenCourseId());
teacherOpenCourseHandsOnSimulationTasksAssessmentQuery.setHandsOnId(teacherOpenCourseHandsOnSimulationTasks.getHandsOnId());
teacherOpenCourseHandsOnSimulationTasksAssessmentQuery.setHandsOnId(handsOnId);
teacherOpenCourseHandsOnSimulationTasksAssessmentQuery.setHandsOnTaskId(teacherOpenCourseHandsOnSimulationTasks.getTaskId());
tasksAssessments.add(teacherOpenCourseHandsOnSimulationTasksAssessmentQuery.pojo());
}
@ -190,7 +213,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
List<TeacherOpenCourseHandsOnSimulationTasksFile> tasksFiles = new ArrayList<>();
for (TeacherOpenCourseHandsOnSimulationTasksFileQuery teacherOpenCourseHandsOnSimulationTasksFile : teacherOpenCourseHandsOnSimulationTasksFiles) {
teacherOpenCourseHandsOnSimulationTasksFile.setTeacherOpenCourseId(teacherOpenCourseHandsOnSimulationTasks.getTeacherOpenCourseId());
teacherOpenCourseHandsOnSimulationTasksFile.setHandsOnId(teacherOpenCourseHandsOnSimulationTasks.getHandsOnId());
teacherOpenCourseHandsOnSimulationTasksFile.setHandsOnId(handsOnId);
teacherOpenCourseHandsOnSimulationTasksFile.setTaskId(teacherOpenCourseHandsOnSimulationTasks.getTaskId());
tasksFiles.add(teacherOpenCourseHandsOnSimulationTasksFile.pojo());
}

@ -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) {

@ -740,6 +740,9 @@ public class TeacherOpenCourseHandsOnController{
*/
@GetMapping(API + "/getHandsListByOpenCourseIdAndStudent.do")
public JsonResult<List<StudentHandsOnVO>> getHandsListByOpenCourseIdAndStudent(Long teacherOpenCourseId, @SCoreUser CoreUser coreUser) {
if (teacherOpenCourseId == null) {
return JsonResult.fail();
}
return teacherOpenCourseHandsOnService.getHandsListByOpenCourseIdAndStudent(teacherOpenCourseId, coreUser);
}

Loading…
Cancel
Save