From 28ded8102d83cf74bc232d1cdfc89b7f22c41952 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 03 十二月 2024 09:09:31 +0800
Subject: [PATCH] 增加点击防抖事件 增加笼子使用详情的计算优化。 增加数据推送时的报错处理 测量台交互逻辑增加 参数界面增加翻转加减速度

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java |   41 ++++++++++++++++++++++++++++-------------
 1 files changed, 28 insertions(+), 13 deletions(-)

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 8756fe9..8a11960 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
@@ -17,7 +17,7 @@
   private StorageCageService storageCageService;
   int aaa;
   String huibao = "";
-
+  String qidong = "";
   @Override
   public void run() {
 
@@ -28,11 +28,12 @@
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
-
       storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
       spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
       albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class);
-      spianService.selectout(1);
+  
+      // spianService.selectout(1);
+      // spianService.mateOut();
       // 璇诲彇DB14鍖烘枃浠�
       PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
       if (plcmes.getPlcParameter("PLCToMES").getValue() != null) {
@@ -42,11 +43,17 @@
         String IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴�
         String MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧
         String MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧
+        String GaToMES = plcmes.getPlcParameter("GaToMES").getValue();// 娴嬮噺鎴愬姛淇″彿
+        
         int taskcont = albaniaMapper.SelectTaskcount(); // 姝e湪杩涜鐨勪换鍔℃暟閲�
         int outtask = albaniaMapper.SelectOutTaskCount(); // 绛夊緟琛ュ彂鐨勫嚭鐗囦换鍔℃暟閲�
-        if(outtask>0){
-          spianService.mateOut();
+        if (ExportTOMES1 != null && MESToPLC != null && taskcont == 0) {
+          //褰撳彲浠ュ彂浠诲姟骞朵笖鍑虹墖闃熷垪鏈変换鍔℃椂
+          if (ExportTOMES1.equals("1") == true && MESToPLC.equals("0") == true && PLCToMES.equals("1") == true&&outtask>0 && MESToPLCStatus1.equals("0")) {
+             spianService.mateOut();
+          }
         }
+
         // String scan=plcmes.getPlcParameter("scan").getValue();//鍙戦�佹壂鐮佷俊鎭�
         // if(scan.equals("1")==true){
         // spianService.scan(scan);
@@ -57,15 +64,25 @@
           System.out.println("姹囨姤璁板綍:" + IDStatus1 + "鏃堕棿" + currentTime);
         }
         huibao = IDStatus1;
+        if (!qidong.equals(MESToPLC)) {
+          System.out.println("鍚姩璁板綍:" + MESToPLC + "鏃堕棿" + currentTime);
+        }
+        qidong = MESToPLC;
+
+        PLCToMES = plcmes.getPlcParameter("PLCToMES").getValue();// 杩愰�佽溅璇锋眰
+        IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1鍙蜂换鍔″畬鎴�
+        MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1鍙风‘璁ゅ瓧
+        MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 鍙戦�佷换鍔″瓧
+
         // 涓�鍙风嚎璇锋眰
         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);
+              && MESToPLCStatus1.equals("0") == true&&outtask == 0) {
+            // System.out
+            //     .println("鍑虹墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
             spianService.selectout(1);
             try {
-              Thread.sleep(200); // 姣�100姣妫�鏌ヤ竴娆�
+              Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆�
             } catch (InterruptedException e) {
               Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇
             }
@@ -78,15 +95,13 @@
         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) {
+        if (PLCToMES != null && glass != null && MESToPLC != null) {
+          if (PLCToMES.equals("1")&& MESToPLC.equals("0")&&("1".equals(GaToMES)||"2".equals(GaToMES))&& taskcont == 0) {
             try {
               Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆�
             } catch (InterruptedException e) {
               Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇
             }
-            System.out
-                .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
             spianService.selectAll(glass);
           }
         }

--
Gitblit v1.8.0