Aggiornamento Traduzioni ...

This commit is contained in:
Paolo Arena
2020-03-31 20:34:24 +02:00
parent d59ee578c9
commit 8c9a5f7518
14 changed files with 946 additions and 269 deletions

View File

@@ -420,12 +420,7 @@ router.post('/dbop', authenticate, async (req, res) => {
try {
if (mydata.dbop === 'creaNaviProvvisorie') {
mydata.provvisoria = true;
const num = await Nave.generaNave(idapp, mydata);
ris = { num };
} else if (mydata.dbop === 'creaNaviDefinitive') {
mydata.provvisoria = false;
if (mydata.dbop === 'creaNavi') {
const num = await Nave.generaNave(idapp, mydata);
ris = { num };
} else if (mydata.dbop === 'delNavi') {
@@ -439,7 +434,22 @@ router.post('/dbop', authenticate, async (req, res) => {
// const num = await Nave.remove({ idapp, date_start: { $gte: tools.IncDateNow(-1000 * 60 * 60 * 24 * 3) } });
// ris = { num };
} else if (mydata.dbop === 'delNaviProvvisorie') {
const num = await Nave.remove({ idapp, provvisoria: true });
let num = 0;
const arrnavi = await Nave.find({ idapp });
for (const nave of arrnavi) {
let persistente = await NavePersistente.findByRigaColByDonatore(idapp, nave.riga, nave.col, 0);
if (!!persistente) {
if (persistente.provvisoria) {
let ris = await Nave.remove({ _id: nave._id });
if (!!ris) {
num++;
}
}
}
}
const data = await Nave.getLastRigaCol(idapp);
await Nave.setRiga(idapp, data.riga);
@@ -456,7 +466,10 @@ router.post('/dbop', authenticate, async (req, res) => {
const mystr = await Nave.checkIfDevoAggiungereInNave(idapp);
ris = { mystr };
} else if (mydata.dbop === 'visuListaIngresso') {
const mystr = await ListaIngresso.showListaOrd(idapp);
const mystr = await ListaIngresso.showListaOrd(idapp, false);
ris = { mystr };
} else if (mydata.dbop === 'visuListaIngressoNuovi') {
const mystr = await ListaIngresso.showListaOrd(idapp, true);
ris = { mystr };
} else if (mydata.dbop === 'initListaIngresso') {
// const aaa = await User.updateMany({ idapp }, { $set: { 'profile.nationality': 'IT' } });
@@ -512,45 +525,47 @@ router.post('/dbop', authenticate, async (req, res) => {
}
ris = { num };
} else if (mydata.dbop === 'CreaNaviPersistenti') {
const listanavi = await Nave.find({ idapp }).sort({riga: 1, col: 1});
let params = {
idapp
};
let num = 0;
for (let rec of listanavi) {
let mypos = {
idapp,
riga: rec.riga,
col: rec.col,
numup: 3
};
tools.getRigaColByPosUp(mypos);
let persistente = await NavePersistente.findByRigaCol(idapp, mypos.riga, mypos.col, 0);
if (!persistente) {
params.date_start = rec.date_start;
params.date_gift_chat_open = rec.date_gift_chat_open;
params.provvisoria = rec.provvisoria;
params.riga = mypos.riga;
params.col = mypos.col;
if (rec.riga > 3) {
params.riga1don = rec.riga;
params.col1don = rec.col;
} else {
params.riga1don = rec.riga;
params.col1don = rec.col;
}
if (params.riga > 0) {
await NavePersistente.addRecordNavePersistenteByParams(params);
num++;
}
}
/*
}
ris = { num };
else if (mydata.dbop === 'CreaNaviPersistenti') {
const listanavi = await Nave.find({ idapp }).sort({riga: 1, col: 1});
let params = {
idapp
};
let num = 0;
for (let rec of listanavi) {
let mypos = {
idapp,
riga: rec.riga,
col: rec.col,
numup: 3
};
tools.getRigaColByPosUp(mypos);
let persistente = await NavePersistente.findByRigaCol(idapp, mypos.riga, mypos.col, 0);
if (!persistente) {
params.date_start = rec.date_start;
params.date_gift_chat_open = rec.date_gift_chat_open;
params.riga = mypos.riga;
params.col = mypos.col;
if (rec.riga > 3) {
params.riga1don = rec.riga;
params.col1don = rec.col;
} else {
params.riga1don = rec.riga;
params.col1don = rec.col;
}
if (params.riga > 0) {
await NavePersistente.addRecordNavePersistenteByParams(params);
num++;
}
}
}
ris = { num }; */
} else if (mydata.dbop === 'CorreggiDataGiftChat') {
const listanavi = await NavePersistente.find({ idapp });
let num = 0;