update Di 3. Mär 17:31:01 CET 2020
This commit is contained in:
parent
2800ede80e
commit
9b76250db3
@ -791,7 +791,7 @@ module.exports = function(db, async, app_cfg) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function db_get_waipid_by_uuid(waip_uuid, callback){
|
function db_get_waipid_by_uuid(waip_uuid, callback){
|
||||||
db.get(`SELECT id FROM WAIP_EINSAETZE WHERE e.uuid like ?`, [waip_uuid], function(err, row) {
|
db.get(`SELECT id FROM WAIP_EINSAETZE WHERE uuid like ?`, [waip_uuid], function(err, row) {
|
||||||
if (err == null && row) {
|
if (err == null && row) {
|
||||||
callback && callback(row.id);
|
callback && callback(row.id);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -77,15 +77,14 @@ module.exports = function(io, sql, async, app_cfg) {
|
|||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
data.forEach(function(row) {
|
data.forEach(function(row) {
|
||||||
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Einsatz verteilen
|
sql.db_get_response_wache(waip_id, row.room, function(result){
|
||||||
var room_stockets = io.sockets.adapter.rooms[row.room];
|
console.log('response_wache: ' + row.room);
|
||||||
if (typeof room_stockets !== 'undefined') {
|
if (row.room) {
|
||||||
Object.keys(room_stockets.sockets).forEach(function(socket_id) {
|
reuckmeldung_verteilen(waip_id, row.room);
|
||||||
io.sockets.to(socket_id).emit('io.response', result)
|
|
||||||
sql.db_log('WAIP', 'Rückmeldung ' + result + ' an Socket ' + socket_id + ' gesendet');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
sql.db_log('Fehler-WAIP', 'Fehler: Wache für waip_id ' + waip_id + ' nicht vorhanden, Rückmeldung konnte nicht verteilt werden!');
|
sql.db_log('Fehler-WAIP', 'Fehler: Wache für waip_id ' + waip_id + ' nicht vorhanden, Rückmeldung konnte nicht verteilt werden!');
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user