|
|
@@ -423,15 +423,15 @@ public class PdfUtil {
|
|
|
dealImageCell((List<String>) data.get("approveSign"), table, 1, 80, 30, 2, 1);
|
|
|
createPDFCell(tableFont, table, "登记人签字", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
dealImageCell((List<String>) data.get("submitSign"), table, 1, 80, 30, 2, 1);
|
|
|
- //第8行
|
|
|
- createPDFCell(tableFont, table, "备注", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_MIDDLE, 5, 1);
|
|
|
+// //第8行
|
|
|
+// createPDFCell(tableFont, table, "备注", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
+// createPDFCell(tableFont, table, data.get("remark").toString(), Element.ALIGN_MIDDLE, 5, 1);
|
|
|
|
|
|
|
|
|
//证件图片
|
|
|
createPDFCell(tableFont, table, "证件图片", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
//证件图片 图片填充
|
|
|
- final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 190, 130, 2);
|
|
|
+ final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 190, 130, 2,0f);
|
|
|
final PdfPCell cell1 = new PdfPCell();
|
|
|
cell1.setNoWrap(false);
|
|
|
cell1.setPaddingLeft(4f);
|
|
|
@@ -444,32 +444,13 @@ public class PdfUtil {
|
|
|
cell1.addElement(imageTable1);
|
|
|
table.addCell(cell1);
|
|
|
|
|
|
- // 核查结果图片为非必填,没有图片时不显示
|
|
|
- List<String> checkImages= (List<String>) data.get("checkImage");
|
|
|
- if(!checkImages.isEmpty())
|
|
|
- {
|
|
|
- createPDFCell(tableFont, table, "核查结果", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 190, 190, 2);
|
|
|
- final PdfPCell cell3 = new PdfPCell();
|
|
|
- cell3.setNoWrap(false);
|
|
|
- cell3.setPaddingLeft(4f);
|
|
|
- cell3.setPaddingRight(4f);
|
|
|
- cell3.setPaddingBottom(4f);
|
|
|
- cell3.setPaddingTop(4f);
|
|
|
- cell3.setColspan(5);
|
|
|
- cell3.setRowspan(1);
|
|
|
- //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
- cell3.addElement(imageTable3);
|
|
|
- table.addCell(cell3);
|
|
|
- document.add(table);
|
|
|
- }
|
|
|
|
|
|
|
|
|
List<String> files= (List<String>) data.get("file");
|
|
|
List<String> files1=new ArrayList<>();
|
|
|
List<String> files2= new ArrayList<>();
|
|
|
// 没有 核查结果 图片 时 需要把 介绍信图片上移
|
|
|
- if(ObjectUtil.isNotEmpty(files) && ObjectUtil.isEmpty(checkImages))
|
|
|
+ if(ObjectUtil.isNotEmpty(files))
|
|
|
{
|
|
|
files1= files.subList(0,1);
|
|
|
if(files.size()>1)
|
|
|
@@ -480,11 +461,11 @@ public class PdfUtil {
|
|
|
else{
|
|
|
files2=files;
|
|
|
}
|
|
|
- // 没有 核查结果 图片 时 需要把 介绍信图片上移
|
|
|
+
|
|
|
if(ObjectUtil.isNotEmpty(files1))
|
|
|
{
|
|
|
createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- final PdfPTable imageTable3 = getImage(files1, 1, 380, 320, 1);
|
|
|
+ final PdfPTable imageTable3 = getImage(files1, 1, 380, 320, 1,0f);
|
|
|
final PdfPCell cell3 = new PdfPCell();
|
|
|
cell3.setNoWrap(false);
|
|
|
cell3.setPaddingLeft(4f);
|
|
|
@@ -505,7 +486,7 @@ public class PdfUtil {
|
|
|
createPDFCell(tableFont, innerTable, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
|
|
|
// createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
|
|
|
- final PdfPTable imageTable2 = getImage(files2, 2, 380, 320, 1);
|
|
|
+ final PdfPTable imageTable2 = getImage(files2, 2, 380, 340, 1,8f);
|
|
|
final PdfPCell cell2 = new PdfPCell();
|
|
|
cell2.setNoWrap(false);
|
|
|
cell2.setPaddingLeft(4f);
|
|
|
@@ -519,6 +500,29 @@ public class PdfUtil {
|
|
|
document.newPage();
|
|
|
document.add(innerTable);
|
|
|
}
|
|
|
+
|
|
|
+ List<String> checkImages= (List<String>) data.get("checkImage");
|
|
|
+
|
|
|
+ PdfPTable innerTable2 = new PdfPTable(6);
|
|
|
+ createPDFCell(tableFont, innerTable2, "备注", Element.ALIGN_MIDDLE, 1, checkImages.isEmpty()?1:2);
|
|
|
+ createPDFCell(tableFont, innerTable2, data.get("remark").toString(), Element.ALIGN_LEFT, 5, 1);
|
|
|
+ // 核查结果图片为非必填,没有图片时不显示
|
|
|
+ if(!checkImages.isEmpty())
|
|
|
+ {
|
|
|
+ final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 190, 190, 2,0f);
|
|
|
+ final PdfPCell cell3 = new PdfPCell();
|
|
|
+ cell3.setNoWrap(false);
|
|
|
+ cell3.setPaddingLeft(4f);
|
|
|
+ cell3.setPaddingRight(4f);
|
|
|
+ cell3.setPaddingBottom(4f);
|
|
|
+ cell3.setPaddingTop(4f);
|
|
|
+ cell3.setColspan(5);
|
|
|
+ cell3.setRowspan(1);
|
|
|
+ //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
|
|
|
+ cell3.addElement(imageTable3);
|
|
|
+ innerTable2.addCell(cell3);
|
|
|
+ }
|
|
|
+ document.add(innerTable2);
|
|
|
}
|
|
|
|
|
|
public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
|
|
|
@@ -638,7 +642,7 @@ public class PdfUtil {
|
|
|
table.addCell(outCell);
|
|
|
}
|
|
|
|
|
|
- private static PdfPTable getImage(List<String> images, int totalImages, float imageWidth, float imageHeight, Integer ImageNumsOfRow) throws Exception {
|
|
|
+ private static PdfPTable getImage(List<String> images, int totalImages, float imageWidth, float imageHeight, Integer ImageNumsOfRow,Float paddingBottom) throws Exception {
|
|
|
if (images == null) {
|
|
|
images = new ArrayList<>();
|
|
|
}
|
|
|
@@ -671,6 +675,7 @@ public class PdfUtil {
|
|
|
cell.setBorder(Rectangle.NO_BORDER);
|
|
|
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
|
|
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
|
|
+ cell.setPaddingBottom(paddingBottom);
|
|
|
innerTable.addCell(cell);
|
|
|
}
|
|
|
}
|