Publish geo alerts to cdm notifications

revert-70aa11f8
charitha 6 years ago
parent 2a995deeb4
commit 055d422e23

@ -122,10 +122,10 @@ function processAfterInitializationMap(geoFencingEnabled) {
}; };
map.addControl(L.control.fullscreen({position: 'bottomright'})); map.addControl(L.control.fullscreen({position: 'bottomright'}));
geoAlertsBar = L.control.geoAlerts({position: 'topright'}); // geoAlertsBar = L.control.geoAlerts({position: 'topright'});
if (geoFencingEnabled) { // if (geoFencingEnabled) {
map.addControl(geoAlertsBar); // map.addControl(geoAlertsBar);
} // }
groupedOverlays = { groupedOverlays = {
"Web Map Service layers": {} "Web Map Service layers": {}
@ -256,7 +256,7 @@ function focusOnSpatialObject(objectId) {
// TODO: check the map._layersMaxZoom and set the zoom level accordingly // TODO: check the map._layersMaxZoom and set the zoom level accordingly
spatialObject.marker.openPopup(); spatialObject.marker.openPopup();
getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime()); // getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime());
spatialObject.drawPath(); spatialObject.drawPath();
if (speedGraphControl) { if (speedGraphControl) {
setTimeout(function () { setTimeout(function () {
@ -435,11 +435,11 @@ function drawSpatialObject() {
return true; return true;
} }
if (geoFencingEnabled) { // if (geoFencingEnabled) {
var alertsFromDate = new Date(); // var alertsFromDate = new Date();
alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours // alertsFromDate.setHours(alertsFromDate.getHours() - 24); //last 24 hours
getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf()); // getAlertsHistory(deviceType, deviceId, alertsFromDate.valueOf(), toDate.valueOf());
} // }
setTimeout(function () { setTimeout(function () {
map.invalidateSize(); map.invalidateSize();
@ -513,7 +513,7 @@ function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
// TODO: check the map._layersMaxZoom and set the zoom level accordingly // TODO: check the map._layersMaxZoom and set the zoom level accordingly
spatialObject.marker.openPopup(); spatialObject.marker.openPopup();
getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime()); // getAlertsHistory(deviceType, deviceId, new Date($('#timeFromCal').val()).getTime(), new Date($('#timeToCal').val()).getTime());
spatialObject.drawPath(); spatialObject.drawPath();
if (speedGraphControl) { if (speedGraphControl) {
setTimeout(function () { setTimeout(function () {

@ -396,16 +396,14 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_APPLICATION_MAPPING (
CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL, NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL, LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
-- NOTIFICATION TABLE END -- -- NOTIFICATION TABLE END --

@ -439,16 +439,14 @@ IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[D
CREATE TABLE DM_NOTIFICATION ( CREATE TABLE DM_NOTIFICATION (
NOTIFICATION_ID INTEGER IDENTITY(1,1) NOT NULL, NOTIFICATION_ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
LAST_UPDATED_TIMESTAMP DATETIME2 NOT NULL, LAST_UPDATED_TIMESTAMP DATETIME2 NOT NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT FL_DM_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
CONSTRAINT FK_DM_OPERATION_NOTIFICATION FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
-- NOTIFICATION TABLE END -- -- NOTIFICATION TABLE END --

@ -454,16 +454,14 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL, NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL, LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL,
PRIMARY KEY (NOTIFICATION_ID), PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
)ENGINE = InnoDB; )ENGINE = InnoDB;
-- END NOTIFICATION TABLES -- -- END NOTIFICATION TABLES --

@ -749,16 +749,14 @@ WHEN (NEW.ID IS NULL)
CREATE TABLE DM_NOTIFICATION ( CREATE TABLE DM_NOTIFICATION (
NOTIFICATION_ID NUMBER(10) NOT NULL, NOTIFICATION_ID NUMBER(10) NOT NULL,
DEVICE_ID NUMBER(10) NOT NULL, DEVICE_ID NUMBER(10) NOT NULL,
OPERATION_ID NUMBER(10) NOT NULL, OPERATION_ID NUMBER(10) NULL,
TENANT_ID NUMBER(10) NOT NULL, TENANT_ID NUMBER(10) NOT NULL,
STATUS VARCHAR2(10) NULL, STATUS VARCHAR2(10) NULL,
DESCRIPTION VARCHAR2(1000) NULL, DESCRIPTION VARCHAR2(1000) NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP(0) NOT NULL, LAST_UPDATED_TIMESTAMP TIMESTAMP(0) NOT NULL,
CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID), CONSTRAINT PK_DM_NOTIFICATION PRIMARY KEY (NOTIFICATION_ID),
CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT FK_DM_DEVICE_NOTIFICATION FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID), DM_DEVICE (ID)
CONSTRAINT FK_DM_OPERATION_NOTIFICATION FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID)
) )
/ /

@ -397,15 +397,13 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY (
CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( CREATE TABLE IF NOT EXISTS DM_NOTIFICATION (
NOTIFICATION_ID BIGSERIAL NOT NULL PRIMARY KEY, NOTIFICATION_ID BIGSERIAL NOT NULL PRIMARY KEY,
DEVICE_ID INTEGER NOT NULL, DEVICE_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NULL,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
STATUS VARCHAR(10) NULL, STATUS VARCHAR(10) NULL,
DESCRIPTION VARCHAR(1000) NULL, DESCRIPTION VARCHAR(1000) NULL,
LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL, LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL,
CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES CONSTRAINT fk_dm_device_notification FOREIGN KEY (DEVICE_ID) REFERENCES
DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION, DM_DEVICE (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
CONSTRAINT fk_dm_operation_notification FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
); );
-- NOTIFICATION TABLE END -- -- NOTIFICATION TABLE END --

Loading…
Cancel
Save