ZengTao
2023-12-27 b6953769ef36e8695dc1baa9304cc8ec05752983
测试代码更新
4个文件已修改
35 ■■■■■ 已修改文件
CanadaMes-ui/src/layout/index.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue
@@ -203,6 +203,9 @@
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = true;
            }
          }else{
              this.alarm = obj.alarmmg[0];
              this.dialogFormVisible2 = false;
          }
          //是否急停
          if (obj.emergencystop != null) {
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -28,6 +28,7 @@
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      if (S7control.getinstance().CheckConnected() == true) {
      spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
@@ -101,8 +102,8 @@
        spianService.overtask(B02glassid.toString());// 完成任务
        S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0
        System.out.println("汇报时B02|" + B02glassid);
        boolean yingda = spianService.listbool("DB106.62");// b01汇报
        System.out.println("汇报时B01|第"+aaa+"次"+ B02glassid+"应答"+yingda);
        boolean yingda = spianService.listbool("DB106.62");// b02汇报
        System.out.println("汇报时B02|第"+aaa+"次"+ B02glassid+"应答"+yingda);
      }
      // 获取DO1数据
@@ -157,5 +158,6 @@
    }
  }
}
}
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -199,8 +199,8 @@
    int SelectOutSliceshu();
    // 更新出片队列的任务状态
    @Update("update out_slice set state=#{state} where glassid=#{glassid} and state=1")
    void OverOutSlice(String glassid, int state);
    @Update("update out_slice set state=#{state} where glassid=#{glassid} and state=#{state2}")
    void OverOutSlice(String glassid, int state,int state2);
    // 获取玻璃的铝框id
    @Select("select barcode from out_slice where glassid=#{glassid};")
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -155,9 +155,9 @@
            datas.add((short) 1000);
            datas.add((short) state);
            datas.add((short) 1);
            spianMapper.OverOutSlice(glassid, 1);// 更新出片队列任务状态为进行中
            spianMapper.OverOutSlice(glassid.toString(), 1,0);// 更新出片队列任务状态为进行中
            spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
            spianMapper.UpdataGlassCageState(glassid, 3);// 更改笼子表的玻璃状态
            spianMapper.UpdataGlassCageState(glassid.toString(), 3);// 更改笼子表的玻璃状态
            spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state);// 新增任务
            // int state = spianMapper.selectGlassState(cage, cell);//获取格子数量
@@ -180,11 +180,11 @@
                datas.add((short) 1000);
                datas.add((short) 1);
                datas.add((short) 1);
                spianMapper.OverOutSlice(glassid, 1);// 更新出片队列任务状态为进行中
                spianMapper.OverOutSlice(glassid.toString(), 1,0);// 更新出片队列任务状态为进行中
                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, 1);// 新增任务
                spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度
                spianMapper.UpdataGlassCageState(glassid, 3);// 更改笼子表的玻璃状态
                spianMapper.OverOutSlice(glassid, 1);// 更新出片队列任务
                System.out.println("出片任务|" + datas);
                outmesid(glassid, "DB105.34");// 派发出片ID
                S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务
@@ -306,13 +306,13 @@
    // 根据玻璃id完成在进行中的任务
    public void overtask(String glassid) {
        spianMapper.UpdatetaskOut(glassid);// 完成上一次 出片或者进片任务
        spianMapper.OverOutSlice(glassid, 2);// 完成出片队列任务
        spianMapper.UpdataGlassCage(glassid, 0);// 清除出片格子玻璃信息
        spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态
        spianMapper.UpdateCageadd(glassid, 1);// 更改笼子表进片状态
        String barcode = spianMapper.SelectBarcode(glassid);// 获取该玻璃的铝框id
        spianMapper.UpdateAddQueue(glassid);// 把进片的玻璃更新到出片队列中
        spianMapper.UpdatetaskOut(glassid.toString());// 完成上一次 出片或者进片任务
        spianMapper.OverOutSlice(glassid.toString(), 2,1);// 完成出片队列任务
        spianMapper.UpdataGlassCage(glassid.toString(), 0);// 清除出片格子玻璃信息
        spianMapper.UpdateCageOver(glassid.toString(), 0);// 更改笼子表出片状态
        spianMapper.UpdateCageadd(glassid.toString(), 1);// 更改笼子表进片状态
        String barcode = spianMapper.SelectBarcode(glassid.toString());// 获取该玻璃的铝框id
        spianMapper.UpdateAddQueue(glassid.toString());// 把进片的玻璃更新到出片队列中
        // if (barcode != null) {
        //     int barcodeState = spianMapper.SelectOverState(barcode);// 获取该铝框的状态
        //     if (barcodeState == 0) {// 当该铝框所有的玻璃都是完成状态时删除在出片队列的数据