|
@@ -9,6 +9,7 @@ import com.ruoyi.common.core.utils.SpringUtils;
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
import com.ruoyi.system.api.RemoteDeptService;
|
|
import com.ruoyi.system.api.RemoteDeptService;
|
|
|
|
+import com.ruoyi.system.api.RemoteFileService;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent;
|
|
import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent;
|
|
import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
|
|
import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
|
|
@@ -19,6 +20,8 @@ import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.EventsV
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.HaiKangEventVo;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.HaiKangEventVo;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.sensor.SensorEventVo;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.sensor.SensorEventVo;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.tower.TowerEventVo;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.tower.TowerEventVo;
|
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.domain.vo.DroneVO;
|
|
|
|
+import com.sooka.sponest.event.centereventteventcatalogue.mapper.AlarmEventMapper;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.AlarmEventService;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.AlarmEventService;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
|
|
import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
|
|
import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
|
|
@@ -28,6 +31,7 @@ import com.sooka.sponest.event.centereventtfirelog.service.ICentereventTFireLogS
|
|
import com.sooka.sponest.event.remoteapi.RemoteDataService;
|
|
import com.sooka.sponest.event.remoteapi.RemoteDataService;
|
|
import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
|
|
import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
|
|
import com.sooka.sponest.event.utils.GWHttpUtilsTest65;
|
|
import com.sooka.sponest.event.utils.GWHttpUtilsTest65;
|
|
|
|
+import com.sooka.sponest.event.utils.NetworkImageToMultipartFile;
|
|
import com.sooka.sponest.event.utils.RemoteApiUtil;
|
|
import com.sooka.sponest.event.utils.RemoteApiUtil;
|
|
import com.sooka.sponest.monitor.api.RemoteMonitorService;
|
|
import com.sooka.sponest.monitor.api.RemoteMonitorService;
|
|
import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
|
|
import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
|
|
@@ -47,6 +51,7 @@ import org.springframework.web.client.RestTemplate;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
import static com.ruoyi.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
|
import static com.ruoyi.common.core.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;
|
|
import static com.sooka.sponest.event.utils.EventConstants.*;
|
|
import static com.sooka.sponest.event.utils.EventConstants.*;
|
|
@@ -71,6 +76,12 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
@Autowired
|
|
@Autowired
|
|
private ICentereventTEventtypeService centereventTEventtypeService;
|
|
private ICentereventTEventtypeService centereventTEventtypeService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private RemoteFileService fileService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private AlarmEventMapper alarmEventMapper;
|
|
|
|
+
|
|
@Value("${sooka.dahuaservice.detail}")
|
|
@Value("${sooka.dahuaservice.detail}")
|
|
private String detailUrl;
|
|
private String detailUrl;
|
|
|
|
|
|
@@ -673,4 +684,20 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
this.insertEventLog(centereventTEventcatalogue);
|
|
this.insertEventLog(centereventTEventcatalogue);
|
|
return centereventTEventcatalogue.getEventCode() + "_" + eventtype.getEventTypeName();
|
|
return centereventTEventcatalogue.getEventCode() + "_" + eventtype.getEventTypeName();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int insertDroneEvent(List<DroneVO> alarmData) {
|
|
|
|
+ alarmData.parallelStream().forEach(item -> {
|
|
|
|
+ item.setId(IdUtils.simpleUUID());
|
|
|
|
+ try {
|
|
|
|
+ Optional.ofNullable(NetworkImageToMultipartFile.downloadImageToMultipartFile(item.getPhotoPath()))
|
|
|
|
+ .map(multipartFile -> fileService.upload(multipartFile).getData())
|
|
|
|
+ .ifPresent(data -> item.setLocalPath(data.getUrl()));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("Failed to process image for item {}: {}", item.getId(), e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return alarmEventMapper.insertDrone(alarmData);
|
|
|
|
+ }
|
|
}
|
|
}
|