|
@@ -247,10 +247,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
List<PdfDto> backupPaperTempPdfList = new ArrayList<>();//备份试卷
|
|
List<PdfDto> backupPaperTempPdfList = new ArrayList<>();//备份试卷
|
|
List<PdfDto> cardPdfTempList = new ArrayList<>();//备份题卡
|
|
List<PdfDto> cardPdfTempList = new ArrayList<>();//备份题卡
|
|
|
|
|
|
- // 印品
|
|
|
|
- BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByCourseCodeAndPaperNumber(examDetailCourse.getCourseCode(), examDetailCourse.getPaperNumber());
|
|
|
|
-
|
|
|
|
- String printContent = StringUtils.isNotBlank(examPrintPlan.getPrintContent()) ? examPrintPlan.getPrintContent() : basicPrintConfig.getPrintContent();
|
|
|
|
|
|
+ String printContent = examPrintPlan.getPrintContent();
|
|
if (StringUtils.isBlank(printContent)) {
|
|
if (StringUtils.isBlank(printContent)) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -307,8 +304,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
paperType = paperTypeParam;
|
|
paperType = paperTypeParam;
|
|
CreatePdfCacheUtil.setPaperType(key, paperType);
|
|
CreatePdfCacheUtil.setPaperType(key, paperType);
|
|
} else {
|
|
} else {
|
|
- DrawRuleEnum drawRuleEnum = examPrintPlan.getDrawRule() != null ? examPrintPlan.getDrawRule() : basicPrintConfig.getDrawRule();
|
|
|
|
- paperType = createPdfUtil.getPaperType(drawRuleEnum, examTaskDetail, key);//抽取卷型
|
|
|
|
|
|
+ paperType = createPdfUtil.getPaperType(examPrintPlan.getDrawRule(), examTaskDetail, key);//抽取卷型
|
|
}
|
|
}
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
examTaskDetail.setRelatePaperType(paperType);
|
|
examDetailCourse.setPaperType(paperType);
|
|
examDetailCourse.setPaperType(paperType);
|
|
@@ -322,7 +318,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
List<String> paperTypes = Arrays.asList(paperType.split(",")).stream().sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
|
|
List<String> paperTypes = Arrays.asList(paperType.split(",")).stream().sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
|
|
int i1 = 0;
|
|
int i1 = 0;
|
|
for (ExamStudent t : examStudentList) {
|
|
for (ExamStudent t : examStudentList) {
|
|
- int mod = i1 % examTaskDetail.getDrawCount().intValue();
|
|
|
|
|
|
+ int mod = i1 % examTaskDetail.getDrawCount();
|
|
String stuPaperType = paperTypes.get(mod);
|
|
String stuPaperType = paperTypes.get(mod);
|
|
t.setPaperType(stuPaperType);
|
|
t.setPaperType(stuPaperType);
|
|
i1++;
|
|
i1++;
|
|
@@ -330,7 +326,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
|
|
|
List<PaperPdfDto> paperPdfDto = null;
|
|
List<PaperPdfDto> paperPdfDto = null;
|
|
|
|
|
|
- int backupCount = examPrintPlan.getBackupCount() != null ? examPrintPlan.getBackupCount().intValue() : basicPrintConfig.getBackupCount();
|
|
|
|
|
|
+ int backupCount = examPrintPlan.getBackupCount() != null ? examPrintPlan.getBackupCount() : 0;
|
|
|
|
|
|
if (printContent.contains("PAPER")) {
|
|
if (printContent.contains("PAPER")) {
|
|
paperPdfDto = createPdfUtil.getPaperPdfFile(paperType, examTaskDetail);
|
|
paperPdfDto = createPdfUtil.getPaperPdfFile(paperType, examTaskDetail);
|
|
@@ -372,7 +368,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
list[1].addAll(cardPdfTempList);
|
|
list[1].addAll(cardPdfTempList);
|
|
|
|
|
|
for (ExamStudent t : examStudentList) {
|
|
for (ExamStudent t : examStudentList) {
|
|
- basicAttachmentList.add(createPdfUtil.examStudentHtml(attachmentIds, studentContent, t, examDetail, examDetailCourse, sysUser.getId(), examStudentTempPdfList));
|
|
|
|
|
|
+ basicAttachmentList.add(createPdfUtil.examStudentHtml(attachmentIds, studentContent, t, examDetail, examDetailCourse, sysUser.getId(), examStudentTempPdfList, basicCardRule));
|
|
}
|
|
}
|
|
// 题卡
|
|
// 题卡
|
|
list[3].addAll(examStudentTempPdfList);
|
|
list[3].addAll(examStudentTempPdfList);
|
|
@@ -405,11 +401,9 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
@Transactional
|
|
@Transactional
|
|
public void createA4File(ExamPrintPlan examPrintPlan, ExamDetail examDetail, BasicSchool basicSchool, Set<File> ftlList, List<ExamDetailCourse> examDetailCourseList, List<PdfDto>... list) throws Exception {
|
|
public void createA4File(ExamPrintPlan examPrintPlan, ExamDetail examDetail, BasicSchool basicSchool, Set<File> ftlList, List<ExamDetailCourse> examDetailCourseList, List<PdfDto>... list) throws Exception {
|
|
// 印品
|
|
// 印品
|
|
- ExamDetailCourse examDetailCourse = examDetailCourseList.get(0);
|
|
|
|
- BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByCourseCodeAndPaperNumber(examDetailCourse.getCourseCode(), examDetailCourse.getPaperNumber());
|
|
|
|
List<Long> examDetailCourseListIds = examDetailCourseList.stream().map(s -> s.getId()).collect(Collectors.toList());
|
|
List<Long> examDetailCourseListIds = examDetailCourseList.stream().map(s -> s.getId()).collect(Collectors.toList());
|
|
|
|
|
|
- String ordinaryContent = StringUtils.isNotBlank(examPrintPlan.getOrdinaryContent()) ? examPrintPlan.getOrdinaryContent() : basicPrintConfig.getOrdinaryContent();
|
|
|
|
|
|
+ String ordinaryContent = examPrintPlan.getOrdinaryContent();
|
|
|
|
|
|
if (StringUtils.isNotBlank(ordinaryContent)) {
|
|
if (StringUtils.isNotBlank(ordinaryContent)) {
|
|
//获取普通印品
|
|
//获取普通印品
|
|
@@ -424,12 +418,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- String variableContent = StringUtils.isNotBlank(examPrintPlan.getVariableContent()) ? examPrintPlan.getVariableContent() : basicPrintConfig.getVariableContent();
|
|
|
|
|
|
+ String variableContent = examPrintPlan.getVariableContent();
|
|
|
|
|
|
if (StringUtils.isNotBlank(variableContent)) {
|
|
if (StringUtils.isNotBlank(variableContent)) {
|
|
List<ExamStudentCourseDto> examStudentCourseDtoList = examStudentService.queryBySchoolIdAndExamDetailCourseIds(basicSchool.getId(), examDetailCourseListIds);
|
|
List<ExamStudentCourseDto> examStudentCourseDtoList = examStudentService.queryBySchoolIdAndExamDetailCourseIds(basicSchool.getId(), examDetailCourseListIds);
|
|
int count = (int) examStudentCourseDtoList.stream().filter(s -> s.getPaperPageA3() != null && s.getPaperPageA3() > 2).count();
|
|
int count = (int) examStudentCourseDtoList.stream().filter(s -> s.getPaperPageA3() != null && s.getPaperPageA3() > 2).count();
|
|
- boolean tag = count > 0 ? true : false;
|
|
|
|
|
|
+ boolean tag = count > 0;
|
|
|
|
|
|
//获取变量印品
|
|
//获取变量印品
|
|
JSONArray jsonArrayVariable = JSONArray.parseArray(variableContent);
|
|
JSONArray jsonArrayVariable = JSONArray.parseArray(variableContent);
|