From dfc78dea276c157f38732e4bc872cece83e5a217 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 29 Jun 2020 14:08:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/group/GroupDao.java | 2 +- .../src/main/java/com/epmet/dao/topic/TopicDao.java | 4 ++-- .../com/epmet/service/group/impl/GroupServiceImpl.java | 5 ++++- .../com/epmet/service/topic/impl/TopicServiceImpl.java | 6 ++++-- .../src/main/resources/mapper/group/GroupDao.xml | 1 + .../src/main/resources/mapper/topic/TopicDao.xml | 2 ++ .../java/com/epmet/service/group/GroupDataService.java | 10 +++++----- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java index 0f22c81d2b..e2a8410272 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java @@ -32,7 +32,7 @@ public interface GroupDao { * @param * @author zxc */ - List getSubGroupCount(); + List getSubGroupCount(@Param("customerId") String customerId); /** * @Description 获取直属网格下的小组数 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java index e45798d750..2ab863ab78 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -54,7 +54,7 @@ public interface TopicDao { * @param * @author zxc */ - List getAllTopicShiftedInfoLastDay(); + List getAllTopicShiftedInfoLastDay(@Param("customerId") String customerId); /** * @Description 校验机关下是否存在直属网格 @@ -75,7 +75,7 @@ public interface TopicDao { * @param * @author zxc */ - List getGridAllTopicShiftedInfoLastDay(); + List getGridAllTopicShiftedInfoLastDay(@Param("customerId")String customerId); /** * @Description 话题日增长 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java index 1c72f584fc..21fdfac41b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java @@ -50,9 +50,12 @@ public class GroupServiceImpl implements GroupService { @Override public List subAgency(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); + String customerId = tokenDto.getCustomerId(); List result = new ArrayList<>(); + //获取下级机关 List subAgencyList = groupDao.getSubAgencyList(agencyId); - List subGroupCount = groupDao.getSubGroupCount(); + //查询客户下 + List subGroupCount = groupDao.getSubGroupCount(customerId); if (subAgencyList.size()!= NumConstant.ZERO){ subGroupCount.forEach(group -> { subAgencyList.forEach(subAgency -> { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 3b81c15cfa..eb49ff744a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -94,12 +94,13 @@ public class TopicServiceImpl implements TopicService { @Override public List topicSubGrid(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); + String customerId = tokenDto.getCustomerId(); List result = new ArrayList<>(); List resultAll = new ArrayList<>(); List subGridIdList = topicDao.getSubGridIdList(agencyId); if (subGridIdList.size() != NumConstant.ZERO){ List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); - List gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(); + List gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(customerId); subGridIdList.forEach(gridId -> { gridAllTopicInfoLastDay.forEach(gridTopic -> { if (gridId.equals(gridTopic.getGridId())){ @@ -135,13 +136,14 @@ public class TopicServiceImpl implements TopicService { @Override public List topicSubAgency(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); + String customerId = tokenDto.getCustomerId(); List result = new ArrayList<>(); List resultAll = new ArrayList<>(); List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); //存在下级机关 if (subAgencyIdList.size() != NumConstant.ZERO){ List allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); - List allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(); + List allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(customerId); //话题状态为 已关闭、讨论中、已屏蔽 subAgencyIdList.forEach(agencyIdOne -> { allTopicInfoLastDay.forEach(agency -> { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index 008dc0175f..e374c96d45 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -43,6 +43,7 @@ AND da.del_flag = '0' WHERE fgad.del_flag = '0' + AND fgad.customer_id = #{customerId} AND fgad.date_id = (SELECT MAX(date_id) FROM fact_group_agency_daily WHERE del_flag = '0') diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 00f845829a..29ddddc6c6 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -94,6 +94,7 @@ LEFT JOIN dim_agency da ON da.id = ftiad.agency_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' + AND ftiad.customer_id = #{customerId} AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_agency_daily WHERE del_flag = '0') @@ -138,6 +139,7 @@ LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0' WHERE ftiad.del_flag = '0' + AND ftiad.customer_id = #{customerId} AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_grid_daily WHERE del_flag = '0') diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index a6d61a756e..82588801a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -21,24 +21,24 @@ public interface GroupDataService { /** * @Description 获取同级机关下网格下的小组数量 - * @param allGrid + * @param * @author zxc */ - List getAgencyGroupTotalCount(List allGrid,String dateId); + List getAgencyGroupTotalCount(String customerId,String dateId); /** * @Description 查询机关下网格内的小组人数 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId); + List selectAgencyGridGroupPeopleTotal(String customerId,String dateId); /** * @Description 查询机关下每个小组的人数 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId); + List selectAgencyEveryGroupPeopleCount(String customerId,String dateId); /** * @Description 查询机关下的小组日增数 @@ -46,7 +46,7 @@ public interface GroupDataService { * @param yesterday * @author zxc */ - List selectAgencyGroupIncr(List allGrid,String yesterday); + List selectAgencyGroupIncr(String customerId,String yesterday); /** * @Description 查询机关下所有网格小组人数