|
@@ -24,6 +24,7 @@ import com.qmth.distributed.print.common.contant.SystemConstant;
|
|
|
import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
|
|
|
import com.qmth.distributed.print.common.util.FileUtil;
|
|
|
import com.qmth.distributed.print.common.util.HexUtils;
|
|
|
+import com.qmth.distributed.print.common.util.JacksonUtil;
|
|
|
import com.qmth.distributed.print.common.util.ResultUtil;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
@@ -263,6 +264,13 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Collections.sort(variablePdfList, new Comparator<PdfDto>() {
|
|
|
+ @Override
|
|
|
+ public int compare(PdfDto o1, PdfDto o2) {
|
|
|
+ return o1.getSequence() > o2.getSequence() ? 1 : -1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
for (ExamStudent t : examStudentList) {
|
|
|
basicAttachmentList.add(createPdfUtil.examStudentHtml(attachmentIds, studentContent, t, paperType, examCard, sysUser.getId(), examStudentTempPdfList));
|
|
|
}
|
|
@@ -420,7 +428,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
String examDate = null;
|
|
|
String examTime = null;
|
|
|
String paperNumber = null;
|
|
|
- List<FieldsDto> secondaryFieldList = new ArrayList<>();
|
|
|
+ List<FieldsDto> secondaryFieldList = new ArrayList<>(); // 备选字段
|
|
|
for (FieldsDto fieldsDto : fieldsDtoList) {
|
|
|
String name = fieldsDto.getName();
|
|
|
String code = fieldsDto.getCode();
|
|
@@ -472,7 +480,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
}
|
|
|
}
|
|
|
// 校验试卷编号
|
|
|
- examTaskService.verifyCourseCodeByPaperNumber(schoolId,paperNumber,courseCode);
|
|
|
+ examTaskService.verifyCourseCodeByPaperNumber(schoolId, paperNumber, courseCode);
|
|
|
|
|
|
// 校验课程信息
|
|
|
basicCourseService.verifyCourseInfo(schoolId, courseCode, courseName, userId);
|
|
@@ -527,27 +535,33 @@ public class TaskLogicServiceImpl implements TaskLogicService {
|
|
|
Long value = counter.get();
|
|
|
try {
|
|
|
// 组装exam_detail数据
|
|
|
- examDetailService.disposeExamDetailByExaminationExcel(dataList, userId, serialNumberParams);
|
|
|
+ List<Long> examDetailIdList = examDetailService.disposeExamDetailByExaminationExcel(dataList, userId, serialNumberParams);
|
|
|
// 组装exam_detail_course数据
|
|
|
examDetailService.disposeExamDetailCourseByExaminationExcel(dataList, userId);
|
|
|
// 组装exam_student数据
|
|
|
examDetailService.disposeExamStudentByExaminationExcel(dataList, userId);
|
|
|
|
|
|
- List<Map<String, Object>> checkList = dataList.stream().flatMap(e -> {
|
|
|
- Map<String, Object> tmp = new HashMap<>();
|
|
|
- tmp.put("schoolId", e.get("schoolId"));
|
|
|
- tmp.put("courseCode", e.get("courseCode"));
|
|
|
- tmp.put("paperNumber", e.get("paperNumber"));
|
|
|
- return Stream.of(tmp);
|
|
|
- }).distinct().collect(Collectors.toList());
|
|
|
- for (Map<String, Object> stringObjectMap : checkList) {
|
|
|
- Long checkSchoolId = SystemConstant.convertIdToLong(String.valueOf(stringObjectMap.get("schoolId")));
|
|
|
- String checkCourseCode = String.valueOf(stringObjectMap.get("courseCode"));
|
|
|
- String checkPaperNumber = String.valueOf(stringObjectMap.get("paperNumber"));
|
|
|
- SysUser user = (SysUser) map.get(SystemConstant.USER);
|
|
|
- user.setSchoolId(schoolId);
|
|
|
- commonService.checkData(checkSchoolId, checkCourseCode, checkPaperNumber, user);
|
|
|
+ // 按照考场检验命题任务是否全部完成,完成生成pdf
|
|
|
+ SysUser user = (SysUser) map.get(SystemConstant.USER);
|
|
|
+ for (Long examDetailId : examDetailIdList) {
|
|
|
+ examTaskService.checkDataByExamination(examDetailId, user);
|
|
|
}
|
|
|
+
|
|
|
+// List<Map<String, Object>> checkList = dataList.stream().flatMap(e -> {
|
|
|
+// Map<String, Object> tmp = new HashMap<>();
|
|
|
+// tmp.put("schoolId", e.get("schoolId"));
|
|
|
+// tmp.put("courseCode", e.get("courseCode"));
|
|
|
+// tmp.put("paperNumber", e.get("paperNumber"));
|
|
|
+// return Stream.of(tmp);
|
|
|
+// }).distinct().collect(Collectors.toList());
|
|
|
+// for (Map<String, Object> stringObjectMap : checkList) {
|
|
|
+// Long checkSchoolId = SystemConstant.convertIdToLong(String.valueOf(stringObjectMap.get("schoolId")));
|
|
|
+// String checkCourseCode = String.valueOf(stringObjectMap.get("courseCode"));
|
|
|
+// String checkPaperNumber = String.valueOf(stringObjectMap.get("paperNumber"));
|
|
|
+// SysUser user = (SysUser) map.get(SystemConstant.USER);
|
|
|
+// user.setSchoolId(schoolId);
|
|
|
+// commonService.checkData(checkSchoolId, checkCourseCode, checkPaperNumber, user);
|
|
|
+// }
|
|
|
map.put("dataCount", dataList.size());
|
|
|
} catch (Exception e) {
|
|
|
redisTemplate.opsForValue().set(key, value);
|