|
@@ -10,7 +10,6 @@ import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
|
|
|
import com.qmth.distributed.print.business.bean.params.RelatePaperParam;
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
|
|
|
-import com.qmth.distributed.print.business.enums.ExamStatusEnum;
|
|
|
import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
|
|
|
import com.qmth.distributed.print.business.mapper.ExamTaskDetailMapper;
|
|
|
import com.qmth.distributed.print.business.service.*;
|
|
@@ -290,31 +289,37 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, String> getUrl(Long schoolId, Long printPlanId, Long examTaskId) {
|
|
|
+ public List<Map<String, String>> getUrl(Long schoolId, Long printPlanId, Long examTaskId) {
|
|
|
ExamTask examTask = examTaskService.getById(examTaskId);
|
|
|
List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, examTask.getCourseCode(), examTask.getPaperNumber());
|
|
|
if (!CollectionUtils.isEmpty(examDetailCourses)) {
|
|
|
- ExamDetailCourse examDetailCourse = examDetailCourses.get(0);
|
|
|
- QueryWrapper<ExamTaskDetail> examTaskDetailQueryWrapper = new QueryWrapper<>();
|
|
|
- examTaskDetailQueryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId);
|
|
|
- ExamTaskDetail examTaskDetail = this.getOne(examTaskDetailQueryWrapper);
|
|
|
- if (examTaskDetail != null) {
|
|
|
- String relatePaperType = examTaskDetail.getRelatePaperType();
|
|
|
- if (StringUtils.isNotBlank(relatePaperType)) {
|
|
|
- String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
|
- List<Map> list = JSONObject.parseArray(paperAttachmentIds, Map.class);
|
|
|
- String attachmentId = null;
|
|
|
- for (Map map : list) {
|
|
|
- String name = map.get("name").toString();
|
|
|
- if (name.equals(examDetailCourse.getPaperType())) {
|
|
|
- attachmentId = map.get("attachmentId").toString();
|
|
|
+ List<Map<String, String>> paperList = new ArrayList<>();
|
|
|
+ for (ExamDetailCourse examDetailCourse : examDetailCourses) {
|
|
|
+ QueryWrapper<ExamTaskDetail> examTaskDetailQueryWrapper = new QueryWrapper<>();
|
|
|
+ examTaskDetailQueryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId);
|
|
|
+ ExamTaskDetail examTaskDetail = this.getOne(examTaskDetailQueryWrapper);
|
|
|
+ if (examTaskDetail != null) {
|
|
|
+ String relatePaperType = examDetailCourse.getPaperType();
|
|
|
+ if (StringUtils.isNotBlank(relatePaperType)) {
|
|
|
+ String[] paperTypes = relatePaperType.split(",");
|
|
|
+ String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
|
+ List<Map> list = JSONObject.parseArray(paperAttachmentIds, Map.class);
|
|
|
+ String attachmentId;
|
|
|
+ for (Map map : list) {
|
|
|
+ String name = map.get("name").toString();
|
|
|
+ for (String paperType : paperTypes) {
|
|
|
+ if (name.equals(paperType)) {
|
|
|
+ attachmentId = map.get("attachmentId").toString();
|
|
|
+ if (StringUtils.isNotBlank(attachmentId)) {
|
|
|
+ paperList.add(teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(attachmentId), false));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(attachmentId)) {
|
|
|
- return teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(attachmentId), false);
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+ return paperList;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
@@ -347,7 +352,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
|
|
|
|
|
|
ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
|
|
|
List<ExamDetail> examDetails = examDetailService.listByCourseCodeAndPaperNumber(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber());
|
|
|
- if(!CollectionUtils.isEmpty(examDetails)) {
|
|
|
+ if (!CollectionUtils.isEmpty(examDetails)) {
|
|
|
List<ExamDetail> examDetailList = examDetails.stream().filter(m -> m.getStatus().equals(ExamDetailStatusEnum.WAITING)).collect(Collectors.toList());
|
|
|
for (ExamDetail examDetail : examDetailList) {
|
|
|
examDetail.setStatus(ExamDetailStatusEnum.NEW);
|