|
|
@@ -241,61 +241,17 @@ public class PdfUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // ------------------------------------------------------------------------------------------------------------
|
|
|
//日常登记簿-布撤防数据
|
|
|
- resumptionProtectionData(document, table, tableFont, data);
|
|
|
-
|
|
|
- // ------------------------------------------------------------------------------------------------------------
|
|
|
-
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 10, 1);
|
|
|
-
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
-
|
|
|
- final List<LinkedHashMap> questionPdfVoList = (List<LinkedHashMap>) data.get("questions");
|
|
|
- if (ObjectUtil.isEmpty(questionPdfVoList)) {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- document.add(table);
|
|
|
- return;
|
|
|
- }
|
|
|
- int questionIndex = 1;
|
|
|
- for (int i = 0; i < questionPdfVoList.size(); i++) {
|
|
|
-
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionIndex++), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("checkContent")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("questionDesc")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- }
|
|
|
-
|
|
|
- // 备注数据
|
|
|
-// PdfUtil.createPDFCell(tableFont, table, getLineStr("备注"), PdfPCell.ALIGN_MIDDLE, 0, 0);
|
|
|
-// PdfUtil.createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_LEFT, 7, 0);
|
|
|
-
|
|
|
- document.add(table);
|
|
|
-
|
|
|
-// Paragraph foot = new Paragraph(" 注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", tableFont);
|
|
|
-// Paragraph foot = new Paragraph(" 注:检查情况正常打“√”;发现问题打“×”,并在备注中具体说明。", new Font(fs, 8, Font.NORMAL));
|
|
|
-// foot.setAlignment(Paragraph.ALIGN_LEFT);
|
|
|
- //在后方加入16个空格
|
|
|
-// document.add(foot);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private static void resumptionProtectionData(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws DocumentException {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "布撤防情况", Element.ALIGN_MIDDLE, 10, 1);
|
|
|
+
|
|
|
PdfUtil.createPDFCell(tableFont, table, "控制器", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
-
|
|
|
List<Map<String, List<Map<String, Object>>>> protectionList = (List<Map<String, List<Map<String, Object>>>>) data.get("protection");
|
|
|
if (ObjectUtil.isEmpty(protectionList)) {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- document.add(table);
|
|
|
} else {
|
|
|
for (Map<String, List<Map<String, Object>>> listMap : protectionList) {
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> listEntry : listMap.entrySet()) {
|
|
|
@@ -323,8 +279,31 @@ public class PdfUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 10, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+
|
|
|
+ final List<LinkedHashMap> questionPdfVoList = (List<LinkedHashMap>) data.get("questions");
|
|
|
+ if (ObjectUtil.isEmpty(questionPdfVoList)) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ document.add(table);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ int questionIndex = 1;
|
|
|
+ for (int i = 0; i < questionPdfVoList.size(); i++) {
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionIndex++), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("checkContent")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(questionPdfVoList.get(i).get("questionDesc")), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ }
|
|
|
+ document.add(table);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private static String getStatusTime(Map<String, Object> value) {
|
|
|
if (value == null) {
|
|
|
return StringUtil.EMPTY_STRING;
|
|
|
@@ -348,6 +327,7 @@ public class PdfUtil {
|
|
|
}
|
|
|
return StringUtil.EMPTY_STRING;
|
|
|
}
|
|
|
+
|
|
|
public static String getLineStr(String str) {
|
|
|
StringBuilder result = new StringBuilder();
|
|
|
for (int i = 0; i < str.length(); i++) {
|