From 3a000e56fd4968b83f0c6e3947c1bd8dbd4b03e2 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 May 2023 16:10:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E4=BA=BA=E7=BE=A4?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E7=BB=8F=E7=BA=AC=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java | 2 ++ .../com/epmet/service/impl/LingShanScreenServiceImpl.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java index 726bd63450..f5b0ba1cea 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/lingshan/LingShanSpecialCrowdStatsByOrgResultDTO.java @@ -21,5 +21,7 @@ public class LingShanSpecialCrowdStatsByOrgResultDTO { */ private Integer quantity = 0; + private String longitude; + private String latitude; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java index fc2912ebb6..6346505e91 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.PidUtils; import com.epmet.constant.LevelConstant; import com.epmet.dao.*; @@ -51,9 +52,14 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD List rl = subOrgs.stream().map(sub -> { LingShanSpecialCrowdStatsByOrgResultDTO t = new LingShanSpecialCrowdStatsByOrgResultDTO(); + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(sub.getOrgId()); t.setOrgId(sub.getOrgId()); t.setOrgName(sub.getOrgName()); t.setOrgType(sub.getOrgType()); + if (agencyInfo != null) { + t.setLongitude(agencyInfo.getLongitude()); + t.setLatitude(agencyInfo.getLatitude()); + } t.setOrgIdPath(PidUtils.convertPid2OrgIdPath(sub.getOrgId(), sub.getPids())); return t; }).collect(Collectors.toList()); From a9b14fd3af69bb5bf2e9e335d6491078496c18b1 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 May 2023 17:20:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E3=80=90=E7=81=B5=E5=B1=B1-=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E4=BA=BA=E7=BE=A4=E3=80=91=E5=A4=A7=E5=B1=8F=EF=BC=9A?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E4=BA=BA=E7=BE=A4=E7=82=B9=E4=BD=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E6=89=BE=E4=B8=8D=E5=88=B0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/redis/common/CustomerOrgRedis.java | 4 ++-- .../impl/LingShanScreenServiceImpl.java | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 6d11f67930..7710c324a9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -95,10 +95,10 @@ public class CustomerOrgRedis { } Result agencyInfoResult = customerOrgRedis.commonAggFeignClient.getAgencyInfo(agencyId); if (!agencyInfoResult.success()){ - throw new RenException("查询组织信息失败..."); + throw new RenException("查询行政组织信息失败,组织ID:" + agencyInfoResult); } if (null == agencyInfoResult.getData()){ - throw new RenException("没有此组织信息..."); + throw new RenException("没有此行政组织信息, 组织ID:" + agencyInfoResult); } Map map = BeanUtil.beanToMap(agencyInfoResult.getData(), false, true); customerOrgRedis.redisUtils.hMSet(key, map); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java index 6346505e91..bb2438083e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java +++ b/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.redis.common.CustomerOrgRedis; 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.constant.LevelConstant; +import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.*; import com.epmet.dto.result.SubOrgResDTO; import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; @@ -52,14 +54,25 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD List rl = subOrgs.stream().map(sub -> { 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.setOrgName(sub.getOrgName()); t.setOrgType(sub.getOrgType()); - if (agencyInfo != null) { - t.setLongitude(agencyInfo.getLongitude()); - t.setLatitude(agencyInfo.getLatitude()); - } + t.setLongitude(longitude); + t.setLatitude(latitude); t.setOrgIdPath(PidUtils.convertPid2OrgIdPath(sub.getOrgId(), sub.getPids())); return t; }).collect(Collectors.toList());