春风项目四线(合箱线、总装线)
yyt
2024-05-28 1c703617885275090d69c697e82e61f4940c0bdc
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/service/impl/DaPassingStationCollectionServiceImpl.java
@@ -236,7 +236,23 @@
        }
    }
    public String sendMessage(String message) throws Exception{
//    public String sendMessage(String message) throws Exception{
//        Map<String,Object> map = new HashMap<>();
//
//        // 获取当前日期和时间
//        LocalDateTime nowDateTime = LocalDateTime.now();
//        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
//        System.out.println(dateTimeFormatter.format(nowDateTime));
//        map.put("server_time",dateTimeFormatter.format(nowDateTime));
//        map.put("server_code","200");
//
//        map.put("server_message",message);
//        JSONObject jsonObject =  new JSONObject(map);
//        WebSocketServer.sendAllMessage(jsonObject.toString());
//        return jsonObject.toString();
//    }
    public String sendMessage(String message,String userid) throws Exception{
        Map<String,Object> map = new HashMap<>();
        // 获取当前日期和时间
@@ -248,7 +264,7 @@
        map.put("server_message",message);
        JSONObject jsonObject =  new JSONObject(map);
        WebSocketServer.sendAllMessage(jsonObject.toString());
        WebSocketServer.sendInfo(jsonObject.toString(),userid);
        return jsonObject.toString();
    }
}