wu
2023-12-08 31101f632c27c05d15f30ca3084e3ed3da2a29af
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,16 +1,8 @@
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;
@@ -23,7 +15,7 @@
  private JdbcConnections jdbcConnections;
  private SpianMapper spianMapper;
  private SpianService spianService;
  @Override
  public void run() {
    boolean inglassbegin = false;
@@ -39,20 +31,6 @@
       spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
//      List<String> adddresslist = new ArrayList<>();
//      adddresslist.add("DB105.0");// 进片车起始位置
//      adddresslist.add("DB105.2");// 进片车目标位置
//      adddresslist.add("DB105.4");// 进片玻璃宽
//      adddresslist.add("DB105.8");//进片笼内已有玻璃数
//      adddresslist.add("DB105.16");// 进片车启动 1为启动
//      List<Short> datas = new ArrayList<>();
//      datas.add((short) 1000);//起始位置
//      datas.add((short) 5);//目标位置
//      datas.add((short) 610);//进片玻璃宽
//      datas.add((short) 1); //玻璃数
//      spianService.outmesid("123321","DB105.20");
//      datas.add((short) 1);//任务启动
//      S7control.getinstance().WriteWord(adddresslist, datas);
      // 根据玻璃id获取订单号,单独数据源
      // try {
      // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
@@ -161,7 +139,7 @@
          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());
@@ -171,7 +149,7 @@
        // 判断当前是否有未执行的任务
        int outnum = spianMapper.SelectOutSliceshu();
        // 当没有任务执行并且出片车空闲时
        if (outnum == 0 && outstate == true) {
        if (outnum == 0 && outstate == true&&Plchome.isAllowQueue==true) {
          // 判断铝框出片队列表是否有待出片的玻璃
          String outglassid = spianMapper.SelectOutSlice();
          if (outglassid != null) {