|
@@ -14,10 +14,7 @@ import com.qmth.distributed.print.business.entity.*;
|
|
|
import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
|
|
|
import com.qmth.distributed.print.business.enums.PrintMethodEnum;
|
|
|
import com.qmth.distributed.print.business.enums.StudentClazzEnum;
|
|
|
-import com.qmth.distributed.print.business.service.BasicTemplateService;
|
|
|
-import com.qmth.distributed.print.business.service.ExamDetailService;
|
|
|
-import com.qmth.distributed.print.business.service.ExamStudentService;
|
|
|
-import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
|
+import com.qmth.distributed.print.business.service.*;
|
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
@@ -108,6 +105,12 @@ public class CreatePdfUtil {
|
|
|
@Resource
|
|
|
BasicSemesterService basicSemesterService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ ExamTaskService examTaskService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ ExamTaskDetailService examTaskDetailService;
|
|
|
+
|
|
|
@Resource
|
|
|
DictionaryConfig dictionaryConfig;
|
|
|
|
|
@@ -326,6 +329,21 @@ public class CreatePdfUtil {
|
|
|
pdfPackageDto.setTitle(schoolName);
|
|
|
pdfPackageDto.setPackageNumber(examDetail.getPackageCode());
|
|
|
|
|
|
+ boolean isTag = false;
|
|
|
+ for (ExamDetailCourse detailCourse : examDetailCourseList) {
|
|
|
+ ExamTask examTask = examTaskService.getByCourseCodeAndPaperNumber(examDetail.getSchoolId(), detailCourse.getCourseCode(), detailCourse.getPaperNumber());
|
|
|
+ ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTask.getId());
|
|
|
+ List<JSONObject> objectList = JSON.parseArray(examTaskDetail.getPaperAttachmentIds(), JSONObject.class);
|
|
|
+ for (JSONObject jsonObject : objectList) {
|
|
|
+ int pages = jsonObject.getIntValue("pages");
|
|
|
+ isTag = pages > 2;
|
|
|
+ pdfPackageDto.setTag(isTag);
|
|
|
+ if (isTag) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 标题信息
|
|
|
List<JSONObject> objectTitleList = JSON.parseArray(object.getString("title"), JSONObject.class);
|
|
|
List<Map<String, String>> titlePlate = new ArrayList<>();
|
|
@@ -406,6 +424,42 @@ public class CreatePdfUtil {
|
|
|
} else if ("paperCount".equals(code)) {
|
|
|
basicMap.put("value", examStudentList.size() + " + " + printCount);
|
|
|
}
|
|
|
+ //开课学院
|
|
|
+ else if ("BCollege".equals(code)) {
|
|
|
+ Set<String> bollegeSet = new HashSet<>();
|
|
|
+ for (ExamStudentCourseDto studentCourseDto : examStudentList) {
|
|
|
+ String extendFields = studentCourseDto.getExtendFields();
|
|
|
+ Set<String> stringSet = JSON.parseArray(extendFields, JSONObject.class).stream().filter(m -> "BCollege".equals(m.getString("code"))).map(m -> m.getString("value")).collect(Collectors.toSet());
|
|
|
+ if (!stringSet.isEmpty()) {
|
|
|
+ bollegeSet.addAll(stringSet);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ basicMap.put("value", String.join(",", bollegeSet));
|
|
|
+ }
|
|
|
+ //派监考学院
|
|
|
+ else if ("STICollege".equals(code)) {
|
|
|
+ Set<String> stiCollegeSet = new HashSet<>();
|
|
|
+ for (ExamStudentCourseDto studentCourseDto : examStudentList) {
|
|
|
+ String extendFields = studentCourseDto.getExtendFields();
|
|
|
+ Set<String> stringSet = JSON.parseArray(extendFields, JSONObject.class).stream().filter(m -> "STICollege".equals(m.getString("code"))).map(m -> m.getString("value")).collect(Collectors.toSet());
|
|
|
+ if (!stringSet.isEmpty()) {
|
|
|
+ stiCollegeSet.addAll(stringSet);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ basicMap.put("value", String.join(",", stiCollegeSet));
|
|
|
+ }
|
|
|
+ //上课教师
|
|
|
+ else if ("CTeacher".equals(code)) {
|
|
|
+ Set<String> cTeacherSet = new HashSet<>();
|
|
|
+ for (ExamStudentCourseDto studentCourseDto : examStudentList) {
|
|
|
+ String extendFields = studentCourseDto.getExtendFields();
|
|
|
+ Set<String> stringSet = JSON.parseArray(extendFields, JSONObject.class).stream().filter(m -> "CTeacher".equals(m.getString("code"))).map(m -> m.getString("value")).collect(Collectors.toSet());
|
|
|
+ if (!stringSet.isEmpty()) {
|
|
|
+ cTeacherSet.addAll(stringSet);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ basicMap.put("value", String.join(",", cTeacherSet));
|
|
|
+ }
|
|
|
basicPlate.add(basicMap);
|
|
|
|
|
|
}
|