From 4a406602538a3b32398839f81df582ef48c3350f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 10 Jun 2021 14:01:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=AB=8B=E9=A1=B9=E7=9A=84=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=BB=990=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProjectSatisfactionStatisticsServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java index 119f217c14..d36c39b6d6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java @@ -38,6 +38,7 @@ import com.epmet.dto.result.MassesDiscontentResultDTO; import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.dto.result.ProjectScoreResultDTO; +import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.ProjectSatisfactionStatisticsRedis; @@ -138,6 +139,11 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl Date: Thu, 10 Jun 2021 14:04:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?made=E9=A1=B9=E7=9B=AE=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E7=BB=9980?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProjectSatisfactionStatisticsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java index d36c39b6d6..f3925108f3 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java @@ -142,7 +142,7 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl Date: Thu, 10 Jun 2021 14:43:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/user/impl/UserServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index a7f1d594c4..e38656d2b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.user.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; @@ -752,6 +753,7 @@ public class UserServiceImpl implements UserService { return; } List collection = userDao.selectScreenProjectData(topicUserIdList); + logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList); Map topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); /* if(!CollectionUtils.isEmpty(collection)){ list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) @@ -766,6 +768,7 @@ public class UserServiceImpl implements UserService { return; } List staffList = userDao.selectStaffInfo(staffUserIdList); + logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList); Map collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); list.forEach(project->{ ScreenProjectDataDTO userDTO = collect.get(project.getLinkName()); From 3e56eff0d0b61043165e8d4385f06493b2fa6fcf Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 10 Jun 2021 15:02:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/user/impl/UserServiceImpl.java | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index e38656d2b7..987c9a1167 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -749,37 +749,34 @@ public class UserServiceImpl implements UserService { public void fillScreenProjectData(List list) { List topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin())) .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); - if (CollectionUtils.isEmpty(topicUserIdList)){ - return; + Map topicUserMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(topicUserIdList)){ + List collection = userDao.selectScreenProjectData(topicUserIdList); + logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList); + topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); } - List collection = userDao.selectScreenProjectData(topicUserIdList); - logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList); - Map topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); - /* if(!CollectionUtils.isEmpty(collection)){ - list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) - .map(merge -> { - target.setLinkName(merge.getLinkName()); - target.setLinkMobile(merge.getLinkMobile()); - return target;})); - }*/ + + List staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin())) .map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); - if (CollectionUtils.isEmpty(topicUserIdList)){ - return; + + Map staffMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(topicUserIdList)){ + List staffList = userDao.selectStaffInfo(staffUserIdList); + logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList); + staffMap = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); } - List staffList = userDao.selectStaffInfo(staffUserIdList); - logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList); - Map collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); - list.forEach(project->{ - ScreenProjectDataDTO userDTO = collect.get(project.getLinkName()); - if (userDTO == null){ + + for (ScreenProjectDataDTO project : list) { + ScreenProjectDataDTO userDTO = staffMap.get(project.getLinkName()); + if (userDTO == null) { userDTO = topicUserMap.get(project.getLinkName()); } - if (userDTO != null){ + if (userDTO != null) { project.setLinkName(userDTO.getLinkName()); project.setLinkMobile(userDTO.getLinkMobile()); } - }); + } } /**