|
|
@ -16,6 +16,7 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
@ -24,6 +25,8 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
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.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.CustomerAgencyConstant; |
|
|
@ -81,6 +84,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
private EpmetUserFeignClient epmetUserFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<CustomerAgencyDTO> page(Map<String, Object> params) { |
|
|
@ -1122,8 +1127,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao |
|
|
|
result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel())); |
|
|
|
result.setLongitude(rootAgency.getLongitude()); |
|
|
|
result.setLatitude(rootAgency.getLatitude()); |
|
|
|
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId()); |
|
|
|
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList()); |
|
|
|
|
|
|
|
String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(rootAgency.getAgencyId()); |
|
|
|
Object o = redisUtils.get(orgTreeCacheKey); |
|
|
|
if (o == null){ |
|
|
|
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId()); |
|
|
|
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList()); |
|
|
|
redisUtils.set(orgTreeCacheKey,result, RedisUtils.MINUTE_THIRTY_EXPIRE); |
|
|
|
}else { |
|
|
|
result = (AgencyTreeResultDTO) o; |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
/** |
|
|
|