|
|
@@ -81,14 +81,17 @@ public class PdfUtil {
|
|
|
if (rowspan != null && rowspan > 0) {
|
|
|
cell.setRowspan(rowspan);
|
|
|
}
|
|
|
- cell.setPaddingTop(8f);
|
|
|
+ // cell.setPaddingTop(8f);
|
|
|
cell.setPaddingLeft(8f);
|
|
|
cell.setPaddingRight(8f);
|
|
|
cell.setPaddingBottom(8f);
|
|
|
+ cell.setLeading(1F,1.5F);
|
|
|
if (PdfPCell.ALIGN_MIDDLE != align) {
|
|
|
cell.setHorizontalAlignment(align);
|
|
|
} else {
|
|
|
- cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);//设置单元格的垂直对齐方式
|
|
|
+ //设置单元格的垂直方向对齐方式
|
|
|
+ cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
|
|
|
+ //设置单元格的水平方向对齐方式
|
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
}
|
|
|
return cell;
|
|
|
@@ -102,6 +105,7 @@ public class PdfUtil {
|
|
|
if (rowspan != null && rowspan > 0) {
|
|
|
cell.setRowspan(rowspan);
|
|
|
}
|
|
|
+ cell.setNoWrap(false);
|
|
|
cell.setLeading(lineSpacing, 0);
|
|
|
if (PdfPCell.ALIGN_MIDDLE != align) {
|
|
|
cell.setHorizontalAlignment(align);
|
|
|
@@ -175,11 +179,11 @@ public class PdfUtil {
|
|
|
createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
|
|
|
//内容
|
|
|
- createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
- createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 140);
|
|
|
- createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
- createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_LEFT, 5, 140);
|
|
|
- createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 140);
|
|
|
+ createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
+ createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
+ createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
dealEduImageCell((List<String>) data.get("signImage"), table, 5, 30, 30);
|
|
|
document.add(table);
|
|
|
|
|
|
@@ -335,19 +339,19 @@ public class PdfUtil {
|
|
|
|
|
|
public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
//第一行
|
|
|
- createPDFCell(tableFont, table, "演练单位", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
- createPDFCell(tableFont, table, "地点", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("drillSite").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "演练单位", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, data.get("drillSite").toString(), Element.ALIGN_MIDDLE, 2, 1);
|
|
|
//第二行
|
|
|
- createPDFCell(tableFont, table, "指挥人", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_CENTER, 2, 1);
|
|
|
- createPDFCell(tableFont, table, "记录人", Element.ALIGN_CENTER, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_CENTER, 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_CENTER, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, "演练时间", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("drillTime").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
- createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 1, 1);
|
|
|
+ createPDFCell(tableFont, table, "演练项目", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
//预设案由
|
|
|
createPDFCell(tableFont, table, "预设案由", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
@@ -530,29 +534,29 @@ public class PdfUtil {
|
|
|
}
|
|
|
|
|
|
public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_CENTER, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "被查日期", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getDateStr(), Element.ALIGN_CENTER, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查日期", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getDateStr(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查类型", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_CENTER, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查名称", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getTaskTitle(), Element.ALIGN_CENTER, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查类型", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查名称", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getTaskTitle(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_CENTER, 4, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_CENTER, 4, 1);
|
|
|
+ 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);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_MIDDLE, 4, 1);
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_CENTER, 3, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_CENTER, 11, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 11, 1);
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_CENTER, 14, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 14, 1);
|
|
|
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_CENTER, 2, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_CENTER, 6, 1);
|
|
|
- PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_CENTER, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
+ PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
|
|
|
final Optional<CheckDataVo> optional = data.getCheckDatas().stream().filter(res -> ObjectUtil.isNotEmpty(res.getResRemark())).findAny();
|
|
|
if (!optional.isPresent()) {
|
|
|
PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);
|