From b7a06b6e93c0df03ed84c40385cbe88d27459d4f Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 09 七月 2021 13:27:48 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
index f034a98..3b82fcd 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -121,9 +121,10 @@
                 eventVO.setVideos(videoList);
 
                 //查询网格员头像
-                String imageUrl = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
-                if (StringUtils.isNotEmpty(imageUrl)) {
-                    eventVO.setGridMemberImageUrl(imageUrl);
+                Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
+                if (StringUtils.isNotEmpty(userMap)) {
+                    eventVO.setGridMemberName(userMap.get("nick_name"));
+                    eventVO.setGridMemberImageUrl(userMap.get("image_url"));
                 }
             });
             return R.ok(ipage);
@@ -1264,9 +1265,10 @@
                 eventVO.setPics(picList);
                 eventVO.setVideos(videoList);
                 //查询网格员头像
-                String imageUrl = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
-                if (StringUtils.isNotEmpty(imageUrl)) {
-                    eventVO.setGridMemberImageUrl(imageUrl);
+                Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
+                if (StringUtils.isNotEmpty(userMap)) {
+                    eventVO.setGridMemberName(userMap.get("nick_name"));
+                    eventVO.setGridMemberImageUrl(userMap.get("image_url"));
                 }
             });
             return R.ok(ipage);
@@ -1325,9 +1327,10 @@
                 eventVO.setVideos(videoList);
 
                 //查询网格员头像
-                String imageUrl = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
-                if (StringUtils.isNotEmpty(imageUrl)) {
-                    eventVO.setGridMemberImageUrl(imageUrl);
+                Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId());
+                if (StringUtils.isNotEmpty(userMap)) {
+                    eventVO.setGridMemberName(userMap.get("nick_name"));
+                    eventVO.setGridMemberImageUrl(userMap.get("image_url"));
                 }
             });
             return R.ok(ipage);
@@ -1738,6 +1741,7 @@
 //        if(!latLng.matches("^[\\-\\+]?(0(\\.\\d{1,10})?|([1-9](\\d)?)(\\.\\d{1,10})?|1[0-7]\\d{1}(\\.\\d{1,10})?|180\\.0{1,10}),[\\-\\+]?((0|([1-8]\\d?))(\\.\\d{1,10})?|90(\\.0{1,10})?)$")){
 //            return R.fail("经纬度参数错误");
 //        }
+        //经纬度匹配规则:(短(纬度)在前长(经度)在后,不要擅自修改此规则,否则出现问题后果自负)
         if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){
             return R.fail("经纬度参数错误");
         }
@@ -2196,7 +2200,12 @@
         IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList(new Page(specialPopulationDTO.getPageNum(), specialPopulationDTO.getPageSize()), specialPopulationDTO);
         if(!specialPopulationVOIPage.getRecords().isEmpty()){
             specialPopulationVOIPage.getRecords().forEach(specialPopulation -> {
-                specialPopulation.setAge(IdcardUtil.getAgeByIdCard(specialPopulation.getIdCard()));
+                try {
+                    Integer age = IdcardUtil.getAgeByIdCard(specialPopulation.getIdCard());
+                    specialPopulation.setAge(age);
+                }catch (Exception e){
+                    log.error("身份证号码转换年龄失败,人员id:" + specialPopulation.getId());
+                }
             });
         }
         return R.ok(specialPopulationVOIPage);

--
Gitblit v1.7.1