zhoushihao
2024-05-09 09be761e45c76c095ddbae1c401d780bae162fdd
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/common/Plcdownglass.java
@@ -28,22 +28,17 @@
    private DownWorkstationService downWorkstationService;
   // @Scheduled(fixedDelay = 300)
   @Scheduled(fixedDelay = 300)
    public void PlcdownglassTask() throws InterruptedException {
        JSONObject jsonObject = new JSONObject();
        try {
            Thread.sleep(300);
            //                String result = S7control.getinstance().ReadWord("DB14.0", 1).get(0) + "";
//                String number = S7control.getinstance().ReadWord("DB14.2", 1).get(0) + "";
            String result ="1";
            String number ="1";
            String result = "3";
            String number = "4";
            // 进片请求
            if (RESULT_IN.equals(result)) {
                downStorageCageService.processInto(number);
@@ -55,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();
        }