|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|