feat: refs #4452 Changed to normal states
gitea/rfidnatura/pipeline/head This commit looks good
Details
gitea/rfidnatura/pipeline/head This commit looks good
Details
This commit is contained in:
parent
88a04673cc
commit
894f881019
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "rfidnatura",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Print server RFID",
|
||||
"license": "GPL-3.0",
|
||||
|
|
|
@ -85,7 +85,7 @@ async function getRecord() {
|
|||
await conn.beginTransaction();
|
||||
const [rows] = await conn.query(`
|
||||
SELECT * FROM expedition_PrintOut
|
||||
WHERE isPrinted = 10
|
||||
WHERE isPrinted = 0
|
||||
LIMIT 1 FOR UPDATE
|
||||
`);
|
||||
if (!rows.length) {
|
||||
|
@ -93,7 +93,7 @@ async function getRecord() {
|
|||
return;
|
||||
}
|
||||
const record = rows[0];
|
||||
await updateState(conn, record.expeditionFk, 12)
|
||||
await updateState(conn, record.expeditionFk, 2)
|
||||
await conn.commit();
|
||||
return record;
|
||||
} catch (error) {
|
||||
|
@ -121,16 +121,16 @@ async function processRecord(record) {
|
|||
const isSendResult = await sendZPL(zplData['VerdNatura Label RFID'].zpl, ipAddress);
|
||||
|
||||
if (isSendResult) {
|
||||
await updateState(conn, record.expeditionFk, 11)
|
||||
await updateState(conn, record.expeditionFk, 1)
|
||||
log('success', `(${record.expeditionFk}) Print completed successfully`);
|
||||
} else {
|
||||
await updateState(conn, record.expeditionFk, 13)
|
||||
await updateState(conn, record.expeditionFk, 3)
|
||||
log('error', `(${record.expeditionFk}) Print not completed`);
|
||||
}
|
||||
parentPort.postMessage('done');
|
||||
} catch (error) {
|
||||
log('error', `Unable to process the record ${error}`);
|
||||
await updateState(conn, record.expeditionFk, 13)
|
||||
await updateState(conn, record.expeditionFk, 3)
|
||||
parentPort.postMessage('error');
|
||||
} finally {
|
||||
conn.release();
|
||||
|
|
Loading…
Reference in New Issue