zhangc
2025-04-11 b2e9d1f13a8a88e2963f504926234589fa2d2787
src/main/java/com/zy/core/thread/impl/FyDevpThread.java
@@ -78,7 +78,7 @@
    @Override
    @SuppressWarnings("InfiniteLoopStatement")
    public void run() {
//        connect();
        connect();
        while (true) {
            try {
                int step = 1;
@@ -185,6 +185,8 @@
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功", DateUtils.convert(new Date()), slave.getId()));
            // 根据实时信息更新数据库
            try {
                BasDevpService basConveyorStaService = SpringUtils.getBean(BasDevpService.class);
                List<BasDevp> stations = new ArrayList<>();
                for (Integer sta : staNos2) {
                    StaProtocol staProtocol = station.get(sta);
@@ -192,7 +194,6 @@
                    stations.add(sqlModel);
                }
                if (!stations.isEmpty()) {
                    BasDevpService basConveyorStaService = SpringUtils.getBean(BasDevpService.class);
                    if (null != basConveyorStaService && !basConveyorStaService.updateBatchById(stations)) {
                        throw new Exception("更新数据库数据失败");
                    }