From b1de6d36b4ed8c29cf1c8a82a487c4289932c3ae Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Sep 2020 18:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=A8=A1=E8=8C=83=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0=E5=A4=A7=E5=B1=8F=E8=A1=A8?= =?UTF-8?q?screen=5Fpioneer=5FdataV0.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/topic/TopicOriginInfoDTO.java | 4 +- .../extract/FactOriginIssueMainDailyDao.java | 29 +++ .../FactOriginProjectMainDailyDao.java | 11 ++ .../extract/FactOriginTopicMainDailyDao.java | 30 +++ .../dao/stats/DimCustomerPartymemberDao.java | 10 + .../java/com/epmet/dao/topic/TopicDao.java | 9 + .../FactOriginTopicLogDailyEntity.java | 2 +- .../FactOriginTopicMainDailyEntity.java | 7 +- .../FactOriginIssueLogDailyService.java | 31 ++++ .../FactOriginIssueMainDailyService.java | 61 +++++++ .../FactOriginProjectMainDailyService.java | 11 ++ .../FactOriginTopicMainDailyService.java | 19 ++ .../FactOriginIssueLogDailyServiceImpl.java | 39 ++++ .../FactOriginIssueMainDailyServiceImpl.java | 86 +++++++++ ...FactOriginProjectMainDailyServiceImpl.java | 17 +- .../FactOriginTopicMainDailyServiceImpl.java | 47 +++++ .../toscreen/PioneerDataExtractService.java | 12 -- .../impl/PioneerDataExtractServiceImpl.java | 172 +++++++++++++++--- .../stats/DimCustomerPartymemberService.java | 9 + .../DimCustomerPartymemberServiceImpl.java | 15 ++ .../com/epmet/service/topic/TopicService.java | 9 + .../service/topic/impl/TopicServiceImpl.java | 13 +- .../extract/FactOriginIssueMainDailyDao.xml | 39 ++++ .../extract/FactOriginProjectMainDailyDao.xml | 15 ++ .../extract/FactOriginTopicMainDailyDao.xml | 42 ++++- .../stats/DimCustomerPartymemberDao.xml | 11 ++ .../main/resources/mapper/topic/TopicDao.xml | 23 ++- 27 files changed, 721 insertions(+), 52 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java index 9514d388c5..2abb8309a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java +++ b/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) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 5ef3c02f02..e0e95effc1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/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 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 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); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 53301ae998..f338e88695 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/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 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); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 8da1ea3774..11ef0a50d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/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 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 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 list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index eee170f6f7..f0eeaf9321 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/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 selectPartyMemberList(String customerId); + + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description + * @Date 2020/9/23 14:20 + **/ + List selectGridPartyMemberUserIds(@Param("customerId") String customerId, @Param("gridId")String gridId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index b078ed45aa..30406b6031 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -87,4 +87,13 @@ public interface TopicDao { **/ List selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + /** + * @return java.util.List + * @param customerId + * @param dateId + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:52 + **/ + List queryUpdateTopicOriginInfoList(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java index 4cfdce2cb8..83a6ec61ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java +++ b/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; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java index e9b88a2fe8..917e95863d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java +++ b/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; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java new file mode 100644 index 0000000000..625804fff9 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java new file mode 100644 index 0000000000..7061178362 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 { + + /** + * @return int + * @param customerId + * @param partyMemberUserIds + * @author yinzuomei + * @description 根据党员ids,查询党员发布议题数 + * @Date 2020/9/23 15:11 + **/ + int getParyPublishIssueTotal(String customerId, List 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); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 58391c62f8..ea2679c372 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/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 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); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index ccd5d5cab2..aaa4d8cbcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/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 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 partyMemberUserIds); + /** + * @return int + * @param customerId + * @param gridId + * @author yinzuomei + * @description 具体某个网格的话题数 + * @Date 2020/9/23 14:22 + **/ + int calGridTopicTotalByGrid(String customerId, String gridId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java new file mode 100644 index 0000000000..df81cee703 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 implements FactOriginIssueLogDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java new file mode 100644 index 0000000000..78d9434cd1 --- /dev/null +++ b/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 + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 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 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); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index dae02f65b5..f38a04aefc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/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 updateTopicOriginInfoList) { + //批量更新 + List> partition = ListUtils.partition(updateTopicOriginInfoList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.updateFactOriginTopicMain(list); + }); + } + private Map getGridInfoMap(String customerId) { Map map=new HashMap<>(); @@ -150,6 +167,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl map=new HashMap<>(); List mainDailyEntityList=new ArrayList<>(); List logDailyEntityList=new ArrayList<>(); + List userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList()); Map userIsPartyMap = userService.selectUserIsParty(userIds); for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){ @@ -256,4 +274,33 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl 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 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); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java index 520977c323..7aadba0ae5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PioneerDataExtractService.java +++ b/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, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index f8230b191c..e363b39646 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/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 gridList=screenPioneerDataService.initPioneerDataList(customerId,"grid", StrConstant.EPMETY_STR); - if(CollectionUtils.isEmpty(gridList)){ + List 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 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 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 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) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index 137aebedbe..fe6f41e37c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/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 selectPartyMemberList(String customerId); + /** + * @return java.util.List + * @param customerId + * @param gridId + * @author yinzuomei + * @description 查询在本网格注册的党员id + * @Date 2020/9/23 14:18 + **/ + List getPartyMemberUserIds(String customerId, String gridId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 689592e636..7a8e9f1acd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/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 + * @author yinzuomei + * @description 查询在本网格注册的党员id + * @Date 2020/9/23 14:18 + **/ + @DataSource(value = DataSourceConstant.STATS) + @Override + public List getPartyMemberUserIds(String customerId, String gridId) { + return baseDao.selectGridPartyMemberUserIds(customerId,gridId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index db3c99f980..d1f1783d79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -53,4 +53,13 @@ public interface TopicService { */ List selectTopicInfo(List topicIds); + /** + * @return java.util.List + * @param customerId + * @param updateDateId + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:51 + **/ + List queryUpdateTopicOriginInfoList(String customerId, String updateDateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 706cc7bf33..689317017a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/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 + * @author yinzuomei + * @description 查询在这一天发生变化的话题记录 + * @Date 2020/9/23 17:51 + **/ + @Override + public List queryUpdateTopicOriginInfoList(String customerId, String updateDateId) { + return topicDao.queryUpdateTopicOriginInfoList(customerId,updateDateId); + } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index a15bd53984..30a9dff9f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/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 + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 2c3abdd2ca..a6aa5a8078 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -143,4 +143,19 @@ T1.TOPIC_ID =#{topicId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 6ca12b2229..3975a34a4c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/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 ( @@ -60,7 +61,8 @@ now(), 'APP_USER', now(), - #{item.pids} + #{item.pids}, + #{item.closedStatus} ) @@ -94,4 +96,40 @@ AND CREATE_TOPIC_USER_IS_PARTY = #{isParty} GROUP BY GRID_ID + + + + + + + + + update fact_origin_topic_main_daily + set TOPIC_STATUS=#{item.topicStatus}, + CLOSED_STATUS=#{item.closedStatus}, + UPDATED_TIME=NOW() + where id = ${item.topicId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 3075cedca7..ea6a9b0d33 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/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} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index bef60366bc..debd5efb90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -162,12 +162,7 @@ + + \ No newline at end of file