From 73263f94cf46a409b0d6fd329b1caa645422379b Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期五, 10 五月 2024 09:14:58 +0800
Subject: [PATCH] 添加日志

---
 springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java    |    2 
 springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java  |   10 ++--
 Albania_Mes-ui/src/views/home/index.vue                                           |    7 ++-
 springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java |    8 +++-
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java    |    1 
 springboot-vue3/effective-pom.xml                                                 |    2 
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java       |   44 +++++++++++-----------
 7 files changed, 40 insertions(+), 34 deletions(-)

diff --git a/Albania_Mes-ui/src/views/home/index.vue b/Albania_Mes-ui/src/views/home/index.vue
index d6c887c..3b2f716 100644
--- a/Albania_Mes-ui/src/views/home/index.vue
+++ b/Albania_Mes-ui/src/views/home/index.vue
@@ -306,6 +306,7 @@
 .cells {
     height: 100%;
 }
+
 </style>
 <template>
     <el-container>
@@ -477,12 +478,12 @@
             <div style="height: 780px;">
                 <!--鍔熻兘-->
                 <div>
-                    <el-button type="primary" @click="ManualMatching()" :disabled="SoftEmergencyStopState"
+                    <el-button type="primary" @click="ManualMatching()" :disabled="(this.LastQueue.state<=0)"
                         style="z-index: 999;">{{ $t('Manual matching') }}</el-button>
-                    <el-button type="primary" @click="ManualTake()" :disabled="SoftEmergencyStopState"
+                    <el-button type="primary" @click="ManualTake()" :disabled="(this.LastQueue.state<=0)"
                         style="z-index: 999;">{{
                 $t('Manual removal') }}</el-button>
-                    <el-button type="primary" @click="AnewMeasure()" :disabled="SoftEmergencyStopState"
+                    <el-button type="primary" @click="AnewMeasure()" :disabled="(this.LastQueue.state<=0)"
                         style="z-index: 999;">{{
                 $t('Remeasure') }}</el-button>
                 </div>
diff --git a/springboot-vue3/effective-pom.xml b/springboot-vue3/effective-pom.xml
index ad8b457..c17ab5b 100644
--- a/springboot-vue3/effective-pom.xml
+++ b/springboot-vue3/effective-pom.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- ====================================================================== -->
 <!--                                                                        -->
-<!-- Generated by Maven Help Plugin on 2024-03-19T08:09:38+08:00            -->
+<!-- Generated by Maven Help Plugin on 2024-04-15T08:30:30+08:00            -->
 <!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
 <!--                                                                        -->
 <!-- ====================================================================== -->
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 2232695..a716c1e 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
@@ -61,6 +61,7 @@
       }
     }
       //杩涚墖璇锋眰鏃�
+      
       GlassInfo glass=albaniaMapper.SelectGlass();
       if(PLCToMES!=null && glass!=null&&MESToPLC!=null){
       if(PLCToMES.equals("1")==true&&MESToPLC.equals("0")==true){        
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 3ac31c8..80a4483 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
@@ -133,29 +133,29 @@
 
                 // 鍖归厤
                 // 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);
-                    }
-                    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);
+                // 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);
+                //     }
+                //     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);
-                        }
-                    }
-                }
+                //         } else if (istest) {
+                //             // 閲嶆柊娴嬮噺
+                //             S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                //                     (short) 4);
+                //         }
+                //     }
+                // }
 
                 // S7control.getinstance().WriteWord("DB14.170", (short)0);
                 Queue LastQueue = QueueMapper.selectLastQueue();
diff --git a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
index 85c3f78..169ed38 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,12 +17,12 @@
         //
         System.out.println("鍚姩瀹屾垚");
 
-        new Plcalarm().start();
-        new PLCAutoMes().start();
-        new PlcHoldNew().start();
+        // new Plcalarm().start();
+        // new PLCAutoMes().start();
+        // new PlcHoldNew().start();
         new Plchome().start();
-        new PlcAlbaniaServo().start();
-        new Plcsign().start();
+        // new PlcAlbaniaServo().start();
+        // new Plcsign().start();
 
        
     }
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 07def32..e0d5bb0 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
@@ -15,7 +15,7 @@
     @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths}  and disabled=0 order by id limit 1")
     StorageCage SelectCage(int glasstype,Double width,int widths);
     //鍒ゆ柇绗煎唴娌℃湁鐜荤拑鐨勭┖鏍�
-    @Select("select id from storage_cage where number=0 and cage>#{cage} and cage<#{cage2} and disabled=0 order by id limit 1")
+    @Select("select id from storage_cage where (number is null or number=0) and cage>#{cage} and cage<#{cage2} and disabled=0 order by id limit 1")
     StorageCage SelectNewCell(int cage,int cage2);
     //澧炲姞鐜荤拑鏁�
     @Update("update storage_cage set number=number+1,width=width-glasswidth where id=#{id}")
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 d0d4082..8dc6562 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
@@ -24,6 +24,8 @@
         //鏈夎繘鐗囪姹備絾鏄祴閲忓彴娌℃湁鐜荤拑
         return 400;
     }
+    
+    System.out.println(glassInfo+"鍒濆");
     //瀹氫箟鍒濆瀛楁
     StorageCage cage;
     String glassid=glassInfo.getGlassid();
@@ -44,14 +46,16 @@
          if(glassInfo.getThickness()>=15){
             cage=albaniaMapper.SelectNewCell(3,5);
         }else{
-            cage=albaniaMapper.SelectNewCell(0,5);
+            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);
             albaniaMapper.UpdateStorage(width,height,cage.getId());
-            
+            System.out.println(cage+"浠诲姟鍙戦��");
         }else{
             return(400);
         }

--
Gitblit v1.8.0