|
|
@ -30,6 +30,8 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.CustomerAgencyConstant; |
|
|
@ -1401,4 +1403,37 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description根据组织Id查询扇形组织网格树 |
|
|
|
* @author sun |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public AgencyTreeResultDTO rootAgencyGridTree(String agencyId) { |
|
|
|
AgencyTreeResultDTO result = new AgencyTreeResultDTO(); |
|
|
|
//1.查询组织缓存信息
|
|
|
|
AgencyInfoCache rootAgency = CustomerOrgRedis.getAgencyInfo(agencyId); |
|
|
|
if (null == rootAgency) { |
|
|
|
throw new RenException(String.format("查询组织信息失败%s", agencyId)); |
|
|
|
} |
|
|
|
result.setPid(rootAgency.getPid()); |
|
|
|
result.setAgencyId(rootAgency.getId()); |
|
|
|
result.setAgencyName(rootAgency.getOrganizationName()); |
|
|
|
result.setLevel(rootAgency.getLevel()); |
|
|
|
result.setOrgLevel(rootAgency.getId().concat("-").concat(rootAgency.getLevel())); |
|
|
|
result.setLongitude(rootAgency.getLongitude()); |
|
|
|
result.setLatitude(rootAgency.getLatitude()); |
|
|
|
|
|
|
|
String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getId()); |
|
|
|
Object o = redisUtils.get(orgTreeCacheKey); |
|
|
|
if (o == null) { |
|
|
|
ExtStaffPermissionResultDTO res = baseDao.selectAgencyAndGridById(rootAgency.getId()); |
|
|
|
convert2AgencyTreeResult(result, res.getSubAgencyList(), res.getGridList()); |
|
|
|
redisUtils.set(orgTreeCacheKey, result, RedisUtils.MINUTE_THIRTY_EXPIRE); |
|
|
|
} else { |
|
|
|
result = (AgencyTreeResultDTO) o; |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|