|
@@ -662,17 +662,19 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
// 处理试卷样品
|
|
// 处理试卷样品
|
|
List<Map> paperInfo = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
List<Map> paperInfo = JSONObject.parseArray(examTaskDetail.getPaperAttachmentIds(), Map.class);
|
|
|
|
+ if (Objects.isNull(paperInfo)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("试卷信息不存在");
|
|
|
|
+ }
|
|
System.out.println("paperInfo = " + JSON.toJSONString(paperInfo));
|
|
System.out.println("paperInfo = " + JSON.toJSONString(paperInfo));
|
|
Set<Long> attPaperIds = new HashSet<>();
|
|
Set<Long> attPaperIds = new HashSet<>();
|
|
for (Map paperMap : paperInfo) {
|
|
for (Map paperMap : paperInfo) {
|
|
- if (Objects.isNull(paperMap.get("attachmentId"))) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("未找到附件id");
|
|
|
|
|
|
+ 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);
|
|
}
|
|
}
|
|
- Long attachmentId = Long.valueOf(String.valueOf(paperMap.get("attachmentId")));
|
|
|
|
- attPaperIds.add(attachmentId);
|
|
|
|
}
|
|
}
|
|
- List<BasicAttachment> paperAttachmentList = basicAttachmentService.listByIds(attPaperIds);
|
|
|
|
- if (Objects.nonNull(paperAttachmentList)) {
|
|
|
|
|
|
+ if (attPaperIds.size() > 0) {
|
|
|
|
+ List<BasicAttachment> paperAttachmentList = basicAttachmentService.listByIds(attPaperIds);
|
|
for (BasicAttachment paperAttachment : paperAttachmentList) {
|
|
for (BasicAttachment paperAttachment : paperAttachmentList) {
|
|
JSONObject jsonObject = JSONObject.parseObject(paperAttachment.getPath());
|
|
JSONObject jsonObject = JSONObject.parseObject(paperAttachment.getPath());
|
|
String paperPath = firstPath + File.separator + "试卷" + File.separator + paperAttachment.getName() + paperAttachment.getType();
|
|
String paperPath = firstPath + File.separator + "试卷" + File.separator + paperAttachment.getName() + paperAttachment.getType();
|
|
@@ -692,8 +694,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
Long attachmentId = Long.valueOf(String.valueOf(confirmMap.get("attachmentId")));
|
|
Long attachmentId = Long.valueOf(String.valueOf(confirmMap.get("attachmentId")));
|
|
attConfirmIds.add(attachmentId);
|
|
attConfirmIds.add(attachmentId);
|
|
}
|
|
}
|
|
- List<BasicAttachment> confirmAttachmentList = basicAttachmentService.listByIds(attConfirmIds);
|
|
|
|
- if (Objects.nonNull(confirmAttachmentList)) {
|
|
|
|
|
|
+ if (attConfirmIds.size() > 0) {
|
|
|
|
+ List<BasicAttachment> confirmAttachmentList = basicAttachmentService.listByIds(attConfirmIds);
|
|
for (BasicAttachment confirmAttachment : confirmAttachmentList) {
|
|
for (BasicAttachment confirmAttachment : confirmAttachmentList) {
|
|
JSONObject jsonObject = JSONObject.parseObject(confirmAttachment.getPath());
|
|
JSONObject jsonObject = JSONObject.parseObject(confirmAttachment.getPath());
|
|
String confirmPath = firstPath + File.separator + "审核样本" + File.separator + confirmAttachment.getName() + confirmAttachment.getType();
|
|
String confirmPath = firstPath + File.separator + "审核样本" + File.separator + confirmAttachment.getName() + confirmAttachment.getType();
|
|
@@ -729,7 +731,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
JSONObject jsonObject = JSONObject.parseObject(cardAttachment.getPath());
|
|
JSONObject jsonObject = JSONObject.parseObject(cardAttachment.getPath());
|
|
String cardPath = firstPath + File.separator + "题卡" + File.separator + cardAttachment.getName() + cardAttachment.getType();
|
|
String cardPath = firstPath + File.separator + "题卡" + File.separator + cardAttachment.getName() + cardAttachment.getType();
|
|
ossUtil.ossDownload((String) jsonObject.get(SystemConstant.PATH), cardPath);
|
|
ossUtil.ossDownload((String) jsonObject.get(SystemConstant.PATH), cardPath);
|
|
- count++;
|
|
|
|
} else {
|
|
} else {
|
|
List<ExamCardDetail> examCardDetailList = examCardDetailService.list(new QueryWrapper<ExamCardDetail>().lambda().eq(ExamCardDetail::getCardId, cardId));
|
|
List<ExamCardDetail> examCardDetailList = examCardDetailService.list(new QueryWrapper<ExamCardDetail>().lambda().eq(ExamCardDetail::getCardId, cardId));
|
|
if (examCardDetailList.size() != 1) {
|
|
if (examCardDetailList.size() != 1) {
|
|
@@ -744,8 +745,8 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
localFile.getParentFile().mkdirs();
|
|
localFile.getParentFile().mkdirs();
|
|
}
|
|
}
|
|
FileCopyUtils.copy(bytes, localFile);
|
|
FileCopyUtils.copy(bytes, localFile);
|
|
- count++;
|
|
|
|
}
|
|
}
|
|
|
|
+ count++;
|
|
}
|
|
}
|
|
ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), true);
|
|
ZipUtil.zip(zipLocalRootPath, zipFile.getPath(), true);
|
|
ossUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))));
|
|
ossUtil.ossUpload(dirNameTmp, zipFile, BinaryUtil.toBase64String(HexUtils.decodeHex(DigestUtils.md5Hex(new FileInputStream(zipFile)))));
|