update Di 16. Jun 13:01:01 CEST 2020

This commit is contained in:
Robert Richter 2020-06-16 13:01:01 +02:00
parent 08dd9c1692
commit 3baf2e9bfb
2 changed files with 4 additions and 14 deletions

View File

@ -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) { function save_new_rmld(data, remote_addr, app_id, callback) {
validate_rmld(data, function (valid) { validate_rmld(data, function (valid) {
if (valid) { if (valid) {
waip.rmld_speichern(data, function (result) { // Rueckmeldung speichern und verteilen
sql.db_rmld_save(data, function (result) {
if (result) { if (result) {
sql.db_log('RMLD', 'Rückmeldung von ' + remote_addr + ' erhalten und gespeichert: ' + JSON.stringify(data)); 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); callback && callback(result);
} else { } else {
sql.db_log('RMLD', 'Fehler beim speichern der Rückmeldung von ' + remote_addr + ': ' + JSON.stringify(data)); 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); api_client_to_server_new_rmld(req.body, app_id);
} else { } else {
sql.db_log('RMLD', 'Fehler: Rückmeldung von ' + remote_addr + ' nicht valide: ' + JSON.stringify(waip_data)); sql.db_log('RMLD', 'Fehler: Rückmeldung von ' + remote_addr + ' nicht valide: ' + JSON.stringify(waip_data));
callback && callback(valid);
}; };
}); });
}; };

View File

@ -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) { function rmld_verteilen_by_uuid(waip_uuid, rmld_uuid) {
// Einsatz-ID mittels Einsatz-UUID ermitteln, und Rueckmelung an alle relevanten Clients verteilen // 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) { 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 { return {
waip_speichern: waip_speichern, waip_speichern: waip_speichern,
waip_verteilen: waip_verteilen, waip_verteilen: waip_verteilen,
rmld_speichern: rmld_speichern,
rmld_verteilen_for_one_client: rmld_verteilen_for_one_client, rmld_verteilen_for_one_client: rmld_verteilen_for_one_client,
rmld_verteilen_by_uuid: rmld_verteilen_by_uuid, rmld_verteilen_by_uuid: rmld_verteilen_by_uuid,
dbrd_verteilen: dbrd_verteilen dbrd_verteilen: dbrd_verteilen