From ae2a52a69dd83930c7c91a16b0c521c6349ccaf3 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 06 八月 2024 09:57:58 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes

---
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
index ff4e20c..0a371fb 100644
--- a/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
+++ b/hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java
@@ -43,7 +43,7 @@
      * fixedDelay : 涓婁竴涓皟鐢ㄧ粨鏉熷悗鍐嶆璋冪敤鐨勫欢鏃�
      */
 
-    @Scheduled(fixedDelay = 300)
+    @Scheduled(fixedDelay = 30000)
     public void plcLoadGlassTask() throws InterruptedException {
         try {
             //鑾峰彇鑱旀満鐘舵��
@@ -87,7 +87,7 @@
         }
     }
 
-    @Scheduled(fixedDelay = 300)
+    @Scheduled(fixedDelay = 30000)
     public void plcLoadGlassReport() {
         //鑾峰彇鏄惁鏈夋眹鎶�
         String loadStatus = plcParameterObject.getPlcParameter("PlcStatus").getValue();
@@ -120,10 +120,17 @@
         JSONObject jsonObject = new JSONObject();
         //姝e湪杩涜鐨勪换鍔�
         List<UpPattenUsage> upPattenUsages = upPattenUsageService.prioritylist();
-        jsonObject.append("prioritylist", upPattenUsages);
+        if(upPattenUsages!=null){
+            jsonObject.append("prioritylist", upPattenUsages);
+        }
+
         //宸ヤ綅淇℃伅
         List<UpWorkstation> upWorkstations = upWorkstationService.list();
         jsonObject.append("list", upWorkstations);
+        //鏄惁寮�濮嬪伐绋�
+        Engineering engineering = engineeringService.selectInitiate(1);
+        jsonObject.append("engineering", engineering);
+
         ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass");
         if (sendwServer != null) {
             for (WebSocketServer webserver : sendwServer) {
@@ -145,8 +152,8 @@
     public void loadGlassStatus() {
         JSONObject jsonObject = new JSONObject();
         //姝e湪杩涜鐨勪换鍔�
-        String inkageStatus = plcParameterObject.getPlcParameter("MesToPlc").getValue();
-        //String inkageStatus ="1";
+//        String inkageStatus =plcParameterObject.getPlcParameter("InkageStatus").getValue();
+        String inkageStatus ="1";
         jsonObject.append("InkageStatus", inkageStatus);
         ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass");
         if (sendwServer != null) {
@@ -159,6 +166,26 @@
             }
         }
     }
+    @Scheduled(fixedDelay = 1000)
+    public void loadGlassIsRun() {
+        JSONObject jsonObject = new JSONObject();
+        Engineering engineering = engineeringService.selectInitiate(1);
+        if (engineering != null){
+            jsonObject.append("engineering", engineering);
+        }else {
+            jsonObject.append("engineering", "0");
+        }
+        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlassIsRun");
+        if (sendwServer != null) {
+            for (WebSocketServer webserver : sendwServer) {
+                if (webserver != null) {
+                    webserver.sendMessage(jsonObject.toString());
+                } else {
+                    log.info("Home is closed");
+                }
+            }
+        }
+    }
 
     public void overTask(String loadStatus, int state) {
 

--
Gitblit v1.8.0