|
@@ -187,15 +187,21 @@ public class PDFSelfUtil {
|
|
|
|
|
|
// 3.打开文档
|
|
|
document.open();
|
|
|
- document.addTitle("随 身 邦 收 货 单");// 标题
|
|
|
+ document.addTitle("随 身 邦 授 权 单");// 标题
|
|
|
document.addAuthor("");// 作者
|
|
|
document.addSubject("");// 主题
|
|
|
document.addKeywords("");// 关键字
|
|
|
document.addCreator("");// 创建者
|
|
|
-
|
|
|
-
|
|
|
+ OrderSelfNote note=new OrderSelfNote();
|
|
|
+ note.setBeentrustName("小鱼");
|
|
|
+ note.setOrderCreationTime("2023-01-25 22:12");
|
|
|
+ note.setEntrustName("南安市天华装饰材料有限公司");
|
|
|
+ note.setbId("310112199009133333");
|
|
|
+ note.setDeliveryNumber("6107014416, 6106986125");
|
|
|
+ note.setCarNumber("沪A66666");
|
|
|
+ note.setBelongTo("0110053958");
|
|
|
// 4.向文档中添加内容
|
|
|
-// PDFUtil.generateEPDF(document,"XXX公司",null,null);
|
|
|
+ generateEPDF(document,note,false);
|
|
|
|
|
|
// 5.关闭文档
|
|
|
document.close();
|
|
@@ -218,12 +224,12 @@ public class PDFSelfUtil {
|
|
|
try {
|
|
|
// 不同字体(这里定义为同一种字体:包含不同字号、不同style)
|
|
|
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
|
|
|
- titlefont = new Font(bfChinese, 16, Font.NORMAL);
|
|
|
+ titlefont = new Font(bfChinese, 16, Font.BOLD);
|
|
|
headfont = new Font(bfChinese, 14, Font.BOLD);
|
|
|
keyfont = new Font(bfChinese, 10, Font.BOLD);
|
|
|
namefont = new Font(bfChinese, 12, Font.BOLD);
|
|
|
textfont = new Font(bfChinese, 10, Font.NORMAL);
|
|
|
- centry=new Font(bfChinese,12,Font.NORMAL);
|
|
|
+ centry=new Font(bfChinese,11,Font.BOLD);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -240,20 +246,10 @@ public class PDFSelfUtil {
|
|
|
paragraph.setIndentationLeft(12); //设置左缩进
|
|
|
paragraph.setIndentationRight(12); //设置右缩进
|
|
|
paragraph.setFirstLineIndent(24); //设置首行缩进
|
|
|
- paragraph.setLeading(5f); //行间距
|
|
|
+ paragraph.setLeading(8f); //行间距
|
|
|
paragraph.setSpacingBefore(5f); //设置段落上空白
|
|
|
paragraph.setSpacingAfter(10f); //设置段落下空白
|
|
|
document.add(paragraph);
|
|
|
-
|
|
|
- /*Paragraph paragraph2 = new Paragraph("发呢五分范文芳你得请我的飒",textfont);
|
|
|
- paragraph2.setAlignment(1); //设置文字居中 0靠左 1,居中 2,靠右
|
|
|
- paragraph2.setIndentationLeft(12); //设置左缩进
|
|
|
- paragraph2.setIndentationRight(12); //设置右缩进
|
|
|
- paragraph2.setFirstLineIndent(24); //设置首行缩进
|
|
|
- paragraph2.setLeading(10f); //行间距
|
|
|
- paragraph2.setSpacingBefore(5f); //设置段落上空白
|
|
|
- paragraph2.setSpacingAfter(5f); //设置段落下空白
|
|
|
- document.add(paragraph2);*/
|
|
|
// 直线
|
|
|
/* Paragraph p1 = new Paragraph();
|
|
|
p1.add(new Chunk(new LineSeparator()));
|
|
@@ -261,7 +257,7 @@ public class PDFSelfUtil {
|
|
|
// Paragraph paragraph1 = new Paragraph("客户名称: " +receivingNote.getCustomerName() +" " +
|
|
|
// " 运单号: " +receivingNote.getShipmentNumber(), namefont);
|
|
|
Paragraph paragraph1 = new Paragraph();
|
|
|
- paragraph1.setLeading(20f); //行间距
|
|
|
+ paragraph1.setLeading(60f); //行间距
|
|
|
paragraph1.setSpacingBefore(2f); //设置段落上空白
|
|
|
paragraph1.setSpacingAfter(2f); //设置段落下空白
|
|
|
document.add(paragraph1);
|
|
@@ -292,52 +288,40 @@ public class PDFSelfUtil {
|
|
|
//时间格式校验
|
|
|
String str=receivingNote.getOrderCreationTime();
|
|
|
SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date date =sdf.parse(str);
|
|
|
+ Date dateOrder =sdf.parse(str);
|
|
|
+ Calendar calendarOrder = Calendar.getInstance();
|
|
|
+ calendarOrder.setTime(dateOrder);
|
|
|
+ String time = str.substring( str.indexOf(" "));
|
|
|
+ Date date=new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(date);
|
|
|
// 表格
|
|
|
PdfPTable table = createTable(new float[] { 80, 80, 80, 80, 80, 80 ,80,80});
|
|
|
- table.addCell(createCell("客 户 自 提 委 托 书", titlefont, Element.ALIGN_CENTER, 8, false));
|
|
|
-
|
|
|
-
|
|
|
- /* PdfPTable table = createTable(new float[] { 160, 60, 60,60});
|
|
|
- table.addCell(createCell("委托人(名称): " +receivingNote.getEntrustName()+"\n\n"+
|
|
|
- "受托(提货)人:姓名: " +receivingNote.getBeentrustName()+" 身份证号码: " +receivingNote.getbId()+" 车牌: " +receivingNote.getCarNumber()+"\n\n"+
|
|
|
- " 委托人委托受托人于 "+calendar.get(Calendar.YEAR)+" 年 "+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+" 日 "+" 来贵司提取交货单号为 "+receivingNote.getDeliveryNumber()+" 上所载明的货物。"+"\n\n"+
|
|
|
- " 特此委托!。"+"\n\n\n\n"+
|
|
|
- " 委托人: "+receivingNote.getEntrustName()+"\n\n", keyfont, Element.ALIGN_LEFT, 2, false));
|
|
|
-
|
|
|
-
|
|
|
-*/ Paragraph paragraph6 = new Paragraph();
|
|
|
- paragraph6.setLeading(20f); //行间距*/
|
|
|
+ table.addCell(createCell("客户自提授权委托书", titlefont, Element.ALIGN_CENTER, 8, false));
|
|
|
+ Paragraph paragraph6 = new Paragraph();
|
|
|
+ paragraph6.setLeading(50f); //行间距*/
|
|
|
document.add(paragraph1);
|
|
|
- table.addCell(createCell(" 委托人(名称):姓名: "+receivingNote.getEntrustName()+"\n\n"+
|
|
|
- "受托(提货)人:姓名: "+receivingNote.getBeentrustName()+" 身份证号码: "+receivingNote.getbId()+" 车牌: "+receivingNote.getCarNumber()+"\n\n"+
|
|
|
- " 委托人委托受托人于 "+calendar.get(Calendar.YEAR)+" 年 "+(calendar.get(Calendar.MONTH)+1)+" 月 "+calendar.get(Calendar.DATE)+" 日 "+" 来贵司提取交货单号为 "+receivingNote.getDeliveryNumber()+"\n\n"+
|
|
|
- " 上所载明的货物。 \n\n"+
|
|
|
+ table.addCell(createCell("致立邦装饰材料(广州)有限公司: "+"\n\n"+" 兹 有 委 托 人: "+receivingNote.getEntrustName()+"("+receivingNote.getBelongTo()+")"+" 全 权 委 托 受 托 人: "+ receivingNote.getBeentrustName() +" 于 以 下 预 约"+
|
|
|
+ " 时 间 前 往 贵 公 司 提 取 立 邦 交 货 清 单( 编 号 "+receivingNote.getDeliveryNumber()+" )上立邦产品, "+
|
|
|
+ " 授 权 其 代 为 我 公 司 向 贵 公 司 提 货 、 确 认 产 品 数 量 和 外 观 , 并 签 收 上 述 授 权 事 宜 对 "+
|
|
|
+ " 应 的 交 货 (清) 单 及 提 货 资 料 , 我 公 司 表 示 认 可 并 接 受 因 此 造 成 的 一 切 法 律 后 果 。"+"\n"+
|
|
|
+ " 本 授 权 委 托 书 期 限 自 委 托 人 签 署 盖 章 后 生 效 , 自 委 托 人 确 定 “ 预 约 提 货 日 期 十 日 内 有 效。"+"\n\n"+
|
|
|
+ "受托人姓名: "+"【"+receivingNote.getBeentrustName()+"】"+"\n\n" +
|
|
|
+ "受托人身份证: "+"【"+receivingNote.getbId()+"】"+"\n\n"+
|
|
|
+ "受托人车牌号: "+"【"+receivingNote.getCarNumber()+"】"+"\n\n"+
|
|
|
+ "自提交货(清单)单号: "+"【"+receivingNote.getDeliveryNumber()+"】"+"\n\n"+
|
|
|
+ "预约提货日期和时间:"+calendarOrder.get(Calendar.YEAR)+"年"+(calendarOrder.get(Calendar.MONTH)+1)+" 月 "+calendarOrder.get(Calendar.DATE)+" 日 "+time+"\n\n"+
|
|
|
"特此委托!\n\n\n"
|
|
|
, centry, Element.ALIGN_LEFT, 7, false));
|
|
|
document.add(paragraph1);
|
|
|
- /* table.addCell(createCell(" \n " +
|
|
|
- "受托(提货)人:姓名: "+receivingNote.getBeentrustName(), centry, Element.ALIGN_LEFT, 7, false));*/
|
|
|
- /* table.addCell(createCell(" 身份证号码: "+receivingNote.getbId(), centry, Element.ALIGN_LEFT, 7, false));
|
|
|
- table.addCell(createCell(" 车牌: "+receivingNote.getCarNumber(), centry, Element.ALIGN_LEFT, 7, false));
|
|
|
- table.addCell(createCell(" 委托人委托受托人于 "+calendar.get(Calendar.YEAR)+" 年 "+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+" 日 ", centry, Element.ALIGN_LEFT, 8, false));
|
|
|
- table.addCell(createCell(" 来贵司提取交货单号为 "+receivingNote.getDeliveryNumber()+" 上所载明的货物。 \n" +
|
|
|
- "特此委托!\n", keyfont, Element.ALIGN_CENTER, 8, false));
|
|
|
- table.addCell(createCell(" 特此委托!\n ", keyfont, Element.ALIGN_LEFT, 7, true));*/
|
|
|
table.addCell(createCell("", keyfont, Element.ALIGN_LEFT, 7, true));
|
|
|
- table.addCell(createCell(" 委托人:"+receivingNote.getEntrustName(), centry, Element.ALIGN_LEFT, 8, false));
|
|
|
- table.addCell(createCell(" 受托(提货)人:"+receivingNote.getBeentrustName(), centry, Element.ALIGN_LEFT, 9, false));
|
|
|
- table.addCell(createCell(calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日", centry, Element.ALIGN_RIGHT, 10, false));
|
|
|
- table.addCell(createCell("委托人盖章:", centry, Element.ALIGN_RIGHT, 11, false));
|
|
|
+ table.addCell(createCell(" 受托(提货)人签字印鉴:"+receivingNote.getBeentrustName()+" 委托人授权收货预留印章", centry,Element.ALIGN_LEFT , 8, false));
|
|
|
+ table.addCell(createCell(" 委托人确认:", centry, Element.ALIGN_LEFT, 11, false));
|
|
|
+ table.addCell(createCell( calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日", centry, Element.ALIGN_LEFT, 10, false));
|
|
|
document.add(paragraph1);
|
|
|
table.addCell(createCell("注意事项:\n" +
|
|
|
- "1、受托(提货)人须携带身份证或驾驶证原件。\n" +
|
|
|
- "2、本委托书必须注明立邦公司交货单号。\n" +
|
|
|
- "3、本委托书必须盖有与销售合同中预留相一致的印章。\n" +
|
|
|
- "4、仓库不接受传真的公章印鉴(外埠客户因特殊原因自提时,携带的传真件必须得到当地办事处相关人员确认后方为有效)。\n" +
|
|
|
- "5、本委托书自委托人确定的提货日期后的十日内有效。", textfont, Element.ALIGN_LEFT, 12, false));
|
|
|
+ "1、受托(提货)人应当携带身份证或驾驶证原件。\n" +
|
|
|
+ "2、甲方提货地点不接受传真或电子方式的“客户自提授权委托书”。", centry, Element.ALIGN_LEFT, 12, false));
|
|
|
|
|
|
|
|
|
document.add(table);
|