update Di 16. Jun 13:01:01 CEST 2020
This commit is contained in:
parent
08dd9c1692
commit
3baf2e9bfb
@ -68,9 +68,11 @@ module.exports = function (app_cfg, sql, waip, uuidv4, io, remote_api) {
|
||||
function save_new_rmld(data, remote_addr, app_id, callback) {
|
||||
validate_rmld(data, function (valid) {
|
||||
if (valid) {
|
||||
waip.rmld_speichern(data, function (result) {
|
||||
// Rueckmeldung speichern und verteilen
|
||||
sql.db_rmld_save(data, function (result) {
|
||||
if (result) {
|
||||
sql.db_log('RMLD', 'Rückmeldung von ' + remote_addr + ' erhalten und gespeichert: ' + JSON.stringify(data));
|
||||
waip.rmld_verteilen_by_uuid(data.waip_uuid, data.rmld_uuid);
|
||||
callback && callback(result);
|
||||
} else {
|
||||
sql.db_log('RMLD', 'Fehler beim speichern der Rückmeldung von ' + remote_addr + ': ' + JSON.stringify(data));
|
||||
@ -83,6 +85,7 @@ module.exports = function (app_cfg, sql, waip, uuidv4, io, remote_api) {
|
||||
api_client_to_server_new_rmld(req.body, app_id);
|
||||
} else {
|
||||
sql.db_log('RMLD', 'Fehler: Rückmeldung von ' + remote_addr + ' nicht valide: ' + JSON.stringify(waip_data));
|
||||
callback && callback(valid);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@ -95,18 +95,6 @@ module.exports = function (io, sql, fs, brk, async, app_cfg) {
|
||||
});
|
||||
};
|
||||
|
||||
function rmld_speichern(rueckmeldung, callback) {
|
||||
// Rueckmeldung speichern und verteilen
|
||||
sql.db_rmld_save(rueckmeldung, function (saved) {
|
||||
if (saved) {
|
||||
rmld_verteilen_by_uuid(rueckmeldung.waip_uuid, rueckmeldung.rmld_uuid);
|
||||
callback && callback(saved);
|
||||
} else {
|
||||
callback && callback(saved);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
function rmld_verteilen_by_uuid(waip_uuid, rmld_uuid) {
|
||||
// Einsatz-ID mittels Einsatz-UUID ermitteln, und Rueckmelung an alle relevanten Clients verteilen
|
||||
sql.db_einsatz_get_waipid_by_uuid(waip_uuid, function (waip_id) {
|
||||
@ -443,7 +431,6 @@ module.exports = function (io, sql, fs, brk, async, app_cfg) {
|
||||
return {
|
||||
waip_speichern: waip_speichern,
|
||||
waip_verteilen: waip_verteilen,
|
||||
rmld_speichern: rmld_speichern,
|
||||
rmld_verteilen_for_one_client: rmld_verteilen_for_one_client,
|
||||
rmld_verteilen_by_uuid: rmld_verteilen_by_uuid,
|
||||
dbrd_verteilen: dbrd_verteilen
|
||||
|
||||
Loading…
Reference in New Issue
Block a user