From b6953769ef36e8695dc1baa9304cc8ec05752983 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 27 十二月 2023 08:30:55 +0800
Subject: [PATCH] 测试代码更新

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java    |    6 ++++--
 springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java   |    4 ++--
 springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java |   22 +++++++++++-----------
 CanadaMes-ui/src/layout/index.vue                                              |    3 +++
 4 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index fe2cd2a..f52efa3 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/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) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
index 4299699..cb92ba3 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
+++ b/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("姹囨姤鏃禕02|" + B02glassid);
-        boolean yingda = spianService.listbool("DB106.62");// b01姹囨姤
-        System.out.println("姹囨姤鏃禕01|绗�"+aaa+"娆�"+ B02glassid+"搴旂瓟"+yingda);
+        boolean yingda = spianService.listbool("DB106.62");// b02姹囨姤
+        System.out.println("姹囨姤鏃禕02|绗�"+aaa+"娆�"+ B02glassid+"搴旂瓟"+yingda);
       }
 
       // 鑾峰彇DO1鏁版嵁
@@ -157,5 +158,6 @@
 
     }
   }
+}
 
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
index 679ce0e..2bcdc37 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
+++ b/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);
 
     // 鑾峰彇鐜荤拑鐨勯摑妗唅d
     @Select("select barcode from out_slice where glassid=#{glassid};")
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
index 0747f90..898fc50 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
+++ b/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) {// 褰撹閾濇鎵�鏈夌殑鐜荤拑閮芥槸瀹屾垚鐘舵�佹椂鍒犻櫎鍦ㄥ嚭鐗囬槦鍒楃殑鏁版嵁

--
Gitblit v1.8.0