master #2

Merged
alexm merged 10 commits from master into test 2022-04-04 10:02:43 +00:00
3 changed files with 6 additions and 8 deletions
Showing only changes of commit da09c4b346 - Show all commits

View File

@ -1,12 +1,9 @@
const con = require('./connect');
function insertSmartTag(smartTagFk, shelving, level) {
module.exports = function insertSmartTag(smartTagFk, shelving, level) {
const sql = `INSERT INTO vn.smartTag (code, shelvingFk, level)
VALUES (?, ?, ?)
ON DUPLICATE KEY
UPDATE shelvingFk = ?, level = ?;`;
con.query(sql, [smartTagFk, shelving, level, shelving, level], function(err, result) {
if (err) console.log(err);
});
}
exports.insertSmartTag = insertSmartTag;
con.query(sql, [smartTagFk, shelving, level, shelving, level]);
};

View File

@ -2,7 +2,7 @@ const con = require('./connect');
function insertTicket(ticket, smartTag) {
const sql = `UPDATE vn.ticketCollection SET smartTagFk = ? WHERE ticketFk = ?`;
con.query(sql, smartTag, ticket, function(err, result) {
con.query(sql, [smartTag, ticket], function(err, result) {
if (err) throw err;
});
}

View File

@ -29,7 +29,7 @@ async function bindShelvingTag(smartTagFk, shelving, level) {
if (filter.isSmartTag(smartTagFk)) {
if (await filter.isShelving(shelving)) {
insertShelving(shelvingId, smartTagFk); // al carry en ESL CLOUD SYSTEM
insertSmartTag.insertSmartTag(smartTagFk, shelving, level); // en vn.smartTag
insertSmartTag(smartTagFk, shelving, level); // en vn.smartTag
} else
return 'INVALID_PLATE';
} else
@ -41,6 +41,7 @@ async function insertShelving(shelvingId, smartTagFk) {
const info = await dataLogIn.dataLogIn;
const key = info.data.token;
const currentUser = info.data.currentUser;
await got.post('http://app.etiquetaselectronicas.com:9999/item/batchImportItem', { // eslint-disable-line
json: {
agencyId: currentUser.agencyId,