|
@@ -228,7 +228,7 @@ public class PDFUtil {
|
|
|
|
|
|
|
|
|
|
|
|
- public static void generateEPDF(Document document,EReceivingNote receivingNote) throws Exception {
|
|
|
+ public static int generateEPDF(Document document,EReceivingNote receivingNote) throws Exception {
|
|
|
// 段落
|
|
|
Paragraph paragraph = new Paragraph("立 邦 随 身 邦 收 货 单", titlefont);
|
|
|
paragraph.setAlignment(1); //设置文字居中 0靠左 1,居中 2,靠右
|
|
@@ -286,6 +286,7 @@ public class PDFUtil {
|
|
|
image.setAlignment(Image.ALIGN_CENTER);
|
|
|
image.scalePercent(40); //依照比例缩放
|
|
|
//document.add(image);
|
|
|
+ int size = 0;
|
|
|
// 表格
|
|
|
PdfPTable table = createTable(new float[] { 100, 80, 80,80});
|
|
|
table.addCell(createCell("物品明细", headfont, Element.ALIGN_CENTER, 8, false));
|
|
@@ -296,21 +297,25 @@ public class PDFUtil {
|
|
|
// table.addCell(createCell("未交货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
// table.addCell(createCell("发货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
// table.addCell(createCell("已收货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
- for (ConfirmCollectLineDetailModel line:receivingNote.getDeliveryLineDetail()) {
|
|
|
- table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
- table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
- table.addCell(createCell(line.getConfirmQuantity().toString(), textfont));
|
|
|
- table.addCell(createCell(line.getDeliveryCount().toString(), textfont));
|
|
|
- }
|
|
|
- for(ConfirmCollectOtherDeliveryModel otherLine:receivingNote.getOtherDeliveryModels()){
|
|
|
- table.addCell(createCell("同运单交货单:"+otherLine.getDeliveryNumber()+" 重量:"+otherLine.getWeight(), keyfont, Element.ALIGN_CENTER,4));
|
|
|
- for (ConfirmCollectLineDetailModel line:otherLine.getDeliveryLineDetail()) {
|
|
|
+
|
|
|
+ for (ConfirmCollectLineDetailModel line : receivingNote.getDeliveryLineDetail()) {
|
|
|
table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
- table.addCell(createCell(line.getConfirmQuantity().toString(), textfont));
|
|
|
- table.addCell(createCell(line.getDeliveryCount().toString(), textfont));
|
|
|
+ table.addCell(createCell(line.getConfirmQuantity(), textfont));
|
|
|
+ table.addCell(createCell(line.getDeliveryCount(), textfont));
|
|
|
+ size += line.getMaterialName().length() / 12 + 1;
|
|
|
+
|
|
|
+ }
|
|
|
+ for (ConfirmCollectOtherDeliveryModel otherLine : receivingNote.getOtherDeliveryModels()) {
|
|
|
+ table.addCell(createCell("同运单交货单:" + otherLine.getDeliveryNumber() + " 重量:" + otherLine.getWeight(), keyfont, Element.ALIGN_CENTER, 4));
|
|
|
+ for (ConfirmCollectLineDetailModel line : otherLine.getDeliveryLineDetail()) {
|
|
|
+ table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
+ table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
+ table.addCell(createCell(line.getConfirmQuantity(), textfont));
|
|
|
+ table.addCell(createCell(line.getDeliveryCount(), textfont));
|
|
|
+ size += line.getMaterialName().length() / 12 + 1;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
document.add(table);
|
|
|
|
|
@@ -324,7 +329,7 @@ public class PDFUtil {
|
|
|
paragraph.setSpacingAfter(10f); //设置段落下空白
|
|
|
document.add(paragraph);
|
|
|
|
|
|
-
|
|
|
+ return size;
|
|
|
}
|
|
|
|
|
|
// 生成PDF文件
|