From f3e394bb156adc17a9ae9662b3187acb3093ee62 Mon Sep 17 00:00:00 2001 From: llopis15 Date: Thu, 11 Mar 2021 15:59:12 +0100 Subject: [PATCH] first commit vicent --- bindLessTicket.js | 61 -------------------------------------------- bindWithTicket.js | 64 ----------------------------------------------- 2 files changed, 125 deletions(-) delete mode 100644 bindLessTicket.js delete mode 100644 bindWithTicket.js diff --git a/bindLessTicket.js b/bindLessTicket.js deleted file mode 100644 index 44ad14f..0000000 --- a/bindLessTicket.js +++ /dev/null @@ -1,61 +0,0 @@ -function smartTag(barcode, shelving, level){ - const got = require('got'); - const config = require('./config'); - (async() => { - const info = await config.info - let key = info.data.token - let currentUser = info.data.currentUser; - (async() => { - const { body } = await got.post('http://app.etiquetaselectronicas.com:9999/item/batchImportItem', { - json: { - agencyId: currentUser.agencyId, - merchantId: currentUser.merchantId, - storeId: currentUser.storeId, - unitName: currentUser.unitName, - itemList: [ - { - attrCategory: "verdnatura", - attrName: "sinTicket", - barCode: shelving + level, - itemTitle: "Etiqueta sin ticket", - productCode: shelving + level, - } - ] - }, - responseType: 'json', - headers: { - "Authorization": key - } - }) - console.log(body) - })(); - (async() => { - const info = await config.info - let key = info.data.token; - - (async() => { - const { body } = await got.post('http://app.etiquetaselectronicas.com:9999/bind/batchBind', { - json: { - storeId: config.storeId, - tagItemBinds: [{ - eslBarcode: barcode, - itemBarcode: shelving + level - } - ] - }, - responseType: 'json', - headers: { - "Authorization": key - } - }) - console.log(body) - })(); - })(); - })(); -} - -var barcode = "A0A3B820690F"; -var shelving = "BCD"; -var level = "1"; - -smartTag(barcode, shelving, level); diff --git a/bindWithTicket.js b/bindWithTicket.js deleted file mode 100644 index d2aa644..0000000 --- a/bindWithTicket.js +++ /dev/null @@ -1,64 +0,0 @@ -function smartTag(barcode, shelving, level){ - const got = require('got'); - const config = require('./config'); - (async() => { - const info = await config.info - let key = info.data.token - let currentUser = info.data.currentUser; - (async() => { - const { body } = await got.post('http://app.etiquetaselectronicas.com:9999/item/batchImportItem', { - json: { - agencyId: currentUser.agencyId, - merchantId: currentUser.merchantId, - storeId: currentUser.storeId, - unitName: currentUser.unitName, - itemList: [ - { - attrCategory: "verdnatura", - attrName: "conTicket", - barCode: shelving + level, - itemTitle: "Etiqueta Con ticket", - productCode: shelving + level, - custFeature1: "Juan", - custFeature2: "MRW", - custFeature3: "123456789" - } - ] - }, - responseType: 'json', - headers: { - "Authorization": key - } - }) - console.log(body) - })(); - (async() => { - const info = await config.info - let key = info.data.token; - - (async() => { - const { body } = await got.post('http://app.etiquetaselectronicas.com:9999/bind/batchBind', { - json: { - storeId: config.storeId, - tagItemBinds: [{ - eslBarcode: barcode, - itemBarcode: shelving + level - } - ] - }, - responseType: 'json', - headers: { - "Authorization": key - } - }) - console.log(body) - })(); - })(); - })(); -} - -var barcode = "A0A3B820690F"; -var shelving = "ABC"; -var level = "1"; - -smartTag(barcode, shelving, level);