| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Base64; |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.javassist.compiler.ast.Symbol; |
| | | 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.entity.north_glass_buffer1; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | |
| | | private JdbcConnections jdbcConnections; |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | |
| | | |
| | | @Override |
| | | public void run() { |
| | | boolean inglassbegin = false; |
| | |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | |
| | | //spianService.selectout2("250"); |
| | | List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态 |
| | | List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 获取进片车任务是否启动 |
| | |
| | | spianMapper.Updatetask(1, 0);// 更改进片任务状态为1 |
| | | spianMapper.UpdatetaskOut(B01glassid.toString()); // 完成上一次出片或者进片任务 |
| | | spianMapper.OverOutSlice(B01glassid.toString(), 2);// 完成出片队列任务 |
| | | spianMapper.UpdataGlassCage(B01glassid.toString(),0);// 清除出片格子玻璃信息 |
| | | S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0 |
| | | System.out.println("汇报时B01|" + B01glassid); |
| | | |
| | |
| | | spianMapper.UpdateCageOver(B02glassid.toString(), 0);// 更改笼子表出片状态 |
| | | spianMapper.UpdatetaskOut(B02glassid.toString()); // 完成上一次出片或者进片任务 |
| | | spianMapper.OverOutSlice(B02glassid.toString(), 2);// 完成出片队列任务 |
| | | spianMapper.UpdataGlassCage(B01glassid.toString(),0);// 清除出片格子玻璃信息 |
| | | S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0 |
| | | // S7control.getinstance().WriteWord("DB105.50", (short) 1);//汇报B02小车收到 |
| | | System.out.println("汇报时B02|" + B02glassid); |
| | |
| | | outglassbegin = false; |
| | | } |
| | | |
| | | if (outstate == true & glass.getbarcode() != null) { // 当出片车空闲且有出片任务待完成时 |
| | | if (outstate == true & glass.getbarcode() != null&&Plchome.isAllowQueue==true) { // 当出片车空闲且有出片任务待完成时 |
| | | // 判断有两个出片或调拨任务时并且出片id和未完成的出片任务id不一样时执行出片 |
| | | if (!writedstrIdOut.toString().equals(glass.getbarcode().toString())) { |
| | | spianService.selectout2(glass.getbarcode().toString()); |
| | |
| | | // 判断当前是否有未执行的任务 |
| | | int outnum = spianMapper.SelectOutSliceshu(); |
| | | // 当没有任务执行并且出片车空闲时 |
| | | if (outnum == 0 && outstate == true) { |
| | | if (outnum == 0 && outstate == true&&Plchome.isAllowQueue==true) { |
| | | // 判断铝框出片队列表是否有待出片的玻璃 |
| | | String outglassid = spianMapper.SelectOutSlice(); |
| | | if (outglassid != null) { |