| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -350,10 +350,12 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DeptOption getUserDeptOption() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return getUserDeptOption(SecurityUser.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DeptOption getDeptAuthByUser() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return getDeptAuthByUser(SecurityUser.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<DeptGridDTO> getGridAuthByUser() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 用户拥有的所有部门权限
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -385,6 +387,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return (DeptOption) obj; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 根据userId,从redis取出用户部门层级关系(街道-社区-网格) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -415,6 +418,51 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return (DeptOption) obj; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DeptOption getBusinessDeptByUser() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        DeptOption result = getUserDeptOption(SecurityUser.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<JSONObject> options = result.getOptions(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (options.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 代表存在子级机构的json key
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String childJsonOptionKey = "children"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 一个街道机构
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        JSONObject streetOption; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 一个街道下所有社区机构
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        JSONArray communityOptionArray; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 一个社区机构
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        JSONObject communityOption; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 循环所有街道
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = options.size() - NumConstant.ONE; i >= NumConstant.ZERO; i--) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 取出一个街道
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            streetOption = options.get(i); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 街道没有children,代表没有下级社区(没有children的,其实是区直)
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (null == streetOption.get(childJsonOptionKey)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 移除区直机构
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                options.remove(i); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                continue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 获取该街道的所有社区
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            communityOptionArray = streetOption.getJSONArray(childJsonOptionKey); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (communityOptionArray.isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 移除区直机构
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                options.remove(i); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                continue; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 社区不为空,循环所有社区
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            for (int j = communityOptionArray.size() - 1; j >= 0; j--) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 取出一个社区
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                communityOption = communityOptionArray.getJSONObject(j); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (null == communityOption.get(childJsonOptionKey) || communityOption.getJSONArray(childJsonOptionKey).isEmpty()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    // 若街道有下级机构(社区),移除社区
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    communityOptionArray.remove(j); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public DeptOption getMiddleByLoginUser() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        DeptOption result = getUserDeptOption(SecurityUser.getUserId()); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -614,10 +662,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 组装部门层级结构 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param userId         用户id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @param userId 用户id | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return void | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author work@yujt.net.cn | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @date 2020/1/28 10:49 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -717,6 +766,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.put("pids", parentDeptIdList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 组装下级结构节点 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -766,9 +816,9 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                nodeParent.put("children", childrenNodeList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if(allParentNode.size() == 0){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (allParentNode.size() == 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            for (int index = 0; index < childDepts.size(); index++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                JSONObject node =  new JSONObject(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                JSONObject node = new JSONObject(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                node.put("label", childDepts.get(index).getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                node.put("value", String.valueOf(childDepts.get(index).getId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                allParentNode.add(node); | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -790,6 +840,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.put("scope", dataScopeDeptList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void packgeAllDeptOption() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<DeptTreeDTO> deptList = baseDao.selectListDeptTree(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1046,10 +1097,10 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<UserSysDeptInfoResultDTO> listAllDeptInfo(UserSysDeptInfoFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Object> map = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formDTO.getTypeKeyList() != null && formDTO.getTypeKeyList().size() >0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formDTO.getTypeKeyList() != null && formDTO.getTypeKeyList().size() > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("typeKey", formDTO.getTypeKeyList().get(0)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formDTO.getDeptIdList() != null && formDTO.getDeptIdList().size() >0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formDTO.getDeptIdList() != null && formDTO.getDeptIdList().size() > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("deptId", formDTO.getDeptIdList().get(0)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (formDTO.getDeptName() != null && formDTO.getDeptName() != "") { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -1060,11 +1111,10 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 组织机构名称修改发送MQ消息 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @params [dto] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @return void | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @params [dto] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author liuchuang | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @since 2020/3/6 21:34 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |