|
@@ -6,8 +6,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.qmth.distributed.print.business.entity.ExamTask;
|
|
|
+import com.qmth.distributed.print.business.entity.ExamTaskDetail;
|
|
|
import com.qmth.distributed.print.business.entity.ExamTaskPaperData;
|
|
|
+import com.qmth.distributed.print.business.service.ExamTaskDetailService;
|
|
|
import com.qmth.distributed.print.business.service.ExamTaskPaperDataService;
|
|
|
+import com.qmth.distributed.print.business.service.ExamTaskService;
|
|
|
+import com.qmth.distributed.print.business.util.ExamTaskUtil;
|
|
|
+import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
@@ -67,6 +73,12 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
|
|
|
@Resource
|
|
|
private ObeCourseRequirementDimensionService obeCourseRequirementDimensionService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ExamTaskDetailService examTaskDetailService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ExamTaskService examTaskService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<ObeCourseTargetResult> findCourseTargetList(Long obeCourseOutlineId) {
|
|
|
ObeCourseOutline courseOutline = obeCourseOutlineService.getById(obeCourseOutlineId);
|
|
@@ -226,9 +238,7 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
|
|
|
Map<String, ObeCourseDimension> courseDimensionMap = obeCourseDimensionList.stream()
|
|
|
.collect(Collectors.toMap(ObeCourseDimension::getCode, e -> e));
|
|
|
|
|
|
- ExamTaskPaperData examTaskPaperData = examTaskPaperDataService.getOne(
|
|
|
- new QueryWrapper<ExamTaskPaperData>().lambda().eq(ExamTaskPaperData::getExamId, examId)
|
|
|
- .eq(ExamTaskPaperData::getPaperNumber, paperNumber).last(SystemConstant.LIMIT1));
|
|
|
+ ExamTaskPaperData examTaskPaperData = this.findExamTaskPaperDataWithPaperTypeA(examId, paperNumber);
|
|
|
if (Objects.nonNull(examTaskPaperData)) {
|
|
|
String paperStruct = examTaskPaperData.getPaperJson();
|
|
|
if (SystemConstant.strNotNull(paperStruct)) {
|
|
@@ -332,8 +342,7 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
|
|
|
* @param dimensionDtoList 知识点集合
|
|
|
* @return 结果
|
|
|
*/
|
|
|
- private List<CourseTargetWebDto> buildByDimensionList(List<ObeCourseTarget> obeCourseTargetDatasource,
|
|
|
- List<DimensionDto> dimensionDtoList) {
|
|
|
+ private List<CourseTargetWebDto> buildByDimensionList(List<ObeCourseTarget> obeCourseTargetDatasource, List<DimensionDto> dimensionDtoList) {
|
|
|
List<CourseTargetWebDto> result = new ArrayList<>();
|
|
|
for (ObeCourseTarget obeCourseTarget : obeCourseTargetDatasource) {
|
|
|
Long courseTargetId = obeCourseTarget.getId();
|
|
@@ -373,4 +382,35 @@ public class ObeCourseTargetServiceImpl extends ServiceImpl<ObeCourseTargetMappe
|
|
|
ObeCourseTarget obeCourseTarget = this.getOne(new QueryWrapper<ObeCourseTarget>().lambda().eq(ObeCourseTarget::getObeCourseOutlineId, obeCourseOutlineId).last(SystemConstant.LIMIT1));
|
|
|
return Objects.nonNull(obeCourseTarget) ? obeCourseTarget.getExpectValue() : null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询对应A卷的题库试卷
|
|
|
+ *
|
|
|
+ * @param examId 考试id
|
|
|
+ * @param paperNumber 试卷编号
|
|
|
+ * @return 题库试卷
|
|
|
+ */
|
|
|
+ private ExamTaskPaperData findExamTaskPaperDataWithPaperTypeA(Long examId, String paperNumber) {
|
|
|
+ ExamTaskPaperData result = null;
|
|
|
+ ExamTask examTask = examTaskService.getOne(new QueryWrapper<ExamTask>().lambda().eq(ExamTask::getExamId, examId)
|
|
|
+ .eq(ExamTask::getPaperNumber, paperNumber).last(SystemConstant.LIMIT1));
|
|
|
+ if (Objects.nonNull(examTask)) {
|
|
|
+ Long examTaskId = examTask.getId();
|
|
|
+ ExamTaskDetail examTaskDetail = examTaskDetailService.getOne(
|
|
|
+ new QueryWrapper<ExamTaskDetail>().lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId)
|
|
|
+ .eq(ExamTaskDetail::getExposedExamId, examId).last(SystemConstant.LIMIT1));
|
|
|
+ if (Objects.nonNull(examTaskDetail)) {
|
|
|
+ List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetail.getPaperAttachmentIds(), "A");
|
|
|
+ if (CollectionUtils.isNotEmpty(paperInfoVoList) && paperInfoVoList.size() == 1) {
|
|
|
+ PaperInfoVo paperInfoVo = paperInfoVoList.get(0);
|
|
|
+ Long paperId = paperInfoVo.getPaperId();
|
|
|
+ result = examTaskPaperDataService.getOne(
|
|
|
+ new QueryWrapper<ExamTaskPaperData>().lambda().eq(ExamTaskPaperData::getExamId, examId)
|
|
|
+ .eq(ExamTaskPaperData::getPaperNumber, paperNumber)
|
|
|
+ .eq(ExamTaskPaperData::getPaperId, paperId).last(SystemConstant.LIMIT1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|