|
@ -29,7 +29,7 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
import com.epmet.commons.tools.feign.ResultDataResolver; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
import com.epmet.commons.tools.redis.RedisKeys; |
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
import com.epmet.commons.tools.redis.RedisUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
@ -47,7 +47,6 @@ import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; |
|
|
import com.epmet.dto.result.GroupPointRankingResultDTO; |
|
|
import com.epmet.dto.result.GroupPointRankingResultDTO; |
|
|
import com.epmet.entity.BizPointTotalDetailEntity; |
|
|
import com.epmet.entity.BizPointTotalDetailEntity; |
|
|
import com.epmet.resi.group.dto.group.ResiGroupDTO; |
|
|
import com.epmet.resi.group.dto.group.ResiGroupDTO; |
|
|
import com.epmet.resi.group.dto.group.result.RankingResultDTO; |
|
|
|
|
|
import com.epmet.resi.group.enums.SearchScopeTypeEnum; |
|
|
import com.epmet.resi.group.enums.SearchScopeTypeEnum; |
|
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
|
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
|
|
import com.epmet.service.BizPointTotalDetailService; |
|
|
import com.epmet.service.BizPointTotalDetailService; |
|
@ -88,6 +87,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
private RedisTemplate<String, ?> redisTemplate; |
|
|
private RedisTemplate<String, ?> redisTemplate; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private RedisUtils redisUtils; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) { |
|
|
public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) { |
|
@ -320,8 +321,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
ranking ++; |
|
|
ranking ++; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
GridInfoCache gridInfo = getGridInfo(g.getGridId()); |
|
|
CustomerGridDTO gridInfo = getGridInfo(g.getGridId()); |
|
|
g.setGridId(g.getGridId()); |
|
|
//g.setGridId(g.getGridId());
|
|
|
if (gridInfo != null) { |
|
|
if (gridInfo != null) { |
|
|
g.setGridNamePath(gridInfo.getGridNamePath()); |
|
|
g.setGridNamePath(gridInfo.getGridNamePath()); |
|
|
} else { |
|
|
} else { |
|
@ -441,28 +442,19 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota |
|
|
* @author wxz |
|
|
* @author wxz |
|
|
* @date 2021.09.08 11:17:17 |
|
|
* @date 2021.09.08 11:17:17 |
|
|
*/ |
|
|
*/ |
|
|
public GridInfoCache getGridInfo(String gridId) { |
|
|
public CustomerGridDTO getGridInfo(String gridId) { |
|
|
HashOperations<String, String, Object> ope = redisTemplate.opsForHash(); |
|
|
String redisKey = RedisKeys.getGridInfoKey(gridId); |
|
|
Map<String, Object> entries = ope.entries(RedisKeys.getGridInfoKey(gridId)); |
|
|
Map<String, Object> gridCache = redisUtils.hGetAll(redisKey); |
|
|
if (entries.size() != 0) { |
|
|
if (gridCache != null && gridCache.size() > 0) { |
|
|
return BeanUtil.mapToBean(entries, GridInfoCache.class, true); |
|
|
// 直接取缓存中的
|
|
|
|
|
|
CustomerGridDTO gridInfo = BeanUtil.mapToBean(gridCache, CustomerGridDTO.class, true); |
|
|
|
|
|
return gridInfo; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
CustomerGridFormDTO form = new CustomerGridFormDTO(); |
|
|
CustomerGridFormDTO form = new CustomerGridFormDTO(); |
|
|
form.setGridId(gridId); |
|
|
form.setGridId(gridId); |
|
|
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getCustomerGridByGridId(form); |
|
|
Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); |
|
|
if (result == null || !result.success() || result.getData() == null) { |
|
|
return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); |
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GridInfoCache cache = new GridInfoCache(); |
|
|
|
|
|
cache.setCustomerId(result.getData().getCustomerId()); |
|
|
|
|
|
cache.setGridId(result.getData().getId()); |
|
|
|
|
|
cache.setGridNamePath(result.getData().getGridName()); |
|
|
|
|
|
cache.setPid(result.getData().getPid()); |
|
|
|
|
|
cache.setPids(result.getData().getPids()); |
|
|
|
|
|
ope.putAll(RedisKeys.getGridInfoKey(gridId), BeanUtil.beanToMap(cache)); |
|
|
|
|
|
return cache; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|