#
Junjie
2024-06-19 877a0dafe0da9f60e09b6b29742573ac33c00f56
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayLiftThread.java
@@ -374,6 +374,36 @@
        return extend.getLock();
    }
    @Override
    public boolean commandFinished(Integer taskNo) {
        try {
            LiftCommand command = getTaskClearCommand();
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/lifterOperation")
                    .setHeaders(headers)
                    .setJson(command.getBody())
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {
                return true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
    //***************设备层通讯-不同厂商设备通讯方案不一致***************
    //请求登录
@@ -544,6 +574,21 @@
        return command;
    }
    //获取提升机任务清除命令
    private LiftCommand getTaskClearCommand() {
        HashMap<String, Object> body = new HashMap<>();
        body.put("messageName", "lifterOperation");
        body.put("msgTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        body.put("deviceNo", Integer.parseInt(this.device.getDeviceNo()));
        body.put("operation", 1);
        LiftCommand command = new LiftCommand();
        command.setLiftNo(Integer.valueOf(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
        command.setMode(LiftCommandModeType.RESET.id);
        return command;
    }
    /**
     * 扩展字段
     */