|
@@ -74,7 +74,8 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public String insertHaiKangFireEvent(EventsVo eventsVo) {
|
|
|
+ public String insertHaiKangFireEvent(HaiKangEventVo haiKangEventVo) {
|
|
|
+ EventsVo eventsVo = haiKangEventVo.getEvents()[0];
|
|
|
// 验证是否配置摄像头通道
|
|
|
CenterdataTCamera centerdataTCamera = SpringUtils.getBean(RemoteMonitorService.class).getInfoByChannelCode(eventsVo.getSrcIndex()).getData();
|
|
|
if (StringUtils.isNull(centerdataTCamera)) {
|
|
@@ -88,13 +89,13 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
return "";
|
|
|
}
|
|
|
// 事件目录
|
|
|
- String eventName = eventsVo.getEventName();
|
|
|
- String eventDescription = eventsVo.getData().toString();
|
|
|
- String longitude = eventsVo.getData().toString();
|
|
|
- String latitude = eventsVo.getData().toString();
|
|
|
- String reportor = eventsVo.getSrcName();
|
|
|
- Date reportTime = new Date();
|
|
|
- String address = eventsVo.getData().toString();
|
|
|
+ String eventName = centerdataTCamera.getCameraName() + DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, haiKangEventVo.getSendTime()) + "火情事件";
|
|
|
+ String eventDescription = eventsVo.toString(centerdataTCamera);
|
|
|
+ String longitude = centerdataTCamera.getLongitude();
|
|
|
+ String latitude = centerdataTCamera.getLatitude();
|
|
|
+ String reportor = centerdataTCamera.getCameraName();
|
|
|
+ Date reportTime = haiKangEventVo.getSendTime();
|
|
|
+ String address = eventsVo.getSrcName();
|
|
|
CentereventTEventcatalogue centereventTEventcatalogue = new CentereventTEventcatalogue("1", null, eventName, eventDescription, longitude, latitude, reportor, reportTime, address);
|
|
|
centereventTEventcatalogue = this.insertEventCatalogue(centereventTEventcatalogue, centerdataTCamera, null);
|
|
|
// 事件部门
|
|
@@ -102,24 +103,25 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
// 事件日志
|
|
|
String logId = this.insertEventLog(centereventTEventcatalogue);
|
|
|
// 附件
|
|
|
-// if (StringUtils.isNotBlank(eventsVo.getData().getImageUrl())) {
|
|
|
-// CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
-// tAttach.setBusId(logId);
|
|
|
-// tAttach.setAttachPath(eventsVo.getData().getImageUrl());
|
|
|
-// tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
-// tAttach.setBusSource("HIK_1");
|
|
|
-// tAttach.setFileType(FILE_TYPE_1);
|
|
|
-// remoteDataService.insertAttach(tAttach);
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotBlank(eventsVo.getData().getVisiblePicUrl())) {
|
|
|
-// CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
-// tAttach.setBusId(logId);
|
|
|
-// tAttach.setAttachPath(eventsVo.getData().getVisiblePicUrl());
|
|
|
-// tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
-// tAttach.setBusSource("HIK_1");
|
|
|
-// tAttach.setFileType(FILE_TYPE_1);
|
|
|
-// remoteDataService.insertAttach(tAttach);
|
|
|
-// }
|
|
|
+ JSONObject picObj = JSONObject.parseObject(JSON.toJSONString(eventsVo.getData())).getJSONArray("fireDetection").getJSONObject(0);
|
|
|
+ if (StringUtils.isNotBlank(picObj.getString("imageUrl"))) {
|
|
|
+ CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
+ tAttach.setBusId(logId);
|
|
|
+ tAttach.setAttachPath(picObj.getString("imageUrl"));
|
|
|
+ tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
+ tAttach.setBusSource("HIK_1");
|
|
|
+ tAttach.setFileType(FILE_TYPE_1);
|
|
|
+ remoteDataService.insertAttach(tAttach);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(picObj.getString("visiblePicUrl"))) {
|
|
|
+ CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
+ tAttach.setBusId(logId);
|
|
|
+ tAttach.setAttachPath(picObj.getString("visiblePicUrl"));
|
|
|
+ tAttach.setBusIndx(BUS_INDEX_1);
|
|
|
+ tAttach.setBusSource("HIK_1");
|
|
|
+ tAttach.setFileType(FILE_TYPE_1);
|
|
|
+ remoteDataService.insertAttach(tAttach);
|
|
|
+ }
|
|
|
return centereventTEventcatalogue.getEventCode();
|
|
|
}
|
|
|
|
|
@@ -148,7 +150,7 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
// 事件目录
|
|
|
String eventType = centereventTEventtype.getParentId();
|
|
|
String eventTypeXl = centereventTEventtype.getId();
|
|
|
- String eventName = centerdataTCamera.getCameraName() + haiKangEventVo.getSendTime() + eventsVo.getEventName();
|
|
|
+ String eventName = centerdataTCamera.getCameraName() + DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, haiKangEventVo.getSendTime()) + eventsVo.getEventName();
|
|
|
String eventDescription = eventsVo.toString(centerdataTCamera);
|
|
|
String longitude = centerdataTCamera.getLongitude();
|
|
|
String latitude = centerdataTCamera.getLatitude();
|