|
|
@@ -9,6 +9,7 @@ import com.lowagie.text.pdf.*;
|
|
|
import com.xunmei.file.vo.ItextPdfTableVo;
|
|
|
import com.xunmei.system.api.domain.AccessDataVo;
|
|
|
import com.xunmei.system.api.domain.CheckDataVo;
|
|
|
+import com.xunmei.system.api.domain.SafeCheckTaskRegisterBookVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -523,26 +524,41 @@ public class PdfUtil {
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 16, 0, 10);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 9, 0, 10);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 9, 0, 10);
|
|
|
- // PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getSituation().equals("0") ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0, 10);
|
|
|
+ // PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getSituation().equals("0") ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0, 10);
|
|
|
PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 9, 0, 10);
|
|
|
}
|
|
|
document.add(table);
|
|
|
}
|
|
|
|
|
|
- public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, Font tableTitleFont, List<CheckDataVo> data) throws DocumentException {
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "检查内容", Element.ALIGN_MIDDLE, 5, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "主要指标描述情况", Element.ALIGN_MIDDLE, 17, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "检查情况", Element.ALIGN_MIDDLE, 5, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "存在的问题及整改意见", Element.ALIGN_MIDDLE, 15, 0);
|
|
|
- PdfUtil.createPDFCell(tableTitleFont, table, "整改期限", Element.ALIGN_MIDDLE, 2, 0);
|
|
|
- for (int i = 1; i <= data.size(); i++) {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 2, 0, 10);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getItemName(), Element.ALIGN_MIDDLE, 5, 0, 10);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getPointName(), Element.ALIGN_MIDDLE, 17, 0, 10);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, StringUtils.isEmpty(data.get(i - 1).getResRemark()) ? "√" : "×", Element.ALIGN_MIDDLE, 5, 0, 10);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, StringUtils.isEmpty(data.get(i - 1).getResRemark()) ? "" : data.get(i - 1).getResRemark(), Element.ALIGN_MIDDLE, 15, 0, 10);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getRectificationDeadline(), Element.ALIGN_MIDDLE, 2, 0, 10);
|
|
|
+ public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "被查日期", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getDateStr(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查类型", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查名称", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getTaskTitle(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_CENTER, 5, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_CENTER, 6, 1);
|
|
|
+
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_CENTER, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_CENTER, 2, 1);
|
|
|
+ for (int i = 1; i <= data.getCheckDatas().size(); i++) {
|
|
|
+ final CheckDataVo checkDataVo = data.getCheckDatas().get(i - 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 1, 1, 10);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, checkDataVo.getItemName(), Element.ALIGN_MIDDLE, 2, 1, 10);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, checkDataVo.getResRemark(), Element.ALIGN_MIDDLE, 2, 1, 10);
|
|
|
}
|
|
|
document.add(table);
|
|
|
}
|
|
|
@@ -556,7 +572,7 @@ public class PdfUtil {
|
|
|
// 获取 源文件总页数
|
|
|
int num = reader.getNumberOfPages();
|
|
|
// 新建文档,默认A4大小
|
|
|
- Document document =createDocument(0,0,50,50);
|
|
|
+ Document document = createDocument(0, 0, 50, 50);
|
|
|
PdfWriter writer = PdfWriter.getInstance(document, fos);
|
|
|
writer.setPageEvent(new PdfPageHelperEvent(num, writer, fs, tableFont));
|
|
|
document.open();
|