严智鑫
2024-05-16 4185a44f983c7aa3cf45ec03a65eece9e847e229
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/Plcdownglass.java
@@ -28,7 +28,7 @@
    private DownWorkstationService downWorkstationService;
    @Scheduled(fixedDelay = 300)
   @Scheduled(fixedDelay = 300)
    public void PlcdownglassTask() throws InterruptedException {
        JSONObject jsonObject = new JSONObject();
        try {
@@ -37,8 +37,8 @@
            //                String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + "";
//                String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + "";
            String result = "2";
            String number = "1";
            String result = "3";
            String number = "4";
            // 进片请求
            if (RESULT_IN.equals(result)) {
                downStorageCageService.processInto(number);
@@ -50,13 +50,19 @@
            // 进出片请求
            else if (RESULT_IN_OUT.equals(result)) {
                // 先出后进
                if (!downStorageCageService.processOut()) {
                if (downStorageCageService.processOut()) {
                    //下片更新
                    downWorkstationService.insertdownglassinfo();
                    // 执行进片操作
                    downStorageCageService.processInto(number);
                } else {
                    // 如果 processOut() 返回 false,可以在这里处理其他逻辑
                    log.info("出片请求失败,无法执行进片操作");
                }
            }
            //下片更新
            downWorkstationService.insertdownglassinfo();
        } catch (Exception e) {
            e.printStackTrace();
        }