Commit 1e68c8be by Java-张振楠

部署前修改

parent c5b54072
......@@ -3,6 +3,7 @@ package com.ejweb.modules.report.web;
import com.ejweb.conf.GConstants;
import com.ejweb.core.base.BaseController;
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.service.ReportService;
import com.itextpdf.text.*;
......@@ -22,6 +23,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
/**
* 举报转为文档Controller
......@@ -49,6 +51,7 @@ public class ReportToPdfController extends BaseController {
BaseFont bfChinese = BaseFont.createFont("STSongStd-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
Font title = new Font(bfChinese,16,Font.BOLD);//文字加粗
Font textfont = new Font(bfChinese,14,Font.NORMAL);//正常文字
Font urlfont = new Font(bfChinese,12,Font.NORMAL);//路径文字
//document是创建的文档,FileOutputStream是向文档中输入
PdfWriter.getInstance(document, new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportEntity.getReportProject()+"_"+reportEntity.getId()+".pdf"));
//打开文档
......@@ -87,7 +90,21 @@ public class ReportToPdfController extends BaseController {
PdfPCell reportAttachment = new PdfPCell(new Paragraph("附件:",textfont));
reportAttachment.setBorderWidth(0);
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);
table1.addCell(reportAttachment1);
document.add(table1);
......@@ -227,7 +244,22 @@ public class ReportToPdfController extends BaseController {
PdfPCell supplementAttachment = new PdfPCell(new Paragraph("附件:",textfont));
supplementAttachment.setBorderWidth(0);
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);
table3.addCell(supplementAttachment1);
document.add(table3);
......
......@@ -73,9 +73,9 @@ userfiles.prefix=static
#projectPath=D\:\\workspace\\jeesite
# 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:/uploads/
#file.upload.dir=/D:/uploads/
# Max Upload File Size: (default 30M=30*1024*1024(B)=31457280 bytes)
file.max.upload.size=31457280
# The File Path Date Format(default yyyyMM)
......@@ -94,7 +94,8 @@ file.image.thumb.is.allow=true
file.image.thumb.width=640
file.image.thumb.height=640
# 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
file.upload.path.separator = /
......@@ -103,4 +104,4 @@ file.upload.path.separator = /
push.server.url=http://123.56.146.81:1880/v1/
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
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.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
......
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