From e2a14112a81740481623dc16bbd1301432ce34b0 Mon Sep 17 00:00:00 2001 From: L <L@132> Date: 星期三, 27 八月 2025 13:15:22 +0800 Subject: [PATCH] * --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 61 +++++++++++++++++------------- 1 files changed, 34 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 73e31c8..035451e 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -761,19 +761,25 @@ if (!taskWrks.isEmpty()) { continue; } - List<TaskWrkLog> taskWrkLogs = taskWrkLogService.selectList(new EntityWrapper<TaskWrkLog>().eq("CRN_NO",crnProtocol.getLaneNo()).orderBy("COMPLETE_TIME",true)); + List<TaskWrkLog> taskWrkLogs = taskWrkLogService.selectList(new EntityWrapper<TaskWrkLog>().eq("CRN_NO",crnProtocol.getLaneNo()).orderBy("COMPLETE_TIME",false)); if (!taskWrkLogs.isEmpty()) { - TaskWrkLog taskWrkLog = taskWrkLogs.get(0); - Date completeTime = taskWrkLog.getCompleteTime(); - if (completeTime==null){ - completeTime = taskWrkLog.getCancelTime(); + boolean signT = false; + for (TaskWrkLog taskWrkLog : taskWrkLogs){ + Date completeTime = taskWrkLog.getCompleteTime(); if (completeTime==null){ - completeTime = taskWrkLog.getModiTime(); + continue; + } + long differenceInSeconds = TimeCalculatorUtils.differenceInMilliseconds(completeTime, new Date()); + if (differenceInSeconds <= 60*2*1000) { + signT = true; + break; + } else { + signT = false; + break; } } - long differenceInSeconds = TimeCalculatorUtils.differenceInMilliseconds(completeTime, new Date()); - if (differenceInSeconds <= 60*10*1000) { - return; + if (signT){ + continue; } } // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- @@ -782,11 +788,11 @@ crnCommand.setLaneNo(crnProtocol.getLaneNo()); // 鍫嗗灈鏈哄贩閬撶紪鍙� crnCommand.setTaskNo((short)999); // 宸ヤ綔鍙� crnCommand.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� - crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 浠诲姟妯″紡: 搴撲綅绉昏浆 - crnCommand.setSourcePosX((short) 0); // 婧愬簱浣嶆帓 - crnCommand.setSourcePosY((short) 0); // 婧愬簱浣嶅垪 - crnCommand.setSourcePosZ((short) 0); // 婧愬簱浣嶅眰 + crnCommand.setTaskMode(CrnTaskModeType.SITE_MOVE); // 浠诲姟妯″紡: 绔欎綅绉昏浆4 int row = crnProtocol.getLaneNo() * 2; + crnCommand.setSourcePosX((short) row); // 婧愬簱浣嶆帓 + crnCommand.setSourcePosY((short) 1); // 婧愬簱浣嶅垪 + crnCommand.setSourcePosZ((short) 1); // 婧愬簱浣嶅眰 crnCommand.setDestinationPosX((short) row); // 鐩爣搴撲綅鎺� crnCommand.setDestinationPosY((short) 1); // 鐩爣搴撲綅灞� crnCommand.setDestinationPosZ((short) 1); // 鐩爣搴撲綅鍒� @@ -989,22 +995,22 @@ // } // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- - CrnCommand crnCommand = new CrnCommand(); - crnCommand.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� - crnCommand.setLaneNo(crnProtocol.getLaneNo()); // 鍫嗗灈鏈哄贩閬撶紪鍙� - crnCommand.setTaskNo(taskWrk.getWrkNo().shortValue()); // 宸ヤ綔鍙� - crnCommand.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� - crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 - crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 婧愬簱浣嶆帓 - crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 婧愬簱浣嶅垪 - crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 婧愬簱浣嶅眰 - crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 鐩爣搴撲綅鍒� + CrnCommand crnCommand1 = new CrnCommand(); + crnCommand1.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� + crnCommand1.setLaneNo(crnProtocol.getLaneNo()); // 鍫嗗灈鏈哄贩閬撶紪鍙� + crnCommand1.setTaskNo(taskWrk.getWrkNo().shortValue()); // 宸ヤ綔鍙� + crnCommand1.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣� + crnCommand1.setTaskMode(CrnTaskModeType.LOC_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆 + crnCommand1.setSourcePosX(crnStn.getRow().shortValue()); // 婧愬簱浣嶆帓 + crnCommand1.setSourcePosY(crnStn.getBay().shortValue()); // 婧愬簱浣嶅垪 + crnCommand1.setSourcePosZ(crnStn.getLev().shortValue()); // 婧愬簱浣嶅眰 + crnCommand1.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 鐩爣搴撲綅鍒� int bay1 = Utils.getBayShort(taskWrk.getTargetPoint()) + 1; - crnCommand.setDestinationPosY((short)bay1); // 鐩爣搴撲綅灞� - crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 鐩爣搴撲綅鎺� + crnCommand1.setDestinationPosY((short)bay1); // 鐩爣搴撲綅灞� + crnCommand1.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 鐩爣搴撲綅鎺� // crnCommand.setCommand((short) 1); - if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand))) { - log.error("鍫嗗灈鏈哄懡浠ょ敓鎴愬け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); + if (!MessageQueue.offer(SlaveType.Crn, slave.getId(), new Task(2, crnCommand1))) { + log.error("鍫嗗灈鏈哄懡浠ょ敓鎴愬け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand1)); devpThread.setErrorDev(staProtocol.getSiteId(), crnProtocol.getLaneNo()+"宸烽亾鍫嗗灈鏈哄懡浠ょ敓鎴愬け璐�"); CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "杩愯鍛戒护涓嬪彂澶辫触"); @@ -1244,6 +1250,7 @@ // 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊� if (taskWrkMapper.selectCrnWorking(crnProtocol.getLaneNo()) != null) { + CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "鍫嗗灈鏈哄瓨鍦ㄦ墽琛屼腑鍚婅溅浠诲姟"); continue; } -- Gitblit v1.9.1