| | |
| | | import com.ycl.service.dict.IDataDictionaryService; |
| | | import com.ycl.service.region.ISccgRegionService; |
| | | import com.ycl.service.resources.IImageResourcesService; |
| | | import com.ycl.service.video.IVideoAlarmReportService; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private IDataDictionaryService dataDictionaryService; |
| | | private IImageResourcesService imageResourcesService; |
| | | private ISccgRegionService regionService; |
| | | private IVideoAlarmReportService videoAlarmReportService; |
| | | @Resource |
| | | BaseCaseMapper baseCaseMapper; |
| | | |
| | |
| | | @Autowired |
| | | public void setRegionService(ISccgRegionService regionService) { |
| | | this.regionService = regionService; |
| | | } |
| | | |
| | | @Autowired |
| | | public void setVideoAlarmReportService(IVideoAlarmReportService videoAlarmReportService) { |
| | | this.videoAlarmReportService = videoAlarmReportService; |
| | | } |
| | | |
| | | @Override |
| | |
| | | List<DataDictionary> dataDictionaries = dataDictionaryService.queryByRemark(alarmParam.getSubject()); |
| | | |
| | | Instant instant = Instant.ofEpochMilli(Long.parseLong(alarmParam.getIncidentDate())); |
| | | LocalDateTime alarmTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); |
| | | |
| | | BaseCase baseCase = BaseCase.builder().eventSource(1).category(QuestionCategory.VIOLATION.getCode()) |
| | | .code(utilNumber.createCaseCode()).createTime(LocalDateTime.now()).createUser(0L).state(1). |
| | | alarmTime(LocalDateTime.ofInstant(instant, ZoneId.systemDefault())).build(); |
| | | alarmTime(alarmTime).build(); |
| | | Violations violations = new Violations(); |
| | | |
| | | baseCase.setLatitude(alarmParam.getLatitude()); |
| | |
| | | if (videoPoint != null) { |
| | | violations.setVideoPointId(videoPoint.getId()); |
| | | } |
| | | baseMapper.insert(violations); |
| | | |
| | | String[] imgs = alarmParam.getFileUrl().split(","); |
| | | |
| | | VideoAlarmReport videoAlarmReport = new VideoAlarmReport(); |
| | | videoAlarmReport.setPlatResourceId(alarmParam.getEventNumber()); |
| | | if (imgs.length > 0) { |
| | | videoAlarmReport.setPicData(imgs[0]); |
| | | } |
| | | videoAlarmReport.setAlarmTime(alarmTime); |
| | | videoAlarmReport.setAlarmId(alarmParam.getEventId()); |
| | | videoAlarmReport.setAlgoName(alarmParam.getContact()); |
| | | videoAlarmReport.setAlarmName(alarmParam.getSubject()); |
| | | videoAlarmReportService.save(videoAlarmReport); |
| | | |
| | | violations.setVideoAlarmReportId(videoAlarmReport.getId()); |
| | | baseMapper.insert(violations); |
| | | |
| | | try { |
| | | for (int i = 0; i < imgs.length; i++) { |
| | |
| | | } catch (Exception ex) { |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |