wangfei
2024-07-05 81785a73765854e116243aafffc0e457221b3340
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/PlcSlicecage.java
@@ -32,44 +32,48 @@
    @Resource
    private TemperingGlassInfoService temperingGlassInfoService;
    private JSONObject jsonObject = new JSONObject();
    public void hangzhoumes() throws InterruptedException {
        List<Double> carPostion=new ArrayList<>();
        carPostion.add(0.25);
        carPostion.add(0.5);
        jsonObject.append("carPostion",carPostion);
        //界面展示笼子信息
        jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail());
        //进片任务数据
        List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1);
        jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask);
        //出片任务数据
        List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2);
        jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask);
        //理片笼使用情况
        List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage();
        jsonObject.append("bigStorageCageUsage", bigStorageCageUsage);
        //理片笼表格信息
        jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll());
    }
    public void salve_hangzhoumes_1() throws InterruptedException {
        //出片队列
        List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list();
        jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
    }
    /**
     * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成)
     * fixedDelay : 上一个调用结束后再次调用的延时
     */
    @Scheduled(fixedDelay = 1000)
    public void plcStorageCageTask() throws InterruptedException {
        JSONObject jsonObject = new JSONObject();
        jsonObject = new JSONObject();
        try {
            //界面展示笼子信息
            jsonObject.append("bigStorageCageInfo1", bigStorageCageService.querybigStorageCageDetail(1));
            jsonObject.append("bigStorageCageInfo2", bigStorageCageService.querybigStorageCageDetail(2));
            jsonObject.append("bigStorageCageInfo3", bigStorageCageService.querybigStorageCageDetail(3));
            jsonObject.append("bigStorageCageInfo4", bigStorageCageService.querybigStorageCageDetail(4));
            jsonObject.append("bigStorageCageInfo5", bigStorageCageService.querybigStorageCageDetail(5));
            jsonObject.append("bigStorageCageInfo6", bigStorageCageService.querybigStorageCageDetail(6));
            jsonObject.append("bigStorageCageInfo7", bigStorageCageService.querybigStorageCageDetail(7));
            jsonObject.append("bigStorageCageInfo8", bigStorageCageService.querybigStorageCageDetail(8));
            //进片任务数据
            List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1);
            jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask);
            //出片任务数据
            List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2);
            jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask);
            //理片笼使用情况
            List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage();
            jsonObject.append("bigStorageCageUsage", bigStorageCageUsage);
            //出片队列
            List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list();
            jsonObject.append("temperingGlassInfoList", temperingGlassInfoList);
            //理片笼表格信息
            jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetail(0));
            hangzhoumes();
            salve_hangzhoumes_1();
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
            if (sendwServer != null) {
                for (WebSocketServer webserver : sendwServer) {