|
@@ -1,8 +1,6 @@
|
|
|
package com.dgtly.wxportal.utils.pdf;
|
|
package com.dgtly.wxportal.utils.pdf;
|
|
|
|
|
|
|
|
-import com.dgtly.wxportal.domain.ConfirmCollectLineDetailModel;
|
|
|
|
|
-import com.dgtly.wxportal.domain.ConfirmCollectOtherDeliveryModel;
|
|
|
|
|
-import com.dgtly.wxportal.domain.EReceivingNote;
|
|
|
|
|
|
|
+import com.dgtly.wxportal.domain.*;
|
|
|
import com.itextpdf.text.*;
|
|
import com.itextpdf.text.*;
|
|
|
import com.itextpdf.text.pdf.*;
|
|
import com.itextpdf.text.pdf.*;
|
|
|
import com.itextpdf.text.pdf.draw.DottedLineSeparator;
|
|
import com.itextpdf.text.pdf.draw.DottedLineSeparator;
|
|
@@ -192,7 +190,7 @@ public class PDFUtil {
|
|
|
|
|
|
|
|
|
|
|
|
|
// 4.向文档中添加内容
|
|
// 4.向文档中添加内容
|
|
|
- //PDFUtil.generateEPDF(document,"XXX公司",null,null);
|
|
|
|
|
|
|
+// PDFUtil.generateEPDF(document,"XXX公司",null,null);
|
|
|
|
|
|
|
|
// 5.关闭文档
|
|
// 5.关闭文档
|
|
|
document.close();
|
|
document.close();
|
|
@@ -255,9 +253,9 @@ public class PDFUtil {
|
|
|
document.add(p1);
|
|
document.add(p1);
|
|
|
PdfPTable table1 = createTable(new float[] { 240, 100});
|
|
PdfPTable table1 = createTable(new float[] { 240, 100});
|
|
|
table1.addCell(createCell("客户名称: " +receivingNote.getCustomerName(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
table1.addCell(createCell("客户名称: " +receivingNote.getCustomerName(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
- table1.addCell(createCell("运单号: " +receivingNote.getShipmentNumber(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
|
|
- table1.addCell(createCell("收货地址: " +receivingNote.getShipToAddress(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
|
|
- table1.addCell(createCell("经办人: " +receivingNote.getAgent(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
|
|
|
|
+ table1.addCell(createCell("TMS运单号: " +receivingNote.getShipmentNumber(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
|
|
+// table1.addCell(createCell("收货地址: " +receivingNote.getShipToAddress(), headfont, Element.ALIGN_LEFT, 1, false));
|
|
|
|
|
+ table1.addCell(createCell("经办人: " +receivingNote.getAgent(), headfont, Element.ALIGN_RIGHT, 2, false));
|
|
|
document.add(table1);
|
|
document.add(table1);
|
|
|
// Paragraph paragraph1 = new Paragraph("客户名称: " +receivingNote.getCustomerName() +" " +
|
|
// Paragraph paragraph1 = new Paragraph("客户名称: " +receivingNote.getCustomerName() +" " +
|
|
|
// " 运单号: " +receivingNote.getShipmentNumber(), namefont);
|
|
// " 运单号: " +receivingNote.getShipmentNumber(), namefont);
|
|
@@ -301,35 +299,48 @@ public class PDFUtil {
|
|
|
//document.add(image);
|
|
//document.add(image);
|
|
|
int size = 0;
|
|
int size = 0;
|
|
|
// 表格
|
|
// 表格
|
|
|
- PdfPTable table = createTable(new float[] { 180, 80, 80});
|
|
|
|
|
|
|
+ PdfPTable table = createTable(new float[] { 160, 60, 60,60});
|
|
|
table.addCell(createCell("物品明细", headfont, Element.ALIGN_CENTER, 8, false));
|
|
table.addCell(createCell("物品明细", headfont, Element.ALIGN_CENTER, 8, false));
|
|
|
- table.addCell(createCell("材料名称", keyfont, Element.ALIGN_CENTER));
|
|
|
|
|
|
|
+ table.addCell(createCell("物料名称", keyfont, Element.ALIGN_CENTER));
|
|
|
table.addCell(createCell("规格", keyfont, Element.ALIGN_CENTER));
|
|
table.addCell(createCell("规格", keyfont, Element.ALIGN_CENTER));
|
|
|
- table.addCell(createCell("确认收货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
|
|
-// table.addCell(createCell("到货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
|
|
- table.addCell(createCell("订单号: "+receivingNote.getOrderNumber()+" 交货单号: " + receivingNote.getDeliveryNumber() + " 重量:" + receivingNote.getWeight(), keyfont, Element.ALIGN_LEFT, 4));
|
|
|
|
|
|
|
+ table.addCell(createCell("数量", keyfont, Element.ALIGN_CENTER));
|
|
|
|
|
+ table.addCell(createCell("确认到货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
|
|
+// table.addCell(createCell("订单号: "+receivingNote.getOrderNumber()+" 交货单号: " + receivingNote.getDeliveryNumber() + " 交货单统计:" + receivingNote.getWeight(), keyfont, Element.ALIGN_LEFT, 4));
|
|
|
// table.addCell(createCell("未交货数量", keyfont, Element.ALIGN_CENTER));
|
|
// table.addCell(createCell("未交货数量", keyfont, Element.ALIGN_CENTER));
|
|
|
// table.addCell(createCell("发货数量", keyfont, Element.ALIGN_CENTER));
|
|
// 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(), textfont));
|
|
|
|
|
-// table.addCell(createCell(line.getDeliveryCount(), textfont));
|
|
|
|
|
- size += line.getMaterialName().length() / 21 + 1;
|
|
|
|
|
|
|
+ for (ConfirmCollectQueryDeliverModel dd : receivingNote.getOwnConfirmCollectQueryDeliverModels()) {
|
|
|
|
|
+ table.addCell(createCell("交货单号: "+dd.getDeliverNumber()+" 交货单统计:" + dd.getDetail(), keyfont, Element.ALIGN_LEFT, 4));
|
|
|
|
|
+ for (ConfirmCollectQueryDeliverLineModel line: dd.getConfirmCollectQueryDeliverLineModels()) {
|
|
|
|
|
+ table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getDeliveryCount().toString(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getConfirmQuantity().toString(), textfont));
|
|
|
|
|
+ size += line.getMaterialName().length() / 21 + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ for (ConfirmCollectQueryDeliverModel od : receivingNote.getOtherConfirmCollectQueryDeliverModels()) {
|
|
|
|
|
+ table.addCell(createCell("交货单号: "+od.getDeliverNumber()+" 交货单统计:" + od.getDetail(), keyfont, Element.ALIGN_LEFT, 4));
|
|
|
|
|
+ for (ConfirmCollectQueryDeliverLineModel line: od.getConfirmCollectQueryDeliverLineModels()) {
|
|
|
|
|
+ table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getDeliveryCount().toString(), textfont));
|
|
|
|
|
+ table.addCell(createCell(line.getConfirmQuantity().toString(), textfont));
|
|
|
|
|
+ size += line.getMaterialName().length() / 21 + 1;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- for (ConfirmCollectOtherDeliveryModel otherLine : receivingNote.getOtherDeliveryModels()) {
|
|
|
|
|
|
|
+ /*for (ConfirmCollectQueryDeliverModel otherLine : receivingNote.getOtherDeliveryModels()) {
|
|
|
table.addCell(createCell("订单号: "+receivingNote.getOrderNumber()+" 交货单号: " + otherLine.getDeliveryNumber() + " 重量:" + otherLine.getWeight(), keyfont, Element.ALIGN_LEFT, 4));
|
|
table.addCell(createCell("订单号: "+receivingNote.getOrderNumber()+" 交货单号: " + otherLine.getDeliveryNumber() + " 重量:" + otherLine.getWeight(), keyfont, Element.ALIGN_LEFT, 4));
|
|
|
- for (ConfirmCollectLineDetailModel line : otherLine.getDeliveryLineDetail()) {
|
|
|
|
|
|
|
+ for (ConfirmCollectQueryDeliverLineModel line : otherLine.confirmCollectQueryDeliverLineModels()) {
|
|
|
table.addCell(createCell(line.getMaterialName(), textfont));
|
|
table.addCell(createCell(line.getMaterialName(), textfont));
|
|
|
table.addCell(createCell(line.getSizeDim(), textfont));
|
|
table.addCell(createCell(line.getSizeDim(), textfont));
|
|
|
table.addCell(createCell(line.getConfirmQuantity(), textfont));
|
|
table.addCell(createCell(line.getConfirmQuantity(), textfont));
|
|
|
// table.addCell(createCell(line.getDeliveryCount(), textfont));
|
|
// table.addCell(createCell(line.getDeliveryCount(), textfont));
|
|
|
size += line.getMaterialName().length() / 21 + 1;
|
|
size += line.getMaterialName().length() / 21 + 1;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
document.add(table);
|
|
document.add(table);
|
|
|
|
|
|