Browse Source

Merge branch 'dev_screen_data_2.0' into dev_temp

master
wxz 5 years ago
parent
commit
6a682160c9
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java
  3. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java
  4. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java
  5. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

1
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 FIFTY_ONE = 51;
int SIXTY = 60; int SIXTY = 60;
int ONE_HUNDRED = 100; int ONE_HUNDRED = 100;
BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100);
int ONE_THOUSAND = 1000; int ONE_THOUSAND = 1000;
int MAX = 99999999; int MAX = 99999999;
int EIGHTY_EIGHT = 88; int EIGHTY_EIGHT = 88;

2
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 numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX); numberFormat.setMaximumFractionDigits(NumConstant.SIX);
String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); 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); map.put(partyMember.getUserId(), topicToIssueRatio);
} }
return map; return map;

10
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 -> { notReturnProjectList.forEach(not -> {
gridIssueShiftProjectRatio.forEach(total -> { gridIssueShiftProjectRatio.forEach(total -> {
if (not.getGridId().equals(total.getGridId())){ 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) -> { scoreMap.forEach((k,v) -> {
allScore.set(++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); String quarterId = DateUtils.getQuarterId(monthId);
@ -432,7 +432,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
int regUserTotal=regUserIds.size(); int regUserTotal=regUserIds.size();
String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal); String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal);
BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr); 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(); int partyUserCount=paryUserIds.size();
String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount); String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount);
BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr); BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr);
entity.setPartyVolunteerRatio(partyVolunteerRatio); entity.setPartyVolunteerRatio(partyVolunteerRatio.multiply(new BigDecimal(NumConstant.ONE_HUNDRED)));
} }
} }
@ -491,7 +491,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
gridProjectTotalList.forEach(project -> { gridProjectTotalList.forEach(project -> {
gridIssueTotalList.forEach(issue -> { gridIssueTotalList.forEach(issue -> {
if (project.getGridId().equals(issue.getGridId())) { 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)));
} }
}); });
}); });

29
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{ }else{
//2、党员参与议事占比 //2、党员参与议事占比
int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); 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、党员发布话题: //3、党员发布话题:
@ -82,7 +83,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} else { } else {
//当前网格内所有话题总数 //当前网格内所有话题总数
int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); 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、党员发布议题占比 : 占网格内所有议题的比率 //6、党员发布议题占比 : 占网格内所有议题的比率
if (entity.getPublishIssueTotal() == NumConstant.ZERO) { if (entity.getPublishIssueTotal() == NumConstant.ZERO) {
entity.setPublishIssueRatio(BigDecimal.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、议题转项目数 //7、议题转项目数
entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null));
//8、议题转项目占比 : 占网格内议题总数的比率 //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{ }else{
// log.info("当前网格内所有议题总数="+gridIssueTotal); // log.info("当前网格内所有议题总数="+gridIssueTotal);
entity.setPublishIssueTotal(NumConstant.ZERO); entity.setPublishIssueTotal(NumConstant.ZERO);
@ -116,7 +130,12 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService
} else { } else {
// 10、占总结项目 // 10、占总结项目
int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); 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); screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList);

2
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<ScreenCustome
if (screenGrid != null) { if (screenGrid != null) {
//说明之前已经插入了该数据 //说明之前已经插入了该数据
screenGrid.setParentAgencyId(grid.getPid()); screenGrid.setParentAgencyId(grid.getPid());
screenGrid.setAllParentIds(grid.getPid()); screenGrid.setAllParentIds(grid.getPids());
screenGrid.setCustomerId(grid.getCustomerId()); screenGrid.setCustomerId(grid.getCustomerId());
screenGrid.setDataEndTime(dateStr); screenGrid.setDataEndTime(dateStr);
screenGrid.setGridName(grid.getGridName()); screenGrid.setGridName(grid.getGridName());

Loading…
Cancel
Save