|
|
|
@ -341,6 +341,18 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
return new Result<DeptOption>().ok((DeptOption) obj); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public DeptOption getAllDeptOptionByLoginUser() { |
|
|
|
Long userId = SecurityUser.getUserId(); |
|
|
|
String deptOptionKey = RedisKeys.getAdminUserDeptOptionKey(userId); |
|
|
|
Object obj = redisUtils.get(deptOptionKey); |
|
|
|
if (null == obj) { |
|
|
|
this.packageAllUserDeptOption(userId); |
|
|
|
obj = redisUtils.get(deptOptionKey); |
|
|
|
} |
|
|
|
return (DeptOption) obj; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO> |
|
|
|
@ -393,6 +405,23 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
|
|
|
|
@Override |
|
|
|
public void packageUserDeptOption(Long userId) { |
|
|
|
packageDeptOptionByUser(userId, false); |
|
|
|
} |
|
|
|
|
|
|
|
public void packageAllUserDeptOption(Long userId) { |
|
|
|
packageDeptOptionByUser(userId, true); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 组装部门层级结构 |
|
|
|
* |
|
|
|
* @param userId 用户id |
|
|
|
* @param packageAllDept 是否组装完整层级结构,否 则组装后三级 |
|
|
|
* @return void |
|
|
|
* @author work@yujt.net.cn |
|
|
|
* @date 2020/1/28 10:49 |
|
|
|
*/ |
|
|
|
private void packageDeptOptionByUser(long userId, boolean packageAllDept) { |
|
|
|
UserDetail userDetail = userDetailRedis.get(userId); |
|
|
|
// 用户拥有的所有部门权限
|
|
|
|
List<Long> dataScopeDeptList = userDetail.getDeptIdList(); |
|
|
|
@ -424,6 +453,9 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
} |
|
|
|
// 用于存放 每次组装好的 某一级节点。页面只需展示三级,所以没有存放顶级节点(市区)
|
|
|
|
List<JSONArray> cache = Lists.newArrayList(); |
|
|
|
if (packageAllDept) { |
|
|
|
cache.add(parentNodeArray); |
|
|
|
} |
|
|
|
Map<String, Object> object; |
|
|
|
while (CollUtil.isNotEmpty(dataScopeDeptList) && CollUtil.isNotEmpty(parentDeptIdList)) { |
|
|
|
// 通过上级节点组装所有下级节点
|
|
|
|
@ -439,7 +471,12 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
DeptOption option = new DeptOption(); |
|
|
|
option.setOptions(cache.get(0)); |
|
|
|
|
|
|
|
redisUtils.set(RedisKeys.getAdminUserDeptOptionKey(userId), option); |
|
|
|
if (packageAllDept) { |
|
|
|
redisUtils.set(RedisKeys.getAllAdminUserDeptOptionKey(userId), option); |
|
|
|
} else { |
|
|
|
redisUtils.set(RedisKeys.getAdminUserDeptOptionKey(userId), option); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -599,20 +636,20 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
return new Result<DeptOption>().ok((DeptOption) obj); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param params |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 查询未建立党员群的网格列表 |
|
|
|
* @Date 2019/12/19 11:20 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public PageData<CompleteDeptDTO> listCompleteDeptDTO(Map<String, Object> params) { |
|
|
|
//查询出已经建立党员群的网格id
|
|
|
|
Result<List<String>> gridListResult=groupFeignClient.listPartyMemberGridId(); |
|
|
|
params.put("gridList",gridListResult.getData()); |
|
|
|
/** |
|
|
|
* @param params |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO> |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 查询未建立党员群的网格列表 |
|
|
|
* @Date 2019/12/19 11:20 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public PageData<CompleteDeptDTO> listCompleteDeptDTO(Map<String, Object> params) { |
|
|
|
//查询出已经建立党员群的网格id
|
|
|
|
Result<List<String>> gridListResult = groupFeignClient.listPartyMemberGridId(); |
|
|
|
params.put("gridList", gridListResult.getData()); |
|
|
|
IPage<CompleteDeptDTO> iPage = this.getPage(params); |
|
|
|
List<CompleteDeptDTO> userDtoList = this.baseDao.selectListCompleteDeptDTO(params); |
|
|
|
return new PageData<>(userDtoList, iPage.getTotal()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|