wu
2024-04-23 2a3c60f0712c3039accf3be35cc8a97e499d09fd
更改现场测试需求
3个文件已修改
42 ■■■■■ 已修改文件
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -1,5 +1,6 @@
package com.example.springboot.component;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
@@ -39,16 +40,19 @@
      
      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");
      // 出片任务////////////////////////////////
     spianService.selectout2("X21942613103GV");
     //spianService.selectout2("X21942613103GV");
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动
@@ -156,8 +160,17 @@
      int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认
      // 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 = spianMapper.selectGlass(queueid1.toString());// D01的玻璃信息
      // north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02玻璃信息
      north_glass_buffer1 glass1=null;
      north_glass_buffer1 glass2=null;
      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的数据到上片队列表
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -106,14 +106,15 @@
  // 根据玻璃id手动上片
  @GetMapping("/Addglassid")
  public Result Addglassid(String glassid) {
  public Result Addglassid(String glassid) throws SQLException {
    Map<String, Object> map = new HashMap<>();
    short taskno = homeMapper.SelectInTask();
    if (taskno > 0) {
      map.put("message2", "500");
    } else {
      // 调用伍上片函数
      short results = spianService.selectAll(glassid);
      north_glass_buffer1 north_glass_buffer1 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(glassid, "", "");
      short results = spianService.selectAll(north_glass_buffer1);
      if (results == 200) {
        map.put("message2", "200");
      } else if (results == 300) {
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -17,8 +17,6 @@
import com.example.springboot.mapper.SpianMapper;
import com.google.common.primitives.Bytes;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
@Service
public class SpianService {
@@ -26,7 +24,7 @@
    private SpianMapper spianMapper;
    // @GetMapping("/all")
    public Short selectAll(String glassid) {
    public Short selectAll(north_glass_buffer1 glasslist) {
        int cage1 = 0;
        int cells;
@@ -36,8 +34,8 @@
        int prctier;
        double width;
        double minwidth = 0;
        north_glass_buffer1 glasslist = spianMapper.selectGlass(glassid); // 获取玻璃参数
        //north_glass_buffer1 glasslist = spianMapper.selectGlass(glassid); // 获取玻璃参数
        // 如果没有此id时
        if (glasslist == null) {
            return (300);
@@ -46,7 +44,7 @@
        double widths = glasslist.getglasslengthmm();
        String orderids = glasslist.getordernumber();
        String FrameBarcode = glasslist.getFrameBarcode();
        String glassid=glasslist.getbarcode();
        List<String> adddresslist = new ArrayList<>();
        adddresslist.add("DB105.0");// 进片车起始位置
        adddresslist.add("DB105.2");// 进片车目标位置