| | |
| | | package com.ycl.service.caseHandler.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.BeanUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.common.util.UtilNumber; |
| | | import com.ycl.dto.video.HKAlarmParam; |
| | |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | |
| | | try { |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType("01"); |
| | | imageResources.setType("05"); |
| | | imageResources.setBelongToId(baseCase.getId()); |
| | | imageResources.setUrl(videoAlarmReport.getPicData()); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | |
| | | ImageResources imageResources1 = new ImageResources(); |
| | | BeanUtil.copyProperties(imageResources,imageResources1); |
| | | imageResources1.setType("01"); |
| | | |
| | | imageResourcesService.save(imageResources1); |
| | | imageResourcesService.save(imageResources); |
| | | } catch (Exception ex) { |
| | | System.out.println("海康推送保存异常:" + ex.getMessage()); |
| | |
| | | VideoPoint videoPoint = videoPointService.getByCode(alarmParam.getEventNumber()); |
| | | |
| | | List<DataDictionary> dataDictionaries = dataDictionaryService.queryByRemark(alarmParam.getSubject()); |
| | | |
| | | Instant instant = Instant.ofEpochMilli(Long.parseLong(alarmParam.getIncidentDate())); |
| | | LocalDateTime alarmTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime alarmTime = LocalDateTime.parse(alarmParam.getIncidentDate(), df); |
| | | |
| | | BaseCase baseCase = BaseCase.builder().eventSource(1).category(QuestionCategory.VIOLATION.getCode()) |
| | | .code(utilNumber.createCaseCode()).createTime(LocalDateTime.now()).createUser(0L).state(1). |
| | |
| | | try { |
| | | for (int i = 0; i < imgs.length; i++) { |
| | | ImageResources imageResources = new ImageResources(); |
| | | imageResources.setType("01"); |
| | | imageResources.setType("04"); |
| | | imageResources.setBelongToId(baseCase.getId()); |
| | | imageResources.setUrl(imgs[i]); |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResourcesService.save(imageResources); |
| | | |
| | | ImageResources imageResources1 = new ImageResources(); |
| | | BeanUtil.copyProperties(imageResources,imageResources1); |
| | | imageResources1.setType("01"); |
| | | |
| | | imageResourcesService.save(imageResources1); |
| | | imageResourcesService.save(imageResources); |
| | | } |
| | | } catch (Exception ex) { |
| | | |