| | |
| | | if (0!=all){ |
| | | BigDecimal countNum = new BigDecimal(statisticsPhotoVO.getCountNum()); |
| | | BigDecimal allDecimal = new BigDecimal(all); |
| | | BigDecimal percent = countNum.divide(allDecimal,2, BigDecimal.ROUND_HALF_DOWN); |
| | | BigDecimal percent = countNum.divide(allDecimal,4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100)); |
| | | statisticsPhotoVO.setPercent(percent); |
| | | } |
| | | } |
| | | Map<String, StatisticsPhotoVO> circleMap = statisticsPhotoVOS |
| | | .stream() |
| | | .collect(Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity())); |
| | | // Map<String, StatisticsPhotoVO> circleMap = statisticsPhotoVOS |
| | | // .stream() |
| | | // .collect(Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity())); |
| | | |
| | | |
| | | //按月份查询 |
| | | List<StatisticsPhotoVO> statisticsPhotoVOS1 = this.baseMapper.selectPhotoByMonth(); |
| | |
| | | if (0L!=sum) { |
| | | BigDecimal countNum = new BigDecimal(statisticsPhotoVO.getCountNum()); |
| | | BigDecimal sumDecimal = new BigDecimal(sum); |
| | | BigDecimal percent = countNum.divide(sumDecimal, 2, BigDecimal.ROUND_HALF_DOWN); |
| | | BigDecimal percent = countNum.divide(sumDecimal, 4, BigDecimal.ROUND_HALF_DOWN).multiply(new BigDecimal(100)); |
| | | statisticsPhotoVO.setPercent(percent); |
| | | } |
| | | } |
| | | } |
| | | Map<String, Map<String, StatisticsPhotoVO>> chartMap = statisticsPhotoVOS1.stream().collect(Collectors.groupingBy(StatisticsPhotoVO::getStatisticsDate, Collectors.toMap(StatisticsPhotoVO::getCountName, Function.identity()))); |
| | | |
| | | |
| | | |
| | | |
| | | // 状态 1待处理 2进行中 3已驳回 4待评价 5.已完成 |
| | | String[] statusArr = {"dcl","jxz","ybh","dpj","ywc"}; |
| | | String[] statusArr = {"待处理","进行中","已驳回","待评价","已完成"}; |
| | | List<String> latest12Month = DateUtils.getLatest12Month(LocalDate.now(), 10); |
| | | for (String month : latest12Month) { |
| | | Map<String, StatisticsPhotoVO> map1; |
| | |
| | | statisticsPhotoVO.setCountNum(0); |
| | | statisticsPhotoVO.setStatisticsDate(month); |
| | | statisticsPhotoVO.setCountName(status); |
| | | statisticsPhotoVOS1.add(statisticsPhotoVO); |
| | | map1.put(status,statisticsPhotoVO); |
| | | } |
| | | } |
| | | chartMap.put(month,map1); |
| | | } |
| | | Map<String, List<StatisticsPhotoVO>> stringListMap = statisticsPhotoVOS1 |
| | | .stream() |
| | | .sorted(Comparator.comparing(StatisticsPhotoVO::getStatisticsDate)) |
| | | .collect(Collectors.groupingBy(StatisticsPhotoVO::getCountName)); |
| | | |
| | | return R.ok(); |
| | | |
| | | Map<String,Object> retMap = new HashMap<>(); |
| | | retMap.put("statisticsPhotoVOS",statisticsPhotoVOS); |
| | | retMap.put("monthMap",stringListMap); |
| | | |
| | | return R.ok(retMap); |
| | | } |
| | | |
| | | } |