|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.ibeetl.jlw.service;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
@ -12,9 +13,15 @@ import com.ibeetl.admin.core.web.JsonResult;
|
|
|
|
|
import com.ibeetl.admin.core.web.JsonReturnCode;
|
|
|
|
|
import com.ibeetl.jlw.dao.HandsOnSimulationTasksDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.ResourcesQuestionDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.HandsOnSimulationTasks;
|
|
|
|
|
import com.ibeetl.jlw.entity.HandsOnSimulationTasksAssessment;
|
|
|
|
|
import com.ibeetl.jlw.entity.HandsOnSimulationTasksFile;
|
|
|
|
|
import com.ibeetl.jlw.entity.ResourcesQuestion;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.HandsOnTaskProblemVO;
|
|
|
|
|
import com.ibeetl.jlw.web.query.*;
|
|
|
|
|
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksAssessmentQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksFileQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.HandsOnSimulationTasksQuery;
|
|
|
|
|
import com.ibeetl.jlw.web.query.ResourcesQuestionQuery;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.beetl.sql.core.SqlId;
|
|
|
|
@ -38,10 +45,15 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Transactional
|
|
|
|
|
public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimulationTasks> {
|
|
|
|
|
|
|
|
|
|
@Autowired private HandsOnSimulationTasksDao handsOnSimulationTasksDao;
|
|
|
|
|
@Autowired private HandsOnSimulationTasksFileService handsOnSimulationTasksFileService;
|
|
|
|
|
@Autowired private HandsOnSimulationTasksAssessmentService handsOnSimulationTasksAssessmentService;
|
|
|
|
|
@Autowired private ResourcesQuestionDao resourcesQuestionDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private HandsOnSimulationTasksDao handsOnSimulationTasksDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private HandsOnSimulationTasksFileService handsOnSimulationTasksFileService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private HandsOnSimulationTasksAssessmentService handsOnSimulationTasksAssessmentService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private ResourcesQuestionDao resourcesQuestionDao;
|
|
|
|
|
|
|
|
|
|
public PageQuery<HandsOnSimulationTasks> queryByCondition(PageQuery query) {
|
|
|
|
|
//查询任务排序
|
|
|
|
|
query.setOrderBy("task_order+0, add_time");
|
|
|
|
@ -85,7 +97,8 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
try {
|
|
|
|
|
handsOnSimulationTasksList.add(JSONObject.parseObject(handsOnSimulationTasksQuery.getHandsOnSimulationTasksJsonStr(), HandsOnSimulationTasks.class));
|
|
|
|
|
} catch (Exception e1) {}
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ToolUtils.deleteNullList(handsOnSimulationTasksList);
|
|
|
|
|
if (null != handsOnSimulationTasksList && handsOnSimulationTasksList.size() > 0) {
|
|
|
|
@ -377,4 +390,48 @@ public class HandsOnSimulationTasksService extends CoreBaseService<HandsOnSimula
|
|
|
|
|
}
|
|
|
|
|
return JsonResult.success(resourcesQuestions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看实训案例 查看详情
|
|
|
|
|
*
|
|
|
|
|
* @param taskId
|
|
|
|
|
* @param coreUser
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public JsonResult<List<ResourcesQuestion>> getHandsOnTaskTheoryCenterByTaskIdDetails(Long taskId, CoreUser coreUser) {
|
|
|
|
|
HandsOnSimulationTasksQuery tasksQuery = new HandsOnSimulationTasksQuery();
|
|
|
|
|
tasksQuery.setTaskId(taskId);
|
|
|
|
|
List<HandsOnSimulationTasks> tasksList = handsOnSimulationTasksDao.getValuesByQueryNotPermission(tasksQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(tasksList)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
HandsOnSimulationTasks tasks = tasksList.get(0);
|
|
|
|
|
String taskList = tasks.getTaskList();
|
|
|
|
|
ResourcesQuestionQuery questionQuery = new ResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setResourcesQuestionIds(taskList);
|
|
|
|
|
questionQuery.setQuestionStatus(1);
|
|
|
|
|
List<ResourcesQuestion> resourcesQuestions = resourcesQuestionDao.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(resourcesQuestions)) {
|
|
|
|
|
return JsonResult.success(resourcesQuestions);
|
|
|
|
|
}
|
|
|
|
|
resourcesQuestions.forEach(item -> {
|
|
|
|
|
if (ObjectUtil.isEmpty(tasks.getTaskList())) {
|
|
|
|
|
item.setQuestionAnswer("");
|
|
|
|
|
item.setQuestionScore(new BigDecimal(0));
|
|
|
|
|
} else {
|
|
|
|
|
if (ObjectUtil.equals(item.getQuestionType(),1)) {
|
|
|
|
|
item.setQuestionScore(tasks.getSingleScore());
|
|
|
|
|
} else if (ObjectUtil.equals(item.getQuestionType(),2)) {
|
|
|
|
|
item.setQuestionScore(tasks.getMultipleScore());
|
|
|
|
|
} else if (ObjectUtil.equals(item.getQuestionType(),3)) {
|
|
|
|
|
item.setQuestionScore(tasks.getJudgeScore());
|
|
|
|
|
} else if (ObjectUtil.equals(item.getQuestionType(),4)) {
|
|
|
|
|
item.setQuestionScore(tasks.getFillScore());
|
|
|
|
|
} else if (ObjectUtil.equals(item.getQuestionType(),5)) {
|
|
|
|
|
item.setQuestionScore(tasks.getAnalysisScore());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return JsonResult.success(resourcesQuestions);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|