Browse Source

一二线放行pdf打印调整改成自适应行高

wenjinbiao 8 months ago
parent
commit
ee824a07e6

+ 2 - 2
snowy-common/src/main/java/vip/xiaonuo/common/util/CommonPdfUtil.java

@@ -43,7 +43,7 @@ public class CommonPdfUtil {
         rectangle.setBackgroundColor(BaseColor.WHITE);
         document.setPageSize(rectangle);
         // 页边距 左,右,上,下
-        document.setMargins(20, 20, 20, 20);
+        document.setMargins(10, 10, 10, 10);
         return document;
     }
     /**
@@ -67,7 +67,7 @@ public class CommonPdfUtil {
         cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
         //默认文字居中显示
         cell.setHorizontalAlignment(Element.ALIGN_CENTER);
-        cell.setFixedHeight(fixedHeight);
+        cell.setFixedHeight(0);
         cell.setRowspan(rowSpan);
         cell.setColspan(colSpan);
         return cell;

+ 2 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyfrontlinewarehouse/service/impl/QyFrontlineWarehouseServiceImpl.java

@@ -408,8 +408,8 @@ public class QyFrontlineWarehouseServiceImpl extends ServiceImpl<QyFrontlineWare
         document.open();
 
         //创建表格
-        PdfPTable pdfPTable = CommonPdfUtil.createPdfPTable(13);
-
+        PdfPTable pdfPTable = CommonPdfUtil.createPdfPTable(14);
+        pdfPTable.setWidthPercentage(100);
         //设置表头
         PdfPCell indexNoHead = CommonPdfUtil.createCenterPdfPCell("序号", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell companyCodeHead = CommonPdfUtil.createCenterPdfPCell("企业编号", 1, 1, CommonPdfUtil.NORMALFONT);

+ 2 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qysecondlinewarehouse/service/impl/QySecondlineWarehouseServiceImpl.java

@@ -390,6 +390,7 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
 
         //设置表头
         PdfPCell indexNoHead = CommonPdfUtil.createCenterPdfPCell("序号", 1, 1, CommonPdfUtil.NORMALFONT);
+
         PdfPCell companyCodeHead = CommonPdfUtil.createCenterPdfPCell("企业编号", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell companyNameHead = CommonPdfUtil.createCenterPdfPCell("企业名称", 1, 1, CommonPdfUtil.NORMALFONT);
         PdfPCell accountTypeHead = CommonPdfUtil.createCenterPdfPCell("账册类型", 1, 1, CommonPdfUtil.NORMALFONT);
@@ -415,9 +416,8 @@ public class QySecondlineWarehouseServiceImpl extends ServiceImpl<QySecondlineWa
         pdfPTable.addCell(accountNumberHead);
         pdfPTable.addCell(unitHead);
         pdfPTable.addCell(frontlineRelesasNumberHead);
-        pdfPTable.addCell(warehouseTimeHead);
         pdfPTable.addCell(warehouseNumberHead);
-
+        pdfPTable.addCell(warehouseTimeHead);
         pdfPTable.addCell(accountTimeHead);
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         for (int i = 1; i <= records.size(); i++) {