|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
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.jlw.Interceptor.SCoreUser;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
@ -15,6 +17,8 @@ import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeResourcesQuestionDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.HandsOnTaskScoreVO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.StudentHandsOnScoreVO;
|
|
|
|
|
import com.ibeetl.jlw.enums.HandsOnTaskEnum;
|
|
|
|
|
import com.ibeetl.jlw.web.query.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -30,6 +34,7 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -43,49 +48,63 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Transactional
|
|
|
|
|
@Validated
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseService<TeacherOpenCourseHandsOnSimulationTasks> implements DeleteResourcesBy{
|
|
|
|
|
public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseService<TeacherOpenCourseHandsOnSimulationTasks> implements DeleteResourcesBy {
|
|
|
|
|
|
|
|
|
|
@Autowired private TeacherOpenCourseHandsOnSimulationTasksDao teacherOpenCourseHandsOnSimulationTasksDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseHandsOnSimulationTasksDao teacherOpenCourseHandsOnSimulationTasksDao;
|
|
|
|
|
|
|
|
|
|
@Autowired private TeacherOpenCourseHandsOnSimulationTasksFileService teacherOpenCourseHandsOnSimulationTasksFileService;
|
|
|
|
|
@Autowired private TeacherOpenCourseHandsOnSimulationTasksAssessmentService teacherOpenCourseHandsOnSimulationTasksAssessmentService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseHandsOnSimulationTasksFileService teacherOpenCourseHandsOnSimulationTasksFileService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseHandsOnSimulationTasksAssessmentService teacherOpenCourseHandsOnSimulationTasksAssessmentService;
|
|
|
|
|
|
|
|
|
|
@Autowired private StudentService studentService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentService studentService;
|
|
|
|
|
|
|
|
|
|
@Autowired private ResourcesQuestionService resourcesQuestionService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ResourcesQuestionService resourcesQuestionService;
|
|
|
|
|
|
|
|
|
|
@Autowired private TeacherOpenCourseMergeResourcesQuestionDao mergeResourcesQuestionService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private TeacherOpenCourseMergeResourcesQuestionDao mergeResourcesQuestionService;
|
|
|
|
|
|
|
|
|
|
@Autowired private StudentHandsOnTaskVideoService studentHandsOnTaskVideoService;
|
|
|
|
|
@Autowired private StudentHandsOnTaskPptService studentHandsOnTaskPptService;
|
|
|
|
|
@Autowired private StudentHandsOnTaskTheoryService studentHandsOnTaskTheoryService;
|
|
|
|
|
@Autowired private StudentHandsOnTaskStepService studentHandsOnTaskStepService;
|
|
|
|
|
@Autowired private StudentHandsOnTaskReportService studentHandsOnTaskReportService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskVideoService studentHandsOnTaskVideoService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskPptService studentHandsOnTaskPptService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskTheoryService studentHandsOnTaskTheoryService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskStepService studentHandsOnTaskStepService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskReportService studentHandsOnTaskReportService;
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks>queryByCondition(PageQuery query){
|
|
|
|
|
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
|
|
|
|
|
@Autowired
|
|
|
|
|
private StudentHandsOnTaskLogService logService;
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> queryByCondition(PageQuery query) {
|
|
|
|
|
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByCondition(query);
|
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks>queryByConditionQuery(PageQuery query){
|
|
|
|
|
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query);
|
|
|
|
|
public PageQuery<TeacherOpenCourseHandsOnSimulationTasks> queryByConditionQuery(PageQuery query) {
|
|
|
|
|
PageQuery ret = teacherOpenCourseHandsOnSimulationTasksDao.queryByConditionQuery(query);
|
|
|
|
|
queryListAfter(ret.getList());
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void deleteByList(List list){
|
|
|
|
|
public void deleteByList(List list) {
|
|
|
|
|
String ids = "";
|
|
|
|
|
ToolUtils.deleteNullList(list);
|
|
|
|
|
for(int i=0;null != list && i<list.size();i++){
|
|
|
|
|
ids += list.get(i).toString()+(i==list.size()-1?"":",");
|
|
|
|
|
for (int i = 0; null != list && i < list.size(); i++) {
|
|
|
|
|
ids += list.get(i).toString() + (i == list.size() - 1 ? "" : ",");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(ids)){
|
|
|
|
|
if (StringUtils.isNotBlank(ids)) {
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasksDao.deleteTeacherOpenCourseHandsOnSimulationTasksByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void deleteTeacherOpenCourseHandsOnSimulationTasks(String ids){
|
|
|
|
|
public void deleteTeacherOpenCourseHandsOnSimulationTasks(String ids) {
|
|
|
|
|
try {
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasksDao.deleteTeacherOpenCourseHandsOnSimulationTasksByIds(ids);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -93,7 +112,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String addAll(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public String addAll(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
String msg = "";
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> teacherOpenCourseHandsOnSimulationTasksList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
@ -101,11 +120,12 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
try {
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasksList.add(JSONObject.parseObject(teacherOpenCourseHandsOnSimulationTasksQuery.getTeacherOpenCourseHandsOnSimulationTasksJsonStr(), TeacherOpenCourseHandsOnSimulationTasks.class));
|
|
|
|
|
} catch (Exception e1) {}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ToolUtils.deleteNullList(teacherOpenCourseHandsOnSimulationTasksList);
|
|
|
|
|
if(null != teacherOpenCourseHandsOnSimulationTasksList && teacherOpenCourseHandsOnSimulationTasksList.size()>0){
|
|
|
|
|
for(int i=0;i<teacherOpenCourseHandsOnSimulationTasksList.size();i++){
|
|
|
|
|
if (null != teacherOpenCourseHandsOnSimulationTasksList && teacherOpenCourseHandsOnSimulationTasksList.size() > 0) {
|
|
|
|
|
for (int i = 0; i < teacherOpenCourseHandsOnSimulationTasksList.size(); i++) {
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksList.get(i);
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setUserId(teacherOpenCourseHandsOnSimulationTasksQuery.getUserId());
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setOrgId(teacherOpenCourseHandsOnSimulationTasksQuery.getOrgId());
|
|
|
|
@ -115,7 +135,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult add(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public JsonResult add(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
|
|
|
|
|
String msg = "";
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo();
|
|
|
|
@ -126,17 +146,23 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
for (HandsOnTaskProblemVO handsOnTaskProblemVO : list) {
|
|
|
|
|
Integer questionType = handsOnTaskProblemVO.getQuestionType();
|
|
|
|
|
switch (questionType) {
|
|
|
|
|
case 1: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 1:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 2: teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 2:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 3: teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 3:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 4: teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 4:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 5: teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 5:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
default: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO);
|
|
|
|
|
default:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -175,7 +201,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
return jsonResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String edit(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public String edit(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
String msg = "";
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksQuery.pojo();
|
|
|
|
|
String handsOnTaskProblemVo = teacherOpenCourseHandsOnSimulationTasksQuery.getHandsOnTaskProblemVo();
|
|
|
|
@ -184,17 +210,23 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
for (HandsOnTaskProblemVO handsOnTaskProblemVO : list) {
|
|
|
|
|
Integer questionType = handsOnTaskProblemVO.getQuestionType();
|
|
|
|
|
switch (questionType) {
|
|
|
|
|
case 1: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 1:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setSingleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 2: teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 2:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setMultipleScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 3: teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 3:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setJudgeScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 4: teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 4:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setFillScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
case 5: teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
case 5:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setAnalysisScore(handsOnTaskProblemVO.getQuestionScore());
|
|
|
|
|
break;
|
|
|
|
|
default: teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO);
|
|
|
|
|
default:
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setSingleScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -231,49 +263,49 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String updateGivenByIds(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public String updateGivenByIds(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
String msg = "";
|
|
|
|
|
if(StringUtils.isNotBlank(teacherOpenCourseHandsOnSimulationTasksQuery.get_given())){
|
|
|
|
|
if (StringUtils.isNotBlank(teacherOpenCourseHandsOnSimulationTasksQuery.get_given())) {
|
|
|
|
|
boolean flag = teacherOpenCourseHandsOnSimulationTasksDao.updateGivenByIds(teacherOpenCourseHandsOnSimulationTasksQuery) > 0;
|
|
|
|
|
if(!flag){
|
|
|
|
|
if (!flag) {
|
|
|
|
|
msg = "更新指定参数失败";
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
msg = "指定参数为空";
|
|
|
|
|
}
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValues (Object paras){
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValues(Object paras) {
|
|
|
|
|
return sqlManager.select(SqlId.of("jlw.teacherOpenCourseHandsOnSimulationTasks.getTeacherOpenCourseHandsOnSimulationTasksValues"), TeacherOpenCourseHandsOnSimulationTasks.class, paras);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQuery (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQuery(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
return teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQueryNotWithPermission (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public List<TeacherOpenCourseHandsOnSimulationTasks> getValuesByQueryNotWithPermission(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
return teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQueryNotWithPermission(teacherOpenCourseHandsOnSimulationTasksQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseHandsOnSimulationTasks getInfo (Long taskId){
|
|
|
|
|
public TeacherOpenCourseHandsOnSimulationTasks getInfo(Long taskId) {
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasksQuery.setTaskId(taskId);
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
|
|
|
|
|
if(null != list && list.size()>0){
|
|
|
|
|
if (null != list && list.size() > 0) {
|
|
|
|
|
// for (TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks : list) {
|
|
|
|
|
// List<HandsOnTaskProblemVO> objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList(), teacherOpenCourseHandsOnSimulationTasks.getTaskId());
|
|
|
|
|
// teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
|
|
|
|
|
// }
|
|
|
|
|
return list.get(0);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseHandsOnSimulationTasks getInfo (TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery){
|
|
|
|
|
public TeacherOpenCourseHandsOnSimulationTasks getInfo(TeacherOpenCourseHandsOnSimulationTasksQuery teacherOpenCourseHandsOnSimulationTasksQuery) {
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> list = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQuery(teacherOpenCourseHandsOnSimulationTasksQuery);
|
|
|
|
|
if(null != list && list.size()>0){
|
|
|
|
|
if (null != list && list.size() > 0) {
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = list.get(0);
|
|
|
|
|
List<HandsOnTaskProblemVO> objectiveProblem = getObjectiveProblem(teacherOpenCourseHandsOnSimulationTasks.getTaskList(), teacherOpenCourseHandsOnSimulationTasks.getTaskId());
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setHandsOnTaskProblemVo(objectiveProblem);
|
|
|
|
@ -294,7 +326,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
teacherOpenCourseHandsOnSimulationTasks.setTeacherOpenCourseHandsOnSimulationTasksFile(JSONArray.toJSONString(valuesByQuery));
|
|
|
|
|
}
|
|
|
|
|
return teacherOpenCourseHandsOnSimulationTasks;
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -313,26 +345,32 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
List<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = StringUtils.isNotEmpty(problemIds) ? mergeResourcesQuestionService.getByIds(problemIds) : null;
|
|
|
|
|
Map<Integer, List<TeacherOpenCourseMergeResourcesQuestion>> questions = resourcesQuestions.stream().collect(Collectors.groupingBy(TeacherOpenCourseMergeResourcesQuestion::getQuestionType));
|
|
|
|
|
List<HandsOnTaskProblemVO> list = new ArrayList<>();
|
|
|
|
|
questions.forEach((k,v) -> {
|
|
|
|
|
questions.forEach((k, v) -> {
|
|
|
|
|
HandsOnTaskProblemVO handsOnTaskProblemVo = new HandsOnTaskProblemVO();
|
|
|
|
|
handsOnTaskProblemVo.setQuestionType(k);
|
|
|
|
|
handsOnTaskProblemVo.setQuestionNum(v.size());
|
|
|
|
|
if (info == null) {
|
|
|
|
|
handsOnTaskProblemVo.setQuestionScore(BigDecimal.ZERO);
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal bigDecimal = BigDecimal.ZERO;
|
|
|
|
|
switch (k) {
|
|
|
|
|
case 1: bigDecimal = info.getSingleScore();
|
|
|
|
|
case 1:
|
|
|
|
|
bigDecimal = info.getSingleScore();
|
|
|
|
|
break;
|
|
|
|
|
case 2: bigDecimal = info.getMultipleScore();
|
|
|
|
|
case 2:
|
|
|
|
|
bigDecimal = info.getMultipleScore();
|
|
|
|
|
break;
|
|
|
|
|
case 3: bigDecimal = info.getJudgeScore();
|
|
|
|
|
case 3:
|
|
|
|
|
bigDecimal = info.getJudgeScore();
|
|
|
|
|
break;
|
|
|
|
|
case 4: bigDecimal = info.getFillScore();
|
|
|
|
|
case 4:
|
|
|
|
|
bigDecimal = info.getFillScore();
|
|
|
|
|
break;
|
|
|
|
|
case 5: bigDecimal = info.getAnalysisScore();
|
|
|
|
|
case 5:
|
|
|
|
|
bigDecimal = info.getAnalysisScore();
|
|
|
|
|
break;
|
|
|
|
|
default: bigDecimal = BigDecimal.ZERO;
|
|
|
|
|
default:
|
|
|
|
|
bigDecimal = BigDecimal.ZERO;
|
|
|
|
|
}
|
|
|
|
|
handsOnTaskProblemVo.setQuestionScore(bigDecimal);
|
|
|
|
|
}
|
|
|
|
@ -360,7 +398,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
StudentHandsOnTaskPptQuery studentHandsOnTaskPptQuery = new StudentHandsOnTaskPptQuery();
|
|
|
|
|
studentHandsOnTaskPptQuery.setStudentId(student.getStudentId());
|
|
|
|
|
List<StudentHandsOnTaskPpt> valuesByQuery = studentHandsOnTaskPptService.getValuesByQuery(studentHandsOnTaskPptQuery);
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getPptScore() == null ? 0 :v.getPptScore().doubleValue()).sum();
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getPptScore() == null ? 0 : v.getPptScore().doubleValue()).sum();
|
|
|
|
|
student.set("sumScore", sum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -369,7 +407,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
StudentHandsOnTaskTheoryQuery studentHandsOnTaskTheoryQuery = new StudentHandsOnTaskTheoryQuery();
|
|
|
|
|
studentHandsOnTaskTheoryQuery.setStudentId(student.getStudentId());
|
|
|
|
|
List<StudentHandsOnTaskTheory> valuesByQuery = studentHandsOnTaskTheoryService.getValuesByQuery(studentHandsOnTaskTheoryQuery);
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 :v.getTheoryScore().doubleValue()).sum();
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 : v.getTheoryScore().doubleValue()).sum();
|
|
|
|
|
student.set("sumScore", sum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -378,7 +416,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
StudentHandsOnTaskStepQuery studentHandsOnTaskStepQuery = new StudentHandsOnTaskStepQuery();
|
|
|
|
|
studentHandsOnTaskStepQuery.setStudentId(student.getStudentId());
|
|
|
|
|
List<StudentHandsOnTaskStep> valuesByQuery = studentHandsOnTaskStepService.getValuesByQuery(studentHandsOnTaskStepQuery);
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 :v.getTheoryScore().doubleValue()).sum();
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getTheoryScore() == null ? 0 : v.getTheoryScore().doubleValue()).sum();
|
|
|
|
|
student.set("sumScore", sum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -387,7 +425,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
StudentHandsOnTaskReportQuery studentHandsOnTaskReportQuery = new StudentHandsOnTaskReportQuery();
|
|
|
|
|
studentHandsOnTaskReportQuery.setStudentId(student.getStudentId());
|
|
|
|
|
List<StudentHandsOnTaskReport> valuesByQuery = studentHandsOnTaskReportService.getValuesByQuery(studentHandsOnTaskReportQuery);
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getReportScore() == null ? 0 :v.getReportScore().doubleValue()).sum();
|
|
|
|
|
double sum = valuesByQuery.stream().mapToDouble(v -> v.getReportScore() == null ? 0 : v.getReportScore().doubleValue()).sum();
|
|
|
|
|
student.set("sumScore", sum);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -424,4 +462,108 @@ public class TeacherOpenCourseHandsOnSimulationTasksService extends CoreBaseServ
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(tasksQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult<StudentHandsOnScoreVO> getScoreByHandsOnId(Long handsOnId, CoreUser coreUser) {
|
|
|
|
|
StudentHandsOnScoreVO studentHandsOnScoreVO = new StudentHandsOnScoreVO();
|
|
|
|
|
studentHandsOnScoreVO.setHandsOnId(handsOnId);
|
|
|
|
|
if (coreUser.isStudent()) {
|
|
|
|
|
Student student = studentService.getByUserId(coreUser.getId());
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
|
|
|
|
|
tasksQuery.setHandsOnId(handsOnId);
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> handsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksDao.getValuesByQueryNotWithPermission(tasksQuery);
|
|
|
|
|
//总分
|
|
|
|
|
BigDecimal bigDecimal = BigDecimal.ZERO;
|
|
|
|
|
List<HandsOnTaskScoreVO> hands = new ArrayList<>();
|
|
|
|
|
for (TeacherOpenCourseHandsOnSimulationTasks task : handsOnSimulationTasks) {
|
|
|
|
|
HandsOnTaskScoreVO handsOnTaskScoreVO = new HandsOnTaskScoreVO();
|
|
|
|
|
Long taskId = task.getTaskId();
|
|
|
|
|
handsOnTaskScoreVO.setHandsOnTaskId(taskId);
|
|
|
|
|
Long studentId = student.getStudentId();
|
|
|
|
|
if (HandsOnTaskEnum.TASK_VIDEO.status.equals(task.getTaskType())) {
|
|
|
|
|
StudentHandsOnTaskVideoQuery videoQuery = new StudentHandsOnTaskVideoQuery();
|
|
|
|
|
videoQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
videoQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskVideo> videoList = studentHandsOnTaskVideoService.getValuesByQueryNotWithPermission(videoQuery);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(videoList)) {
|
|
|
|
|
StudentHandsOnTaskVideo studentHandsOnTaskVideo = videoList.get(0);
|
|
|
|
|
BigDecimal videoScore = studentHandsOnTaskVideo.getVideoScore();
|
|
|
|
|
handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue());
|
|
|
|
|
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO:videoScore);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setScore(0D);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if(HandsOnTaskEnum.TASK_PPT.status.equals(task.getTaskType())) {
|
|
|
|
|
StudentHandsOnTaskPptQuery pptQuery = new StudentHandsOnTaskPptQuery();
|
|
|
|
|
pptQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
pptQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskPpt> pptList = studentHandsOnTaskPptService.getValuesByQueryNotWithPermission(pptQuery);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(pptList)) {
|
|
|
|
|
StudentHandsOnTaskPpt studentHandsOnTaskPpt = pptList.get(0);
|
|
|
|
|
BigDecimal videoScore = studentHandsOnTaskPpt.getPptScore();
|
|
|
|
|
handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue());
|
|
|
|
|
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setScore(0D);
|
|
|
|
|
}
|
|
|
|
|
}else if(HandsOnTaskEnum.TASK_THEORY.status.equals(task.getTaskType())) {
|
|
|
|
|
StudentHandsOnTaskTheoryQuery theoryQuery = new StudentHandsOnTaskTheoryQuery();
|
|
|
|
|
theoryQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
theoryQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskTheory> taskTheoryList = studentHandsOnTaskTheoryService.getValuesByQueryNotWithPermission(theoryQuery);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(taskTheoryList)) {
|
|
|
|
|
BigDecimal videoScore = taskTheoryList.stream().map(StudentHandsOnTaskTheory::getTheoryScore).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue());
|
|
|
|
|
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setScore(0D);
|
|
|
|
|
}
|
|
|
|
|
}else if(HandsOnTaskEnum.TASK_PRACTICAL_TRAINING.status.equals(task.getTaskType())) {
|
|
|
|
|
StudentHandsOnTaskStepQuery stepQuery = new StudentHandsOnTaskStepQuery();
|
|
|
|
|
stepQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
stepQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskStep> stepList = studentHandsOnTaskStepService.getValuesByQueryNotWithPermission(stepQuery);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(stepList)) {
|
|
|
|
|
StudentHandsOnTaskStep taskTheory = stepList.get(0);
|
|
|
|
|
BigDecimal videoScore = taskTheory.getTheoryScore();
|
|
|
|
|
handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue());
|
|
|
|
|
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setScore(0D);
|
|
|
|
|
}
|
|
|
|
|
}else if(HandsOnTaskEnum.TASK_REPORT_WRITING.status.equals(task.getTaskType())) {
|
|
|
|
|
StudentHandsOnTaskReportQuery reportQuery = new StudentHandsOnTaskReportQuery();
|
|
|
|
|
reportQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
reportQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskReport> reportList =studentHandsOnTaskReportService.getValuesByQueryNotWithPermission(reportQuery);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(reportList)) {
|
|
|
|
|
StudentHandsOnTaskReport taskTheory = reportList.get(0);
|
|
|
|
|
BigDecimal videoScore = taskTheory.getReportScore();
|
|
|
|
|
handsOnTaskScoreVO.setScore(videoScore == null ? 0 : videoScore.doubleValue());
|
|
|
|
|
bigDecimal = bigDecimal.add(videoScore == null ? BigDecimal.ZERO: videoScore);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setScore(0D);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
StudentHandsOnTaskLogQuery logQuery = new StudentHandsOnTaskLogQuery();
|
|
|
|
|
logQuery.setHandsOnTaskId(taskId);
|
|
|
|
|
logQuery.setStudentId(studentId);
|
|
|
|
|
List<StudentHandsOnTaskLog> handsOnTaskLogs = logService.getValuesByQueryNotWithPermission(logQuery);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(handsOnTaskLogs)) {
|
|
|
|
|
StudentHandsOnTaskLog studentHandsOnTaskLog = handsOnTaskLogs.get(0);
|
|
|
|
|
Date createTime = studentHandsOnTaskLog.getCreateTime();
|
|
|
|
|
Date lastUpdateTime = studentHandsOnTaskLog.getLastUpdateTime();
|
|
|
|
|
long between = DateUtil.between(createTime, lastUpdateTime, DateUnit.MINUTE);
|
|
|
|
|
handsOnTaskScoreVO.setTime(between);
|
|
|
|
|
}else {
|
|
|
|
|
handsOnTaskScoreVO.setTime(0L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hands.add(handsOnTaskScoreVO);
|
|
|
|
|
}
|
|
|
|
|
studentHandsOnScoreVO.setHandsOnTaskScores(hands);
|
|
|
|
|
studentHandsOnScoreVO.setSumScore(bigDecimal.doubleValue());
|
|
|
|
|
}
|
|
|
|
|
return JsonResult.success(studentHandsOnScoreVO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|