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
dadf708f
Commit
dadf708f
authored
Nov 10, 2017
by
yjh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务类型改成多选框
parent
a83eed6f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
199 additions
and
80 deletions
+199
-80
ReportEntity.java
src/main/java/com/ejweb/modules/report/entity/ReportEntity.java
+10
-0
ReportService.java
src/main/java/com/ejweb/modules/report/service/ReportService.java
+41
-21
ReportController.java
src/main/java/com/ejweb/modules/report/web/ReportController.java
+49
-0
ReportToWordController.java
src/main/java/com/ejweb/modules/report/web/ReportToWordController.java
+41
-16
jdbc.properties
src/main/resources/jdbc.properties
+10
-10
ReportDao.xml
src/main/resources/mappings/modules/report/ReportDao.xml
+4
-1
reportDetail.jsp
src/main/webapp/WEB-INF/views/modules/report/reportDetail.jsp
+8
-1
reportList.jsp
src/main/webapp/WEB-INF/views/modules/report/reportList.jsp
+1
-9
reportTrack.jsp
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
+35
-22
No files found.
src/main/java/com/ejweb/modules/report/entity/ReportEntity.java
View file @
dadf708f
...
...
@@ -45,6 +45,8 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private
String
supplementAttachment
;
//补充提交文件
private
String
dealAttachment
;
//处理成果文件
private
String
[]
types
;
//新业务类型
@ExcelField
(
title
=
"被举报项目"
,
align
=
2
,
sort
=
24
)
public
String
getReportProject
()
{
return
reportProject
;
...
...
@@ -279,4 +281,12 @@ public class ReportEntity extends DataEntity<ReportEntity> {
public
void
setDealAttachment
(
String
dealAttachment
)
{
this
.
dealAttachment
=
dealAttachment
;
}
public
String
[]
getTypes
()
{
return
types
;
}
public
void
setTypes
(
String
[]
types
)
{
this
.
types
=
types
;
}
}
src/main/java/com/ejweb/modules/report/service/ReportService.java
View file @
dadf708f
...
...
@@ -327,27 +327,47 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
public
List
<
ReportEntity
>
getReportList
(
ReportEntity
reportEntity
){
List
<
ReportEntity
>
reportList
=
dao
.
findList
(
reportEntity
);
for
(
ReportEntity
report
:
reportList
)
{
String
supplementType
=
report
.
getSupplementType
();
if
(
StringUtils
.
isNotBlank
(
supplementType
))
{
if
(
supplementType
.
equals
(
"1"
))
{
supplementType
=
"营销"
;
}
else
if
(
supplementType
.
equals
(
"2"
))
{
supplementType
=
"工程"
;
}
else
if
(
supplementType
.
equals
(
"3"
))
{
supplementType
=
"成本"
;
}
else
if
(
supplementType
.
equals
(
"4"
))
{
supplementType
=
"招采"
;
}
else
if
(
supplementType
.
equals
(
"5"
))
{
supplementType
=
"人力"
;
}
else
if
(
supplementType
.
equals
(
"6"
))
{
supplementType
=
"物业"
;
}
else
if
(
supplementType
.
equals
(
"7"
))
{
supplementType
=
"投诉"
;
}
}
else
{
supplementType
=
""
;
}
report
.
setSupplementType
(
supplementType
);
String
typeStr
=
""
;
String
[]
types
=
report
.
getSupplementType
().
split
(
","
);
for
(
String
value
:
types
)
{
if
(
value
.
equals
(
"1"
))
{
value
=
"营销"
;
}
else
if
(
value
.
equals
(
"2"
))
{
value
=
"工程"
;
}
else
if
(
value
.
equals
(
"3"
))
{
value
=
"成本"
;
}
else
if
(
value
.
equals
(
"4"
))
{
value
=
"招采"
;
}
else
if
(
value
.
equals
(
"5"
))
{
value
=
"人力"
;
}
else
if
(
value
.
equals
(
"6"
))
{
value
=
"物业"
;
}
else
if
(
value
.
equals
(
"7"
))
{
value
=
"投诉"
;
}
typeStr
=
typeStr
+
value
+
","
;
}
report
.
setSupplementType
(
typeStr
.
substring
(
0
,
typeStr
.
length
()-
1
));
// if (StringUtils.isNotBlank(supplementType)) {
// if (supplementType.equals("1")) {
// supplementType = "营销";
// } else if (supplementType.equals("2")) {
// supplementType = "工程";
// } else if (supplementType.equals("3")) {
// supplementType = "成本";
// } else if (supplementType.equals("4")) {
// supplementType = "招采";
// } else if (supplementType.equals("5")) {
// supplementType = "人力";
// } else if (supplementType.equals("6")) {
// supplementType = "物业";
// } else if (supplementType.equals("7")) {
// supplementType = "投诉";
// }
// }else{
// supplementType = "";
// }
// report.setSupplementType(supplementType);
String
reportStatus
=
report
.
getReportStatus
();
if
(
StringUtils
.
isNotBlank
(
reportStatus
))
{
if
(
reportStatus
.
equals
(
"0"
))
{
...
...
src/main/java/com/ejweb/modules/report/web/ReportController.java
View file @
dadf708f
...
...
@@ -80,6 +80,43 @@ public class ReportController extends BaseController {
}
Page
<
ReportEntity
>
page
=
reportService
.
findPage
(
new
Page
<
ReportEntity
>(
request
,
response
),
reportEntity
);
List
<
ReportEntity
>
reportlist
=
page
.
getList
();
for
(
ReportEntity
report
:
reportlist
){
String
typeStr
=
""
;
if
(
StringUtils
.
isNoneBlank
(
report
.
getSupplementType
()))
{
String
[]
types
=
report
.
getSupplementType
().
split
(
","
);
for
(
String
value
:
types
)
{
if
(
value
.
equals
(
"1"
))
{
value
=
"营销"
;
}
else
if
(
value
.
equals
(
"2"
))
{
value
=
"工程"
;
}
else
if
(
value
.
equals
(
"3"
))
{
value
=
"成本"
;
}
else
if
(
value
.
equals
(
"4"
))
{
value
=
"招采"
;
}
else
if
(
value
.
equals
(
"5"
))
{
value
=
"人力"
;
}
else
if
(
value
.
equals
(
"6"
))
{
value
=
"物业"
;
}
else
if
(
value
.
equals
(
"7"
))
{
value
=
"投诉"
;
}
else
if
(
value
.
equals
(
"8"
))
{
value
=
"行政"
;
}
else
if
(
value
.
equals
(
"9"
))
{
value
=
"财务"
;
}
else
if
(
value
.
equals
(
"10"
))
{
value
=
"商业管理"
;
}
else
if
(
value
.
equals
(
"11"
))
{
value
=
"研发"
;
}
else
if
(
value
.
equals
(
"12"
))
{
value
=
"投资开发"
;
}
typeStr
=
typeStr
+
value
+
","
;
}
report
.
setSupplementType
(
typeStr
.
substring
(
0
,
typeStr
.
length
()-
1
));
}
}
page
.
setList
(
reportlist
);
model
.
addAttribute
(
"page"
,
page
);
model
.
addAttribute
(
"report"
,
reportEntity
);
model
.
addAttribute
(
"flag"
,
flag
);
...
...
@@ -129,6 +166,17 @@ public class ReportController extends BaseController {
ReportAttachmentEntity
reportAttachment
=
new
ReportAttachmentEntity
();
reportAttachment
.
setReportId
(
reportEntity
.
getId
());
reportAttachment
.
setAttachmentType
(
"0"
);
String
supplementType
=
""
;
String
[]
supplementTypes
={
"营销"
,
"工程"
,
"成本"
,
"招采"
,
"人力"
,
"物业"
,
"投诉"
,
"行政"
,
"财务"
,
"商业管理"
,
"研发"
,
"投资开发"
};
String
typeNumber
[]=
reportEntity
.
getSupplementType
().
split
(
","
);
for
(
int
i
=
0
;
i
<
typeNumber
.
length
;
i
++)
{
supplementType
+=
supplementTypes
[
Integer
.
valueOf
(
typeNumber
[
i
])-
1
]+
","
;
}
supplementType
=
supplementType
.
substring
(
0
,
supplementType
.
length
()-
1
);
reportEntity
.
setSupplementType
(
supplementType
);
List
<
ReportAttachmentEntity
>
reportAttachmentList
=
reportService
.
getAttachmentInfo
(
reportAttachment
);
//获取补充提交文件列表
ReportAttachmentEntity
supplementAttachment
=
new
ReportAttachmentEntity
();
...
...
@@ -144,6 +192,7 @@ public class ReportController extends BaseController {
model
.
addAttribute
(
"reportAttachmentList"
,
reportAttachmentList
);
model
.
addAttribute
(
"supplementAttachmentList"
,
supplementAttachmentList
);
model
.
addAttribute
(
"dealAttachmentList"
,
dealAttachmentList
);
return
"modules/report/reportDetail"
;
}
...
...
src/main/java/com/ejweb/modules/report/web/ReportToWordController.java
View file @
dadf708f
...
...
@@ -59,6 +59,7 @@ public class ReportToWordController {
}
FileOutputStream
out
=
new
FileOutputStream
(
GConstants
.
FILE_UPLOAD_DIR
+
"pdf/"
+
reportProjectTitle
+
"_"
+
reportEntity
.
getId
()+
".docx"
);
// FileOutputStream out = new FileOutputStream("D:/1.docx");
// FileOutputStream out = new FileOutputStream("C:/1.docx");
//添加标题
XWPFParagraph
titleParagraph
=
document
.
createParagraph
();
//设置段落居中
...
...
@@ -243,25 +244,49 @@ public class ReportToWordController {
XWPFTableRow
supplementType
=
supplementInfoTable
.
createRow
();
supplementType
.
getCell
(
0
).
setText
(
"业务类型:"
);
String
supplement_type
=
reportEntity
.
getSupplementType
();
String
[]
types
=
supplement_type
.
split
(
","
);
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
=
"投诉"
;
String
typeStr
=
""
;
for
(
String
value
:
types
)
{
if
(
value
.
equals
(
"1"
))
{
value
=
"营销"
;
}
else
if
(
value
.
equals
(
"2"
))
{
value
=
"工程"
;
}
else
if
(
value
.
equals
(
"3"
))
{
value
=
"成本"
;
}
else
if
(
value
.
equals
(
"4"
))
{
value
=
"招采"
;
}
else
if
(
value
.
equals
(
"5"
))
{
value
=
"人力"
;
}
else
if
(
value
.
equals
(
"6"
))
{
value
=
"物业"
;
}
else
if
(
value
.
equals
(
"7"
))
{
value
=
"投诉"
;
}
}
else
{
supplement_type
=
""
;
typeStr
=
typeStr
+
value
+
","
;
supplement_type
=
typeStr
.
substring
(
0
,
typeStr
.
length
()-
1
);
}
// 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
();
...
...
src/main/resources/jdbc.properties
View file @
dadf708f
#MySQL Database Config(The All Config Is Must)
db.table.prefix
=
sunac_
#
jdbc.type=mysql
#
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.type
=
oracle
jdbc.driver.class
=
oracle.jdbc.driver.OracleDriver
jdbc.url
=
jdbc:oracle:thin:@192.168.2.53:1521:eas
jdbc.username
=
eas7531
jdbc.password
=
sunac
jdbc.type
=
mysql
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.type=oracle
#
jdbc.driver.class=oracle.jdbc.driver.OracleDriver
#
jdbc.url=jdbc:oracle:thin:@192.168.2.53:1521:eas
#
jdbc.username=eas7531
#
jdbc.password=sunac
#初始化连接
jdbc.initialSize
=
0
...
...
src/main/resources/mappings/modules/report/ReportDao.xml
View file @
dadf708f
...
...
@@ -87,7 +87,10 @@
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{reportPersonTel}, '%')
</if>
</if>
<if
test=
"supplementType != null and supplementType != ''"
>
AND r.supplement_type = #{supplementType}
AND r.supplement_type LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{supplementType}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{supplementType}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{supplementType}, '%')
</if>
</if>
<if
test=
"dealResult != null and dealResult != ''"
>
AND r.deal_result = #{dealResult}
...
...
src/main/webapp/WEB-INF/views/modules/report/reportDetail.jsp
View file @
dadf708f
...
...
@@ -190,7 +190,14 @@
<div
class=
"control-group"
>
<label
class=
"control-label"
>
业务类型:
</label>
<div
class=
"controls"
>
<form:input
id=
"supplementType"
path=
"supplementType"
htmlEscape=
"false"
maxlength=
"200"
class=
"input-xlarge required"
/>
<
%
--
<
form:input
id=
"supplementType"
items=
"split(${report.supplementType},',')"
path=
"supplementType"
--
%
>
<
%
--htmlEscape=
"false"
maxlength=
"200"
class=
"input-xlarge required"
/>
--%>
<c:forEach
items=
"${report.supplementType}"
var=
"Type"
>
<form:input
id=
"supplementType"
path=
"supplementType"
htmlEscape=
"false"
maxlength=
"200"
class=
"input-xlarge required"
/>
</c:forEach>
</div>
</div>
<div
class=
"control-group"
>
...
...
src/main/webapp/WEB-INF/views/modules/report/reportList.jsp
View file @
dadf708f
...
...
@@ -138,15 +138,7 @@
<tr>
<td>
${vs.count}
</td>
<td>
${report.supplementTitle}
</td>
<td>
<c:if
test=
"${report.supplementType eq '1'}"
>
营销
</c:if>
<c:if
test=
"${report.supplementType eq '2'}"
>
工程
</c:if>
<c:if
test=
"${report.supplementType eq '3'}"
>
成本
</c:if>
<c:if
test=
"${report.supplementType eq '4'}"
>
招采
</c:if>
<c:if
test=
"${report.supplementType eq '5'}"
>
人力
</c:if>
<c:if
test=
"${report.supplementType eq '6'}"
>
物业
</c:if>
<c:if
test=
"${report.supplementType eq '7'}"
>
投诉
</c:if>
</td>
<td>
${report.supplementType}
</td>
<td>
${report.reportProject}
</td>
<td>
${report.reportPersonName}
</td>
<td>
${report.reportPersonTel}
</td>
...
...
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
View file @
dadf708f
<
%@
taglib
prefix=
"from"
uri=
"http://www.springframework.org/tags/form"
%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/WEB-INF/views/include/taglib.jsp"
%
>
<html>
...
...
@@ -105,23 +106,24 @@
path
+=
"标题:${report.supplementTitle}</br>"
;
path
+=
"被举报公司:${report.supplementCompany}</br>"
;
path
+=
"被举报部门:${report.supplementDepartment}</br>"
;
var
supplementType
=
"${report.supplementType}"
;
if
(
supplementType
==
"1"
){
supplementType
=
"营销"
;
}
else
if
(
supplementType
==
"2"
){
supplementType
=
"工程"
;
}
else
if
(
supplementType
==
"3"
){
supplementType
=
"成本"
;
}
else
if
(
supplementType
==
"4"
){
supplementType
=
"招采"
;
}
else
if
(
supplementType
==
"5"
){
supplementType
=
"人力"
;
}
else
if
(
supplementType
==
"6"
){
supplementType
=
"物业"
;
}
else
if
(
supplementType
==
"7"
){
supplementType
=
"投诉"
;
}
path
+=
"业务类型:"
+
supplementType
+
"</br>"
;
//12:01注
<%--
var
supplementType
=
"${report.supplementType}"
;
--%>
<%--
if
(
supplementType
==
"1"
){
--%>
<%--
supplementType
=
"营销"
;
--%>
<%--
}
else
if
(
supplementType
==
"2"
){
--%>
<%--
supplementType
=
"工程"
;
--%>
<%--
}
else
if
(
supplementType
==
"3"
){
--%>
<%--
supplementType
=
"成本"
;
--%>
<%--
}
else
if
(
supplementType
==
"4"
){
--%>
<%--
supplementType
=
"招采"
;
--%>
<%--
}
else
if
(
supplementType
==
"5"
){
--%>
<%--
supplementType
=
"人力"
;
--%>
<%--
}
else
if
(
supplementType
==
"6"
){
--%>
<%--
supplementType
=
"物业"
;
--%>
<%--
}
else
if
(
supplementType
==
"7"
){
--%>
<%--
supplementType
=
"投诉"
;
--%>
<%--
}
--%>
// path += "业务类型:"+supplementType+"
<
/br>"
;
var
supplementArea
=
"${report.supplementArea}"
;
if
(
supplementArea
==
"North China"
){
supplementArea
=
"华北区域公司"
;
...
...
@@ -154,8 +156,16 @@
console
.
log
(
path
);
window
.
location
.
href
=
path
;
});
var
checkedNumber
=
"${report.supplementType}"
;
var
number
=
checkedNumber
.
split
(
","
);
var
ck
=
document
.
getElementsByName
(
"supplementType"
);
for
(
var
i
=
0
;
i
<
number
.
length
;
i
++
)
{
ck
[
number
[
i
]
-
1
].
checked
=
true
;
}
});
</script>
<style
type=
"text/css"
>
.title
{
...
...
@@ -232,11 +242,14 @@
<div
class=
"control-group"
>
<label
class=
"control-label"
>
业务类型:
</label>
<div
class=
"controls"
>
<form:select
id=
"supplementType"
path=
"supplementType"
class=
"input-small required"
>
<form:option
value=
" "
>
请选择
</form:option>
<form:options
items=
"${fns:getDictList('supplement_type')}"
itemLabel=
"label"
itemValue=
"value"
htmlEscape=
"false"
/></form:select>
<span
class=
"help-inline"
><font
color=
"red"
>
*
</font>
</span>
<span
class=
"supplementType"
>
<form:checkboxes
path=
"supplementType"
items=
"${fns:getDictList('supplement_type')}"
itemLabel=
"label"
itemValue=
"value"
/>
</span>
<
%
--
<
form:select
id=
"supplementType"
path=
"supplementType"
class=
"input-small required"
>
--%>
<
%
--
<
form:option
value=
" "
>
请选择
</form:option>
--%>
<
%
--
<
form:options
items=
"${fns:getDictList('supplement_type')}"
itemLabel=
"label"
itemValue=
"value"
--
%
>
<
%
--htmlEscape=
"false"
/></form:select>
--%>
<
%
--
<
span
class=
"help-inline"
><font
color=
"red"
>
*
</font>
</span>
--%>
</div>
</div>
<div
class=
"control-group"
>
...
...
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