|
@@ -18,6 +18,7 @@ import com.sooka.sponest.event.centereventteventcatalogue.domain.dahua.*;
|
|
|
import com.sooka.sponest.event.centereventteventcatalogue.domain.haikang.EventsVo;
|
|
|
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.tower.TowerEventVo;
|
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.AlarmEventService;
|
|
|
import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
|
|
|
import com.sooka.sponest.event.centereventteventtype.domain.CentereventTEventtype;
|
|
@@ -421,6 +422,7 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
return "请刷新后重试";
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
@Override
|
|
|
public String insertDaHuaOtherEvent(DaHuaOtherEventVO daHuaOtherEventVO) {
|
|
|
// 验证是否配置摄像头通道
|
|
@@ -474,6 +476,62 @@ public class AlarmEventServiceImpl implements AlarmEventService {
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
+ public String insertTowerEvent(TowerEventVo towerEventVo) {
|
|
|
+ // 验证是否配置指挥中心
|
|
|
+ List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).listForCommandCenter(towerEventVo.getDeviceCode(), "1", "1").getData();
|
|
|
+ if (StringUtils.isEmpty(listDept)) {
|
|
|
+ logger.info(ERROR_MSG_DEPT, towerEventVo.getDeviceCode());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ // 验证事件类型是否配置对应报文码值--只能从数据库配
|
|
|
+ CentereventTEventtype centereventTEventtype = centereventTEventtypeService.selectCentereventTEventtypeByCodeTower(towerEventVo.getAlarmType());
|
|
|
+ if (StringUtils.isNull(centereventTEventtype)) {
|
|
|
+ logger.info("无法匹配相关事件!报文码值为:{}", towerEventVo.getAlarmType());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ // 事件目录
|
|
|
+ String eventType = centereventTEventtype.getParentId();
|
|
|
+ String eventTypeXl = centereventTEventtype.getId();
|
|
|
+ String eventName = towerEventVo.getDeviceName() + DateUtils.parseDateToStr(YYYY_MM_DD_HH_MM_SS, towerEventVo.getAlarmTime()) + centereventTEventtype.getEventTypeName();
|
|
|
+ String eventDescription = towerEventVo.toString();
|
|
|
+ String longitude = towerEventVo.getEventLongitude();
|
|
|
+ String latitude = towerEventVo.getEventLatitude();
|
|
|
+ String reportor = towerEventVo.getDeviceName();
|
|
|
+ Date reportTime = towerEventVo.getAlarmTime();
|
|
|
+ String address = towerEventVo.getAddress();
|
|
|
+ CentereventTEventcatalogue centereventTEventcatalogue = new CentereventTEventcatalogue(eventType, eventTypeXl, eventName, eventDescription, longitude, latitude, reportor, reportTime, address);
|
|
|
+ CenterdataTCamera centerdataTCamera = new CenterdataTCamera(towerEventVo.getDeviceCode(), towerEventVo.getDeviceName());
|
|
|
+ centereventTEventcatalogue = this.insertEventCatalogue(centereventTEventcatalogue, centerdataTCamera, null);
|
|
|
+ // 事件部门
|
|
|
+ this.insertEventDept(centereventTEventcatalogue, listDept);
|
|
|
+ // 事件日志
|
|
|
+ String logId = this.insertEventLog(centereventTEventcatalogue);
|
|
|
+ if (StringUtils.isNotBlank(towerEventVo.getOriginalPictureUrl())) {
|
|
|
+ String[] pictures = towerEventVo.getOriginalPictureUrl().split(",");
|
|
|
+ for (String picture : pictures) {
|
|
|
+ CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
+ tAttach.setBusId(logId);
|
|
|
+ tAttach.setAttachPath(picture);
|
|
|
+ tAttach.setBusIndx(BUS_INDEX_2);
|
|
|
+ tAttach.setBusSource("TT_1");
|
|
|
+ tAttach.setFileType(FILE_TYPE_1);
|
|
|
+ remoteDataService.insertAttach(tAttach);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(towerEventVo.getAlarmPictureUrl())) {
|
|
|
+ CenterdataTAttach tAttach = new CenterdataTAttach();
|
|
|
+ tAttach.setBusId(logId);
|
|
|
+ tAttach.setAttachPath(towerEventVo.getAlarmPictureUrl());
|
|
|
+ tAttach.setBusIndx(BUS_INDEX_2);
|
|
|
+ tAttach.setBusSource("TT_1");
|
|
|
+ tAttach.setFileType(FILE_TYPE_1);
|
|
|
+ remoteDataService.insertAttach(tAttach);
|
|
|
+ }
|
|
|
+ return centereventTEventcatalogue.getEventCode();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ @Override
|
|
|
public String insertSensorEvent(SensorEventVo sensorEventVo) {
|
|
|
// 验证是否配置指挥中心
|
|
|
List<CenterdataTAidevicedept> listDept = SpringUtils.getBean(RemoteMonitorService.class).listForCommandCenter(sensorEventVo.getSensorId(), "1", "1").getData();
|