|
@@ -325,8 +325,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
public Map<String, Object> executeExaminationLogic(Map<String, Object> map) throws Exception {
|
|
public Map<String, Object> executeExaminationLogic(Map<String, Object> map) throws Exception {
|
|
List<ExaminationExportDto> examinationExportDtoList = examDetailService.findExaminationExportDtoDatasource(map);
|
|
List<ExaminationExportDto> examinationExportDtoList = examDetailService.findExaminationExportDtoDatasource(map);
|
|
|
|
|
|
- System.out.println("examinationResultList = " + JSON.toJSONString(examinationExportDtoList));
|
|
|
|
-
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
ExcelUtil.excelMake(ExaminationExportDto.class, examinationExportDtoList, outputStream);
|
|
ExcelUtil.excelMake(ExaminationExportDto.class, examinationExportDtoList, outputStream);
|
|
InputStream in = new ByteArrayInputStream(outputStream.toByteArray());
|
|
InputStream in = new ByteArrayInputStream(outputStream.toByteArray());
|
|
@@ -439,7 +437,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String level = fieldsDto.getLevel();
|
|
String level = fieldsDto.getLevel();
|
|
|
|
|
|
Cell cell = row.getCell(index);
|
|
Cell cell = row.getCell(index);
|
|
- if (cell == null){
|
|
|
|
|
|
+ if (cell == null) {
|
|
throw ExceptionResultEnum.ERROR.exception("excel中第[" + (r + 1) + "]行,第[" + (index + 1) + "]列,字段[" + name + "]必填");
|
|
throw ExceptionResultEnum.ERROR.exception("excel中第[" + (r + 1) + "]行,第[" + (index + 1) + "]列,字段[" + name + "]必填");
|
|
}
|
|
}
|
|
String cellValue = String.valueOf(ExcelUtil.convert(cell));
|
|
String cellValue = String.valueOf(ExcelUtil.convert(cell));
|
|
@@ -669,7 +667,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
String firstPath = zipLocalRootPath + File.separator + examTaskSign;
|
|
String firstPath = zipLocalRootPath + File.separator + examTaskSign;
|
|
List<ExamTaskDetail> examTaskDetailList = examTaskDetailService.list(new QueryWrapper<ExamTaskDetail>().lambda().eq(ExamTaskDetail::getExamTaskId, id));
|
|
List<ExamTaskDetail> examTaskDetailList = examTaskDetailService.list(new QueryWrapper<ExamTaskDetail>().lambda().eq(ExamTaskDetail::getExamTaskId, id));
|
|
if (examTaskDetailList.size() != 1) {
|
|
if (examTaskDetailList.size() != 1) {
|
|
- throw ExceptionResultEnum.ERROR.exception("获取命题任务详情失败 命题任务id : " + id);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("获取命题任务详情失败");
|
|
}
|
|
}
|
|
ExamTaskDetail examTaskDetail = examTaskDetailList.get(0);
|
|
ExamTaskDetail examTaskDetail = examTaskDetailList.get(0);
|
|
|
|
|
|
@@ -720,25 +718,25 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
Long cardId = examTaskDetail.getCardId();
|
|
Long cardId = examTaskDetail.getCardId();
|
|
ExamCard examCard = examCardService.getById(cardId);
|
|
ExamCard examCard = examCardService.getById(cardId);
|
|
if (Objects.isNull(examCard)) {
|
|
if (Objects.isNull(examCard)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到答题卡 cardId = " + cardId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到答题卡");
|
|
}
|
|
}
|
|
MakeMethodEnum makeMethodEnum = examCard.getMakeMethod();
|
|
MakeMethodEnum makeMethodEnum = examCard.getMakeMethod();
|
|
if (MakeMethodEnum.SELECT.equals(makeMethodEnum)) {
|
|
if (MakeMethodEnum.SELECT.equals(makeMethodEnum)) {
|
|
Long templateId = examCard.getTemplateId();
|
|
Long templateId = examCard.getTemplateId();
|
|
if (templateId == null || templateId == 0) {
|
|
if (templateId == null || templateId == 0) {
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到题卡对应的模板 templateId = " + templateId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到题卡对应的模板");
|
|
}
|
|
}
|
|
BasicTemplate basicTemplate = basicTemplateService.getById(templateId);
|
|
BasicTemplate basicTemplate = basicTemplateService.getById(templateId);
|
|
if (Objects.isNull(basicTemplate)) {
|
|
if (Objects.isNull(basicTemplate)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到模板信息 templateId = " + templateId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到模板信息");
|
|
}
|
|
}
|
|
Long attachmentId = basicTemplate.getAttachmentId();
|
|
Long attachmentId = basicTemplate.getAttachmentId();
|
|
if (attachmentId == null || attachmentId == 0) {
|
|
if (attachmentId == null || attachmentId == 0) {
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到模板对应的附件 templateId = " + templateId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到模板对应的附件");
|
|
}
|
|
}
|
|
BasicAttachment cardAttachment = basicAttachmentService.getById(attachmentId);
|
|
BasicAttachment cardAttachment = basicAttachmentService.getById(attachmentId);
|
|
if (Objects.isNull(cardAttachment)) {
|
|
if (Objects.isNull(cardAttachment)) {
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到附件 attachmentId = " + attachmentId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
}
|
|
}
|
|
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();
|
|
@@ -747,7 +745,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
} 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) {
|
|
- throw ExceptionResultEnum.ERROR.exception("题卡明细信息异常 card_id = " + cardId);
|
|
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("题卡明细信息异常");
|
|
}
|
|
}
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(cardId);
|
|
ExamCardDetail examCardDetail = examCardDetailService.getByCardId(cardId);
|
|
String htmlContent = examCardDetail.getHtmlContent();
|
|
String htmlContent = examCardDetail.getHtmlContent();
|