From 43af250ce92297472a08a8e567a9daf545bca589 Mon Sep 17 00:00:00 2001 From: alexmorenograu <61759297+alexmorenograu@users.noreply.github.com> Date: Mon, 15 Mar 2021 10:13:16 +0100 Subject: [PATCH] update --- bindTicketShelving.js | 48 +++++++++++-------------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) diff --git a/bindTicketShelving.js b/bindTicketShelving.js index 1a96dc8..f1a29bf 100644 --- a/bindTicketShelving.js +++ b/bindTicketShelving.js @@ -1,46 +1,22 @@ const insert = require('./insertTicket'); const filter = require('./filter'); +const select = require('./db/selectDB') var barcode = "A0A3B820690F"; var shelving = "ABC";///introducida por el usuario var collectionFk = '254'; -var consultaSql1 = [ - { - id: 1025963, - ticketFk: 2516988, - level: 1,//en un futur no estaran - wagon: 0,//en un futur no estaran - nickname: 'FLORA&CO', - agencyModeFk: 'MRW',//Seria un numero - }, - { - id: 1025964, - ticketFk: 2542131, - level: 2, - wagon: 0, - nickname: 'MORRIS', - agencyModeFk: 'MRW'//Seria un numero - }, - { - id: 1025965, - ticketFk: 2542131, - level: 3, - wagon: 0, - nickname: 'MORRIS2', - agencyModeFk: 'MRW' - } -] -function ticketCollection(){//parametro collectionFk - /// CONSULTA SQL PER A TINDRE ELS DIFERENTS ticketsColletion DE UN colletionFK (consiltaSql1) /// - /// CONSULTA SQL PER A CADA ticket DE CADA ticketCollection (consiltaSql2) /// - if(filter.filterShelving(shelving)){ - insert.insertTicket(consultaSql1, shelving) - } - else{ - console.log("¡MATRICULA INCORRECTA!") - } + +function ticketCollection(collectionFk){//parametro collectionFk + select.select(collectionFk, function(err,data){ + if(filter.filterShelving(shelving)){ + insert.insertTicket(data, shelving) + } + else{ + console.log("¡MATRICULA INCORRECTA!") + } + }); } -ticketCollection(); \ No newline at end of file +ticketCollection(collectionFk, shelving); \ No newline at end of file