From fa7cd5b6b633bd89774b7eae1f5e9d286a6f7a72 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 07 十二月 2023 13:12:01 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/home/index.vue                                               |   59 ++++++++++----
 springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java    |   36 ++++----
 CanadaMes-ui/src/api/home.js                                                        |    7 +
 CanadaMes-ui/src/img/xmjc.png                                                       |    0 
 CanadaMes-ui/src/lang/locales/en-US.json                                            |    2 
 springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java   |   26 ++++++
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java         |   12 ++-
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java         |   25 ++++-
 springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java |   31 +++----
 CanadaMes-ui/src/lang/locales/zh-CN.json                                            |    2 
 10 files changed, 133 insertions(+), 67 deletions(-)

diff --git a/CanadaMes-ui/src/api/home.js b/CanadaMes-ui/src/api/home.js
index beef5bd..29d0964 100644
--- a/CanadaMes-ui/src/api/home.js
+++ b/CanadaMes-ui/src/api/home.js
@@ -222,4 +222,11 @@
     })
 }
 
+export function CompleteQueue(id,frameid) {
+    return request({
+        url: '/home/CompleteQueue?id=' + id+'&frameid='+frameid,
+        method: 'post',
+        data:""
+    })
+}
 
diff --git a/CanadaMes-ui/src/img/xmjc.png b/CanadaMes-ui/src/img/xmjc.png
index afdb166..dee5f48 100644
--- a/CanadaMes-ui/src/img/xmjc.png
+++ b/CanadaMes-ui/src/img/xmjc.png
Binary files differ
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 3940824..1cd1b3a 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -324,6 +324,8 @@
   "Unable to find the placement method of the aluminum frame":"Unable to find the placement method of the aluminum frame",
   "Unable to find whether the aluminum frame is flipped or not":"Unable to find whether the aluminum frame is flipped or not",
   "You do not have this permission":"You do not have this permission",
+  "This glass is already in the Queue":"This glass is already in the Queue",
+  "complete":"complete",
     "ServoManualone": {
       "A01 鎵�鍦ㄦ牸瀛�": "A01 Current Grid",
       "鏁伴噺": "Quantity",
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index e49479d..6d3fc03 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -316,6 +316,8 @@
   "You do not have this permission":"You do not have this permission",
   "Unable to find the placement method of the aluminum frame":"鏌ヨ涓嶅埌閾濇鎽嗘斁鏂瑰紡",
   "Unable to find whether the aluminum frame is flipped or not":"鏌ヨ涓嶅埌閾濇鏄惁缈昏浆",
+  "This glass is already in the Queue":"姝ょ幓鐠冨凡鍦ㄥ嚭鐗囬槦鍒椾腑",
+  "complete":"瀹屾垚",
   "langparameter": {
     "conveyor Velocity(Auto FAST)": "D01-D06 鐨甫杈撻�佽嚜鍔ㄥ揩閫�",
     "conveyor Velocity(Auto SLOW)": "D01-D06 鐨甫杈撻�佽嚜鍔ㄦ參閫�",
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index b5b1693..2d65daf 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -238,9 +238,9 @@
             </div>
             <div>
                 <el-table :data="this.tasklist1" border style="width: 100%">
+                    <el-table-column :width="180" prop="glassId" :label="$t('Outfeed glass barcode')"></el-table-column>
                     <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column>
                     <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column>
-                    <el-table-column :width="180" prop="glassId" :label="$t('Outfeed glass barcode')"></el-table-column>
                     <el-table-column :width="130" prop="orderId" :label="$t('Order No')"></el-table-column>
                     <el-table-column prop="orderId" :label="$t('List No')"></el-table-column>
                     <el-table-column prop="orderId" :label="$t('Box No')"></el-table-column>
@@ -258,9 +258,9 @@
                     </el-table-column>
                 </el-table>
                 <el-table :data="this.tasklist2" border style="width: 100%">
+                    <el-table-column :width="180" prop="glassId" :label="$t('Infeed glass barcode')"></el-table-column>
                     <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column>
                     <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column>
-                    <el-table-column :width="180" prop="glassId" :label="$t('Infeed glass barcode')"></el-table-column>
                     <el-table-column :width="130" prop="orderId" :label="$t('Order No')"></el-table-column>
                     <el-table-column prop="orderId" :label="$t('List No')"></el-table-column>
                     <el-table-column prop="orderId" :label="$t('Box No')"></el-table-column>
@@ -628,7 +628,11 @@
         </el-dialog>
 
         <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
-            <el-button type="primary" @click="isAllowQueueState()">{{ this.isAllowQueue == true ? $t('Start') : $t('Stop')
+            <el-button type="primary" @click="isAllowQueueState()" :disabled="!this.isAllowReordering">{{ this.isAllowQueue
+                == true ? $t('Start') : $t('Stop')
+            }}</el-button>
+            <el-button type="primary" @click="isAllowReorderingState()" :disabled="this.isAllowQueue">{{
+                this.isAllowReordering == true ? $t('Not Allow') : $t('Allow')
             }}</el-button>
             <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border
                 style="width: 100%;overflow: auto;">
@@ -640,27 +644,34 @@
                 <el-table-column prop="storageCage.glassheightmm" :label="$t('Width')"></el-table-column>
                 <el-table-column prop="state" :label="$t('State')">
                     <template slot-scope='scope'>
-                        {{ scope.row.state == 0 ? "Waiting" : "Outing" }}
+                        {{ scope.row.state == 0 ? "Waiting" : scope.row.state == 1 ?"Outing":"Completed" }}
                     </template>
                 </el-table-column>
                 <el-table-column prop="sequence" :label="$t('Sequence')"></el-table-column>
                 <el-table-column prop="position" :label="$t('Position')"></el-table-column>
                 <el-table-column prop="barcode" :label="$t('Frame No')"></el-table-column>
+
+                <el-table-column prop="barcode" :label="$t('Complete')">
+                    <template slot-scope='scope'>
+                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="!isAllowQueue"
+                            @click="CompleteQueue(scope.row.id,scope.row.barcode)">{{ $t('Complete') }}</el-button>
+                    </template>
+                </el-table-column>
                 <el-table-column :width="280" :label="$t('Operate')">
                     <template slot-scope='scope'>
                         <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
                             style="font-size: 15px;"
-                            :disabled="(scope.$index == 0 || isAllowQueue == true || scope.row.state == 1)">
+                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
                             {{ $t('Top') }}
                         </el-button>
                         <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)"
                             style="font-size: 15px;"
-                            :disabled="(scope.$index == 0 || isAllowQueue == true || scope.row.state == 1)">
+                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
                             {{ $t('Up') }}
                         </el-button>
                         <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)"
                             style="font-size: 15px;"
-                            :disabled="(OutSlice.length - 1 == scope.$index || isAllowQueue == true || scope.row.state == 1)">
+                            :disabled="(OutSlice.length - 1 == scope.$index || isAllowReordering == true || scope.row.state == 1)">
                             {{ $t('Down') }}
                         </el-button>
                         <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="isAllowQueue"
@@ -714,7 +725,7 @@
 import {
     home, home2, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
     SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass, SelectGlassNo,
-    SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates, SelectPermissionByUserName, currentUsername
+    SelectAluminumFrameInfoById, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues, isConfirmStates, SelectPermissionByUserName, currentUsername, CompleteQueue
 } from "../../api/home";
 
 
@@ -785,7 +796,6 @@
             currentPage: 1,  //榛樿鍒濆椤�
             pagesize: 15,    //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
             pageCount: 0,
-
             currentPages: 1,  //榛樿鍒濆椤�
             pagesizes: 21,    //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
             pageCounts: 0,
@@ -793,6 +803,7 @@
             AluminumFrame: [],
             framebarcode: "",
             isAllowQueue: true,
+            isAllowReordering: true,
             FrameNoFlag: "",
             isConfirm: true,
             ManuallyInfeedGlass: true,
@@ -847,7 +858,7 @@
                     //鏄惁鍏佽鍑虹墖
                     this.isAllowQueue = obj.isAllowQueue[0];
                     //鍑虹墖闃熷垪
-                    if (this.isAllowQueue == true) {
+                    if (this.isAllowReordering == true) {
                         this.OutSlice = obj.listoutslice[0];
                     }
                     //鑾峰彇涓婄墖浣嶇幓鐠冧俊鎭�
@@ -877,9 +888,9 @@
                         this.form5 = obj.form3[0];
                         this.showform3();
                         this.Sizerange(this.form5, 3);
-                        this.glassid1="";
+                        this.glassid1 = "";
                     } else {
-                        if(this.glassid1==""){
+                        if (this.glassid1 == "") {
                             this.DeleteBarcodeGlass();
                         }
                     }
@@ -1234,7 +1245,7 @@
                 if (this.password == value) {
                     if (state == 1) {
                         OutByGlassID(glassid).then(res => {
-                            if (res.data.message3 == 200) {
+                            if (res.data.message2 == 200) {
                                 this.$message.success(this.$t('Operation successful'));
                             }
                             else if (res.data.message2 == 300) {
@@ -1354,7 +1365,7 @@
         //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
         InsertQueueGlass(parameter) {
             if (parameter == 1 && this.form5.glassId != "") {
-                if (this.form5.glassId != this.form2.glassId) {
+                if (this.form5.glassId != this.form2.glassId && this.form5.glassId != this.form3.glassId) {
                     InsertQueueGlassId(1, this.form5).then(res => {
                         if (res.data.message == 200) {
                             this.form5 = {};
@@ -1367,7 +1378,7 @@
                     this.$message.error(this.$t('The glass ID already exists in the loading queue'));
                 }
             } else if (parameter == 2 && this.form4.glassId != "") {
-                if (this.form4.glassId != this.form3.glassId) {
+                if (this.form4.glassId != this.form3.glassId && this.form4.glassId != this.form2.glassId) {
                     InsertQueueGlassId(2, this.form4).then(res => {
                         if (res.data.message == 200) {
                             this.form4 = {};
@@ -1388,14 +1399,14 @@
             if (parameter == 1) {
                 DeleteQueueGlass(1).then(res => {
                     if (res.data.message == 200) {
-                        this.form2 = {};
+                        this.form3 = {};
                         this.$message.success(this.$t('Operation successful'));
                     }
                 });
             } else {
                 DeleteQueueGlass(2).then(res => {
                     if (res.data.message == 200) {
-                        this.form3 = {};
+                        this.form2 = {};
                         this.$message.success(this.$t('Operation successful'));
                     }
                 });
@@ -1551,6 +1562,10 @@
                 }
             })
         },
+        //
+        isAllowReorderingState() {
+            this.isAllowReordering = !this.isAllowReordering;
+        },
         //鍒囨崲涓婄墖鏄惁闇�瑕佺‘璁ょ幓鐠冧俊鎭�
         isConfirmState() {
             isConfirmStates(!this.isConfirm).then(res => {
@@ -1574,7 +1589,7 @@
             if (rowIndex != 0) {
                 barcode2 = arrOutSlice[rowIndex - 1].barcode;
             }
-            if (columnIndex === 10) {
+            if (columnIndex === 11) {
                 if (barcode != barcode2) {
                     // this.FrameNoFlag = barcode;
                     for (let i = rowIndex; i < this.OutSlice.length; i++) {
@@ -1634,6 +1649,14 @@
         //娓呯┖寰呯‘璁ょ幓鐠冧俊鎭�
         DeleteBarcodeGlass() {
             this.form5 = {};
+        },
+        //鎵嬪姩瀹屾垚鍑虹墖浠诲姟
+        CompleteQueue(id,frameid) {
+            CompleteQueue(id,frameid).then(res => {
+                if (res.data.message == 200) {
+                    this.$message.success(this.$t('Operation successful'));
+                }
+            });
         }
     }
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index a9f3c26..136c668 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -14,6 +14,7 @@
 import com.example.springboot.mapper.SpianMapper;
 import com.example.springboot.service.JdbcConnections;
 import com.example.springboot.service.North_Glass_Buffer1Service;
+import com.example.springboot.service.OutSliceServive;
 import com.example.springboot.service.SpianService;
 
 
@@ -21,6 +22,7 @@
 
     @Autowired
     private HomeMapper homeMapper;
+    private OutSliceServive outSliceServive;
     private SpianMapper spianMapper;
     private SpianService spianService;
     private North_Glass_Buffer1Service north_Glass_Buffer1Service;
@@ -47,6 +49,7 @@
             homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
             spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
             spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
+            outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
             north_Glass_Buffer1Service = WebSocketServer.applicationContext.getBean(North_Glass_Buffer1Service.class);
             // 绗煎瓙浣跨敤鎯呭喌
             List<StorageCage> tableData = homeMapper.selectAll();
@@ -103,10 +106,11 @@
                 jsonObject.append("form3", form3);
             }
             // 鑾峰彇鍑虹墖闃熷垪淇℃伅
-            List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
-            for (Out_slice out_slice : listoutslice) {
-                out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
-            }
+            List<Out_slice> listoutslice=outSliceServive.SelectProductionqueue();
+            // List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
+            // for (Out_slice out_slice : listoutslice) {
+            //     out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
+            // }
             jsonObject.append("listoutslice", listoutslice);
             //鑾峰彇褰撳墠鍑虹墖闃熷垪鐘舵��
             jsonObject.append("isAllowQueue",Plchome.isAllowQueue);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
index f4b82b1..608b252 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -20,25 +20,25 @@
 //    new PlcHold().start();
 //
     //
-//    new Plchome().start();
+   new Plchome().start();
 //    //
-     new PlcParameter().start();
-     //
-     new Plcalarm().start();
-     //
-     new Plcsign().start();
-     //
-     new Plcaction().start();
-     new Plcstate().start();
-     new PlcPositioning1().start();
-     new PlcPositioning2().start();
-    new PlcParameter2().start();
-     new PlcParameter1().start();
-     new PLCAutomaticParameterSetting().start();
+    //  new PlcParameter().start();
+    //  //
+    //  new Plcalarm().start();
+    //  //
+    //  new Plcsign().start();
+    //  //
+    //  new Plcaction().start();
+    //  new Plcstate().start();
+    //  new PlcPositioning1().start();
+    //  new PlcPositioning2().start();
+    // new PlcParameter2().start();
+    //  new PlcParameter1().start();
+    //  new PLCAutomaticParameterSetting().start();
 
-     new PlcManualonePosition().start();
-     new PlcManualonePosition2().start();
-     new PlcServoManualone().start();
-     new PLCManualJog().start();
+    //  new PlcManualonePosition().start();
+    //  new PlcManualonePosition2().start();
+    //  new PlcServoManualone().start();
+    //  new PLCManualJog().start();
   }
 }
\ No newline at end of file
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
index a8fcacd..b85fc8a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -261,6 +261,7 @@
     } else {
       homeMapper.Inglassid(queue, cage, cell, tier);
       spianMapper.UpdataAddCage1(queue.getglasswidth(), cage, cell);
+      map.put("message", "200");
     }
     return Result.success(map);
   }
@@ -283,8 +284,10 @@
       map.put("message", "300");
     } else {
       homeMapper.InsertQueueGlassId(queue, id);
-      // 璋冪敤浼嶅瓨鍌ㄨ繃绋�
-      spianService.selectAll(queue.getglassId());
+      if (id == 1) {
+        // 璋冪敤浼嶅瓨鍌ㄨ繃绋�
+        spianService.selectAll(queue.getglassId());
+      }
       map.put("message", "200");
     }
     return Result.success(map);
@@ -328,22 +331,6 @@
     return Result.success(map);
   }
 
-  // 鏌ヨ鍑虹墖闃熷垪鏁版嵁
-  @PostMapping("/SelectProductionqueue")
-  public Result SelectProductionqueue() throws SQLException {
-    List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
-    for (Out_slice out_slice : listoutslice) {
-      out_slice
-          .setnorth_glass_buffer1s(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(out_slice.getGlassId(), "", ""));
-      out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
-    }
-    Map<String, Object> maps = new HashMap<>();
-    maps.put("listoutslice", listoutslice);
-    // Plchome.isAllowQueue=false;
-    return Result.success(maps);
-
-  }
-
   // 鏍规嵁鐜荤拑id鍒犻櫎鍑虹墖闃熷垪鐜荤拑
   @PostMapping("/DeleteProductionQueueGlass")
   public Result DeleteProductionQueueGlass(String FrameNo) {
@@ -384,4 +371,12 @@
     map.put("message", "200");
     return Result.success(map);
   }
+
+  //鎵嬪姩瀹屾垚浠诲姟
+  @PostMapping("/CompleteQueue")
+  public Result CompleteQueue(String id,String frameid) {
+    return outSliceServive.CompleteQueue(id,frameid);
+    
+  }
+  
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index 3dfec02..84d1fe4 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -115,15 +115,15 @@
   Queue GetQueueInfo(int id);
 
   //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
-  @Select("update queue set glassid=#{queue.glassId},orderid=#{queue.orderId},listId=#{queue.listId},boxId=#{queue.boxId},glasswidth=#{queue.glasswidth},glassheight=#{queue.glassheight},glasswidthmm=#{queue.glasswidthmm},glassheightmm=#{queue.glassheightmm},state=1 where id=#{id}")
+  @Update("update queue set glassid=#{queue.glassId},orderid=#{queue.orderId},listId=#{queue.listId},boxId=#{queue.boxId},glasswidth=#{queue.glasswidth},glassheight=#{queue.glassheight},glasswidthmm=#{queue.glasswidthmm},glassheightmm=#{queue.glassheightmm},state=1 where id=#{id}")
   void InsertQueueGlassId(Queue queue,Short id);
 
   //纭鎵爜浣嶇幓鐠冧俊鎭�
-  @Select("update queue set state=1 where id=1")
+  @Update("update queue set state=1 where id=1")
   void UpdateQueueState();
 
   //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
-  @Select("update queue set glassid=null,orderid=null,listid=null,boxid=null,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,state=0 where id=#{id}")
+  @Update("update queue set glassid=null,orderid=null,listid=null,boxid=null,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,state=0 where id=#{id}")
   void DeleteQueueGlass(String id);
 
   //鏌ヨ姝よ鍗曞湪鐞嗙墖绗奸噷鐨勭幓鐠冩暟
@@ -144,7 +144,7 @@
 
 
   //鏍规嵁鐜荤拑id鍒犻櫎鍑虹墖闃熷垪鐜荤拑
-  @Select("update out_slice set state=3 where barcode=#{FrameNo} and (state=0 or state=1 or state=2)")
+  @Update("update out_slice set state=4 where barcode=#{FrameNo} and (state=0 or state=1 or state=2)")
   void DeleteProductionQueueGlass(String id);
 
   //鏍规嵁閾濇id鏌ヨ瀵瑰簲鐜荤拑淇℃伅
@@ -157,18 +157,29 @@
   Out_slice SelectQueueByglassid(String getbarcode);
 
   //娣诲姞鍑虹墖闃熷垪
-  @Select("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, 0, #{flip}, #{sequence}, now(), #{position});")
+  @Insert("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`, `sequence`, `time` ,`position`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, 0, #{flip}, #{sequence}, now(), #{position});")
   void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm, int sequence, String position);
 
   //鍑虹墖闃熷垪璋冨簭
-  @Select("update out_slice set sequence=#{sequence} where glassid=#{glassId}")
+  @Update("update out_slice set sequence=#{sequence} where glassid=#{glassId}")
   void UpdateOutSliceSequence(String glassId,int sequence);
 
   //鏌ヨ鍑虹墖闃熷垪鏈�澶ч『搴�
   @Select("select ifnull(max(sequence),0)+1 from out_slice ")
   Short SelectMaxSquence();
-
+  //鏌ヨ鐢ㄦ埛鏉冮檺
   @Select("select rp.* from role_permission rp inner join role r on rp.role_id=r.id and r.name=#{token} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35)")
   List<RolePermission> SelectPermissionByUserName(String token);
+  //瀹屾垚鍑虹墖浠诲姟
+  @Update("update out_slice set state=2 where id=#{id}")
+  void CompleteQueue(String id);
+
+  //鏌ヨ閾濇id瀵瑰簲鐜荤拑瀹屾垚鏁伴噺
+  @Select("select count(*) from out_slice where barcode=#{frameid} and state<2")
+  Short SelectCountByFrameNo(String frameid);
+
+  //閾濇id瀵瑰簲鐜荤拑鏀瑰畬鍏ㄩ儴瀹屾垚鐘舵��
+  @Update("update out_slice set state=3 where barcode=#{frameid} and state=2")
+  void CompleteQueueByFrameNo(String frameid);
 
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java b/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
index ed546f4..e29eb16 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/OutSliceServive.java
@@ -1,11 +1,15 @@
 package com.example.springboot.service;
 
 import java.sql.SQLException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.example.springboot.common.Result;
+import com.example.springboot.entity.Out_slice;
 import com.example.springboot.mapper.HomeMapper;
 
 @Service
@@ -19,7 +23,7 @@
 
   public void AddOutSliceS(String[][] AluminumFrames) throws SQLException {
     int sequence = homeMapper.SelectMaxSquence();
-    
+
     // 娣诲姞鍒版暟鎹簱
     for (String[] item : AluminumFrames) {
       if (item[1] == "true") {
@@ -30,6 +34,24 @@
     }
   }
 
-  
+  // 鏌ヨ鍑虹墖闃熷垪
+  public List<Out_slice> SelectProductionqueue() {
+    List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
+    for (Out_slice out_slice : listoutslice) {
+      out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
+    }
+    return listoutslice;
+  }
+
+public Result CompleteQueue(String id, String frameid) {
+  homeMapper.CompleteQueue(id);
+  Short num=homeMapper.SelectCountByFrameNo(frameid);
+  if(num==0){
+    homeMapper.CompleteQueueByFrameNo(frameid);
+  }
+  Map<String, Object> map = new HashMap<>();
+  map.put("message", "200");
+  return Result.success(map);
+}
 
 }

--
Gitblit v1.8.0