|
@@ -328,272 +328,6 @@ public class WrittenMaterial10047FZ extends WrittenMaterialDefault {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*****************
|
|
|
- * 桌贴(无照片-桌贴备份)
|
|
|
- */
|
|
|
- public File makeWriteSeat_BK(FrameThread thread, File tempFile, LyGroup group, boolean image_flag) {
|
|
|
- Document doc = null;
|
|
|
- try {
|
|
|
- doc = pageModel.prepareDocument(tempFile);
|
|
|
- doc.setMargins(0, 0, 0, 0);
|
|
|
- doc.setBorder(null);
|
|
|
- doc.setFont(getSchoolFont());
|
|
|
- List<LyRoomWritten> roomArray = this.daoRoom.listRoom(group.getLy_group_id());
|
|
|
- Map<LyRoomWritten, List<Map<String, Object>>> roomStdMap = new LinkedHashMap<LyRoomWritten, List<Map<String, Object>>>();
|
|
|
-
|
|
|
- FrameThreadHelper.updateThread(thread, 1, "一共有【" + roomArray.size() + "】个笔试考场", FrameThreadStatus.Running);
|
|
|
- for (LyRoomWritten room : roomArray) {
|
|
|
- roomStdMap.put(room, this.daoRoom.listRoomStd(group.getLy_group_id(), room));
|
|
|
- }
|
|
|
-
|
|
|
- int pageStdCount = 30;
|
|
|
-
|
|
|
- // 每行考生数
|
|
|
- int roomIndex = 0;
|
|
|
- for (List<Map<String, Object>> array : roomStdMap.values()) {
|
|
|
- Table mainTable = new Table(new float[] { 1, 1, 1 }).setWidthPercent(100).setBorder(Border.NO_BORDER);
|
|
|
- // 宽度 及无边框设置
|
|
|
- boolean hasStd = false;
|
|
|
- for (int stdIndex = 0; stdIndex < array.size(); stdIndex++) {
|
|
|
- Map<String, Object> std = array.get(stdIndex);
|
|
|
- Table stdTable = new Table(new float[] { 1.2f, 1 }).setWidthPercent(100).setBorder(Border.NO_BORDER)
|
|
|
- .setMarginTop(17);
|
|
|
- stdTable.addCell(new Cell(1, 2).add(
|
|
|
- "央美招生 -- " + (StringHelper.isEmpty(group.getShow_aspect_name()) ? group.getGroup_name() : group.getShow_aspect_name()))
|
|
|
- .setBold().setMarginLeft(-8)
|
|
|
- .setMarginTop(2).setMarginBottom(0).setFontSize(12f).setBorder(Border.NO_BORDER)
|
|
|
- .setTextAlignment(TextAlignment.LEFT).setMarginLeft(30)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE)).setBorder(Border.NO_BORDER);
|
|
|
- stdTable.addCell(new Cell(1, 1).add(std.get("aspect_ticket_num").toString()).setBold()
|
|
|
- .setMarginTop(-1).setMarginBottom(0).setMarginLeft(10).setFontSize(16f)
|
|
|
- .setBorder(Border.NO_BORDER).setTextAlignment(TextAlignment.RIGHT)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE)).setBorder(Border.NO_BORDER);
|
|
|
- stdTable.addCell(new Cell(1, 1).add(std.get("std_name").toString()).setFontSize(16f).setBold()
|
|
|
- .setMarginLeft(2).setMarginTop(-1).setMarginBottom(0).setBorder(Border.NO_BORDER)
|
|
|
- .setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE))
|
|
|
- .setBorder(Border.NO_BORDER);
|
|
|
-
|
|
|
- FrameThreadHelper.updateThread(thread, roomIndex * 100 / roomArray.size() - 3, "材料生成中......",
|
|
|
- FrameThreadStatus.Running);
|
|
|
-
|
|
|
- mainTable.addCell(new Cell(1, 1).add(stdTable).setMarginLeft(2).setBorder(Border.NO_BORDER));
|
|
|
- if (stdIndex > 0) {
|
|
|
- // 判断分页
|
|
|
- if ((stdIndex + 1) % pageStdCount == 0) {
|
|
|
- doc.add(mainTable);
|
|
|
- // 判断本考场是否还有考生
|
|
|
- if (stdIndex != array.size() - 1) {
|
|
|
- doc.add(new AreaBreak());
|
|
|
- hasStd = true;
|
|
|
- } else {
|
|
|
- // 没考生了
|
|
|
- hasStd = false;
|
|
|
- }
|
|
|
- mainTable = new Table(new float[] { 1, 1, 1 }).setWidthPercent(100).setBorder(null);
|
|
|
- } else {
|
|
|
- // 判断是不是最后一个考生
|
|
|
- if (stdIndex == array.size() - 1) {
|
|
|
- doc.add(mainTable);
|
|
|
- hasStd = false;
|
|
|
- mainTable = new Table(new float[] { 1, 1, 1 }).setWidthPercent(100).setBorder(null);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (hasStd) {
|
|
|
- doc.add(mainTable);
|
|
|
- }
|
|
|
- if (!hasStd && roomIndex == roomStdMap.keySet().size() - 1) {
|
|
|
- doc.add(mainTable);
|
|
|
- }
|
|
|
- if (roomIndex < roomStdMap.keySet().size() - 1)
|
|
|
- doc.add(new AreaBreak());
|
|
|
- roomIndex++;
|
|
|
- }
|
|
|
-
|
|
|
- ItextPdfHelper.closePdf(doc);
|
|
|
- FrameThreadHelper.completeThread(thread, "考务材料已生成!");
|
|
|
- return tempFile;
|
|
|
- } catch (Exception e) {
|
|
|
- LogHelper.error(e);
|
|
|
- FrameThreadHelper.completeThread(thread, "材料生成出现内部错误,请检查字体大小设置是否正确", FrameThreadStatus.Error);
|
|
|
- throw new BusinessException("无法生成pdf文件,请联系系统管理员");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /********************
|
|
|
- * 签字单
|
|
|
- */
|
|
|
- // @Override
|
|
|
- public File makeWriteSign2(FrameThread thread, File tempFile, LyGroup group, List<LySubject> subjectArray, Integer subject_id) {
|
|
|
- Document doc = null;
|
|
|
- try {
|
|
|
- tempFile.getParentFile().mkdirs();
|
|
|
- doc = pageModel.prepareDocument(tempFile);
|
|
|
- doc.setMargins(30, 20, 20, 20);
|
|
|
- doc.setFont(getSchoolFont());
|
|
|
- List<LyRoomWritten> roomArray = this.daoRoom.listRoom(group.getLy_group_id());
|
|
|
- Map<LyRoomWritten, List<Map<String, Object>>> roomStdMap = new LinkedHashMap<LyRoomWritten, List<Map<String, Object>>>();
|
|
|
-
|
|
|
- FrameThreadHelper.updateThread(thread, 1, "一共有【" + roomArray.size() + "】个笔试考场", FrameThreadStatus.Running);
|
|
|
- for (LyRoomWritten room : roomArray) {
|
|
|
- List<Map<String, Object>> sArray = this.daoRoom.listRoomStd(group.getLy_group_id(), room);
|
|
|
- if (sArray.size() == 0)
|
|
|
- continue;
|
|
|
- roomStdMap.put(room, sArray);
|
|
|
- }
|
|
|
-
|
|
|
- int pageStdCount = 15;
|
|
|
- LyAgent agent = this.daoGroup.find(LyAgent.class, group.getLy_agent_id());
|
|
|
-
|
|
|
- // 计算每个考生的margin
|
|
|
- // 每行考生数
|
|
|
- float[] mainCols = new float[5];
|
|
|
- for (int i = 0; i < mainCols.length; i++)
|
|
|
- mainCols[i] = 100 / mainCols.length;
|
|
|
-
|
|
|
- int roomIndex = 0;
|
|
|
- for (LyRoomWritten room : roomStdMap.keySet()) {
|
|
|
- List<Map<String, Object>> array = roomStdMap.get(room);
|
|
|
- Table mainTable = new Table(mainCols).setMarginTop(10);
|
|
|
- // 宽度 及无边框设置
|
|
|
- mainTable.setWidthPercent(100).setBorder(null).setMarginTop(-10);
|
|
|
- this.createSignNewPage(doc, group, subjectArray, room);
|
|
|
- boolean hasStd = false;
|
|
|
- for (int stdIndex = 0; stdIndex < array.size(); stdIndex++) {
|
|
|
- Map<String, Object> std = array.get(stdIndex);
|
|
|
- Table stdTable = new Table(new float[] { 2.2f, 3 }).setWidthPercent(100).setBorder(null);
|
|
|
- // 图片
|
|
|
- Image imgStdUpload = ArtFileHelper.generateStdImage(
|
|
|
- std.containsKey("std_image") ? std.get("std_image").toString() : "cert.jpg");
|
|
|
-
|
|
|
- int row_margin = -2;
|
|
|
-
|
|
|
- stdTable.addCell(new Cell(1, 2).setBorder(null).add(imgStdUpload.scaleAbsolute(72, 90))
|
|
|
- .setMarginTop(0).setHorizontalAlignment(HorizontalAlignment.CENTER)
|
|
|
- .setTextAlignment(TextAlignment.CENTER).setVerticalAlignment(VerticalAlignment.MIDDLE)
|
|
|
- .setMarginLeft(15));
|
|
|
-
|
|
|
- // 身份证证号
|
|
|
- stdTable.addCell(new Cell(1, 2).add(std.get("cert_id").toString()).setMarginTop(0).setFontSize(9)
|
|
|
- .setBorder(null)).setTextAlignment(TextAlignment.CENTER).setBold()
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE);
|
|
|
- // 准考证号
|
|
|
- stdTable.addCell(new Cell(1, 1).add(" 准考证:").setBorder(null).setMarginTop(row_margin)
|
|
|
- .setHorizontalAlignment(HorizontalAlignment.RIGHT)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(8).setMarginLeft(6));
|
|
|
- stdTable.addCell(new Cell(1, 1).add(std.get("aspect_ticket_num").toString()).setBorder(null)
|
|
|
- .setMarginTop(row_margin).setHorizontalAlignment(HorizontalAlignment.LEFT).setMarginLeft(-2)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(10)
|
|
|
- .setTextAlignment(TextAlignment.LEFT).setBold());
|
|
|
- // 姓名
|
|
|
- stdTable.addCell(new Cell(1, 1).add(" 姓 名:").setBorder(null).setMarginTop(row_margin)
|
|
|
- .setHorizontalAlignment(HorizontalAlignment.RIGHT)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(8).setMarginLeft(6));
|
|
|
- stdTable.addCell(new Cell(1, 1).add(std.get("std_name").toString()).setBorder(null)
|
|
|
- .setMarginTop(row_margin).setHorizontalAlignment(HorizontalAlignment.LEFT).setMarginLeft(-2)
|
|
|
- .setBold().setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(10)
|
|
|
- .setTextAlignment(TextAlignment.LEFT));
|
|
|
-
|
|
|
- // 性别
|
|
|
- stdTable.addCell(new Cell(1, 1).add(" 性 别:").setBorder(null).setMarginTop(row_margin)
|
|
|
- .setHorizontalAlignment(HorizontalAlignment.RIGHT)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(8).setMarginLeft(6));
|
|
|
- stdTable.addCell(new Cell(1, 1).add(std.get("std_sex").toString()).setBorder(null)
|
|
|
- .setMarginTop(row_margin).setHorizontalAlignment(HorizontalAlignment.LEFT).setMarginLeft(-2)
|
|
|
- .setBold().setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(10)
|
|
|
- .setTextAlignment(TextAlignment.LEFT));
|
|
|
- // if (stdIndex % 5 == 0) {
|
|
|
- // // 第一行
|
|
|
- // for (LySubject sb : subjectArray) {
|
|
|
- // int fontsize = 11;
|
|
|
- // if (sb.getSubject_name().length() > 5)
|
|
|
- // fontsize = 6;
|
|
|
- // else if (sb.getSubject_name().length() > 4)
|
|
|
- // fontsize = 8;
|
|
|
- // else if (sb.getSubject_name().length() > 3)
|
|
|
- // fontsize = 9;
|
|
|
- // stdTable.addCell(new Cell(1,
|
|
|
- // 1).add(sb.getSubject_name()).setBorder(null).setMarginTop(5)
|
|
|
- // .setHorizontalAlignment(HorizontalAlignment.CENTER)
|
|
|
- // .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(fontsize));
|
|
|
- // stdTable.addCell(new Cell(1,
|
|
|
- // 1).add("_________").setBorder(null).setMarginTop(5)
|
|
|
- // .setHorizontalAlignment(HorizontalAlignment.CENTER)
|
|
|
- // .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11));
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // for (LySubject sb : subjectArray) {
|
|
|
- stdTable.addCell(new Cell(1, 2).add("签字:________________").setBorder(null).setMarginTop(8)
|
|
|
- .setHorizontalAlignment(HorizontalAlignment.CENTER)
|
|
|
- .setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(8));
|
|
|
- // }
|
|
|
- // }
|
|
|
- mainTable.addCell(new Cell().add(stdTable).setMarginTop(13).setBorder(null));
|
|
|
-
|
|
|
- FrameThreadHelper.updateThread(thread, roomIndex * 100 / roomArray.size() - 3, "材料生成中......",
|
|
|
- FrameThreadStatus.Running);
|
|
|
- if (stdIndex > 0) {
|
|
|
- // 判断分页
|
|
|
- if ((stdIndex + 1) % pageStdCount == 0) {
|
|
|
- doc.add(mainTable.setMarginTop(10));
|
|
|
- doc.add(new Paragraph("监考员签字:______________________").setFontSize(12).setBold()
|
|
|
- .setTextAlignment(TextAlignment.RIGHT).setFixedPosition(260, 30, 300));
|
|
|
- // 判断本考场是否还有考生
|
|
|
- if (stdIndex != array.size() - 1) {
|
|
|
- doc.add(new AreaBreak());
|
|
|
- this.createSignNewPage(doc, group, subjectArray, room);
|
|
|
- hasStd = true;
|
|
|
- } else {
|
|
|
- // 没考生了
|
|
|
- hasStd = false;
|
|
|
- }
|
|
|
- mainTable = new Table(mainCols);
|
|
|
- // 宽度 及无边框设置
|
|
|
- mainTable.setWidthPercent(100).setBorder(null);
|
|
|
- } else {
|
|
|
- if (stdIndex == array.size() - 1) {
|
|
|
- doc.add(new Paragraph("监考员签字:______________________").setFontSize(12).setBold()
|
|
|
- .setTextAlignment(TextAlignment.RIGHT).setFixedPosition(260, 30, 300));
|
|
|
- doc.add(mainTable);
|
|
|
- hasStd = false;
|
|
|
- mainTable = new Table(new float[] { 1, 1, 1 }).setWidthPercent(100).setBorder(null);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if (hasStd) {
|
|
|
- doc.add(mainTable.setMarginTop(10));
|
|
|
- // doc.add(new Paragraph("监考教室核对完毕后签名:___________________").setFontSize(12).setBold()
|
|
|
- // .setTextAlignment(TextAlignment.RIGHT).setFixedPosition(260, 10, 300));
|
|
|
- }
|
|
|
- if (!hasStd && roomIndex == roomStdMap.keySet().size() - 1) {
|
|
|
- doc.add(mainTable.setMarginTop(10));
|
|
|
- // doc.add(new Paragraph("监考教室核对完毕后签名:___________________").setFontSize(12).setBold()
|
|
|
- // .setTextAlignment(TextAlignment.RIGHT).setFixedPosition(260, 10, 300));
|
|
|
- }
|
|
|
- if (roomIndex < roomStdMap.keySet().size() - 1)
|
|
|
- doc.add(new AreaBreak());
|
|
|
- roomIndex++;
|
|
|
- }
|
|
|
-
|
|
|
- ItextPdfHelper.closePdf(doc);
|
|
|
- Thread.sleep(3000);
|
|
|
- FrameThreadHelper.completeThread(thread, "考务材料已生成!");
|
|
|
- return tempFile;
|
|
|
- } catch (Exception e) {
|
|
|
- ItextPdfHelper.closePdf(doc);
|
|
|
- FrameThreadHelper.completeThread(thread, "材料生成出现内部错误,请检查字体大小设置是否正确", FrameThreadStatus.Error);
|
|
|
- LogHelper.error(e);
|
|
|
- throw new BusinessException("无法生成pdf文件,请联系系统管理员");
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
public File makeWriteSign(FrameThread thread, File tempFile, LyGroup group, List<LySubject> subjectArray, Integer subject_id) {
|
|
|
Document doc = null;
|
|
@@ -1356,53 +1090,6 @@ public class WrittenMaterial10047FZ extends WrittenMaterialDefault {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- private void createSignNewPage2(Document doc, LyAgent agent, LyGroup group, List<LySubject> subjectArray,
|
|
|
- LyRoomWritten room) {
|
|
|
- // 中央美术学院2020年本科招生专业考试信息核对单
|
|
|
- Paragraph p1 = new Paragraph("中央美术学院" + ArtParamHelper.ArtYear + "年附中优秀人才选拔考试考生信息核对单").setFontSize(16).setBold()
|
|
|
- .setTextAlignment(TextAlignment.CENTER);
|
|
|
- doc.add(p1);
|
|
|
- Table table = new Table(new float[] { 1f, 2f, 1.5f, 1.5f, 1.5f, 1.5f }).setWidthPercent(100).setMarginLeft(15);
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("考点名称:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("中央美术学院燕郊校区").setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11)
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("笔试地点:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add(room.getRoom_addr()).setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11)
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("考场号码:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add(room.getRoom_name()).setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11)
|
|
|
- .setBorder(null));
|
|
|
-
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("考试日期:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(new Cell(1, 1).add("2024年1月3日").setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11)
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("考试时间:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- ;
|
|
|
- table.addCell(new Cell(1, 1).add(LocalDateHelper.formatHourMinute(subjectArray.get(0).getExam_start_time()) + "-" + LocalDateHelper.formatHourMinute(
|
|
|
- subjectArray.get(0).getExam_end_time()))
|
|
|
- .setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add("考试科目:").setTextAlignment(TextAlignment.RIGHT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11).setBold()
|
|
|
- .setBorder(null));
|
|
|
- table.addCell(
|
|
|
- new Cell(1, 1).add(group.getGroup_name()).setTextAlignment(TextAlignment.LEFT).setVerticalAlignment(VerticalAlignment.MIDDLE).setFontSize(11)
|
|
|
- .setBorder(null));
|
|
|
- doc.add(table);
|
|
|
- }
|
|
|
-
|
|
|
private static PdfFont getSchoolFont() {
|
|
|
try {
|
|
|
return PdfFontFactory.createFont(
|