| | |
| | | } |
| | | |
| | | @Override |
| | | public Page listViolationsPage(Integer current, Integer size, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId) { |
| | | public Page listViolationsPage(Integer current, Integer size, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId,Integer videoId) { |
| | | Integer type = 01; |
| | | Integer hours = 60; |
| | | Integer day = 24; |
| | | Page page = new Page<>().setCurrent(current).setSize(size); |
| | | Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId); |
| | | Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId, videoId); |
| | | violationsPage.getRecords().stream().forEach(item -> { |
| | | if (item.getCloseTime() == null) { |
| | | Duration duration = Duration.between(item.getAlarmTime(), LocalDateTime.now()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<BaseCaseVO> selectVideoInspection(Integer current, Long gradeId, Long videoId, String beginTime, String endTime) { |
| | | return baseCaseMapper.selectVideoInspection(new Page<>(current, 1), gradeId, videoId, beginTime, endTime); |
| | | public Page<BaseCaseVO> selectVideoInspection(Integer current,Integer pageSize, Long gradeId, Long videoId, String beginTime, String endTime) { |
| | | return baseCaseMapper.selectVideoInspection(new Page<>(current, pageSize), gradeId, videoId, beginTime, endTime); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public List<VideoAndAreaVO> areaCount() { |
| | | List<VideoAndAreaVO> areaCountList = baseCaseMapper.areaCount(); |
| | | Long allCount = baseCaseMapper.selectCount(new LambdaQueryWrapper<>()); |
| | | areaCountList.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP))); |
| | | areaCountList.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / allCount).setScale(4, BigDecimal.ROUND_HALF_UP))); |
| | | return areaCountList; |
| | | } |
| | | |
| | |
| | | if (reportLastMonthCount == 0) { |
| | | report.setRatio(null); |
| | | } else { |
| | | report.setRatio(new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_UP).abs()); |
| | | report.setRatio(new BigDecimal(v).setScale(4, BigDecimal.ROUND_HALF_UP).abs()); |
| | | } |
| | | if (v < 0) { |
| | | report.setUp(false); |
| | |
| | | if (disposeLastMonthCount == 0) { |
| | | dispose.setRatio(null); |
| | | } else { |
| | | dispose.setRatio(new BigDecimal(v1).setScale(2, BigDecimal.ROUND_HALF_UP).abs()); |
| | | dispose.setRatio(new BigDecimal(v1).setScale(4, BigDecimal.ROUND_HALF_UP).abs()); |
| | | } |
| | | if (v1 < 0) { |
| | | dispose.setUp(false); |
| | |
| | | if (onTimeCaseLastMonthCount == 0) { |
| | | onTimeDispose.setRatio(null); |
| | | } else { |
| | | onTimeDispose.setRatio(new BigDecimal(v2).setScale(2, BigDecimal.ROUND_HALF_UP).abs()); |
| | | onTimeDispose.setRatio(new BigDecimal(v2).setScale(4, BigDecimal.ROUND_HALF_UP).abs()); |
| | | } |
| | | if (v2 < 0) { |
| | | onTimeDispose.setUp(false); |
| | |
| | | if (disposeLastMonthCount == 0) { |
| | | register.setRatio(null); |
| | | } else { |
| | | register.setRatio(new BigDecimal(v3).setScale(2, BigDecimal.ROUND_HALF_UP).abs()); |
| | | register.setRatio(new BigDecimal(v3).setScale(4, BigDecimal.ROUND_HALF_UP).abs()); |
| | | } |
| | | if (v3 < 0) { |
| | | register.setUp(false); |