| | |
| | | @Override |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | // connect(); |
| | | connect(); |
| | | while (true) { |
| | | try { |
| | | int step = 1; |
| | |
| | | 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); |
| | |
| | | stations.add(sqlModel); |
| | | } |
| | | if (!stations.isEmpty()) { |
| | | BasDevpService basConveyorStaService = SpringUtils.getBean(BasDevpService.class); |
| | | if (null != basConveyorStaService && !basConveyorStaService.updateBatchById(stations)) { |
| | | throw new Exception("更新数据库数据失败"); |
| | | } |