delete old
This commit is contained in:
parent
7f5be2a566
commit
42e6c223e9
|
@ -1,18 +0,0 @@
|
|||
// const insert = require('./methods/bindTicketShelving');
|
||||
const filter = require('./utilities/filter');
|
||||
const select = require('./db/selectDB');
|
||||
|
||||
// let barcode = 'A0A3B820690F';
|
||||
let shelving = 'BCD';// /introducida por el usuario
|
||||
let collectionFk = '274286';
|
||||
|
||||
function ticketCollection(collectionFk) {// parametro collectionFk
|
||||
select.select(collectionFk, function(err, data) {
|
||||
if (filter.isShelving(shelving)) {
|
||||
// insert.insertTicket(data, shelving,)
|
||||
// } else
|
||||
// console.log('¡MATRICULA INCORRECTA!');
|
||||
}
|
||||
});
|
||||
}
|
||||
ticketCollection(collectionFk);
|
|
@ -1,42 +0,0 @@
|
|||
function insertTicket(consultaSql, shelving, max) {
|
||||
const config = require('../config');
|
||||
const got = require('got');
|
||||
(async() => {
|
||||
const info = await config.info;
|
||||
let key = info.data.token;
|
||||
let currentUser = info.data.currentUser;
|
||||
|
||||
(async() => {
|
||||
for (let i = 0; i < consultaSql.length; i++) {
|
||||
// for(var j=0;j<max;j++){
|
||||
for (let j = 0; j < consultaSql[i].Level.toString().length; j++) {
|
||||
const {body} = await got.post('http://app.etiquetaselectronicas.com:9999/item/batchImportItem', { // eslint-disable-line
|
||||
json: {
|
||||
agencyId: currentUser.agencyId,
|
||||
merchantId: currentUser.merchantId,
|
||||
storeId: currentUser.storeId,
|
||||
unitName: currentUser.unitName,
|
||||
itemList: [
|
||||
{
|
||||
attrCategory: 'verdnatura',
|
||||
attrName: 'conTicket',
|
||||
barCode: shelving + consultaSql[i].Level.toString().charAt(j), // Matricula + nivel
|
||||
itemTitle: 'Etiqueta Con ticket',
|
||||
productCode: consultaSql[i].Ticket, // Ticket
|
||||
custFeature1: consultaSql[i].Client, // Client
|
||||
custFeature2: consultaSql[i].Agency // Agencia de transporte
|
||||
}
|
||||
]
|
||||
},
|
||||
responseType: 'json',
|
||||
headers: {
|
||||
'Authorization': key
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
})();
|
||||
}
|
||||
|
||||
exports.insertTicket = insertTicket;
|
Reference in New Issue