From 2d92826d942cd4c06e1f415d4a3896b99ec65e2b Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期四, 07 十一月 2024 19:32:00 +0800
Subject: [PATCH] 更改配片逻辑

---
 springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java               |   10 
 springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java       |   54 ++
 springboot-vue3/src/main/java/com/example/springboot/mapper/QueueMapper.java         |    7 
 springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java        |    4 
 Albania_Mes-ui/src/lang/locales/en-US.json                                           |    6 
 Albania_Mes-ui/src/views/home/index.vue                                              |  205 +++++++--
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java       |  205 +++++---
 springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java         |    4 
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java          |   78 ++-
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java          |   55 +
 springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java  |  163 ++++---
 springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java     |    4 
 springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java |  153 +++++-
 Albania_Mes-ui/src/api/home.js                                                       |   16 
 Albania_Mes-ui/src/lang/locales/zh-CN.json                                           |   24 
 springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java    |  308 ++++++++-----
 16 files changed, 858 insertions(+), 438 deletions(-)

diff --git a/Albania_Mes-ui/src/api/home.js b/Albania_Mes-ui/src/api/home.js
index 51cc9cc..440cffd 100644
--- a/Albania_Mes-ui/src/api/home.js
+++ b/Albania_Mes-ui/src/api/home.js
@@ -295,9 +295,9 @@
 }
 export function deleteTasks(num) {
     return request({
-        url: '/home/deleteTasks?num='+num,
+        url: '/home/deleteTasks',
         method: 'post',
-        data:""
+        data:{"num":num}
     })
 }
 
@@ -356,6 +356,14 @@
         data:""
     })
 }
+export function SaveMeasure(films,thickness) {
+   
+    return request({
+        url: '/home/SaveMeasure?films='+films+'&thickness='+thickness,
+        method: 'post',
+        data:""
+    })
+}
 
 export function ModeChange(flowcard,method) {
     return request({
@@ -364,9 +372,9 @@
         data:""
     })
 }
-export function StartChange(flowcard) {
+export function StartChange(flowcard,orderstate) {
     return request({
-        url: '/home/StartChange?flowcard='+flowcard,
+        url: '/home/StartChange?flowcard='+flowcard+'&orderstate='+orderstate,
         method: 'post',
         data:""
     })
diff --git a/Albania_Mes-ui/src/lang/locales/en-US.json b/Albania_Mes-ui/src/lang/locales/en-US.json
index f29491f..3989053 100644
--- a/Albania_Mes-ui/src/lang/locales/en-US.json
+++ b/Albania_Mes-ui/src/lang/locales/en-US.json
@@ -15,6 +15,7 @@
   "All Out":"All Out",
   "Operation failed":"Operation canceled",
   "Flowcard":"Flowcard",
+  "Mateid":"Mateid",
   "Glasstype":"Glasstype",
   "Mode Change":"Mode Change",
   "Start Task":"Start Task",
@@ -26,6 +27,7 @@
   "'No Of Cage":"'No Of Cage",
   "Finish No":"Finish No",
   "Mate No":"Mate No",
+  "Cage GlassNumber":"鍦ㄧ鏁伴噺",
   "Order":"Order",
   "Select":"Select",
   "GlassType":"GlassType",
@@ -43,6 +45,7 @@
   "MeasureNumber":"MeasureNumber",
   "results":"results",
   "start work":"start work",
+  "stop work":"stop work",
   "Line":"Line",
   "Please select a route":"Please select a route",
   "This route already has a task":"This route already has a task",
@@ -51,7 +54,8 @@
   
 
   
-  "ip":"192.168.10.2",
+  "ip2":"192.168.10.2",
+  "ip":"localhost",
   "systemTitle": "Login System",
   "usernamePlaceholder": "Please enter username",
   "passwordPlaceholder": "Please enter password",
diff --git a/Albania_Mes-ui/src/lang/locales/zh-CN.json b/Albania_Mes-ui/src/lang/locales/zh-CN.json
index 5e58eb4..559a1bb 100644
--- a/Albania_Mes-ui/src/lang/locales/zh-CN.json
+++ b/Albania_Mes-ui/src/lang/locales/zh-CN.json
@@ -14,17 +14,19 @@
   "Productname":"椤圭洰鍚嶇О",
   "All Out":"鍏ㄩ儴鍑哄畬",
   "Operation failed":"鎿嶄綔澶辫触",
-  "Flowcard":"娴佺▼鍗�",
+  "Flowcard":"璁㈠崟",
+  "Mateid":"閰嶇墖ID",
   "Glasstype":"鐜荤拑绫诲瀷",
   "Mode Change":"妯″紡鏇存敼",
-  "Start Task":"寮�濮嬩换鍔�",
-  "Stop Task":"鍋滄浠诲姟",
+  "Start Task":"寮�濮嬪嚭鐗�",
+  "Stop Task":"鍋滄鍑虹墖",
   "No Of Cage":"绗煎瓙鍙�",
-  "Task State":"浠诲姟鐘舵��",
-  "Task Method":"浠诲姟妯″紡",
-  "Task Line":"浠诲姟绾胯矾",
+  "Task State":"鍑虹墖鐘舵��",
+  "Task Method":"鍑虹墖妯″紡",
+  "Task Line":"鍑虹墖绾胯矾",
   "Finish No":"瀹屾垚鏁伴噺",
   "Mate No":"閰嶅缂栧彿",
+  "Cage GlassNumber":"鍦ㄧ鏁伴噺",
   "Order":"璁㈠崟",
   "Select":"鏌ヨ",
   "GlassType":"鐜荤拑绫诲瀷",
@@ -41,15 +43,17 @@
   "Clear":"娓呴櫎",
   "MeasureNumber":"娴嬮噺鏁伴噺",
   "results":"缁撴灉",
-  "start work":"寮�濮嬪伐绋�",
+  "start work":"寮�濮嬩笂鐗�",
+  "stop work":"鏆傚仠涓婄墖",
   "Line":"绾胯矾",
   "Please select a route":"璇烽�夋嫨绾胯矾",
   "This route already has a task":"姝よ矾绾垮凡瀛樺湪浠诲姟",
+  
   "Save":"淇濆瓨",
   "Select file":"閫夋嫨鏂囦欢",
 
-  "ip":"192.168.10.2",
-  "ip1":"localhost",
+  "ip2":"192.168.10.2",
+  "ip":"localhost",
   "systemTitle": "鐧诲綍绯荤粺",
   "usernamePlaceholder": "璇疯緭鍏ョ敤鎴峰悕",
   "passwordPlaceholder": "璇疯緭鍏ュ瘑鐮�",
@@ -299,7 +303,7 @@
   "Slot No": "鏍煎瓙",
   "Barcode": "鐜荤拑id",
   "Delete": "鍒犻櫎",
-  "Out": "鍑虹墖",
+  "Out": "閰嶇墖鍑虹墖",
   "Operation successful": "鎿嶄綔鎴愬姛",
   "Operation canceled": "鎿嶄綔鍙栨秷",
   "There is no such order": "娌℃湁姝よ鍗曠殑鐜荤拑",
diff --git a/Albania_Mes-ui/src/views/home/index.vue b/Albania_Mes-ui/src/views/home/index.vue
index 2d87286..c873062 100644
--- a/Albania_Mes-ui/src/views/home/index.vue
+++ b/Albania_Mes-ui/src/views/home/index.vue
@@ -327,6 +327,11 @@
     display: inline-block;
     cursor: pointer;
 }
+
+.bold-center {
+    font-weight: bold;
+    text-align: center;
+}
 </style>
 <template>
     <el-container>
@@ -432,7 +437,7 @@
                         </div>
                     </div>
                     <el-table :data="this.tasklist1" border style="width: 700px;">
-                        <el-table-column prop="glasstype" :label="$t('Glasstype')"></el-table-column>
+                        <el-table-column prop="mateid" :label="$t('Mateid')"></el-table-column>
                         <el-table-column prop="storageCage.cage" :label="$t('Cage No')"></el-table-column>
                         <el-table-column prop="storageCage.cell" :label="$t('Slot No')"></el-table-column>
                         <el-table-column prop="storageCage.glassWidth" :label="$t('Width')"></el-table-column>
@@ -447,7 +452,7 @@
                         </el-table-column>
                     </el-table>
                     <el-table :data="this.tasklist2" border style="width: 100%">
-                        <el-table-column prop="glassId" :label="$t('Glasstype')"></el-table-column>
+                        <el-table-column prop="mateid" :label="$t('Mateid')"></el-table-column>
                         <el-table-column prop="storageCage.cage" :label="$t('Cage No')"></el-table-column>
                         <el-table-column prop="storageCage.cell" :label="$t('Slot No')"></el-table-column>
                         <el-table-column prop="storageCage.glassWidth" :label="$t('Width')"></el-table-column>
@@ -478,7 +483,7 @@
                             <!-- 淇濆瓨 -->
                             <el-button type="primary" @click="importData()"
                                 style="margin-right: 10px;margin-bottom: 10px;">{{
-                                $t('Save') }}</el-button>
+                                    $t('Save') }}</el-button>
                             <input type="file" id="file-upload" multiple @change="Change" />
                             <label for="file-upload">{{ $t('Select file') }}</label>
                         </div>
@@ -504,17 +509,35 @@
 
         <el-dialog :visible.sync="Measure" :title="$t('Measure')" top="5vh"><!--娴嬮噺椤甸潰-->
             <!--娴嬮噺椤甸潰涓讳綋-->
-            <div style="height: 780px;">
+            <div style="height: 800px;">
                 <!--鍔熻兘-->
                 <div>
-                    <!-- <el-button type="primary" @click="ManualMatching()" :disabled="(this.LastQueue.state <= 0)"
+                    <el-button type="primary" @click="ManualMatching()" :disabled="(this.LastQueue.state > 1)"
                         style="z-index: 999;">{{ $t('Manual matching') }}</el-button>
-                    <el-button type="primary" @click="ManualTake()" :disabled="(this.LastQueue.state <= 0)"
+                    <el-button type="primary" @click="ManualTake()" :disabled="(this.LastQueue.state > 1)"
                         style="z-index: 999;">{{
-                $t('Manual removal') }}</el-button> -->
-                    <el-button type="primary" @click="AnewMeasure()" :disabled="(this.LastQueue.state <= 0)"
+                $t('Manual removal') }}</el-button> 
+                    <el-button type="primary" @click="AnewMeasure()" 
                         style="z-index: 999;">{{
                             $t('Remeasure') }}</el-button>
+                    <!-- 杈撳叆涓嬫媺妗�1 -->
+                    <!-- SelectSetting -->
+                    <label for="file-upload"  style="font-weight: bold;font-size: 16px;margin-left: 50px;">{{ $t('Films') }}:{{SelectSetting.films }}</label>
+                    <el-select v-model="selectedValue1" :placeholder="$t('Films')">
+                        <el-option v-for="item in selectedOption1.films" :key="item.value" :label="item.films"
+                            :value="item.films">
+                        </el-option>
+                    </el-select>
+                    <!-- 杈撳叆涓嬫媺妗�2 -->
+                    <label for="file-upload"  style="font-weight: bold;font-size: 16px;">{{ $t('Thickness') }}:{{SelectSetting.thickness }}mm</label>
+                    <el-select v-model="selectedValue2" :placeholder="$t('Thickness')">
+                        <el-option v-for="item in selectedOption2.thickness" :key="item.value" :label="item.thickness"
+                            :value="item.thickness">
+                        </el-option>
+                    </el-select>
+                    <el-button type="primary" @click="SaveMeasure(selectedValue1,selectedValue2)" 
+                        style="z-index: 999;">{{
+                            $t('Save') }}</el-button>
                 </div>
                 <br>
                 <!--鏄剧ず-->
@@ -544,7 +567,7 @@
                 </div>
                 <!--鏄剧ず-->
                 <div style="width:20px;height: 720px;float: left;"></div>
-                <div style="width:600px;height: 720px;border: 2px solid #d1d1d1;float: left;">
+                <div style="width:700px;height: 720px;border: 2px solid #d1d1d1;float: left;">
                     <!--鐜荤拑鍥�  #81b337  padding: 50px 50px;-->
                     <!-- <span class="measuretitle">{{ $t('Width') }}锛�</span> <span class="measureValue">{{
                 this.LastQueue.glasswidth
@@ -564,8 +587,9 @@
                 this.LastQueue.state > 0 ? $t('Matching successful') :
                     (this.LastQueue.state == 0 ? $t('Multiple data matching') : $t('Matching failed')) }}</span>
                     <br> -->
-                    <el-table :data="this.tasklist3" :row-class-name="rowClassName" style="width: 100%;padding:0;">
+                    <el-table :data="this.tasklist3" :height="700"  :row-class-name="rowClassName" style="width: 100%;padding:0;">
                         <el-table-column prop="flowcard" :label="$t('Flowcard')"></el-table-column>
+                        <el-table-column prop="mateid" :label="$t('Mateid')"></el-table-column>
                         <el-table-column prop="films" :label="$t('Films')"></el-table-column>
                         <el-table-column prop="width" :label="$t('Width')"></el-table-column>
                         <el-table-column prop="height" :label="$t('Height')"></el-table-column>
@@ -579,16 +603,18 @@
         </el-dialog>
 
         <el-dialog :visible.sync="StorageCage" :title="$t('StorageCage')" top="5vh">
-            <el-table :data="this.StorageCageInfo" :height="700" border style="width: 100%;overflow: auto;">
+            <el-table :data="this.StorageCageInfo" :height="700" border style="width: 100%;overflow: auto;"
+                :span-method="spanMethod" class="bold-center">
                 <el-table-column :min-width="80" prop="cage" :label="$t('Cage No')"></el-table-column>
                 <el-table-column :min-width="80" prop="cell" :label="$t('Slot No')"></el-table-column>
-                <el-table-column :min-width="80" prop="glasstype" :label="$t('GlassType')"></el-table-column>
+                <el-table-column :min-width="80" prop="flowcard" :label="$t('Flowcard')"></el-table-column>
+                <el-table-column :min-width="80" prop="mateid" :label="$t('Mateid')"></el-table-column>
                 <el-table-column :min-width="80" prop="glassWidth" :label="$t('Width')"></el-table-column>
                 <el-table-column :min-width="80" prop="glassHeight" :label="$t('Height')"></el-table-column>
                 <el-table-column :min-width="80" prop="thickness" :label="$t('Thickness')"></el-table-column>
                 <el-table-column :min-width="80" prop="films" :label="$t('Films')"></el-table-column>
                 <el-table-column :min-width="80" prop="number" :label="$t('number')"></el-table-column>
-                <el-table-column :min-width="80" prop="width" :label="$t('Width')"></el-table-column>
+                <!-- <el-table-column :min-width="80" prop="width" :label="$t('Width')"></el-table-column> -->
                 <el-table-column :min-width="250" :label="$t('Operate')">
                     <template slot-scope='scope'>
                         <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
@@ -617,17 +643,18 @@
                 :tree-props="{ children: 'glassinfo', hasChildren: 'hasChildren' }">
                 <el-table-column prop="flowcard" :label="$t('Order')" width="150" align="center">
                     <template slot-scope='scope'>
-                        <div
-                           >
+                        <div>
                             {{ scope.row.flowcard }}
                         </div>
                     </template>
                 </el-table-column>
-                <el-table-column prop="glasstype" :label="$t('GlassType')" align="center">
+                <el-table-column prop="mateid" :label="$t('Mateid')" align="center">
                 </el-table-column>
-                <el-table-column prop="number" :label="$t('Order No')" align="center">
+                <el-table-column prop="tier" :label="$t('Tier')" align="center">
                 </el-table-column>
-                <el-table-column prop="cageno" :label="$t('No Of Cage')" align="center">
+                <el-table-column prop="number" :label="$t('Number')" align="center">
+                </el-table-column>
+                <el-table-column prop="cageno" :label="$t('Cage GlassNumber')" align="center">
                 </el-table-column>
                 <el-table-column prop="finishnumber" :label="$t('Finish No')" align="center">
                 </el-table-column>
@@ -644,7 +671,7 @@
                 <el-table-column prop="state" :label="$t('Task State')" align="center">
                     <template slot-scope='scope'>
                         <div
-                            :style="{ backgroundColor: scope.row.state === 0 ? '' : '#00FFFF', width: '105%', height: '125%',lineHeight: '50px'}">
+                            :style="{ backgroundColor: scope.row.state === 0 ? '' : '#00FFFF', width: '105%', height: '125%', lineHeight: '50px' }">
                             {{ scope.row.state >= 0 ? scope.row.state == 0 ? $t('Stop') : $t('Start') : "" }}
                         </div>
                     </template>
@@ -654,9 +681,11 @@
                         {{ scope.row.state >= 0 ? scope.row.state == 0 ? $t('Stop') : $t('Start') : "" }}
                     </template>
                 </el-table-column> -->
-                <el-table-column prop="method" :label="$t('Task Method')">
+                <el-table-column prop="method" :label="$t('Task Method')" align="center">
                     <template slot-scope='scope'>
-                        {{ scope.row.state >= 0 ? scope.row.method == 0 ? $t('Out') : $t('All Out') : "" }}
+                        <div style="text-align: center;width: 105%;">
+                            {{ scope.row.state >= 0 ? (scope.row.method == 0 ? $t('Out') : $t('All Out')) : "" }}
+                        </div>
                     </template>
                 </el-table-column>
                 <el-table-column prop="line" :label="$t('Task Line')">
@@ -681,24 +710,24 @@
                             {{ $t('Mode Change') }}</el-button>
 
                         <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
-                            v-show="scope.row.state >= 0 ? true : false" @click="StartChange(scope.row.flowcard)">
-                            {{ scope.row.orderstate > 0 ? $t('start work') : $t('start work') }}</el-button>
+                            v-show="scope.row.state >= 0 ? true : false" @click="StartChange(scope.row.flowcard, scope.row.orderstate)">
+                            {{ scope.row.orderstate > 0 ? $t('stop work') : $t('start work') }}</el-button>
+
                         <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
-                            v-show="scope.row.state >= 0 ? true : false"
-                            @click="deleteTasks(scope.row.flowcard)">
+                            v-show="scope.row.state >= 0 ? true : false" @click="deleteTasks(scope.row.flowcard)">
                             {{ $t('langDelete') }}</el-button>
 
                     </template>
                 </el-table-column>
             </el-table>
         </el-dialog>
-
+        <!-- 浜哄伐鍖归厤 -->
         <el-dialog :visible.sync="StorageCageAdd" :title="$t('StorageCageAdd')" top="5vh" width="80%">
             <div style="display: flex;height: 40px;line-height: 40px;">
                 <label for="">{{ $t('Width') }}</label>
-                <el-input v-model="StorageCageForm.width" autocomplete="off" style="width:15%;" />
+                <el-input v-model="StorageCageForm.glasswidthmm" autocomplete="off" style="width:15%;" />
                 <label for="">{{ $t('Height') }}</label>
-                <el-input v-model="StorageCageForm.height" autocomplete="off" style="width:15%;" />
+                <el-input v-model="StorageCageForm.glassheightmm" autocomplete="off" style="width:15%;" />
                 <label for="">{{ $t('Thickness') }}</label>
                 <el-input v-model="StorageCageForm.thickness" autocomplete="off" style="width:15%;" />
                 <label for="">{{ $t('Films') }}</label>
@@ -709,7 +738,7 @@
             <el-table :data="this.StorageCageAddInfo" :height="700" border style="width: 100%;overflow: auto;">
                 <el-table-column prop="flowcard" :label="$t('Flowcard')"></el-table-column>
                 <el-table-column prop="tier" :label="$t('Tier')"></el-table-column>
-                <el-table-column prop="glasstype" :label="$t('GlassType')"></el-table-column>
+                <el-table-column prop="mateid" :label="$t('Mateid')"></el-table-column>
                 <el-table-column prop="width" :label="$t('Width')"></el-table-column>
                 <el-table-column prop="height" :label="$t('Height')"></el-table-column>
                 <el-table-column prop="thickness" :label="$t('Thickness')"></el-table-column>
@@ -733,7 +762,7 @@
     Disabled, SelectPermissionByUserName, currentUsername, CompleteQueue,
     isAllowReorderings,
 
-    UpdateStroageCageByCell, FinishTask, SelectGlassInfo, StorageCageAddGlass, ClaimTasks, ModeChange, UpdateQueue, importData, ManualTake, AnewMeasure, StartChange, deleteTasks
+    UpdateStroageCageByCell, FinishTask, SelectGlassInfo, StorageCageAddGlass, ClaimTasks, ModeChange, UpdateQueue, importData, ManualTake, AnewMeasure, StartChange, deleteTasks,SaveMeasure
 } from "../../api/home";
 
 
@@ -747,14 +776,28 @@
             carposition: 0,
             // selected: [],
             selected: Array.from({ length: 1000 }, () => 1),
+            selected2: Array.from({ length: 1000 }, () => 1),
+            selected3: Array.from({ length: 1000 }, () => 1),
             // selected: '1',
             options: [{
                 value: '1',
                 label: '1'
             }],
-            // mounted() {
-            //   this.selected[scope.$index] = '1'; // 鍋囪浣犳兂璁╃涓�涓笅鎷夋榛樿閫変腑 '閫夐」 1'
-            // },
+            // 娴嬮噺涓嬫媺妗嗚啘绯�
+            selectedOption1: {
+                films: [],
+              },
+              selectedOption2: {
+                thickness: [],
+              },
+            //  selectedOption1: [films],
+            //  selectedOption2: [thickness],
+
+            selectedValue1: null, // 鐢ㄤ簬瀛樺偍绗竴涓笅鎷夋鐨勯�変腑鍊�
+            selectedValue2: null, // 鐢ㄤ簬瀛樺偍绗簩涓笅鎷夋鐨勯�変腑鍊�
+            // 灏嗗�艰祴缁� selectedValue1 鍜� selectedValue2
+           
+
             dataList: [],
             tableData1: [],
             Measuermode: false,
@@ -775,8 +818,8 @@
             StorageCageAdd: false,
             StorageCageInfo: [],
             StorageCageForm: {
-                width: "",
-                height: "",
+                glasswidthmm: "",
+                glassheightmm: "",
                 thickness: "",
                 films: ""
             },
@@ -794,6 +837,8 @@
             cagelist2: [],
             cagelist3: [],
             cagelist4: [],
+            SelectMeasure: [],
+            SelectSetting: [],
             task1: 3,
             task2: 2,
             tasklist1: [],
@@ -847,7 +892,7 @@
             PromptSize: 250,
             reset: false,
             isQueueWarning: false,
-            CurrentFrame: [],
+            // CurrentFrame: [],
             DeviceList: [1, 1, 1, 1],
             GlassIdList: [],
             Scanningmethod: true,
@@ -859,11 +904,13 @@
     created() {
         this.load();
 
+
     },
     activated() {
         this.init();
     }
     ,
+
     methods: {
         showform(i) {
             if (i == 1) {
@@ -912,6 +959,23 @@
                     this.tasklist3 = obj.glassInfoFlowCard[0];
                     this.tasklist2 = obj.StoragTaskeTaskFeed[0];
                     this.tasklist1 = obj.StoragTaskeTaskOut[0];
+                    this.SelectSetting=obj.SelectSetting[0];
+                    this.selectedOption1.films = obj.SelectMeasure[0];
+                    this.selectedOption2.thickness = obj.SelectMeasure[0];
+                    // if(obj.StorageCageForm.length == 0){
+                    //     this.StorageCageForm.glasswidthmm = ""
+                    //     this.StorageCageForm.glassheightmm = ""
+                    //     this.StorageCageForm.films = ""
+                    //     this.StorageCageForm.thickness = ""
+                    // }else{
+                    //     this.StorageCageForm = obj.StorageCageForm[0];
+                    // }
+                    
+                    // console.log(obj.StorageCageForm[0]);
+
+
+                    //鍦ㄨ繖閲屽啓涓嬫媺閫夌殑v-for鐨勫悕绉�
+
                     if (obj.alarmmg[0].length > 0) {
                         if (this.alarm.length > 0) {
                             if (this.alarm[this.alarm.length - 1].id != obj.alarmmg[0][obj.alarmmg[0].length - 1].id) {
@@ -952,6 +1016,7 @@
                     this.$forceUpdate();
 
                 }.bind(this);
+
                 //鍏抽棴浜嬩欢
                 socket.onclose = function () {
                     console.log("websocket宸插叧闂�");
@@ -966,6 +1031,7 @@
                 });
             }
         },
+        
         load() {
             //鍔犺浇鐢ㄦ埛鏉冮檺
             currentUsername().then(res => {
@@ -1005,6 +1071,7 @@
                 this.cageinfo = res.data.cageinfo;
                 this.currentPages = 1;
             });
+
         },
         //娣诲姞鐞嗙墖绗肩幓鐠�
         StorageCageAddGlass(index) {
@@ -1056,25 +1123,46 @@
                 }
             });
         },//閫夋嫨寮�濮嬪伐绋�
-        StartChange(flowcard) {
-            StartChange(flowcard).then(res => {
+        StartChange(flowcard,orderstate) {
+            if(orderstate==1){
+               
+            StartChange(flowcard,0).then(res => {
+                if (res.data.message == 200) {
+                    this.$message.success(this.$t('Operation successful'));
+                }
+            });
+        }else{
+            StartChange(flowcard,1).then(res => {
+                if (res.data.message == 200) {
+                    this.$message.success(this.$t('Operation successful'));
+                }
+            });
+        }
+        },
+        //閫夋嫨寮�濮嬪伐绋�
+        deleteTasks(flowcard) {
+            deleteTasks(flowcard).then(res => {
+                console.log("@" + flowcard + "@");
                 if (res.data.message == 200) {
                     this.$message.success(this.$t('Operation successful'));
                 }
             });
         },
-        //閫夋嫨寮�濮嬪伐绋�
-        deleteTasks(flowcard) {
-            deleteTasks(flowcard).then(res => {
-                console.log("@"+flowcard+"@");
-                if (res.data.message == 200) {
+        //淇濆瓨娴嬮噺鑶滅郴鐨勫弬鏁�
+        SaveMeasure(films,thickness) {
+            console.log('Films:', films);  // 鎵撳嵃 films
+            console.log('Thickness:', thickness);  // 鎵撳嵃 thickness
+            SaveMeasure(films,thickness).then(res => {
+                if (res.data.message >= 1) {
                     this.$message.success(this.$t('Operation successful'));
                 }
             });
         },
         //鏌ヨ鐜荤拑淇℃伅
         SelectGlassInfo() {
-            SelectGlassInfo(this.StorageCageForm.width, this.StorageCageForm.height, this.StorageCageForm.thickness, this.StorageCageForm.films).then(res => {
+            console.log(this.StorageCageForm.glasswidthmm);
+            
+            SelectGlassInfo(this.StorageCageForm.glasswidthmm, this.StorageCageForm.glassheightmm, this.StorageCageForm.thickness, this.StorageCageForm.films).then(res => {
                 this.StorageCageAddInfo = res.data.StorageCageAddInfo;
             })
         },
@@ -1112,7 +1200,35 @@
                 }
             });
         },
+        spanMethod({ rowIndex, columnIndex }) {
+            let zhi1 = this.StorageCageInfo[rowIndex].cage;
+            let zhi2 = 0;
+            if (rowIndex > 0) {
+                zhi2 = this.StorageCageInfo[rowIndex - 1].cage;
+            }
+            if (columnIndex === 0) { // 浠呭鐞� cage 鍒�
+                // console.log(columnIndex,rowIndex);
+                if (zhi1 != zhi2) {
+                    const currentCage = this.StorageCageInfo[rowIndex].cage;
+                    let span = { rowspan: 1, colspan: 1 };
 
+                    // 妫�鏌ュ悗缁锛屾壘鍒扮浉鍚岀殑 cage 鍊�
+                    for (let i = rowIndex + 1; i < this.StorageCageInfo.length; i++) {
+                        if (this.StorageCageInfo[i].cage === currentCage) {
+                            span.rowspan++;
+                        } else {
+                            break;
+                        }
+                    }
+                    return span;
+                } else {
+                    return { rowspan: 0, colspan: 0 };
+                }
+
+            }
+            // 鍏朵粬鍒椾繚鎸侀粯璁わ紝涓嶅悎骞�
+            return { rowspan: 1, colspan: 1 };
+        },
         //鏀瑰彉姣忛〉瀹圭撼鐨勬暟鎹噺
         handleSizeChange: function (size) {
             this.pagesize = size;
@@ -1234,6 +1350,7 @@
             importData(tbdata).then(res => {
                 if (res.data.message == 200) {
                     this.$message.success(this.$t('Operation successful'));
+                    this.dataList = null;
                 }
             });
         },
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
index ecee1cc..8756fe9 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -1,4 +1,7 @@
 package com.example.springboot.component;
+
+import java.util.Date;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import com.example.springboot.service.SpianServiceNew;
 import com.example.springboot.service.StorageCageService;
@@ -6,16 +9,14 @@
 import com.example.springboot.entity.device.PlcParameterObject;
 import com.example.springboot.mapper.AlbaniaMapper;
 
-
 public class PlcHoldNew extends Thread {
-
- 
 
   @Autowired
   private AlbaniaMapper albaniaMapper;
   private SpianServiceNew spianService;
   private StorageCageService storageCageService;
   int aaa;
+  String huibao = "";
 
   @Override
   public void run() {
@@ -23,101 +24,137 @@
     while (this != null) {
       try {
 
-        Thread.sleep(500);
+        Thread.sleep(300);
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
 
-      
       storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
       spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
       albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class);
-      
-      //璇诲彇DB14鍖烘枃浠�
-      PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
-      if(plcmes.getPlcParameter("PLCToMES").getValue()!=null){
-        
-      // spianService.Mestast("NG0001-1",40,1,0,"MESID1",1);
-      // spianService.Mestast("NG0001-2",40,2,0,"MESID2",2);
-      // spianService.Mestast("NG0001-3",40,2,1,"MESID3",3);
-    
-      String ExportTOMES1=plcmes.getPlcParameter("ExportTOMES1").getValue();//鍑虹墖璇锋眰涓�绾�
-      String ExportToMES2=plcmes.getPlcParameter("ExportToMES2").getValue();//鍑虹墖璇锋眰浜岀嚎
-      String PLCToMES=plcmes.getPlcParameter("PLCToMES").getValue();//杩愰�佽溅璇锋眰
-      String IDStatus1=plcmes.getPlcParameter("IDStatus1").getValue();//1鍙蜂换鍔″畬鎴�
-      String MESToPLCStatus1=plcmes.getPlcParameter("MESToPLCStatus1").getValue();//1鍙风‘璁ゅ瓧
-      String MESToPLC=plcmes.getPlcParameter("MESToPLC").getValue();//鍙戦�佷换鍔″瓧
-      // String scan=plcmes.getPlcParameter("scan").getValue();//鍙戦�佹壂鐮佷俊鎭�
-      // if(scan.equals("1")==true){
-      //   spianService.scan(scan);
-      // }
-      
-      //涓�鍙风嚎璇锋眰
-      
-      if(ExportTOMES1!=null&&MESToPLC!=null){
-      if (ExportTOMES1.equals("1") == true&&MESToPLC.equals("0")==true) {
-      
-        spianService.selectout(1);
-      }
-    }
-      // //浜岀嚎鍙疯姹傛椂
-    //   if(ExportToMES2!=null &&MESToPLC!=null){
-    //   if (ExportToMES2.equals("1") == true&&MESToPLC.equals("0")==true) {
-    //     spianService.selectout(2);
-    //   }
-    // }
-      //杩涚墖璇锋眰鏃�
-      
-      GlassInfo glass=albaniaMapper.SelectGlass();
-      if(PLCToMES!=null && glass!=null&&MESToPLC!=null){
-      if(PLCToMES.equals("1")==true&&MESToPLC.equals("0")==true){        
-  
-        spianService.selectAll(glass);
-      }
-    }
-    
-    // System.out.println("IDStatus1:"+IDStatus1+"MESToPLCStatus1:"+MESToPLCStatus1);
-      //浠诲姟瀹屾垚鏃�
-      if(IDStatus1.equals("1")==true && MESToPLCStatus1.equals("0")==true){
-        //瀹屾垚纭瀛�
-        for(int i=1;i<7;i++){
-          String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//PLC鐞嗙墖浠诲姟鐘舵�佹眹鎶�
-          String Glassid=plcmes.getPlcParameter("MESID"+i).getValueString();//MES鐜荤拑ID
-          GlassInfo id=albaniaMapper.SelectTaskId(Glassid);       
-            if(id!=null&&Tastover.equals("1")){
-              //璋冪敤瀹屾垚浠诲姟 Glassid
-              storageCageService.FinishTask(id.getId());
-            }               
-              S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//瀹屾垚纭瀛�
-              System.out.println("瀹屾垚纭瀛桵ESToPLCStatus");
-              
+      spianService.selectout(1);
+      // 璇诲彇DB14鍖烘枃浠�
+      PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
+      if (plcmes.getPlcParameter("PLCToMES").getValue() != null) {
+
+        String ExportTOMES1 = plcmes.getPlcParameter("ExportTOMES1").getValue();// 鍑虹墖璇锋眰涓�绾�
+        String PLCToMES = plcmes.getPlcParameter("PLCToMES").getValue();// 杩愰�佽溅璇锋眰
+        String IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴�
+        String MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧
+        String MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧
+        int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲�
+        int outtask = albaniaMapper.SelectOutTaskCount(); // 绛夊緟琛ュ彂鐨勫嚭鐗囦换鍔℃暟閲�
+        if(outtask>0){
+          spianService.mateOut();
+        }
+        // String scan=plcmes.getPlcParameter("scan").getValue();//鍙戦�佹壂鐮佷俊鎭�
+        // if(scan.equals("1")==true){
+        // spianService.scan(scan);
+        // }
+        // 鑾峰彇褰撳墠鏃堕棿
+        String currentTime = new Date().toString();
+        if (!huibao.equals(IDStatus1)) {
+          System.out.println("姹囨姤璁板綍:" + IDStatus1 + "鏃堕棿" + currentTime);
+        }
+        huibao = IDStatus1;
+        // 涓�鍙风嚎璇锋眰
+        if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) {
+          if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true
+              && MESToPLCStatus1.equals("0") == true) {
+            System.out
+                .println("鍑虹墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
+            spianService.selectout(1);
+            try {
+              Thread.sleep(200); // 姣�100姣妫�鏌ヤ竴娆�
+            } catch (InterruptedException e) {
+              Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇
             }
-              S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 0);//娓呴櫎浠诲姟鍙戦�佸瓧
-              System.out.println("娓呴櫎浠诲姟鍙戦�佸瓧MESToPLC");
-            
-          }
-          
-        
-      
-      //姹囨姤鍙栨秷鏃�
-      if(IDStatus1.equals("0")==true &&MESToPLCStatus1.equals("1")){
-        
-        //鍙栨秷纭瀛�
-        for(int i=1;i<7;i++){
-          String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//渚濇鑾峰彇浠诲姟姹囨姤
-          if(Tastover.equals("0")){
-            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 0);//娓呴櫎纭瀛�
-            System.out.println("娓呴櫎纭瀛桵ESToPLCStatus");
           }
         }
+
+        PLCToMES = plcmes.getPlcParameter("PLCToMES").getValue();// 杩愰�佽溅璇锋眰
+        IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴�
+        MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧
+        MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧
+        // 杩愰�佽溅璇锋眰鍜屾祴閲忓畬鎴愯姹�
+        GlassInfo glass = albaniaMapper.SelectGlass();
+        if (PLCToMES != null && glass != null && MESToPLC != null && taskcont == 0) {
+          if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true) {
+            try {
+              Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆�
+            } catch (InterruptedException e) {
+              Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇
+            }
+            System.out
+                .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
+            spianService.selectAll(glass);
+          }
+        }
+
+        // 浠诲姟瀹屾垚鏃�
+        if ((IDStatus1.equals("1") && MESToPLCStatus1.equals("0")) ||
+            (IDStatus1.equals("4") && MESToPLCStatus1.equals("0"))) {
+          // 瀹屾垚纭瀛�
+          for (int i = 1; i < 7; i++) {
+            String Tastover = plcmes.getPlcParameter("IDStatus" + i).getValue();// PLC鐞嗙墖浠诲姟鐘舵�佹眹鎶�
+            String Glassid = plcmes.getPlcParameter("MESID" + i).getValueString();// MES鐜荤拑ID
+            GlassInfo id = albaniaMapper.SelectTaskId(Glassid);
+            if (Tastover.equals("1")) {
+              // 璋冪敤瀹屾垚浠诲姟 Glassid
+              storageCageService.FinishTask();
+              System.out.println("瀹屾垚浠诲姟ID:" + id);
+            } else if (Tastover.equals("4")) {
+              storageCageService.FinishTask();
+              System.out.println("瀹屾垚澶辫触浠诲姟ID:" + id);
+            }
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus" + i).getAddress(), (short) 1);// 瀹屾垚纭瀛�
+          }
+          System.out.println("瀹屾垚纭瀛桵ESToPLCStatus");
+          // 娓呴櫎浠诲姟鍦板潃
+          for (int i = 1; i < 7; i++) {
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStart" + i).getAddress(), (short) 0);// 娓呴櫎浠诲姟鍦板潃
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget" + i).getAddress(), (short) 0);// 娓呴櫎浠诲姟鍦板潃
+          }
+          System.out.println("娓呴櫎浠诲姟鍦板潃");
+          while (true) {
+            String currentValue = plcmes.getPlcParameter("MESToPLC").getValue();
+            // 妫�鏌� MESToPLC 鐨勫�兼槸鍚︿负 0
+            if (currentValue.equals("0")) {
+              System.out.println("MESToPLC 宸插彉涓� 0,鍋滄寰幆鍐欏叆");
+              break; // 閫�鍑哄惊鐜�
+            }
+            // 濡傛灉涓嶄负 0锛岀户缁啓鍏�
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(),
+                (short) 0);// 娓呴櫎浠诲姟鍙戦�佸瓧
+            System.out.println("缁х画鍐欏叆 MESToPLC,褰撳墠鍊�:" + currentValue);
+            // 鍔犱笂寤舵椂锛岄伩鍏嶅崰鐢ㄨ繃澶� CPU 璧勬簮
+            try {
+              Thread.sleep(100); // 渚嬪姣忕妫�鏌ヤ竴娆�
+            } catch (InterruptedException e) {
+              e.printStackTrace();
+            }
+          }
+
+        }
+
+        // 姹囨姤鍙栨秷鏃�
+        if ((IDStatus1.equals("0")) && MESToPLCStatus1.equals("1")) {
+          // 鍙栨秷纭瀛�
+          for (int i = 1; i < 7; i++) {
+            String Tastover = plcmes.getPlcParameter("IDStatus" + i).getValue();// 渚濇鑾峰彇浠诲姟姹囨姤
+            if (Tastover.equals("0")) {
+              S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus" + i).getAddress(), (short) 0);// 娓呴櫎纭瀛�
+
+            }
+          }
+          System.out.println("娓呴櫎纭瀛桵ESToPLCStatus");
+        }
+
       }
-    
-  }
-  
+
       // 鏌ヨ鏁版嵁搴�
       // 鎺ㄩ�佸埌鍓嶇
 
-    
     }
   }
 
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 5cdb6fa..20a2049 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
@@ -3,12 +3,15 @@
 import cn.hutool.json.JSONObject;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+
 import com.example.springboot.service.*;
 
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 
 import com.example.springboot.entity.Flowcard;
+import com.example.springboot.entity.Glass;
 import com.example.springboot.entity.GlassInfo;
 import com.example.springboot.entity.MeasureSetting;
 import com.example.springboot.entity.Out_slice;
@@ -77,7 +80,7 @@
                 storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
                 glassInfoMapper = WebSocketServer.applicationContext.getBean(GlassInfoMapper.class);
                 // 鑾峰彇鍏惰溅鐨勪綅缃�
-                if (S7control.getinstance().CheckConnected() == true&&false) {
+                if (S7control.getinstance().CheckConnected() == true && false) {
                     double carposition = 0;
                     float car = S7control.getinstance().readFloat32("DB10.1992");
                     carposition = (-40 + (car / (carend - carstart) * 595));
@@ -117,8 +120,8 @@
                 // 鏄惁闇�瑕佷汉宸ョ‘璁や笂鐗囩幓鐠�
                 jsonObject.append("isConfirm", isConfirm);
                 // 鏌ヨ褰撳墠閾濇淇℃伅
-                Out_slice CurrentFrame = outSliceServive.SelectCurrentFrame();
-                jsonObject.append("CurrentFrame", CurrentFrame);
+                // Out_slice CurrentFrame = outSliceServive.SelectCurrentFrame();
+                // jsonObject.append("CurrentFrame", CurrentFrame);
 
                 // 璇诲彇DB105鍖烘枃浠�
                 PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
@@ -132,40 +135,41 @@
                 // String MesSend = "0";
                 // double width = 727;
                 // double height = 414;
-              
-                //鍖归厤
-            //    System.err.println(PlcRequest+","+MesSend+","+width+","+height);
-                if (plcmes.getPlcParameter("GaToMES").getValue() != null) {
-                String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 璇锋眰
-                String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 鍙戦��
-                double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());//
-               // 瀹�
-                double height =Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 楂�
-                if ("0".equals(PlcRequest) && istest) {
-                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
-                (short) 0);
-                }
-                // System.out.println("PlcRequest:" + PlcRequest+"MesSend:" + MesSend+"width:" + width+"height:" + height);
-               
-            
-                if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
-                boolean is = HomeService.Normal(width, height, "1");
-                if (is && istest) {
-                // 娴嬮噺鎴愬姛
-                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
 
-                } 
-                else if (istest) {
-                // 閲嶆柊娴嬮噺
-                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
-                (short) 4);
-                }
-                }
+                // 鍖归厤
+                // System.err.println(PlcRequest+","+MesSend+","+width+","+height);
+                if (plcmes.getPlcParameter("GaToMES").getValue() != null) {
+                    String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 璇锋眰
+                    String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 鍙戦��
+                    double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());//
+                    // 瀹�
+                    double height = Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 楂�
+                    if ("0".equals(PlcRequest) && istest) {
+                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                                (short) 0);
+                    }
+                    // System.out.println("PlcRequest:" + PlcRequest+"MesSend:" + MesSend+"width:" +
+                    // width+"height:" + height);
+
+                    if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
+                        boolean is = HomeService.Normal(width, height, "1");
+                        if (is && istest) {
+                            // 娴嬮噺鎴愬姛
+                            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                                    (short) 1);
+
+                        } else if (istest) {
+                            // 閲嶆柊娴嬮噺
+                            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                                    (short) 4);
+
+                        }
+                    }
                 }
 
                 // S7control.getinstance().WriteWord("DB14.170", (short)0);
 
-                // 姝e湪涓婄墖璁㈠崟涓殑鎵�鏈夊皬鐗囦俊鎭�   
+                // 姝e湪涓婄墖璁㈠崟涓殑鎵�鏈夊皬鐗囦俊鎭�
                 List<GlassInfo> glassInfoFlowCard = glassInfoMapper.selectOrderState(1);
                 jsonObject.append("glassInfoFlowCard", glassInfoFlowCard);
 
@@ -201,6 +205,16 @@
                 List<StorageTask> StoragTaskeTaskOut = storageCageService.SelectStorageTask(1);
                 jsonObject.append("StoragTaskeTaskOut", StoragTaskeTaskOut);
 
+                // 鏌ヨ鎵�鏈夌幓鐠冨帤搴﹀拰鑶滅郴
+                List<GlassInfo> SelectMeasure = storageCageService.SelectMeasure();
+                jsonObject.append("SelectMeasure", SelectMeasure);
+                // 鏌ヨ褰撳墠鑶滅郴鍘氬害
+                MeasureSetting SelectSetting = storageCageService.SelectSetting();
+                jsonObject.append("SelectSetting", SelectSetting);
+                // 鏌ヨ鐜板湪鐨勭幓鐠冨帤搴﹀拰鑶滅郴
+                Map StorageCageForm = storageCageService.StorageCageForm();
+                jsonObject.append("StorageCageForm", StorageCageForm);
+
                 // //鏌ヨ褰撳墠璁㈠崟浠诲姟
                 List<Flowcard> OrderTask = storageCageService.SelectOrderTask();
                 jsonObject.append("OrderTask", OrderTask);
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 3cb75d4..9f6a8d9 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
@@ -62,22 +62,20 @@
   private JdbcConnections jdbcConnections;
 
   @GetMapping("/WriteWord")
-  public Result WriteWord(String address,float value,String type)  {
-    
-    if("0".equals(type)){
-      System.err.println("鍐欏叆word"+address+"+"+value);
-      S7control.getinstance().WriteWord(address, (short)value);
-      
-    }
-    else if("3".equals(type)){
-      System.err.println("鍐欏叆time"+address+"+"+value);
-      S7control.getinstance().writetime(address, (long)value);
-    }
-    else{
-      System.err.println("鍐欏叆float"+address+"+"+value);
+  public Result WriteWord(String address, float value, String type) {
+
+    if ("0".equals(type)) {
+      System.err.println("鍐欏叆word" + address + "+" + value);
+      S7control.getinstance().WriteWord(address, (short) value);
+
+    } else if ("3".equals(type)) {
+      System.err.println("鍐欏叆time" + address + "+" + value);
+      S7control.getinstance().writetime(address, (long) value);
+    } else {
+      System.err.println("鍐欏叆float" + address + "+" + value);
       S7control.getinstance().writeFloat32(address, value);
     }
-    
+
     Map<String, Object> map = new HashMap<>();
     map.put("message", "200");
     return Result.success(map);
@@ -85,16 +83,16 @@
 
   // 鍐欏叆bit
   @GetMapping("/WriteBit")
-  public Result WriteBit(String address,short value)  {
-    
+  public Result WriteBit(String address, short value) {
+
     boolean values;
     if (value == 0) {
-      values=false;
-    }else{
-      values=true;
+      values = false;
+    } else {
+      values = true;
     }
     S7control.getinstance().WriteBit(address, values);
-    System.err.println("鍐欏叆bit"+address+"+"+values);
+    System.err.println("鍐欏叆bit" + address + "+" + values);
     Map<String, Object> map = new HashMap<>();
     map.put("message", "200");
     return Result.success(map);
@@ -159,6 +157,7 @@
       map.put("message2", "500");
     } else {
       // 璋冪敤浼嶄笂鐗囧嚱鏁�
+      System.out.println("璋冪敤涓婄墖鍑芥暟");
       short results = spianService.selectAll(glassid);
       if (results == 200) {
         map.put("message2", "200");
@@ -321,7 +320,7 @@
   @PostMapping("/InsertQueueGlassId")
   public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
     return storageCageService.InsertQueueGlassId(id, queue);
-    
+
   }
 
   // 纭鎵爜浣嶇幓鐠冧俊鎭�
@@ -416,6 +415,7 @@
     map.put("message", "200");
     return Result.success(map);
   }
+
   // 鎵嬪姩瀹屾垚浠诲姟
   @PostMapping("/CompleteQueue")
   public Result CompleteQueue(String id, String frameid, String glassid) {
@@ -493,69 +493,82 @@
 
   // 鍒囨崲PLC鑾峰彇浜岀淮鐮佹柟寮�
   @PostMapping("/UpdateStroageCageByCell")
-  public Result UpdateStroageCageByCell(Integer cell,Integer num) {
-    return storageCageService.UpdateStroageCageByCell(cell,num);
+  public Result UpdateStroageCageByCell(Integer cell, Integer num) {
+    return storageCageService.UpdateStroageCageByCell(cell, num);
   }
 
-  //鎵嬪姩瀹屾垚浠诲姟
+  // 鎵嬪姩瀹屾垚浠诲姟
   @PostMapping("/FinishTask")
   public Result FinishTask(Integer id) {
-    return storageCageService.FinishTask(id);
+    return storageCageService.FinishTask();
   }
-  
-  //鏌ヨ鐜荤拑淇℃伅
+
+  // 鏌ヨ鐜荤拑淇℃伅
   @PostMapping("/SelectGlassInfo")
-  public Result SelectGlassInfo(String width,String height,String thickness,String films) {
-    return storageCageService.SelectGlassInfo(width,height,thickness,films);
+  public Result SelectGlassInfo(String width, String height, String thickness, String films) {
+    return storageCageService.SelectGlassInfo(width, height, thickness, films);
   }
 
-  //娣诲姞鐜荤拑淇℃伅鍒扮瀛�
+  // 娣诲姞鐜荤拑淇℃伅鍒扮瀛�
   @PostMapping("/StorageCageAddGlass")
-  public Result StorageCageAddGlass(String cell,@RequestBody GlassInfo glassInfo) {
-    return storageCageService.StorageCageAddGlass(cell,glassInfo);
+  public Result StorageCageAddGlass(String cell, @RequestBody GlassInfo glassInfo) {
+    return storageCageService.StorageCageAddGlass(cell, glassInfo);
   }
-  
-  //棰嗗彇/鏆傚仠浠诲姟
-  @PostMapping("/ClaimTasks")
-  public Result ClaimTasks(String flowcard,Integer state, Integer line) {
-    return storageCageService.ClaimTasks(flowcard,state,line);
-  }
-  
-  //淇敼鍑虹墖鏂瑰紡
-  @PostMapping("/ModeChange")
-  public Result ModeChange(String flowcard,Integer method) {
-    return storageCageService.ModeChange(flowcard,method);
-  }
-  
-   //娣诲姞鐜荤拑淇℃伅鍒版祴閲忎俊鎭�
-   @PostMapping("/UpdateQueue")
-   public Result UpdateQueue(@RequestBody GlassInfo glassInfo) {
-     return storageCageService.UpdateQueue(glassInfo);
-   }
-    //浜哄伐鎷胯蛋
-    @PostMapping("/ManualTake")
-    public Result ManualTake(@RequestBody String glassInfo) {
-      return storageCageService.ManualTake(glassInfo);
-    }
 
-    //寮�濮嬪伐绋�
-    @PostMapping("/StartChange")
-    public Result StartChange(String flowcard) {
-      return storageCageService.StartChange(flowcard);
-    }
-    //閲嶆柊娴嬮噺
-    @PostMapping("/AnewMeasure")
-    public Result AnewMeasure(@RequestBody String glassInfo) {
-      return storageCageService.AnewMeasure(glassInfo);
-    }
-   //瀵煎叆鏁版嵁 锛氭坊鍔犵幓鐠冧俊鎭�
-   @PostMapping("/importData")
-   public Result importData(@RequestBody List<Map> IportDataStr) { 
-     return storageCageService.AddGlassinfo(IportDataStr);
-   }
-    //鍒犻櫎璁㈠崟
-    @PostMapping("/deleteTasks")
-    public Result deleteTasks(@RequestBody String flowcard){ 
-      return storageCageService.deleteTasks(flowcard);
-    }
+  // 棰嗗彇/鏆傚仠浠诲姟
+  @PostMapping("/ClaimTasks")
+  public Result ClaimTasks(String flowcard, Integer state, Integer line) {
+    return storageCageService.ClaimTasks(flowcard, state, line);
+  }
+
+  // 淇敼鍑虹墖鏂瑰紡
+  @PostMapping("/ModeChange")
+  public Result ModeChange(String flowcard, Integer method) {
+    return storageCageService.ModeChange(flowcard, method);
+  }
+
+  // 娣诲姞鐜荤拑淇℃伅鍒版祴閲忎俊鎭�
+  @PostMapping("/UpdateQueue")
+  public Result UpdateQueue(@RequestBody GlassInfo glassInfo) {
+    return storageCageService.UpdateQueue(glassInfo);
+  }
+
+  // 浜哄伐鎷胯蛋
+  @PostMapping("/ManualTake")
+  public Result ManualTake(@RequestBody String glassInfo) {
+    return storageCageService.ManualTake(glassInfo);
+  }
+
+  // 寮�濮嬪伐绋�
+  @PostMapping("/StartChange")
+  public Result StartChange(String flowcard,int orderstate) {
+    return storageCageService.StartChange(flowcard,orderstate);
+  }
+
+  // 閲嶆柊娴嬮噺
+  @PostMapping("/AnewMeasure")
+  public Result AnewMeasure(@RequestBody String glassInfo) {
+    return storageCageService.AnewMeasure(glassInfo);
+  }
+
+  // 瀵煎叆鏁版嵁 锛氭坊鍔犵幓鐠冧俊鎭�
+  @PostMapping("/importData")
+  public Result importData(@RequestBody List<Map> IportDataStr) {
+    return storageCageService.AddGlassinfo(IportDataStr);
+  }
+
+  // 鍒犻櫎璁㈠崟
+  @PostMapping("/deleteTasks")
+  public Result deleteTasks(@RequestBody Map num) {
+    System.out.println("鎺у埗鍣�:" + num);
+    return storageCageService.deleteTasks(num);
+  }
+
+  // 淇濆瓨鑶滅郴璁剧疆
+  @PostMapping("/SaveMeasure")
+  public Result SaveMeasure(String films, Integer thickness) {
+    System.out.println("鎺у埗鍣�:" + films+thickness);
+    return storageCageService.SaveMeasure(films,thickness);
+  }
+
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java b/springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java
index 65b274c..ac3b5bb 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java
@@ -13,7 +13,7 @@
     private int glasstype;//绫诲瀷
     private int state;//鐘舵��
     private String time;//淇敼鏃堕棿
-
+    private int mateid;//閰嶇墖id
     public int getid() {
         return id;
     }
@@ -110,4 +110,12 @@
         this.time = time;
     }
 
+    public int getmateid() {
+        return mateid;
+    }
+
+    public void setmateid(int mateid) {
+        this.mateid = mateid;
+    }
+
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java b/springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java
index 628afd0..0434c03 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java
@@ -84,5 +84,9 @@
      * 鐜荤拑鏁伴噺
      */
     private Integer number;
+    /**
+     * 閰嶇墖ID
+     */
+    private Integer mateid;
 
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
index 4056b3d..a0f59c0 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
@@ -1,4 +1,6 @@
 package com.example.springboot.mapper;
+import java.util.List;
+
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
@@ -7,6 +9,7 @@
 import org.springframework.stereotype.Repository;
 import com.example.springboot.entity.GlassInfo;
 import com.example.springboot.entity.StorageCage;
+import com.example.springboot.entity.StorageTask;
 
 @Mapper
 @Repository
@@ -26,9 +29,12 @@
     //澧炲姞浠诲姟璁板綍
     @Insert("INSERT INTO `albania`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time,glass_id,glasstype,flowcard,mateid,tier) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now(),#{glassid},#{glasstype},#{flowcard},#{mateid},#{tier});")
     void Inserttask(int tasktype, int taskstate, int shelfrack, int loadrack, String glassid, int glasstype,String flowcard,int mateid,int tier);
+    //澧炲姞浠e彂浠诲姟璁板綍
+    @Insert("INSERT INTO `albania`.`out_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time,glass_id,glasstype,flowcard,mateid,tier) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now(),#{glassid},#{glasstype},#{flowcard},#{mateid},#{tier});")
+    void InsertOutTask(int tasktype, int taskstate, int shelfrack, int loadrack, String glassid, int glasstype,String flowcard,int mateid,int tier);
     //鏂板涓�鏉$瀛愭暟鎹�
-    @Update("UPDATE `albania`.`storage_cage` SET `glass_id` =#{glassid}, `width` =width-#{glasswidth}, `glasswidth` =#{glasswidth}, `glassheight` =#{glassheight}, `glasswidthmm` =#{glasswidth}, `glassheightmm` = #{glassheight},  `state` = #{state}, `glasstype` = #{glasstype}, `number` = #{number} WHERE `id` =#{id};")
-    void AddCage(int id,String glassid,Double glasswidth,Double glassheight,int state,int glasstype,int number);
+    @Update("UPDATE `albania`.`storage_cage` SET `glass_id` =#{glassid}, `width` =width-#{glasswidth}, `glasswidth` =#{glasswidth}, `glassheight` =#{glassheight}, `glasswidthmm` =#{glasswidth}, `glassheightmm` = #{glassheight},  `state` = #{state}, `glasstype` = #{glasstype}, `number` = #{number},thickness=#{thickness},films=#{films},flowcard=#{flowcard},mateid=#{mateid}  WHERE `id` =#{id};")
+    void AddCage(int id,String glassid,Double glasswidth,Double glassheight,int state,int glasstype,int number,Double thickness,String films,String flowcard,int mateid);
     //鑾峰彇杩涚墖鏁版嵁
     @Select("select glassid,flowcard,glasswidth as width,glassheight as height,glasswidthmm,glassheightmm,glasstype,thickness  from queue where state=1 limit 1")
     GlassInfo SelectGlass();
@@ -38,29 +44,40 @@
     //浜屽彿绾挎煡璇换鍔�
     @Select("select * from v_cagerelease2 where mateid not in(select mateid from v_cagerelease2 where surplus=0 group by mateid)LIMIT 1;")
     GlassInfo SelectOutGlass2();
+    //寰呭嚭鐗囦换鍔℃煡璇�
+    @Select("select * from out_task where task_state=0")
+    List<StorageTask> SelectOutTask();
     //娴佺▼鍗′换鍔℃煡璇�
-    @Select("select G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,ku.KuCount) as 'surplus',G.totaltier as id,G.width,G.glassid from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width,Ggf.glassid  from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=#{line}) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where flowcard is not null group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid)order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;")
+    @Select("select  G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,IFNULL(ku.KuCount,0)) as 'surplus',G.totaltier as id,G.width,G.glassid from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width,Ggf.glassid  from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=1) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where glasstype is not null and disabled=0 group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid) HAVING surplus>0  order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;")
     GlassInfo SelectOutGlass(int line);
+    // @Select("select SQL_NO_CACHE G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,ku.KuCount) as 'surplus',G.totaltier as id,G.width,G.glassid from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width,Ggf.glassid  from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=#{line}) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where flowcard is not null group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid)  HAVING surplus>0 order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;")
+    // GlassInfo SelectOutGlass(int line);
     //鑾峰彇璇ョ被鍨嬪湪搴撳瓨鐨勪綅缃�
     @Select("select * from storage_cage where glasstype=#{glasstype} and number>0 limit 1")
     StorageCage SelectCageGlass(int glasstype);
     //鍙戦�佸嚭鐗囧悗澧炲姞宸插彂鏁伴噺
-    @Update("update glassinfo set finishnumber=finishnumber+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{tier};")
+    @Update("update glassinfo set finishnumber=ifnull(finishnumber,0)+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{tier};")
     void AddFinishNumber(String flowcard,int mateid,int tier);
     //鑾峰彇褰撳墠浠诲姟鐨刬d
     @Select("select id from storage_task where task_state=0 and glass_id=#{glassid} ORDER BY id desc LIMIT 1")
     GlassInfo SelectTaskId(String glassid);
+    //鑾峰彇褰撳墠鏈畬鎴愪换鍔$殑鏁伴噺
+    @Select("select count(*) from storage_task where task_state=0")
+    int SelectTaskcount();
+    //鑾峰彇褰撳墠鏈畬鎴愪换鍔$殑鏁伴噺
+    @Select("select count(*) from out_task where task_state=0")
+    int SelectOutTaskCount();
     //鍒犻櫎娴嬮噺琛ㄧ殑淇℃伅
     @Delete("delete from queue where glassid=#{glassid}")
     int DeleteQueue(String glassid);
     //鍒ゆ柇鏄惁鏄洿鍑烘ā寮�
-    @Select("select method from flowcard where state=1 and line=#{line} ORDER BY starttime LIMIT 1;")
+    @Select("select method,flowcard from flowcard where state=1 and line=#{line} ORDER BY starttime LIMIT 1;")
     GlassInfo SelectMethod(int line);
     //鐩村嚭妯″紡浠诲姟鏌ヨ
-    @Select("select b.flowcard,b.glassid,b.glasstype,b.mateid,b.width,b.tier,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=1 and c.number>0 limit 1")
+    @Select("select  b.flowcard,b.glassid,b.glasstype,b.mateid,b.width,b.tier,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=1 and c.number>0 and b.finishnumber<b.number  ORDER BY b.finishnumber,b.tier asc limit 1")
     GlassInfo SelectOutGlass2(int line);
     //鏌ヨ鐩撮�氭ā寮忎笅鏈�鍚庝竴鍧�
-    @Select("select b.tier from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0 ORDER BY b.tier desc LIMIT 1")
+    @Select("select IFNULL(b.tier, 0) from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0 ORDER BY b.tier desc LIMIT 1")
     int SelectOutGlassend(int line);
     //澧炲姞绗煎瓙琛ㄥ楂�
     @Select("update storage_cage a set a.glasswidth=#{width},a.glassheight=#{height} where id=#{id} ")
@@ -68,6 +85,25 @@
     //鏇存敼闃熷垪琛ㄧ姸鎬�
     @Update("update queue set state=2 where glassid=#{glassid};")
     void UpdateQueueState(String glassid);
-
-
+     //鏇存敼闃熷垪琛ㄧ姸鎬�
+     @Select("select*from glassinfo  where glasstype=#{glasstype} limit 1;")
+     GlassInfo SelectGlassinfo(Integer glasstype);
+    //鏌ヨ绾厤鐗囨ā寮忓彲鍑洪厤鐗噄d
+    @Select("select gls.flowcard,gls.mateid,gls.tier,gls.glasstype,kc.number from glassinfo as gls left join (select glasstype,sum(number) as number from storage_cage where number>0 and disabled=0 GROUP BY glasstype)as kc on gls.glasstype=kc.glasstype where gls.flowcard=#{flowcard} and gls.number>gls.finishnumber and kc.number>0 GROUP BY gls.flowcard, gls.mateid, gls.tier, gls.glasstype, kc.number,mateid  order by gls.mateid;")
+    List<GlassInfo> SelectOutGlass3(String flowcard);
+    //鍒ゆ柇姝ら厤鐗噄d鏄惁鏈夎冻澶熺殑鐜荤拑
+    @Select("SELECT  CASE WHEN storage.number >= required.number THEN '瓒冲' ELSE '涓嶈冻' END AS status FROM (SELECT a.glasstype, COUNT(a.glasstype) AS number FROM glassinfo a WHERE a.flowcard =#{flowcard} AND a.mateid =#{mateid} GROUP BY a.glasstype) AS required LEFT JOIN (SELECT a.glasstype, SUM(a.number) AS number FROM storage_cage a WHERE a.number > 0 and disabled=0 GROUP BY a.glasstype) AS storage ON required.glasstype = storage.glasstype;")
+    List<String> SelectOutGlass4(String flowcard,int mateid);
+    //鏌ヨ姝ら厤鐗噄d闇�瑕佺殑鐜荤拑绫诲瀷
+    @Select("select glasstype,width,sumtier from glassinfo where flowcard=#{flowcard} and mateid=#{mateid}")
+    List<GlassInfo> SelectOutGlass5(String flowcard,int mateid);
+    //鍒ゆ柇姝ょ粍鐜荤拑鏄惁鑳戒竴娆′笂杞�
+    @Select("select sum(width)+(sumtier-1)*300 as width,mateid from glassinfo where flowcard=#{flowcard} and mateid=#{mateid} GROUP BY mateid,sumtier")
+    GlassInfo SelectOutGlass6(String flowcard,int mateid);
+    //鏌ヨ姝ら厤鐗噄d鎵�闇�鐨勭被鍨�
+    @Select("select * from glassinfo where flowcard=#{flowcard} and mateid=#{mateid}")
+    List<GlassInfo> SelectOutGlass7(String flowcard,int mateid);
+    //鏌ヨ姝ら厤鐗噄d鏄惁鏈夊彲鍑虹墖鏁伴噺
+    @Select("SELECT  CASE WHEN number >finishnumber THEN '瓒冲' ELSE '涓嶈冻' END AS status FROM  glassinfo a WHERE a.flowcard =#{flowcard} AND a.mateid =#{mateid}")
+    List<String> SelectOutGlass8(String flowcard,int mateid);
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
index 44133dd..c974a6a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
@@ -13,13 +13,13 @@
 @Repository
 public interface GlassInfoMapper extends BaseMapper<GlassInfo> {
 
-    @Select("select gi.* from flowcard as fd LEFT JOIN glassinfo as gi on fd.flowcard=gi.flowcard where fd.orderstate=1 and gi.flowcard is not null and  gi.width<=#{maxwidth} and gi.width>=#{minwidth} and gi.height<=#{maxheight} and gi.height>=#{minheight} and gi.films>=#{Films} and gi.thickness>=#{Thickness}  and gi.measurenumber<gi.number")
+    @Select("select gi.* from flowcard as fd LEFT JOIN glassinfo as gi on fd.flowcard=gi.flowcard where fd.orderstate=1 and gi.flowcard is not null and  gi.width<=#{maxwidth} and gi.width>=#{minwidth} and gi.height<=#{maxheight} and gi.height>=#{minheight} and gi.films=#{Films} and gi.thickness>=#{Thickness}  and gi.measurenumber<gi.number")
     List<GlassInfo> selectGlassInfos(@Param("maxwidth") double maxwidth, @Param("minwidth") double minwidth, @Param("maxheight") double maxheight, @Param("minheight") double minheight,Integer Thickness,String Films);
 
     // @Select("SELECT COUNT(*) FROM role_permission WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
     // boolean checkExists(@Param("roleId") int roleId, @Param("permissionId") int permissionId);
 
-    @Select("SELECT g.* FROM flowcard as f left join glassinfo as g on f.flowcard=g.flowcard WHERE f.orderstate = #{orderstate}")
+    @Select("SELECT g.* FROM flowcard as f left join glassinfo as g on f.flowcard=g.flowcard WHERE f.orderstate = #{orderstate} and state!=2")
     List<GlassInfo> selectOrderState(@Param("orderstate") int orderstate);
 
     @Update("UPDATE glassinfo SET measurenumber = measurenumber+1 WHERE id = #{id}")
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 f95c880..018e422 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
@@ -5,6 +5,7 @@
 import com.example.springboot.entity.CarPosition;
 import com.example.springboot.entity.Flowcard;
 import com.example.springboot.entity.GlassInfo;
+import com.example.springboot.entity.MeasureSetting;
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.StorageTask;
 import com.example.springboot.entity.alarmmg;
@@ -238,7 +239,7 @@
   List<StorageCage> SelectStorageCageInfo();
 
   // 鍒犻櫎鏍煎瓙鍐呯幓鐠冧俊鎭�
-  @Update("update storage_cage set films=null,width=5000,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,thickness=null,glasstype=null,number=null where cell=#{cell}")
+  @Update("update storage_cage set films=null,width=4300,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,thickness=null,glasstype=null,number=null,glass_id=null,flowcard=null,mateid=null where cell=#{cell}")
   void DeleteStroageCageByCell(Integer cell);
 
   // 淇敼鏍煎瓙鐜荤拑鏁伴噺
@@ -246,7 +247,7 @@
   void updateStroageCageByCell(Integer cell, Integer num);
 
   // 璁$畻鏍煎瓙鍐呭墿浣欏搴�
-  @Update("update storage_cage set width=5000-if(glasswidth is null,0,glasswidth+300)*number where cell=#{cell}")
+  @Update("update storage_cage set width=4300-if(glasswidth is null,0,glasswidth+300)*number where cell=#{cell}")
   void UpdateStroageCageWidthByCell(Integer cell);
 
   // 鏍规嵁浠诲姟绫诲瀷鑾峰彇浠诲姟
@@ -254,8 +255,8 @@
   List<StorageTask> SelectStorageTask(int task_type);
 
   // 鏍规嵁id浠诲姟
-  @Select("select * from storage_task where id=#{id}")
-  StorageTask SelectStorageTaskById(int id);
+  @Select("select * from storage_task where task_state=0 ORDER BY id asc LIMIT 1")
+  StorageTask SelectStorageTaskById();  
 
   // 鏍规嵁鏍煎瓙鏌ヨ鐜荤拑淇℃伅
   @Select("select * from storage_cage where cell=#{cell}")
@@ -263,12 +264,15 @@
 
   // 鎵嬪姩瀹屾垚浠诲姟
   @Select("update storage_task set task_state=1 where id=#{id}")
-  void FinishTask(Integer id);
-
-  @Select("select gi.* from glassinfo gi inner join flowcard fc on gi.flowcard=fc.flowcard where fc.state!=2 and position(#{width} in gi.width) and position(#{height} in gi.height) and position(#{thickness} in gi.thickness) and position(#{films} in gi.films) group by gi.id")
+  void FinishTask(Integer id, int state);
+  //浜哄伐鍖归厤娴嬮噺鏌ヨ
+  @Select("select gi.* from glassinfo gi inner join flowcard fc on gi.flowcard=fc.flowcard where fc.state!=2 and fc.orderstate=1 and position(#{width} in gi.width) and position(#{height} in gi.height) and position(#{thickness} in gi.thickness) and position(#{films} in gi.films) group by gi.id")
   List<GlassInfo> SelectGlassInfo(String width, String height, String thickness, String films);
+  // @Select("select b.* from flowcard a left join glassinfo b on a.flowcard=b.flowcard INNER JOIN measuresetting c where a.orderstate=1 and a.state!=2 and b.width BETWEEN  #{width} - c.errorwidth AND #{width} + c.errorwidth and b.height BETWEEN  #{height} - c.errorheight AND #{height} + c.errorheight and b.films=#{films} and b.thickness=#{thickness}")
+  // List<GlassInfo> SelectGlassInfo(String width, String height, String thickness, String films);
 
-  @Update("update storage_cage set glasstype=#{glassInfo.glasstype},glasswidth=#{glassInfo.width},glassheight=#{glassInfo.height},thickness=#{glassInfo.thickness},films=#{glassInfo.films},number=0 where cell=#{cell}")
+
+  @Update("update storage_cage set glasstype=#{glassInfo.glasstype},mateid=#{glassInfo.mateid},glass_id=#{glassInfo.glassid},flowcard=#{glassInfo.flowcard},glasswidth=#{glassInfo.width},glassheight=#{glassInfo.height},thickness=#{glassInfo.thickness},films=#{glassInfo.films},number=0 where cell=#{cell}")
   void StorageCageAddGlass(String cell, GlassInfo glassInfo);
 
   @Select("select * from flowcard where state!=2")
@@ -276,7 +280,7 @@
 
   // @Select("select gi.*,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
   // List<GlassInfo> SelectOrderView(String flowcard);
-  @Select("select gi.id, gi.glasstype, gi.mateid, gi.glassid, gi.tier, gi.films, gi.width, gi.height, gi.thickness, gi.number, gi.finishnumber, gi.sumtier, gi.measurenumber,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
+  @Select("select gi.id, gi.glasstype, gi.mateid, gi.glassid, gi.tier, gi.films, gi.width, gi.height, gi.thickness, gi.number, gi.finishnumber, gi.sumtier, gi.measurenumber,sum(sc.number) as cageno,IFNULL(c.orderstate,0) as orderstate from  glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype left join flowcard c on gi.flowcard=c.flowcard where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
   List<GlassInfo> SelectOrderView(String flowcard);
 
 
@@ -293,15 +297,22 @@
   @Select("select orderstate from flowcard  where flowcard=#{flowcard} limit 1")
   int selectStartChange(String flowcard);
 
-  @Delete("DELETE from flowcard  where flowcard=#{flowcard}")
+  // @Delete("DELETE from flowcard  where flowcard=#{flowcard}")
+  // int deleteFlowcard(String flowcard);
+
+  // @Delete("DELETE from glassinfo  where flowcard=#{flowcard}")
+  // int deleteGlassinfo(String flowcard);
+  @Update("Update  flowcard set state=2, flowcard=CONCAT('宸插垹闄�', #{flowcard}),orderstate=0  where flowcard=#{flowcard}")
   int deleteFlowcard(String flowcard);
 
-  @Delete("DELETE from glassinfo  where flowcard=#{flowcard}")
+  @Update("Update  glassinfo set flowcard=CONCAT('宸插垹闄�', #{flowcard}) where flowcard=#{flowcard}")
   int deleteGlassinfo(String flowcard);
 
-  @Update("update queue set glassid=concat(#{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},state=1 where state<=0")
-  void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier);
-
+  @Update("update queue set glassid=concat(#{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},mateid=#{mateid},state=1 where state<=0")
+  void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier,int mateid);
+  //浜哄伐鍖归厤鏂板涓�鏉�
+  @Insert("INSERT INTO queue (flowcard,glassid,glasswidth,glassheight,glasstype,thickness,mateid,state) VALUES (#{flowcard},concat(#{flowcard},'-',#{tier}),#{width},#{height},#{glasstype},#{thickness},#{mateid},1)")
+  int AddQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier,int mateid); 
   @Update("update glassinfo set finishnumber=ifnull(finishnumber,0)+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{geTier}")
   void AddGlassNo(String flowcard, Integer mateid, Integer geTier);
 
@@ -316,8 +327,17 @@
   @Select("select max(glasstype)+1 from glassinfo")
   Integer SelectMaxType();
     // 鏈�澶х幓鐠冪被鍨�
-    @Select("select glasstype from glassinfo where CONCAT(width,'_',height,'_',thickness,'_',films)=#{key} limit 1")
+    @Select("select glasstype from glassinfo where CONCAT(width,'_',height,'_',thickness,'_',films,'_',flowcard)=#{key} limit 1")
     Integer SelectMaxTypes(String key);
+
+    //鏌ヨ鎵�鏈夌幓鐠冭啘绯诲拰鍘氬害
+  @Select("select films,thickness from glassinfo GROUP BY films,thickness")
+  List<GlassInfo> SelectMeasure();
+  @Select("select*from measuresetting")
+  MeasureSetting SelectMeasureSetting();
+  //鏌ヨ褰撳墠娴嬮噺瀹介珮鍜岃啘绯诲帤搴�
+  @Select("select ifnull(a.glasswidthmm,0) as glasswidthmm,ifnull(a.glassheightmm,0) as glassheightmm,ifnull(b.films,'') as films,ifnull(b.thickness,0) as thickness from queue a INNER JOIN measuresetting b where state!=2 ORDER BY a.id asc LIMIT 1")
+  Map SelectMeasureWidthHeight();
 
   // 鏌ヨ鍏ㄩ儴鐜荤拑绫诲瀷
   @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films,glasstype")
@@ -336,9 +356,12 @@
                     +" select #{flowcard}, 0, #{number}, 0, 0, 0, now() where 0=( select count(*) from flowcard where flowcard=#{flowcard});")
   void InsertFlowcard(String flowcard, Integer number);
 
-    @Delete("Delete from queue where glassid=#{glassId}")
+    @Delete("DELETE FROM queue WHERE id = (SELECT id FROM ( SELECT id FROM queue WHERE glassid = #{glassId} ORDER BY time ASC LIMIT 1) AS temp);")
     void DeletequeueByGlassid(String glassId);
 
     @Select("select count(*) from flowcard where line=#{line} and state=1 and flowcard!=#{flowcard}")
     int SelectTaskCount(String flowcard,Integer line);
+  //淇敼娴嬮噺璁惧畾鑶滅郴鍜屽帤搴�
+    @Update("UPDATE measuresetting SET `films` = #{films}, `thickness` = #{thickness} WHERE `id` = 1;")
+    int SaveMeasure(String films, Integer thickness);
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/QueueMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/QueueMapper.java
index bb8c179..e2a4826 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/QueueMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/QueueMapper.java
@@ -30,8 +30,8 @@
     // @Update("UPDATE role_permission SET state = #{state} WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
     // void updateState(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state);
 
-    @Insert("insert into queue (glassid,flowcard,listid,boxid,glasswidth,glassheight,glasswidthmm,glassheightmm,glasstype,state,time,thickness) "+
-                        "select id,flowcard,null,null,width,height,#{glasswidthmm},#{glassheightmm},glasstype,#{state},NOW(),thickness from glassinfo where id=#{glassid}")
+    @Insert("insert into queue (glassid,flowcard,listid,boxid,glasswidth,glassheight,glasswidthmm,glassheightmm,glasstype,state,time,thickness,mateid) "+
+                        "select id,flowcard,null,null,width,height,#{glasswidthmm},#{glassheightmm},glasstype,#{state},NOW(),thickness,mateid from glassinfo where id=#{glassid}")
     int insert(@Param("glassid") Integer glassid, @Param("glasswidthmm") double glasswidthmm, @Param("glassheightmm") double glassheightmm,@Param("state") int state);
     
     @Insert("insert into queue (glassid,flowcard,listid,boxid,glasswidth,glassheight,glasswidthmm,glassheightmm,glasstype,state,time) "+
@@ -41,4 +41,7 @@
     @Delete("delete from queue where state<=0")
     void DeleteErrorQueue();
 
+    @Delete("delete from queue where state<=3")
+    void DeleteQueue();
+
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
index 410ade6..9a4cc37 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
@@ -42,7 +42,7 @@
         List<GlassInfo> Results = new ArrayList<GlassInfo>();
         // 鑾峰彇鍖归厤璁剧疆
         MeasureSetting MeasureSetting = MeasureSettingMapper.SelectMeasureSetting(line);
-
+        System.out.println("鑾峰彇鍖归厤璁剧疆:"+MeasureSetting);
         if (height > 0 && width > 0 && MeasureSetting != null) {
             // 鏈夋晥鍙傛暟 璇锋眰=1 闀�/瀹�>0
             double maxheight = height + MeasureSetting.getErrorHeight();
@@ -53,6 +53,8 @@
             String Films = MeasureSetting.getFilms();
             // 鏌ヨ褰撳墠娴嬮噺鏁版嵁 
             List<GlassInfo> GlassInfos = GlassInfoMapper.selectGlassInfos(maxwidth, minwidth, maxheight, minheight,Thickness,Films);
+            System.out.println("鍘氬害"+Thickness+"鑶�"+Films);
+            System.out.println("GlassInfos鏁伴噺:"+GlassInfos.size());
             if(Thickness==0||Films==""){
                 System.out.println("鍘氬害"+Thickness+"鑶�"+Films);
                 return null;
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
index 64d54bb..f2a2366 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
@@ -1,4 +1,5 @@
 package com.example.springboot.service;
+
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
@@ -12,128 +13,193 @@
 import com.example.springboot.mapper.AlbaniaMapper;
 import com.google.common.primitives.Bytes;
 
-
 @Service
 public class SpianServiceNew {
     @Autowired
     private AlbaniaMapper albaniaMapper;
-     //璇诲彇DB105鍖烘枃浠�
-    private PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
-public Short selectAll(GlassInfo glassInfo) {
-    if(glassInfo==null){
-        //鏈夎繘鐗囪姹備絾鏄祴閲忓彴娌℃湁鐜荤拑
-        return 400;
-    }
-    
-    System.out.println(glassInfo+"鍒濆");
-    //瀹氫箟鍒濆瀛楁
-    StorageCage cage;
-    String glassid=glassInfo.getGlassid();
-    Double width=glassInfo.getWidth();
-    Double height=glassInfo.getHeight();
-    String flowcard=glassInfo.getFlowcard();
-    int glasstype=glassInfo.getGlasstype();
-    //鍒ゆ柇鏄惁鏈夊悓绫诲瀷鐨�
-    cage=albaniaMapper.SelectCage(glasstype,width, 300);
-     
-    //濡傛灉鏈夊悓绫诲瀷鏃剁洿鎺ュ鍔�
-    if(cage!=null){
-        //鍙戦�乸lc浠诲姟
-        Mestast(glassid, 1001, cage.getId(), 1,"MESID1",1);
-        System.out.println("浠诲姟鍙戦�佺幓鐠僫d:"+glassid+"璧峰浣嶇疆:"+1001+"鏍煎瓙鍙�:"+cage.getId()+"鍚姩:"+1);
-        
-    }else{ 
-         //鍒ゆ柇鐜荤拑鏄惁杩涘叆澶х墖绗�
-         if(glassInfo.getThickness()>=15){
-            cage=albaniaMapper.SelectNewCell(3,5);
-        }else{
-            cage=albaniaMapper.SelectNewCell(0,4);
-            
-            System.out.println(cage+"鐞嗙墖绗煎垽鏂�");
-        }
-        //褰撹繑鍥炵殑鏍煎瓙鍙蜂负绌烘椂,杩斿洖400绗煎瓙宸叉弧
-        if(cage!=null){
-            albaniaMapper.AddCage(cage.getId(), glassid,width, height, 1, glasstype, 0);
-            Mestast(glassid,1001,cage.getId(),1,"MESID1",1);
-            System.out.println("浠诲姟鍙戦�佺幓鐠僫d:"+glassid+"璧峰浣嶇疆:"+1001+"鏍煎瓙鍙�:"+cage.getId()+"鍚姩:"+1);
-            albaniaMapper.UpdateStorage(width,height,cage.getId());
-        }else{
-            return(400);
-        }
-    }
-    //澧炲姞浠诲姟璁板綍
-    albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid,glasstype, flowcard,0,0);
-    albaniaMapper.UpdateQueueState(glassid);
-    return(200);
+    @Autowired
+    private StorageCageService storageCageService;
+    // 璇诲彇DB105鍖烘枃浠�
+    private PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
 
-}
+    public Short selectAll(GlassInfo glassInfo) {
+        if (glassInfo == null) {
+            // 鏈夎繘鐗囪姹備絾鏄祴閲忓彴娌℃湁鐜荤拑
+            return 400;
+        }
 
-    //鍑虹墖
+        System.out.println(glassInfo + "鍒濆");
+        // 瀹氫箟鍒濆瀛楁
+        StorageCage cage;
+        String glassid = glassInfo.getGlassid();
+        Double width = glassInfo.getWidth();
+        Double height = glassInfo.getHeight();
+        String flowcard = glassInfo.getFlowcard();
+        Integer glasstype = glassInfo.getGlasstype();
+        Double thickness = glassInfo.getThickness();
+        GlassInfo glassfilms = albaniaMapper.SelectGlassinfo(glasstype);
+        // 鍒ゆ柇鏄惁鏈夊悓绫诲瀷鐨�
+        cage = albaniaMapper.SelectCage(glasstype, width, 300);
+        // 濡傛灉鏈夊悓绫诲瀷鏃剁洿鎺ュ鍔�
+        if (cage != null) {
+            // 鍙戦�乸lc浠诲姟
+            Mestast(glassid, 1001, cage.getId(), 1, "MESID1", 1);
+            System.out.println("浠诲姟鍙戦�佺幓鐠僫d:" + glassid + "璧峰浣嶇疆:" + 1001 + "鏍煎瓙鍙�:" + cage.getId() + "鍚姩:" + 1);
+
+        } else {
+            // 鍒ゆ柇鐜荤拑鏄惁杩涘叆澶х墖绗�
+            if (glassInfo.getThickness() >= 15) {
+                cage = albaniaMapper.SelectNewCell(3, 5);
+            } else {
+                cage = albaniaMapper.SelectNewCell(0, 4);
+
+                // System.out.println(cage + "鐞嗙墖绗煎垽鏂�");
+            }
+            // 褰撹繑鍥炵殑鏍煎瓙鍙蜂负绌烘椂,杩斿洖400绗煎瓙宸叉弧
+            if (cage != null) {
+                albaniaMapper.AddCage(cage.getId(), glassid, width, height, 1, glasstype, 0, thickness,
+                        glassfilms.getFilms(),glassfilms.getFlowcard(),glassfilms.getMateid());
+                Mestast(glassid, 1001, cage.getId(), 1, "MESID1", 1);
+                System.out.println("浠诲姟鍙戦�佺幓鐠僫d:" + glassid + "璧峰浣嶇疆:" + 1001 + "鏍煎瓙鍙�:" + cage.getId() + "鍚姩:" + 1);
+                albaniaMapper.UpdateStorage(width, height, cage.getId());
+            } else {
+                return (400);
+            }
+        }
+        // 澧炲姞浠诲姟璁板綍
+        albaniaMapper.Inserttask(0, 0, 1001, cage.getId(), glassid, glasstype, flowcard, glassfilms.getMateid(), 0);
+        albaniaMapper.UpdateQueueState(glassid);
+        return (200);
+
+    }
+    //琛ュ厖鍑虹墖
+    public Short mateOut() {
+        double carwidth = -300;
+        list<StorageTask> glassmate = albaniaMapper.SelectMateOut();
+        return (200);
+    }
+    // 鍑虹墖
     public Short selectout(int line) {
-        GlassInfo glassmate=new GlassInfo();
-        GlassInfo method=new GlassInfo();
-        StorageCage glass=new StorageCage();
-        int glassend=0;
-        method=albaniaMapper.SelectMethod(line);
-        if(method==null){
+        GlassInfo glassmate = new GlassInfo();
+        GlassInfo method = new GlassInfo();
+        StorageCage glass = new StorageCage();
+        int glassend = 0;
+        double carwidth = -300;
+        method = albaniaMapper.SelectMethod(line);
+        if (method == null) {
             return (400);
         }
-        double width=0;
-            for(int i=1;i<=7;i++){
-                //濡傛灉涓嶆槸鐩撮�氭ā寮忓彧鍑烘湁瀹屾暣閰嶇墖鐨勬祦绋嬪崱
-                if(method.getMethod()==0){
-                    glassmate= albaniaMapper.SelectOutGlass(1);
-                }else{
-                    //鐩撮�氭ā寮忔椂鎸夐『搴忕洿鍑�
-                    glassmate= albaniaMapper.SelectOutGlass2(1);
-                    //鑾峰彇鐩撮�氭ā寮忔渶鍚庝竴鍧�
-                    glassend=albaniaMapper.SelectOutGlassend(1);
-                }
-                System.err.println("method:"+method+"glassmate:"+glassmate);
-                System.err.println(line);
-                if(glassmate==null){ 
-                    //鏈鍙栦换鍔�
-                    System.out.println("鏈鍙栦换鍔�");
+        double width = 0;
+        for (int i = 1; i <= 7; i++) {
+            // 濡傛灉涓嶆槸鐩撮�氭ā寮忓彧鍑烘湁瀹屾暣閰嶇墖鐨勬祦绋嬪崱
+            if (method.getMethod() == 0) {
+                // glassmate= albaniaMapper.SelectOutGlass(1);
+                //鍒ゆ柇鏈夋暟閲忕殑閰嶇墖id
+                List<GlassInfo> peipianid = albaniaMapper.SelectOutGlass3(method.getFlowcard());
+                if (peipianid.size() == 0) {
+                    System.out.println("peipianid:"+peipianid);
                     return (400);
-                }else{
-                
-                glass= albaniaMapper.SelectCageGlass(glassmate.getGlasstype()); 
-                System.out.println("glassmate:"+glassmate+"glassend:"+glassend+"glass:"+glass);   
-                  if(glass!=null){  
-                    //鍙戦�佷换鍔′箣鍓嶅垽鏂溅涓婄殑鍓╀綑瀹藉害鏄惁澶т簬姝ょ幓鐠�
-                    width=width+glassmate.getWidth()+300;
-                    //澶т簬杞︿笂绌轰綑瀹藉害鏃舵彁鍓嶅彂閫佸嚭鐗囧惎鍔�
-                    if(width>5000){
-                        //鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
-                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)1);//鍑虹墖浠诲姟鍚姩
-                        return (200);//缁撴潫
-                      }
-                    //鍙戦�侀厤鐗囨暟鎹�
-                    Mestast(glass.getGlassId(), glass.getId(),40, 0,"MESID"+i,i);
-                    albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier());
-                    albaniaMapper.Inserttask(1, 0, glass.getId(), 2001, glassmate.getGlassid(), glassmate.getGlasstype(),glass.getFlowcard(),glassmate.getMateid(),glassmate.getTier());
-                      if(glassmate.getTier()==glassmate.getId()||glassmate.getTier()==glassend){//褰撻厤鐗囨暟閲忕瓑浜庢垚鍝佸皬鐗囨�荤墖鏁版椂
-                        //鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
-                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)1);//鍑虹墖浠诲姟鍚姩
-                        System.out.println("浠诲姟绫诲瀷:1,浠诲姟鐘舵��:0,璧峰:"+glass.getId()+",鐩爣"+"40");
-                        return (200);//缁撴潫
-                      }
-                     
-                      
-                    }else{
-                        return (400);//缁撴潫
+                } else {
+                    for (int j = 0; j < peipianid.size(); j++) {
+                        // 鍒ゆ柇閰嶇墖瀹藉害鏄惁澶熶笂澶ц溅
+                        // GlassInfo glasswidth = albaniaMapper.SelectOutGlass6(peipianid.get(j).getFlowcard(),peipianid.get(j).getMateid());
+                        // if (glasswidth.getWidth() <= 4300) {
+                            //鏄惁鏈夎冻澶熺殑搴撳瓨鏁伴噺
+                            List<String> peipiancage = albaniaMapper.SelectOutGlass4(peipianid.get(j).getFlowcard(),peipianid.get(j).getMateid());                              
+                            //鏄惁鏈夎冻澶熺殑鍙嚭鐗囨暟閲�
+                            List<String> peipiancage2 = albaniaMapper.SelectOutGlass8(peipianid.get(j).getFlowcard(),peipianid.get(j).getMateid()); 
+                            // System.out.println("peipiancage:"+peipiancage+peipianid.get(j).getMateid()); 
+                            // System.out.println("peipiancage2:"+peipiancage2);                                     
+                            if (!peipiancage.contains("涓嶈冻")&&!peipiancage2.contains("涓嶈冻")) {
+                                List<GlassInfo> chupian = albaniaMapper.SelectOutGlass7(peipianid.get(j).getFlowcard(),peipianid.get(j).getMateid());
+                                for (int k = 0; k < chupian.size(); k++) {
+                                      glass = albaniaMapper.SelectCageGlass(chupian.get(k).getGlasstype());
+                                      carwidth= carwidth+glass.getGlassWidth()+300;
+                                      if (carwidth<=4300) {
+                                          // 鍙戦�侀厤鐗囨暟鎹�
+                                    //   Mestast(chupian.get(k).getGlassid(), glass.getId(), 2001, 0, "MESID" + (k+1), k+1);                                    
+                                      albaniaMapper.AddFinishNumber(chupian.get(k).getFlowcard(), chupian.get(k).getMateid(), chupian.get(k).getTier());
+                                      storageCageService.UpdateStroageCageByCell(glass.getId(), -1);// 鐜荤拑鏁伴噺-1
+                                      albaniaMapper.Inserttask(1, 0, glass.getId(), 2001, chupian.get(k).getGlassid(),
+                                      chupian.get(k).getGlasstype(), chupian.get(k).getFlowcard(), chupian.get(k).getMateid(), chupian.get(k).getTier());
+                                      }else {
+                                        albaniaMapper.AddFinishNumber(chupian.get(k).getFlowcard(), chupian.get(k).getMateid(), chupian.get(k).getTier());
+                                        storageCageService.UpdateStroageCageByCell(glass.getId(), -1);// 鐜荤拑鏁伴噺-1
+                                        albaniaMapper.InsertOutTask(1, 0, glass.getId(), 2001, chupian.get(k).getGlassid(),
+                                        chupian.get(k).getGlasstype(), chupian.get(k).getFlowcard(), chupian.get(k).getMateid(), chupian.get(k).getTier());
+                                      }
+                                    
+                                }
+                                // 鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
+                                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 鍑虹墖浠诲姟鍚姩
+                                return (200);// 缁撴潫
+                            }
+                        // }
+                        //  else {
+                        //     continue;
+                        // }
                     }
-                    
-                
+                    System.out.println("鏈湁瀹屾暣閰嶇墖");
+                    return (400);
                 }
+
+            } else {
+                // 鐩撮�氭ā寮忔椂鎸夐『搴忕洿鍑�
+                glassmate= albaniaMapper.SelectOutGlass(1);
+                // glassmate = albaniaMapper.SelectOutGlass2(1);
+                // // 鑾峰彇鐩撮�氭ā寮忔渶鍚庝竴鍧�
+                // glassend = albaniaMapper.SelectOutGlassend(1);
+           
             }
-        return(200);// 缁撴潫
+            System.err.println("鍑虹墖:" + glassmate);
+            if (glassmate == null && i > 1) {
+                // 鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
+                S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 鍑虹墖浠诲姟鍚姩
+                System.out.println("鍑哄畬浠诲姟:1,浠诲姟鐘舵��:0,璧峰:" + glass.getId() + ",鐩爣" + "2001");
+                return (200);// 缁撴潫
+            }
+            if (glassmate == null) {
+                // 鏈鍙栦换鍔�
+                System.out.println("鏈鍙栦换鍔�:" + i);
+                return (400);
+            } else {
+                glass = albaniaMapper.SelectCageGlass(glassmate.getGlasstype());
+                System.out.println("glassmate:" + glassmate  + "glass:" + glass);
+                if (glass != null) {
+                    // 鍙戦�佷换鍔′箣鍓嶅垽鏂溅涓婄殑鍓╀綑瀹藉害鏄惁澶т簬姝ょ幓鐠�
+                    width = width + glassmate.getWidth() + 300;
+                    // 澶т簬杞︿笂绌轰綑瀹藉害鏃舵彁鍓嶅彂閫佸嚭鐗囧惎鍔�
+                    if (width > 4300) {
+                        // 鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
+                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 鍑虹墖浠诲姟鍚姩
+                        return (200);// 缁撴潫
+                    }
+                    // 鍙戦�侀厤鐗囨暟鎹�
+                    Mestast(glass.getGlassId(), glass.getId(), 2001, 0, "MESID" + i, i);
+                    albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier());
+                    storageCageService.UpdateStroageCageByCell(glass.getId(), -1);// 鐜荤拑鏁伴噺-1
+                    albaniaMapper.Inserttask(1, 0, glass.getId(), 2001, glassmate.getGlassid(),
+                    glassmate.getGlasstype(), glass.getFlowcard(), glassmate.getMateid(), glassmate.getTier());
+                    // if (glassmate.getTier() == glassmate.getId() || glassmate.getTier() == glassend|| method.getMethod() == 1) {// 褰撻厤鐗囨暟閲忕瓑浜庢垚鍝佸皬鐗囨�荤墖鏁版椂
+                    //     // 鏈閰嶇墖瀹屾垚鍙戦�佸惎鍔ㄥ懡浠�
+                    //     S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 1);// 鍑虹墖浠诲姟鍚姩
+                    //     System.out.println("浠诲姟绫诲瀷:1,浠诲姟鐘舵��:0,璧峰:" + glass.getId() + ",鐩爣" + "2001");
+                    //     return (200);// 缁撴潫
+                    // }
+
+                } else {
+                    return (400);// 缁撴潫
+                }
+
+            }
+        }
+        return (200);// 缁撴潫
     }
 
     // 娲惧彂浠诲姟鐜荤拑id
     public void outmesid(String glassid, String address) {
-      //璇诲彇DB105鍖烘枃浠�
-      PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
+        // 璇诲彇DB105鍖烘枃浠�
+        PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
         // System.out.println("outmesid:" + glassid);
         List<Byte> glassidlist = new ArrayList();
         char ds[] = glassid.toCharArray();
@@ -141,7 +207,7 @@
             glassidlist.add((byte) iditem);
         }
         byte[] bytes = Bytes.toArray(glassidlist);
-        //writeString
+        // writeString
         System.out.println("outmesidbytes:" + bytes.length);
         System.out.println(plcmes.getPlcParameter(address).getAddress());
         System.out.println();
@@ -158,7 +224,7 @@
                 writedstrIdOut.append((char) iditem);
             }
         }
-        return writedstrIdOut;  
+        return writedstrIdOut;
     }
 
     // char鏁扮粍杞寲鎴恇it鏁扮粍
@@ -180,22 +246,30 @@
         return listbool;
     }
 
-    //涓嬪彂鐞嗙墖浠诲姟
-    public void Mestast(String glassid,int MESToPLCStart1,int MESToPLCTarget1,int MESToPLC,String address,int i) {
-        S7control.getinstance().writeString(plcmes.getPlcParameter(address).getAddress(),glassid);//鐜荤拑id
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStart"+i).getAddress(), (short) MESToPLCStart1);//璧峰浣嶇疆
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget"+i).getAddress(), (short) MESToPLCTarget1);//鐩爣浣嶇疆
-        if(MESToPLC!=0){
-            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)MESToPLC);//mes鐞嗙墖浠诲姟绫诲瀷
-        }    
+    // 涓嬪彂鐞嗙墖浠诲姟
+    public void Mestast(String glassid, int MESToPLCStart1, int MESToPLCTarget1, int MESToPLC, String address, int i) {
+        // System.out.println("涓嬪彂鐞嗙墖浠诲姟鏁版嵁锛�");
+        // System.out.println("鐜荤拑 ID: " + glassid);
+        // System.out.println("璧峰浣嶇疆: " + MESToPLCStart1);
+        // System.out.println("鐩爣浣嶇疆: " + MESToPLCTarget1);
+        // System.out.println("浠诲姟绫诲瀷: " + MESToPLC);
+        // System.out.println("鍦板潃: " + address);
+        // System.out.println("绱㈠紩: " + i);
+        S7control.getinstance().writeString(plcmes.getPlcParameter(address).getAddress(), glassid);// 鐜荤拑id
+        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStart" + i).getAddress(),
+                (short) MESToPLCStart1);// 璧峰浣嶇疆
+        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCTarget" + i).getAddress(),
+                (short) MESToPLCTarget1);// 鐩爣浣嶇疆
+        if (MESToPLC != 0) {
+            S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) MESToPLC);// mes鐞嗙墖浠诲姟绫诲瀷
+        }
     }
-    
+
     // 鎵爜澧炲姞闃熷垪浠诲姟
     public boolean scan(String address) {
         List<Short> list = S7control.getinstance().ReadWord(address, 1);// 杩斿洖涓簍ure鏃朵负1
         boolean listbool = list.contains((short) 1);
         return listbool;
     }
-
 
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
index c83305f..401e8cf 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -16,10 +16,12 @@
 import com.example.springboot.component.S7control;
 import com.example.springboot.entity.Flowcard;
 import com.example.springboot.entity.GlassInfo;
+import com.example.springboot.entity.MeasureSetting;
 import com.example.springboot.entity.Queue;
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.StorageTask;
 import com.example.springboot.entity.device.PlcParameterObject;
+import com.example.springboot.mapper.AlbaniaMapper;
 import com.example.springboot.mapper.HomeMapper;
 import com.example.springboot.mapper.QueueMapper;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -37,6 +39,8 @@
 
     @Autowired
     private SpianService spianService;
+    @Autowired
+    private AlbaniaMapper albaniaMapper;
 
     public void EndTask(int types) {
         String A01glassid1 = spianService.queGlassid("DB103.128", 14).toString();
@@ -200,6 +204,7 @@
         } else {
             if (id == 1) {
                 // 璋冪敤浼嶅瓨鍌ㄨ繃绋�
+                System.out.println("璋冪敤涓婄墖鍑芥暟");
                 zhi = spianService.selectAll(queue.getglassId());
                 if (zhi == 200) {
                     homeMapper.InsertQueueGlassId(queue, id);
@@ -233,7 +238,7 @@
     // 鏌ヨ杩�/鍑虹墖浠诲姟
     public List<StorageTask> SelectStorageTask(int task_type) {
         List<StorageTask> storageTasks = new ArrayList<>();
-        String loadrack="0";
+        String loadrack = "0";
         if (task_type == 0) {
             storageTasks = homeMapper.SelectStorageTask(task_type);
         } else {
@@ -241,30 +246,85 @@
         }
         for (StorageTask storageTask : storageTasks) {
             if (task_type == 0) {
-                loadrack=storageTask.getLoadrack();
-            }else{
-                loadrack=storageTask.getShelfRack();
+                loadrack = storageTask.getLoadrack();
+            } else {
+                loadrack = storageTask.getShelfRack();
             }
             storageTask.setstorageCage(homeMapper.SelectStorageByCell(loadrack));
         }
         return storageTasks;
     }
 
+    // 鏌ヨ杩�/鍑虹墖浠诲姟
+    public List<GlassInfo> SelectMeasure() {
+        return homeMapper.SelectMeasure();
+    }
+     // 鏌ヨ褰撳墠鑶滅郴鍘氬害
+     public MeasureSetting SelectSetting() {
+        return homeMapper.SelectMeasureSetting();
+    }
+     // 鏌ヨ娴嬮噺瀹介珮鍘氳啘绯�
+     public Map StorageCageForm() {
+        return homeMapper.SelectMeasureWidthHeight();
+    }
+
+
     // 鎵嬪姩瀹屾垚浠诲姟
-    public Result FinishTask(Integer id) {
-        StorageTask storageTask = homeMapper.SelectStorageTaskById(id);// 鑾峰彇浠诲姟淇℃伅
-        homeMapper.FinishTask(storageTask.getId());// 瀹屾垚浠诲姟
-        if (storageTask.getTaskType().equals("0")) {
-            UpdateStroageCageByCell(Integer.parseInt(storageTask.getLoadrack()), 1);// 鐜荤拑鏁伴噺+1
-            homeMapper.DeletequeueByGlassid(storageTask.getGlassId());
-        } else {
-            StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getShelfRack());
-            if (storageCage.getNumber() > 1) {
-                UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), -1);// 鐜荤拑鏁伴噺-1
-            } else {
-                UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), 0);// 娓呴櫎鏍煎唴淇℃伅
+    public Result FinishTask() {
+        for (int i = 1; i < 7; i++) {
+            int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲�
+            System.out.println("浠诲姟鏁伴噺:"+taskcont);
+            if (taskcont == 0) {
+                break;
             }
-            homeMapper.AddGlassNo(storageTask.getFlowcard(), storageTask.getMateid(), storageTask.geTier());// 娣诲姞鍑虹墖瀹屾垚鏁伴噺
+            StorageTask storageTask = homeMapper.SelectStorageTaskById();// 鑾峰彇浠诲姟淇℃伅
+            if (storageTask.getTaskType().equals("0")) {
+                System.out.println("瀹屾垚杩涚墖浠诲姟:"+storageTask.getId());
+                homeMapper.FinishTask(storageTask.getId(), 1);// 瀹屾垚浠诲姟
+                UpdateStroageCageByCell(Integer.parseInt(storageTask.getLoadrack()), 1);// 鐜荤拑鏁伴噺+1
+                homeMapper.DeletequeueByGlassid(storageTask.getGlassId());
+            } else {
+                System.out.println("瀹屾垚鍑虹墖浠诲姟:"+storageTask.getId());
+                homeMapper.FinishTask(storageTask.getId(), 1);// 瀹屾垚浠诲姟
+                StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getShelfRack());
+                if (storageCage.getNumber()==null||storageCage.getNumber() ==0) {
+                    UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), 0);// 娓呴櫎鏍煎唴淇℃伅
+                }
+                // homeMapper.AddGlassNo(storageTask.getFlowcard(), storageTask.getMateid(), storageTask.geTier());// 娣诲姞鍑虹墖瀹屾垚鏁伴噺
+
+            }
+        }
+        Map<String, Object> map = new HashMap<>();
+        map.put("message", "200");
+        return Result.success(map);
+    }
+
+    // 鑷姩瀹屾垚浠诲姟
+    public Result LoseTask() {
+        for (int i = 1; i < 7; i++) {
+            int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲�
+            System.out.println("浠诲姟鏁伴噺:"+taskcont);
+            if (taskcont == 0) {
+                break;
+            }
+            StorageTask storageTask = homeMapper.SelectStorageTaskById();// 鑾峰彇浠诲姟淇℃伅
+            if (storageTask.getTaskType().equals("0")) {
+                System.out.println("瀹屾垚杩涚墖浠诲姟:"+storageTask.getId());
+                homeMapper.FinishTask(storageTask.getId(), 1);// 瀹屾垚浠诲姟
+                UpdateStroageCageByCell(Integer.parseInt(storageTask.getLoadrack()), 1);// 鐜荤拑鏁伴噺+1
+                homeMapper.DeletequeueByGlassid(storageTask.getGlassId());
+            } else {
+                System.out.println("瀹屾垚鍑虹墖浠诲姟:"+storageTask.getId());
+                homeMapper.FinishTask(storageTask.getId(), 1);// 瀹屾垚浠诲姟
+                StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getShelfRack());
+                if (storageCage.getNumber() > 1) {
+                    UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), -1);// 鐜荤拑鏁伴噺-1
+                } else {
+                    UpdateStroageCageByCell(Integer.parseInt(storageTask.getShelfRack()), 0);// 娓呴櫎鏍煎唴淇℃伅
+                }
+                homeMapper.AddGlassNo(storageTask.getFlowcard(), storageTask.getMateid(), storageTask.geTier());// 娣诲姞鍑虹墖瀹屾垚鏁伴噺
+
+            }
         }
         Map<String, Object> map = new HashMap<>();
         map.put("message", "200");
@@ -297,21 +357,21 @@
         return OrderTask;
     }
 
-    // 寮�濮嬩换鍔�
+    // 寮�濮嬪嚭鐗�
     public Result ClaimTasks(String flowcard, Integer state, Integer line) {
-        int count=homeMapper.SelectTaskCount(flowcard,line);
+        int count = homeMapper.SelectTaskCount(flowcard, line);
         Map<String, Object> map = new HashMap<>();
-        if(count==0){
+        if (count == 0) {
             if (state == 1) {
                 homeMapper.ClaimTasks(flowcard, 0, line);
             } else {
                 homeMapper.ClaimTasks(flowcard, 1, line);
             }
             map.put("message", "200");
-        }else{
+        } else {
             map.put("message", "300");
         }
-        
+
         return Result.success(map);
     }
 
@@ -329,8 +389,10 @@
 
     // 淇敼娴嬮噺淇℃伅
     public Result UpdateQueue(GlassInfo glassInfo) {
-        homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(),
-                glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier());
+        // 鍒犻櫎鏁版嵁
+        QueueMapper.DeleteQueue();
+        homeMapper.AddQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(),
+                glassInfo.getGlasstype(), glassInfo.getThickness(), glassInfo.getTier(),glassInfo.getMateid());
         Map<String, Object> map = new HashMap<>();
         PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 1);
@@ -357,20 +419,31 @@
         return Result.success(map);
     }
 
-    // 寮�濮嬪伐绋�
-    public Result StartChange(String flowcard) {
-        homeMapper.StartChange(flowcard, 1);
+    // 寮�濮嬩笂鐗�
+    public Result StartChange(String flowcard,int orderstate) {
+        homeMapper.StartChange(flowcard, orderstate);
         Map<String, Object> map = new HashMap<>();
-        int state=homeMapper.selectStartChange(flowcard);
+        int state = homeMapper.selectStartChange(flowcard);
         map.put("message", "200");
         return Result.success(map);
     }
-     // 鍒犻櫎宸ョ▼
-     public Result deleteTasks(String flowcard) {
-        int aa=homeMapper.deleteFlowcard(flowcard.trim());
+
+    // 鍒犻櫎宸ョ▼
+    public Result deleteTasks(Map num) {
+        String flowcard = (String) num.get("num");
+        int aa = homeMapper.deleteFlowcard(flowcard.trim());
         homeMapper.deleteGlassinfo(flowcard.trim());
+        System.out.println(flowcard);
         Map<String, Object> map = new HashMap<>();
-        map.put("message", aa);
+        map.put("message", flowcard.trim());
+        return Result.success(map);
+    }
+
+    // 淇濆瓨娴嬮噺璁剧疆
+    public Result SaveMeasure(String films, Integer thickness) {
+        int Measure = homeMapper.SaveMeasure(films, thickness);
+        Map<String, Object> map = new HashMap<>();
+        map.put("message", Measure);
         return Result.success(map);
     }
 
@@ -398,7 +471,7 @@
         Map<String, Integer> OrderFinishedProduct = new HashMap<String, Integer>(); // 寰楀埌澶勭悊瀹屽悗璁㈠崟鎴愬搧鎬绘暟閲�;
         // "order zong 0 1 10 2 10"
         List<Map> RemoveErrorData = IportDataStr.stream()
-                .filter(item -> (item.get("order") != null && item.get("glasstype") != null && item.get("tier") != null
+                .filter(item -> (item.get("order") != null && item.get("tier") != null
                         &&
                         item.get("films") != null && item.get("base") != null && item.get("height") != null
                         && item.get("thickness") != null && item.get("quantity") != null
@@ -437,22 +510,22 @@
         int count = 1;
         for (Map map : RemoveErrorData) {
             String key = map.get("base").toString() + "_" + map.get("height").toString() + "_"
-                    + map.get("thickness").toString() + "_" + map.get("films").toString();
- 
+                    + map.get("thickness").toString() + "_" + map.get("films").toString()+ "_" + map.get("order").toString();
+
             String tierkey = map.get("order").toString() + "_" + map.get("matching").toString();
 
             String value = TypeData.get(key);
             Integer glasstype;
-            System.out.println(key+":"+TypeData.get(key));
+            System.out.println(key + ":" + TypeData.get(key));
             if (TypeData.get(key) == null) {
 
                 glasstype = homeMapper.SelectMaxTypes(key);
-                if(glasstype==null){
-                glasstype = homeMapper.SelectMaxType();
-                 }
+                if (glasstype == null) {
+                    glasstype = homeMapper.SelectMaxType();
+                }
                 if (glasstype == null) {
                     glasstype = 1;
-                } 
+                }
             } else {
                 glasstype = Integer.valueOf(value);
             }

--
Gitblit v1.8.0