|
@@ -2,6 +2,7 @@ package com.qmth.distributed.print.business.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -21,7 +22,6 @@ import com.qmth.distributed.print.business.bean.result.WorkResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskExamStudentImportResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.examTaskStudent.ExamTaskStudentObjectResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.examTaskStudent.StudentInfo;
|
|
|
-import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
|
import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
|
|
@@ -38,6 +38,7 @@ import com.qmth.teachcloud.common.bean.params.BasicStudentExtrasParam;
|
|
|
import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
|
|
|
import com.qmth.teachcloud.common.bean.result.SysUserResult;
|
|
|
import com.qmth.teachcloud.common.bean.result.TbTaskDetailResult;
|
|
|
+import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
@@ -949,9 +950,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
dirPath = dirPath.add(rootPath).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getSemesterName()).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getExamName()).add(File.separator)
|
|
|
- .add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(File.separator)
|
|
|
+ .add(examTaskDetailPdfDownloadDto.getCourseNameCode().replaceAll(" ", "")).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(File.separator)
|
|
|
- .add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(SystemConstant.HYPHEN)
|
|
|
+ .add(examTaskDetailPdfDownloadDto.getCourseNameCode().replaceAll(" ", "")).add(SystemConstant.HYPHEN)
|
|
|
.add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(SystemConstant.HYPHEN);
|
|
|
List<File> fileList = new ArrayList<>();
|
|
|
List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetailPdfDownloadDto.getPaperAttachmentIds());
|
|
@@ -966,7 +967,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
paperPath = paperPath.add(rootPath).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getSemesterName()).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getExamName()).add(File.separator)
|
|
|
- .add(examTaskDetailPdfDownloadDto.getCourseNameCode()).add(File.separator)
|
|
|
+ .add(examTaskDetailPdfDownloadDto.getCourseNameCode().replaceAll(" ", "")).add(File.separator)
|
|
|
.add(examTaskDetailPdfDownloadDto.getPaperNumber()).add(File.separator);
|
|
|
String fileName = examTaskDetailPdfDownloadDto.getCourseNameCode() + SystemConstant.HYPHEN + examTaskDetailPdfDownloadDto.getPaperNumber() + SystemConstant.HYPHEN + "试卷" + SystemConstant.HYPHEN + name + attachment.getType();
|
|
|
File file = teachcloudCommonService.copyFile(paperPath.toString(), fileName, attachment);
|
|
@@ -2131,6 +2132,18 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ExamTask getByExamIdAndCourseCodeAndPaperNumber(Long examId, String courseCode, String paperNumber) {
|
|
|
+ QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
|
|
|
+ LambdaQueryWrapper<ExamTask> lambdaQueryWrapper = queryWrapper.lambda();
|
|
|
+ lambdaQueryWrapper.eq(ExamTask::getExamId, examId);
|
|
|
+ if (StringUtils.isNotBlank(courseCode)) {
|
|
|
+ lambdaQueryWrapper.eq(ExamTask::getCourseCode, courseCode);
|
|
|
+ }
|
|
|
+ lambdaQueryWrapper.eq(ExamTask::getPaperNumber, paperNumber);
|
|
|
+ return this.getOne(queryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 简单校验提交参数
|
|
|
*
|