From 300c187d293847c17bf18cefdfba8eb442367a34 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期二, 04 六月 2024 14:07:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 UI-Project/src/views/UnLoadGlass/loadmachinerack.vue                                            |    6 +--
 UI-Project/src/views/Caching/cachingun.vue                                                      |   34 ++++++++++++++--
 UI-Project/src/views/Slicecage/slicecage.vue                                                    |    5 +-
 UI-Project/src/views/StockBasicData/stockBasicData.vue                                          |    5 +-
 UI-Project/src/views/Returns/returns.vue                                                        |   14 +++---
 UI-Project/src/views/Identify/identify.vue                                                      |    4 +-
 UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue                                       |    5 +-
 UI-Project/src/views/Caching/cachingbefore.vue                                                  |    5 +-
 UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue                                       |    4 +-
 hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/job/PlcLoadGlassTask.java |   20 +++------
 UI-Project/src/utils/constants.js                                                               |    3 +
 11 files changed, 59 insertions(+), 46 deletions(-)

diff --git a/UI-Project/src/utils/constants.js b/UI-Project/src/utils/constants.js
index 381c503..67d36d2 100644
--- a/UI-Project/src/utils/constants.js
+++ b/UI-Project/src/utils/constants.js
@@ -1,2 +1,3 @@
 // export const WebSocketHost = "192.168.1.199";
-export const WebSocketHost = "10.153.19.150";
\ No newline at end of file
+export const WebSocketHost = "10.153.19.150";
+export const host = "88";
\ No newline at end of file
diff --git a/UI-Project/src/views/Caching/cachingbefore.vue b/UI-Project/src/views/Caching/cachingbefore.vue
index 739782d..0fa7fac 100644
--- a/UI-Project/src/views/Caching/cachingbefore.vue
+++ b/UI-Project/src/views/Caching/cachingbefore.vue
@@ -4,7 +4,7 @@
 import {useRouter} from "vue-router"
 const router = useRouter()
 const adda = ref(false)
-import { WebSocketHost } from '@/utils/constants'
+import { WebSocketHost ,host} from '@/utils/constants'
 
 import request from "@/utils/request"
 import { ref, onMounted , onBeforeUnmount} from "vue";
@@ -78,8 +78,7 @@
     console.error('鍙戠敓閿欒:', error);  
   }  
 };   
-const socketUrl = `ws://${WebSocketHost}:88/api/cacheGlass/api/talk/cacheGlass`;
-// const socketUrl = `ws://10.153.19.150:88/api/cacheGlass/api/talk/cacheGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
diff --git a/UI-Project/src/views/Caching/cachingun.vue b/UI-Project/src/views/Caching/cachingun.vue
index 8aed036..a22e37e 100644
--- a/UI-Project/src/views/Caching/cachingun.vue
+++ b/UI-Project/src/views/Caching/cachingun.vue
@@ -4,9 +4,10 @@
 import {useRouter} from "vue-router"
 const router = useRouter()
 const adda = ref(false)
- 
+import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
-import { ref, onMounted } from "vue";
+import { ref, onMounted , onBeforeUnmount} from "vue";
+import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
 // import { ref } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
 //  import LanguageMixin from './lang/LanguageMixin'
@@ -67,6 +68,32 @@
     console.error('鍙戠敓閿欒:', error);  
   }  
 };   
+
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+  // 鏇存柊 tableData 鐨勬暟鎹�
+  tableData.splice(0, tableData.length, ...data.params[0]);
+  // tableData.value = data.params[0]
+  // adjustedRects.value = data.EdgStorageCageinfos[0]
+  adjustedRects.value = data.params[0].map(rect => ({  
+            ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�  
+            width: rect.width * 0.5 ,
+            id: rect.id * 10,
+          })); 
+
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+  // fetchFlowCardId();
+  // fetchTableData(); // 鑾峰彇鏁版嵁
+  initializeWebSocket(socketUrl, handleMessage);
+});
+
+onBeforeUnmount(() => {
+  console.log("鍏抽棴浜�")
+  closeWebSocket();
+});
 </script>
  
 <template>
@@ -113,9 +140,6 @@
     >
     </div>
   </div>
-<!-- <div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -124px;margin-left: 480px;"></div>
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: -30px;margin-left: 850px;"></div>
-<div style="width: 100px;height: 10px;background-color: #409EFF;margin-top: 30px;margin-left: 695px;"></div> -->
 </div>
 </template>
  
diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index b68dcbc..5e69d9b 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -44,7 +44,7 @@
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { ref, onMounted, onBeforeUnmount } from 'vue';  
 import request from "@/utils/request"
-import { WebSocketHost } from '@/utils/constants'
+import { WebSocketHost ,host} from '@/utils/constants'
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
 const blind = ref(false)
 const olWidth = ref(); 
@@ -176,7 +176,7 @@
     }  
   });  
 }
-const socketUrl = `ws://${WebSocketHost}:88/api/cacheGlass/api/talk/cacheGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index 7f8942c..3888531 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -13,7 +13,7 @@
 const adda = ref(false)
 const flake = ref(false)
 const flakea = ref(false)
-import { WebSocketHost } from '@/utils/constants'
+import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
 const ida = ref(null); 
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -25,9 +25,9 @@
 const selectedValuea = ref('');  
 const selectedValueb = ref('');
 const selectedValuec = ref(''); 
-const upstatus = ref(''); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��  
+const upstatus = ref('涓婄墖鏈烘墜鍔ㄧ姸鎬侊細'); // 鍋囪杩欎釜鐢ㄤ簬鏄剧ず鑷姩/鎵嬪姩鐘舵��  
 const cuttingMachine = ref(''); // 鍋囪杩欎釜鐢ㄤ簬瀛樺偍鍚庣杩斿洖鐨勭姸鎬佸�硷紙0鎴�1锛�  
-const cuttingMachineStatusColor = ref(''); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊 
+const cuttingMachineStatusColor = ref('#911005'); // 鐢ㄤ簬鍔ㄦ�佽缃甶鏍囩鐨勮儗鏅壊 
 const inKageWord = ref(0); // 鐢ㄤ簬瀛樺偍瑕佷紶閫掔粰鎺ュ彛鐨刬nKageWord鍊� 
 const options = ref<any[]>([]); // 涓嬫媺閫夐」鍒楄〃  
 const selectOptions = ref<Array<any>>([]); // 涓嬫媺閫夐�夐」鏁扮粍  
@@ -102,7 +102,7 @@
 const titleSelectJsona = ref({
   processTypea: [],
 })
-const socketUrl = `ws://${WebSocketHost}:88/api/loadGlass/api/talk/loadGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
@@ -497,7 +497,7 @@
 
 
 
-const wsUrl = `ws://${WebSocketHost}:88/api/loadGlass/api/talk/loadGlass`;
+const wsUrl = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlass`;
 const ws = new WebSocket(wsUrl);  
 ws.onopen = () => {  
   console.log('WebSocket杩炴帴宸叉墦寮�');  
@@ -526,7 +526,7 @@
       const status = data.InkageStatus[0]; 
       cuttingMachine.value = status; 
       upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';
-      cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';  
+      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';  
       inKageWord.value = status === '1' ? 0 : 1;  
     } else {  
       // 澶勭悊閿欒鎯呭喌鎴栨棤鏁堟暟鎹�  
@@ -544,7 +544,7 @@
     if (response.code == 200) {  
       const status = response.data.status; 
       upstatus.value = status === '1' ? '涓婄墖鏈鸿仈鏈虹姸鎬侊細' : '涓婄墖鏈烘墜鍔ㄧ姸鎬侊細';  
-      cuttingMachineStatusColor.value = status === '1' ? '#911005' : 'green';  
+      cuttingMachineStatusColor.value = status === '1' ? 'green' : '#911005';  
       // 鏄剧ず鎴愬姛娑堟伅  
       ElMessage.success(response.message);  
     } else {  
diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index eccab95..e87bae7 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -3,8 +3,7 @@
 import {reactive} from "vue";
 import {useRouter} from "vue-router"
 const router = useRouter()
-import { WebSocketHost } from '@/utils/constants'
- 
+import { WebSocketHost ,host} from '@/utils/constants'
 import { ref, onMounted , onBeforeUnmount} from "vue";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
 import { ElMessage, ElMessageBox } from 'element-plus'
@@ -192,7 +191,7 @@
 }
  
 
-const socketUrl = `ws://${WebSocketHost}:88/api/cacheVerticalGlass/api/talk/slicecage`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
diff --git a/UI-Project/src/views/StockBasicData/stockBasicData.vue b/UI-Project/src/views/StockBasicData/stockBasicData.vue
index 5cddf28..01b0ddb 100644
--- a/UI-Project/src/views/StockBasicData/stockBasicData.vue
+++ b/UI-Project/src/views/StockBasicData/stockBasicData.vue
@@ -4,8 +4,7 @@
 import {useRouter} from "vue-router"
 const router = useRouter()
 const adda = ref(false)
-import { WebSocketHost } from '@/utils/constants'
-
+import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
 import { ref, onMounted , onBeforeUnmount} from "vue";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -95,7 +94,7 @@
   }  
 };   
 
-const socketUrl = `ws://${WebSocketHost}:88/api/cacheGlass/api/talk/cacheGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
diff --git a/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
index a0464cc..6d4df18 100644
--- a/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
+++ b/UI-Project/src/views/StockBasicData/stockBasicDatatwo.vue
@@ -4,8 +4,7 @@
 import {useRouter} from "vue-router"
 const router = useRouter()
 const adda = ref(false)
-import { WebSocketHost } from '@/utils/constants'
-
+import { WebSocketHost ,host} from '@/utils/constants'
 import request from "@/utils/request"
 import { ref, onMounted , onBeforeUnmount} from "vue";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
@@ -96,7 +95,7 @@
 };   
 
 
-const socketUrl = `ws://${WebSocketHost}:88/api/cacheGlass/api/talk/cacheGlass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
   // 鏇存柊 tableData 鐨勬暟鎹�
diff --git a/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue b/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
index 74bdcb8..4e16fae 100644
--- a/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
+++ b/UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
@@ -37,7 +37,7 @@
 import Swal from 'sweetalert2'
 import request from "@/utils/request";
 import { initializeWebSocket } from '@/utils/WebSocketService';
- import { WebSocketHost } from '@/utils/constants';
+import { WebSocketHost ,host} from '@/utils/constants'
 const racks = ref([
   { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
  
@@ -112,7 +112,7 @@
   }
 };
 
-const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass3`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass3`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
 
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index 9f5ce9c..fa23b1a 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -11,9 +11,7 @@
 import Landingindicationtwo from "./Landingindicationtwo.vue";
 import request from "@/utils/request";
 import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
- import { WebSocketHost } from '@/utils/constants';
-
-
+import { WebSocketHost ,host} from '@/utils/constants'
 const dialogFormVisiblea = ref(false)
 
 const dialogFormVisiblea2 = ref(false)
@@ -148,7 +146,7 @@
 };
 
 
-const socketUrl = `ws://${WebSocketHost}:88/api/unLoadGlass/api/talk/unloadglass`;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
 // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
 const handleMessage = (data) => {
 
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 3f979db..71351af 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
@@ -5,7 +5,6 @@
 import com.mes.device.PlcParameterObject;
 import com.mes.engineering.entity.Engineering;
 import com.mes.engineering.service.EngineeringService;
-import com.mes.pp.entity.OptimizeProject;
 import com.mes.pp.service.OptimizeProjectService;
 import com.mes.tools.WebSocketServer;
 import com.mes.uppattenusage.entity.UpPattenUsage;
@@ -130,11 +129,11 @@
             for (WebSocketServer webserver : sendwServer) {
                 if (webserver != null) {
                     webserver.sendMessage(jsonObject.toString());
-                    List<String> messages = webserver.getMessages();
-                    if (!messages.isEmpty()) {
-                        // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
-                        webserver.clearMessages();
-                    }
+//                    List<String> messages = webserver.getMessages();
+//                    if (!messages.isEmpty()) {
+//                        // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+//                        webserver.clearMessages();
+//                    }
                 } else {
                     log.info("Home is closed");
                 }
@@ -145,19 +144,14 @@
     public void loadGlassStatus(){
         JSONObject jsonObject = new JSONObject();
         //姝e湪杩涜鐨勪换鍔�
-        //String inkageStatus =plcParameterObject.getPlcParameter("MesToPlc").getValue();
-        String inkageStatus ="1";
+        String inkageStatus =plcParameterObject.getPlcParameter("MesToPlc").getValue();
+        //String inkageStatus ="1";
         jsonObject.append("InkageStatus", inkageStatus);
         ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("loadGlass");
         if (sendwServer != null) {
             for (WebSocketServer webserver : sendwServer) {
                 if (webserver != null) {
                     webserver.sendMessage(jsonObject.toString());
-                    List<String> messages = webserver.getMessages();
-                    if (!messages.isEmpty()) {
-                        // // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
-                        webserver.clearMessages();
-                    }
                 } else {
                     log.info("Home is closed");
                 }

--
Gitblit v1.8.0