update
This commit is contained in:
parent
fc9deb6726
commit
e5b529a7c6
|
@ -1,7 +1,7 @@
|
|||
const config = require('./config');
|
||||
const got = require('got');
|
||||
|
||||
function bindShelving(barcode, shelving, level){
|
||||
function bindShelving(barcode, shelvingId){
|
||||
(async() => {
|
||||
const info = await config.info
|
||||
let key = info.data.token;
|
||||
|
@ -11,7 +11,7 @@ function bindShelving(barcode, shelving, level){
|
|||
storeId: config.storeId,
|
||||
tagItemBinds: [{
|
||||
eslBarcode: barcode,
|
||||
itemBarcode: shelving + level
|
||||
itemBarcode: shelvingId
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -4,10 +4,11 @@ const filter = require('./filter');
|
|||
const insertDB = require('./db/insertDB')
|
||||
|
||||
function bindShelvingTag(barcode, shelving, level){
|
||||
let shelvingId = shelving + level;
|
||||
if(filter.filterBarcode(barcode)){
|
||||
if(filter.filterShelving(shelving)){
|
||||
bindShelving.bindShelving(barcode, shelving, level);
|
||||
insertShelving.insertShelving(shelving, level);
|
||||
bindShelving.bindShelving(barcode, shelvingId);
|
||||
insertShelving.insertShelving(shelvingId);
|
||||
insertDB.insertDB(barcode, shelving, level);
|
||||
}else{
|
||||
console.log("¡MATRICULA INCORRECTA!")
|
||||
|
@ -20,6 +21,8 @@ function bindShelvingTag(barcode, shelving, level){
|
|||
var barcode = "A0A3B8224DBF"; //valido = "A0A3B82"+ 4 CARACTERES HEXADECIMALES (0-F)
|
||||
var shelving = "BCD"; //valido = 3 CARACTERES LETRAS (A-Z)
|
||||
var level = "1";
|
||||
bindShelvingTag(barcode, shelving, level);
|
||||
//////////////////////////////////////
|
||||
|
||||
bindShelvingTag(barcode, shelving, level);
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
const insert = require('./insertTicket');
|
||||
const filter = require('./filter');
|
||||
//const select = require('./db/selectDB');
|
||||
import select from './db/selectDB';
|
||||
const select = require('./db/selectDB');
|
||||
|
||||
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 = '254';
|
||||
|
||||
function ticketCollection(collectionFk, shelving){//parametro collectionFk
|
||||
select(collectionFk, function(err,data){
|
||||
select.select(collectionFk, function(err,data){
|
||||
if(filter.filterShelving(shelving)){
|
||||
insert.insertTicket(data, shelving)
|
||||
}
|
||||
else{
|
||||
insert.insertTicket(data, shelving,)
|
||||
}
|
||||
else{
|
||||
console.log("¡MATRICULA INCORRECTA!")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const con = require('./connect')
|
||||
|
||||
|
||||
module.exports = function (collectionFk, callback){
|
||||
let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level
|
||||
function select(collectionFk, callback){
|
||||
let consSql = `SELECT t.id AS Ticket, c.name AS Client, am.name AS Agency, tc.level AS Level, tc.wagon AS Wagon
|
||||
FROM ticketCollection tc
|
||||
JOIN ticket t ON t.id = tc.ticketFk JOIN client c ON t.clientFk = c.id
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
|
@ -14,7 +14,7 @@ module.exports = function (collectionFk, callback){
|
|||
});
|
||||
}
|
||||
|
||||
console.log("PROBA");
|
||||
exports.select =select;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ function insertShelving(shelving, level){
|
|||
{
|
||||
attrCategory: "verdnatura",
|
||||
attrName: "sinTicket",
|
||||
barCode: shelving + level,//Matricula + nivel
|
||||
barCode: shelvingId,//Matricula + nivel
|
||||
itemTitle: "Etiqueta Sin ticket",
|
||||
}
|
||||
]
|
||||
|
|
Reference in New Issue