| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.util.UtilNumber; |
| | | import com.ycl.entity.caseHandler.BaseCase; |
| | | import com.ycl.entity.caseHandler.EventSource; |
| | | import com.ycl.entity.caseHandler.QuestionCategory; |
| | |
| | | BaseCaseMapper baseCaseMapper; |
| | | |
| | | @Autowired |
| | | UtilNumber utilNumber; |
| | | |
| | | @Autowired |
| | | public void setVideoPointService(IVideoPointService videoPointService) { |
| | | this.videoPointService = videoPointService; |
| | | } |
| | |
| | | public void saveFromVideo(List<VideoAlarmReport> videoAlarmReports) { |
| | | for (VideoAlarmReport videoAlarmReport : videoAlarmReports) { |
| | | VideoPoint videoPoint = null; |
| | | LambdaQueryWrapper<VideoPoint> queryWrapper = new LambdaQueryWrapper<VideoPoint>().eq(VideoPoint::getPlatResourceId, videoAlarmReport.getPlatResourceId()); |
| | | LambdaQueryWrapper<VideoPoint> queryWrapper = new LambdaQueryWrapper<VideoPoint>() |
| | | .eq(VideoPoint::getPlatResourceId, videoAlarmReport.getPlatResourceId()) |
| | | .or().eq(VideoPoint::getCode, videoAlarmReport.getPlatResourceId()); |
| | | List<VideoPoint> pointList = videoPointService.list(queryWrapper); |
| | | if (pointList.size() > 0) { |
| | | videoPoint = pointList.get(0); |
| | | } |
| | | BaseCase baseCase = BaseCase.builder().eventSource(EventSource.VIDEO.getCode()).category(QuestionCategory.VIOLATION.getCode()) |
| | | .createTime(LocalDateTime.now()).createUser(0L).state(1).alarmTime(videoAlarmReport.getAlarmTime()).build(); |
| | | .code(utilNumber.createCaseCode()).createTime(LocalDateTime.now()).createUser(0L).state(1).alarmTime(videoAlarmReport.getAlarmTime()).build(); |
| | | Violations violations = new Violations(); |
| | | if (videoPoint != null) { |
| | | baseCase.setLatitude(videoPoint.getLatitude()); |