From 35b92e62a6ba557f7feeea1a344e104d8db7ffb4 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期二, 12 十二月 2023 16:59:44 +0800
Subject: [PATCH] A01启动 B01启动 增加plc地址 单独写入

---
 springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

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 e26b4ab..01b9e20 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
@@ -64,7 +64,7 @@
             }
             // 鍒ゆ柇閫変腑绗煎瓙鏄惁鏈夊悎閫傚搴︾┖鏍�
             // 鏈夊悎閫傜┖鏍兼椂杩涚墖
-            if (cages1 != null && cages >= 1) {
+            if (cages1 != null && cages >= 1&&storageCage2.getDisabled()==0) {
                 ids = cages1.getId();// 鏁版嵁搴揑D
                 tiers = cages1.getTier();// 鍐呭鐗�
                 cells = cages1.getCell();// 鏍煎瓙鍙�
@@ -87,16 +87,19 @@
                     //spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids-1, 2);
                     spianMapper.UpdataAddCage2(orderids, glassid, glasslist, cage1,cells, ids-1, 2);
                     spianMapper.UpdataAddCage1(widths, cage1, cells);// 鍑忓皯鏍煎瓙瀹藉害
-                    spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 鏂板浠诲姟
+                    spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(),prctier);// 鏂板浠诲姟
                     S7control.getinstance().WriteWord(adddresslist, datas);
+                    System.out.println("姹囨姤鏃朵换鍔" + datas);
                    
                 }else{
                  // 鏁版嵁搴撲慨鏀圭瀛愯〃鏂板涓�鏉$幓鐠�
                 //spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids, 2);
                 spianMapper.UpdataAddCage2(orderids, glassid, glasslist, cage1,cells, ids, 2);
                 spianMapper.UpdataAddCage1(widths, cage1, cells);// 鍑忓皯鏍煎瓙瀹藉害
-                spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString());// 鏂板浠诲姟
+                spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(),prctier);// 鏂板浠诲姟
                 S7control.getinstance().WriteWord(adddresslist, datas);
+                    System.out.println("姹囨姤鏃朵换鍔" + datas);
+
 
                 // S7control.getinstance().WriteByte("DB105.16",glassid);
                 }
@@ -149,7 +152,7 @@
             spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 澧炲姞鍘熸牸瀛愬搴�
             spianMapper.UpdataGlassCageState(glassid,3);//鏇存敼绗煎瓙琛ㄧ殑鐜荤拑鐘舵��
             
-            spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 鏂板浠诲姟
+            spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid,state);// 鏂板浠诲姟
             // int state = spianMapper.selectGlassState(cage, cell);//鑾峰彇鏍煎瓙鏁伴噺
             if (state == 2) {
                 spianMapper.UpdateDBCage1(cage, cell);// 灏嗗唴鐗囨暟鎹洿鏂板埌澶栫墖閲�
@@ -171,7 +174,7 @@
                 datas.add((short) 1);
                 datas.add((short) 1);
                 spianMapper.OverOutSlice(glassid, 1);//鏇存柊鍑虹墖闃熷垪浠诲姟鐘舵�佷负杩涜涓�
-                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 鏂板浠诲姟
+                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid,1);// 鏂板浠诲姟
                 spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 澧炲姞鍘熸牸瀛愬搴�
                 spianMapper.UpdataGlassCageState(glassid,3);//鏇存敼绗煎瓙琛ㄧ殑鐜荤拑鐘舵��
                 spianMapper.OverOutSlice(glassid,2);//瀹屾垚鍑虹墖闃熷垪浠诲姟
@@ -204,7 +207,7 @@
                     spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 鍑忓皯鏂版牸瀛愬搴�
                     spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 澧炲姞鍘熸牸瀛愬搴�
                     spianMapper.UpdataGlassCageState(glassids,3);//鏇存敼绗煎瓙琛ㄧ殑鐜荤拑鐘舵��
-                    spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassid);// 鏂板璋冨害浠诲姟
+                    spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassid,2);// 鏂板璋冨害浠诲姟
                     //spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 鏂板鍑虹墖浠诲姟
                     // 浼犺緭mes鏁版嵁,鍧愭爣锛屾暟鎹�
                     S7control.getinstance().WriteWord(adddresslist, datas);// 娲惧彂鍑虹墖杞︿换鍔�
@@ -228,7 +231,7 @@
                     datas.add((short) 2);
                     datas.add((short) 1);
                     String glassids = spianMapper.SelectGlassid(cage, cell); // 鑾峰彇琚皟鎷ㄧ殑鐜荤拑id
-                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassid);// 鏂板璋冨害浠诲姟
+                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassid,2);// 鏂板璋冨害浠诲姟
                     //spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 鏂板鍑虹墖浠诲姟
                     spianMapper.UpdateDBCage(ids, cage, cell,2);// 灏嗗師鏍煎瓙鏁版嵁鏇存柊鍒版柊鏍煎瓙閲�
                     spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 鍑忓皯鏂版牸瀛愬搴�
@@ -285,4 +288,17 @@
        boolean listbool = list.contains((short) 1);
         return listbool;
     }
+    //鏍规嵁鐜荤拑id瀹屾垚鍦ㄨ繘琛屼腑鐨勪换鍔�
+    public void overtask(String glassid){
+        spianMapper.UpdateCageOver(glassid, 0);// 鏇存敼绗煎瓙琛ㄥ嚭鐗囩姸鎬�
+        spianMapper.UpdatetaskOut(glassid); // 瀹屾垚涓婁竴娆″嚭鐗囨垨鑰呰繘鐗囦换鍔�
+        spianMapper.OverOutSlice(glassid, 2);// 瀹屾垚鍑虹墖闃熷垪浠诲姟
+        spianMapper.UpdataGlassCage(glassid,0);// 娓呴櫎鍑虹墖鏍煎瓙鐜荤拑淇℃伅
+        String barcode=spianMapper.SelectBarcode(glassid);//鑾峰彇璇ョ幓鐠冪殑閾濇id
+        spianMapper.UpdateAddQueue(glassid);//鎶婅繘鐗囩殑鐜荤拑鏇存柊鍒板嚭鐗囬槦鍒椾腑
+        int barcodeState=spianMapper.SelectOverState(barcode);//鑾峰彇璇ラ摑妗嗙殑鐘舵��
+        if(barcodeState==2){//褰撹閾濇鎵�鏈夌殑鐜荤拑閮芥槸瀹屾垚鐘舵�佹椂鍒犻櫎鍦ㄥ嚭鐗囬槦鍒楃殑鏁版嵁
+            spianMapper.DeleteQueue(barcode);
+        }
+    }
 }

--
Gitblit v1.8.0