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
2ad2f8c6
Commit
2ad2f8c6
authored
Sep 19, 2017
by
Java-李昕颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加消息
parent
af728ff7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
232 additions
and
15 deletions
+232
-15
ReportDao.java
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
+32
-4
ReportExchangeHistory.java
src/main/java/com/ejweb/modules/report/entity/ReportExchangeHistory.java
+49
-0
ReportService.java
src/main/java/com/ejweb/modules/report/service/ReportService.java
+64
-9
ReportController.java
src/main/java/com/ejweb/modules/report/web/ReportController.java
+7
-1
ReportDao.xml
src/main/resources/mappings/modules/report/ReportDao.xml
+79
-0
reportTrack.jsp
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
+1
-1
No files found.
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
View file @
2ad2f8c6
...
@@ -4,9 +4,11 @@ import com.ejweb.core.persistence.CrudDao;
...
@@ -4,9 +4,11 @@ import com.ejweb.core.persistence.CrudDao;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.modules.report.entity.ReportAttachmentEntity
;
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.entity.ReportExchangeHistory
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.workbench.Bean.WorkbenchBean
;
import
com.ejweb.modules.workbench.Bean.WorkbenchBean
;
import
com.ejweb.modules.workbench.entity.ReportNotice
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -86,12 +88,38 @@ public interface ReportDao extends CrudDao<ReportEntity> {
...
@@ -86,12 +88,38 @@ public interface ReportDao extends CrudDao<ReportEntity> {
public
List
<
User
>
getPositionList
();
public
List
<
User
>
getPositionList
();
/**
/**
* 移交举报
* 根据reportId查询消息表中是否已存在该条记录
* @param userId
* @param reportId
* @param id
* @return
* @return
*/
*/
public
int
modifyExchangeAfterUser
(
String
userId
,
String
id
);
public
ReportNotice
findReportNotice
(
String
reportId
,
String
userId
);
/**
* 新增消息
* @param reportNotice
* @return
*/
public
int
addReportNotice
(
ReportNotice
reportNotice
);
/**
* 更新消息表
* @param reportNotice
* @return
*/
public
int
updateReportNotice
(
ReportNotice
reportNotice
);
/**
* 新增消息
* @param reportExchangeHistory
* @return
*/
public
int
addRecord
(
ReportExchangeHistory
reportExchangeHistory
);
/**
* 查询管理员ID
* @return
*/
public
String
findAdmin
();
/**
/**
* 举报状态数据
* 举报状态数据
...
...
src/main/java/com/ejweb/modules/report/entity/ReportExchangeHistory.java
0 → 100644
View file @
2ad2f8c6
package
com
.
ejweb
.
modules
.
report
.
entity
;
public
class
ReportExchangeHistory
{
private
String
id
;
private
String
oldUserId
;
private
String
newUserId
;
private
String
exchangeType
;
private
String
exchangeTime
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getOldUserId
()
{
return
oldUserId
;
}
public
void
setOldUserId
(
String
oldUserId
)
{
this
.
oldUserId
=
oldUserId
;
}
public
String
getNewUserId
()
{
return
newUserId
;
}
public
void
setNewUserId
(
String
newUserId
)
{
this
.
newUserId
=
newUserId
;
}
public
String
getExchangeType
()
{
return
exchangeType
;
}
public
void
setExchangeType
(
String
exchangeType
)
{
this
.
exchangeType
=
exchangeType
;
}
public
String
getExchangeTime
()
{
return
exchangeTime
;
}
public
void
setExchangeTime
(
String
exchangeTime
)
{
this
.
exchangeTime
=
exchangeTime
;
}
}
src/main/java/com/ejweb/modules/report/service/ReportService.java
View file @
2ad2f8c6
...
@@ -7,9 +7,11 @@ import com.ejweb.core.utils.StringUtils;
...
@@ -7,9 +7,11 @@ import com.ejweb.core.utils.StringUtils;
import
com.ejweb.modules.report.dao.ReportDao
;
import
com.ejweb.modules.report.dao.ReportDao
;
import
com.ejweb.modules.report.entity.ReportAttachmentEntity
;
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.entity.ReportExchangeHistory
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.sys.utils.UserUtils
;
import
com.ejweb.modules.sys.utils.UserUtils
;
import
com.ejweb.modules.workbench.entity.ReportNotice
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -18,6 +20,7 @@ import java.io.File;
...
@@ -18,6 +20,7 @@ import java.io.File;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -214,15 +217,67 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
...
@@ -214,15 +217,67 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
}
}
/**
/**
* 移交后发送消息
* 管理员移交后发送消息
* @param reportId
* @param reportEntity
* @param supplementTitle
* @return
*/
@Transactional
(
readOnly
=
false
)
public
void
addNotice
(
ReportEntity
reportEntity
,
String
flag
){
User
user
=
UserUtils
.
getUser
();
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
ReportNotice
reportNotice
=
reportDao
.
findReportNotice
(
reportEntity
.
getId
(),
user
.
getId
());
if
(
reportNotice
!=
null
){
//消息表中已存在该条举报的移交信息
if
(
StringUtils
.
isNotBlank
(
user
.
getId
())){
reportNotice
.
setUpdateBy
(
user
.
getId
());
}
reportNotice
.
setUpdateDate
(
date
);
String
sendTime
=
sdf
.
format
(
date
);
reportNotice
.
setSendTime
(
sendTime
);
reportNotice
.
setSendFromId
(
user
.
getId
());
reportNotice
.
setSendToId
(
reportEntity
.
getExchangeAfterUser
());
reportNotice
.
setStatus
(
"0"
);
reportDao
.
updateReportNotice
(
reportNotice
);
}
else
{
reportNotice
.
setId
(
IdGen
.
uuid
());
reportNotice
.
setReportId
(
reportEntity
.
getId
());
if
(
flag
.
equals
(
"answer"
)){
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy年MM月dd日"
);
String
dateStr
=
sdf1
.
format
(
date
);
reportNotice
.
setTitle
(
"“"
+
reportEntity
.
getSupplementTitle
()+
"”已由"
+
user
.
getName
()+
"于"
+
dateStr
+
"处理完成"
);
reportNotice
.
setSendToId
(
reportDao
.
findAdmin
());
}
else
{
reportNotice
.
setTitle
(
"请处理-“"
+
reportEntity
.
getSupplementTitle
()+
"”"
);
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
);
}
}
/**
* 新增移交记录
* @param reportEntity
* @return
* @return
*/
*/
// @Transactional(readOnly = false)
@Transactional
(
readOnly
=
false
)
// public int addNotice(String reportId,String supplementTitle){
public
void
addRecord
(
ReportEntity
reportEntity
,
String
exchangeType
){
//
ReportExchangeHistory
reportExchangeHistory
=
new
ReportExchangeHistory
();
// if ()
reportExchangeHistory
.
setId
(
IdGen
.
uuid
());
// return reportDao.modifyExchangeAfterUser(userId,id);
reportExchangeHistory
.
setOldUserId
(
reportEntity
.
getExchangeBeforeUser
());
// }
reportExchangeHistory
.
setNewUserId
(
reportEntity
.
getExchangeAfterUser
());
reportExchangeHistory
.
setExchangeType
(
exchangeType
);
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
reportExchangeHistory
.
setExchangeTime
(
sdf
.
format
(
date
));
reportDao
.
addRecord
(
reportExchangeHistory
);
}
}
}
src/main/java/com/ejweb/modules/report/web/ReportController.java
View file @
2ad2f8c6
...
@@ -185,6 +185,13 @@ public class ReportController extends BaseController {
...
@@ -185,6 +185,13 @@ public class ReportController extends BaseController {
return
form
(
reportEntity
,
model
);
return
form
(
reportEntity
,
model
);
}
}
reportService
.
saveTrack
(
reportEntity
);
reportService
.
saveTrack
(
reportEntity
);
if
(
StringUtils
.
isNotBlank
(
reportEntity
.
getExchangeAfterUser
())){
reportService
.
addNotice
(
reportEntity
,
"transger"
);
reportService
.
addRecord
(
reportEntity
,
"1"
);
}
if
(
StringUtils
.
isNotBlank
(
reportEntity
.
getDealResult
())){
reportService
.
addNotice
(
reportEntity
,
"answer"
);
}
addMessage
(
redirectAttributes
,
"补充举报"
+
reportEntity
.
getSupplementTitle
()
+
"'成功"
);
addMessage
(
redirectAttributes
,
"补充举报"
+
reportEntity
.
getSupplementTitle
()
+
"'成功"
);
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
}
}
...
@@ -244,7 +251,6 @@ public class ReportController extends BaseController {
...
@@ -244,7 +251,6 @@ public class ReportController extends BaseController {
response
.
setContentType
(
"application/json;charset=utf-8"
);
response
.
setContentType
(
"application/json;charset=utf-8"
);
out
.
write
(
html
.
toString
());
out
.
write
(
html
.
toString
());
out
.
close
();
out
.
close
();
}
}
}
}
src/main/resources/mappings/modules/report/ReportDao.xml
View file @
2ad2f8c6
...
@@ -277,6 +277,85 @@
...
@@ -277,6 +277,85 @@
FROM sys_position
FROM sys_position
</select>
</select>
<insert
id=
"addReportNotice"
>
INSERT INTO report_notice(
id,
report_id,
title,
send_time,
send_from_id,
send_to_id,
status,
create_by,
create_date,
update_by,
update_date
) VALUES (
#{id},
#{reportId},
#{title},
#{sendTime},
#{sendFromId},
#{sendToId},
#{status},
#{createBy},
#{createDate},
#{updateBy},
#{updateDate}
)
</insert>
<update
id=
"updateReportNotice"
>
UPDATE report_notice SET
id = #{id},
report_id = #{reportId},
title = #{title},
send_time = #{sendTime},
send_from_id = #{sendFromId},
send_to_id = #{sendToId},
status = #{status},
create_by = #{createBy},
create_date = #{createDate},
update_by = #{updateBy},
update_date = #{updateDate}
WHERE report_id = #{reportId}
</update>
<select
id=
"findReportNotice"
resultType=
"ReportNotice"
>
SELECT
*
FROM report_notice
WHERE report_id = #{reportId}
AND send_from_id = #{userId}
</select>
<select
id=
"findAdmin"
resultType=
"String"
>
SELECT
su.id
FROM
sys_user su
LEFT JOIN sys_user2role sur ON su.id = sur.user_id
LEFT JOIN sys_role sr ON sr.id = sur.role_id
WHERE
sr.`name` = '系统管理员'
</select>
<insert
id=
"addRecord"
>
INSERT INTO report_exchange_history(
id,
old_user_id,
new_user_id,
exchange_type,
exchange_time
) VALUES (
#{id},
#{oldUserId},
#{newUserId},
#{exchangeType},
#{exchangeTime}
)
</insert>
<select
id=
"getReportStatus"
parameterType=
"com.ejweb.modules.workbench.Bean.WorkbenchBean"
resultType=
"java.util.HashMap"
>
<select
id=
"getReportStatus"
parameterType=
"com.ejweb.modules.workbench.Bean.WorkbenchBean"
resultType=
"java.util.HashMap"
>
select report_status,COUNT(report_status)
select report_status,COUNT(report_status)
FROM report
FROM report
...
...
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
View file @
2ad2f8c6
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
<div
class=
"control-group"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
>
移交:
</label>
<label
class=
"control-label"
>
移交:
</label>
<div
class=
"controls"
>
<div
class=
"controls"
>
<form:hidden
id=
"userId"
path=
"exchangeAfterUser"
/>
<form:hidden
id=
"userId"
path=
"exchangeAfterUser"
value=
""
/>
<input
id=
"chooseUser"
type=
"text"
value=
"选择移交人员"
htmlEscape=
"false"
maxlength=
"200"
class=
"input-xlarge"
/>
<input
id=
"chooseUser"
type=
"text"
value=
"选择移交人员"
htmlEscape=
"false"
maxlength=
"200"
class=
"input-xlarge"
/>
</div>
</div>
</div>
</div>
...
...
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