diff --git a/bindTicketShelving.js b/bindTicketShelving.js index b407cf6..0504249 100644 --- a/bindTicketShelving.js +++ b/bindTicketShelving.js @@ -1,24 +1,19 @@ const insert = require('./insertTicket'); const filter = require('./filter'); const select = require('./db/selectDB'); -const maxWagon = require('./db/maxWagon'); var barcode = "A0A3B820690F"; -//var shelving = "BCD";///introducida por el usuario O en leida de la bbdd? +var shelving = "BCD";///introducida por el usuario var collectionFk = '274286'; function ticketCollection(collectionFk){//parametro collectionFk select.select(collectionFk, function(err,data){ - maxWagon.maxWagon(collectionFk,function(err,max){ - console.log('Entra') - //aqui iria una función para pedir el numero de shelvings correspondientes - var shelving = ['ABC','DFG','HIJ'] - //if(filter.isShelving(shelving)){ - insert.insertTicket(data, shelving, 1) - //}else{ - //console.log("¡MATRICULA INCORRECTA!") - //} - }); + if(filter.isShelving(shelving)){ + //insert.insertTicket(data, shelving,) + } + else{ + console.log("¡MATRICULA INCORRECTA!") + } }); } diff --git a/bindTicketShelving2.js b/bindTicketShelving2.js deleted file mode 100644 index fbbc93b..0000000 --- a/bindTicketShelving2.js +++ /dev/null @@ -1,20 +0,0 @@ -const insert = require('./insertTicket'); -const filter = require('./filter'); -const select = require('./db/selectDB'); - -var barcode = "A0A3B820690F"; -var shelving = "BCD";///introducida por el usuario -var collectionFk = '254'; - -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(collectionFk); \ No newline at end of file diff --git a/bindTicketShelvingWW.js b/bindTicketShelvingWW.js new file mode 100644 index 0000000..8a98781 --- /dev/null +++ b/bindTicketShelvingWW.js @@ -0,0 +1,25 @@ +const insert = require('./insertTicketWW'); +const filter = require('./filter'); +const select = require('./db/selectDB'); +const maxWagon = require('./db/maxWagon'); + +var barcode = "A0A3B820690F"; +//var shelving = "BCD";///introducida por el usuario O en leida de la bbdd? +var collectionFk = '274286'; + +function ticketCollection(collectionFk){//parametro collectionFk + select.select(collectionFk, function(err,data){ + maxWagon.maxWagon(collectionFk,function(err,max){ + console.log('Entra') + //aqui iria una función para pedir el numero de shelvings correspondientes + var shelving = ['ABC','DFG','HIJ'] + //if(filter.isShelving(shelving)){ + insert.insertTicket(data, shelving, max) + //}else{ + //console.log("¡MATRICULA INCORRECTA!") + //} + }); + }); +} + +ticketCollection(collectionFk); \ No newline at end of file diff --git a/insertTicket.js b/insertTicket.js index 4f7f371..6cd3de6 100644 --- a/insertTicket.js +++ b/insertTicket.js @@ -8,8 +8,8 @@ function insertTicket(consultaSql, shelving, max){ (async() => { for(var i=0;i { + const info = await config.info + let key = info.data.token + let currentUser = info.data.currentUser; + + (async() => { + for(var i=0;i