From 1bd155ffc1b5a42850c1243f43f838fdf9cefe46 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 27 Sep 2020 14:45:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?screen=5Fpublic=5Fparti=5Ftotal=5Fdata?= =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E=E5=90=84=E7=B1=BB=E6=80=BB?= =?UTF-8?q?=E6=95=B0v0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueLogDailyDao.java | 12 ++++ .../screen/ScreenPublicPartiTotalDataDao.java | 9 +++ .../screen/ScreenUserTotalDataDao.java | 9 +++ .../ScreenPublicPartiTotalDataEntity.java | 2 +- .../FactOriginIssueLogDailyService.java | 10 +++ .../FactOriginIssueLogDailyServiceImpl.java | 37 +++++++++- .../PublicPartiTotalDataExtractService.java | 19 ++++++ ...ublicPartiTotalDataExtractServiceImpl.java | 68 +++++++++++++++++++ .../ScreenPublicPartiTotalDataService.java | 11 +++ .../screen/ScreenUserTotalDataService.java | 9 +++ ...ScreenPublicPartiTotalDataServiceImpl.java | 31 +++++++++ .../impl/ScreenUserTotalDataServiceImpl.java | 13 +++- .../extract/FactOriginIssueLogDailyDao.xml | 19 ++++++ .../screen/ScreenPublicPartiTotalDataDao.xml | 47 ++++++++++++- .../screen/ScreenUserTotalDataDao.xml | 8 +++ 15 files changed, 300 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/PublicPartiTotalDataExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 9ac027b1fa..9b89222731 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -89,4 +89,16 @@ public interface FactOriginIssueLogDailyDao extends BaseDao list, @Param("customerId")String customerId); + + /** + * @return void + * @param list + * @author yinzuomei + * @description 批量插入entity + * @Date 2020/9/27 14:00 + **/ + void insertBatchEntity(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 2456d0d93a..d877d0042d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -57,4 +57,13 @@ public interface ScreenUserTotalDataDao extends BaseDao list, @Param("customerId")String customerId); void insertBatch(@Param("list") List list); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:22 + **/ + List selectList(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java index 3f38146cc6..b0c78254e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPublicPartiTotalDataEntity.java @@ -86,7 +86,7 @@ public class ScreenPublicPartiTotalDataEntity extends BaseEpmetEntity { private Integer regUserTotal; /** - * 参与人数 + * 参与人数参与人数: 议题的表决行为的用户数去重的累计值 */ private Integer joinUserTotal; 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 index 671888fb14..a6376e27dc 100644 --- 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 @@ -40,4 +40,14 @@ public interface FactOriginIssueLogDailyService extends BaseService implements FactOriginIssueLogDailyService { - + @Autowired + private DimAgencyService dimAgencyService; /** * @param customerId @@ -51,4 +59,31 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl userTotalDataEntityList = screenUserTotalDataService.selectList(customerId); + if (CollectionUtils.isEmpty(userTotalDataEntityList)) { + log.warn("screen_user_total_data dosen't have any record "); + return; + } + List list = new ArrayList<>(); + for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) { + ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity(); + entity.setCustomerId(customerId); + entity.setOrgType(totalData.getOrgType()); + entity.setOrgId(totalData.getOrgId()); + entity.setParentId(totalData.getParentId()); + entity.setOrgName(totalData.getOrgName()); + entity.setDataEndTime(dateId); + entity.setTopicTotal(totalData.getTopicTotal()); + entity.setIssueTotal(totalData.getIssueTotal()); + entity.setProjectTotal(totalData.getProjectTotal()); + entity.setRegUserTotal(totalData.getUserTotal()); + //参与人数参与人数: 议题的表决行为的用户数去重的累计值 + int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId()); + entity.setJoinUserTotal(joinUserTotal); + list.add(entity); + } + //先删除,后插入 + screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java index 4e804628cc..0e03f4d555 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenPublicPartiTotalDataService.java @@ -21,6 +21,8 @@ package com.epmet.service.evaluationindex.screen; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; +import java.util.List; + /** * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 * @@ -28,4 +30,13 @@ import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; * @since v1.0.0 2020-09-22 */ public interface ScreenPublicPartiTotalDataService extends BaseService { + /** + * @return void + * @param customerId + * @param list screen_public_parti_total_data 记录 + * @author yinzuomei + * @description 先删除,后插入 + * @Date 2020/9/27 13:51 + **/ + void delAndInsertBatch(String customerId, List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java index 3f38a3a683..313de8c061 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserTotalDataService.java @@ -40,4 +40,13 @@ public interface ScreenUserTotalDataService extends BaseService list,String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:18 + **/ + List selectList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java index f0b888967e..fdc231a5d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java @@ -19,10 +19,17 @@ package com.epmet.service.evaluationindex.screen.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.screen.ScreenPublicPartiTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; /** * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数 @@ -34,4 +41,28 @@ import org.springframework.stereotype.Service; public class ScreenPublicPartiTotalDataServiceImpl extends BaseServiceImpl implements ScreenPublicPartiTotalDataService { + /** + * @param customerId + * @param entityList screen_public_parti_total_data 记录 + * @return void + * @author yinzuomei + * @description 先删除,后插入 + * @Date 2020/9/27 13:51 + **/ + @Transactional(rollbackFor = Exception.class) + @Override + public void delAndInsertBatch(String customerId, List entityList) { + if(CollectionUtils.isEmpty(entityList)){ + return; + } + int deleteNum=0; + do{ + //沿用原来项目采集的删除方法,一次删除1000 + deleteNum=baseDao.deletePublicPartiTotalData(customerId); + }while (deleteNum!= NumConstant.ZERO); + List> partionList= ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE); + partionList.forEach(list->{ + baseDao.insertBatchEntity(list); + }); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java index a1b21beced..b21e39c716 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserTotalDataServiceImpl.java @@ -23,7 +23,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.screen.ScreenUserTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -56,4 +55,16 @@ public class ScreenUserTotalDataServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 根据条件查询screen_user_total_data表 + * @Date 2020/9/27 11:18 + **/ + @Override + public List selectList(String customerId) { + return baseDao.selectList(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 734f088d09..85c927d5c3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -119,4 +119,23 @@ and M.IS_PARTY=#{isParty} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml index 0c2bfa9c51..1b33f8b0ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -77,5 +77,50 @@ - + + + insert into screen_public_parti_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index e8c0e8c660..c3b3ef7de7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -105,4 +105,12 @@ + + From 837b9468926e505c5633b98e4e480854c23cd09a Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 27 Sep 2020 15:22:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/GridGroupUserCountResultDTO.java | 30 +++ .../result/IssueVoteStatisticalResultDTO.java | 68 ++++++ .../result/IssueVoteUserCountResultDTO.java | 26 ++ .../extract/FactOriginGroupMainDailyDao.java | 69 +++--- .../extract/FactOriginIssueLogDailyDao.java | 42 ++-- .../com/epmet/dao/issue/StatsIssueDao.java | 229 ++++++++++-------- .../com/epmet/service/Issue/IssueService.java | 37 ++- .../service/Issue/impl/IssueServiceImpl.java | 30 ++- .../FactOriginGroupMainDailyService.java | 17 +- .../FactOriginIssueLogDailyService.java | 24 +- .../FactOriginGroupMainDailyServiceImpl.java | 11 +- .../FactOriginIssueLogDailyServiceImpl.java | 9 +- .../impl/PublicPartExtractServiceImpl.java | 49 +++- .../extract/FactOriginGroupMainDailyDao.xml | 15 ++ .../extract/FactOriginIssueLogDailyDao.xml | 16 ++ 15 files changed, 482 insertions(+), 190 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java new file mode 100644 index 0000000000..72723e1987 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridGroupUserCountResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 网格级别小组内的组成员数 + * + * @author LiuJanJun + * @date 2020/9/27 2:27 下午 + */ +@Data +public class GridGroupUserCountResultDTO implements Serializable { + + + private static final long serialVersionUID = -4729061928990808187L; + /** + * 客户ID + */ + private String customerId; + + private String gridId; + + private Integer memberCount; + /** + * 网格的pids + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java new file mode 100644 index 0000000000..01531e3bb1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteStatisticalResultDTO.java @@ -0,0 +1,68 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * desc: 议题投票统计结果DTO + * + * @author LiuJanJun + * @date 2020/9/27 11:22 上午 + */ +@Data +public class IssueVoteStatisticalResultDTO implements Serializable { + + + private static final long serialVersionUID = 2631108929053690349L; + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 统计日期 yyyy-MM-dd + */ + private Date statisticalDate; + + /** + * 到该日的总赞成数 + */ + private Integer supportCount; + + /** + * 到该日的总反对数 + */ + private Integer oppositionCount; + + /** + * 到该日的总票数 + */ + private Integer totalCount; + + /** + * 该日增量 + */ + private Integer todayIncrement; + + /** + * 该日赞成增量 + */ + private Integer supportIncrement; + + /** + * 该日反对增量 + */ + private Integer oppositionIncrement; + + /** + * 到该日的应表决数 + */ + private Integer votableCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java new file mode 100644 index 0000000000..405ab7b3a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueVoteUserCountResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 议题投票人数 + * + * @author LiuJanJun + * @date 2020/9/27 2:27 下午 + */ +@Data +public class IssueVoteUserCountResultDTO implements Serializable { + + + private static final long serialVersionUID = -4729061928990808187L; + private String gridId; + private String issueId; + private Integer voteCount; + private Integer issueCount; + /** + * 网格的pids + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 66a156557d..5107262311 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,16 +18,16 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; -import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; - import java.util.List; /** @@ -40,86 +40,87 @@ import java.util.List; public interface FactOriginGroupMainDailyDao extends BaseDao { /** - * @Description 查询建群党员数 * @param customerId * @param monthId + * @Description 查询建群党员数 * @author zxc * @date 2020/9/19 3:49 下午 */ - List selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + List selectPartyCreateGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId); /** - * @Description 查询是否存在该客户下的数据 * @param customerId * @return + * @Description 查询是否存在该客户下的数据 * @author wangc * @date 2020.09.18 23:30 - **/ - int selectIfExist(@Param("customerId")String customerId); + **/ + int selectIfExist(@Param("customerId") String customerId); /** - * @Description 按照客户Id清除组数据 * @param customerId * @return + * @Description 按照客户Id清除组数据 * @author wangc * @date 2020.09.20 09:58 - **/ - void deleteBatchByCustomerId(@Param("customerId")String customerId); + **/ + void deleteBatchByCustomerId(@Param("customerId") String customerId); /** - * @Description 按照客户Id清除组员数据 * @param customerId * @return + * @Description 按照客户Id清除组员数据 * @author wangc * @date 2020.09.20 09:58 **/ - void deleteBatchMemberByCustomerId(@Param("customerId")String customerId,@Param("dimId") String dimId,@Param("dateType") String dateType); + void deleteBatchMemberByCustomerId(@Param("customerId") String customerId, @Param("dimId") String dimId, @Param("dateType") String dateType); /** - * @Description 按照组Id清除组和组员数据 * @param customerId * @return + * @Description 按照组Id清除组和组员数据 * @author wangc * @date 2020.09.20 12:16 - **/ - void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List list); + **/ + void deleteBatchByGroupId(@Param("customerId") String customerId, @Param("list") List list); /** - * @Description 更新群主的党员信息 * @param list * @return + * @Description 更新群主的党员信息 * @author wangc * @date 2020.09.20 12:44 - **/ - int updatePartyFlag(@Param("list") List list,@Param("customerId")String customerId); + **/ + int updatePartyFlag(@Param("list") List list, @Param("customerId") String customerId); /** - * @Description 更新群主的热心居民信息 * @param list * @return + * @Description 更新群主的热心居民信息 * @author wangc * @date 2020.09.20 12:44 - **/ - int updateHeartedFlag(@Param("list") List list,@Param("customerId")String customerId); + **/ + int updateHeartedFlag(@Param("list") List list, @Param("customerId") String customerId); /** - * @Description 批量插入组主表 * @param list * @return + * @Description 批量插入组主表 * @author wangc * @date 2020.09.20 15:37 - **/ + **/ int insertBatchMain(@Param("list") List list); /** - * @Description 批量插入组员表 * @param list * @return + * @Description 批量插入组员表 * @author wangc * @date 2020.09.20 15:37 - **/ + **/ int insertBatchMembers(List list); + /** * @param customerId * @param groupOwnerId @@ -131,8 +132,8 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId); /** - * @return java.util.List * @param groupIdList + * @return java.util.List * @author yinzuomei * @description 查询组成员数(去重) * @Date 2020/9/20 21:29 @@ -140,11 +141,21 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectGroupMemberList(@Param("list") List groupIdList); /** - * @Description 查询党员建组信息 * @param customerId * @param monthId + * @Description 查询党员建组信息 * @author zxc * @date 2020/9/25 9:46 上午 */ - List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("gridIds") List gridIds); + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List gridIds); + + /** + * desc: 获取所有网格的组中成员人数 去重 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:31 下午 + */ + List selectDistinctGroupMemberCount(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 9b89222731..793926e513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -27,7 +28,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 议题记录附表 + * 议题记录附表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-14 @@ -36,50 +37,50 @@ import java.util.List; public interface FactOriginIssueLogDailyDao extends BaseDao { /** - * @Description 议题记录附表插入 * @param issueLogList + * @Description 议题记录附表插入 * @author zxc * @date 2020/9/14 5:53 下午 */ - void insertIssueLogList(@Param("issueLogList")List issueLogList); + void insertIssueLogList(@Param("issueLogList") List issueLogList); /** - * @Description 删除旧的记录 * @param customerId * @param dateId + * @Description 删除旧的记录 * @author zxc * @date 2020/9/16 9:33 上午 */ - void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId); + void deleteOldLogRecord(@Param("customerId") String customerId, @Param("dateId") String dateId); /** - * @return java.lang.Integer - * @param userId 用户id + * @param userId 用户id * @param customerId * @param monthId + * @return java.lang.Integer * @author yinzuomei * @description 查询用户在这个月内表决的总次数 * @Date 2020/9/20 21:52 **/ - Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId")String monthId); + Integer selectCountUserVote(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId); /** - * @Description 查询 议题表决【党员/群众】 * @param customerId * @param monthId * @param isParty + * @Description 查询 议题表决【党员/群众】 * @author zxc * @date 2020/9/21 9:37 上午 */ - List selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + List selectPartyActiveIssueVote(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("isParty") Integer isParty); /** - * @return int * @param customerId * @param gridId * @param communityId * @param agencyPath * @param isParty + * @return int * @author yinzuomei * @description 党员参与议事:支持或者反对的次数 * @Date 2020/9/26 18:05 @@ -91,14 +92,25 @@ public interface FactOriginIssueLogDailyDao extends BaseDao + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index ca7a25d340..190353059f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -1,13 +1,14 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; -import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -29,33 +30,36 @@ public interface StatsIssueDao extends BaseDao { */ List selectAgencyIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 获取当前日期组织下议题增量 - * @author zhaoqifeng - * @date 2020/6/18 9:55 - * @param customerId - * @param date - * @return java.util.List - */ + /** + * 获取当前日期组织下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ List selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date); - /** - * 已关闭议题统计 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List + /** + * 已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 已关闭议题增量 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List + /** + * 已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 */ List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); @@ -66,6 +70,7 @@ public interface StatsIssueDao extends BaseDao { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List selectGridProjectList(IssueEntity issueEntity); + /** * 获取当前日期网格下议题统计结果 * @@ -77,87 +82,103 @@ public interface StatsIssueDao extends BaseDao { */ List selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - /** - * 获取当前日期网格下议题增量 - * @author zhaoqifeng - * @date 2020/6/18 9:55 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); - - /** - * 网格已关闭议题统计 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); - - /** - * 网格已关闭议题增量 - * @author zhaoqifeng - * @date 2020/6/18 14:41 - * @param customerId - * @param date - * @return java.util.List - */ - List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); - - /** - * 查询客户下议题和项目关系 - * @author zhaoqifeng - * @date 2020/6/19 17:34 - * @param customerId - * @return java.util.List + /** + * 获取当前日期网格下议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 9:55 + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题统计 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题增量 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/18 14:41 + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询客户下议题和项目关系 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/19 17:34 */ List selectIssueProjectList(@Param("customerId") String customerId); - /** - * 根据ID获取议题信息 - * @author zhaoqifeng - * @date 2020/9/15 16:56 - * @param ids - * @return java.util.List - */ - List selectIssueInfoByIds(@Param("ids") List ids); - - /** - * @Description 查询议题信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/15 2:28 下午 - */ - List selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题process信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题满意度评价信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); - - /** - * @Description 查询议题支持反对信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + /** + * 根据ID获取议题信息 + * + * @param ids + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/15 16:56 + */ + List selectIssueInfoByIds(@Param("ids") List ids); + + /** + * @param customerId + * @param dateId + * @Description 查询议题信息 + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + List selectIssueInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题process信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题满意度评价信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc: 根据客户id 获取当前议题的情况 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 1:22 下午 + */ + List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index c7ea8e56bb..239ad2d8b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -1,12 +1,13 @@ package com.epmet.service.Issue; -import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; -import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; @@ -149,14 +150,26 @@ public interface IssueService { * @author zxc * @date 2020/9/16 1:48 下午 */ - List selectIssueSatisfactionInfo(String customerId,String dateId); - - /** - * @Description 查询议题支持反对信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - List selectIssueVoteInfo(String customerId,String dateId); + List selectIssueSatisfactionInfo(String customerId, String dateId); + + /** + * @param customerId + * @param dateId + * @Description 查询议题支持反对信息 + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(String customerId, String dateId); + + /** + * desc: 【月】查询议题支持反对及应表决人数 + * 数据由两部分组成 1:本月内已经关闭的话题的支持和反对数据 来自issue,issue_vote_statistical + * + * @param customerId + * @param monthId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 11:20 上午 + */ + List selectIssueVoteStatis(String customerId, String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 981082f743..e134358618 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -3,13 +3,14 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; -import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; -import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -127,14 +128,19 @@ public class IssueServiceImpl implements IssueService { } /** - * @Description 查询议题支持反对信息 - * @param customerId - * @param dateId - * @author zxc - * @date 2020/9/16 1:48 下午 - */ - @Override - public List selectIssueVoteInfo(String customerId, String dateId) { - return statsIssueDao.selectIssueVoteInfo(customerId, dateId); - } + * @Description 查询议题支持反对信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueVoteInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteInfo(customerId, dateId); + } + + @Override + public List selectIssueVoteStatis(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteStatis(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index fdaac9d36e..c14364b799 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -62,14 +63,24 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData,List memberList); + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, List memberList); /** - * @Description 查询党员建组信息 * @param customerId * @param monthId + * @Description 查询党员建组信息 * @author zxc * @date 2020/9/25 9:46 上午 */ - List selectPartyCreateGroupInfo(String customerId,String monthId,List gridIds); + List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds); + + /** + * desc: 获取客户下每个网格小组内的 去重人数 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2020/9/27 2:24 下午 + */ + List selectDistinctGroupMemberCount(String customerId); } \ 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/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index a6376e27dc..a5de0ab804 100644 --- 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 @@ -18,10 +18,13 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; +import java.util.List; + /** - * 议题记录附表 + * 议题记录附表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-23 @@ -29,12 +32,12 @@ import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; public interface FactOriginIssueLogDailyService extends BaseService { /** - * @return int * @param customerId * @param gridId * @param communityId * @param agencyPath * @param isParty + * @return int * @author yinzuomei * @description 党员参与议事:支持或者反对的次数 * @Date 2020/9/26 17:57 @@ -42,12 +45,23 @@ public interface FactOriginIssueLogDailyService extends BaseService + * @author LiuJanJun + * @date 2020/9/27 1:58 下午 + */ + List getVoteCount(String customerId, String monthId); } \ 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/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 4cc0ebb248..f0b5cd53f0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -18,10 +18,10 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; @@ -108,11 +108,16 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId,List gridIds) { - if (!CollectionUtils.isEmpty(gridIds)){ + public List selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds) { + if (!CollectionUtils.isEmpty(gridIds)) { return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); } return new ArrayList<>(); } + @Override + public List selectDistinctGroupMemberCount(String customerId) { + return baseDao.selectDistinctGroupMemberCount(customerId); + } + } \ 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 index 66df6ec87c..e86a41a309 100644 --- 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 @@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; @@ -31,8 +32,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** - * 议题记录附表 + * 议题记录附表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-23 @@ -86,4 +89,8 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl getVoteCount(String customerId, String monthId) { + return baseDao.getVoteCount(customerId, monthId); + } } \ 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/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index bb94830ba1..2f2d5f1e4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -7,11 +7,15 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.form.ExtractScreenFormDTO; +import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.GridUserCountResultDTO; +import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; import com.epmet.service.evaluationindex.extract.toscreen.PublicPartExtractService; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimGridService; @@ -48,6 +52,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { private FactIssueGridMonthlyService factIssueGridMonthlyService; @Autowired private FactRegUserGridMonthlyService factRegUserGridMonthlyService; + @Autowired + private FactOriginIssueLogDailyService factOriginIssueLogDailyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** @@ -55,7 +63,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { * target:screen_user_join * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 * 百人人均议题:统计周期内总的议题数/(注册用户数/100) - * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据 + *

+ *

+ *

* 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 * * @return java.lang.Boolean @@ -101,16 +112,42 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { GridUserCountResultDTO user = userCountMap.get(gridId); //百人人均议题:统计周期内总的议题数/(注册用户数/100) BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getUserCount()).divide(new BigDecimal(NumConstant.ONE_HUNDRED))); - // 需要修改字段类型 entity.setAvgIssue(avgIssueCount); - - //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + }); - entity.setAvgJoin(new BigDecimal(0)); - }); + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId()); + Map gridMemberCount = new HashMap<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(memberCountList)) { + log.error("抽取【公众参与-人均议题】,获取应表决人数为空"); + return; + } + gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getGridId, o -> o.getMemberCount())); + } + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + //遍历实际参与人数 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getGridId)); + for (Map.Entry> entry : voteMap.entrySet()) { + String gridId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + List issueList = entry.getValue(); + BigDecimal bigDecimal = new BigDecimal(0); + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); + for (IssueVoteUserCountResultDTO vote : issueList) { + Integer memberCount = gridMemberCount.get(gridId); + if (memberCount == null) { + memberCount = 0; + } + bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / memberCount)); + } + entity.setAvgJoin(bigDecimal.divide(votedByIssueCount).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); + } } private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index a6c9b62bee..2680ca1605 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -264,4 +264,19 @@ ) 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/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 85c927d5c3..1d549be8cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -138,4 +138,20 @@ and m.PIDS LIKE CONCAT(#{pids},'%') + + \ No newline at end of file From 38a3fbd53d83368940b211e36fc48937dd0b50fd Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Sun, 27 Sep 2020 15:44:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?issue=E7=9A=84pids?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/IssueExtractServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index a222e22cbb..804c884998 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -128,7 +128,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(pid -> { if (r.getAgencyId().equals(pid.getAgencyId())){ r.setPid(pid.getPid()); - r.setPids(pid.getPids().concat(":").concat(pid.getPid())); + r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); } }); }); @@ -227,7 +227,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(agency -> { if (r.getAgencyId().equals(agency.getAgencyId())){ r.setPid(agency.getPid()); - r.setPids(agency.getPids()); + r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); } }); }); From 787af996303d12188e2ee6515f4666095f79e8b8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 27 Sep 2020 15:53:58 +0800 Subject: [PATCH 4/5] =?UTF-8?q?screen=5Fpioneer=5Fdata=E5=85=9A=E5=91=98?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E8=AE=AE=E4=BA=8B=E6=8F=90=E4=BA=A4=20V0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/DemoController.java | 8 +++++++- .../impl/FactOriginIssueLogDailyServiceImpl.java | 11 +++++++++-- .../toscreen/impl/PioneerDataExtractServiceImpl.java | 7 ++++--- .../impl/ScreenPublicPartiTotalDataServiceImpl.java | 3 +++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 8b0dc2156a..708bc70d60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -673,7 +673,8 @@ public class DemoController { @Autowired private PioneerDataExtractService pioneerDataExtractService; - + @Autowired + private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; @PostMapping("insertScreenPioneerData") public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { @@ -692,6 +693,11 @@ public class DemoController { return new Result(); } + @PostMapping("extractPublicPartiTotalData") + public Result extractPublicPartiTotalData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId){ + publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId,dateId); + return new Result(); + } } 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 index e86a41a309..923ac3f2ff 100644 --- 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 @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; import com.epmet.dto.stats.DimAgencyDTO; @@ -73,7 +74,7 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl gridList = screenPioneerDataService.initPioneerDataList(customerId, "grid"); + List gridList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.GRID); if (CollectionUtils.isEmpty(gridList)) { return; } @@ -140,7 +141,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Override public void extractCommunityPioneerData(String customerId, String dateId) { //查询客户下所有的社区,初始数据值为0 - List communityList = screenPioneerDataService.initPioneerDataList(customerId, "community"); + List communityList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.COMMUNITY); if (CollectionUtils.isEmpty(communityList)) { return; } @@ -209,7 +210,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService @Override public void extractExceptCommunityPioneerData(String customerId, String dateId) { //查询客户下所有的组织(社区除外),初始数据值为0 - List agencyList = screenPioneerDataService.initPioneerDataList(customerId, "agency"); + List agencyList = screenPioneerDataService.initPioneerDataList(customerId, OrgTypeConstant.AGENCY); if (CollectionUtils.isEmpty(agencyList)) { return; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java index fdc231a5d2..859941d9ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPublicPartiTotalDataServiceImpl.java @@ -18,8 +18,10 @@ package com.epmet.service.evaluationindex.screen.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.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.screen.ScreenPublicPartiTotalDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; @@ -49,6 +51,7 @@ public class ScreenPublicPartiTotalDataServiceImpl extends BaseServiceImpl entityList) { From 2871ae86221f3664521fbdeee90dda489eb02b6c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sun, 27 Sep 2020 16:06:26 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9C=88=E5=BA=A6?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E6=8E=A5=E5=8F=A3bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 93276c8725..fe09c575db 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -270,6 +270,9 @@ public class IndexServiceImpl implements IndexService { //screen_index_data_monthly 根据组织id和月份获取月度指标得分 //1.根据组织或网格Id以及月份Id查询各项月度指数得分 IndexScoreResultDTO resultDTO = screenIndexDataMonthlyDao.selectMonthData(formDTO); + if (null == resultDTO) { + return resultDTO; + } //2.将数据改成正确格式 四舍五入保留一位小数 权重转成百分比 NumberFormat nf = NumberFormat.getPercentInstance();