change attrName and itemTitle and update flashOn

This commit is contained in:
alexmorenograu 2021-08-06 08:04:22 +02:00
parent 04c0457df8
commit 92581b0d81
3 changed files with 11 additions and 12 deletions

View File

@ -49,14 +49,14 @@ async function insertShelving(shelvingId, smartTagFk) {
json: {
agencyId: currentUser.agencyId,
merchantId: currentUser.merchantId,
storeId: currentUser.storeId,
storeId: config.storeId,
unitName: currentUser.unitName,
itemList: [
{
attrCategory: 'verdnatura', // Plantilla
attrName: 'sinTicket', // Tipo de Plantilla
attrName: 'withOutTicket', // Tipo de Plantilla
barCode: shelvingId, // Matricula + nivel --> Cod.Barras artículo
itemTitle: 'Etiqueta Sin ticket',
itemTitle: 'tagWithOutTicket',
qrCode: shelvingId
}
]
@ -66,6 +66,7 @@ async function insertShelving(shelvingId, smartTagFk) {
'Authorization': key
}
});
console.log(config.storeId);
await bindShelving(smartTagFk, shelvingId);
console.log('Insert Shelving:', body);
})();

View File

@ -40,9 +40,9 @@ function insertTicket(consultaSql) {
itemList: [
{
attrCategory: 'verdnatura',
attrName: 'conTicket',
attrName: 'withTicket',
barCode: consultaSql[i].shelvingFk + consultaSql[i].level, // Matricula + nivel
itemTitle: 'Etiqueta Con ticket',
itemTitle: 'tagWithTicket',
productCode: consultaSql[i].ticketFk, // Ticket
qrCode: consultaSql[i].ticketFk,
custFeature1: consultaSql[i].clientFk, // Cliente

View File

@ -1,10 +1,11 @@
const express = require('express');
const router = express.Router(); // eslint-disable-line
const select = require('../db/selectTicket');
const config = require('../config');
router.get('/:ticket', async(req, res) => {
const ticket = req.params.ticket;
console.log(ticket);
// console.log(ticket);
searchTicket(ticket);
res.json({message: 'SUCCESS'});
});
@ -13,28 +14,25 @@ module.exports = router;
function searchTicket(ticket) {// parametro ticketFk
select.select(ticket, function(err, data) {
console.log(data);
insertFlash(data);
});
// insertFlash();
}
function insertFlash(consultaSql) {
function insertFlash(qrySql) {
// console.log('CONSULTASQL_TAMAÑO:', consultaSql.length);
const dataLogIn = require('../server');
const got = require('got');
(async() => {
const info = await dataLogIn.dataLogIn;
let key = info.data.token;
let currentUser = info.data.currentUser;
(async() => {
const {body} = await got.post('http://app.etiquetaselectronicas.com:9999/led/excuteLed', { // eslint-disable-line
json: {
storeId: currentUser.storeId,
storeId: config.storeId,
lightColor: 8,
lightTime: 30,
targetExecution: 1, // consultaSql[0].shelvingFk + consultaSql[0].level + '/Etiqueta Con Ticket',
targetExecution: qrySql.shelvingFk + '/tagWithTicket',
lightFrequency: 1
},
responseType: 'json',