From ca1ae93196be366e707647c42e3039512a2cf45f Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 12 十一月 2024 14:00:24 +0800
Subject: [PATCH] 字段显示,结束任务功能更新,界面调整,测量显示

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 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..dbf369f 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() {
 
@@ -32,7 +32,8 @@
       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,16 @@
         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();
+        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,12 +63,22 @@
           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姣妫�鏌ヤ竴娆�
@@ -79,14 +95,14 @@
         // 杩愰�佽溅璇锋眰鍜屾祴閲忓畬鎴愯姹�
         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.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true&&outtask == 0) {
             try {
               Thread.sleep(100); // 姣�100姣妫�鏌ヤ竴娆�
             } catch (InterruptedException e) {
               Thread.currentThread().interrupt(); // 澶勭悊绾跨▼涓柇
             }
-            System.out
-                .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
+            // System.out
+            //     .println("杩涚墖鐘舵��:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
             spianService.selectAll(glass);
           }
         }

--
Gitblit v1.8.0