From 3250f9ab4e369328857b364091904df6ada53c73 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Sat, 10 Oct 2020 09:34:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=9C=AA=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 6 ++++++ .../extract/dataToIndex/impl/CalGridIndexServiceImpl.java | 5 +---- 2 files changed, 7 insertions(+), 4 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 eeb5758d08..c5d269e36f 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 @@ -710,7 +710,13 @@ public class DemoController { return new Result(); } + @Autowired + private PublicPartExtractService publicPartExtractService; + @PostMapping("extractTotalDataMonthly") + public void extractTotalDataMonthly(@RequestBody ExtractScreenFormDTO formDTO){ + publicPartExtractService.extractTotalDataMonthly(formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 4610455b81..858b3d6ddd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -4,7 +4,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; -import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; @@ -48,8 +47,6 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { @Autowired private IssueExtractService issueExtractService; @Autowired - private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; - @Autowired private FactOriginProjectMainDailyService projectMainService; @Autowired private FactOriginProjectLogDailyService projectLogService; @@ -312,7 +309,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { project.setScore(ProjectEvaluateConstant.PERFECT); break; default: - log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode()); + log.warn("calGridIndexGovernAbility other projectEvaluate,actionCode:{}", project.getActionCode()); } }); Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); From 3b4f1048dbcdf474914511e84eb6bf92a997fb03 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sat, 10 Oct 2020 14:55:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AF=AD=E5=8F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/extract/FactOriginProjectMainDailyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4bd90e9773..60eb86505b 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 @@ -362,7 +362,7 @@ grid.DEL_FLAG = '0' AND grid.CUSTOMER_ID = #{customerId} ) gridInfo ON project.GRID_ID = gridInfo.dimGridId - LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = '3ef7e4bb195eb9e622d68b52509aa940' GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID -- 处理次数 + LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID LEFT JOIN ( SELECT PROJECT_ID, From 983568a2565cdedd0018bed2ae52edccc41b102a Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 10 Oct 2020 15:24:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9B=E4=BA=BA=E5=9D=87=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=20=E4=B9=98=E4=BB=A5100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PublicPartExtractServiceImpl.java | 12 ++++++------ .../impl/ScreenDifficultyDataServiceImpl.java | 15 +++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) 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 0cc8aa4c00..7f85fe8339 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 @@ -2,7 +2,6 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.OrgTypeConstant; @@ -73,8 +72,8 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { * target:screen_user_join * 总参与:统计周期内议题表决(虽然可以评价 但是只有表决的人可以评价 所以按表决人数算)的人数 * 百人人均议题:统计周期内总的议题数/(注册用户数/100) - * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据 - * + * 百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与人数/应参与人数)的和)/被表决的议题数 来源 获取issue_vote_statistical_daily中 monthId的数据 + *

* 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 * * @return java.lang.Boolean @@ -123,7 +122,8 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { log.debug("user:{}", JSON.toJSONString(user)); if (!user.getRegTotal().equals(0)) { BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()) - .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); + .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP) + .multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); entity.setAvgIssue(avgIssueCount); } }); @@ -136,7 +136,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { //获取每个网格的应表决人数 List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); if (CollectionUtils.isEmpty(memberCountList)) { - log.error("抽取【公众参与-人均议题】,获取应表决人数为空"); + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); return; } gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); @@ -209,7 +209,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { //获取每个网格的应表决人数 List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); if (CollectionUtils.isEmpty(memberCountList)) { - log.error("抽取【公众参与-人均议题】,获取应表决人数为空"); + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); return; } orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 022f4484be..bc772ba821 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -50,20 +50,23 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl difficulties,List imgs) { - if(!CollectionUtils.isEmpty(difficulties)){ - baseDao.deleteBatchDifficulty(customerId,difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList())); + public void dataClean(String customerId, List difficulties, List imgs) { + if (!CollectionUtils.isEmpty(difficulties)) { + baseDao.deleteBatchDifficulty(customerId, difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatch(difficulties); } - if(!CollectionUtils.isEmpty(imgs)){ + if (!CollectionUtils.isEmpty(imgs)) { baseDao.deleteBatchDifficultyImg(imgs.stream().map(ScreenDifficultyImgDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.insertBatchImg(imgs); }