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
3f339e50
Commit
3f339e50
authored
Sep 11, 2017
by
Java-聂换换
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
举报
parent
d9aafc3f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
FrontReportDao.java
src/main/java/com/ejweb/modules/front/report/dao/FrontReportDao.java
+4
-0
FrontReportService.java
src/main/java/com/ejweb/modules/front/report/service/FrontReportService.java
+16
-0
FrontReportDao.xml
src/main/resources/mappings/modules/front/report/FrontReportDao.xml
+10
-0
No files found.
src/main/java/com/ejweb/modules/front/report/dao/FrontReportDao.java
View file @
3f339e50
...
@@ -5,6 +5,7 @@ import com.ejweb.core.persistence.annotation.MyBatisDao;
...
@@ -5,6 +5,7 @@ import com.ejweb.core.persistence.annotation.MyBatisDao;
import
com.ejweb.modules.front.report.bean.FrontReportBean
;
import
com.ejweb.modules.front.report.bean.FrontReportBean
;
import
com.ejweb.modules.front.report.bean.ReportAttachmentBean
;
import
com.ejweb.modules.front.report.bean.ReportAttachmentBean
;
import
com.ejweb.modules.front.report.entity.FrontReportEntity
;
import
com.ejweb.modules.front.report.entity.FrontReportEntity
;
import
com.ejweb.modules.sys.entity.User
;
/**
/**
* Created by lenovo on 2017/9/8.
* Created by lenovo on 2017/9/8.
...
@@ -18,5 +19,8 @@ public interface FrontReportDao extends CrudDao<FrontReportEntity> {
...
@@ -18,5 +19,8 @@ public interface FrontReportDao extends CrudDao<FrontReportEntity> {
// 添加举报附件
// 添加举报附件
public
Integer
insertReportAttachment
(
ReportAttachmentBean
bean
);
public
Integer
insertReportAttachment
(
ReportAttachmentBean
bean
);
// 查找管理员
public
User
getUser
();
}
}
src/main/java/com/ejweb/modules/front/report/service/FrontReportService.java
View file @
3f339e50
...
@@ -4,14 +4,17 @@ import com.ejweb.conf.ErrorCode;
...
@@ -4,14 +4,17 @@ import com.ejweb.conf.ErrorCode;
import
com.ejweb.conf.GConstants
;
import
com.ejweb.conf.GConstants
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.utils.DateUtils
;
import
com.ejweb.core.utils.IdWorker
;
import
com.ejweb.core.utils.IdWorker
;
import
com.ejweb.modules.front.report.bean.FrontReportBean
;
import
com.ejweb.modules.front.report.bean.FrontReportBean
;
import
com.ejweb.modules.front.report.bean.ReportAttachmentBean
;
import
com.ejweb.modules.front.report.bean.ReportAttachmentBean
;
import
com.ejweb.modules.front.report.dao.FrontReportDao
;
import
com.ejweb.modules.front.report.dao.FrontReportDao
;
import
com.ejweb.modules.front.report.entity.FrontReportEntity
;
import
com.ejweb.modules.front.report.entity.FrontReportEntity
;
import
com.ejweb.modules.sys.entity.User
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -28,6 +31,19 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
...
@@ -28,6 +31,19 @@ public class FrontReportService extends CrudService<FrontReportDao,FrontReportEn
public
ResponseBean
addReport
(
FrontReportBean
bean
){
public
ResponseBean
addReport
(
FrontReportBean
bean
){
ResponseBean
responseBean
=
new
ResponseBean
();
ResponseBean
responseBean
=
new
ResponseBean
();
bean
.
setId
(
IdWorker
.
getNextId
(
"R"
));
bean
.
setId
(
IdWorker
.
getNextId
(
"R"
));
bean
.
setReportTime
(
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
// 现在写的是微信公众号,可能不是这个
bean
.
setReportSource
(
"wechat"
);
bean
.
setReportStatus
(
"0"
);
// 查询管理员
User
user
=
dao
.
getUser
();
if
(
user
!=
null
){
bean
.
setExchangeBeforeUser
(
user
.
getId
());
}
//
// bean.setExchangeBeforeUser("");
// 添加举报信息表
// 添加举报信息表
int
row
=
dao
.
insertReport
(
bean
);
int
row
=
dao
.
insertReport
(
bean
);
if
(
row
==
1
){
// 添加成功
if
(
row
==
1
){
// 添加成功
...
...
src/main/resources/mappings/modules/front/report/FrontReportDao.xml
View file @
3f339e50
...
@@ -85,4 +85,13 @@
...
@@ -85,4 +85,13 @@
)
)
</insert>
</insert>
<select
id=
"getUser"
resultType=
"com.ejweb.modules.sys.entity.User"
>
SELECT u.id
FROM sys_user u
LEFT JOIN sys_user2role u2r ON u2r.user_id = u.id
LEFT JOIN sys_role r ON r.id = u2r.role_id
WHERE r.enname = 'admin'
limit 1
</select>
</mapper>
</mapper>
\ No newline at end of file
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