| | |
| | | // 判断是否满足入库条件 |
| | | 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); |
| | | } |