Commit 1e68c8be by Java-张振楠

部署前修改

parent c5b54072
...@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web; ...@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants; import com.ejweb.conf.GConstants;
import com.ejweb.core.base.BaseController; import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.report.entity.ReportAttachmentEntity;
import com.ejweb.modules.report.entity.ReportEntity; import com.ejweb.modules.report.entity.ReportEntity;
import com.ejweb.modules.report.service.ReportService; import com.ejweb.modules.report.service.ReportService;
import com.itextpdf.text.*; import com.itextpdf.text.*;
...@@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.List;
/** /**
* 举报转为文档Controller * 举报转为文档Controller
...@@ -49,6 +51,7 @@ public class ReportToPdfController extends BaseController { ...@@ -49,6 +51,7 @@ public class ReportToPdfController extends BaseController {
BaseFont bfChinese = BaseFont.createFont("STSongStd-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED); BaseFont bfChinese = BaseFont.createFont("STSongStd-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
Font title = new Font(bfChinese,16,Font.BOLD);//文字加粗 Font title = new Font(bfChinese,16,Font.BOLD);//文字加粗
Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字 Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字
Font urlfont = new Font(bfChinese,12,Font.NORMAL);//路径文字
//document是创建的文档,FileOutputStream是向文档中输入 //document是创建的文档,FileOutputStream是向文档中输入
PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf")); PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf"));
//打开文档 //打开文档
...@@ -87,7 +90,21 @@ public class ReportToPdfController extends BaseController { ...@@ -87,7 +90,21 @@ public class ReportToPdfController extends BaseController {
PdfPCell reportAttachment = new PdfPCell(new Paragraph("附件:",textfont)); PdfPCell reportAttachment = new PdfPCell(new Paragraph("附件:",textfont));
reportAttachment.setBorderWidth(0); reportAttachment.setBorderWidth(0);
table1.addCell(reportAttachment); table1.addCell(reportAttachment);
PdfPCell reportAttachment1 = new PdfPCell(new Paragraph(reportEntity.getReportProject()==null?"":reportEntity.getReportProject(),textfont)); //获取附件列表
ReportAttachmentEntity reportAttachmentBean = new ReportAttachmentEntity();
reportAttachmentBean.setReportId(reportEntity.getId());
reportAttachmentBean.setAttachmentType("0");
List<ReportAttachmentEntity> list = reportService.getAttachmentInfo(reportAttachmentBean);
Paragraph paragraphPath1 = new Paragraph();
if (list != null && list.size() != 0) {
for (ReportAttachmentEntity reportAttachmentEntity : list) {
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentPath(),urlfont);
paragraphPath1.add(chunk);
paragraphPath1.add(Chunk.NEWLINE);
}
}
PdfPCell reportAttachment1 = new PdfPCell(paragraphPath1);
reportAttachment1.setBorderWidth(0); reportAttachment1.setBorderWidth(0);
table1.addCell(reportAttachment1); table1.addCell(reportAttachment1);
document.add(table1); document.add(table1);
...@@ -227,7 +244,22 @@ public class ReportToPdfController extends BaseController { ...@@ -227,7 +244,22 @@ public class ReportToPdfController extends BaseController {
PdfPCell supplementAttachment = new PdfPCell(new Paragraph("附件:",textfont)); PdfPCell supplementAttachment = new PdfPCell(new Paragraph("附件:",textfont));
supplementAttachment.setBorderWidth(0); supplementAttachment.setBorderWidth(0);
table3.addCell(supplementAttachment); table3.addCell(supplementAttachment);
PdfPCell supplementAttachment1 = new PdfPCell(new Paragraph(reportEntity.getSupplementAttachment()==null?"":reportEntity.getSupplementAttachment(),textfont));
//获取附件列表
ReportAttachmentEntity reportAttachmentBean1 = new ReportAttachmentEntity();
reportAttachmentBean.setReportId(reportEntity.getId());
reportAttachmentBean.setAttachmentType("1");
List<ReportAttachmentEntity> list1 = reportService.getAttachmentInfo(reportAttachmentBean);
Paragraph paragraphPath2 = new Paragraph();
if (list != null && list.size() != 0) {
for (ReportAttachmentEntity reportAttachmentEntity : list) {
Chunk chunk = new Chunk(reportAttachmentEntity.getAttachmentPath(),urlfont);
paragraphPath1.add(chunk);
paragraphPath1.add(Chunk.NEWLINE);
}
}
PdfPCell supplementAttachment1 = new PdfPCell(paragraphPath2);
supplementAttachment1.setBorderWidth(0); supplementAttachment1.setBorderWidth(0);
table3.addCell(supplementAttachment1); table3.addCell(supplementAttachment1);
document.add(table3); document.add(table3);
......
...@@ -73,9 +73,9 @@ userfiles.prefix=static ...@@ -73,9 +73,9 @@ userfiles.prefix=static
#projectPath=D\:\\workspace\\jeesite #projectPath=D\:\\workspace\\jeesite
# The Upload File DIR, Must End With File Separator # The Upload File DIR, Must End With File Separator
#file.upload.dir=/mnt/sunac/ file.upload.dir=/mnt/sunac/
## file.upload.dir=D:\\WorkSapce\\JEESpace\\ejweb-api-1.0\\files\\ ## file.upload.dir=D:\\WorkSapce\\JEESpace\\ejweb-api-1.0\\files\\
file.upload.dir=/D:/uploads/ #file.upload.dir=/D:/uploads/
# Max Upload File Size: (default 30M=30*1024*1024(B)=31457280 bytes) # Max Upload File Size: (default 30M=30*1024*1024(B)=31457280 bytes)
file.max.upload.size=31457280 file.max.upload.size=31457280
# The File Path Date Format(default yyyyMM) # The File Path Date Format(default yyyyMM)
...@@ -94,7 +94,8 @@ file.image.thumb.is.allow=true ...@@ -94,7 +94,8 @@ file.image.thumb.is.allow=true
file.image.thumb.width=640 file.image.thumb.width=640
file.image.thumb.height=640 file.image.thumb.height=640
# The Prefix Url # The Prefix Url
file.prefix.url=http://123.56.146.81:8808/ #file.prefix.url=http://123.56.146.81:8808/
file.prefix.url=http://192.168.3.232:8080/
# The Prefix separator # The Prefix separator
file.upload.path.separator = / file.upload.path.separator = /
...@@ -103,4 +104,4 @@ file.upload.path.separator = / ...@@ -103,4 +104,4 @@ file.upload.path.separator = /
push.server.url=http://123.56.146.81:1880/v1/ push.server.url=http://123.56.146.81:1880/v1/
faq.base.api=http://localhost:8182/sunac-core-api faq.base.api=http://localhost:8182/sunac-core-api
user.office.name=\u5929\u6d25 user.office.name=\u5929\u6d25
\ No newline at end of file
...@@ -6,6 +6,9 @@ jdbc.driver.class=com.mysql.jdbc.Driver ...@@ -6,6 +6,9 @@ jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8 jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8
jdbc.username=reportuser jdbc.username=reportuser
jdbc.password=$R@20$7 jdbc.password=$R@20$7
#jdbc.url=jdbc:mysql://123.56.146.7:3306/sunac_report?useUnicode=true&characterEncoding=utf-8
#jdbc.username=reportuser
#jdbc.password=$R@20$7
#初始化连接 #初始化连接
jdbc.initialSize=0 jdbc.initialSize=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment