|
@ -1178,14 +1178,35 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 从登录用户所属组织开始,包含网格的一颗组织树 |
|
|
|
|
|
* @param staffId 如果staffId为空时,从根组织返回 |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId) { |
|
|
public AgencyTreeResultDTO getOrgTreeData(String staffId,String customerId) { |
|
|
AgencyTreeResultDTO result = new AgencyTreeResultDTO(); |
|
|
AgencyTreeResultDTO result = new AgencyTreeResultDTO(); |
|
|
//1.查询工作人员所属组织信息
|
|
|
AgencyResultDTO rootAgency=new AgencyResultDTO(); |
|
|
AgencyResultDTO rootAgency = baseDao.selectAgencyByStaffId(staffId); |
|
|
if(StringUtils.isNotBlank(staffId)){ |
|
|
if (null == rootAgency) { |
|
|
//1.查询工作人员所属组织信息
|
|
|
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId)); |
|
|
rootAgency = baseDao.selectAgencyByStaffId(staffId); |
|
|
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); |
|
|
if (null == rootAgency) { |
|
|
|
|
|
logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId)); |
|
|
|
|
|
throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
LambdaQueryWrapper<CustomerAgencyEntity> rootQuery=new LambdaQueryWrapper<>(); |
|
|
|
|
|
rootQuery.eq(CustomerAgencyEntity::getCustomerId,customerId) |
|
|
|
|
|
.eq(CustomerAgencyEntity::getPid,NumConstant.ZERO_STR); |
|
|
|
|
|
CustomerAgencyEntity rootEntity=baseDao.selectOne(rootQuery); |
|
|
|
|
|
rootAgency.setAgencyId(rootEntity.getId()); |
|
|
|
|
|
rootAgency.setAgencyName(rootEntity.getOrganizationName()); |
|
|
|
|
|
rootAgency.setPids(rootEntity.getPids()); |
|
|
|
|
|
rootAgency.setPid(rootEntity.getPid()); |
|
|
|
|
|
rootAgency.setLevel(rootEntity.getLevel()); |
|
|
|
|
|
rootAgency.setLongitude(rootEntity.getLongitude()); |
|
|
|
|
|
rootAgency.setLatitude(rootEntity.getLatitude()); |
|
|
} |
|
|
} |
|
|
result.setPid(rootAgency.getPid()); |
|
|
result.setPid(rootAgency.getPid()); |
|
|
result.setAgencyName(rootAgency.getAgencyName()); |
|
|
result.setAgencyName(rootAgency.getAgencyName()); |
|
|