#
luxiaotao1123
2024-04-03 98db59ccb704eb44f535bbafe5694a83919e795b
#
3个文件已修改
1个文件已添加
29 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/websocket.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/websocket/MockScheduler.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx
@@ -105,6 +105,7 @@
            websocket = new WebSocketClient('/ws/map/websocket');
            websocket.connect();
            websocket.onMessage = Utils.updateMapStatusInRealTime;
            const handleResize = () => {
                setWindowSize({
zy-asrs-flow/src/pages/map/utils.js
@@ -582,4 +582,8 @@
export const generateLocNo = (row, bay, lev) => {
    return row + '-' + bay + '-' + lev;
}
export const updateMapStatusInRealTime = (data) => {
    console.log('map: ' + data);
}
zy-asrs-flow/src/pages/map/websocket.js
@@ -6,7 +6,7 @@
        this.url = WEBSOCKET_BASE_URL + path;
        this.webSocket = null;
        this.heartbeatInterval = null; // Store the interval ID
        this.heartbeatFrequency = 30000; // Heartbeat every 10 seconds
        this.heartbeatFrequency = 30000; // Heartbeat every 30 seconds
    }
    connect() {
@@ -24,7 +24,7 @@
        };
        this.webSocket.onmessage = (event) => {
            console.log('websocket message received:', event.data);
            // console.log('websocket message received:', event.data);
            this.onMessage(event.data);
        };
@@ -48,9 +48,8 @@
        }
    }
    // Override
    onMessage(data) {
        // 子类可能会重写这个方法来处理消息
        console.log('WebSocketClient: Message received:', data);
    }
    close() {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/websocket/MockScheduler.java
New file
@@ -0,0 +1,17 @@
package com.zy.asrs.wcs.core.map.websocket;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
 * Created by vincent on 4/3/2024
 */
@Component
public class MockScheduler {
    @Scheduled(cron = "0/1 * * * * ? ")
    public void mock() {
        MapWebSocket.broadcast("test data");
    }
}