Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-shiro
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
常超
xzxt-shiro
Commits
948dfacc
Commit
948dfacc
authored
Oct 30, 2018
by
wushanyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统管理权限查询页面
parent
8d1f77f9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
98 additions
and
24 deletions
+98
-24
src/main/java/com/xzxtshiro/controller/admin/SearchController.java
+18
-10
src/main/java/com/xzxtshiro/dao/SysDictitemDao.java
+7
-0
src/main/java/com/xzxtshiro/mapper/SysDictitemMapper.xml
+17
-1
src/main/java/com/xzxtshiro/mapper/SysUserMapper.xml
+10
-4
src/main/java/com/xzxtshiro/service/SysDictitemService.java
+7
-0
src/main/java/com/xzxtshiro/service/imp/SysDictitemImpl.java
+9
-0
src/main/java/com/xzxtshiro/util/ZtreeDataUtil.java
+20
-7
src/main/webapp/WEB-INF/jsp/admin/search/search_header.jsp
+2
-1
src/main/webapp/WEB-INF/jsp/admin/search/zczlLlyList.jsp
+0
-1
src/main/webapp/WEB-INF/jsp/admin/search/zxywstfzrList.jsp
+8
-0
No files found.
src/main/java/com/xzxtshiro/controller/admin/SearchController.java
View file @
948dfacc
package
com
.
xzxtshiro
.
controller
.
admin
;
import
com.xzxtshiro.pojo.BaseModel
;
import
com.xzxtshiro.pojo.SysUser
;
import
com.xzxtshiro.pojo.TbYwZcxzLly
;
import
com.xzxtshiro.pojo.TbYwZczlLly
;
import
com.xzxtshiro.pojo.*
;
import
com.xzxtshiro.service.SearchService
;
import
com.xzxtshiro.service.SysDictitemService
;
import
com.xzxtshiro.service.SysRoleService
;
import
com.xzxtshiro.service.SysUserService
;
import
com.xzxtshiro.util.TokenUtil
;
import
com.xzxtshiro.util.ZtreeDataUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -54,7 +52,11 @@ public class SearchController {
@ResponseBody
@RequestMapping
(
value
=
"/dsxjglyList"
,
method
=
RequestMethod
.
GET
)
public
BaseModel
dsxjglyList
(
SysUser
user
){
user
=
SysUserController
.
setQueryParam
(
user
);
if
(
""
.
equals
(
user
.
getUnitcode
())
||
user
.
getUnitcode
()
==
null
)
{
//获取当前登录用户
SysUser
dlUser
=
TokenUtil
.
getUser
();
user
.
setUnitcode
(
dlUser
.
getUnitcode
().
substring
(
0
,
2
));
}
return
searchService
.
selectDsxjglyPage
(
user
);
}
...
...
@@ -76,7 +78,11 @@ public class SearchController {
@ResponseBody
@RequestMapping
(
value
=
"/zxywstfzrList"
,
method
=
RequestMethod
.
GET
)
public
BaseModel
zxywstfzrList
(
SysUser
user
)
{
user
=
SysUserController
.
setQueryParam
(
user
);
if
(
""
.
equals
(
user
.
getUnitcode
())
||
user
.
getUnitcode
()
==
null
)
{
//获取当前登录用户
SysUser
dlUser
=
TokenUtil
.
getUser
();
user
.
setUnitcode
(
dlUser
.
getUnitcode
().
substring
(
0
,
2
));
}
return
searchService
.
selectZxastfzrUserPage
(
user
);
}
...
...
@@ -86,10 +92,8 @@ public class SearchController {
*/
@RequestMapping
(
value
=
"/zczlLlyIndex"
,
method
=
RequestMethod
.
GET
)
public
String
zczlLlyIndex
(
Model
model
){
//设置unit标志,区分CODE_UNIT和CODE_XZUNIT
model
.
addAttribute
(
"flag"
,
"刑侦UNIT"
);
//获取unit字典码数据
setZtreeData
(
model
,
userService
,
dictitemService
,
roleService
);
//获取xzUnit字典码数据
setXzUnitData
(
model
,
dictitemService
);
return
"admin/search/zczlLlyList"
;
}
...
...
@@ -140,4 +144,8 @@ public class SearchController {
new
ZtreeDataUtil
().
setUnitAndRole
(
model
,
dictitemService
,
userService
,
roleService
);
}
private
static
void
setXzUnitData
(
Model
model
,
SysDictitemService
dictitemService
)
{
new
ZtreeDataUtil
().
setXzUnit
(
model
,
dictitemService
);
}
}
src/main/java/com/xzxtshiro/dao/SysDictitemDao.java
View file @
948dfacc
...
...
@@ -15,4 +15,11 @@ public interface SysDictitemDao {
*/
List
<
SysDictitem
>
selectDictitemByCondition
(
SysDictitem
dictitem
);
/**
* 查询groupid为“CODE_XZUNIT”的字典
* @param dictitem
* @return
*/
List
<
SysDictitem
>
selectDictitemByXzUnit
(
SysDictitem
dictitem
);
}
src/main/java/com/xzxtshiro/mapper/SysDictitemMapper.xml
View file @
948dfacc
...
...
@@ -146,7 +146,7 @@
</sql>
<select
id=
"selectDictitemByCondition"
resultMap=
"BaseResultMap"
parameterType=
"com.xzxtshiro.pojo.SysDictitem"
>
select
select
ID, CODE, NAME ||'['||CODE||']' as NAME, GROUPID, LEVELID, SPELL, WBZX, LRR, LRSJ, GXR, GXSJ, SIMPLE, LRDWDM,
LRDWMC, GROUPNAME, SCBZ, YYCJ1, YYCJ2, YYCJ3, YYCJ4, PID, ISPARENT, YYCJ7, YYCJ5,
YYCJ6, DESCRIPTION, ENDCODE, STARTCODE, YYCJ8, SFQYBMPDBZ, DMMCBM, GXDWDM, GXDWMC,
...
...
@@ -161,6 +161,22 @@
ORDER BY CODE
</select>
<!--单位代码 刑侦unit -->
<select
id=
"selectDictitemByXzUnit"
resultMap=
"BaseResultMap"
parameterType=
"com.xzxtshiro.pojo.SysDictitem"
>
select
ID, CODE, NAME ||'['||CODE||']' as NAME, GROUPID, LEVELID, SPELL, WBZX, LRR, LRSJ, GXR, GXSJ, SIMPLE, LRDWDM,
LRDWMC, GROUPNAME, SCBZ, YYCJ1, YYCJ2, YYCJ3, YYCJ4, PID, ISPARENT, YYCJ7, YYCJ5,
YYCJ6, DESCRIPTION, ENDCODE, STARTCODE, YYCJ8, SFQYBMPDBZ, DMMCBM, GXDWDM, GXDWMC,
GABXF
from SYS_DICTITEM
where SCBZ=0
<include
refid=
"queryWhere"
/>
AND ( PID IN (SELECT CODE FROM SYS_DICTITEM WHERE GROUPID='CODE_XZUNIT')
OR PID IS NULL
)
ORDER BY CODE
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from SYS_DICTITEM
where ID = #{id,jdbcType=VARCHAR}
...
...
src/main/java/com/xzxtshiro/mapper/SysUserMapper.xml
View file @
948dfacc
...
...
@@ -527,7 +527,7 @@
listagg( roleName, ',' ) within group ( order by u.user_id ) as roleName
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0'
where scbz='0'
and t.username != 'admin'
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"roleName !=null"
>
and ROLENAME like '%'||#{roleName}||'%'
</if>
<if
test=
"username !=null"
>
and USERNAME like '%'||#{username}||'%'
</if>
...
...
@@ -536,6 +536,7 @@
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
</if>
<if
test=
"openFlag !=null"
>
and OPEN_FLAG =#{openFlag,jdbcType=VARCHAR}
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
) t where ROWNUM
<![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
...
...
@@ -549,7 +550,7 @@
listagg( roleName, ',' ) within group ( order by u.user_id ) as roleName
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0'
where scbz='0'
and t.username != 'admin'
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"roleName !=null"
>
and ROLENAME like '%'||#{roleName}||'%'
</if>
<if
test=
"username !=null"
>
and USERNAME like '%'||#{username}||'%'
</if>
...
...
@@ -558,6 +559,7 @@
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and unitcode like '%'||#{unitcode}||'%'
</if>
<if
test=
"openFlag !=null"
>
and OPEN_FLAG =#{openFlag,jdbcType=VARCHAR}
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
</select>
<!--山西特殊情况-->
...
...
@@ -573,7 +575,7 @@
xmlagg(xmlparse(content roleName||',' wellformed) order by u.user_id).getclobval() as roleName
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0'
where scbz='0'
and t.username != 'admin'
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"roleName !=null"
>
and ROLENAME like '%'||#{roleName}||'%'
</if>
<if
test=
"username !=null"
>
and USERNAME like '%'||#{username}||'%'
</if>
...
...
@@ -582,6 +584,7 @@
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and unitcode like '%'||#{unitcode}||'%'
</if>
<if
test=
"openFlag !=null"
>
and OPEN_FLAG =#{openFlag,jdbcType=VARCHAR}
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
) t where ROWNUM
<![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
...
...
@@ -595,7 +598,7 @@
xmlagg(xmlparse(content roleName||',' wellformed) order by u.user_id).getclobval() as roleName
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0'
where scbz='0'
and t.username != 'admin'
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"roleName !=null"
>
and ROLENAME like '%'||#{roleName}||'%'
</if>
<if
test=
"username !=null"
>
and USERNAME like '%'||#{username}||'%'
</if>
...
...
@@ -604,6 +607,7 @@
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and unitcode like '%'||#{unitcode}||'%'
</if>
<if
test=
"openFlag !=null"
>
and OPEN_FLAG =#{openFlag,jdbcType=VARCHAR}
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
</select>
<!--批量添加用户角色信息-->
...
...
@@ -665,4 +669,5 @@
where scbz='0'
<if
test=
"userId !=null"
>
and ID = #{userId}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/java/com/xzxtshiro/service/SysDictitemService.java
View file @
948dfacc
...
...
@@ -15,4 +15,11 @@ public interface SysDictitemService {
* @return
*/
JSONArray
selectDictitemByCondition
(
SysDictitem
dictitem
);
/**
* 查询groupid为“CODE_XZUNIT”的字典
* @param dictitem
* @return
*/
JSONArray
selectDictitemByXzUnit
(
SysDictitem
dictitem
);
}
src/main/java/com/xzxtshiro/service/imp/SysDictitemImpl.java
View file @
948dfacc
...
...
@@ -26,4 +26,13 @@ public class SysDictitemImpl implements SysDictitemService {
JSONArray
dictitemjson
=
JSONArray
.
fromObject
(
dictitems
);
return
dictitemjson
;
}
@Override
public
JSONArray
selectDictitemByXzUnit
(
SysDictitem
dictitem
)
{
List
<
SysDictitem
>
dictitems
=
sysDictitemDao
.
selectDictitemByXzUnit
(
dictitem
);
JSONArray
dictitemjson
=
JSONArray
.
fromObject
(
dictitems
);
return
dictitemjson
;
}
}
src/main/java/com/xzxtshiro/util/ZtreeDataUtil.java
View file @
948dfacc
...
...
@@ -39,6 +39,10 @@ public class ZtreeDataUtil {
setPermissionZtreeData
(
model
,
userService
,
sysPermissionService
);
}
public
static
void
setXzUnit
(
Model
model
,
SysDictitemService
dictitemService
){
setXzunitZtreeData
(
model
,
dictitemService
);
}
/**
* 设置单位ztree
* @param model
...
...
@@ -49,11 +53,7 @@ public class ZtreeDataUtil {
String
unitStr
=
user
.
getUnitcode
();
String
usergrade
=
user
.
getGrade
();
SysDictitem
dictitem
=
new
SysDictitem
();
if
(
model
.
containsAttribute
(
"flag"
))
{
//如果含有flag标志,说明是groupid是CODE_ZCUNIT
dictitem
.
setGroupid
(
"CODE_XZUNIT"
);
}
else
{
dictitem
.
setGroupid
(
"SHIRO_UNIT"
);
}
dictitem
.
setGroupid
(
"SHIRO_UNIT"
);
dictitem
.
setCodeStr
(
unitStr
.
substring
(
0
,
2
)+
"%"
);
XzxtRestResult
xzxtRestResult
=
new
XzxtRestResult
();
//从缓存中取内容
...
...
@@ -120,7 +120,20 @@ public class ZtreeDataUtil {
model
.
addAttribute
(
"permission"
,
permission
);
}
/**
* 设置刑侦unit ztree
* @param model
* @param dictitemService
*/
public
static
void
setXzunitZtreeData
(
Model
model
,
SysDictitemService
dictitemService
){
//初始化sysDictitem对象,设置groupid为“CODE_XZUNIT”
SysDictitem
sysDictitem
=
new
SysDictitem
();
sysDictitem
.
setGroupid
(
"CODE_XZUNIT"
);
//查询CODE_XZUNIT字典list
List
<
SysDictitem
>
xzUnitList
=
dictitemService
.
selectDictitemByXzUnit
(
sysDictitem
);
JSONArray
xzUnits
=
JSONArray
.
fromObject
(
xzUnitList
);
//设置页面返回值
model
.
addAttribute
(
"unit"
,
xzUnits
);
}
}
src/main/webapp/WEB-INF/jsp/admin/search/search_header.jsp
View file @
948dfacc
...
...
@@ -31,5 +31,5 @@
<script src="${pageContext.request.contextPath}/resources/common/common.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/search/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/search/css/font-awesome.min.css">
<link rel="stylesheet" href="${pag
oeC
ntext.request.contextPath}/resources/search/css/base_initialize.css">
<link rel="stylesheet" href="${pag
eCo
ntext.request.contextPath}/resources/search/css/base_initialize.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/search/css/style.css">
\ No newline at end of file
src/main/webapp/WEB-INF/jsp/admin/search/zczlLlyList.jsp
View file @
948dfacc
...
...
@@ -52,7 +52,6 @@
<input
type=
"text"
name=
"unitname"
autocomplete=
"off"
id=
"unitname"
lay-verify=
"required"
class=
"layui-input code-icon"
onclick=
"checkTree('myUnitTree');"
>
<input
type=
"text"
id=
"unitcode"
Name=
"unitcode"
style=
"display: none;"
>
<
%
--
<
span
class=
"layui-btn"
id=
"checkPer"
onclick=
"checkTree('myUnitTree');"
>
选择单位
</span>
--%>
<div
id=
"myUnitTree"
style=
"display: none"
>
<div
class=
"ISearch"
>
<input
type=
"text"
autocomplete=
"off"
>
...
...
src/main/webapp/WEB-INF/jsp/admin/search/zxywstfzrList.jsp
View file @
948dfacc
...
...
@@ -95,6 +95,14 @@
</div>
<script
src=
"${pageContext.request.contextPath}/resources/layui/layui.js"
></script>
<script>
function
resetAll
()
{
$
(
"#trueName"
).
val
();
$
(
"#policemanid"
).
val
();
$
(
"#telephone"
).
val
();
$
(
"#unitname"
).
val
();
$
(
"#unitcode"
).
val
();
$
(
"#check"
).
attr
(
"checked"
,
"checked"
);
}
layui
.
use
([
'table'
,
'element'
,
'jquery'
],
function
()
{
$
(
'.demoTable .layui-btn'
).
on
(
'click'
,
function
(){
var
type
=
$
(
this
).
data
(
'type'
);
...
...
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