| | |
| | | Long count = iViolationsService.count(); |
| | | typeAndSourceVO.setAll(iViolationsService.count()); |
| | | List<VideoAndAreaVO> videoAndAreaVOS = iViolationsService.selectType(); |
| | | videoAndAreaVOS.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(2, BigDecimal.ROUND_HALF_UP))); |
| | | videoAndAreaVOS.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP))); |
| | | typeAndSourceVO.setRecords(videoAndAreaVOS); |
| | | return CommonResult.success(typeAndSourceVO); |
| | | } |