|
|
@@ -101,6 +101,7 @@ public class PdfUtil {
|
|
|
}
|
|
|
return cell;
|
|
|
}
|
|
|
+
|
|
|
private static PdfPCell cell(Font tableFont, String content, int align, Integer colspan, Integer rowspan, Integer paddingLeft, Integer paddingRight) {
|
|
|
PdfPCell cell = new PdfPCell(new Phrase(content, tableFont));
|
|
|
if (colspan != null && colspan > 0) {
|
|
|
@@ -183,16 +184,20 @@ public class PdfUtil {
|
|
|
|
|
|
public static void dealEduBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
//第一行
|
|
|
- createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
+
|
|
|
+ createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("address").toString(), Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("site").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
//第二行
|
|
|
createPDFCell(tableFont, table, "主持人", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
createPDFCell(tableFont, table, "记录人", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
|
|
|
+ createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("time").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
+
|
|
|
//内容
|
|
|
createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
@@ -216,43 +221,72 @@ public class PdfUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public static void dealResumptionBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
// 第一行
|
|
|
PdfUtil.createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 3, 0);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isNotEmpty(data.get("submiterNames")) ? data.get("dateStr").toString() : "", Element.ALIGN_MIDDLE, 3, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isNotEmpty(data.get("dateStr")) ? data.get("dateStr").toString() : "", Element.ALIGN_MIDDLE, 3, 0);
|
|
|
// 第二行
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get("submiterNames").toString(), Element.ALIGN_MIDDLE, 8, 0);
|
|
|
// 第三行
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "任务时段", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ Object planTypes = data.get("planTypes");
|
|
|
+ if ("1".equals(planTypes)) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "履职工作情况", Element.ALIGN_MIDDLE, 10, 0);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ } else {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "任务时段", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ }
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 6, 0);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
final List<SysDictData> dictCache = DictUtils.getDictCache(DictConstants.RESUMPTION_PLAN_EXEC);
|
|
|
final List<String> names = dictCache.stream().map(SysDictData::getDictLabel).collect(Collectors.toList());
|
|
|
- for (String s : names) {
|
|
|
- List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
|
|
|
- if (ObjectUtil.isEmpty(lists)) {
|
|
|
- //不同的执行时刻
|
|
|
- continue;
|
|
|
- }
|
|
|
- //不同的执行时刻
|
|
|
- PdfUtil.createPDFCell(tableFont, table, getLineStr(s), PdfPCell.ALIGN_MIDDLE, 2, lists.size());
|
|
|
+ if ("1".equals(planTypes)) {
|
|
|
int o = 1;
|
|
|
- for (LinkedHashMap<String, Object> listVo : lists) {
|
|
|
- // 检查内容
|
|
|
- String rowContent = o + "、" + listVo.get("pointName");
|
|
|
- PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
|
|
|
- // 检查情况
|
|
|
- PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue")) ? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
|
|
|
- // 检查人
|
|
|
- //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
- o++;
|
|
|
+ for (String s : names) {
|
|
|
+ List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
|
|
|
+ if (ObjectUtil.isNotEmpty(lists)) {
|
|
|
+ for (LinkedHashMap<String, Object> listVo : lists) {
|
|
|
+ //序号
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(o), PdfPCell.ALIGN_MIDDLE, 2, 0);
|
|
|
+ // 检查内容
|
|
|
+ String rowContent = listVo.get("pointName")+"";
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
|
|
|
+ // 检查情况
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue")) ? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ // 检查人
|
|
|
+ //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
+ o++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } else {
|
|
|
+ for (String s : names) {
|
|
|
+ List<LinkedHashMap<String, Object>> lists = (List<LinkedHashMap<String, Object>>) data.get(s);
|
|
|
+ if (ObjectUtil.isEmpty(lists)) {
|
|
|
+ //不同的执行时刻
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //不同的执行时刻
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, getLineStr(s), PdfPCell.ALIGN_MIDDLE, 2, lists.size());
|
|
|
+ int o = 1;
|
|
|
+ for (LinkedHashMap<String, Object> listVo : lists) {
|
|
|
+ // 检查内容
|
|
|
+ String rowContent = o + "、" + listVo.get("pointName");
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
|
|
|
+ // 检查情况
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue")) ? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
|
|
|
+ // 检查人
|
|
|
+ //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
|
|
|
+ o++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
List<Map<String, List<Map<String, Object>>>> protectionList = (List<Map<String, List<Map<String, Object>>>>) data.get("protection");
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(protectionList)) {
|
|
|
@@ -260,7 +294,7 @@ public class PdfUtil {
|
|
|
//日常登记簿-布撤防数据
|
|
|
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, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
|
|
|
@@ -363,7 +397,7 @@ public class PdfUtil {
|
|
|
createPDFCell(tableFont, table, data.get("accompanyingPerson").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
|
|
|
//第三行
|
|
|
- createPDFCell(tableFont, table, "来访单位", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, "所在单位", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("outOrgName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
createPDFCell(tableFont, table, "来访人员", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("userName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
@@ -689,10 +723,10 @@ public class PdfUtil {
|
|
|
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查开始时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
//PdfUtil.createPDFCell(tableFont, table, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- table.addCell( cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
|
|
|
+ table.addCell(cell(tableFont, data.getStartTimeStr(), Element.ALIGN_MIDDLE, 4, 1, 2, 2));
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查结束时间", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
//PdfUtil.createPDFCell(tableFont, table, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
- table.addCell( cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1,2,2));
|
|
|
+ table.addCell(cell(tableFont, data.getEndTimeStr(), Element.ALIGN_MIDDLE, 4, 1, 2, 2));
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
@@ -707,15 +741,15 @@ public class PdfUtil {
|
|
|
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查工作情况", Element.ALIGN_MIDDLE, 14, 1);
|
|
|
|
|
|
- List<CheckDataVo> normalDataList = data.getCheckDatas().stream().filter(d -> ObjectUtil.equal(Boolean.TRUE, d.getCheckStatus())).collect(Collectors.toList());
|
|
|
+// List<CheckDataVo> normalDataList = data.getCheckDatas().stream().filter(d -> ObjectUtil.equal(Boolean.TRUE, d.getCheckStatus())).collect(Collectors.toList());
|
|
|
PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查内容", Element.ALIGN_MIDDLE, 10, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, "检查情况", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
- if (normalDataList.size() > 0) {
|
|
|
- for (CheckDataVo checkDataVo : normalDataList) {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(normalDataList.indexOf(checkDataVo) + 1), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ if (ObjectUtil.isNotEmpty(data.getCheckDatas()) && data.getCheckDatas().size() > 0) {
|
|
|
+ for (CheckDataVo checkDataVo : data.getCheckDatas()) {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(data.getCheckDatas().indexOf(checkDataVo) + 1), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
PdfUtil.createPDFCell(tableFont, table, checkDataVo.getPointName(), Element.ALIGN_MIDDLE, 10, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "正常", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, ObjectUtil.equal(Boolean.TRUE, checkDataVo.getCheckStatus())?"正常":"异常", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
}
|
|
|
} else {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 2, 1);
|