Merge remote-tracking branch 'origin/master'

master
wangxh 5 years ago
commit 07951f9062

@ -279,13 +279,13 @@
</section> </section>
</div> </div>
<!-- 底部版权--> <!-- 底部版权-->
<%--<footer class="main-footer"> <footer class="main-footer">
<div class="pull-right hidden-xs"> <div class="pull-right hidden-xs">
<b>Version</b> 20200211 <b>Version</b> 20200211
</div> </div>
<strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights <strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
reserved. reserved.
</footer>--%> </footer>
</div> </div>
<%@ include file="/WEB-INF/jspf/webSocket.jspf" %> <%@ include file="/WEB-INF/jspf/webSocket.jspf" %>
<script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script> <script type="text/javascript" src="${path}/static/js/menu.js?time=2019-12-15"></script>

@ -76,7 +76,7 @@
</div> </div>
<div class="searcDiv"> <div class="searcDiv">
<div class="form-group"> <div class="form-group">
<label class="col-sm-9 control-label"><input type="text" class="form-control input-sm" id="key" maxlength="11" placeholder="ID-用户名(手机号)"></label> <label class="col-sm-9 control-label"><input type="text" class="form-control input-sm" id="key" maxlength="11" placeholder="工号-姓名"></label>
<div class="col-sm-3"> <div class="col-sm-3">
<button type="button" class="btn btn-sm btn-primary left" onclick="reloadTree()">搜索</button> <button type="button" class="btn btn-sm btn-primary left" onclick="reloadTree()">搜索</button>
</div> </div>

@ -389,7 +389,7 @@ $('#queryBtn').click(function () {
}) })
//获取table的高度 //获取table的高度
function getHeight() { function getHeight() {
return $(window).height() - 190; return $(window).height() * 0.8;
} }
//刷新表格 //刷新表格
function refresh() { function refresh() {

@ -389,7 +389,7 @@ $('#queryBtn').click(function () {
}) })
//获取table的高度 //获取table的高度
function getHeight() { function getHeight() {
return $(window).height() - 190; return $(window).height() * 0.8;
} }
//刷新表格 //刷新表格
function refresh() { function refresh() {

@ -127,12 +127,8 @@ function addChildNodes(event, treeId, treeNode){
//关键字搜索树 //关键字搜索树
function reloadTree() { function reloadTree() {
var key = $("#key").val(); var key = $("#key").val();
if(key.length > 2){ $('#loadingModal').modal('show');
$('#loadingModal').modal('show'); menu.loadMenuTree();
menu.loadMenuTree();
}else{
toastr.warning("数据较多,搜索内容字符不少于2位");
}
} }

@ -317,7 +317,7 @@ $('#queryBtn').click(function () {
}) })
//获取table的高度 //获取table的高度
function getHeight() { function getHeight() {
return $(window).height() - 190; return $(window).height() * 0.8;
} }
//刷新表格 //刷新表格
function refresh() { function refresh() {

@ -472,7 +472,7 @@ function saveForm(){
} }
//获取table的高度 //获取table的高度
function getHeight() { function getHeight() {
return $(window).height() - 190; return $(window).height() * 0.8;
} }
//刷新表格 //刷新表格
function refresh() { function refresh() {

@ -33,6 +33,24 @@ public class Power_UserAndRoleTree {
private Boolean isParent; private Boolean isParent;
private String realName;
public Boolean getParent() {
return isParent;
}
public void setParent(Boolean parent) {
isParent = parent;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public Boolean getIsParent() { public Boolean getIsParent() {
return isParent; return isParent;
} }

@ -13,7 +13,7 @@
</resultMap> </resultMap>
<select id="getUserTree" resultMap="BaseResultMap"> <select id="getUserTree" resultMap="BaseResultMap">
select 1 as level,0 as parent_id,power_sys_dict.hospital_name name,power_sys_dict.hospital_name new_name,null as select 1 as level,0 as parent_id,power_sys_dict.hospital_name name,power_sys_dict.hospital_name new_name,null as
sys_flag,null as dept_id,dict_id self_id,null as tel from power_sys_dict where sys_flag,null as dept_id,dict_id self_id,null as tel,null as real_name from power_sys_dict where
<if test="userId != null"> <if test="userId != null">
dict_id in (select dict_id from power_user_dict dict_id in (select dict_id from power_user_dict
where power_user_dict.user_id = #{userId}) and where power_user_dict.user_id = #{userId}) and
@ -21,14 +21,13 @@
<if test="key != null and key != '' and userId == null"> <if test="key != null and key != '' and userId == null">
dict_id in (select dict_id from power_user_dict dict_id in (select dict_id from power_user_dict
INNER JOIN power_user ON power_user.effective = 1 AND power_user_dict.user_id = power_user.user_id AND ( INNER JOIN power_user ON power_user.effective = 1 AND power_user_dict.user_id = power_user.user_id AND (
power_user.user_name LIKE '%${key}%' OR power_user.user_id LIKE '%${key}%' OR power_user.user_tel LIKE power_user.user_name LIKE '%${key}%' OR power_user.name LIKE '%${key}%'
'%${key}%'
)) AND )) AND
</if> </if>
sys_name is null and dict_status = 1 sys_name is null and dict_status = 1
union ALL union ALL
select 2 as level,power_sys_dict.parent_id,power_sys_dict.sys_name name,power_sys_dict.sys_name select 2 as level,power_sys_dict.parent_id,power_sys_dict.sys_name name,power_sys_dict.sys_name
new_name,sys_flag,null as dept_id,null as self_id,null as tel from power_sys_dict where sys_flag = 'power' and new_name,sys_flag,null as dept_id,null as self_id,null as tel,null as real_name from power_sys_dict where sys_flag = 'power' and
parent_id in (select power_sys_dict.dict_id from power_sys_dict where parent_id in (select power_sys_dict.dict_id from power_sys_dict where
<if test="userId != null"> <if test="userId != null">
dict_id in (select dict_id from power_user_dict dict_id in (select dict_id from power_user_dict
@ -37,11 +36,10 @@
sys_name is null and dict_status = 1) and dict_status = 1 sys_name is null and dict_status = 1) and dict_status = 1
UNION ALL UNION ALL
select 3 as level,power_dept.dict_id parent_id,dept_name name,dept_name new_name,null select 3 as level,power_dept.dict_id parent_id,dept_name name,dept_name new_name,null
sys_flag,power_dept.dept_id,null as self_id,null as tel from power_dept sys_flag,power_dept.dept_id,null as self_id,null as tel,null as real_name from power_dept
<if test="key != null and key != ''"> <if test="key != null and key != ''">
INNER JOIN power_user on FIND_IN_SET(power_dept.dept_id,power_user.dept_id) and power_user.effective = 1 and INNER JOIN power_user on FIND_IN_SET(power_dept.dept_id,power_user.dept_id) and power_user.effective = 1 and
(power_user.user_id LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%' OR power_user.user_tel LIKE (power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
'%${key}%')
<if test="userId != null"> <if test="userId != null">
AND power_user.user_id != #{userId} AND power_user.user_id != #{userId}
</if> </if>
@ -54,13 +52,12 @@
sys_name is null and dict_status = 1) and power_dept.effective = 1 sys_name is null and dict_status = 1) and power_dept.effective = 1
union ALL union ALL
select 4 as level,power_sys_dict.parent_id parent_id,sys_name name,sys_name select 4 as level,power_sys_dict.parent_id parent_id,sys_name name,sys_name
new_name,sys_flag,power_sys_dict.dept_id,power_sys_dict.dict_id as self_id,null as tel from power_sys_dict where new_name,sys_flag,power_sys_dict.dept_id,power_sys_dict.dict_id as self_id,null as tel,null as real_name from power_sys_dict where
power_sys_dict.dict_status = 1 and power_sys_dict.sys_flag != 'power' and power_sys_dict.dept_id in (select power_sys_dict.dict_status = 1 and power_sys_dict.sys_flag != 'power' and power_sys_dict.dept_id in (select
power_dept.dept_id from power_dept power_dept.dept_id from power_dept
<if test="key != null and key != ''"> <if test="key != null and key != ''">
INNER JOIN power_user on FIND_IN_SET(power_dept.dept_id,power_user.dept_id) and power_user.effective = 1 and INNER JOIN power_user on FIND_IN_SET(power_dept.dept_id,power_user.dept_id) and power_user.effective = 1 and
(power_user.user_id LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%' OR power_user.user_tel LIKE (power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
'%${key}%')
<if test="userId != null"> <if test="userId != null">
AND power_user.user_id != #{userId} AND power_user.user_id != #{userId}
</if> </if>
@ -73,7 +70,7 @@
sys_name is null and dict_status = 1 )) sys_name is null and dict_status = 1 ))
union ALL union ALL
select 5 as level,power_user_dict.dict_id as parent_id,power_user.user_name name,power_user.user_name select 5 as level,power_user_dict.dict_id as parent_id,power_user.user_name name,power_user.user_name
new_name,null as sys_flag,power_user.dept_id,power_user.user_id self_id,power_user.user_tel from power_user new_name,null as sys_flag,power_user.dept_id,power_user.user_id self_id,power_user.user_tel,power_user.name as real_name from power_user
INNER JOIN (select power_dept.dept_id from power_dept where power_dept.effective = 1 and power_dept.dict_id in INNER JOIN (select power_dept.dept_id from power_dept where power_dept.effective = 1 and power_dept.dict_id in
(select power_sys_dict.dict_id from power_sys_dict where (select power_sys_dict.dict_id from power_sys_dict where
<if test="userId != null"> <if test="userId != null">
@ -87,8 +84,7 @@
AND power_user.user_id != #{userId} AND power_user.user_id != #{userId}
</if> </if>
<if test="key != null and key != ''"> <if test="key != null and key != ''">
and (power_user.user_id LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%' OR power_user.user_tel LIKE and (power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
'%${key}%')
</if> </if>
group by self_id group by self_id
</select> </select>

@ -271,13 +271,6 @@
user_name = #{userName} user_name = #{userName}
</select> </select>
<!--2019-4-22 ljx -->
<select id="validUserRoleMenu" resultType="java.lang.Integer">
select count(*) from power_role_menu rm
where rm.role_id in ( select ur.role_id from power_user ur WHERE ur.user_id = #{userId,jdbcType=INTEGER} )
and rm.menu_id in ( select m.menu_id from power_menu m WHERE m.menu_url LIKE #{menuUrl,jdbcType=VARCHAR} )
</select>
<!--2019-4-22 ljx --> <!--2019-4-22 ljx -->
<select id="findSomeByMore" resultMap="BaseResultMap"> <select id="findSomeByMore" resultMap="BaseResultMap">
SELECT SELECT
@ -347,12 +340,6 @@
</if> </if>
</select> </select>
<!--2019-4-22 ly -->
<select id="validUserMenu" resultType="java.lang.Integer">
select count(*) from power_user_menu um
where um.menu_id in(select m.menu_id from power_menu m WHERE m.menu_url LIKE #{menuUrl,jdbcType=VARCHAR} )
and um.user_id = #{userId,jdbcType=INTEGER} and flag = #{flag,jdbcType=INTEGER}
</select>
<select id="getTotal" resultType="int"> <select id="getTotal" resultType="int">
SELECT SELECT
count(1) count(1)
@ -528,15 +515,7 @@
AND power_user.role_id != 0 AND power_user.role_id != 0
AND power_user.effective = 1 AND power_user.effective = 1
</select> </select>
<!--删除角色用户角色id置空-->
<update id="updateUserRoleIdByRoleId" parameterType="java.lang.Integer">
UPDATE
power_user
SET
role_id = NULL
WHERE
role_id = ${roleId}
</update>
<select id="selectHospitalIdByUserId" resultType="java.lang.Integer"> <select id="selectHospitalIdByUserId" resultType="java.lang.Integer">
select dict_id from power_user_dict where user_id = ${userId} select dict_id from power_user_dict where user_id = ${userId}
</select> </select>
@ -652,10 +631,10 @@
</select> </select>
<!--根据医院id查询用户集合--> <!--根据医院id查询用户集合-->
<select id="getUserTreeByHospitalId" resultMap="BaseResultMap"> <select id="getUserTreeByHospitalId" resultMap="BaseResultMap">
SELECT SELECT
power_user.user_id, power_user.user_id,
power_user.user_name, power_user.user_name,
power_user.user_tel power_user.name
FROM FROM
power_user_dict power_user_dict
inner JOIN inner JOIN
@ -671,10 +650,11 @@
SELECT SELECT
power_user.user_id, power_user.user_id,
power_user.user_name, power_user.user_name,
power_user.user_tel power_user.name
FROM FROM
power_user power_user
WHERE WHERE
FIND_IN_SET(#{deptId},dept_id) FIND_IN_SET(#{deptId},dept_id)
and role_id != -100
</select> </select>
</mapper> </mapper>

@ -409,6 +409,7 @@ public class PowerServiceImpl implements PowerService {
int id = 1; int id = 1;
int oneLevelId = 0; int oneLevelId = 0;
int twoLevelId = 0; int twoLevelId = 0;
int threeLevelId = 0;
for(Power_UserAndRoleTree hos : hosList){ for(Power_UserAndRoleTree hos : hosList){
//第一级医院 //第一级医院
Power_UserAndRoleTree tree1 = new Power_UserAndRoleTree(); Power_UserAndRoleTree tree1 = new Power_UserAndRoleTree();
@ -429,32 +430,34 @@ public class PowerServiceImpl implements PowerService {
tree2.setParentId(oneLevelId); tree2.setParentId(oneLevelId);
tree2.setSysFlag(powerSys.getSysFlag()); tree2.setSysFlag(powerSys.getSysFlag());
Boolean isParent = false; Boolean isParent = false;
id++;
//第三级用户 //第三级用户
if(null != userList && !userList.isEmpty()){ if(null != userList && !userList.isEmpty()){
//属于该医院的权限系统下有有该用户 //属于该医院的权限系统下有有该用户
for(Power_UserAndRoleTree powerUser : userList){ for(Power_UserAndRoleTree powerUser : userList){
if(null != powerUser.getParentId() && powerUser.getParentId().equals(hos.getSelfId())){ if(null != powerUser.getParentId() && powerUser.getParentId().equals(hos.getSelfId())){
/*Power_UserAndRoleTree tree3 = new Power_UserAndRoleTree(); if(StringUtils.isNotBlank(key)){
BeanUtils.copyProperties(powerUser,tree3); Power_UserAndRoleTree tree3 = new Power_UserAndRoleTree();
tree3.setId(id); BeanUtils.copyProperties(powerUser,tree3);
tree3.setParentId(twoLevelId); tree3.setId(id);
if(StringUtils.isNotBlank(powerUser.getTel())){ tree3.setParentId(twoLevelId);
tree3.setName(powerUser.getSelfId()+"-"+powerUser.getName()+"("+powerUser.getTel()+")"); if(StringUtils.isNotBlank(powerUser.getRealName())){
tree3.setNewName(powerUser.getSelfId()+"-"+powerUser.getName()+"("+powerUser.getTel()+")"); tree3.setName(powerUser.getName()+"-"+powerUser.getRealName());
}else{ tree3.setNewName(powerUser.getName()+"-"+powerUser.getRealName());
tree3.setName(powerUser.getSelfId()+"-"+powerUser.getName()); }else{
tree3.setNewName(powerUser.getSelfId()+"-"+powerUser.getName()); tree3.setName(powerUser.getName());
tree3.setNewName(powerUser.getName());
}
tree3.setSysFlag("power");
treeList.add(tree3);
id++;
} }
tree3.setSysFlag("power");
treeList.add(tree3);
id++;*/
isParent = true; isParent = true;
} }
} }
} }
tree2.setIsParent(isParent); tree2.setIsParent(isParent);
treeList.add(tree2); treeList.add(tree2);
id++;
} }
} }
} }
@ -480,6 +483,8 @@ public class PowerServiceImpl implements PowerService {
tree5.setId(id); tree5.setId(id);
tree5.setParentId(twoLevelId); tree5.setParentId(twoLevelId);
tree5.setSysFlag(sys.getSysFlag()); tree5.setSysFlag(sys.getSysFlag());
threeLevelId = id;
id++;
Boolean isParent = false; Boolean isParent = false;
//第四级用户 //第四级用户
if(null != userList && !userList.isEmpty()) { if(null != userList && !userList.isEmpty()) {
@ -490,42 +495,46 @@ public class PowerServiceImpl implements PowerService {
if(!deptId.contains(",")){ if(!deptId.contains(",")){
if(deptId.equals(dept.getDeptId())){ if(deptId.equals(dept.getDeptId())){
isParent = true; isParent = true;
/*Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree(); if(StringUtils.isNotBlank(key)){
BeanUtils.copyProperties(users,tree6); id++;
tree6.setId(id); Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree();
tree6.setParentId(threeLevelId); BeanUtils.copyProperties(users,tree6);
if(StringUtils.isNotBlank(users.getTel())){ tree6.setId(id);
tree6.setName(users.getSelfId()+"-"+users.getName()+"("+users.getTel()+")"); tree6.setParentId(threeLevelId);
tree6.setNewName(users.getSelfId()+"-"+users.getName()+"("+users.getTel()+")"); if(StringUtils.isNotBlank(users.getRealName())){
}else{ tree6.setName(users.getName()+"-"+users.getRealName());
tree6.setName(users.getSelfId()+"-"+users.getName()); tree6.setNewName(users.getName()+"-"+users.getRealName());
tree6.setNewName(users.getSelfId()+"-"+users.getName()); }else{
tree6.setName(users.getName());
tree6.setNewName(users.getName());
}
tree6.setSysFlag(sys.getSysFlag());
treeList.add(tree6);
id++;
} }
tree6.setSysFlag(sys.getSysFlag());
treeList.add(tree6);
id++;*/
} }
}else{ }else{
//逗号隔开多科室 //逗号隔开多科室
String[] deptIds = deptId.split(","); String[] deptIds = deptId.split(",");
for (String deptStr : deptIds) { for (String deptStr : deptIds) {
if(StringUtils.isNotBlank(deptStr) && deptStr.equals(dept.getDeptId())){ if(StringUtils.isNotBlank(deptStr) && deptStr.equals(dept.getDeptId())){
/*Power_UserAndRoleTree tree7 = new Power_UserAndRoleTree(); if(StringUtils.isNotBlank(key)){
BeanUtils.copyProperties(users,tree7); Power_UserAndRoleTree tree7 = new Power_UserAndRoleTree();
tree7.setId(id); BeanUtils.copyProperties(users,tree7);
tree7.setParentId(threeLevelId); tree7.setId(id);
if(StringUtils.isNotBlank(users.getTel())){ tree7.setParentId(threeLevelId);
tree7.setName(users.getSelfId()+"-"+users.getName()+"("+users.getTel()+")"); if(StringUtils.isNotBlank(users.getRealName())){
tree7.setNewName(users.getSelfId()+"-"+users.getName()+"("+users.getTel()+")"); tree7.setName(users.getName()+"-"+users.getRealName());
}else{ tree7.setNewName(users.getName()+"-"+users.getRealName());
tree7.setName(users.getSelfId()+"-"+users.getName()); }else{
tree7.setNewName(users.getSelfId()+"-"+users.getName()); tree7.setName(users.getName());
tree7.setNewName(users.getName());
}
tree7.setSysFlag(sys.getSysFlag());
treeList.add(tree7);
id++;
} }
tree7.setSysFlag(sys.getSysFlag());
treeList.add(tree7);
id++;*/
isParent = true; isParent = true;
continue;
} }
} }
} }
@ -534,7 +543,6 @@ public class PowerServiceImpl implements PowerService {
} }
tree5.setIsParent(isParent); tree5.setIsParent(isParent);
treeList.add(tree5); treeList.add(tree5);
id++;
} }
} }
} }
@ -552,13 +560,14 @@ public class PowerServiceImpl implements PowerService {
if(null != userList && !userList.isEmpty()){ if(null != userList && !userList.isEmpty()){
for (Power_User users : userList) { for (Power_User users : userList) {
Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree(); Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree();
if(StringUtils.isNotBlank(users.getUserTel())){ if(StringUtils.isNotBlank(users.getName())){
tree6.setName(users.getUserId()+"-"+users.getUserName()+"("+users.getUserTel()+")"); tree6.setName(users.getUserName()+"-"+users.getName());
tree6.setNewName(users.getUserId()+"-"+users.getUserName()+"("+users.getUserTel()+")"); tree6.setNewName(users.getUserName()+"-"+users.getName());
}else{ }else{
tree6.setName(users.getUserId()+"-"+users.getUserName()); tree6.setName(users.getUserName());
tree6.setNewName(users.getUserId()+"-"+users.getUserName()); tree6.setNewName(users.getUserName());
} }
tree6.setSelfId(users.getUserId());
treeList.add(tree6); treeList.add(tree6);
} }
} }
@ -572,13 +581,14 @@ public class PowerServiceImpl implements PowerService {
if(null != userList && !userList.isEmpty()){ if(null != userList && !userList.isEmpty()){
for (Power_User users : userList) { for (Power_User users : userList) {
Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree(); Power_UserAndRoleTree tree6 = new Power_UserAndRoleTree();
if(StringUtils.isNotBlank(users.getUserTel())){ if(StringUtils.isNotBlank(users.getName())){
tree6.setName(users.getUserId()+"-"+users.getUserName()+"("+users.getUserTel()+")"); tree6.setName(users.getUserName()+"-"+users.getName());
tree6.setNewName(users.getUserId()+"-"+users.getUserName()+"("+users.getUserTel()+")"); tree6.setNewName(users.getUserName()+"-"+users.getName());
}else{ }else{
tree6.setName(users.getUserId()+"-"+users.getUserName()); tree6.setName(users.getUserName());
tree6.setNewName(users.getUserId()+"-"+users.getUserName()); tree6.setNewName(users.getUserName());
} }
tree6.setSelfId(users.getUserId());
treeList.add(tree6); treeList.add(tree6);
} }
} }

Loading…
Cancel
Save