| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.List; |
| | | import com.example.springboot.service.SpianService; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | |
| | | 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() { |
| | |
| | | |
| | | 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); |
| | | try { |
| | | Glass glass=jdbcConnections.selectGlass(112); |
| | | //System.out.println(glass.getOrderId()); |
| | | } catch (SQLException e) { |
| | | // TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //判断进片请求 |
| | | List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1); |
| | |
| | | List<Short> datas1ListID=S7control.getinstance().ReadWord("DB106.26", 13); |
| | | //获取玻璃id |
| | | for(Short list1:datas1ListID){ |
| | | |
| | | spianService.selectAll((short)list1); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | } |