From 17b8d077f7efe3db20344987cdad9da9d9ab3de6 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期五, 03 十一月 2023 15:21:11 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

---
 CanadaMes-ui/src/views/home/index.vue                                               |  264 ++++++++++++++++++++++++++++++-------
 springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java    |   18 +-
 CanadaMes-ui/src/api/home.js                                                        |   26 +++
 springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java        |    5 
 CanadaMes-ui/src/lang/locales/en-US.json                                            |    8 +
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java         |   42 +++--
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java         |   19 ++
 springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java |   28 +++
 CanadaMes-ui/src/lang/locales/zh-CN.json                                            |    8 +
 9 files changed, 324 insertions(+), 94 deletions(-)

diff --git a/CanadaMes-ui/src/api/home.js b/CanadaMes-ui/src/api/home.js
index 7658487..4a35acf 100644
--- a/CanadaMes-ui/src/api/home.js
+++ b/CanadaMes-ui/src/api/home.js
@@ -116,9 +116,9 @@
     })
 }
 
-export function Inglassid(cage,cell,tier,data) {
+export function Inglassid(cage, cell, tier, data) {
     return request({
-        url: '/home/Inglassid?cage=' + cage + '&cell=' + cell+ '&tier=' + tier,
+        url: '/home/Inglassid?cage=' + cage + '&cell=' + cell + '&tier=' + tier,
         method: 'post',
         data
     })
@@ -128,13 +128,29 @@
     return request({
         url: '/home/SelectGlass?orderid=' + orderid,
         method: 'post',
-        data:""
+        data: ""
     })
 }
 
-export function InsertQueueGlassId(glassid) {
+export function InsertQueueGlassId(glassid, id) {
     return request({
-        url: '/home/InsertQueueGlassId?glassid=' + glassid,
+        url: '/home/InsertQueueGlassId?glassid=' + glassid + '&id=' + id,
+        method: 'post',
+        data: ""
+    })
+}
+
+export function UpdateQueueState() {
+    return request({
+        url: '/home/UpdateQueueState',
+        method: 'post',
+        data: ""
+    })
+}
+
+export function DeleteQueueGlass(id) {
+    return request({
+        url: '/home/DeleteQueueGlass?id=' + id,
         method: 'post',
         data: ""
     })
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 0769742..4cb0513 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -296,6 +296,12 @@
   "query was successful":"query was successful",
   "Scan Code Point":"Scan Code Point",
   "Upper film position":"Upper film position",
-  "Glass Information":"Glass Information"
+  "Glass Information":"Glass Information",
+  "current Information":"current information",
+  "Modify Information":"Modify information",
+  "Clear Current":"Clear Current",
+  "Confirm Modification":"Confirm modification",
+  "The glass ID already exists in the loading queue":"The glass ID already exists in the loading queue",
+  "This glass ID already exists in the sorting cage":"This glass ID already exists in the sorting cage"
 
 }
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 767e722..fa58c91 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -299,6 +299,12 @@
   "query was successful":"鏌ヨ鎴愬姛",
   "Scan Code Point":"鎵爜浣�",
   "Upper film position":"涓婄墖浣�",
-  "Glass Information":"鐜荤拑淇℃伅"
+  "Glass Information":"鐜荤拑淇℃伅",
+  "current Information":"褰撳墠淇℃伅",
+  "Modify Information":"淇敼淇℃伅",
+  "Clear Current":"娓呴櫎褰撳墠",
+  "Confirm Modification":"纭淇敼",
+  "The glass ID already exists in the loading queue":"涓婄墖闃熷垪宸插瓨鍦ㄦ鐜荤拑id",
+  "This glass ID already exists in the sorting cage":"鐞嗙墖绗煎唴宸插瓨鍦ㄦ鐜荤拑id"
 
 }
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index 7012203..8b8aa91 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -195,7 +195,7 @@
             </div>
             <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                 <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
-                <el-button type="primary" @click="SelectGlassByGlassIDs()">{{ $t('Infeed barcodid') }}</el-button>
+                <el-button type="primary" @click="SelectGlassByGlassIDs(2)">{{ $t('Infeed barcodid') }}</el-button>
                 <el-input style="width:15%;" :placeholder="$t('Enter the order number')" v-model="order"></el-input>
                 <el-button type="warning" @click="showform1();">{{ $t('Exit the glass by order number') }}</el-button>
             </div>
@@ -336,24 +336,44 @@
 
         <el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
             <el-form :model="form" label-width="100px" style="padding-right: 30px">
-                <el-form-item style="text-align: center;">
-                    <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
-                    <el-button type="primary" @click="SelectGlassByGlassIDs()">{{ $t('Query') }}</el-button>
-                </el-form-item>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item>
+                        <label for="">{{ $t('Upper film position') }}</label>
+                        <label for="">{{ $t('Scan Code Point') }}</label>
+                    </el-form-item>
+                </div>
                 <div style="display: flex;justify-content: space-around;height: 40px;">
-                    <label for="">{{ $t('Scan Code Point') }}</label>
-                    <label for="">{{ $t('Upper film position') }}</label>
-                    <label for="">{{ $t('Glass Information') }}</label>
+                    <label for="">{{ $t('current Information') }}</label>
+                    <label for="">{{ $t('Modify Information') }}</label>
+                    <label for="">{{ $t('current Information') }}</label>
+                    <label for="">{{ $t('Modify Information') }}</label>
+                </div>
+                <div style="display: flex;justify-content: space-around;">
+                    <el-form-item>
+                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
+                            v-model="glassid2"></el-input>
+                        <el-button type="primary" @click="SelectGlassByGlassIDs(1)" :disabled="disabled">{{ $t('Query')
+                        }}</el-button>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass lD')"
+                            v-model="glassid1"></el-input>
+                        <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="disabled">{{ $t('Query')
+                        }}</el-button>
+                    </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
                     <el-form-item :label="$t('Barcodid')">
                         <el-input v-model="form2.glassId" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('Barcodid')">
+                        <el-input v-model="form4.glassId" readonly autocomplete="off" />
+                    </el-form-item>
+                    <el-form-item :label="$t('Barcodid')">
                         <el-input v-model="form3.glassId" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('Barcodid')">
-                        <el-input v-model="form4.glassId" readonly autocomplete="off" />
+                        <el-input v-model="form5.glassId" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
@@ -361,10 +381,13 @@
                         <el-input v-model="form2.orderId" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('order')">
+                        <el-input v-model="form4.orderId" readonly autocomplete="off" />
+                    </el-form-item>
+                    <el-form-item :label="$t('order')">
                         <el-input v-model="form3.orderId" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('order')">
-                        <el-input v-model="form4.orderId" readonly autocomplete="off" />
+                        <el-input v-model="form5.orderId" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
@@ -372,10 +395,13 @@
                         <el-input v-model="form2.height" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('length')">
+                        <el-input v-model="form4.height" readonly autocomplete="off" />
+                    </el-form-item>
+                    <el-form-item :label="$t('length')">
                         <el-input v-model="form3.height" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('length')">
-                        <el-input v-model="form4.height" readonly autocomplete="off" />
+                        <el-input v-model="form5.height" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
                 <div style="display: flex;justify-content: space-around;">
@@ -383,20 +409,29 @@
                         <el-input v-model="form2.width" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('width')">
+                        <el-input v-model="form4.width" readonly autocomplete="off" />
+                    </el-form-item>
+                    <el-form-item :label="$t('width')">
                         <el-input v-model="form3.width" readonly autocomplete="off" />
                     </el-form-item>
                     <el-form-item :label="$t('width')">
-                        <el-input v-model="form4.width" readonly autocomplete="off" />
+                        <el-input v-model="form5.width" readonly autocomplete="off" />
                     </el-form-item>
                 </div>
-
+                <div style="display: flex;justify-content: space-around;">
+                    <el-button @click="DeleteQueueGlasss(2)" type="primary" :disabled="disabled1">{{ $t('Clear Current')
+                    }}</el-button>
+                    <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled1">
+                        {{ $t('Confirm Modification') }}</el-button>
+                    <el-button @click="DeleteQueueGlasss(1)" type="primary" :disabled="disabled1">{{ $t('Clear Current')
+                    }}</el-button>
+                    <el-button @click="InsertQueueGlass(1)" type="primary" :disabled="disabled1">
+                        {{ $t('Confirm Modification') }}</el-button>
+                </div>
             </el-form>
             <template #footer>
                 <span class="dialog-footer">
-                    <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
-                    }}</el-button>
-                    <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
-                    }}</el-button>
+
                     <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
                 </span>
             </template>
@@ -494,7 +529,7 @@
 //:disabled="scope.row.glassId > 0 || scope.row.disabled == 1 ? true : false"
 import {
     home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
-    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId
+    SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass
 } from "../../api/home";
 
 
@@ -528,18 +563,24 @@
                 number: 800,
             },
             form2: {
-                orderId: "1145",
-                glassId: "112",
-                height: "59.06",
-                width: "48.03"
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
             },
             form3: {
-                orderId: "1",
-                glassId: "2",
-                height: "3",
-                width: "4"
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
             },
             form4: {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
+            },
+            form5: {
                 orderId: "",
                 glassId: "",
                 height: "",
@@ -558,6 +599,7 @@
             order: "",
             glassid: "",
             glassid1: "",
+            glassid2: "",
             url: "../../img/bigcar01.png",
             car1: 145,
             car2: 210,
@@ -572,8 +614,8 @@
             zhuangtai: "",
             orderid: "",
             GlassInfo: [],
-            disabled: true,
-            disabled1: true,
+            disabled: false,
+            disabled1: false,
             currentPage: 1,  //榛樿鍒濆椤�
             pagesize: 15,    //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
             pageCount: 0
@@ -621,16 +663,50 @@
                     this.tasklist2 = obj.tasklist2[0];
                     this.alarm = obj.alarmmg[0];
                     this.loadglassheight = obj.loadglassheight;
-                    this.zhuangtai = obj.zhuangtai[0];
-
-                    this.glassid1 = obj.queid[0];
-                    if (this.glassid1 != "") {
-                        this.disabled1=false;
-                        this.showform3();
+                    if (obj.zhuangtai != null) {
+                        this.zhuangtai = obj.zhuangtai[0];
                     }
-                    this.form2 = obj.form2;
-                    this.form2 = obj.form3;
 
+                    // this.glassid1 = obj.queid[0];
+                    // if (obj.queid[0] != "" && obj.queid[0] != null && obj.state[0] == 0) {
+                    //     this.state = false;
+                    //     this.disabled = true;
+                    //     this.disabled1 = false;
+                    //     this.showform3();
+                    // } else if (obj.queid[0] != "" && obj.queid[0] != null && obj.state[0] == 1) {
+                    //     this.state = true;
+                    //     this.disabled = true;
+                    //     this.disabled1 = true;
+                    // }
+                    // else {
+                    //     this.state = true;
+                    //     this.disabled = false;
+                    //     this.disabled1 = false;
+                    // }
+                    if (obj.form2 != null && obj.form2 != "") {
+                        this.form2 = obj.form2[0];
+                    } else {
+                        this.form2 = {
+                            orderId: "",
+                            glassId: "",
+                            height: "",
+                            width: ""
+                        };
+                    }
+
+                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 1) {
+                        this.form3 = obj.form3[0];
+                    } else {
+                        this.form3 = {
+                            orderId: "",
+                            glassId: "",
+                            height: "",
+                            width: ""
+                        };
+                    }
+                    if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) {
+                        this.form5 = obj.form3[0];
+                    }
                     //if (obj.dbconnected == "false") {
                     this.text = this.$t('DataBase Connection failed');
                     // }
@@ -777,25 +853,48 @@
             }
         },
         //鏄剧ず鎵爜浣嶅拰涓婄墖浣�
-        showform3(){
+        showform3() {
             this.dialogFormVisible5 = true;
         },
         //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
-        SelectGlassByGlassIDs() {
+        SelectGlassByGlassIDs(parameter) {
             this.showform3();
-            SelectGlassByGlassID(this.glassid1).then(res => {
-                if (res.data.form != null) {
-                    this.form4 = res.data.form;
-                    this.$message.success(this.$t('query was successful'));
-                } else {
-                    this.$message.error(this.$t('There is no such glass'));
-                }
-                if (this.form2.glassId == "") {
-                    this.disabled = false;
-                } else {
-                    this.disabled = true;
-                }
-            });
+            if (parameter == 1) {
+                SelectGlassByGlassID(this.glassid2).then(res => {
+                    if (res.data.form != null) {
+                        this.form4 = res.data.form;
+                        this.$message.success(this.$t('query was successful'));
+                    } else {
+                        this.$message.error(this.$t('There is no such glass'));
+                    }
+                    if (this.form4.length > 0) {
+                        if (this.form4.glassId == "") {
+                            this.disabled = false;
+                        } else {
+                            this.disabled = true;
+                        }
+                    }
+
+                });
+            } else {
+                SelectGlassByGlassID(this.glassid1).then(res => {
+                    if (res.data.form != null) {
+                        this.form5 = res.data.form;
+                        this.$message.success(this.$t('query was successful'));
+                    } else {
+                        this.$message.error(this.$t('There is no such glass'));
+                    }
+                    if (this.form5.length > 0) {
+                        if (this.form5.glassId == "") {
+                            this.disabled = false;
+                        } else {
+                            this.disabled = true;
+                        }
+                    }
+
+                });
+            }
+
         },
         selectglassinfo() {
             SelectGlass(this.orderid).then(res => {
@@ -988,8 +1087,67 @@
         handleCurrentChange: function (currentPage) {
             this.currentPage = currentPage;
         },
-        InsertQueueGlass() {
-            InsertQueueGlassId(this.glassid1).then(res => {
+        //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
+        InsertQueueGlass(parameter) {
+            if (parameter == 1 && this.form5.glassId != "") {
+                if (this.form5.glassId != this.form2.glassId) {
+                    InsertQueueGlassId(this.form5.glassId, 1).then(res => {
+                        if (res.data.message == 200) {
+                            this.form5 = {
+                                orderId: "",
+                                glassId: "",
+                                height: "",
+                                width: ""
+                            };
+                            this.$message.success(this.$t('Operation successful'));
+                        }else{
+                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
+                        }
+                    });
+                } else {
+                    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) {
+                    InsertQueueGlassId(this.form4.glassId, 2).then(res => {
+                        if (res.data.message == 200) {
+                            this.form4 = {
+                                orderId: "",
+                                glassId: "",
+                                height: "",
+                                width: ""
+                            };
+                            this.$message.success(this.$t('Operation successful'));
+                        }else{
+                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
+                        }
+                    });
+                } else {
+                    this.$message.error(this.$t('The glass ID already exists in the loading queue'));
+                }
+
+
+            }
+        },
+        //娓呴櫎涓婄墖闃熷垪鐜荤拑
+        DeleteQueueGlasss(parameter) {
+            if (parameter == 1) {
+                DeleteQueueGlass(1).then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            } else {
+                DeleteQueueGlass(2).then(res => {
+                    if (res.data.message == 200) {
+                        this.$message.success(this.$t('Operation successful'));
+                    }
+                });
+            }
+        },
+        //淇敼鎵爜浣嶇幓鐠冪姸鎬�
+        UpdateQueueStates() {
+            UpdateQueueState().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 06a6a0f..cf088ab 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
@@ -56,21 +56,32 @@
             // 鏌ヨ鎶ヨ淇℃伅
             List<alarmmg> alarmmg = homeMapper.SelectAlarmmgInfo();
             jsonObject.append("alarmmg", alarmmg);
-            // 璇诲幓Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃甒
-            List<String> addressList = new ArrayList<String>();
-            addressList.add("DB106.12");
-            addressList.add("DB106.0");
-            List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
-            // 鑾峰彇杩涚墖杞︾姸鎬�
-            List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 鑾峰彇杩涚墖杞︾姸鎬�
-            boolean exist1 = datas1ListState.contains((short) 0);
-            jsonObject.append("zhuangtai", exist1);
+            // // 璇诲幓Plc杩涚墖杞︿笌鍑虹墖杞︿綅缃甒
+            // List<String> addressList = new ArrayList<String>();
+            // addressList.add("DB106.12");
+            // addressList.add("DB106.0");
+            // List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
+            // if (paramlist != null) {
+            //     jsonObject.append("params", paramlist);
+            // }
+            // // 鑾峰彇杩涚墖杞︾姸鎬�
+            // List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 鑾峰彇杩涚墖杞︾姸鎬�
+            // boolean exist1 = datas1ListState.contains((short) 0);
+            // jsonObject.append("zhuangtai", exist1);
+            //鑾峰彇杩涚墖鐜荤拑淇℃伅
+            // List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
+            // if (inglassInfo != null) {
+            //     if (inglassInfo.size() > 0)
+            //         jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
+            // }
             // 浼� 鑾峰彇杩涙槸鍚︽湁寰呯‘璁ょ殑鐜荤拑id
             String queid = spianMapper.Selectqueueid();
+            String state = spianMapper.Selectqueuestate();
             jsonObject.append("queid", queid);
+            jsonObject.append("state", state);
             // 鑾峰彇鎵爜浣嶄笌涓婄墖浣嶇幓鐠冧俊鎭�
-            List<Glass> form2 = homeMapper.GetQueueInfo(1);
-            List<Glass> form3 = homeMapper.GetQueueInfo(2);
+            Glass form2 = homeMapper.GetQueueInfo(2);
+            Glass form3 = homeMapper.GetQueueInfo(1);
             jsonObject.append("form2", form2);
             jsonObject.append("form3", form3);
             // List<Short> paramlists = new ArrayList<Short>();
@@ -80,14 +91,7 @@
             // paramlists.add(para2);
             // System.out.println(paramlists);
 
-            if (paramlist != null) {
-                jsonObject.append("params", paramlist);
-            }
-            List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
-            if (inglassInfo != null) {
-                if (inglassInfo.size() > 0)
-                    jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
-            }
+            
             dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
             boolean dbconnected = false;
             try {
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 1a90139..fa0b7d6 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
@@ -19,24 +19,24 @@
 
 public class AppRunnerConfig implements ApplicationRunner {
 
-  @Override 
+  @Override
   public void run(ApplicationArguments args) throws Exception {
     // TODO Auto-generated method stub
     //
     System.out.println("鍚姩瀹屾垚");
 
-    new PlcHold().start();
- 
-    // new Plcaction().start();
+    // new PlcHold().start();
 
-    // new Plchome().start();
+    new Plcaction().start();
 
-    // new PlcParameter().start();
+    new Plchome().start();
 
-    // new Plcalarm().start();
+    new PlcParameter().start();
 
-    // new Plcsign().start();
+    new Plcalarm().start();
 
-    // new Plcstate().start();
+    new Plcsign().start();
+
+    new Plcstate().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 e452a4e..0024641 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
@@ -219,11 +219,35 @@
 
     //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
     @PostMapping("/InsertQueueGlassId")
-    public Result InsertQueueGlassId(String glassid) {
-        homeMapper.InsertQueueGlassId(glassid);
+    public Result InsertQueueGlassId(String glassid,Short id) {
+        Map<String, Object> map = new HashMap<>();
+        short result = homeMapper.SelectStorageByGlassId(glassid);
+        if (result > 0) {
+            map.put("message", "300");
+        }else{
+            homeMapper.InsertQueueGlassId(glassid,id);
+            map.put("message", "200");
+        }
+        return Result.success(map);
+    }
+    
+    //纭鎵爜浣嶇幓鐠冧俊鎭�
+    @PostMapping("/UpdateQueueState")
+    public Result UpdateQueueState() {
+        homeMapper.UpdateQueueState();
         Map<String, Object> map = new HashMap<>();
         map.put("message", "200");
         return Result.success(map);
     }
+
+    //娓呴櫎涓婄墖闃熷垪鐜荤拑
+    @PostMapping("/DeleteQueueGlass")
+    public Result DeleteQueueGlass(String id) {
+        homeMapper.DeleteQueueGlass(id);
+        Map<String, Object> map = new HashMap<>();
+        map.put("message", "200");
+        return Result.success(map);
+    }
+    
     
 }
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 c5e465f..730ca3b 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
@@ -107,14 +107,25 @@
   @Select("select count(*) from storage_cage where glass_id=#{glassId}")
   short SelectStorageByGlassId(String glassId);
 
+  //鏍规嵁璁㈠崟鏌ヨ鐜荤拑淇℃伅
   @Select("select * from glass where position(#{orderid} in orderid)")
   List<Glass> SelectGlass(String orderid);
 
-  @Select("select * from queue qe inner join glass gl on qe.glassid=gl.glassid where id=#{id}")
-  List<Glass> GetQueueInfo(int id);
+  //鑾峰彇涓婄墖闃熷垪淇℃伅
+  @Select("select gl.* from queue qe inner join glass gl on qe.glassid=gl.glassid where qe.id=#{id}")
+  Glass GetQueueInfo(int id);
 
-  @Select("update queue set glassid=#{glassid},state=0,time=now() where id=1")
-  void InsertQueueGlassId(String glassid);
+  //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
+  @Select("update queue set glassid=#{glassid},state=1 where id=#{id}")
+  void InsertQueueGlassId(String glassid,Short id);
+
+  //纭鎵爜浣嶇幓鐠冧俊鎭�
+  @Select("update queue set state=1 where id=1")
+  void UpdateQueueState();
+
+  //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
+  @Select("update queue set glassid='' where id=#{id}")
+  void DeleteQueueGlass(String id);
 
   
 }
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 0ed5faa..6903be8 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
@@ -109,6 +109,7 @@
      @Select("SELECT COUNT(*) FROM `storage_cage` where state=3;")
      Integer Selectoutstate();
      //娣诲姞浠诲姟搴忓垪
+     //鑾峰彇杩涚墖闃熷垪id
      @Insert("INSERT INTO `canadames`.`queue`(`glassid`, `type`, `state`,width) VALUES (#{glassid},#{type},0,#{width});")
      void insertqueue(String glassid,int type,double width);
      //鑾峰彇浠诲姟搴忓垪
@@ -134,6 +135,10 @@
      StorageCage SelectQueout(String orderid,int cage,int cell);
      //鑾峰彇杩涚墖闃熷垪id
      @Select("select glassid from queue where type=1 and state=0;")
+     @Select("select glassid from queue where type=1")
      String Selectqueueid();
+     //鑾峰彇杩涚墖闃熷垪id
+     @Select("select state from queue where type=1")
+     String Selectqueuestate();
 }
     
\ No newline at end of file

--
Gitblit v1.8.0