| | |
| | | import com.ycl.mapper.trend.TrendAnalysisMapper; |
| | | import com.ycl.service.caseHandler.IBaseCaseService; |
| | | import com.ycl.service.caseHandler.IViolationsService; |
| | | import com.ycl.service.trend.TrendAnalysisService; |
| | | import com.ycl.util.CheckApiUtil; |
| | | import com.ycl.vo.TrendVo; |
| | | import com.ycl.vo.cockpit.CockpitVO; |
| | | import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO; |
| | | import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | IBaseCaseService iBaseCaseService; |
| | | @Autowired |
| | | IViolationsService iViolationsService; |
| | | @Autowired |
| | | @Resource |
| | | TrendAnalysisMapper trendAnalysisMapper; |
| | | |
| | | @ApiOperation(value = "执法事件统计") |
| | | @GetMapping("/statistics") |
| | | public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO(); |
| | | eventVO.setCount(10); |
| | | eventVO.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP)); |
| | | eventVO.setUp(true); |
| | | map.put("reported", eventVO); |
| | | map.put("disposition", eventVO); |
| | | map.put("dispositionInTime", eventVO); |
| | | map.put("register", eventVO); |
| | | return CommonResult.success(map); |
| | | return CommonResult.success(iBaseCaseService.statistics()); |
| | | } |
| | | |
| | | @ApiOperation(value = "事件类型") |
| | |
| | | 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(2, BigDecimal.ROUND_HALF_UP))); |
| | | typeAndSourceVO.setRecords(videoAndAreaVOS); |
| | | return CommonResult.success(typeAndSourceVO); |
| | | } |
| | |
| | | al.setCount(alCount); |
| | | typeVO1s.add(al); |
| | | VideoAndAreaVO hand = new VideoAndAreaVO(); |
| | | hand.setName("人工上报"); |
| | | hand.setName("网格巡查"); |
| | | hand.setRatio(new BigDecimal(handCount * 1.0 / allCount).setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | hand.setCount(handCount); |
| | | typeVO1s.add(hand); |