|
|
@ -249,27 +249,27 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("->getCompleteDept:::部门ID格式转换异常:::deptId->{}", deptId); |
|
|
|
} |
|
|
|
if (null == deptId) { |
|
|
|
if (null == deptIdL) { |
|
|
|
return new Result().error("参数格式异常"); |
|
|
|
} |
|
|
|
CompleteDeptDTO completeDept = this.baseDao.getParentAndAllDept(deptIdL); |
|
|
|
ParentAndAllDeptDTO parentAndAllDeptDTO = new ParentAndAllDeptDTO(); |
|
|
|
|
|
|
|
if(completeDept != null){ |
|
|
|
if (completeDept != null) { |
|
|
|
parentAndAllDeptDTO.setGrid(StringUtils.isNotEmpty(completeDept.getGrid()) ? completeDept.getGrid() : ""); |
|
|
|
parentAndAllDeptDTO.setGridId(completeDept.getGridId()!=null && completeDept.getGridId()!= 0 ? completeDept.getGridId() : null); |
|
|
|
parentAndAllDeptDTO.setGridId(completeDept.getGridId() != null && completeDept.getGridId() != 0 ? completeDept.getGridId() : null); |
|
|
|
// 父所有部门(包含街道、社区)
|
|
|
|
String deptNames = (StringUtils.isNotEmpty(completeDept.getDistrict()) ? completeDept.getDistrict() +"-" : ""); |
|
|
|
deptNames += (StringUtils.isNotEmpty(completeDept.getStreet()) ? completeDept.getStreet() +"-": ""); |
|
|
|
deptNames += (StringUtils.isNotEmpty(completeDept.getCommunity()) ? completeDept.getCommunity() +"-": ""); |
|
|
|
String deptIds = (completeDept.getDistrictId()!=null && completeDept.getDistrictId()!= 0 ? completeDept.getDistrictId().toString() +"," : ""); |
|
|
|
deptIds += (completeDept.getStreetId()!=null && completeDept.getStreetId()!= 0 ? completeDept.getStreetId().toString() +",": ""); |
|
|
|
deptIds += (completeDept.getCommunityId()!=null && completeDept.getCommunityId()!= 0 ? completeDept.getCommunityId().toString() +"," : ""); |
|
|
|
parentAndAllDeptDTO.setParentDeptIds(!"".equals(deptIds)? deptIds.substring(0,deptIds.length()-1) : ""); |
|
|
|
parentAndAllDeptDTO.setParentDeptNames(!"".equals(deptNames)? deptNames.substring(0,deptNames.length()-1) : ""); |
|
|
|
String deptNames = (StringUtils.isNotEmpty(completeDept.getDistrict()) ? completeDept.getDistrict() + "-" : ""); |
|
|
|
deptNames += (StringUtils.isNotEmpty(completeDept.getStreet()) ? completeDept.getStreet() + "-" : ""); |
|
|
|
deptNames += (StringUtils.isNotEmpty(completeDept.getCommunity()) ? completeDept.getCommunity() + "-" : ""); |
|
|
|
String deptIds = (completeDept.getDistrictId() != null && completeDept.getDistrictId() != 0 ? completeDept.getDistrictId().toString() + "," : ""); |
|
|
|
deptIds += (completeDept.getStreetId() != null && completeDept.getStreetId() != 0 ? completeDept.getStreetId().toString() + "," : ""); |
|
|
|
deptIds += (completeDept.getCommunityId() != null && completeDept.getCommunityId() != 0 ? completeDept.getCommunityId().toString() + "," : ""); |
|
|
|
parentAndAllDeptDTO.setParentDeptIds(!"".equals(deptIds) ? deptIds.substring(0, deptIds.length() - 1) : ""); |
|
|
|
parentAndAllDeptDTO.setParentDeptNames(!"".equals(deptNames) ? deptNames.substring(0, deptNames.length() - 1) : ""); |
|
|
|
// 所有部门(包含街道、社区、网格)
|
|
|
|
deptNames += (StringUtils.isNotEmpty(completeDept.getGrid()) ? completeDept.getGrid() : ""); |
|
|
|
deptIds += (completeDept.getGridId()!=null && completeDept.getGridId()!= 0 ? completeDept.getGridId().toString() : ""); |
|
|
|
deptIds += (completeDept.getGridId() != null && completeDept.getGridId() != 0 ? completeDept.getGridId().toString() : ""); |
|
|
|
parentAndAllDeptDTO.setAllDeptIds(deptIds); |
|
|
|
parentAndAllDeptDTO.setAllDeptNames(deptNames); |
|
|
|
} else { |
|
|
@ -347,12 +347,12 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public List<UserSysDeptInfoResultDTO> listUserSysDeptInfoResultDTO(UserSysDeptInfoFormDTO formDTO) { |
|
|
|
if(CollUtil.isEmpty(formDTO.getDeptIdList())){ |
|
|
|
if (CollUtil.isEmpty(formDTO.getDeptIdList())) { |
|
|
|
Long userId = SecurityUser.getUserId(); |
|
|
|
// 查询当前用户所具有的的数据权限
|
|
|
|
UserDetail userDetail = userDetailRedis.get(userId); |
|
|
|
// 用户拥有的所有部门权限
|
|
|
|
List<Long> dataScopeDeptList=userDetail.getDeptIdList(); |
|
|
|
List<Long> dataScopeDeptList = userDetail.getDeptIdList(); |
|
|
|
formDTO.setDeptIdList(dataScopeDeptList); |
|
|
|
} |
|
|
|
List<UserSysDeptInfoResultDTO> list = baseDao.selectListUserSysDeptInfo(formDTO); |
|
|
|