自动化立体仓库 - WCS系统
#
Junjie
2023-09-04 4a349f04abb665c0e99930bc1ef1c54ef24614f7
#
2个文件已修改
17 ■■■■■ 已修改文件
src/main/java/com/zy/common/utils/NyHttpUtils.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/NyShuttleThread.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NyHttpUtils.java
@@ -313,13 +313,18 @@
            JSONObject resultResponse = JSON.parseObject(result.get("response").toString());
            JSONObject resultHeader = JSON.parseObject(resultResponse.get("header").toString());
            int responseId = Integer.parseInt(resultHeader.get("responseId").toString());
            if (responseId != httpCommand.getRequest().getHeader().getRequestId()) {
                return null;//响应ID与请求ID不一致
            }
//            if (responseId != httpCommand.getRequest().getHeader().getRequestId()) {
//                return null;//响应ID与请求ID不一致
//            }
            return filterBodyData(result);//返回Body结果集
        } catch (Exception e) {
            e.printStackTrace();
            try {
                socket.close();
            } catch (IOException exception) {
                exception.printStackTrace();
            }
        }
        return null;
    }
src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -87,7 +87,7 @@
    private void read() {
        try {
            if (this.socket == null || !this.socket.isConnected()) {
            if (this.socket == null || this.socket.isClosed()) {
                //链接断开重新链接
                this.connect();
            }
@@ -117,7 +117,7 @@
            NyShuttleHttpCommand readStatusCommand = NyHttpUtils.getReadStatusCommand(slave.getId());
            JSONObject jsonObject = NyHttpUtils.requestCommand(socket, readStatusCommand);
            if (jsonObject == null) {
                OutputQueue.SHUTTLE.offer(MessageFormat.format("【{0}】四向穿梭车plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
                OutputQueue.SHUTTLE.offer(MessageFormat.format("【{0}】四向穿梭车Socket状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
            }else {
                //手动状态/自动状态
                shuttleProtocol.setWorkingMode(jsonObject.getInteger("workingMode"));
@@ -243,7 +243,7 @@
            }
        } catch (Exception e) {
            e.printStackTrace();
            OutputQueue.SHUTTLE.offer(MessageFormat.format("【{0}】四向穿梭车plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
            OutputQueue.SHUTTLE.offer(MessageFormat.format("【{0}】四向穿梭车Socket状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
        }
    }