|
|
@ -344,16 +344,15 @@ public class SysStaffOrgService extends MybatisBaseService<SysStaffOrgMapper, Sy |
|
|
|
public ResultBean<OrgVo> getOrgByPath(String orgSidPath) { |
|
|
|
ResultBean<OrgVo> rb = ResultBean.fireFail(); |
|
|
|
OrgVo orgVo = new OrgVo(); |
|
|
|
List<String> stringList = Arrays.asList(orgSidPath.split("/")); |
|
|
|
//根据orgSidPath查询该组织的层级
|
|
|
|
SysOrganization sysOrganization = baseMapper.selectOrgSidPath(orgSidPath); |
|
|
|
if ("1".equals(sysOrganization.getOrgLevelKey())) { |
|
|
|
sysOrganization = sysOrganizationService.fetchBySid(stringList.get(0)); |
|
|
|
} else if ("2".equals(sysOrganization.getOrgLevelKey())) { |
|
|
|
sysOrganization = sysOrganizationService.fetchBySid(stringList.get(1)); |
|
|
|
String[] levels = orgSidPath.split("/"); // 将orgSidPath按'/'分割
|
|
|
|
String orgSid = ""; |
|
|
|
// 判断层级
|
|
|
|
if (levels.length > 3) { |
|
|
|
orgSid = levels[2]; // 第三层级的sid
|
|
|
|
} else { |
|
|
|
sysOrganization = sysOrganizationService.fetchBySid(stringList.get(2)); |
|
|
|
orgSid = levels[levels.length - 2]; // 倒数第二层级的sid
|
|
|
|
} |
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(orgSid); |
|
|
|
orgVo.setUseOrgName(sysOrganization.getName()); |
|
|
|
orgVo.setUseOrgSid(sysOrganization.getSid()); |
|
|
|
orgVo.setOrgCode(sysOrganization.getOrgCode()); |
|
|
|