From 81065c3b7772055124c40babba354d160b99cce9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 27 Sep 2020 16:10:24 +0800 Subject: [PATCH] =?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.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/DimObjectStatusConstant.java | 8 ++++++++ .../dataToIndex/impl/CalCpcIndexServiceImpl.java | 7 +++---- .../impl/PioneerDataExtractServiceImpl.java | 11 ++++++----- .../PublicPartiTotalDataExtractServiceImpl.java | 13 +++---------- .../screen/impl/ScreenPioneerDataServiceImpl.java | 7 ++++--- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java index 5ceae84d44..97342260a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java @@ -7,4 +7,12 @@ package com.epmet.constant; * @date 2020/9/16 10:14 */ public interface DimObjectStatusConstant { + /** + * 已解决 + */ + String RESOLVED="resolved"; + /** + * 无需解决 + */ + String UNRESOLVED="unresolved"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 41c21e6b68..d76391ece8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -57,7 +56,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //1、构造初始值 List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { - log.info("dim_customer_partymember do not any records"); + log.info("dim_customer_partymember do not any records customerId="+customerId); return; } String quarterId= DateUtils.getQuarterId(monthId); @@ -75,11 +74,11 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { //可以先查询出每个党员的 自建群 Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); - //6、党员自建群群众人数 (todo 和monthId无关??) + //6、党员自建群群众人数 :和评价周期无关 Map groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); //7、党员自建群活跃群众人数 Map groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); - //8、党员自建群活跃度——话题数 (todo 校验sql正确性) + //8、党员自建群活跃度——话题数:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 Map groupTopicCountMap = calGroupTopicCount(customerId, monthId); //9、自建群活跃度——议题转项目率 Map topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); 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 2062a57668..10f16a3273 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 @@ -2,6 +2,7 @@ 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.DimObjectStatusConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; @@ -107,7 +108,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, "resolved")); + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED)); if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { @@ -194,7 +195,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 - entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, "resolved")); + entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED)); if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { @@ -203,7 +204,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); - screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, communityList); + screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList); } @@ -267,7 +268,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 - entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), "resolved")); + entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED)); if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { @@ -276,7 +277,7 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); - screenPioneerDataService.delAndSavePioneerData(customerId, "agency", IndexCalConstant.DELETE_SIZE, agencyList); + screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java index a228e13f8b..23d433b8b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartiTotalDataExtractServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; @@ -41,21 +42,13 @@ public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalD public void extractPublicPartiTotalData(String customerId, String dateId) { List userTotalDataEntityList = screenUserTotalDataService.selectList(customerId); if (CollectionUtils.isEmpty(userTotalDataEntityList)) { - log.warn("screen_user_total_data dosen't have any record "); + log.warn("screen_user_total_data dosen't have any record customerId="+customerId); 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()); + ScreenPublicPartiTotalDataEntity entity = ConvertUtils.sourceToTarget(totalData,ScreenPublicPartiTotalDataEntity.class); 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()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java index 0ae80e0b0c..ff49082598 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenPioneerDataServiceImpl.java @@ -23,6 +23,7 @@ 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.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.screen.ScreenPioneerDataDao; import com.epmet.entity.evaluationindex.screen.ScreenPioneerDataEntity; import com.epmet.service.evaluationindex.screen.ScreenPioneerDataService; @@ -58,13 +59,13 @@ public class ScreenPioneerDataServiceImpl extends BaseServiceImpl initPioneerDataList(String customerId, String orgType) { List list = new ArrayList<>(); - if ("grid".equals(orgType)) { + if (OrgTypeConstant.GRID.equals(orgType)) { //按网格构造 list = baseDao.initGridPioneerDataList(customerId); - } else if ("community".equals(orgType)) { + } else if (OrgTypeConstant.COMMUNITY.equals(orgType)) { //按社构造 list = baseDao.initCommunityPioneerDataList(customerId); - }else if("agency".equals(orgType)){ + }else if(OrgTypeConstant.AGENCY.equals(orgType)){ list = baseDao.initExceptCommunityPioneerDataList(customerId); } return list;