update So 14. Jun 21:31:01 CEST 2020

This commit is contained in:
Robert Richter 2020-06-14 21:31:01 +02:00
parent d8ecc33b6c
commit 4852995104
2 changed files with 9 additions and 8 deletions

View File

@ -123,7 +123,7 @@ module.exports = function (db, uuidv4, app_cfg) {
ORDER BY em.waip_einsaetze_id DESC
)
WHERE DATETIME(zeitstempel, \'+\' || ` + select_reset_counter + ` || \' minutes\')
> DATETIME(\'now\')`, [wachen_id],
> DATETIME(\'now\', \'localtime\')`, [wachen_id],
function (err, rows) {
if (err == null && rows.length > 0) {
//callback && callback(row.waip_einsaetze_ID); ALT
@ -212,10 +212,10 @@ module.exports = function (db, uuidv4, app_cfg) {
db.get(`SELECT
e.id,
e.uuid,
DATETIME(e.zeitstempel, 'localtime') zeitstempel,
DATETIME(e.zeitstempel) zeitstempel,
DATETIME(e.zeitstempel, '+' || (
SELECT COALESCE(MAX(reset_counter), ?) reset_counter FROM waip_user_config WHERE user_id = ?
) || ' minutes', 'localtime') ablaufzeit,
) || ' minutes') ablaufzeit,
e.EINSATZART, e.STICHWORT, e.SONDERSIGNAL, e.OBJEKT, e.ORT,e.ORTSTEIL, e.STRASSE,
e.BESONDERHEITEN, e.wgs84_x, e.wgs84_y, em1.EM_ALARMIERT, em0.EM_WEITERE, e.wgs84_area
FROM WAIP_EINSAETZE e
@ -473,7 +473,7 @@ module.exports = function (db, uuidv4, app_cfg) {
\'` + user_name + `\',
\'` + user_permissions + `\',
\'` + user_agent + `\',
(select DATETIME(zeitstempel,\'+\' || ` + reset_timestamp + ` || \' minutes\') from waip_einsaetze where id =\'` + client_status + `\'));`);
(select DATETIME(zeitstempel, \'+\' || ` + reset_timestamp + ` || \' minutes\') from waip_einsaetze where id =\'` + client_status + `\'));`);
};
function db_client_get_connected(callback) {
@ -566,7 +566,7 @@ module.exports = function (db, uuidv4, app_cfg) {
function db_socket_get_all_to_standby(callback) {
// alle Sockets/Clients finden, die auf Standby gesetzt werden koennen
db.all(`select socket_id from waip_clients
where reset_timestamp < DATETIME(\'now\')`, function (err, rows) {
where reset_timestamp < DATETIME(\'now\', \'localtime\')`, function (err, rows) {
if (err == null && rows) {
callback && callback(rows);
} else {

View File

@ -369,6 +369,9 @@ 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');
console.log(export_data.export_filter);
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'];
@ -433,8 +436,6 @@ module.exports = function (io, sql, fs, brk, async, app_cfg, proof) {
};
});
// FIXME beraltete hispry löschen
// loeschen alter Sounddaten nach alter (15min) und socket-id (nicht mehr verbunden)
fs.readdirSync(process.cwd() + app_cfg.global.soundpath).forEach(file => {
// nur die mp3s von alten clients loeschen