|
@@ -70,7 +70,7 @@ public class CreatePdfUtil {
|
|
|
*/
|
|
|
public void createCheckIn(ExamDetail examDetail, BasicAttachment basicAttachment, List<PdfDto> ordinaryPdfList, Integer printCount) throws IOException, DocumentException {
|
|
|
if (Objects.isNull(basicAttachment)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
|
|
|
}
|
|
|
String type = basicAttachment.getType();
|
|
|
JSONObject jsonObject = JSONObject.parseObject(basicAttachment.getPath());
|
|
@@ -100,7 +100,7 @@ public class CreatePdfUtil {
|
|
|
*/
|
|
|
public void createPaperPackage(boolean tag, BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
|
|
|
if (Objects.isNull(basicAttachment)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
|
|
|
}
|
|
|
Map<String, Object> htmlMap = new HashMap<>();
|
|
|
if (Objects.nonNull(examStudentList) && examStudentList.size() > 0) {
|
|
@@ -185,7 +185,7 @@ public class CreatePdfUtil {
|
|
|
*/
|
|
|
public void createSignBook(BasicAttachment basicAttachment, String schoolName, ExamDetail examDetail, List<ExamStudentCourseDto> examStudentList, List<PdfDto> variablePdfList, Integer printCount) throws IOException {
|
|
|
if (Objects.isNull(basicAttachment)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
|
|
|
}
|
|
|
Map<String, Object> htmlMap = new HashMap<>();
|
|
|
if (Objects.nonNull(examStudentList) && examStudentList.size() > 0) {
|
|
@@ -368,7 +368,7 @@ public class CreatePdfUtil {
|
|
|
Long attachmentId = Long.parseLong((String) (object.get("attachmentId")));
|
|
|
BasicAttachment basicAttachment = basicAttachmentService.getById(attachmentId);
|
|
|
if (Objects.isNull(basicAttachment)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("找不到附件");
|
|
|
+ throw ExceptionResultEnum.ATTACHMENT_IS_NULL.exception();
|
|
|
}
|
|
|
String name = (String) object.get("name");
|
|
|
if (Objects.equals(name.toUpperCase(), paperType.toUpperCase())) {
|
|
@@ -398,14 +398,14 @@ public class CreatePdfUtil {
|
|
|
//已曝光卷型
|
|
|
String exposedPaperType = examTaskDetail.getExposedPaperType();
|
|
|
if (drawRule == DrawRuleEnum.ONE) {
|
|
|
- if (Objects.isNull(unexposedPaperType)) {
|
|
|
+ if (Objects.isNull(unexposedPaperType) || Objects.equals(unexposedPaperType.trim(), "")) {
|
|
|
CreatePdfCacheUtil.deletePaperType(key);
|
|
|
- throw ExceptionResultEnum.ERROR.exception("当前没有未曝光的卷型");
|
|
|
+ throw ExceptionResultEnum.PAPER_ERROR.exception();
|
|
|
}
|
|
|
} else {
|
|
|
- if (Objects.isNull(exposedPaperType) && Objects.isNull(unexposedPaperType)) {
|
|
|
+ if ((Objects.isNull(exposedPaperType) || Objects.equals(exposedPaperType.trim(), "")) && (Objects.isNull(unexposedPaperType) || Objects.equals(unexposedPaperType.trim(), ""))) {
|
|
|
CreatePdfCacheUtil.deletePaperType(key);
|
|
|
- throw ExceptionResultEnum.ERROR.exception("当前没有未曝光的卷型");
|
|
|
+ throw ExceptionResultEnum.PAPER_ERROR.exception();
|
|
|
}
|
|
|
}
|
|
|
String paperType = null;
|
|
@@ -447,7 +447,7 @@ public class CreatePdfUtil {
|
|
|
log.info("getPaperType key:{},paperType:{},lock:{}", key, paperType, lock);
|
|
|
if (!lock) {
|
|
|
log.info("getPaperType 未获取到锁,key:{}", key);
|
|
|
- throw ExceptionResultEnum.ERROR.exception("未获取到试卷类型");
|
|
|
+ throw ExceptionResultEnum.PAPER_TYPE_ERROR.exception();
|
|
|
}
|
|
|
return paperType;
|
|
|
}
|