wu
2024-04-24 abda546a9cbcefd5bfe3abb563361f371f36faaa
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,11 +1,12 @@
package com.example.springboot.component;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.SpianService;
import com.example.springboot.service.SpianServiceNew;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.AlarmMapper;
import com.example.springboot.mapper.SpianMapper;
@@ -18,7 +19,7 @@
  private JdbcConnections jdbcConnections;
  private SpianMapper spianMapper;
  private SpianService spianService;
  private SpianServiceNew spianServiceNew;
  int aaa;
  @Override
@@ -32,23 +33,26 @@
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      // if (S7control.getinstance().CheckConnected() == false) {
      spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
      spianServiceNew = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
      // 根据玻璃id获取订单号,单独数据源
      // try {
      // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
      // // System.out.println(glass.getOrderId());
      //   spianService.selectAll(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId("X12345610102GV","",""));
      // } catch (SQLException e) {
      // // TODO Auto-generated catch block
      // e.printStackTrace();
      //   // TODO Auto-generated catch block
      //   e.printStackTrace();
      // }
        //spianService.selectout2("X12345610102GV");
      // 出片任务////////////////////////////////
      spianServiceNew.selectout2("X21942613103GV");
     //spianService.selectout2("X21942613103GV");
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动
@@ -155,13 +159,25 @@
      StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14);
      int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认
      // queueid1.toString().isEmpty()
      queueid1.toString().isEmpty()
      north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01的玻璃信息
      north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02玻璃信息
      // north_glass_buffer1 glass1=null;
      // north_glass_buffer1 glass2=null;
      // String queueid1="123";
      // String queueid2="123";
      // int questate=0;
      try {
        glass1 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueid1.toString(),"","");// D01玻璃信息
        glass2 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueid2.toString(),"","");// D02玻璃信息
      } catch (SQLException e) {
        e.printStackTrace();
      }
      // 当扫码位玻璃id为空时 宽度为0
      if (queueid1 != null && questate == 0) {
        // 写入D01的数据到上片队列表
        if (glass1 == null) { // 当没有值时传空
        if (glass1 == null ||glass1.getordernumber()==null) { // 当没有值时传空
          spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 1);
        } else {
@@ -174,7 +190,7 @@
      if (queueid2 != null) {
        // 写入D02的数据到上片队列表
        if (glass2 == null) {
        if (glass2 == null ||glass2.getordernumber()==null) {
          spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 2);
        } else {
          spianMapper.Updatequeue(queueid2.toString(), glass2.getordernumber(), glass2.getlistnumber(),