|
@@ -62,10 +62,23 @@ public class OfficeService extends TreeService<OfficeMapper, Office> {
|
|
OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
|
|
OfficeDTO officeDTO = UserUtils.getCurrentUserDTO().getOfficeDTO();
|
|
// 排除管理员
|
|
// 排除管理员
|
|
if (!UserUtils.getCurrentUserDTO().isAdmin()){
|
|
if (!UserUtils.getCurrentUserDTO().isAdmin()){
|
|
- // isPublic为“0”,当前用户的部门为私有部门,查询的部门包含自己所属部门和公有部门
|
|
|
|
- if ("0".equals(officeDTO.getIsPublic())) {
|
|
|
|
- if(null != officeDTO && StringUtils.isNotBlank(officeDTO.getParentIds())){
|
|
|
|
- offices = this.getCompanyFromTree(offices);
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(officeDTO.getParentIds())) {
|
|
|
|
+ String[] split = officeDTO.getParentIds().split(",");
|
|
|
|
+ if (split.length > 2) {
|
|
|
|
+ Office office = officeMapper.selectById(split[2]);
|
|
|
|
+ if ("0".equals(office.getIsPublic())) {
|
|
|
|
+ // isPublic为“0”,当前用户的公司为私有,查询的部门包含自己所属公司全部部门和其他的公有部门
|
|
|
|
+ if(null != officeDTO && StringUtils.isNotBlank(officeDTO.getParentIds())){
|
|
|
|
+ offices = this.getCompanyFromTree(offices);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if ("0".equals(officeDTO.getIsPublic())) {
|
|
|
|
+ // isPublic为“0”,当前用户的公司为私有,查询的部门包含自己所属公司全部部门和其他的公有部门
|
|
|
|
+ if(null != officeDTO && StringUtils.isNotBlank(officeDTO.getParentIds())){
|
|
|
|
+ offices = this.getCompanyFromTree(offices);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|