- Nuovo Sistema di Flotte per Tutor.
X - Mettere anche la email del sognatore, per chi è abituato ad inviarla in quel modo... X - Controllare che sul sito compaiano le informazioni del Sognatore...
This commit is contained in:
@@ -3,6 +3,7 @@ const router = express.Router();
|
||||
|
||||
const { User } = require('../models/user');
|
||||
const { Nave } = require('../models/nave');
|
||||
const { Flotta } = require('../models/flotta');
|
||||
const { NavePersistente } = require('../models/navepersistente');
|
||||
const { ListaIngresso } = require('../models/listaingresso');
|
||||
const { Graduatoria } = require('../models/graduatoria');
|
||||
@@ -135,7 +136,10 @@ router.post('/', async (req, res) => {
|
||||
user.profile.saw_and_accepted = recorig.profile.saw_and_accepted;
|
||||
user.profile.my_dream = recorig.profile.my_dream;
|
||||
user.profile.email_paypal = recorig.profile.email_paypal;
|
||||
user.profile.link_payment = recorig.profile.link_payment;
|
||||
user.profile.note_payment = recorig.profile.note_payment;
|
||||
user.profile.paymenttypes = recorig.profile.paymenttypes;
|
||||
user.profile.qualified = recorig.profile.qualified;
|
||||
let msgseconda = '!!! REGISTRATA ';
|
||||
if (numero === '2')
|
||||
msgseconda += 'SECONDA';
|
||||
@@ -312,6 +316,13 @@ router.post('/login', (req, res) => {
|
||||
tools.mylogshow(msg);
|
||||
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||
res.status(404).send({ code: server_constants.RIS_CODE_LOGIN_ERR });
|
||||
} else if (!!user.subaccount && user.subaccount) {
|
||||
await tools.snooze(1000);
|
||||
// const msg = "Tentativo di Login ERRATO [" + body.username + ' , ' + body.password + ']\n' + '[IP: ' + tools.getiPAddressUser(req) + ']';
|
||||
// tools.mylogshow(msg);
|
||||
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||
res.status(404).send({ code: server_constants.RIS_CODE_LOGIN_ERR_SUBACCOUNT });
|
||||
return null;
|
||||
}
|
||||
return user
|
||||
})
|
||||
@@ -364,7 +375,7 @@ router.post('/login', (req, res) => {
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
tools.mylog("ERRORE IN LOGIN: " + e);
|
||||
tools.mylog("ERRORE IN LOGIN: " + e.message);
|
||||
if (!resalreadysent)
|
||||
res.status(400).send({ code: server_constants.RIS_CODE_LOGIN_ERR_GENERIC });
|
||||
});
|
||||
@@ -411,16 +422,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
try {
|
||||
|
||||
if (mydata.dbop === 'rigeneraTutto') {
|
||||
|
||||
mydata.dbop = 'delNaviProvvisorie';
|
||||
await eseguiDbOp(idapp, mydata, locale);
|
||||
|
||||
mydata.dbop = 'GeneraGraduatoria';
|
||||
await eseguiDbOp(idapp, mydata, locale);
|
||||
|
||||
mydata.dbop = 'creaNavi';
|
||||
ris = await eseguiDbOp(idapp, mydata, locale);
|
||||
|
||||
await ListaIngresso.Esegui_CronTab(idapp, mydata);
|
||||
} else if (mydata.dbop === 'creaNavi') {
|
||||
const num = await Nave.generaNave(idapp, mydata, false);
|
||||
ris = { num };
|
||||
@@ -439,36 +441,8 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
// ris = { num };
|
||||
} else if (mydata.dbop === 'delNaviProvvisorie') {
|
||||
|
||||
let num = 0;
|
||||
ris = await Nave.delNaviProvvisorie(idapp);
|
||||
|
||||
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.deleteOne({ _id: nave._id });
|
||||
if (!!ris) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Pulisci gli added se era stato cancellato dalla nave
|
||||
await Nave.pulisciNonPresenzeInNave(idapp);
|
||||
|
||||
const data = await Nave.getLastRigaCol(idapp);
|
||||
await Nave.setRiga(idapp, data.riga);
|
||||
await Nave.setCol(idapp, data.col + 1);
|
||||
|
||||
const maxcol = tools.getmaxcol(data.riga);
|
||||
if (data.col === maxcol) {
|
||||
await Nave.setRiga(idapp, data.riga + 1);
|
||||
await Nave.setCol(idapp, 1);
|
||||
}
|
||||
|
||||
ris = { num };
|
||||
} else if (mydata.dbop === 'visuListaNave') {
|
||||
mystr = await Nave.showListaOrd(idapp);
|
||||
ris = { mystr };
|
||||
@@ -494,6 +468,14 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
ris = { mystr };
|
||||
} else if (mydata.dbop === 'visuNaviUtentiEliminati') {
|
||||
ris = await Nave.visuNaviUtentiEliminati(idapp);
|
||||
} else if (mydata.dbop === 'convSubAccount') {
|
||||
ris = await User.convSubAccount(idapp);
|
||||
} else if (mydata.dbop === 'flagUtentiNaviNonPresenti') {
|
||||
ris = await User.flagUtentiNaviNonPresenti(idapp);
|
||||
} else if (mydata.dbop === 'generaFlotte') {
|
||||
ris = await NavePersistente.generaFlotte(idapp);
|
||||
} else if (mydata.dbop === 'addNavePerUtentiNaviNonPresenti') {
|
||||
ris = await User.addNavePerUtentiNaviNonPresenti(idapp);
|
||||
} else if (mydata.dbop === 'creaTessituraeConv') {
|
||||
ris = await ListaIngresso.creaTessituraeConv(idapp);
|
||||
ris = { mystr };
|
||||
@@ -506,6 +488,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
} else if (mydata.dbop === 'convNaviTessinListaIngressoRec') {
|
||||
let num = 0;
|
||||
|
||||
|
||||
const arrnavitess = await Nave.find({ idapp, num_tess: { $gte: 3 } });
|
||||
|
||||
for (const recnave of arrnavitess) {
|
||||
@@ -699,7 +682,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
} else if (mydata.dbop === 'visuPlacca') {
|
||||
|
||||
mystr = '✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'ECCO LE NUOVE NAVI DEFINITIVE CHE APRONO DOMANI LA GIFT CHAT !!! DALLA ' + mydata.riga + '.' + mydata.col + ' ALLA ' + mydata.riga + '.' + (parseInt(mydata.col) + 7) + '\n' +
|
||||
'NAVI CHE SALPANO DALLA ' + mydata.riga + '.' + mydata.col + ' ALLA ' + mydata.riga + '.' + (parseInt(mydata.col) + 7) + '\n' +
|
||||
'AUGURI ALLA NUOVA SOGNATRICE !!!\n' +
|
||||
'✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user