Browse Source

fix:【灵山-特殊人群】大屏:特殊人群点位展示,找不到组织的bug

master
wxz 2 years ago
parent
commit
a9b14fd3af
  1. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  2. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -95,10 +95,10 @@ public class CustomerOrgRedis {
} }
Result<AgencyInfoCache> agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId); Result<AgencyInfoCache> agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId);
if (!agencyInfoResult.success()){ if (!agencyInfoResult.success()){
throw new RenException("查询组织信息失败..."); throw new RenException("查询行政组织信息失败,组织ID:" + agencyInfoResult);
} }
if (null == agencyInfoResult.getData()){ if (null == agencyInfoResult.getData()){
throw new RenException("没有此组织信息..."); throw new RenException("没有此行政组织信息, 组织ID:" + agencyInfoResult);
} }
Map<String, Object> map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true); Map<String, Object> map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map); customerOrgRedis.redisUtils.hMSet(key, map);

23
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java

@ -6,8 +6,10 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.PidUtils;
import com.epmet.constant.LevelConstant; import com.epmet.constant.LevelConstant;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.*; import com.epmet.dao.*;
import com.epmet.dto.result.SubOrgResDTO; import com.epmet.dto.result.SubOrgResDTO;
import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO;
@ -52,14 +54,25 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD
List<LingShanSpecialCrowdStatsByOrgResultDTO> rl = subOrgs.stream().map(sub -> { List<LingShanSpecialCrowdStatsByOrgResultDTO> rl = subOrgs.stream().map(sub -> {
LingShanSpecialCrowdStatsByOrgResultDTO t = new LingShanSpecialCrowdStatsByOrgResultDTO(); LingShanSpecialCrowdStatsByOrgResultDTO t = new LingShanSpecialCrowdStatsByOrgResultDTO();
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(sub.getOrgId());
String longitude = null;
String latitude = null;
if (OrgInfoConstant.AGENCY.equals(sub.getOrgType())) {
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(sub.getOrgId());
longitude = agencyInfo.getLongitude();
latitude = agencyInfo.getLatitude();
} else if (OrgInfoConstant.GRID.equals(sub.getOrgType())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(sub.getOrgId());
longitude = gridInfo.getLongitude();
latitude = gridInfo.getLatitude();
}
t.setOrgId(sub.getOrgId()); t.setOrgId(sub.getOrgId());
t.setOrgName(sub.getOrgName()); t.setOrgName(sub.getOrgName());
t.setOrgType(sub.getOrgType()); t.setOrgType(sub.getOrgType());
if (agencyInfo != null) { t.setLongitude(longitude);
t.setLongitude(agencyInfo.getLongitude()); t.setLatitude(latitude);
t.setLatitude(agencyInfo.getLatitude());
}
t.setOrgIdPath(PidUtils.convertPid2OrgIdPath(sub.getOrgId(), sub.getPids())); t.setOrgIdPath(PidUtils.convertPid2OrgIdPath(sub.getOrgId(), sub.getPids()));
return t; return t;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

Loading…
Cancel
Save