|
|
@ -686,6 +686,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
return subAgencyList; |
|
|
|
} |
|
|
|
|
|
|
|
private List<AgencySubResultDTO> getDepartmentLevelList(String subAgencyPids) { |
|
|
|
List<AgencySubResultDTO> subAgencyList = baseDao.selectSubAgencyLevelList(subAgencyPids); |
|
|
|
if (subAgencyList.size() > NumConstant.ZERO) { |
|
|
|
for (AgencySubResultDTO sub : subAgencyList) { |
|
|
|
List<AgencySubResultDTO> subAgency = getDepartmentLevelList(sub.getPids() + ":" + sub.getAgencyId()); |
|
|
|
sub.setSubAgencyList(subAgency); |
|
|
|
} |
|
|
|
} |
|
|
|
return subAgencyList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param staffId |
|
|
|
* @return |
|
|
@ -1057,6 +1068,24 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public StaffInAgencyListResultDTO staffinAgencyLevelList(String staffId) { |
|
|
|
StaffInAgencyListResultDTO resultDTO = new StaffInAgencyListResultDTO(); |
|
|
|
//1.查询工作人员所属组织信息
|
|
|
|
AgencyResultDTO agencyList = baseDao.selectAgencyByStaffId(staffId); |
|
|
|
if (null == agencyList) { |
|
|
|
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId)); |
|
|
|
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); |
|
|
|
} |
|
|
|
resultDTO.setAgencyList(agencyList); |
|
|
|
|
|
|
|
//2.递归查询所有下级组织信息
|
|
|
|
List<AgencySubResultDTO> subAgencyList = getDepartmentLevelList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId()); |
|
|
|
resultDTO.setSubAgencyList(subAgencyList); |
|
|
|
|
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param customerId |
|
|
|
* @return com.epmet.dto.result.AgencyElementTreeResultDTO |
|
|
|