Commit 948dfacc by wushanyu

系统管理权限查询页面

parent 8d1f77f9
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);
}
}
......@@ -15,4 +15,11 @@ public interface SysDictitemDao {
*/
List<SysDictitem> selectDictitemByCondition(SysDictitem dictitem);
/**
* 查询groupid为“CODE_XZUNIT”的字典
* @param dictitem
* @return
*/
List<SysDictitem> selectDictitemByXzUnit(SysDictitem dictitem);
}
......@@ -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}
......
......@@ -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
......@@ -15,4 +15,11 @@ public interface SysDictitemService {
* @return
*/
JSONArray selectDictitemByCondition(SysDictitem dictitem);
/**
* 查询groupid为“CODE_XZUNIT”的字典
* @param dictitem
* @return
*/
JSONArray selectDictitemByXzUnit(SysDictitem dictitem);
}
......@@ -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;
}
}
......@@ -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.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);
}
}
......@@ -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="${pagoeCntext.request.contextPath}/resources/search/css/base_initialize.css">
<link rel="stylesheet" href="${pageContext.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
......@@ -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">
......
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment