Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-sunac-report
sunac_report
Commits
1e68c8be
Commit
1e68c8be
authored
Sep 25, 2017
by
Java-张振楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部署前修改
parent
c5b54072
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
6 deletions
+43
-6
ReportToPdfController.java
src/main/java/com/ejweb/modules/report/web/ReportToPdfController.java
+34
-2
ejweb.properties
src/main/resources/ejweb.properties
+6
-4
jdbc.properties
src/main/resources/jdbc.properties
+3
-0
reportDeliver.jsp
src/main/webapp/WEB-INF/views/modules/report/reportDeliver.jsp
+0
-0
No files found.
src/main/java/com/ejweb/modules/report/web/ReportToPdfController.java
View file @
1e68c8be
...
@@ -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
);
...
...
src/main/resources/ejweb.properties
View file @
1e68c8be
...
@@ -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\u
6d25
user.office.name
=
\u5929\u
6d25
\ No newline at end of file
src/main/resources/jdbc.properties
View file @
1e68c8be
...
@@ -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
...
...
src/main/webapp/WEB-INF/views/modules/report/reportDeliver.jsp
View file @
1e68c8be
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment