自动化立体仓库 - WMS系统
zhou zhou
2025-09-27 6ac88ce94925d290e579b787570d09d5854d864e
#websocket
2个文件已修改
17 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/webSocketConfig/LedWebsocket.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/webSocketConfig/LedWebsocket.java
@@ -17,6 +17,7 @@
import com.zy.common.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -46,6 +47,8 @@
    private OrderDetlService orderDetlService;
    @Autowired
    private RedisUtil redisUtil;
    @Value("${led.id}")
    private String ledId;
    @Scheduled(cron = "0/2 * * * * ? ")
    private void send() {
@@ -155,8 +158,8 @@
    @Scheduled(cron = "0/2 * * * * ? ")
    private void ErrorSend(){
        Map<String,Object> map=new HashMap<>();
        map.put("to","1002");
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 1002));
        map.put("to",ledId);
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId));
        if (basDevp == null ){
            return;
        }
@@ -166,7 +169,7 @@
            return;
        }
        map.put("message",Cools.add("type", "error").add("errMsg",basDevp.getDecDesc()));
        webSocketServer.onMessage(JSONObject.toJSONString(map),null,"1002");
        webSocketServer.onMessage(JSONObject.toJSONString(map),null,ledId);
        redisUtil.set(key,basDevp.getDecDesc(),15);
    }
@@ -174,8 +177,8 @@
    @Scheduled(cron = "0/2 * * * * ? ")
    private void TaskSend(){
        Map<String,Object> map=new HashMap<>();
        map.put("to","1002");
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 1002));
        map.put("to",ledId);
        BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", ledId));
        if (basDevp == null ){
            return;
        }
@@ -192,7 +195,7 @@
            }
        }
        map.put("message",Cools.add("type", "task").add("taskList",commandList));
        webSocketServer.onMessage(JSONObject.toJSONString(map),null,"1002");
        webSocketServer.onMessage(JSONObject.toJSONString(map),null,ledId);
        redisUtil.set(key,basDevp.getWrkNo(),15);
    }
src/main/resources/application.yml
@@ -66,7 +66,7 @@
  ip: 192.168.1.198
  url: wms
  port: 8081
  id: 1002
  id: 1001
#erp对接
erp: