| | |
| | | import com.zy.acs.common.utils.RedisSupport; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.core.constant.AgvAreaDispatcher; |
| | | import com.zy.acs.manager.core.cache.CoreCache; |
| | | import com.zy.acs.manager.core.domain.CodeStepDto; |
| | | import com.zy.acs.manager.core.domain.type.JobType; |
| | |
| | | }}; |
| | | |
| | | private List<String> CONVEYOR_PICK_CODE_DATA_CACHE = new ArrayList<String>(){{ |
| | | add("00000246"); |
| | | add("00000146"); |
| | | }}; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | Code startCode = codeService.getCacheById(agvDetail.getRecentCode()); |
| | | |
| | | Set<String> notInCodeSet = new HashSet<>(); |
| | | notInCodeSet.add("00000301"); |
| | | notInCodeSet.add("00000302"); |
| | | notInCodeSet.add("00000303"); |
| | | notInCodeSet.add("00000351"); |
| | | notInCodeSet.add("00000353"); |
| | | notInCodeSet.add("00000401"); |
| | | notInCodeSet.add("00000402"); |
| | | List<String> codeList = AgvAreaDispatcher.AGV_AREA.get(agvNo); |
| | | List<String> disableCodeList = AgvAreaDispatcher.AGV_DISABLE_AREA.get(agvNo); |
| | | if (!Cools.isEmpty(codeList)) { |
| | | Collections.shuffle(codeList); |
| | | } |
| | | |
| | | notInCodeSet.add("00000311"); |
| | | notInCodeSet.add("00000312"); |
| | | notInCodeSet.add("00000313"); |
| | | notInCodeSet.add("00000361"); |
| | | notInCodeSet.add("00000363"); |
| | | notInCodeSet.add("00000411"); |
| | | notInCodeSet.add("00000412"); |
| | | |
| | | notInCodeSet.add("00000046"); |
| | | notInCodeSet.add("00000047"); |
| | | |
| | | Collections.shuffle(CODE_DATA_CACHE); |
| | | |
| | | for (String endCodeData : CODE_DATA_CACHE) { |
| | | if (notInCodeSet.contains(endCodeData)) { continue; } |
| | | for (String endCodeData : codeList) { |
| | | if (disableCodeList.contains(endCodeData)) { continue; } |
| | | Code endCode = codeService.getCacheByData(endCodeData); |
| | | |
| | | // valid lane |
| | |
| | | } |
| | | } |
| | | |
| | | return CODE_DATA_CACHE.stream().findFirst().orElse(null); |
| | | return codeList.stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | // --------------------------------------------------------------------------- |
| | |
| | | |
| | | Runnable patrolTask = () -> { |
| | | try { |
| | | // executePatrolLogic(agvNo); |
| | | executeUShapeConveyor(agvNo); |
| | | executePatrolLogic(agvNo); |
| | | // executeUShapeConveyor(agvNo); |
| | | } catch (Exception e) { |
| | | log.error("执行AGV{}跑库任务时发生异常: {}", agvNo, e.getMessage()); |
| | | log.error("执行AGV{}跑库任务时发生异常", agvNo, e); |
| | | } |
| | | }; |
| | | |