ZengTao
2024-05-09 58d7b0e12ccd92cf3934f6582b51b5fbcecaa39a
修改注入方式
2个文件已修改
30 ■■■■ 已修改文件
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,14 +62,7 @@
    // b.put()
    @Override
    public void run() {
        homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
                spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
                spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
                outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
                north_Glass_Buffer1Service = WebSocketServer.applicationContext
                        .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();
@@ -78,7 +71,14 @@
            try {
                Thread.sleep(1000);
                // 注入mapper
                homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
                spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
                spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
                outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
                north_Glass_Buffer1Service = WebSocketServer.applicationContext
                        .getBean(North_Glass_Buffer1Service.class);
                storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
                dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
                // boolean dbconnected = false;
                try {
@@ -205,10 +205,10 @@
                            e.printStackTrace();
                        }
                        Short send;
                        if (position.equals("0")) {
                            send = 2;
                        } else {
                        if (position.equals("1")) {
                            send = 1;
                        } else {
                            send = 2;
                        }
                        if (J01id != null) {
                            int barcodeState = spianMapper.SelectOverState(J01id);// 获取该铝框的状态