| | |
| | | ConcurrentHashMap<String, TaskProtocol> allTaskProtocol = taskProtocolCache.getAllTaskProtocol(); |
| | | if (!allTaskProtocol.isEmpty()) { |
| | | for (TaskProtocol taskProtocol : allTaskProtocol.values()) { |
| | | if (taskProtocol.getTaskNo() != 0) { |
| | | if (taskProtocol.getTaskNo() != 0 && taskProtocol.getTaskNo()!=32222L) { |
| | | return taskProtocol.getTaskNo().toString(); |
| | | } |
| | | } |
| | |
| | | ArrayList<Long[]> arrayListAll = new ArrayList<>(); |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | try{ |
| | | boolean itSmall = new TrackRangeUtils().IsItSmall(rgvSlave); |
| | | String taskNoNow = rgvOtherTaskWrk(rgvSlave); |
| | | if (taskNoNow.equals("无")){ |
| | | continue; |
| | | } |
| | | if (!arrayListOld.contains(taskNoNow)){ |
| | | arrayListOld.add(taskNoNow); |
| | | } |
| | | |
| | | TaskWrk taskWrk = taskWrkMapper.selectByTaskNo(taskNoNow); |
| | | if (taskWrk != null) { |
| | | if (!arrayListAllP.contains(taskWrk.getWrkNo())) { |
| | | |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | TaskProtocolCache taskProtocolCache = rgvThread.getTaskProtocolCache(); |
| | | |
| | | arrayListAllP.add(taskWrk.getWrkNo()); |
| | | long startP = 0; |
| | | if (!itSmall){ |
| | | startP = System.currentTimeMillis(); |
| | | } |
| | | |
| | | long endP = 0; |
| | | long endP1 = 0; |
| | | long endP2 = 0; |
| | | ConcurrentHashMap<String, TaskProtocol> allTaskProtocol = taskProtocolCache.getAllTaskProtocol(); |
| | | for (TaskProtocol taskProtocol : allTaskProtocol.values()){ |
| | | if (taskProtocol.getTaskStatus() == 2){//取 |
| | | endP1 = taskProtocol.getTargetPosition(); |
| | | } else if (taskProtocol.getTaskStatus() == 3){//放 |
| | | endP2 = taskProtocol.getTargetPosition(); |
| | | } |
| | | } |
| | | if (endP1 > endP2){ |
| | | if (itSmall){ |
| | | endP = endP1; |
| | | } else { |
| | | endP = endP2; |
| | | } |
| | | } |
| | | if (endP == 0){ |
| | | if (itSmall){ |
| | | endP = System.currentTimeMillis(); |
| | | } |
| | | } |
| | | Long[] longList = {taskWrk.getWrkNo().longValue(),startP,endP}; |
| | | arrayListAll.add(longList); |
| | | } |
| | | } else { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | TaskProtocolCache taskProtocolCache = rgvThread.getTaskProtocolCache(); |
| | | |
| | | try { |
| | | long startP = 0; |
| | | long endP = 0; |
| | | ConcurrentHashMap<String, TaskProtocol> allTaskProtocol = taskProtocolCache.getAllTaskProtocol(); |
| | | for (TaskProtocol taskProtocol : allTaskProtocol.values()){ |
| | | if (taskProtocol.getTaskStatus() == 2){//取 |
| | | startP = taskProtocol.getTargetPosition(); |
| | | } else if (taskProtocol.getTaskStatus() == 3){//放 |
| | | endP = taskProtocol.getTargetPosition(); |
| | | } |
| | | } |
| | | if (startP == 0 ){ |
| | | if (!itSmall){ |
| | | startP = System.currentTimeMillis(); |
| | | } |
| | | } |
| | | if (endP == 0){ |
| | | if (itSmall){ |
| | | endP = System.currentTimeMillis(); |
| | | } |
| | | } |
| | | // taskNoNow |
| | | long parseLong = Long.parseLong(taskNoNow); |
| | | Long[] longList = {parseLong,startP,endP}; |
| | | arrayListAll.add(longList); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("任务过滤查询小车执行任务异常:"+e.getMessage()); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | |
| | | List<Long> wrkNoList = new ArrayList<>(); |
| | | List<Long> signWrk = new ArrayList<>(); |
| | | for (Long[] longList : crossingPathsW) { |
| | | if (arrayListOld.contains(longList[0].toString()) || arrayListOld.contains(longList[1].toString())){ |
| | | signWrk.add(longList[0]); |
| | | signWrk.add(longList[1]); |
| | | continue; |
| | | } |
| | | if (!wrkNoList.contains(longList[0]) && !signWrk.contains(longList[0])) { |
| | | if (!wrkNoList.contains(longList[1]) && !signWrk.contains(longList[1])) { |
| | | wrkNoList.add(longList[0]); |