From 0dc0a47cf5f655cb0dbff082f7c36613c21e328b Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期一, 12 七月 2021 18:30:01 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java | 41 ++++++++++++++++++++++++++++++----------- 1 files changed, 30 insertions(+), 11 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..0b39198 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); @@ -263,7 +264,7 @@ } //当事件为特殊人群上报时,需要查询事件与人口关联关系 - if(eventDetailsVO.getEventType().equals(6)){ + if(eventDetailsVO.getEventType() != null && eventDetailsVO.getEventType().equals(6)){ List<EventSpecialPopulationDetailsVO> specialPopulationList = eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId()); if(!specialPopulationList.isEmpty()){ specialPopulationList.forEach(special -> { @@ -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("经纬度参数错误"); } @@ -1933,6 +1937,16 @@ } if(statisticsDetailVO.getNoEventZFTotal() == null){ statisticsDetailVO.setNoEventZFTotal(0); + } + + //查询网格 + EventGridDataDO gridDataDO = eventGridDataMapper.selectById(statisticsDTO.getGridId()); + if(gridDataDO != null){ + Map<String,Long> sspCountMap = this.baseMapper.getSSPEventTotal(gridDataDO.getGridCommunityId()); + if(!sspCountMap.isEmpty()){ + statisticsDetailVO.setEventSSPTotal(sspCountMap.get("eventSSPTotal")!=null?sspCountMap.get("eventSSPTotal").intValue():0); + statisticsDetailVO.setNoEventSSPTotal(sspCountMap.get("noEventSSPTotal")!=null?sspCountMap.get("noEventSSPTotal").intValue():0); + } } //统计数据 @@ -2196,7 +2210,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