|
|
@@ -221,6 +221,10 @@ public class PdfUtil {
|
|
|
for (String s : names) {
|
|
|
List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
|
|
|
if (ObjectUtil.isEmpty(lists)) {
|
|
|
+ //不同的执行时刻
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, s, PdfPCell.ALIGN_MIDDLE, 2,1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table,"/", PdfPCell.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "/", PdfPCell.ALIGN_MIDDLE, 2,1);
|
|
|
continue;
|
|
|
}
|
|
|
//不同的执行时刻
|
|
|
@@ -239,22 +243,15 @@ 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, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "控制器名称", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "详情", Element.ALIGN_MIDDLE, 8, 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, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- document.add(table);
|
|
|
- } else {
|
|
|
+ if (ObjectUtil.isNotEmpty(protectionList)) {
|
|
|
for (int i = 0; i < protectionList.size(); i++) {
|
|
|
Map<String, List<Map<String, Object>>> listMap = protectionList.get(i);
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> listEntry : listMap.entrySet()) {
|
|
|
@@ -262,42 +259,37 @@ public class PdfUtil {
|
|
|
List<Map<String, Object>> value = listEntry.getValue();
|
|
|
//布防状态,0:撤防,1:布防
|
|
|
if (value.isEmpty()) {
|
|
|
- // 序号
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(i + 1), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
//子系统名称
|
|
|
- PdfUtil.createPDFCell(tableFont, table, subsystem.getName(), Element.ALIGN_MIDDLE, 3, 1);
|
|
|
- //状态
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, subsystem.getName(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table,"撤防时间" , Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table,"布防时间" , Element.ALIGN_MIDDLE, 2, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- // 时间
|
|
|
- PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 3, 1);
|
|
|
} else {
|
|
|
- // 序号
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(i + 1), Element.ALIGN_MIDDLE, 2, 2);
|
|
|
- //子系统名称
|
|
|
- PdfUtil.createPDFCell(tableFont, table, subsystem.getName(), Element.ALIGN_MIDDLE, 3, 2);
|
|
|
- //状态
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "撤防", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ // 子系统名称
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, subsystem.getName(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
Optional<Map<String, Object>> statusOptional1 = value.stream().filter(r -> {
|
|
|
Integer status = (Integer) r.get("status");
|
|
|
return ObjectUtil.equal(0,status);
|
|
|
}).findFirst();
|
|
|
String cfStatus = statusOptional1.isPresent() ? String.valueOf(statusOptional1.get().get("date")) : StringUtil.EMPTY_STRING;
|
|
|
// 撤防时间
|
|
|
- PdfUtil.createPDFCell(tableFont, table, cfStatus, Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "撤防时间", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, cfStatus, Element.ALIGN_MIDDLE, 2, 1);
|
|
|
|
|
|
-
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "布防", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
Optional<Map<String, Object>> statusOptional = value.stream().filter(r -> {
|
|
|
Integer status = (Integer) r.get("status");
|
|
|
return ObjectUtil.equal(1,status);
|
|
|
}).findFirst();
|
|
|
String bfStatus = statusOptional.isPresent() ? String.valueOf(statusOptional.get().get("date")) : StringUtil.EMPTY_STRING;
|
|
|
// 布防时间
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "布防时间", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, bfStatus, Element.ALIGN_MIDDLE, 3, 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|