From 2c1e3b7b10c0d4afbf09a9151e132f1ee85b9c6f Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期六, 02 八月 2025 11:15:25 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/action/ShuttleAction.java | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zy/core/action/ShuttleAction.java b/src/main/java/com/zy/core/action/ShuttleAction.java index 6a968c0..55bba24 100644 --- a/src/main/java/com/zy/core/action/ShuttleAction.java +++ b/src/main/java/com/zy/core/action/ShuttleAction.java @@ -203,8 +203,10 @@ } } + News.info("execute send command {},{}", shuttleNo, taskNo); // 涓嬪彂鍛戒护 CommandResponse response = write(command, shuttleNo); + News.info("execute send command complete {},{}", shuttleNo, taskNo); //淇濆瓨鍛戒护鏃ュ織 BasShuttleOpt basShuttleOpt = new BasShuttleOpt(); @@ -360,7 +362,8 @@ } //鐢宠鍙栨秷绠″埗 - trafficControlThread.cancelTrafficControl(shuttleNo, shuttleProtocol.getTaskNo()); + cancelTrafficControl(shuttleNo, shuttleProtocol.getTaskNo()); + //鍒犻櫎redis redisUtil.del(RedisKeyType.SHUTTLE_WORK_FLAG.key + redisCommand.getWrkNo()); return 0;//绂佹鍐嶄笅鍙戝懡浠� @@ -511,16 +514,18 @@ //鏌ヨ鏄惁鐢宠绠″埗鎴愬姛 public boolean queryTrafficControl(Integer shuttleNo, Integer taskNo) { - TrafficControlThread trafficControlThread = (TrafficControlThread) SlaveConnection.get(SlaveType.TrafficControl, 1); - if (trafficControlThread == null) { + Object object = redisUtil.get(RedisKeyType.TRAFFIC_CONTROL_SUCCESS_APPLY.key + shuttleNo + "_" + taskNo); + if (object == null) { return false; } + return true; + } - TrafficControlDataModel trafficControlDataModel = trafficControlThread.queryTrafficControl(shuttleNo, taskNo); - if (trafficControlDataModel == null) { - return false; - } - + public boolean cancelTrafficControl(Integer shuttleNo, Integer taskNo) { + TrafficControlDataModel model = new TrafficControlDataModel(); + model.setShuttleNo(shuttleNo); + model.setTaskNo(taskNo); + redisUtil.set(RedisKeyType.TRAFFIC_CONTROL_CANCEL_LIST.key + shuttleNo + "_" + taskNo, model); return true; } @@ -1155,7 +1160,7 @@ // } // } - private synchronized CommandResponse write(ShuttleCommand command, Integer shuttleNo) { + private CommandResponse write(ShuttleCommand command, Integer shuttleNo) { CommandResponse response = new CommandResponse(false); if (null == command) { News.error("鍥涘悜绌挎杞﹀啓鍏ュ懡浠や负绌�"); -- Gitblit v1.9.1