Browse Source

数据统计修改

master
zxc 5 years ago
parent
commit
dfc78dea27
  1. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java
  2. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  3. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
  4. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  5. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
  6. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
  7. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java

@ -32,7 +32,7 @@ public interface GroupDao {
* @param * @param
* @author zxc * @author zxc
*/ */
List<GroupSubAgencyResultDTO> getSubGroupCount(); List<GroupSubAgencyResultDTO> getSubGroupCount(@Param("customerId") String customerId);
/** /**
* @Description 获取直属网格下的小组数 * @Description 获取直属网格下的小组数

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -54,7 +54,7 @@ public interface TopicDao {
* @param * @param
* @author zxc * @author zxc
*/ */
List<TopicSubAgencyResultDTO> getAllTopicShiftedInfoLastDay(); List<TopicSubAgencyResultDTO> getAllTopicShiftedInfoLastDay(@Param("customerId") String customerId);
/** /**
* @Description 校验机关下是否存在直属网格 * @Description 校验机关下是否存在直属网格
@ -75,7 +75,7 @@ public interface TopicDao {
* @param * @param
* @author zxc * @author zxc
*/ */
List<TopicSubGridResultDTO> getGridAllTopicShiftedInfoLastDay(); List<TopicSubGridResultDTO> getGridAllTopicShiftedInfoLastDay(@Param("customerId")String customerId);
/** /**
* @Description 话题日增长 * @Description 话题日增长

5
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 @Override
public List<GroupSubAgencyResultDTO> subAgency(TokenDto tokenDto) { public List<GroupSubAgencyResultDTO> subAgency(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto); String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<GroupSubAgencyResultDTO> result = new ArrayList<>(); List<GroupSubAgencyResultDTO> result = new ArrayList<>();
//获取下级机关
List<SubAgencyResultDTO> subAgencyList = groupDao.getSubAgencyList(agencyId); List<SubAgencyResultDTO> subAgencyList = groupDao.getSubAgencyList(agencyId);
List<GroupSubAgencyResultDTO> subGroupCount = groupDao.getSubGroupCount(); //查询客户下
List<GroupSubAgencyResultDTO> subGroupCount = groupDao.getSubGroupCount(customerId);
if (subAgencyList.size()!= NumConstant.ZERO){ if (subAgencyList.size()!= NumConstant.ZERO){
subGroupCount.forEach(group -> { subGroupCount.forEach(group -> {
subAgencyList.forEach(subAgency -> { subAgencyList.forEach(subAgency -> {

6
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 @Override
public List<TopicSubGridResultDTO> topicSubGrid(TokenDto tokenDto) { public List<TopicSubGridResultDTO> topicSubGrid(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto); String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<TopicSubGridResultDTO> result = new ArrayList<>(); List<TopicSubGridResultDTO> result = new ArrayList<>();
List<TopicSubGridResultDTO> resultAll = new ArrayList<>(); List<TopicSubGridResultDTO> resultAll = new ArrayList<>();
List<String> subGridIdList = topicDao.getSubGridIdList(agencyId); List<String> subGridIdList = topicDao.getSubGridIdList(agencyId);
if (subGridIdList.size() != NumConstant.ZERO){ if (subGridIdList.size() != NumConstant.ZERO){
List<TopicSubGridResultDTO> gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); List<TopicSubGridResultDTO> gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay();
List<TopicSubGridResultDTO> gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(); List<TopicSubGridResultDTO> gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(customerId);
subGridIdList.forEach(gridId -> { subGridIdList.forEach(gridId -> {
gridAllTopicInfoLastDay.forEach(gridTopic -> { gridAllTopicInfoLastDay.forEach(gridTopic -> {
if (gridId.equals(gridTopic.getGridId())){ if (gridId.equals(gridTopic.getGridId())){
@ -135,13 +136,14 @@ public class TopicServiceImpl implements TopicService {
@Override @Override
public List<TopicSubAgencyResultDTO> topicSubAgency(TokenDto tokenDto) { public List<TopicSubAgencyResultDTO> topicSubAgency(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto); String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<TopicSubAgencyResultDTO> result = new ArrayList<>(); List<TopicSubAgencyResultDTO> result = new ArrayList<>();
List<TopicSubAgencyResultDTO> resultAll = new ArrayList<>(); List<TopicSubAgencyResultDTO> resultAll = new ArrayList<>();
List<String> subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); List<String> subAgencyIdList = topicDao.getSubAgencyIdList(agencyId);
//存在下级机关 //存在下级机关
if (subAgencyIdList.size() != NumConstant.ZERO){ if (subAgencyIdList.size() != NumConstant.ZERO){
List<TopicSubAgencyResultDTO> allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); List<TopicSubAgencyResultDTO> allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay();
List<TopicSubAgencyResultDTO> allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(); List<TopicSubAgencyResultDTO> allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(customerId);
//话题状态为 已关闭、讨论中、已屏蔽 //话题状态为 已关闭、讨论中、已屏蔽
subAgencyIdList.forEach(agencyIdOne -> { subAgencyIdList.forEach(agencyIdOne -> {
allTopicInfoLastDay.forEach(agency -> { allTopicInfoLastDay.forEach(agency -> {

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

@ -43,6 +43,7 @@
AND da.del_flag = '0' AND da.del_flag = '0'
WHERE WHERE
fgad.del_flag = '0' 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') AND fgad.date_id = (SELECT MAX(date_id) FROM fact_group_agency_daily WHERE del_flag = '0')
</select> </select>

2
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' LEFT JOIN dim_agency da ON da.id = ftiad.agency_id AND da.del_flag = '0'
WHERE WHERE
ftiad.del_flag = '0' 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') AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_agency_daily WHERE del_flag = '0')
</select> </select>
@ -138,6 +139,7 @@
LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0' LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0'
WHERE WHERE
ftiad.del_flag = '0' 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') AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_grid_daily WHERE del_flag = '0')
</select> </select>

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java

@ -21,24 +21,24 @@ public interface GroupDataService {
/** /**
* @Description 获取同级机关下网格下的小组数量 * @Description 获取同级机关下网格下的小组数量
* @param allGrid * @param
* @author zxc * @author zxc
*/ */
List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(List<String> allGrid,String dateId); List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(String customerId,String dateId);
/** /**
* @Description 查询机关下网格内的小组人数 * @Description 查询机关下网格内的小组人数
* @param * @param
* @author zxc * @author zxc
*/ */
List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(List<String> allGrid,String dateId); List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(String customerId,String dateId);
/** /**
* @Description 查询机关下每个小组的人数 * @Description 查询机关下每个小组的人数
* @param * @param
* @author zxc * @author zxc
*/ */
List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(List<String> allGrid,String dateId); List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(String customerId,String dateId);
/** /**
* @Description 查询机关下的小组日增数 * @Description 查询机关下的小组日增数
@ -46,7 +46,7 @@ public interface GroupDataService {
* @param yesterday * @param yesterday
* @author zxc * @author zxc
*/ */
List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(List<String> allGrid,String yesterday); List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(String customerId,String yesterday);
/** /**
* @Description 查询机关下所有网格小组人数 * @Description 查询机关下所有网格小组人数

Loading…
Cancel
Save