From c4b6b51afdd3374735ed5f358457987eaa6e476f Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期五, 05 九月 2025 16:55:20 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/impl/NyLiftThread.java | 39 ++++++++++----------------------------- 1 files changed, 10 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/zy/core/thread/impl/NyLiftThread.java b/src/main/java/com/zy/core/thread/impl/NyLiftThread.java index e5a01e7..dc1c42a 100644 --- a/src/main/java/com/zy/core/thread/impl/NyLiftThread.java +++ b/src/main/java/com/zy/core/thread/impl/NyLiftThread.java @@ -160,7 +160,7 @@ if (null == liftProtocol) { liftProtocol = new LiftProtocol(); liftProtocol.setLiftNo(device.getDeviceNo()); - liftProtocol.setProtocolStatus(LiftProtocolStatusType.NONE); + liftProtocol.setProtocolStatus(LiftProtocolStatusType.IDLE); InnerLiftExtend innerLiftExtend = new InnerLiftExtend(); liftProtocol.setExtend(innerLiftExtend); @@ -171,8 +171,8 @@ liftProtocol.setModel(data.getInteger("model")); //PLC浠诲姟鍙� liftProtocol.setPlcTaskNo(data.getInteger("plcTaskNo")); - //浠诲姟鐘舵�� - liftProtocol.setProtocolStatus(data.getInteger("protocolStatus")); + //璁惧鐘舵�� + liftProtocol.setDeviceStatus(data.getInteger("deviceStatus")); //浠诲姟妯″紡 liftProtocol.setTaskMode(data.getInteger("taskMode")); //鍙栬揣鏁版嵁 @@ -381,30 +381,10 @@ @Override public CommandResponse reset() { - CommandResponse response = new CommandResponse(false); - try { - LiftCommand resetCommand = getResetCommand(9999); - - //鍙戝嚭璇锋眰 - String resultKey = requestCommand(resetCommand); - //鏌ヨ璇锋眰缁撴灉 - JSONObject result = queryCommandStatus(resultKey); - if (result == null) { - return response;//璇锋眰澶辫触 - } - if(!result.getString("result").equals("success")) { - return response;//璇锋眰澶辫触 - } - - this.liftProtocol.setSendTime(System.currentTimeMillis());//鎸囦护涓嬪彂鏃堕棿 - response.setMessage(JSON.toJSONString(result)); - response.setResult(true); - return response; - } catch (Exception e) { - e.printStackTrace(); - response.setMessage(e.getMessage()); - return response; - } + CommandResponse response = new CommandResponse(true); + this.setSyncTaskNo(0); + this.setProtocolStatus(LiftProtocolStatusType.IDLE); + return response; } @Override @@ -422,7 +402,7 @@ InnerLiftExtend extend = (InnerLiftExtend) this.liftProtocol.getExtend(); boolean res = this.liftProtocol.getProtocolStatus() == LiftProtocolStatusType.IDLE.id - && this.liftProtocol.getPlcTaskNo() == 0 +// && this.liftProtocol.getPlcTaskNo() == 0 && this.liftProtocol.getTaskNo() == 0 && this.liftProtocol.getModel() == 2 && this.liftProtocol.getErrorCode() == 0 @@ -481,7 +461,8 @@ @Override public boolean setSyncTaskNo(Integer taskNo) { - this.liftProtocol.setSyncTaskNo(taskNo); + redisUtil.setSync(RedisKeyType.LIFT_FLAG.key + liftProtocol.getLiftNo(), taskNo); + this.liftProtocol.setTaskNo(taskNo); return true; } -- Gitblit v1.9.1