| | |
| | | |
| | | 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; |
| | | import com.ycl.entity.caseHandler.Violations; |
| | | import com.ycl.entity.dict.DataDictionary; |
| | | import com.ycl.entity.resources.ImageResources; |
| | | import com.ycl.entity.video.VideoAlarmReport; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.enums.common.DictTypeEnum; |
| | |
| | | import com.ycl.service.caseHandler.IBaseCaseService; |
| | | import com.ycl.service.caseHandler.IViolationsService; |
| | | import com.ycl.service.dict.IDataDictionaryService; |
| | | import com.ycl.service.resources.IImageResourcesService; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private IVideoPointService videoPointService; |
| | | private IBaseCaseService baseCaseService; |
| | | private IDataDictionaryService dataDictionaryService; |
| | | private IImageResourcesService imageResourcesService; |
| | | |
| | | @Resource |
| | | BaseCaseMapper baseCaseMapper; |
| | | |
| | | @Autowired |
| | | UtilNumber utilNumber; |
| | | |
| | | @Autowired |
| | | public void setVideoPointService(IVideoPointService videoPointService) { |
| | |
| | | this.dataDictionaryService = dataDictionaryService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setImageResourcesService(IImageResourcesService imageResourcesService) { |
| | | this.imageResourcesService = imageResourcesService; |
| | | } |
| | | |
| | | @Override |
| | | public void saveFromVideo(List<VideoAlarmReport> videoAlarmReports) { |
| | | for (VideoAlarmReport videoAlarmReport : videoAlarmReports) { |
| | |
| | | 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()); |
| | |
| | | } |
| | | |
| | | baseMapper.insert(violations); |
| | | |
| | | try { |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType("01"); |
| | | imageResources.setBelongToId(baseCase.getId()); |
| | | imageResources.setUrl(videoAlarmReport.getPicData()); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResourcesService.save(imageResources); |
| | | } catch (Exception ex) { |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |