wu
2023-09-13 be5351fe3cc2714756ae43ab272cf8813cb0fe98
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,18 +1,24 @@
package com.example.springboot.component;
import java.util.ArrayList;
import java.sql.SQLException;
import java.util.List;
import com.example.springboot.controller.SpianController;
import com.example.springboot.service.SpianService;
import com.example.springboot.mapper.AlarmMapper;
import com.example.springboot.mapper.HomeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.SpianService;
import com.example.springboot.entity.Glass;
import com.example.springboot.mapper.AlarmMapper;
public class PlcHold extends Thread {
  private AlarmMapper alarmMapper;
  @Autowired
  private JdbcConnections jdbcConnections;
  private SpianService spianService;
  @Override
  public void run() {
@@ -22,12 +28,24 @@
        Thread.sleep(500);
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        //\\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
      //spianService.selectout("112");
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
      //根据玻璃id获取订单号
      try {
          Glass glass=jdbcConnections.selectGlass(112);
          //System.out.println(glass.getOrderId());
        } catch (SQLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      spianService.selectout("11");
      //判断进片请求 
       List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1);
       List<Short> datas1ListState=S7control.getinstance().ReadWord("DB106.8", 1);
@@ -44,6 +62,7 @@
        List<Short> datas1ListID=S7control.getinstance().ReadWord("DB106.26", 13);
        //获取玻璃id    
        for(Short list1:datas1ListID){
            spianService.selectAll((short)list1);
        }
      }
@@ -63,4 +82,5 @@
    }
  }
}