|
@@ -8,10 +8,7 @@ import com.aliyun.oss.common.utils.BinaryUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.distributed.print.business.annotation.ExcelDBFieldDesc;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.ExaminationExportDto;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.ExaminationImportDto;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.FieldsDto;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.PdfDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.*;
|
|
|
import com.qmth.distributed.print.business.bean.params.ArraysParams;
|
|
|
import com.qmth.distributed.print.business.bean.params.SerialNumberParams;
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
@@ -237,8 +234,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String paperType = Objects.nonNull(paperTypeParam) ? paperTypeParam : createPdfUtil.getPaperType(examPrintPlan, examTaskDetail, examDetail, examDetailCourse);
|
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
|
|
|
|
+ PaperPdfDto paperPdfDto = createPdfUtil.getPaperPdfFile(paperType, examTaskDetail);
|
|
|
+
|
|
|
//获取试卷pdf
|
|
|
- PdfDto pdfDto = createPdfUtil.getPaperPdf(paperType, examTaskDetail, examPrintPlan.getBackupCount(), null, backupPaperTempPdfList);
|
|
|
+ PdfDto pdfDto = createPdfUtil.getPaperPdf(paperPdfDto, examPrintPlan.getBackupCount(), backupPaperTempPdfList);
|
|
|
examDetailCourse.setPaperPagesA3(Objects.nonNull(pdfDto) ? pdfDto.getPageCount() : examDetailCourse.getPaperPagesA3());
|
|
|
backupPaperPdfList.addAll(backupPaperTempPdfList);
|
|
|
|
|
@@ -290,11 +289,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
});
|
|
|
|
|
|
for (ExamStudent t : examStudentList) {
|
|
|
- createPdfUtil.getPaperPdf(paperType, examTaskDetail, 1, paperPdfTempList, null);
|
|
|
- paperPdfList.addAll(paperPdfTempList);
|
|
|
-
|
|
|
+ createPdfUtil.getExamStudentPaperPdf(paperPdfDto, paperPdfTempList);
|
|
|
basicAttachmentList.add(createPdfUtil.examStudentHtml(attachmentIds, studentContent, t, paperType, examCard, sysUser.getId(), examStudentTempPdfList));
|
|
|
}
|
|
|
+ paperPdfList.addAll(paperPdfTempList);
|
|
|
examStudentPdfList.addAll(examStudentTempPdfList);
|
|
|
examStudentService.saveOrUpdateBatch(examStudentList);
|
|
|
jsonObject.put("card", jsonArray);
|
|
@@ -664,19 +662,17 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
// 处理试卷样品
|
|
|
List<Map> paperInfo = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
|
- if (Objects.isNull(paperInfo)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("试卷信息不存在");
|
|
|
- }
|
|
|
System.out.println("paperInfo = " + JSON.toJSONString(paperInfo));
|
|
|
Set<Long> attPaperIds = new HashSet<>();
|
|
|
for (Map paperMap : paperInfo) {
|
|
|
- if (Objects.nonNull(paperMap.get("attachmentId")) && String.valueOf(paperMap.get("attachmentId")).length() > 0 && !String.valueOf(paperMap.get("attachmentId")).equals("null")) {
|
|
|
- Long attachmentId = Long.valueOf(String.valueOf(paperMap.get("attachmentId")));
|
|
|
- attPaperIds.add(attachmentId);
|
|
|
+ if (Objects.isNull(paperMap.get("attachmentId"))) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("未找到附件id");
|
|
|
}
|
|
|
+ Long attachmentId = Long.valueOf(String.valueOf(paperMap.get("attachmentId")));
|
|
|
+ attPaperIds.add(attachmentId);
|
|
|
}
|
|
|
- if (attPaperIds.size() > 0) {
|
|
|
- List<BasicAttachment> paperAttachmentList = basicAttachmentService.listByIds(attPaperIds);
|
|
|
+ List<BasicAttachment> paperAttachmentList = basicAttachmentService.listByIds(attPaperIds);
|
|
|
+ if (Objects.nonNull(paperAttachmentList)) {
|
|
|
for (BasicAttachment paperAttachment : paperAttachmentList) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(paperAttachment.getPath());
|
|
|
String paperPath = firstPath + File.separator + "试卷" + File.separator + paperAttachment.getName() + paperAttachment.getType();
|
|
@@ -696,8 +692,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
Long attachmentId = Long.valueOf(String.valueOf(confirmMap.get("attachmentId")));
|
|
|
attConfirmIds.add(attachmentId);
|
|
|
}
|
|
|
- if (attConfirmIds.size() > 0) {
|
|
|
- List<BasicAttachment> confirmAttachmentList = basicAttachmentService.listByIds(attConfirmIds);
|
|
|
+ List<BasicAttachment> confirmAttachmentList = basicAttachmentService.listByIds(attConfirmIds);
|
|
|
+ if (Objects.nonNull(confirmAttachmentList)) {
|
|
|
for (BasicAttachment confirmAttachment : confirmAttachmentList) {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(confirmAttachment.getPath());
|
|
|
String confirmPath = firstPath + File.separator + "审核样本" + File.separator + confirmAttachment.getName() + confirmAttachment.getType();
|
|
@@ -733,6 +729,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(cardAttachment.getPath());
|
|
|
String cardPath = firstPath + File.separator + "题卡" + File.separator + cardAttachment.getName() + cardAttachment.getType();
|
|
|
ossUtil.ossDownload((String) jsonObject.get(SystemConstant.PATH), cardPath);
|
|
|
+ count++;
|
|
|
} else {
|
|
|
List<ExamCardDetail> examCardDetailList = examCardDetailService.list(new QueryWrapper<ExamCardDetail>().lambda().eq(ExamCardDetail::getCardId, cardId));
|
|
|
if (examCardDetailList.size() != 1) {
|
|
@@ -747,8 +744,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
localFile.getParentFile().mkdirs();
|
|
|
}
|
|
|
FileCopyUtils.copy(bytes, localFile);
|
|
|
+ count++;
|
|
|
}
|
|
|
- count++;
|
|
|
}
|
|
|
ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), true);
|
|
|
ossUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))));
|