| | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | // && staProtocol.isInEnable() |
| | | && (workNo == 0 || (workNo>9000 && workNo<10000)) |
| | | // && (workNo == 0 || (workNo>9000 && workNo<10000)) |
| | | && staProtocol.isPakMkWalk() |
| | | ) { |
| | | if (inSta.isBarcodeSign()){ |
| | |
| | | } |
| | | return true; |
| | | } |
| | | public boolean rgvOtherIDLE(RgvSlave slave) { |
| | | RgvProtocol rgvProtocol = RgvStatusCache.getRgvStatus(slave.getId()); |
| | | RgvTaskProtocol rgvTaskProtocol = RgvTaskCache.getRgvStatus(slave.getId()); |
| | | |
| | | if (rgvProtocol == null || rgvTaskProtocol == null) { |
| | | return false; |
| | | } |
| | | if (!rgvProtocol.getModeType().equals(RgvModeType.AUTO) || rgvProtocol.getRgvPos().equals(0L) || rgvTaskProtocol.getAvoid() == -1 |
| | | || (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) && !rgvProtocol.getStatusType().equals(RgvStatusType.ROAM))) { |
| | | return false; |
| | | } |
| | | RgvProtocol rgvProtocolOther = RgvStatusCache.getRgvStatus(slave.getOtherId()); |
| | | RgvTaskProtocol rgvTaskProtocolOther = RgvTaskCache.getRgvStatus(slave.getOtherId()); |
| | | |
| | | if (rgvProtocolOther == null) { |
| | | return true; |
| | | } |
| | | if (rgvProtocolOther.statusEnable) { |
| | | if (rgvProtocolOther.getModeType().equals(RgvModeType.AUTO) |
| | | && rgvProtocolOther.getStatusType().equals(RgvStatusType.IDLE) |
| | | && rgvProtocolOther.getLoaded()==0) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public TaskWrk deviceDetection(RgvSlave.RgvStn inSta) { |
| | | |
| | |
| | | if (rgvStn.getStaNo().equals(staNoNow)) { |
| | | TaskWrk taskWrk = deviceDetection(rgvStn); |
| | | if (taskWrk != null) { |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", taskWrk.getTargetPointConvert())); |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", BarcodeUtils.getOutStaNo(taskWrk.getOriginTargetPoint()))); |
| | | if (RouteUtils.CheckIfItIsWithinTheRange(rangeList, basDevpPosition.getPlcPosition(), basDevpPositions, itSmall)) { |
| | | sign = taskGenerate(rgvSlave, rgvStn, 0); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (!sign){ |
| | | if (!rgvOtherIDLE(rgvSlave)){ |
| | | sign=true; |
| | | } |
| | | } |
| | | |
| | | if (!sign) { |
| | | for (Integer staNoNow : rangeList) { |
| | | for (RgvSlave.RgvStn rgvStn : rgvSlave.getRgvInSta()) { |
| | | if (rgvStn.getStaNo().equals(staNoNow)) { |
| | | TaskWrk taskWrk = deviceDetection(rgvStn); |
| | | if (taskWrk != null) { |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", taskWrk.getTargetPointConvert())); |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", BarcodeUtils.getOutStaNo(taskWrk.getOriginTargetPoint()))); |
| | | if (RouteUtils.CheckIfItIsWithinTheRange(rangeList, basDevpPosition.getPlcPosition(), basDevpPositions, itSmall)) { |
| | | sign = taskGenerate(rgvSlave, rgvStn, 0); |
| | | } |
| | |
| | | if (rgvStn.getStaNo().equals(staNoNow)) { |
| | | TaskWrk taskWrk = deviceDetection(rgvStn); |
| | | if (taskWrk != null) { |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", taskWrk.getTargetPointConvert())); |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", BarcodeUtils.getOutStaNo(taskWrk.getOriginTargetPoint()))); |
| | | if (RouteUtils.CheckIfItIsWithinTheRange(rangeList, basDevpPosition.getPlcPosition(), basDevpPositions, itSmall)) { |
| | | sign = taskGenerate(rgvSlave, rgvStn, 0); |
| | | } |
| | |
| | | if (targetPointConvert == null) { |
| | | return false; |
| | | } |
| | | RgvSlave.RgvStn rgvStnEnd = getRgvStnNow(rgvSlave, targetPointConvert); |
| | | if (rgvStnEnd == null) { |
| | | return false; |
| | | } |
| | | |
| | | BasDevpPosition basDevpPositionSou = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", rgvStn.getStaNo())); |
| | | BasDevpPosition basDevpPositionEnd = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", targetPointConvert)); |
| | |
| | | issuedTake.setTaskNoDirection(issuedTake.gettaskNoDirection$(issuedTake.getTaskNo(), issuedTake.getTaskStatus())); |
| | | issuedTake.setTargetPosition(basDevpPositionSou.getPlcPosition()); |
| | | issuedTake.setIsRunning(1); |
| | | issuedTake.setDirection(rgvStn.isDirection()); |
| | | issuedTake.setDirection(basDevpPositionSou.getRgvSign()==1); |
| | | |
| | | |
| | | issuedPut.setTaskNo(Long.valueOf(taskWrk.getTaskNo())); |
| | |
| | | issuedPut.setTaskNoDirection(issuedPut.gettaskNoDirection$(issuedPut.getTaskNo(), issuedPut.getTaskStatus())); |
| | | issuedPut.setTargetPosition(basDevpPositionEnd.getPlcPosition()); |
| | | issuedPut.setIsRunning(1); |
| | | issuedPut.setDirection(rgvStnEnd.isDirection()); |
| | | issuedPut.setDirection(basDevpPositionEnd.getRgvSign()==1); |
| | | } catch (Exception e) { |
| | | log.error("任务生成失败issued1===》异常信息:{}", e.getMessage()); |
| | | return false; |