Merge remote-tracking branch 'origin/master'

master
wangxh 5 years ago
commit 07951f9062

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

@ -76,7 +76,7 @@
</div>
<div class="searcDiv">
<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">
<button type="button" class="btn btn-sm btn-primary left" onclick="reloadTree()">搜索</button>
</div>

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

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

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

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

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

@ -33,6 +33,24 @@ public class Power_UserAndRoleTree {
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() {
return isParent;
}

@ -13,7 +13,7 @@
</resultMap>
<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
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">
dict_id in (select dict_id from power_user_dict
where power_user_dict.user_id = #{userId}) and
@ -21,14 +21,13 @@
<if test="key != null and key != '' and userId == null">
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 (
power_user.user_name LIKE '%${key}%' OR power_user.user_id LIKE '%${key}%' OR power_user.user_tel LIKE
'%${key}%'
power_user.user_name LIKE '%${key}%' OR power_user.name LIKE '%${key}%'
)) AND
</if>
sys_name is null and dict_status = 1
union ALL
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
<if test="userId != null">
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
UNION ALL
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 != ''">
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
'%${key}%')
(power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
<if test="userId != null">
AND power_user.user_id != #{userId}
</if>
@ -54,13 +52,12 @@
sys_name is null and dict_status = 1) and power_dept.effective = 1
union ALL
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_dept.dept_id from power_dept
<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
(power_user.user_id LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%' OR power_user.user_tel LIKE
'%${key}%')
(power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
<if test="userId != null">
AND power_user.user_id != #{userId}
</if>
@ -73,7 +70,7 @@
sys_name is null and dict_status = 1 ))
union ALL
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
(select power_sys_dict.dict_id from power_sys_dict where
<if test="userId != null">
@ -87,8 +84,7 @@
AND power_user.user_id != #{userId}
</if>
<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
'%${key}%')
and (power_user.name LIKE '%${key}%' OR power_user.user_name LIKE '%${key}%')
</if>
group by self_id
</select>

@ -271,13 +271,6 @@
user_name = #{userName}
</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 -->
<select id="findSomeByMore" resultMap="BaseResultMap">
SELECT
@ -347,12 +340,6 @@
</if>
</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
count(1)
@ -528,15 +515,7 @@
AND power_user.role_id != 0
AND power_user.effective = 1
</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 dict_id from power_user_dict where user_id = ${userId}
</select>
@ -652,10 +631,10 @@
</select>
<!--根据医院id查询用户集合-->
<select id="getUserTreeByHospitalId" resultMap="BaseResultMap">
SELECT
SELECT
power_user.user_id,
power_user.user_name,
power_user.user_tel
power_user.name
FROM
power_user_dict
inner JOIN
@ -671,10 +650,11 @@
SELECT
power_user.user_id,
power_user.user_name,
power_user.user_tel
power_user.name
FROM
power_user
WHERE
FIND_IN_SET(#{deptId},dept_id)
and role_id != -100
</select>
</mapper>

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

Loading…
Cancel
Save