feat: set to 0 counter when createPallet or not
This commit is contained in:
parent
d30e157420
commit
842c141e13
|
@ -1,12 +1,10 @@
|
||||||
import con from '../db/connect.js';
|
import con from '../db/connect.js';
|
||||||
import counter from './counter.js';
|
|
||||||
import t from '../util/translator.js';
|
import t from '../util/translator.js';
|
||||||
|
|
||||||
export default async(rfids, arcId) => {
|
export default async(rfids, arcId) => {
|
||||||
try {
|
try {
|
||||||
console.log(Array.from(rfids), arcId, null);
|
console.log(Array.from(rfids), arcId, null);
|
||||||
await con.query(`CALL vn.expeditionPallet_build(JSON_ARRAY(?), ?, ?, @palletId);`, [Array.from(rfids), arcId, null]);
|
await con.query(`CALL vn.expeditionPallet_build(JSON_ARRAY(?), ?, ?, @palletId);`, [Array.from(rfids), arcId, null]);
|
||||||
await counter(null, arcId);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
await con.query(`UPDATE vn.arcRead SET error = ?, counter = NULL WHERE id = ?;`, [t(error.sqlMessage), arcId]);
|
await con.query(`UPDATE vn.arcRead SET error = ?, counter = NULL WHERE id = ?;`, [t(error.sqlMessage), arcId]);
|
||||||
|
|
|
@ -44,6 +44,7 @@ export default async(conf, cb) => {
|
||||||
|
|
||||||
rfidbuffer = new Set();
|
rfidbuffer = new Set();
|
||||||
rfidbufferExtend = [];
|
rfidbufferExtend = [];
|
||||||
|
counterIntervalManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
function counterIntervalManager() {
|
function counterIntervalManager() {
|
||||||
|
|
Loading…
Reference in New Issue