springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -23,16 +23,16 @@ @Override public void run() { spianService = WebSocketServer.applicationContext.getBean(SpianService.class); spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); while (this != null) { try { spianService.result=new ArrayList<>(); Thread.sleep(300); // if (S7control.getinstance().CheckConnected() == false) { spianService = WebSocketServer.applicationContext.getBean(SpianService.class); spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); // 根据玻璃id获取订单号,单独数据源 // try { springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -62,13 +62,6 @@ // b.put() @Override public void run() { while (this != null) { Short zhi = 0; JSONObject jsonObject = new JSONObject(); jsonObject.append("feedglassid", feedglassid); try { Thread.sleep(1000); // 注入mapper homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class); spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); spianService = WebSocketServer.applicationContext.getBean(SpianService.class); @@ -77,6 +70,15 @@ .getBean(North_Glass_Buffer1Service.class); storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class); dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class); while (this != null) { Short zhi = 0; JSONObject jsonObject = new JSONObject(); jsonObject.append("feedglassid", feedglassid); try { Thread.sleep(1000); // 注入mapper // boolean dbconnected = false; try {