From e49fd4a7b26a355306a343d238c8ac818dc833ed Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 13 Oct 2020 14:27:08 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BA=94=E7=BA=A7=E6=8C=87=E6=A0=87=EF=BC=8C=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E7=9B=B8=E5=85=B3-=E6=9C=8D=E5=8A=A1=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=A1=A8=EF=BC=8C=E5=A4=A7=E5=B1=8F=E5=85=88?= =?UTF-8?q?=E9=94=8B=E6=A8=A1=E8=8C=83screen=5Fpioneer=5Fdata=E8=A1=A8?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=8E=87=20=20*100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CalCpcIndexServiceImpl.java | 2 +- .../impl/CalGridIndexServiceImpl.java | 4 +-- .../impl/PioneerDataExtractServiceImpl.java | 29 +++++++++++++++---- 3 files changed, 27 insertions(+), 8 deletions(-) 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 c4ba146e48..6c7fad11c7 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 @@ -380,7 +380,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); - BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr); + BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); map.put(partyMember.getUserId(), topicToIssueRatio); } return map; 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 858b3d6ddd..dd4befe207 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 @@ -432,7 +432,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { int regUserTotal=regUserIds.size(); String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal); BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr); - entity.setVolunteerRatio(volunteerRatio); + entity.setVolunteerRatio(volunteerRatio.multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } } //网格党员志愿者率 : 所有志愿者中,同时是党员的占比 @@ -449,7 +449,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { int partyUserCount=paryUserIds.size(); String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); - entity.setPartyVolunteerRatio(partyVolunteerRatio); + entity.setPartyVolunteerRatio(partyVolunteerRatio.multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } } 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 2cb4feff51..f41366eb13 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 @@ -71,7 +71,8 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService }else{ //2、党员参与议事占比 int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); - entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + BigDecimal issueRatio=new BigDecimal(entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } //3、党员发布话题: @@ -82,7 +83,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } else { //当前网格内所有话题总数 int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); - entity.setTopicRatio(gridTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / gridTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + if(gridTopicTotal == NumConstant.ZERO){ + entity.setTopicRatio(BigDecimal.ZERO); + }else{ + BigDecimal topicRatio=new BigDecimal(entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setTopicRatio(topicRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } } //当前网格内所有议题总数 @@ -93,13 +99,21 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService //6、党员发布议题占比 : 占网格内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); + }else{ + BigDecimal publishIssueRatio=new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } - entity.setPublishIssueRatio(gridIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); //8、议题转项目占比 : 占网格内议题总数的比率 - entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + if(entity.getShiftProjectTotal() == NumConstant.ZERO){ + entity.setShiftProjectRatio(BigDecimal.ZERO); + }else{ + BigDecimal shiftProjectRatio=new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setShiftProjectRatio(shiftProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }else{ // log.info("当前网格内所有议题总数="+gridIssueTotal); entity.setPublishIssueTotal(NumConstant.ZERO); @@ -116,7 +130,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } else { // 10、占总结项目 int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); - entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + if(closedProjectTotal == NumConstant.ZERO){ + entity.setResolvedProjectRatio(BigDecimal.ZERO); + }else { + BigDecimal resolvedProjectRatio=new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } } }); screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList); From 3323859ba736e09c590acf9c50ecd2525e14175d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 13 Oct 2020 14:35:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=85=9A=E5=BB=BA=E8=83=BD=E5=8A=9B=E3=80=81=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=9C=89=E5=85=B3=20xx=E7=8E=87=20*=20100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/constant/NumConstant.java | 1 + .../extract/dataToIndex/impl/CalGridIndexServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index bcef31dc14..75c8c1cac9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -38,6 +38,7 @@ public interface NumConstant { int FIFTY_ONE = 51; int SIXTY = 60; int ONE_HUNDRED = 100; + BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); int ONE_THOUSAND = 1000; int MAX = 99999999; int EIGHTY_EIGHT = 88; 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 dd4befe207..1d189bacef 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 @@ -282,7 +282,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { notReturnProjectList.forEach(not -> { gridIssueShiftProjectRatio.forEach(total -> { if (not.getGridId().equals(total.getGridId())){ - not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()))); + not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); } }); }); @@ -319,7 +319,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { scoreMap.forEach((k,v) -> { allScore.set(++v); }); - resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); + resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); }); } String quarterId = DateUtils.getQuarterId(monthId); @@ -491,7 +491,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { gridProjectTotalList.forEach(project -> { gridIssueTotalList.forEach(issue -> { if (project.getGridId().equals(issue.getGridId())) { - project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()))); + project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); } }); }); From 930f46d44e122a4b4574b4431c46009f6dd73c00 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 13 Oct 2020 16:07:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9AEIGrid=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=BA=93=E5=90=8C=E6=AD=A5=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=EF=BC=8C=E9=94=99=E6=8A=8Apid=E8=B5=8B=E5=80=BC=E7=BB=99pids?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenCustomerGridServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index f0a47885ea..45ed305ff5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -86,7 +86,7 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl