From d0e719bd6bb8d2a840211d60efbb46b83d77455d Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期四, 21 九月 2023 09:51:54 +0800
Subject: [PATCH] 添加玻璃尺寸不在范围内的提示并不允许上片

---
 CanadaMes-ui/src/views/home/index.vue                                               |   89 +++++++++++++++--------------
 CanadaMes-ui/src/api/home.js                                                        |    8 ++
 springboot-vue3/src/main/java/com/example/springboot/entity/Glass.java              |    9 +++
 CanadaMes-ui/src/lang/locales/en-US.json                                            |    4 +
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java         |    1 
 springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java         |   16 +++--
 springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java |   11 +++
 CanadaMes-ui/src/lang/locales/zh-CN.json                                            |    3 
 8 files changed, 87 insertions(+), 54 deletions(-)

diff --git a/CanadaMes-ui/src/api/home.js b/CanadaMes-ui/src/api/home.js
index 20bf0fb..1c301d1 100644
--- a/CanadaMes-ui/src/api/home.js
+++ b/CanadaMes-ui/src/api/home.js
@@ -100,4 +100,10 @@
     })
 }
 
-
+export function SelectGlassByGlassID(glassid) {
+    return request({
+        url: '/home/SelectGlassByGlassID?glassid='+glassid,
+        method: 'get',
+        data :""
+    })
+}
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 467713e..1a0aeb4 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -274,11 +274,13 @@
   "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
   "prompt":"prompt",
   "Yes":"Yes",
+  
 
   "No":"No",
   "Please enter the password":"Please enter the password",
   "Password error":"Password error",
   "DataBase Connection failed":"DataBase Connection failed",
-  "Distribute parameters":"Distribute parameters"
+  "Distribute parameters":"Distribute parameters",
+  "The glass size is not within the range":"The glass size is not within the range"
 
 }
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 865e5ec..fe88319 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -283,6 +283,7 @@
   "Please enter the password":"璇疯緭鍏ュ瘑鐮�",
   "Password error":"瀵嗙爜閿欒",
   "DataBase Connection failed":"鏁版嵁搴撹繛鎺ュけ璐�",
-  "Distribute parameters":"涓嬪彂鍙傛暟"
+  "Distribute parameters":"涓嬪彂鍙傛暟",
+  "The glass size is not within the range":"鐜荤拑灏哄涓嶅湪鑼冨洿鍐�"
 
 }
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index cc2c24d..82c639a 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -302,22 +302,22 @@
         <el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')">
             <el-form :model="form" label-width="100px" style="padding-right: 30px">
                 <el-form-item :label="$t('order')">
-                    <el-input v-model="form.orderno" autocomplete="off" />
+                    <el-input v-model="form.orderId" autocomplete="off" />
+                </el-form-item>
+                <el-form-item :label="$t('glassid')">
+                    <el-input v-model="form.glassId" autocomplete="off" />
                 </el-form-item>
                 <el-form-item :label="$t('length')">
-                    <el-input v-model="form.length" autocomplete="off" />
+                    <el-input v-model="form.height" autocomplete="off" />
                 </el-form-item>
                 <el-form-item :label="$t('width')">
                     <el-input v-model="form.width" autocomplete="off" />
                 </el-form-item>
-                <el-form-item :label="$t('coating')">
-                    <el-input v-model="form.coating" autocomplete="off" />
-                </el-form-item>
             </el-form>
             <template #footer>
                 <span class="dialog-footer">
-                    <el-button @click="cancal()">{{ $t('cancal') }}</el-button>
                     <el-button @click="sbumitglassid()" type="primary">{{ $t('confirm') }}</el-button>
+                    <el-button @click="cancal()">{{ $t('cancal') }}</el-button>
                 </span>
             </template>
         </el-dialog>
@@ -332,8 +332,8 @@
             </el-form>
             <template #footer>
                 <span class="dialog-footer">
-                    <el-button @click="cancal1()">{{ $t('cancal') }}</el-button>
                     <el-button @click="getOrder();" type="primary">{{ $t('confirm') }}</el-button>
+                    <el-button @click="cancal1()">{{ $t('cancal') }}</el-button>
                 </span>
             </template>
         </el-dialog>
@@ -370,7 +370,7 @@
 </template>
 <script>
 
-import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword } from "../../api/home";
+import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword, SelectGlassByGlassID } from "../../api/home";
 
 
 import LanguageMixin from '../../lang/LanguageMixin'
@@ -386,10 +386,10 @@
             dialogFormVisible2: false,
             dialogFormVisible3: false,
             form: {
-                orderno: "NG2210210",
-                length: 800,
-                width: 1000,
-                coating: "red",
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
             },
             form1: {
                 order: "NG2210210",
@@ -454,8 +454,6 @@
                         this.car2 = 210 + 8.15 * Math.abs(obj.params[0][1] - this.carlist[1]['start']) / Math.abs(this.carlist[1]['end'] - this.carlist[1]['start']) * 100;
                         // this.car1 = 210 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
                         // this.car2 = 300 + 11.25 * (obj.params[0][1]-this.carlist[1]['start'])/(this.carlist[1]['end']-this.carlist[1]['start'])*100;
-                        console.log(obj.params[0][1], this.carlist[1]['start']);
-                        console.log(obj.params[0][0], this.carlist[0]['start']);
                     }
                     this.tableData = obj.tableData[0];
                     this.cagelist1 = obj.cagelist1[0];
@@ -464,7 +462,6 @@
                     this.cagelist4 = obj.cagelist4[0];
                     this.tasklist1 = obj.tasklist1[0];
                     this.tasklist2 = obj.tasklist2[0];
-                    console.log(this.cagelist4);
                     this.alarm = obj.alarmmg[0];
                     this.loadglassheight = obj.loadglassheight;
                     this.zhuangtai = obj.zhuangtai[0];
@@ -518,7 +515,6 @@
             });
             Loadcarlist().then(res => {
                 this.carlist = res.data.carlist;
-                console.log(this.carlist);
             });
             SelectPassword().then(res => {
                 this.password = res.data.password;
@@ -557,37 +553,41 @@
         //鎵嬪姩涓婄墖
         sbumitglassid() {
             if (this.form.order != "") {
-                if (this.zhuangtai == true) {
-                    Addglassid(this.glassid).then(res => {
-                        if (res.data.message2 == 200) {
-                            this.$message.success(this.$t('Operation successful'));
-                            this.cancal();
-                        } else if (res.data.message2 == 500) {
-                            this.$message.success(this.$t('There are currently tasks'));
-                        }
-                        else if (res.data.message2 == 300) {
-                            this.$message.success(this.$t('There is no such glass'));
-                        }
-                        else if (res.data.message2 == 400) {
-                            this.$message.success(this.$t('There is no such grid'));
-                        }
-                    });
+                if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
+                    this.$message.success(this.$t('The glass size is not within the range'));
                 } else {
-                    this.$message.success(this.$t('There are currently tasks'));
+                    if (this.zhuangtai == true) {
+                        Addglassid(this.glassid).then(res => {
+                            if (res.data.message2 == 200) {
+                                this.$message.success(this.$t('Operation successful'));
+                                this.cancal();
+                            } else if (res.data.message2 == 500) {
+                                this.$message.success(this.$t('There are currently tasks'));
+                            }
+                            else if (res.data.message2 == 300) {
+                                this.$message.success(this.$t('There is no such glass'));
+                            }
+                            else if (res.data.message2 == 400) {
+                                this.$message.success(this.$t('There is no such grid'));
+                            }
+                        });
+                    } else {
+                        this.$message.success(this.$t('There are currently tasks'));
+                    }
                 }
-
             }
         },
         showform() {
             if (this.glassid != "") {
-                this.form =
-                {
-                    orderno: "NG2210210",
-                    length: 800,
-                    width: 1000,
-                    coating: "red",
-                };
-                this.dialogFormVisible = true;
+                SelectGlassByGlassID(this.glassid).then(res => {
+                    if(res.data.form!=null){
+                        this.form = res.data.form;
+                        this.dialogFormVisible = true;
+                    }else{
+                        this.$message.success(this.$t('There is no such glass'));
+                    }
+                });
+                
             }
         },
         showform1() {
@@ -604,7 +604,12 @@
         },
         cancal() {
             this.dialogFormVisible = false;
-            this.form = {};
+            this.form = {
+                orderId: "",
+                glassId: "",
+                height: "",
+                width: ""
+            };
         },
         cancal1() {
             this.dialogFormVisible1 = false;
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 8a86901..34e8c89 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
@@ -5,7 +5,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.ibatis.javassist.tools.framedump;
 
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.alarmmg;
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 8279255..d0a2b5d 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
@@ -13,6 +13,7 @@
 import com.example.springboot.common.Result;
 import com.example.springboot.component.S7control;
 import com.example.springboot.entity.CarPosition;
+import com.example.springboot.entity.Glass;
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.alarmmg;
 
@@ -80,7 +81,7 @@
     @GetMapping("/Addglassid")
     public Result Addglassid(short glassid) {
         Map<String, Object> map = new HashMap<>();
-        short taskno = homeMapper.SelectOutTask();
+        short taskno = homeMapper.SelectInTask();
         if (taskno > 0) {
             map.put("message2", "500");
         } else {
@@ -173,5 +174,11 @@
         return Result.success(map);
     }
     
-    
+    @GetMapping("/SelectGlassByGlassID")
+    public Result SelectGlassByGlassID(String glassid) {
+        Glass Glass = homeMapper.SelectGlassByGlassID(glassid);
+        Map<String, Object> map = new HashMap<>();
+        map.put("form", Glass);
+        return Result.success(map);
+    }
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/Glass.java b/springboot-vue3/src/main/java/com/example/springboot/entity/Glass.java
index 9ab999d..7324151 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/Glass.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/Glass.java
@@ -4,6 +4,7 @@
     private Integer id;
     private Short orderId;
     private double glassWidth;
+    private double glassHeight;
     private Short glassId;
     
     
@@ -30,6 +31,14 @@
         return glassWidth;
     }
 
+    public void setHeight(double glassHeight) {
+        this.glassHeight = glassHeight;
+    }
+
+    public double getHeight() {
+        return glassHeight;
+    }
+
     public void setWidth(double glassWidth) {
         this.glassWidth = glassWidth;
     }
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 04cd455..2a2bae3 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
@@ -3,6 +3,7 @@
 import org.apache.ibatis.annotations.*;
 
 import com.example.springboot.entity.CarPosition;
+import com.example.springboot.entity.Glass;
 import com.example.springboot.entity.StorageCage;
 import com.example.springboot.entity.alarmmg;
 
@@ -14,19 +15,19 @@
   @Select("select cage,round(100-(21-sum(state))/21*100) as cell,21-sum(state) as state from (select cage,cell,max(state) as state from storage_cage group by cage,cell) as cages group by cage")
   List<StorageCage> selectAll();
 
-  // 鏌ヨ1-5绗煎唴灞傛牸瀛愮姸鎬�
+  // 鏌ヨ10-6绗煎唴灞傛牸瀛愮姸鎬�
   @Select("SELECT cage,state,ifnull(glasswidth/2750*2,0) as glasswidth from storage_cage where cage>5 and tier=2 order by cage desc,cell desc")
   List<StorageCage> selectRack1();
 
-  // 鏌ヨ6-10绗煎唴灞傛牸瀛愮姸鎬�
+  // 鏌ヨ5-1绗煎唴灞傛牸瀛愮姸鎬�
   @Select("SELECT cage,state,ifnull(glasswidth/2750*2,0) as glasswidth from storage_cage where cage<=5 and tier=2 order by cage desc,cell desc")
   List<StorageCage> selectRack2();
 
-  // 鏌ヨ1-5绗煎灞傛牸瀛愮姸鎬�
+  // 鏌ヨ10-6绗煎灞傛牸瀛愮姸鎬�
   @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width  from storage_cage where cage>5  group by cage,cell order by cage desc,cell desc")
   List<StorageCage> selectRack3();
 
-  // 鏌ヨ6-10绗煎灞傛牸瀛愮姸鎬�
+  // 鏌ヨ5-1绗煎灞傛牸瀛愮姸鎬�
   @Select("SELECT case when tier=1 then cage else 0 end as cage,case when tier=1 then state else 0 end as state,sum(case when tier=1 then glasswidth/2750*2 else 0 end) as glasswidth,sum(case when tier=2 then glasswidth/2750*2 else 0 end) as width  from storage_cage where cage<=5  group by cage,cell order by cage desc,cell desc")
   List<StorageCage> selectRack4();
 
@@ -47,8 +48,8 @@
   void updateOrder();
 
   // 鏌ヨ鏄惁瀛樺湪姝e湪涓婄墖鐨勪换鍔�
-  @Select("select count(*) from storage_task where task_state=0 and task_type=1")
-  short SelectOutTask();
+  @Select("select count(*) from storage_task where task_state=0 and task_type=0")
+  short SelectInTask();
 
   // 鎵嬪姩瀹屾垚浠诲姟
   @Update("update storage_task set task_state=1 where task_type=#{task_type} and task_state=0")
@@ -82,4 +83,7 @@
   @Select("select * from storage_cage where glass_id=#{glassid}")
   StorageCage SelectGlassInfo(Integer glassid);
 
+  @Select("select * from glass where glassid=#{glassid}")
+  Glass SelectGlassByGlassID(String glassid);
+
 }

--
Gitblit v1.8.0