update Mo 15. Jun 00:31:01 CEST 2020

This commit is contained in:
Robert Richter 2020-06-15 00:31:01 +02:00
parent 7d8f72af9e
commit 4106796cdc
3 changed files with 76 additions and 67 deletions

View File

@ -420,6 +420,7 @@ socket.on('io.new_waip', function (data) {
socket.on('io.new_rmld', function (data) {
// DEBUG
console.log(data);
// FIXME Änderung des Funktions-Typ berücksichtigen
// Neue Rueckmeldung hinterlegen
data.forEach(function (arrayItem) {
// HTML festlegen
@ -463,7 +464,12 @@ var counter_rmld = [];
function reset_rmld(p_uuid) {
var bar_uuid = 'bar-' + p_uuid;
$('#pg-ek').children().each(function(i) {
if (!$(this).hasClass(bar_uuid)) {
console.log('ein gefunden');
console.log(this);
if ($(this).hasClass(bar_uuid)) {
console.log('hier');
$(this).remove;
};
});

View File

@ -882,20 +882,24 @@ module.exports = function (db, uuidv4, app_cfg) {
arry_wachen = arry_wachen.concat(traeger);
// doppelte Elemente aus Array entfernen
arry_wachen = arry_wachen.filter((v, i, a) => a.indexOf(v) === i);
// Leer-String hinzufuegen, um auch Export-Eintraege ohne Filter zu beruecksichtigen
arry_wachen.push("");
// DEBUG
if (app_cfg.global.development) {
console.log('Export-Liste RMLD: ' + JSON.stringify(arry_wachen));
console.log(arry_wachen.join(', '));
};
// nur weiter machen wenn arry_wachen nicht leer, weil z.b. keine Rueckmeldungen vorhanden sind
if (arry_wachen.length > 0) {
// Export-Liste auslesen
db.each(`select * from waip_export where export_typ like \'rmld\' and export_filter IN (` + arry_wachen.join(', ') + ` )`, function (err, row) {
db.each(`select * from waip_export where export_typ like \'rmld\' and (export_filter IN (` + arry_wachen.join(', ') + `) or export_filter like \'\')`, function (err, row) {
if (err == null && row) {
callback && callback(row);
} else {
callback && callback(null);
};
});
} else {
callback && callback(null);
};
};
return {

View File

@ -369,9 +369,7 @@ module.exports = function (io, sql, fs, brk, async, app_cfg, proof) {
var arry_wachen = full_rmld.map(a => a.wache_nr);
sql.db_export_get_for_rmld(arry_wachen, function (export_data) {
// SQL gibt ist eine Schliefe (db.each), fuer jedes Ergebnis wird eine CSV/Mail erstellt
console.log('exportfilter');
// FIXME
console.log(export_data);
if (export_data) {
var part_rmld = full_rmld.filter(obj => obj.wache_id.startsWith(export_data.export_filter));
// CSV-Spalten definieren
var csv_col = ['id', 'einsatznummer', 'waip_uuid', 'rmld_uuid', 'alias', 'einsatzkraft', 'maschinist', 'fuehrungskraft', 'agt', 'set_time', 'arrival_time', 'wache_id', 'wache_nr', 'wache_name'];
@ -426,6 +424,7 @@ module.exports = function (io, sql, fs, brk, async, app_cfg, proof) {
};
};
});
};
});
// alte Rueckmeldungen loeschen
sql.db_rmld_loeschen(waip.uuid);