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
de72a624
Commit
de72a624
authored
Oct 24, 2017
by
java-lixy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息中心修改+添加功能:转为word文档
parent
72997486
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
466 additions
and
14 deletions
+466
-14
ReportService.java
src/main/java/com/ejweb/modules/report/service/ReportService.java
+15
-10
ReportController.java
src/main/java/com/ejweb/modules/report/web/ReportController.java
+7
-3
ReportToWordController.java
src/main/java/com/ejweb/modules/report/web/ReportToWordController.java
+435
-0
ReportNoticeMapper.xml
src/main/resources/mappings/modules/workbench/ReportNoticeMapper.xml
+1
-1
reportForm.jsp
src/main/webapp/WEB-INF/views/modules/report/reportForm.jsp
+8
-0
No files found.
src/main/java/com/ejweb/modules/report/service/ReportService.java
View file @
de72a624
...
@@ -243,6 +243,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
...
@@ -243,6 +243,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
Date
date
=
new
Date
();
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
ReportNotice
reportNotice
=
reportDao
.
findReportNotice
(
reportEntity
);
ReportNotice
reportNotice
=
reportDao
.
findReportNotice
(
reportEntity
);
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy年MM月dd日"
);
String
dateStr
=
sdf1
.
format
(
date
);
if
(
reportNotice
!=
null
){
if
(
reportNotice
!=
null
){
//消息表中已存在该条举报的移交信息,更新该记录
//消息表中已存在该条举报的移交信息,更新该记录
if
(
StringUtils
.
isNotBlank
(
user
.
getId
())){
if
(
StringUtils
.
isNotBlank
(
user
.
getId
())){
...
@@ -256,8 +258,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
...
@@ -256,8 +258,8 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice
.
setStatus
(
"0"
);
reportNotice
.
setStatus
(
"0"
);
if
(
flag
.
equals
(
"answer"
)){
if
(
flag
.
equals
(
"answer"
)){
reportNotice
.
setSendToId
(
reportDao
.
findAdmin
(
new
Office
()));
reportNotice
.
setSendToId
(
reportDao
.
findAdmin
(
new
Office
()));
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy年MM月dd日
"
);
reportNotice
.
setTitle
(
"“"
+
reportEntity
.
getSupplementTitle
()+
"”已由"
+
user
.
getName
()+
"于"
+
dateStr
+
"处理完成
"
);
String
dateStr
=
sdf1
.
format
(
date
);
}
if
(
flag
.
equals
(
"meanWhile"
)){
reportNotice
.
setTitle
(
"“"
+
reportEntity
.
getSupplementTitle
()+
"”已由"
+
user
.
getName
()+
"于"
+
dateStr
+
"处理完成"
);
reportNotice
.
setTitle
(
"“"
+
reportEntity
.
getSupplementTitle
()+
"”已由"
+
user
.
getName
()+
"于"
+
dateStr
+
"处理完成"
);
}
}
reportDao
.
updateReportNotice
(
reportNotice
);
reportDao
.
updateReportNotice
(
reportNotice
);
...
@@ -267,8 +269,19 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
...
@@ -267,8 +269,19 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice
=
new
ReportNotice
();
reportNotice
=
new
ReportNotice
();
reportNotice
.
setId
(
IdGen
.
uuid
());
reportNotice
.
setId
(
IdGen
.
uuid
());
reportNotice
.
setReportId
(
reportEntity
.
getId
());
reportNotice
.
setReportId
(
reportEntity
.
getId
());
reportNotice
.
setCreateDate
(
date
);
reportNotice
.
setUpdateDate
(
date
);
String
sendTime
=
sdf
.
format
(
date
);
reportNotice
.
setSendTime
(
sendTime
);
reportNotice
.
setSendFromId
(
user
.
getId
());
reportNotice
.
setStatus
(
"0"
);
reportNotice
.
setCreateBy
(
user
.
getId
());
reportNotice
.
setUpdateBy
(
user
.
getId
());
if
(
flag
.
equals
(
"answer"
)){
if
(
flag
.
equals
(
"answer"
)){
return
0
;
return
0
;
}
else
if
(
flag
.
equals
(
"meanWhile"
)){
reportNotice
.
setSendToId
(
reportEntity
.
getExchangeAfterUser
());
reportNotice
.
setTitle
(
"“"
+
reportEntity
.
getSupplementTitle
()+
"”已由"
+
user
.
getName
()+
"于"
+
dateStr
+
"处理完成"
);
}
else
{
}
else
{
//管理员转交或移交,消息标题为“请处理xxx”
//管理员转交或移交,消息标题为“请处理xxx”
String
title
=
reportEntity
.
getSupplementTitle
();
String
title
=
reportEntity
.
getSupplementTitle
();
...
@@ -278,14 +291,6 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
...
@@ -278,14 +291,6 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
reportNotice
.
setTitle
(
"请处理-“"
+
title
+
"”"
);
reportNotice
.
setTitle
(
"请处理-“"
+
title
+
"”"
);
reportNotice
.
setSendToId
(
reportEntity
.
getExchangeAfterUser
());
reportNotice
.
setSendToId
(
reportEntity
.
getExchangeAfterUser
());
}
}
reportNotice
.
setCreateDate
(
date
);
reportNotice
.
setUpdateDate
(
date
);
String
sendTime
=
sdf
.
format
(
date
);
reportNotice
.
setSendTime
(
sendTime
);
reportNotice
.
setSendFromId
(
user
.
getId
());
reportNotice
.
setStatus
(
"0"
);
reportNotice
.
setCreateBy
(
user
.
getId
());
reportNotice
.
setUpdateBy
(
user
.
getId
());
reportDao
.
addReportNotice
(
reportNotice
);
reportDao
.
addReportNotice
(
reportNotice
);
return
1
;
return
1
;
}
}
...
...
src/main/java/com/ejweb/modules/report/web/ReportController.java
View file @
de72a624
...
@@ -209,12 +209,16 @@ public class ReportController extends BaseController {
...
@@ -209,12 +209,16 @@ public class ReportController extends BaseController {
}
}
reportService
.
saveTrack
(
reportEntity
);
reportService
.
saveTrack
(
reportEntity
);
String
exchangeAfterUser
=
request
.
getParameter
(
"exchangeAfterUser"
);
String
exchangeAfterUser
=
request
.
getParameter
(
"exchangeAfterUser"
);
if
(
StringUtils
.
isNotBlank
(
exchangeAfterUser
)){
if
(
StringUtils
.
isNotBlank
(
exchangeAfterUser
)
&&
StringUtils
.
isBlank
(
reportEntity
.
getDealResult
())){
//管理员移交给他人处理
reportService
.
addNotice
(
reportEntity
,
"transfer"
);
reportService
.
addNotice
(
reportEntity
,
"transfer"
);
reportService
.
addRecord
(
reportEntity
,
"1"
);
reportService
.
addRecord
(
reportEntity
,
"1"
);
}
}
else
if
(
StringUtils
.
isNotBlank
(
reportEntity
.
getDealResult
())
&&
StringUtils
.
isBlank
(
exchangeAfterUser
)){
if
(
StringUtils
.
isNotBlank
(
reportEntity
.
getDealResult
())){
//自行处理
reportService
.
addNotice
(
reportEntity
,
"answer"
);
reportService
.
addNotice
(
reportEntity
,
"answer"
);
}
else
if
(
StringUtils
.
isNotBlank
(
exchangeAfterUser
)
&&
StringUtils
.
isNotBlank
(
reportEntity
.
getDealResult
())){
//管理员进行处理,同时移交给他人
reportService
.
addNotice
(
reportEntity
,
"meanWhile"
);
}
}
addMessage
(
redirectAttributes
,
"补充举报"
+
reportEntity
.
getSupplementTitle
()
+
"'成功"
);
addMessage
(
redirectAttributes
,
"补充举报"
+
reportEntity
.
getSupplementTitle
()
+
"'成功"
);
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
...
...
src/main/java/com/ejweb/modules/report/web/ReportToWordController.java
0 → 100644
View file @
de72a624
package
com
.
ejweb
.
modules
.
report
.
web
;
import
com.ejweb.conf.GConstants
;
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
org.apache.poi.xwpf.usermodel.*
;
import
org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy
;
import
org.apache.xmlbeans.XmlException
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.servlet.mvc.support.RedirectAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.math.BigInteger
;
import
java.util.List
;
/**
* 举报转为Word文档Controller
* @author lixy
* @version 2017-10-19
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/report"
)
public
class
ReportToWordController
{
@Autowired
private
ReportService
reportService
;
@ModelAttribute
public
ReportEntity
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
if
(
StringUtils
.
isNotBlank
(
id
))
{
return
reportService
.
get
(
id
);
}
else
{
return
new
ReportEntity
();
}
}
@RequestMapping
(
value
=
"toWord"
)
public
void
toWord
(
ReportEntity
reportEntity
,
String
flag
,
HttpServletRequest
request
,
HttpServletResponse
response
,
RedirectAttributes
redirectAttributes
)
throws
IOException
,
XmlException
{
//Blank Document
XWPFDocument
document
=
new
XWPFDocument
();
//Write the Document in file system
String
reportProjectTitle
=
reportEntity
.
getReportProject
();
if
(
reportProjectTitle
.
contains
(
"/"
)){
reportProjectTitle
=
reportProjectTitle
.
replace
(
"/"
,
"|"
);
}
if
(
reportProjectTitle
.
contains
(
"\\"
)){
reportProjectTitle
=
reportProjectTitle
.
replace
(
"\\"
,
"|"
);
}
// FileOutputStream out = new FileOutputStream(GConstants.FILE_UPLOAD_DIR+"pdf/"+reportProjectTitle+"_"+reportEntity.getId()+".pdf");
FileOutputStream
out
=
new
FileOutputStream
(
"D:/1.docx"
);
//添加标题
XWPFParagraph
titleParagraph
=
document
.
createParagraph
();
//设置段落居中
titleParagraph
.
setAlignment
(
ParagraphAlignment
.
CENTER
);
XWPFRun
titleParagraphRun
=
titleParagraph
.
createRun
();
titleParagraphRun
.
setText
(
"举报记录"
);
titleParagraphRun
.
setColor
(
"000000"
);
titleParagraphRun
.
setFontSize
(
20
);
//段落 第一段 举报内容
XWPFParagraph
paragraphBasic
=
document
.
createParagraph
();
XWPFRun
runBasic
=
paragraphBasic
.
createRun
();
runBasic
.
setText
(
"举报内容"
);
runBasic
.
setColor
(
"696969"
);
runBasic
.
setFontSize
(
16
);
//换行
XWPFParagraph
newLine1
=
document
.
createParagraph
();
XWPFRun
paragraphRun1
=
newLine1
.
createRun
();
paragraphRun1
.
setText
(
"\r"
);
//基本信息表格
XWPFTable
basicInfoTable
=
document
.
createTable
();
//去表格边框
basicInfoTable
.
getCTTbl
().
getTblPr
().
unsetTblBorders
();
//列宽自动分割
CTTblWidth
infoTableWidth
=
basicInfoTable
.
getCTTbl
().
addNewTblPr
().
addNewTblW
();
infoTableWidth
.
setType
(
STTblWidth
.
AUTO
);
infoTableWidth
.
setW
(
BigInteger
.
valueOf
(
9072
));
//表格第一行
XWPFTableRow
reportProject
=
basicInfoTable
.
getRow
(
0
);
reportProject
.
getCell
(
0
).
setText
(
"被举报项目:"
);
reportProject
.
addNewTableCell
().
setText
(
reportEntity
.
getReportProject
()==
null
?
""
:
reportEntity
.
getReportProject
());
//表格第二行
XWPFTableRow
supplementInformant
=
basicInfoTable
.
createRow
();
supplementInformant
.
getCell
(
0
).
setText
(
"被举报人:"
);
supplementInformant
.
getCell
(
1
).
setText
(
reportEntity
.
getSupplementInformant
()
==
null
?
""
:
reportEntity
.
getSupplementInformant
());
//表格第三行
XWPFTableRow
reportCity
=
basicInfoTable
.
createRow
();
reportCity
.
getCell
(
0
).
setText
(
"所在城市:"
);
reportCity
.
getCell
(
1
).
setText
(
reportEntity
.
getReportCity
()==
null
?
""
:
reportEntity
.
getReportCity
());
//表格第四行
XWPFTableRow
reportTime
=
basicInfoTable
.
createRow
();
reportTime
.
getCell
(
0
).
setText
(
"举报时间:"
);
reportTime
.
getCell
(
1
).
setText
(
reportEntity
.
getReportTime
()==
null
?
""
:
reportEntity
.
getReportTime
());
//表格第五行
XWPFTableRow
reportContent
=
basicInfoTable
.
createRow
();
reportContent
.
getCell
(
0
).
setText
(
"内容:"
);
reportContent
.
getCell
(
1
).
setText
(
reportEntity
.
getReportContent
()==
null
?
""
:
reportEntity
.
getReportContent
());
//表格 附件
//获取附件列表
ReportAttachmentEntity
reportAttachmentBean
=
new
ReportAttachmentEntity
();
reportAttachmentBean
.
setReportId
(
reportEntity
.
getId
());
reportAttachmentBean
.
setAttachmentType
(
"0"
);
List
<
ReportAttachmentEntity
>
list
=
reportService
.
getAttachmentInfo
(
reportAttachmentBean
);
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
XWPFTableRow
reportAttachment
=
basicInfoTable
.
createRow
();
reportAttachment
.
getCell
(
0
).
setText
(
"附件:"
);
reportAttachment
.
getCell
(
1
).
setText
(
list
.
get
(
i
).
getAttachmentPath
());
}
}
if
(
list
.
size
()
>
1
)
{
mergeCellsVertically
(
basicInfoTable
,
0
,
5
,
5
+
list
.
size
()
-
1
);
}
this
.
setCellWidth
(
basicInfoTable
);
//两个表格之间加个换行
XWPFParagraph
newLine2
=
document
.
createParagraph
();
XWPFRun
paragraphRun2
=
newLine2
.
createRun
();
paragraphRun2
.
setText
(
"\r"
);
//段落 第二段 举报人信息
XWPFParagraph
paragraphPeople
=
document
.
createParagraph
();
XWPFRun
runPeople
=
paragraphPeople
.
createRun
();
runPeople
.
setText
(
"举报人信息"
);
runPeople
.
setColor
(
"696969"
);
runPeople
.
setFontSize
(
16
);
//换行
XWPFParagraph
newLine3
=
document
.
createParagraph
();
XWPFRun
paragraphRun3
=
newLine3
.
createRun
();
paragraphRun3
.
setText
(
"\r"
);
//举报人信息表格
XWPFTable
peopleInfoTable
=
document
.
createTable
();
//去表格边框
peopleInfoTable
.
getCTTbl
().
getTblPr
().
unsetTblBorders
();
//列宽自动分割
CTTblWidth
peopleInfoTableWidth
=
peopleInfoTable
.
getCTTbl
().
addNewTblPr
().
addNewTblW
();
peopleInfoTableWidth
.
setType
(
STTblWidth
.
AUTO
);
peopleInfoTableWidth
.
setW
(
BigInteger
.
valueOf
(
9072
));
//表格第一行
XWPFTableRow
reportPersonName
=
peopleInfoTable
.
getRow
(
0
);
reportPersonName
.
getCell
(
0
).
setText
(
"姓名:"
);
reportPersonName
.
addNewTableCell
().
setText
(
reportEntity
.
getReportPersonName
()==
null
?
""
:
reportEntity
.
getReportPersonName
());
//表格第二行
XWPFTableRow
reportPersonTel
=
peopleInfoTable
.
createRow
();
reportPersonTel
.
getCell
(
0
).
setText
(
"手机号:"
);
reportPersonTel
.
getCell
(
1
).
setText
(
reportEntity
.
getReportPersonTel
()
==
null
?
""
:
reportEntity
.
getReportPersonTel
());
//表格第三行
XWPFTableRow
reportPersonEmail
=
peopleInfoTable
.
createRow
();
reportPersonEmail
.
getCell
(
0
).
setText
(
"Email:"
);
reportPersonEmail
.
getCell
(
1
).
setText
(
reportEntity
.
getReportPersonEmail
()==
null
?
""
:
reportEntity
.
getReportPersonEmail
());
//表格第四行
XWPFTableRow
reportSource
=
peopleInfoTable
.
createRow
();
reportSource
.
getCell
(
0
).
setText
(
"举报途径:"
);
String
report_source
=
reportEntity
.
getReportSource
();
if
(
StringUtils
.
isNotBlank
(
report_source
)){
if
(
report_source
.
equals
(
"web"
)){
report_source
=
"官网"
;
}
else
if
(
report_source
.
equals
(
"oa"
)){
report_source
=
"融创OA系统"
;
}
else
if
(
report_source
.
equals
(
"supplier"
)){
report_source
=
"供应商系统"
;
}
else
if
(
report_source
.
equals
(
"wechat"
)){
report_source
=
"微信公众号"
;
}
else
if
(
report_source
.
equals
(
"sunacE"
)){
report_source
=
"融E"
;
}
else
if
(
report_source
.
equals
(
"offline"
)){
report_source
=
"线下扫码"
;
}
else
if
(
report_source
.
equals
(
"tel"
)){
report_source
=
"电话"
;
}
else
if
(
report_source
.
equals
(
"email"
)){
report_source
=
"邮件"
;
}
else
if
(
report_source
.
equals
(
"visit"
)){
report_source
=
"来访"
;
}
}
else
{
report_source
=
""
;
}
reportSource
.
getCell
(
1
).
setText
(
report_source
);
this
.
setCellWidth
(
peopleInfoTable
);
//两个表格之间加个换行
XWPFParagraph
newLine6
=
document
.
createParagraph
();
XWPFRun
paragraphRun6
=
newLine6
.
createRun
();
paragraphRun6
.
setText
(
"\r"
);
//段落 第三段 举报信息补充
XWPFParagraph
paragraphSupplement
=
document
.
createParagraph
();
XWPFRun
runSupplement
=
paragraphSupplement
.
createRun
();
runSupplement
.
setText
(
"举报信息补充"
);
runSupplement
.
setColor
(
"696969"
);
runSupplement
.
setFontSize
(
16
);
//换行
XWPFParagraph
newLine4
=
document
.
createParagraph
();
XWPFRun
paragraphRun4
=
newLine4
.
createRun
();
paragraphRun4
.
setText
(
"\r"
);
//举报信息补充表格
XWPFTable
supplementInfoTable
=
document
.
createTable
();
//去表格边框
supplementInfoTable
.
getCTTbl
().
getTblPr
().
unsetTblBorders
();
//列宽自动分割
CTTblWidth
supplementInfoTableWidth
=
supplementInfoTable
.
getCTTbl
().
addNewTblPr
().
addNewTblW
();
supplementInfoTableWidth
.
setType
(
STTblWidth
.
AUTO
);
supplementInfoTableWidth
.
setW
(
BigInteger
.
valueOf
(
9072
));
//表格第一行
XWPFTableRow
supplementTitle
=
supplementInfoTable
.
getRow
(
0
);
supplementTitle
.
getCell
(
0
).
setText
(
"标题:"
);
supplementTitle
.
addNewTableCell
().
setText
(
reportEntity
.
getSupplementTitle
()==
null
?
""
:
reportEntity
.
getSupplementTitle
());
//表格第二行
XWPFTableRow
supplementCompany
=
supplementInfoTable
.
createRow
();
supplementCompany
.
getCell
(
0
).
setText
(
"被举报公司:"
);
supplementCompany
.
getCell
(
1
).
setText
(
reportEntity
.
getSupplementCompany
()
==
null
?
""
:
reportEntity
.
getSupplementCompany
());
//表格第三行
XWPFTableRow
supplementDepartment
=
supplementInfoTable
.
createRow
();
supplementDepartment
.
getCell
(
0
).
setText
(
"被举报部门:"
);
supplementDepartment
.
getCell
(
1
).
setText
(
reportEntity
.
getSupplementDepartment
()==
null
?
""
:
reportEntity
.
getSupplementDepartment
());
//表格第四行
XWPFTableRow
supplementType
=
supplementInfoTable
.
createRow
();
supplementType
.
getCell
(
0
).
setText
(
"业务类型:"
);
String
supplement_type
=
reportEntity
.
getSupplementType
();
if
(
StringUtils
.
isNotBlank
(
supplement_type
))
{
if
(
supplement_type
.
equals
(
"1"
))
{
supplement_type
=
"营销"
;
}
else
if
(
supplement_type
.
equals
(
"2"
))
{
supplement_type
=
"工程"
;
}
else
if
(
supplement_type
.
equals
(
"3"
))
{
supplement_type
=
"成本"
;
}
else
if
(
supplement_type
.
equals
(
"4"
))
{
supplement_type
=
"招采"
;
}
else
if
(
supplement_type
.
equals
(
"5"
))
{
supplement_type
=
"人力"
;
}
else
if
(
supplement_type
.
equals
(
"6"
))
{
supplement_type
=
"物业"
;
}
else
if
(
supplement_type
.
equals
(
"7"
))
{
supplement_type
=
"投诉"
;
}
}
else
{
supplement_type
=
""
;
}
supplementType
.
getCell
(
1
).
setText
(
supplement_type
);
//表格第五行
XWPFTableRow
supplementArea
=
supplementInfoTable
.
createRow
();
supplementArea
.
getCell
(
0
).
setText
(
"被举报区域:"
);
String
supplement_area
=
reportEntity
.
getSupplementArea
();
if
(
StringUtils
.
isNotBlank
(
supplement_area
))
{
if
(
supplement_area
.
equals
(
"North China"
))
{
supplement_area
=
"华北区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"BeiJing"
))
{
supplement_area
=
"北京区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"ShangHai"
))
{
supplement_area
=
"上海区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"SouthWest"
))
{
supplement_area
=
"西南区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"SouthEast"
))
{
supplement_area
=
"东南区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"Central China"
))
{
supplement_area
=
"华中区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"GuangShen"
))
{
supplement_area
=
"广深区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"Hainan"
))
{
supplement_area
=
"海南区域公司"
;
}
else
if
(
supplement_area
.
equals
(
"Group"
))
{
supplement_area
=
"集团本部"
;
}
}
else
{
supplement_area
=
""
;
}
supplementArea
.
getCell
(
1
).
setText
(
supplement_area
);
//表格第六行
XWPFTableRow
supplementContent
=
supplementInfoTable
.
createRow
();
supplementContent
.
getCell
(
0
).
setText
(
"内容:"
);
supplementContent
.
getCell
(
1
).
setText
(
reportEntity
.
getSupplementContent
()==
null
?
""
:
reportEntity
.
getSupplementContent
());
//表格 附件行
//获取附件列表
ReportAttachmentEntity
supplementAttachmentBean
=
new
ReportAttachmentEntity
();
supplementAttachmentBean
.
setReportId
(
reportEntity
.
getId
());
supplementAttachmentBean
.
setAttachmentType
(
"1"
);
List
<
ReportAttachmentEntity
>
list1
=
reportService
.
getAttachmentInfo
(
supplementAttachmentBean
);
if
(
list1
!=
null
&&
list1
.
size
()
!=
0
)
{
for
(
int
i
=
0
;
i
<
list1
.
size
();
i
++)
{
XWPFTableRow
reportAttachment
=
supplementInfoTable
.
createRow
();
reportAttachment
.
getCell
(
0
).
setText
(
"附件:"
);
reportAttachment
.
getCell
(
1
).
setText
(
list1
.
get
(
i
).
getAttachmentPath
());
}
}
if
(
list1
.
size
()
>
1
)
{
mergeCellsVertically
(
supplementInfoTable
,
0
,
6
,
6
+
list1
.
size
()
-
1
);
}
this
.
setCellWidth
(
supplementInfoTable
);
supplementInfoTable
.
setCellMargins
(
0
,
100
,
0
,
100
);
//两个表格之间加个换行
XWPFParagraph
newLine5
=
document
.
createParagraph
();
XWPFRun
paragraphRun5
=
newLine5
.
createRun
();
paragraphRun5
.
setText
(
"\r"
);
//段落 第四段 处理结果
XWPFParagraph
paragraphResult
=
document
.
createParagraph
();
XWPFRun
runResult
=
paragraphResult
.
createRun
();
runResult
.
setText
(
"处理结果"
);
runResult
.
setColor
(
"696969"
);
runResult
.
setFontSize
(
16
);
//换行
XWPFParagraph
newLine7
=
document
.
createParagraph
();
XWPFRun
paragraphRun7
=
newLine7
.
createRun
();
paragraphRun7
.
setText
(
"\r"
);
//举报信息补充表格
XWPFTable
resultInfoTable
=
document
.
createTable
();
//去表格边框
resultInfoTable
.
getCTTbl
().
getTblPr
().
unsetTblBorders
();
//列宽自动分割
CTTblWidth
resultInfoTableWidth
=
resultInfoTable
.
getCTTbl
().
addNewTblPr
().
addNewTblW
();
resultInfoTableWidth
.
setType
(
STTblWidth
.
AUTO
);
resultInfoTableWidth
.
setW
(
BigInteger
.
valueOf
(
9072
));
//表格第一行
XWPFTableRow
dealPersonName
=
resultInfoTable
.
getRow
(
0
);
dealPersonName
.
getCell
(
0
).
setText
(
"处理人:"
);
dealPersonName
.
addNewTableCell
().
setText
(
reportEntity
.
getDealPersonName
()==
null
?
""
:
reportEntity
.
getDealPersonName
());
//表格 附件行
//获取附件列表
ReportAttachmentEntity
dealAttachmentBean
=
new
ReportAttachmentEntity
();
dealAttachmentBean
.
setReportId
(
reportEntity
.
getId
());
dealAttachmentBean
.
setAttachmentType
(
"2"
);
List
<
ReportAttachmentEntity
>
list2
=
reportService
.
getAttachmentInfo
(
dealAttachmentBean
);
if
(
list2
!=
null
&&
list2
.
size
()
!=
0
)
{
for
(
int
i
=
0
;
i
<
list2
.
size
();
i
++)
{
XWPFTableRow
reportAttachment
=
resultInfoTable
.
createRow
();
reportAttachment
.
getCell
(
0
).
setText
(
"附件:"
);
reportAttachment
.
getCell
(
1
).
setText
(
list2
.
get
(
i
).
getAttachmentPath
());
}
}
if
(
list2
.
size
()
>
1
)
{
mergeCellsVertically
(
resultInfoTable
,
0
,
1
,
1
+
list2
.
size
()
-
1
);
}
this
.
setCellWidth
(
resultInfoTable
);
resultInfoTable
.
setCellMargins
(
0
,
100
,
0
,
100
);
//表格第三行
XWPFTableRow
dealResult
=
resultInfoTable
.
createRow
();
dealResult
.
getCell
(
0
).
setText
(
"处理结论:"
);
String
deal_result
=
reportEntity
.
getDealResult
();
if
(
StringUtils
.
isNotBlank
(
deal_result
))
{
if
(
deal_result
.
equals
(
"1"
))
{
deal_result
=
"投诉"
;
}
else
if
(
deal_result
.
equals
(
"2"
))
{
deal_result
=
"举报无效"
;
}
else
if
(
deal_result
.
equals
(
"3"
))
{
deal_result
=
"举报属实"
;
}
}
else
{
deal_result
=
""
;
}
dealResult
.
getCell
(
1
).
setText
(
deal_result
);
this
.
setCellWidth
(
basicInfoTable
);
CTSectPr
sectPr
=
document
.
getDocument
().
getBody
().
addNewSectPr
();
XWPFHeaderFooterPolicy
policy
=
new
XWPFHeaderFooterPolicy
(
document
,
sectPr
);
document
.
write
(
out
);
out
.
close
();
PrintWriter
printWriter
=
response
.
getWriter
();
response
.
setContentType
(
"application/json;charset=utf-8"
);
printWriter
.
write
(
GConstants
.
FILE_PREFIX_URL
+
"pdf/"
+
reportProjectTitle
+
"_"
+
reportEntity
.
getId
()+
".pdf"
);
printWriter
.
close
();
}
/**
* @Description: 跨行合并
*/
public
void
mergeCellsVertically
(
XWPFTable
table
,
int
col
,
int
fromRow
,
int
toRow
)
{
for
(
int
rowIndex
=
fromRow
;
rowIndex
<=
toRow
;
rowIndex
++)
{
XWPFTableCell
cell
=
table
.
getRow
(
rowIndex
).
getCell
(
col
);
if
(
rowIndex
==
fromRow
)
{
// The first merged cell is set with RESTART merge value
cell
.
getCTTc
().
addNewTcPr
().
addNewVMerge
().
setVal
(
STMerge
.
RESTART
);
}
else
{
// Cells which join (merge) the first one, are set with CONTINUE
cell
.
getCTTc
().
addNewTcPr
().
addNewVMerge
().
setVal
(
STMerge
.
CONTINUE
);
}
}
}
/**
* @Description: 设置单元格宽度
*/
public
void
setCellWidth
(
XWPFTable
table
)
{
List
<
XWPFTableRow
>
rowList
=
table
.
getRows
();
for
(
XWPFTableRow
row
:
rowList
){
List
<
XWPFTableCell
>
cellList
=
row
.
getTableCells
();
int
i
=
0
;
for
(
XWPFTableCell
cell
:
cellList
){
CTTcPr
cellPr
=
cell
.
getCTTc
().
addNewTcPr
();
cellPr
.
addNewVAlign
().
setVal
(
STVerticalJc
.
CENTER
);
int
width
=
2268
;
if
(
i
==
1
){
width
=
6804
;
}
//设置宽度
cellPr
.
addNewTcW
().
setW
(
BigInteger
.
valueOf
(
width
));
i
++;
}
}
}
}
src/main/resources/mappings/modules/workbench/ReportNoticeMapper.xml
View file @
de72a624
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
FROM ct_bbtc_report_notice
FROM ct_bbtc_report_notice
WHERE send_to_id = #{sendToId,jdbcType=VARCHAR}
WHERE send_to_id = #{sendToId,jdbcType=VARCHAR}
order by
create_dat
e desc
order by
send_tim
e desc
</select>
</select>
<select
id=
"getMessageCount"
resultType=
"Integer"
>
<select
id=
"getMessageCount"
resultType=
"Integer"
>
...
...
src/main/webapp/WEB-INF/views/modules/report/reportForm.jsp
View file @
de72a624
...
@@ -155,6 +155,14 @@
...
@@ -155,6 +155,14 @@
</div>
</div>
</div>
</div>
<div
class=
"control-group"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
>
被举报人:
</label>
<div
class=
"controls"
>
<form:input
path=
"supplementInformant"
htmlEscape=
"false"
maxlength=
"50"
class=
"input-xlarge required"
placeholder=
"最多输入50个字符"
/>
<span
class=
"help-inline"
><font
color=
"red"
>
*
</font>
</span>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
>
内容:
</label>
<label
class=
"control-label"
>
内容:
</label>
<div
class=
"controls"
>
<div
class=
"controls"
>
<form:textarea
id=
"reportContent"
htmlEscape=
"true"
path=
"reportContent"
rows=
"4"
maxlength=
"500"
<form:textarea
id=
"reportContent"
htmlEscape=
"true"
path=
"reportContent"
rows=
"4"
maxlength=
"500"
...
...
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