|
|
@ -57,7 +57,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility())); |
|
|
|
yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility())); |
|
|
|
yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility())); |
|
|
|
yearAverageIndexResultDTO.setYearAverageIndex(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility()); |
|
|
|
yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility())); |
|
|
|
return yearAverageIndexResultDTO; |
|
|
|
} |
|
|
|
|
|
|
@ -71,22 +71,22 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
@Override |
|
|
|
public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { |
|
|
|
|
|
|
|
MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),null); |
|
|
|
if (null == pieChartDTO){ |
|
|
|
MonthPieChartResultDTO pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), null); |
|
|
|
String monthId = dateUtils.getCurrentMonthId(); |
|
|
|
int time = NumConstant.TWELVE; |
|
|
|
//保证获取月度指数数据的最大可能性
|
|
|
|
while ((null == pieChartDTO || StringUtils.isBlank(pieChartDTO.getMonthId())) && time > NumConstant.ONE) { |
|
|
|
time--; |
|
|
|
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); |
|
|
|
pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(), monthId); |
|
|
|
} |
|
|
|
if (null == pieChartDTO) { |
|
|
|
return new MonthPieChartResultDTO(); |
|
|
|
} |
|
|
|
// 处理小数四舍五入
|
|
|
|
pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility())); |
|
|
|
pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility())); |
|
|
|
pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility())); |
|
|
|
String monthId = dateUtils.getCurrentMonthId(); |
|
|
|
int time = NumConstant.TWELVE; |
|
|
|
//保证获取月度指数数据的最大可能性
|
|
|
|
while(null == pieChartDTO && time > NumConstant.ONE){ |
|
|
|
time--; |
|
|
|
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); |
|
|
|
pieChartDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId(),monthId); |
|
|
|
} |
|
|
|
return pieChartDTO; |
|
|
|
} |
|
|
|
|
|
|
@ -126,7 +126,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility())); |
|
|
|
barchart.setGovernAbility(getRound(barchart.getGovernAbility())); |
|
|
|
barchart.setServiceAbility(getRound(barchart.getServiceAbility())); |
|
|
|
barchart.setIndexTotal(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility()); |
|
|
|
barchart.setIndexTotal(getRound(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility())); |
|
|
|
}); |
|
|
|
List<MonthBarchartResult> collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); |
|
|
|
//升序 当前月份在队尾
|
|
|
@ -199,7 +199,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); |
|
|
|
indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); |
|
|
|
indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); |
|
|
|
indexRank.setTotalIndex(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()); |
|
|
|
indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); |
|
|
|
}); |
|
|
|
return subAgencyIndexRankResultDTOS; |
|
|
|
} |
|
|
@ -218,7 +218,7 @@ public class IndexServiceImpl implements IndexService { |
|
|
|
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility())); |
|
|
|
rank.setGovernAbility(getRound(rank.getGovernAbility())); |
|
|
|
rank.setServiceAbility(getRound(rank.getServiceAbility())); |
|
|
|
rank.setTotalIndex(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility()); |
|
|
|
rank.setTotalIndex(getRound(rank.getPartyDevAbility() + rank.getGovernAbility() + rank.getServiceAbility())); |
|
|
|
}); |
|
|
|
} |
|
|
|
return subAgencyIndexRankResultDTOS; |
|
|
|