| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.example.springboot.service.SpianService; |
| | | import com.example.springboot.entity.Glass; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | |
| | | public class PlcHold extends Thread { |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | | jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); |
| | | |
| | | //根据玻璃id获取订单号 |
| | |
| | | } |
| | | |
| | | |
| | | spianService.selectout("11"); |
| | | //spianService.selectout("11"); |
| | | //判断进片请求 |
| | | List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1); |
| | | List<Short> datas1ListState=S7control.getinstance().ReadWord("DB106.8", 1); |
| | | |
| | | if(datas1List!=null &&datas1ListState!=null){ |
| | | //获取prc进片请求数据 |
| | | boolean exist = datas1List.contains((short)1); |
| | |
| | | spianService.selectAll((short)list1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //System.out.println(exist); |
| | | } |
| | | } |
| | | |
| | | List<Short> outlist=S7control.getinstance().ReadWord("DB106.20", 1); //出片车状态 |
| | | List<Short> outlist2=S7control.getinstance().ReadWord("DB106.20", 1); //出片任务完成 |
| | | |
| | | |
| | | List<Short>ceshi1=new ArrayList<Short>();//出片车状态 |
| | | List<Short>ceshi2=new ArrayList<Short>();//出片任务完成 |
| | | ceshi1.add((short)0); |
| | | ceshi2.add((short)1); |
| | | if(ceshi1!=null && ceshi2!=null){ |
| | | //判断按订单出片 |
| | | boolean outstate = ceshi1.contains((short)0); |
| | | boolean outstate2 = ceshi1.contains((short)1); |
| | | if(outstate=true){ //出片车状态空闲时 |
| | | if(outstate2=true){ //出片车任务完成时 |
| | | String orderid=spianMapper.SelectOrderout(); |
| | | if(orderid!=null){ |
| | | spianService.selectout(orderid); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |