| | |
| | | dashboardQuery.setStartTime(DateUtils.getMouthStart(now)); |
| | | dashboardQuery.setEndTime(DateUtils.getMouthEnd(now)); |
| | | List<CheckScore> dashboard = scoreMapper.dashboard(dashboardQuery); |
| | | //初始化各个区县数据 |
| | | Map<String, Map<String, Object>> resultMap = new HashMap<>(); |
| | | |
| | | for (AreaDeptEnum value : AreaDeptEnum.values()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("score", 0); |
| | | resultMap.put(value.getName(), map); |
| | | } |
| | | //填充各个区县数据 |
| | | for (CheckScore checkScore : dashboard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("score", checkScore.getScore().setScale(2,RoundingMode.HALF_UP)); |
| | | map.put("score", checkScore.getScore().setScale(1,RoundingMode.HALF_UP)); |
| | | resultMap.put(checkScore.getDeptName(), map); |
| | | } |
| | | return resultMap; |