Junjie
2024-03-04 7603004d9eed2904a823861e7cd6f5c2f0016500
src/main/java/com/zy/core/thread/BarcodeThread.java
@@ -50,6 +50,7 @@
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("time", DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmss_F));
            jsonObject.put("barcode", barcode);
            jsonObject.put("id", slave.getId());
            if (OutputQueue.BARCODE.size() >= 32) {
                OutputQueue.BARCODE.poll();
            }
@@ -99,7 +100,7 @@
        connect();
        while (true) {
            try {
                byte[] read = read(14, 5000);
                byte[] read = read(14, 15000);
                if (null != read) {
                    String s = new String(read);
                    if (!Cools.isEmpty(s)) {
@@ -107,12 +108,13 @@
                    }
                }
                Thread.sleep(50);
            } catch (SocketTimeoutException ignore) {
                connCount++;
            } catch (Exception e) {
            }catch (Exception e) {
                setBarcode("");
                e.printStackTrace();
                log.error("run" + e);
//                e.printStackTrace();
                connect();
            }
        }
    }