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
6c2d4e1a
Commit
6c2d4e1a
authored
Sep 15, 2017
by
Java-李昕颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
举报移交
parent
5663def1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
333 additions
and
14 deletions
+333
-14
ReportDao.java
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
+34
-0
ReportService.java
src/main/java/com/ejweb/modules/report/service/ReportService.java
+50
-0
ReportController.java
src/main/java/com/ejweb/modules/report/web/ReportController.java
+38
-0
User.java
src/main/java/com/ejweb/modules/sys/entity/User.java
+12
-1
ReportDao.xml
src/main/resources/mappings/modules/report/ReportDao.xml
+76
-9
reportTrack.jsp
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
+13
-4
reportTransfer.jsp
src/main/webapp/WEB-INF/views/modules/report/reportTransfer.jsp
+110
-0
No files found.
src/main/java/com/ejweb/modules/report/dao/ReportDao.java
View file @
6c2d4e1a
...
...
@@ -4,6 +4,7 @@ import com.ejweb.core.persistence.CrudDao;
import
com.ejweb.core.persistence.annotation.MyBatisDao
;
import
com.ejweb.modules.report.entity.ReportAttachmentEntity
;
import
com.ejweb.modules.report.entity.ReportEntity
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.User
;
import
java.util.List
;
...
...
@@ -56,4 +57,37 @@ public interface ReportDao extends CrudDao<ReportEntity> {
* @return
*/
public
int
updateReportStatus
(
ReportEntity
reportEntity
);
/**
* 查询用户
* @param user
* @return
*/
public
List
<
User
>
findUser
(
User
user
);
/**
* 查询公司列表
* @return
*/
public
List
<
Office
>
getCompanyList
();
/**
* 查询部门列表
* @return
*/
public
List
<
Office
>
getOfficeList
();
/**
* 查询职位列表
* @return
*/
public
List
<
User
>
getPositionList
();
/**
* 移交举报
* @param userId
* @param id
* @return
*/
public
int
modifyExchangeAfterUser
(
String
userId
,
String
id
);
}
src/main/java/com/ejweb/modules/report/service/ReportService.java
View file @
6c2d4e1a
package
com
.
ejweb
.
modules
.
report
.
service
;
import
com.ejweb.core.persistence.Page
;
import
com.ejweb.core.service.CrudService
;
import
com.ejweb.core.utils.IdGen
;
import
com.ejweb.core.utils.StringUtils
;
import
com.ejweb.modules.report.dao.ReportDao
;
import
com.ejweb.modules.report.entity.ReportAttachmentEntity
;
import
com.ejweb.modules.report.entity.ReportEntity
;
import
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.sys.utils.UserUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -16,7 +18,9 @@ import java.io.File;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* 举报Service
...
...
@@ -173,4 +177,50 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
return
null
;
}
}
/**
* 查询用户
* @param user
* @return
*/
public
Page
<
User
>
findUserPage
(
Page
<
User
>
page
,
User
user
){
user
.
setPage
(
page
);
page
.
setList
(
reportDao
.
findUser
(
user
));
return
page
;
}
/**
* 查询公司列表
* @return
*/
public
List
<
Office
>
getCompanyList
(){
return
reportDao
.
getCompanyList
();
}
/**
* 查询部门列表
* @return
*/
public
List
<
Office
>
getOfficeList
(){
return
reportDao
.
getOfficeList
();
}
/**
* 查询职位列表
* @return
*/
public
List
<
User
>
getPositionList
(){
return
reportDao
.
getPositionList
();
}
/**
* 移交举报
* @param userId
* @param id
* @return
*/
@Transactional
(
readOnly
=
false
)
public
int
modifyExchangeAfterUser
(
String
userId
,
String
id
){
return
reportDao
.
modifyExchangeAfterUser
(
userId
,
id
);
}
}
src/main/java/com/ejweb/modules/report/web/ReportController.java
View file @
6c2d4e1a
...
...
@@ -6,6 +6,7 @@ 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
com.ejweb.modules.sys.entity.Office
;
import
com.ejweb.modules.sys.entity.User
;
import
com.ejweb.modules.sys.utils.UserUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
...
@@ -173,4 +174,41 @@ public class ReportController extends BaseController {
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
}
/**
* 移交列表
*
* @param user
* @param model
* @param request
* @param response
* @return
*/
@RequestMapping
(
value
=
"viewTransfer"
)
public
String
viewTransfer
(
ReportEntity
reportEntity
,
User
user
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Page
<
User
>
page
=
reportService
.
findUserPage
(
new
Page
<
User
>(
request
,
response
),
user
);
List
<
Office
>
companyList
=
reportService
.
getCompanyList
();
List
<
Office
>
officeList
=
reportService
.
getOfficeList
();
List
<
User
>
positionList
=
reportService
.
getPositionList
();
model
.
addAttribute
(
"page"
,
page
);
model
.
addAttribute
(
"companyList"
,
companyList
);
model
.
addAttribute
(
"officeList"
,
officeList
);
model
.
addAttribute
(
"positionList"
,
positionList
);
model
.
addAttribute
(
"User"
,
user
);
model
.
addAttribute
(
"report"
,
reportEntity
);
return
"modules/report/reportTransfer"
;
}
/**
* 移交操作
*
* @param userId
* @param model
* @return
*/
@RequestMapping
(
value
=
"transfer"
)
public
String
transfer
(
ReportEntity
reportEntity
,
String
userId
,
Model
model
,
RedirectAttributes
redirectAttributes
)
{
reportService
.
modifyExchangeAfterUser
(
userId
,
reportEntity
.
getId
());
addMessage
(
redirectAttributes
,
"移交举报"
+
reportEntity
.
getReportProject
()
+
"'成功"
);
return
"redirect:"
+
adminPath
+
"/report/list/?repage&flag=0"
;
}
}
src/main/java/com/ejweb/modules/sys/entity/User.java
View file @
6c2d4e1a
...
...
@@ -52,6 +52,9 @@ public class User extends DataEntity<User> {
private
List
<
Role
>
roleList
=
Lists
.
newArrayList
();
// 拥有角色列表
private
String
positionName
;
//职位
public
User
()
{
super
();
this
.
loginFlag
=
GConstants
.
YES
;
...
...
@@ -307,7 +310,15 @@ public class User extends DataEntity<User> {
roleList
.
add
(
role
);
}
}
public
String
getPositionName
()
{
return
positionName
;
}
public
void
setPositionName
(
String
positionName
)
{
this
.
positionName
=
positionName
;
}
/**
* 用户拥有的角色名称字符串, 多个角色名称用','分隔.
*/
...
...
src/main/resources/mappings/modules/report/ReportDao.xml
View file @
6c2d4e1a
...
...
@@ -198,7 +198,7 @@
update_by = #{updateBy.id},
update_date = #{updateDate}
WHERE id = #{id}
</update>
</update>
<update
id=
"updateReportStatus"
>
UPDATE report SET
...
...
@@ -206,13 +206,79 @@
WHERE id = #{id}
</update>
<update
id=
"delete"
>
UPDATE sys_area SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%,'+#{id}+',%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%,', #{id}, ',%')
</if>
</update>
<select
id=
"findUser"
parameterType=
"User"
resultType=
"User"
>
SELECT
su.id AS "id",
su.`no` AS "no",
su.`name` AS "name",
su.mobile AS "mobile",
so1.`name` AS "company.name",
so2.`name` AS "office.name",
sp.position_name AS "positionName"
FROM sys_user su
LEFT JOIN sys_office so1 ON so1.id = su.company_id
LEFT JOIN sys_office so2 ON so2.id = su.office_id
LEFT JOIN sys_user2position sup ON sup.user_id = su.id
LEFT JOIN sys_position sp ON sp.id = sup.position_id
<where>
1 = 1
<if
test=
"no != null and no != ''"
>
AND su.no LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{no}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{no}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{no}, '%')
</if>
</if>
<if
test=
"name != null and name != ''"
>
AND su.name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{name}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{name}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{name}, '%')
</if>
</if>
<if
test=
"mobile != null and mobile != ''"
>
AND su.mobile LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{mobile}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{mobile}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%', #{mobile}, '%')
</if>
</if>
<if
test=
"company != null and company.id != null and company.id != ''"
>
AND so1.id = #{company.id}
</if>
<if
test=
"office != null and office.id != null and office.id != ''"
>
AND so2.id = #{office.id}
</if>
<if
test=
"positionName != null and positionName != ''"
>
AND sp.position_name = #{positionName}
</if>
</where>
ORDER BY su.update_date DESC
</select>
<select
id=
"getOfficeList"
resultType=
"Office"
>
SELECT
so.id AS "id",
CONCAT(so.`name`,'(',(SELECT s.`name` FROM sys_office s WHERE s.id = so.parent_id),')') AS "name"
FROM sys_office so
WHERE so.type = '2'
</select>
<select
id=
"getCompanyList"
resultType=
"Office"
>
SELECT
so.id AS "id",
so.`name` AS "name"
FROM sys_office so
WHERE so.type = '1'
</select>
<select
id=
"getPositionList"
resultType=
"User"
>
SELECT
position_name AS "positionName"
FROM sys_position
</select>
<update
id=
"modifyExchangeAfterUser"
parameterType=
"HashMap"
>
UPDATE report SET
exchange_after_user = #{0}
WHERE id = #{1}
</update>
</mapper>
\ No newline at end of file
src/main/webapp/WEB-INF/views/modules/report/reportTrack.jsp
View file @
6c2d4e1a
...
...
@@ -32,6 +32,18 @@
}
}
});
$
(
"#btnTransfer"
).
click
(
function
()
{
var
flag
=
$
{
transferFlag
};
if
(
flag
==
"1"
){
var
id
=
"${report.id}"
;
var
url
=
"${ctx}/report/viewTransfer?id="
+
id
;
window
.
open
(
url
,
'newwindow'
,
'height=600, width=800, left=300, toolbar=no, menubar=no, scrollbars=yes,resizable=yes,location=no, status=no'
);
}
});
});
</script>
<style
type=
"text/css"
>
...
...
@@ -154,14 +166,12 @@
<div
class=
"control-group"
>
<label
class=
"control-label"
>
移交:
</label>
<div
class=
"controls"
>
<input
id=
"btnTransfer"
class=
"btn btn-primary"
type=
"button"
value=
"选择移交人员"
<
c:if
test=
"${transferFlag eq '0'}"
>
disabled="true" onclick="transfer();"
</c:if>
/>
<input
id=
"btnTransfer"
class=
"btn btn-primary"
type=
"button"
value=
"选择移交人员"
/>
</div>
</div>
<div
class=
"form-actions"
>
<input
id=
"btnSubmit"
class=
"btn btn-primary"
type=
"submit"
value=
"提交"
/>
</div>
</form:form>
</body>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/views/modules/report/reportTransfer.jsp
0 → 100644
View file @
6c2d4e1a
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/WEB-INF/views/include/taglib.jsp"
%
>
<html>
<head>
<title>
举报管理
</title>
<meta
name=
"decorator"
content=
"default"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
"#btnConfirm"
).
click
(
function
()
{
var
userId
=
$
(
'input:radio:checked'
).
val
();
var
id
=
"${report.id}"
;
window
.
location
.
href
=
"${ctx}/report/transfer?id="
+
id
+
"&userId="
+
userId
;
});
$
(
"input:radio"
).
click
(
function
()
{
$
(
"input:radio"
).
attr
(
"checked"
,
false
);
$
(
"#chooseItem"
).
empty
();
$
(
this
).
attr
(
"checked"
,
true
);
$
(
"#chooseItem"
).
html
(
"已选择 "
+
$
(
"input:radio:checked"
).
parent
().
next
().
next
().
next
().
html
()
+
"<span onclick='remove();'><font size='5'> ×</font></span>"
);
});
});
function
remove
(){
$
(
"input:radio"
).
attr
(
"checked"
,
false
);
$
(
"#chooseItem"
).
empty
();
}
function
page
(
n
,
s
){
$
(
"#pageNo"
).
val
(
n
);
$
(
"#pageSize"
).
val
(
s
);
$
(
"#searchForm"
).
attr
(
"action"
,
"${ctx}/report/viewTransfer"
);
$
(
"#searchForm"
).
submit
();
return
false
;
}
function
resetPageNo
()
{
$
(
"#pageNo"
).
val
(
0
);
}
</script>
</head>
<body>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"${ctx}/report/viewTransfer"
>
选择移交人员
</a></li>
</ul>
<form:form
id=
"searchForm"
modelAttribute=
"user"
action=
"${ctx}/report/viewTransfer?id=${report.id}"
method=
"post"
class=
"breadcrumb form-search"
>
<input
id=
"pageNo"
name=
"pageNo"
type=
"hidden"
value=
"${page.pageNo}"
/>
<input
id=
"pageSize"
name=
"pageSize"
type=
"hidden"
value=
"${page.pageSize}"
/>
<ul
class=
"ul-form"
>
<li><label>
员工号:
</label><form:input
onchange=
"resetPageNo();"
path=
"no"
htmlEscape=
"false"
maxlength=
"50"
class=
"input-small"
/></li>
<li><label>
姓名:
</label><form:input
onchange=
"resetPageNo();"
path=
"name"
htmlEscape=
"false"
maxlength=
"50"
class=
"input-small"
/></li>
<li><label>
手机号:
</label><form:input
onchange=
"resetPageNo();"
path=
"mobile"
htmlEscape=
"false"
maxlength=
"50"
class=
"input-small"
/></li>
<li><label>
公司:
</label><form:select
onchange=
"resetPageNo();"
path=
"company.id"
class=
"input-small "
>
<form:option
value=
" "
>
请选择
</form:option>
<form:options
items=
"${companyList}"
itemLabel=
"name"
itemValue=
"id"
htmlEscape=
"false"
/>
</form:select></li>
<li
class=
"clearfix"
></li>
<li><label>
部门:
</label><form:select
onchange=
"resetPageNo();"
path=
"office.id"
class=
"input-small"
>
<form:option
value=
" "
>
请选择
</form:option>
<form:options
items=
"${officeList}"
itemLabel=
"name"
itemValue=
"id"
htmlEscape=
"false"
/></form:select></li>
<li><label>
职位:
</label><form:select
onchange=
"resetPageNo();"
path=
"positionName"
class=
"input-small"
>
<form:option
value=
" "
>
请选择
</form:option>
<form:options
items=
"${positionList}"
itemLabel=
"positionName"
itemValue=
"positionName"
htmlEscape=
"false"
/></form:select></li>
<li
class=
"btns"
>
<label
style=
"width:auto;"
><input
id=
"btnSubmit"
class=
"btn btn-primary"
type=
"submit"
value=
"筛选"
/>
</label>
</li>
<li
class=
"clearfix"
></li>
</ul>
</form:form>
<sys:message
content=
"${message}"
/>
<table
id=
"contentTable"
class=
"table table-striped table-bordered table-condensed"
>
<thead>
<tr>
<th>
选择
</th>
<th>
ID
</th>
<th>
员工号
</th>
<th>
姓名
</th>
<th>
手机号
</th>
<th>
所属公司
</th>
<th>
所属部门
</th>
<th>
职位
</th>
</tr>
</thead>
<tbody>
<c:if
test=
"${page.list.size()>0}"
>
<c:forEach
items=
"${page.list}"
var=
"user"
varStatus=
"vs"
>
<tr>
<td><input
type=
"radio"
value=
"${user.id}"
></td>
<td>
${vs.count}
</td>
<td>
${user.no}
</td>
<td>
${user.name}
</td>
<td>
${user.mobile}
</td>
<td>
${user.company.name}
</td>
<td>
${user.office.name}
</td>
<td>
${user.positionName}
</td>
</tr>
</c:forEach>
</c:if>
</tbody>
</table>
<span
id=
"chooseItem"
></span>
<c:if
test=
"${page.list.size()=='0'}"
>
<span
style=
"color: #999999;margin: 20px 0 70px 20px;display: block;"
>
未查询到相关内容
</span>
</c:if>
<c:if
test=
"${page.list.size()>0}"
>
<div
class=
"pagination"
>
${page}
</div>
</c:if>
<li
class=
"btns"
>
<label
style=
"width:auto;"
><input
id=
"btnConfirm"
class=
"btn btn-primary"
type=
"button"
value=
"确定"
/>
<input
id=
"btnClose"
class=
"btn btn-primary"
type=
"button"
value=
"关闭"
onclick=
"javascript:window.close();"
/></label>
</li>
</body>
</html>
\ 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