wu
2024-07-22 b6480bb8991e83a2efd5e4835ccc8ed0e87c067a
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -33,13 +33,14 @@
    private TemperingGlassInfoService temperingGlassInfoService;
    private JSONObject jsonObject = new JSONObject();
    public void hangzhoumes() throws InterruptedException {
    private JSONObject jsonObject1 = new JSONObject();
    public void queryDataSource1() throws InterruptedException {
        List<Double> carPostion=new ArrayList<>();
        carPostion.add(0.25);
        carPostion.add(0.5);
        jsonObject.append("carPostion",carPostion);
        //界面展示笼子信息
        jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail());
        jsonObject1.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail());
        //进片任务数据
        List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1);
@@ -58,7 +59,7 @@
    }
    public void salve_hangzhoumes_1() throws InterruptedException {
    public void queryDataSource2() throws InterruptedException {
        //出片队列
        List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list();
        jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
@@ -71,14 +72,19 @@
    @Scheduled(fixedDelay = 1000)
    public void plcStorageCageTask() throws InterruptedException {
        jsonObject = new JSONObject();
        jsonObject1 = new JSONObject();
        try {
            hangzhoumes();
            salve_hangzhoumes_1();
            //查询使用数据源1查询数据
            queryDataSource1();
            //查询使用数据源2查询数据
            queryDataSource2();
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
            if (sendwServer != null) {
                for (WebSocketServer webserver : sendwServer) {
                    if (webserver != null) {
                        webserver.sendMessage(jsonObject.toString());
                        webserver.sendMessage(jsonObject1.toString());
                        List<String> messages = webserver.getMessages();
                        if (!messages.isEmpty()) {
                            // // 将最后一个消息转换为整数类型的列表