wu
2024-07-22 20e2190ae2b1fb62d73446e7021b03909f8bd097
更改版图玻璃旋转角度
1个文件已修改
34 ■■■■ 已修改文件
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/PlcTemperingGlassTask.java
@@ -25,7 +25,7 @@
     * fixedDelay : 上一个调用结束后再次调用的延时
     */
    @Scheduled(fixedDelay = 2000)
    @Scheduled(fixedDelay = 1000)
    public void temperingGlassHome(){
        JSONObject jsonObject = new JSONObject();
        //正在等待进片的玻璃
@@ -34,12 +34,14 @@
        //获取整在炉中的两个版图id
        List<TemperingGlassInfo> layoutId = temperingAgoService.selectLayoutId();
        //进炉中的玻璃
        List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId());
        jsonObject.append("intoGlass", intoGlass);
        //进炉中的第二个版图
        if (layoutId.size() > 1) {
            List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId());
            jsonObject.append("intoGlass2", intoGlass2);
        if(!layoutId.isEmpty()) {
            List<TemperingGlassInfo> intoGlass = temperingAgoService.selectIntoGlass(layoutId.get(0).getTemperingLayoutId());
            jsonObject.append("intoGlass", intoGlass);
            //进炉中的第二个版图
            if (layoutId.size() > 1) {
                List<TemperingGlassInfo> intoGlass2 = temperingAgoService.selectIntoGlass(layoutId.get(1).getTemperingLayoutId());
                jsonObject.append("intoGlass2", intoGlass2);
            }
        }
        //出炉后的玻璃
        List<TemperingGlassInfo> outGlass = temperingAgoService.selectOutGlass();
@@ -60,5 +62,23 @@
            }
        }
    }
    @Scheduled(fixedDelay = 1000)
    public void temperingIsRun(){
        JSONObject jsonObject = new JSONObject();
        //正在进行的任务
        List<TemperingGlassInfo>temperingTaskType=temperingAgoService.selectTaskType();
        jsonObject.append("temperingTaskType", temperingTaskType);
        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("isRun");
        if (sendwServer != null) {
            for (WebSocketServer webserver : sendwServer) {
                if (webserver != null) {
                    webserver.sendMessage(jsonObject.toString());
                } else {
                    log.info("Home is closed");
                }
            }
        }
    }
}