Browse Source

先进模范数据抽取到大屏表screen_pioneer_dataV0.3

dev_shibei_match
yinzuomei 5 years ago
parent
commit
b1de6d36b4
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java
  2. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  3. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  4. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  5. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  6. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java
  8. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java
  9. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java
  10. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  11. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  12. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  13. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java
  14. 86
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  15. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  16. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  17. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java
  18. 172
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  19. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  20. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  21. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java
  22. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  23. 39
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  24. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  25. 42
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  26. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml
  27. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java

@ -52,7 +52,7 @@ public class TopicOriginInfoDTO implements Serializable {
private Date originalBusinessTime;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
* 小组id
*/
private String groupId;
@ -64,7 +64,7 @@ public class TopicOriginInfoDTO implements Serializable {
/**
* 话题关闭时的状态已解决 resolved未解决 unresolved
*/
// private String closedStatus;
private String closedStatus;
/**
* 网格id ( 其实就是小组所属的网格id)

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -110,4 +110,33 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
* @Date 2020/9/20 22:54
**/
Integer selectIssueTotalTwoMonth(@Param("list") List<String> topicIdList);
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 根据党员ids, 查询党员发布议题数
* @Date 2020/9/23 15:13
**/
int getParyPublishIssueTotal(@Param("customerId") String customerId, @Param("list")List<String> partyMemberUserIds);
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的议题总数
* @Date 2020/9/23 15:23
**/
int getGridIssueTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* @return int
* @param customerId
* @param gridId
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:45
**/
int getShiftProjectTotalByGrid(@Param("customerId") String customerId, @Param("gridId") String gridId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -106,4 +106,15 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @Date 2020/9/20 22:27
**/
Integer selectCountByPartyUser(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("list")List<String> topicIdList);
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param closedStatus
* @author yinzuomei
* @description 具体某个网格内的项目
* @Date 2020/9/23 18:18
**/
Integer getGridClosedProjectTotal(@Param("customerId")String customerId, @Param("gridId") String gridId, @Param("closedStatus") String closedStatus);
}

30
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -75,4 +76,33 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
* @date 2020/9/19 1:58 下午
*/
List<CreateTopicCountResultDTO> selectCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("isParty")Integer isParty);
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:46
**/
int selectPublishedByPartyTopicCount(@Param("customerId") String customerId, @Param("list") List<String> partyMemberUserIds);
/**
* @return int
* @param customerId
* @param gridId
* @author yinzuomei
* @description 具体某个网格的话题数
* @Date 2020/9/23 14:23
**/
int selectGridTopicTotalByGrid(@Param("customerId")String customerId, @Param("gridId")String gridId);
/**
* @return void
* @param list
* @author yinzuomei
* @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS
* @Date 2020/9/23 17:59
**/
void updateFactOriginTopicMain(@Param("list") List<TopicOriginInfoDTO> list);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -60,4 +60,14 @@ public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymembe
* @Date 2020/9/18 9:00
**/
List<FactIndexPartyAblityCpcMonthlyEntity> selectPartyMemberList(String customerId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param gridId
* @author yinzuomei
* @description
* @Date 2020/9/23 14:20
**/
List<String> selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -87,4 +87,13 @@ public interface TopicDao {
**/
List<TopicOriginInfoDTO> selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param dateId
* @author yinzuomei
* @description 查询在这一天发生变化的话题记录
* @Date 2020/9/23 17:52
**/
List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java

@ -113,7 +113,7 @@ public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity {
*/
private Date originalBusinessTime;
/**
* 所有上级组织ID,英文:隔开
* 本表AGENCY_ID的PIDS英文:隔开
*/
private String pids;
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java

@ -100,7 +100,12 @@ public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity {
*/
private Boolean createTopicUserIsParty;
/**
* 所有上级组织ID,英文:隔开
* 本表AGENCY_ID的PIDS英文:隔开
*/
private String pids;
/**
* 关闭状态已解决 resolved未解决 unresolved
*/
private String closedStatus;
}

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java

@ -0,0 +1,31 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
/**
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
public interface FactOriginIssueLogDailyService extends BaseService<FactOriginIssueLogDailyEntity> {
}

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import java.util.List;
/**
* 议题主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
public interface FactOriginIssueMainDailyService extends BaseService<FactOriginIssueMainDailyEntity> {
/**
* @return int
* @param customerId
* @param partyMemberUserIds
* @author yinzuomei
* @description 根据党员ids,查询党员发布议题数
* @Date 2020/9/23 15:11
**/
int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds);
/**
* @return int
* @param customerId
* @param gridId
* @author yinzuomei
* @description 具体某个网格的议题总数
* @Date 2020/9/23 15:22
**/
int getGridIssueTotalByGrid(String customerId, String gridId);
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
**/
Integer getShiftProjectTotalByGrid(String customerId, String gridId);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -163,4 +163,15 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @Date 2020/9/20 22:25
**/
Integer selectCountByPartyUser(String customerId, String monthId, List<String> topicIdList);
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param closedStatus
* @author yinzuomei
* @description 具体某个网格内的项目
* @Date 2020/9/23 18:17
**/
Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java

@ -61,4 +61,23 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @date 2020/9/19 1:58 下午
*/
List<CreateTopicCountResultDTO> selectCreateTopicCount(String customerId, String monthId,Integer isParty);
/**
* @return int
* @param customerId
* @param partyMemberUserIds 党员用户id
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:36
**/
int calPublishedByPartyTopicCount(String customerId,List<String> partyMemberUserIds);
/**
* @return int
* @param customerId
* @param gridId
* @author yinzuomei
* @description 具体某个网格的话题数
* @Date 2020/9/23 14:22
**/
int calGridTopicTotalByGrid(String customerId, String gridId);
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService;
import org.springframework.stereotype.Service;
/**
* 议题记录附表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@DataSource(DataSourceConstant.STATS)
@Service
public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl<FactOriginIssueLogDailyDao, FactOriginIssueLogDailyEntity> implements FactOriginIssueLogDailyService {
}

86
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* 议题主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-23
*/
@DataSource(DataSourceConstant.STATS)
@Slf4j
@Service
public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOriginIssueMainDailyDao, FactOriginIssueMainDailyEntity> implements FactOriginIssueMainDailyService {
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 根据党员ids, 查询党员发布议题数
* @Date 2020/9/23 15:11
**/
@Override
public int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds) {
if(CollectionUtils.isEmpty(partyMemberUserIds)){
return NumConstant.ZERO;
}
return baseDao.getParyPublishIssueTotal(customerId,partyMemberUserIds);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的议题总数
* @Date 2020/9/23 15:22
**/
@Override
public int getGridIssueTotalByGrid(String customerId, String gridId) {
return baseDao.getGridIssueTotalByGrid(customerId,gridId);
}
/**
* @param customerId
* @param gridId
* @return java.lang.Integer
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:39
**/
@Override
public Integer getShiftProjectTotalByGrid(String customerId, String gridId) {
return baseDao.getShiftProjectTotalByGrid(customerId,gridId);
}
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -28,8 +28,8 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import org.apache.commons.lang3.StringUtils;
@ -37,7 +37,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -171,4 +170,18 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
return baseDao.selectCountByPartyUser(customerId,monthId,topicIdList);
}
/**
* @param customerId
* @param gridId
* @param closedStatus
* @return java.lang.Integer
* @author yinzuomei
* @description 具体某个网格内的项目
* @Date 2020/9/23 18:17
**/
@Override
public Integer getGridClosedProjectTotal(String customerId, String gridId, String closedStatus) {
return baseDao.getGridClosedProjectTotal(customerId,gridId,closedStatus);
}
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java

@ -95,9 +95,26 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
saveFactOriginTopicMainDailyEntity(mainDailyEntityList);
//批量保存明细表
saveFactOriginTopicLogDailyEntity(logDailyEntityList);
//更新主表的状态状态、关闭状态
updateFactOriginTopicMain(topicService.queryUpdateTopicOriginInfoList(customerId, dateId));
return true;
}
/**
* @return void
* @param updateTopicOriginInfoList
* @author yinzuomei
* @description 更新话题主表的TOPIC_STATUS , CLOSED_STATUS
* @Date 2020/9/23 17:47
**/
private void updateFactOriginTopicMain(List<TopicOriginInfoDTO> updateTopicOriginInfoList) {
//批量更新
List<List<TopicOriginInfoDTO>> partition = ListUtils.partition(updateTopicOriginInfoList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
baseDao.updateFactOriginTopicMain(list);
});
}
private Map<String, GridInfoDTO> getGridInfoMap(String customerId) {
Map<String ,GridInfoDTO> map=new HashMap<>();
@ -150,6 +167,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
Map<String, Object> map=new HashMap<>();
List<FactOriginTopicMainDailyEntity> mainDailyEntityList=new ArrayList<>();
List<FactOriginTopicLogDailyEntity> logDailyEntityList=new ArrayList<>();
List<String> userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList());
Map<String,Integer> userIsPartyMap = userService.selectUserIsParty(userIds);
for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){
@ -256,4 +274,33 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
public List<CreateTopicCountResultDTO> selectCreateTopicCount(String customerId, String monthId,Integer isParty) {
return baseDao.selectCreateTopicCount(customerId, monthId, isParty);
}
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 党员提出的话题总数
* @Date 2020/9/23 13:36
**/
@Override
public int calPublishedByPartyTopicCount(String customerId,List<String> partyMemberUserIds) {
if(CollectionUtils.isEmpty(partyMemberUserIds)){
return NumConstant.ZERO;
}
return baseDao.selectPublishedByPartyTopicCount(customerId,partyMemberUserIds);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 具体某个网格的话题数
* @Date 2020/9/23 14:22
**/
@Override
public int calGridTopicTotalByGrid(String customerId, String gridId) {
return baseDao.selectGridTopicTotalByGrid(customerId,gridId);
}
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java

@ -7,18 +7,6 @@ package com.epmet.service.evaluationindex.extract.toscreen;
* @date 2020/9/22 11:25
*/
public interface PioneerDataExtractService {
/**
* @return void
* @param customerId
* @param dateId
* @author yinzuomei
* @description 总方法入口
* @Date 2020/9/22 14:17
**/
void extractPioneerData(String customerId, String dateId);
// 机关级别(社区级:community,
// 乡(镇、街道)级:street,
// 区县级: district,

172
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java

@ -1,13 +1,20 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.PioneerDataExtractService;
import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
@ -20,24 +27,14 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Autowired
private ScreenPioneerDataService screenPioneerDataService;
/**
* @param customerId
* @param dateId
* @return void
* @author yinzuomei
* @description 总方法入口
* @Date 2020/9/22 14:17
**/
@Override
public void extractPioneerData(String customerId, String dateId) {
extractGridPioneerData(customerId, dateId);
extractCommunityPioneerData(customerId, dateId);
extractStreetPioneerData(customerId, dateId);
extractDistrictPioneerData(customerId, dateId);
extractCityPioneerData(customerId, dateId);
extractProvincePioneerData(customerId, dateId);
}
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private DimCustomerPartymemberService dimCustomerPartymemberService;
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
/**
* @param customerId
@ -50,17 +47,146 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
@Override
public void extractGridPioneerData(String customerId, String dateId) {
//查询客户下所有的网格,初始数据值为0
List<ScreenPioneerDataEntity> gridList=screenPioneerDataService.initPioneerDataList(customerId,"grid", StrConstant.EPMETY_STR);
if(CollectionUtils.isEmpty(gridList)){
List<ScreenPioneerDataEntity> gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid", StrConstant.EPMETY_STR);
if (CollectionUtils.isEmpty(gridList)) {
return;
}
gridList.forEach(entity->{
gridList.forEach(entity -> {
entity.setDataEndTime(dateId);
String gridId = entity.getOrgId();
//1、党员参与议事 todo
entity.setIssueTotal(NumConstant.ZERO);
//2、党员参与议事占比 todo
entity.setIssueRatio(BigDecimal.ZERO);
//网格内的党员集合
List<String> partyMemberUserIds = dimCustomerPartymemberService.getPartyMemberUserIds(customerId, gridId);
//3、党员发布话题:
entity.setTopicTotal(getTopicTotal(customerId, partyMemberUserIds));
//4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率
if (entity.getTopicTotal() == NumConstant.ZERO) {
entity.setTopicRatio(BigDecimal.ZERO);
} else {
//当前网格内所有话题总数
int gridTopicTotal = getGridTopicTotal(customerId, gridId);
entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
//当前网格内所有议题总数
int gridIssueTotal = getGridIssueTotal(customerId, gridId);
if (gridIssueTotal != NumConstant.ZERO) {
//5、党员发布议题
entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, partyMemberUserIds));
//6、党员发布议题占比 : 占网格内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.ZERO);
}
entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
//7、议题转项目数
entity.setShiftProjectTotal(getGridShiftProjectTotal(customerId, gridId));
//8、议题转项目占比 : 占网格内议题总数的比率
entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
// 9、已解决项目
entity.setResolvedProjectTotal(getGridClosedProjectTotal(customerId,gridId,"resolved"));
if(entity.getResolvedProjectTotal()==NumConstant.ZERO){
entity.setResolvedProjectRatio(BigDecimal.ZERO);
}else{
// 10、占总结项目
int closedProjectTotal=getGridClosedProjectTotal(customerId,gridId,null);
entity.setResolvedProjectRatio(closedProjectTotal==NumConstant.ZERO?BigDecimal.ZERO:new BigDecimal(entity.getResolvedProjectTotal()/closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP));
}
});
screenPioneerDataService.delAndSavePioneerData(customerId,"grid",dateId, IndexCalConstant.DELETE_SIZE,gridList);
screenPioneerDataService.delAndSavePioneerData(customerId, "grid", dateId, IndexCalConstant.DELETE_SIZE, gridList);
}
/**
* @return java.lang.Integer
* @param customerId
* @param gridId
* @param closedStatus 结案状态已解决 resolved未解决 unresolved
* @author yinzuomei
* @description 网格内已解决项目
* @Date 2020/9/23 16:24
**/
private Integer getGridClosedProjectTotal(String customerId, String gridId,String closedStatus) {
return factOriginProjectMainDailyService.getGridClosedProjectTotal(customerId,gridId,closedStatus);
}
/**
* @param customerId
* @param partyMemberUserIds
* @return int
* @author yinzuomei
* @description 党员发布的话题总数
* @Date 2020/9/23 13:44
**/
private int getTopicTotal(String customerId, List<String> partyMemberUserIds) {
if (CollectionUtils.isEmpty(partyMemberUserIds)) {
//如果网格内没有党员,直接返回0
return NumConstant.ZERO;
}
return factOriginTopicMainDailyService.calPublishedByPartyTopicCount(customerId, partyMemberUserIds);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 当前网格内发布的话题总数
* @Date 2020/9/23 14:18
**/
private int getGridTopicTotal(String customerId, String gridId) {
return factOriginTopicMainDailyService.calGridTopicTotalByGrid(customerId, gridId);
}
/**
* @param customerId
* @param partyMemberUserIds
* @return java.lang.Integer
* @author yinzuomei
* @description 党员发布的议题总数
* @Date 2020/9/23 14:39
**/
private int getParyPublishIssueTotal(String customerId, List<String> partyMemberUserIds) {
if (CollectionUtils.isEmpty(partyMemberUserIds)) {
return NumConstant.ZERO;
}
return factOriginIssueMainDailyService.getParyPublishIssueTotal(customerId, partyMemberUserIds);
}
/**
* @param customerId
* @param gridId
* @return int
* @author yinzuomei
* @description 当前网格内所有议题总数
* @Date 2020/9/23 15:21
**/
private int getGridIssueTotal(String customerId, String gridId) {
return factOriginIssueMainDailyService.getGridIssueTotalByGrid(customerId, gridId);
}
/**
* @param customerId
* @param gridId
* @return java.lang.Integer
* @author yinzuomei
* @description 网格内议题转项目数
* @Date 2020/9/23 15:38
**/
private Integer getGridShiftProjectTotal(String customerId, String gridId) {
return factOriginIssueMainDailyService.getShiftProjectTotalByGrid(customerId, gridId);
}
@Override
public void extractCommunityPioneerData(String customerId, String dateId) {

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -111,4 +111,13 @@ public interface DimCustomerPartymemberService extends BaseService<DimCustomerPa
* @Date 2020/9/18 9:03
**/
List<FactIndexPartyAblityCpcMonthlyEntity> selectPartyMemberList(String customerId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param gridId
* @author yinzuomei
* @description 查询在本网格注册的党员id
* @Date 2020/9/23 14:18
**/
List<String> getPartyMemberUserIds(String customerId, String gridId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -190,4 +190,19 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
}
}
/**
* @param customerId
* @param gridId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询在本网格注册的党员id
* @Date 2020/9/23 14:18
**/
@DataSource(value = DataSourceConstant.STATS)
@Override
public List<String> getPartyMemberUserIds(String customerId, String gridId) {
return baseDao.selectGridPartyMemberUserIds(customerId,gridId);
}
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java

@ -53,4 +53,13 @@ public interface TopicService {
*/
List<TopicInfoResultDTO> selectTopicInfo(List<String> topicIds);
/**
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @param customerId
* @param updateDateId
* @author yinzuomei
* @description 查询在这一天发生变化的话题记录
* @Date 2020/9/23 17:51
**/
List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(String customerId, String updateDateId);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -8,7 +8,6 @@ import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.result.TopicInfoResultDTO;
import com.epmet.dto.stats.DimTopicStatusDTO;
import com.epmet.dto.stats.topic.*;
import com.epmet.dto.stats.topic.result.GridTopicData;
import com.epmet.dto.stats.topic.result.GroupTopicData;
import com.epmet.dto.stats.topic.result.TopicStatisticalData;
import com.epmet.dto.topic.ResiTopicDTO;
@ -114,6 +113,18 @@ public class TopicServiceImpl implements TopicService {
return topicDao.selectTopicInfo(topicIds);
}
/**
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.topic.TopicOriginInfoDTO>
* @author yinzuomei
* @description 查询在这一天发生变化的话题记录
* @Date 2020/9/23 17:51
**/
@Override
public List<TopicOriginInfoDTO> queryUpdateTopicOriginInfoList(String customerId, String updateDateId) {
return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId);
}
/**

39
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -166,4 +166,43 @@
AND (MONTH_ID = #{monthId} OR MONTH_ID = #{minusMonthId})
GROUP BY GRID_ID
</select>
<!-- 根据党员ids, 查询党员发布议题数 -->
<select id="getParyPublishIssueTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
t1.CREATE_TOPIC_USER_ID=#{userId}
</foreach>
</select>
<!-- 具体某个网格的议题总数 -->
<select id="getGridIssueTotalByGrid" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
</select>
<!-- 网格内议题转项目数 -->
<select id="getShiftProjectTotalByGrid" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ID ) AS total
FROM
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
AND T1.ISSUE_STATUS='shift_project'
</select>
</mapper>

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -143,4 +143,19 @@
T1.TOPIC_ID =#{topicId}
</foreach>
</select>
<!-- 具体某个网格内的项目 -->
<select id="getGridClosedProjectTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_project_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
and t1.GRID_ID=#{gridId}
<if test='null != closedStatus and "" != closedStatus'>
and t1.CLOSED_STATUS=#{closedStatus}
</if>
</select>
</mapper>

42
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -36,7 +36,8 @@
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME,
PIDS
PIDS,
CLOSED_STATUS
) values
<foreach collection="list" item="item" index="index" separator=",">
(
@ -60,7 +61,8 @@
now(),
'APP_USER',
now(),
#{item.pids}
#{item.pids},
#{item.closedStatus}
)
</foreach>
</insert>
@ -94,4 +96,40 @@
AND CREATE_TOPIC_USER_IS_PARTY = #{isParty}
GROUP BY GRID_ID
</select>
<!-- 党员提出的话题总数 -->
<select id="selectPublishedByPartyTopicCount" parameterType="map" resultType="java.lang.Integer">
SELECT
count(T1.ID) AS TOTAL
FROM
fact_origin_topic_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
T1.CREATE_TOPIC_USER_ID=#{userId}
</foreach>
</select>
<!-- 具体某个网格的话题数 -->
<select id="selectGridTopicTotalByGrid" parameterType="map" resultType="java.lang.Integer">
SELECT
count(T1.ID) AS TOTAL
FROM
fact_origin_topic_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.GRID_ID=#{gridId}
</select>
<update id="updateFactOriginTopicMain" parameterType="map">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update fact_origin_topic_main_daily
set TOPIC_STATUS=#{item.topicStatus},
CLOSED_STATUS=#{item.closedStatus},
UPDATED_TIME=NOW()
where id = ${item.topicId}
</foreach>
</update>
</mapper>

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

@ -87,4 +87,15 @@
dcp.DEL_FLAG = '0'
AND dcp.CUSTOMER_ID =#{customerId}
</select>
<!-- 查询网格内注册的党员,用户id -->
<select id="selectGridPartyMemberUserIds" parameterType="map" resultType="java.lang.String">
select dcp.USER_ID
FROM
dim_customer_partymember dcp
WHERE
dcp.DEL_FLAG = '0'
AND dcp.CUSTOMER_ID =#{customerId}
and dcp.GRID_ID=#{gridId}
</select>
</mapper>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

@ -162,12 +162,7 @@
<select id="selectListTopicOriginInfo" parameterType="map" resultType="com.epmet.dto.topic.TopicOriginInfoDTO">
SELECT
rto.TOPIC_ID,
(case
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='resolved' then 'closed_resolved'
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='unresolved' then 'closed_unresolved'
else rto.OPERATION_TYPE
end
)as ACTION_CODE,
rto.OPERATION_TYPE as ACTION_CODE,
rto.CREATED_BY as OPERATE_USER_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID,
@ -176,7 +171,8 @@
rt.GROUP_ID,
rt.STATUS as TOPIC_STATUS,
rg.GRID_ID,
RG.CUSTOMER_ID
RG.CUSTOMER_ID,
rt.CLOSED_STATUS
FROM
resi_topic_operation rto
LEFT JOIN resi_topic rt ON ( rto.TOPIC_ID = rt.id AND rt.DEL_FLAG = '0' )
@ -197,7 +193,8 @@
rt.GROUP_ID ,
rt.STATUS as TOPIC_STATUS,
rg.GRID_ID,
rg.CUSTOMER_ID
rg.CUSTOMER_ID,
rt.CLOSED_STATUS
FROM
resi_topic_comment rtc
LEFT JOIN resi_topic rt ON ( rtc.TOPIC_ID = rt.id AND rt.DEL_FLAG = '0' )
@ -208,4 +205,14 @@
AND RG.CUSTOMER_ID =#{customerId}
</select>
<!-- 查询在这一天发生变化的话题记录 -->
<select id="queryUpdateTopicOriginInfoList" parameterType="map" resultType="com.epmet.dto.topic.TopicOriginInfoDTO">
select
rt.id as TOPIC_ID,
rt.CLOSED_STATUS,
rt.STATUS as TOPIC_STATUS
from resi_topic rt
where rt.del_flag='0'
and DATE_FORMAT( rt.UPDATED_TIME, '%Y%m%d' )=#{dateId}
</select>
</mapper>
Loading…
Cancel
Save