|
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.dahuatech.icc.exception.ClientException;
|
|
import com.dahuatech.icc.exception.ClientException;
|
|
import com.dahuatech.icc.oauth.http.IccHttpHttpRequest;
|
|
import com.dahuatech.icc.oauth.http.IccHttpHttpRequest;
|
|
-import com.ruoyi.common.core.domain.R;
|
|
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
import com.ruoyi.common.core.utils.DateUtils;
|
|
import com.ruoyi.common.core.utils.SpringUtils;
|
|
import com.ruoyi.common.core.utils.SpringUtils;
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
@@ -13,7 +12,6 @@ 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.RemoteFileService;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
import com.ruoyi.system.api.domain.SysDept;
|
|
-import com.ruoyi.system.api.domain.SysFile;
|
|
|
|
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;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
|
|
@@ -41,18 +39,12 @@ 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;
|
|
import com.sooka.sponest.monitor.api.domain.CenterdataTCamera;
|
|
import com.sooka.sponest.monitor.api.domain.CenterdataTCamera;
|
|
-import com.sooka.sponest.monitor.api.domain.CentermonitorTUav;
|
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
-import org.springframework.http.HttpEntity;
|
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
|
-import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -291,10 +283,10 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
centereventTFireLog.setOperationType(LOG_OPER_TYPE_3);
|
|
centereventTFireLog.setOperationType(LOG_OPER_TYPE_3);
|
|
centereventTFireLog.setCreateName(centereventTEventcatalogue.getCreateName());
|
|
centereventTFireLog.setCreateName(centereventTEventcatalogue.getCreateName());
|
|
centereventTFireLog.setCreateTime(centereventTEventcatalogue.getCreateTime());
|
|
centereventTFireLog.setCreateTime(centereventTEventcatalogue.getCreateTime());
|
|
- if(StringUtils.isNotEmpty(centereventTEventcatalogue.getLongitude())){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(centereventTEventcatalogue.getLongitude())) {
|
|
centereventTFireLog.setLongitude(centereventTEventcatalogue.getLongitude());
|
|
centereventTFireLog.setLongitude(centereventTEventcatalogue.getLongitude());
|
|
}
|
|
}
|
|
- if(StringUtils.isNotEmpty(centereventTEventcatalogue.getLatitude())){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(centereventTEventcatalogue.getLatitude())) {
|
|
centereventTFireLog.setLatitude(centereventTEventcatalogue.getLatitude());
|
|
centereventTFireLog.setLatitude(centereventTEventcatalogue.getLatitude());
|
|
}
|
|
}
|
|
logger.info("写入事件部门表:-->{}", centereventTEventcatalogue.getEventCode());
|
|
logger.info("写入事件部门表:-->{}", centereventTEventcatalogue.getEventCode());
|
|
@@ -310,8 +302,10 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
// 313:烟雾,5122:热感
|
|
// 313:烟雾,5122:热感
|
|
if (type == 313 || type == 5122) {
|
|
if (type == 313 || type == 5122) {
|
|
return insertFireEvent(daHuaFireEventVO);
|
|
return insertFireEvent(daHuaFireEventVO);
|
|
- } else if (type == 302 || type == 303 || type == 962 || type == 963 || type == 964 || type == 965) {
|
|
|
|
|
|
+ } else if (type == 302 || type == 303 || type == 962 || type == 963 || type == 964 || type == 965
|
|
|
|
+ || type == 987654321 || type == 987654322 || type == 987654333 || type == 987654334) {
|
|
// 302:绊线入侵,303:区域入侵 ,962:人穿越警戒线,963:机动车穿越警戒线,964:人穿越区域,965:机动车穿越区域
|
|
// 302:绊线入侵,303:区域入侵 ,962:人穿越警戒线,963:机动车穿越警戒线,964:人穿越区域,965:机动车穿越区域
|
|
|
|
+ //鄂前大华新事件类型 987654321:违法畜牧,987654322:违章建筑,987654333:河岸垃圾倾倒,987654334:耕地保护
|
|
return insertBayonetEvent(daHuaFireEventVO);
|
|
return insertBayonetEvent(daHuaFireEventVO);
|
|
}
|
|
}
|
|
return "";
|
|
return "";
|
|
@@ -708,15 +702,7 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int insertDroneEvent(List<DroneVO> alarmData) {
|
|
public int insertDroneEvent(List<DroneVO> alarmData) {
|
|
- Map<Object, Object> eventType = new HashMap<>();
|
|
|
|
- eventType.put("Sheep","222");
|
|
|
|
- eventType.put("Car","218");
|
|
|
|
-
|
|
|
|
- Map<Object, Object> eventLabel = new HashMap<>();
|
|
|
|
- eventLabel.put("Sheep","区域入侵");
|
|
|
|
- eventLabel.put("Car","工程车检测");
|
|
|
|
-
|
|
|
|
- // 将告警图片转换为本地图片
|
|
|
|
|
|
+ // 将告警图片转换为本地图片
|
|
alarmData.parallelStream().forEach(item -> {
|
|
alarmData.parallelStream().forEach(item -> {
|
|
item.setId(IdUtils.simpleUUID());
|
|
item.setId(IdUtils.simpleUUID());
|
|
try {
|
|
try {
|
|
@@ -727,18 +713,16 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// 通过无人机id, 获取无人机信息和绑定的指挥中心
|
|
// 通过无人机id, 获取无人机信息和绑定的指挥中心
|
|
- alarmData.forEach(alarm->{
|
|
|
|
|
|
+ alarmData.forEach(alarm -> {
|
|
Map<String, Object> data = (Map<String, Object>) SpringUtils.getBean(RemoteMonitorService.class).selectUavByUavId(alarm.getCopterId(), "1").get("data");
|
|
Map<String, Object> data = (Map<String, Object>) SpringUtils.getBean(RemoteMonitorService.class).selectUavByUavId(alarm.getCopterId(), "1").get("data");
|
|
- /**
|
|
|
|
- * 牛羊 Sheep:222
|
|
|
|
- * 车辆 Car: 218
|
|
|
|
- */
|
|
|
|
|
|
|
|
- String eventName = MapUtils.getString(data, "uavName")+"上报"+MapUtils.getString(eventLabel, alarm.getAlarmType())+"事件";
|
|
|
|
- String eventDescription = "基站:"+MapUtils.getString(data, "baseStationName")+",无人机:"+MapUtils.getString(data, "uavName")+",经度:"+alarm.getLongitude()+",纬度:"+alarm.getLatitude()+",海拔:"+alarm.getAltitude();
|
|
|
|
|
|
+ Map<Object, Object> eventType = alarmEventMapper.getEventTypeByCodeTower(alarm.getAlarmType());
|
|
|
|
+
|
|
|
|
+ String eventName = MapUtils.getString(data, "uavName") + "上报" + MapUtils.getString(eventType, "eventTypeName") + "事件";
|
|
|
|
+ String eventDescription = "基站:" + MapUtils.getString(data, "baseStationName") + ",无人机:" + MapUtils.getString(data, "uavName") + ",经度:" + alarm.getLongitude() + ",纬度:" + alarm.getLatitude() + ",海拔:" + alarm.getAltitude();
|
|
|
|
|
|
//创建事件主体, 写入事件表.
|
|
//创建事件主体, 写入事件表.
|
|
- CentereventTEventcatalogue centereventTEventcatalogue = new CentereventTEventcatalogue("2", MapUtils.getString(eventType, alarm.getAlarmType()), eventName, eventDescription, alarm.getLongitude(), alarm.getLatitude(), MapUtils.getString(data, "uavName"), alarm.getCreationTime(), "");
|
|
|
|
|
|
+ CentereventTEventcatalogue centereventTEventcatalogue = new CentereventTEventcatalogue("2", MapUtils.getString(eventType, "eventType"), eventName, eventDescription, alarm.getLongitude(), alarm.getLatitude(), MapUtils.getString(data, "uavName"), alarm.getCreationTime(), "");
|
|
centereventTEventcatalogue.setLongitude(alarm.getLongitude());
|
|
centereventTEventcatalogue.setLongitude(alarm.getLongitude());
|
|
centereventTEventcatalogue.setLatitude(alarm.getLatitude());
|
|
centereventTEventcatalogue.setLatitude(alarm.getLatitude());
|
|
centereventTEventcatalogue.setReportSource(REPORTING_SOURCE_6);
|
|
centereventTEventcatalogue.setReportSource(REPORTING_SOURCE_6);
|
|
@@ -758,7 +742,7 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
centereventTDeptEvent.setId(IdUtils.fastSimpleUUID());
|
|
centereventTDeptEvent.setId(IdUtils.fastSimpleUUID());
|
|
centereventTDeptEvent.setEventCode(eventCode);
|
|
centereventTDeptEvent.setEventCode(eventCode);
|
|
centereventTDeptEvent.setDeptId(MapUtils.getLong(item, "mapDeptId"));
|
|
centereventTDeptEvent.setDeptId(MapUtils.getLong(item, "mapDeptId"));
|
|
- centereventTDeptEvent.setDeptName(MapUtils.getString(item,"mapDeptName"));
|
|
|
|
|
|
+ centereventTDeptEvent.setDeptName(MapUtils.getString(item, "mapDeptName"));
|
|
centereventTDeptEvent.setIsUrged(SYS_ISURGE_2);
|
|
centereventTDeptEvent.setIsUrged(SYS_ISURGE_2);
|
|
centereventTDeptEvent.setEventStatus("上报");
|
|
centereventTDeptEvent.setEventStatus("上报");
|
|
centereventTDeptEvent.setEventStatusValue(FOREST_EVENT_STATUS_1);
|
|
centereventTDeptEvent.setEventStatusValue(FOREST_EVENT_STATUS_1);
|
|
@@ -780,10 +764,10 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
// centereventTFireLog.setCreateBy(alarm.getCopterId());
|
|
// centereventTFireLog.setCreateBy(alarm.getCopterId());
|
|
centereventTFireLog.setCreateName(centereventTEventcatalogue.getCreateName());
|
|
centereventTFireLog.setCreateName(centereventTEventcatalogue.getCreateName());
|
|
centereventTFireLog.setCreateTime(centereventTEventcatalogue.getCreateTime());
|
|
centereventTFireLog.setCreateTime(centereventTEventcatalogue.getCreateTime());
|
|
- if(StringUtils.isNotEmpty(centereventTEventcatalogue.getLongitude())){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(centereventTEventcatalogue.getLongitude())) {
|
|
centereventTFireLog.setLongitude(centereventTEventcatalogue.getLongitude());
|
|
centereventTFireLog.setLongitude(centereventTEventcatalogue.getLongitude());
|
|
}
|
|
}
|
|
- if(StringUtils.isNotEmpty(centereventTEventcatalogue.getLatitude())){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(centereventTEventcatalogue.getLatitude())) {
|
|
centereventTFireLog.setLatitude(centereventTEventcatalogue.getLatitude());
|
|
centereventTFireLog.setLatitude(centereventTEventcatalogue.getLatitude());
|
|
}
|
|
}
|
|
centereventTFireLogService.insertCentereventTFireLog(centereventTFireLog);
|
|
centereventTFireLogService.insertCentereventTFireLog(centereventTFireLog);
|
|
@@ -845,7 +829,7 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
if (StringUtils.isNotBlank(eventsVo.getSnappedPicUrl())) {
|
|
if (StringUtils.isNotBlank(eventsVo.getSnappedPicUrl())) {
|
|
CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
tAttach.setBusId(logId);
|
|
tAttach.setBusId(logId);
|
|
- JSONObject jsonObject = JSON.parseObject(MapUtils.getString(eventsVo.getData(),"transInfo"));
|
|
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(MapUtils.getString(eventsVo.getData(), "transInfo"));
|
|
String imageUrl = jsonObject.getString("imageUrl");
|
|
String imageUrl = jsonObject.getString("imageUrl");
|
|
|
|
|
|
Optional.ofNullable(NetworkImageToMultipartFile.downloadImageToMultipartFile(imageUrl))
|
|
Optional.ofNullable(NetworkImageToMultipartFile.downloadImageToMultipartFile(imageUrl))
|