| | |
| | | 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; |
| | |
| | | |
| | | Code startCode = codeService.getCacheById(agvDetail.getRecentCode()); |
| | | |
| | | List<String> codeList = AgvAreaDispatcher.AGV_AREA.get(agvNo); |
| | | List<String> disableCodeList = AgvAreaDispatcher.AGV_DISABLE_AREA.get(agvNo); |
| | | if (!Cools.isEmpty(codeList)) { |
| | | Collections.shuffle(codeList); |
| | | } |
| | | Set<String> notInCodeSet = new HashSet<>(); |
| | | |
| | | for (String endCodeData : codeList) { |
| | | if (disableCodeList.contains(endCodeData)) { continue; } |
| | | Collections.shuffle(CODE_DATA_CACHE); |
| | | |
| | | for (String endCodeData : CODE_DATA_CACHE) { |
| | | if (notInCodeSet.contains(endCodeData)) { continue; } |
| | | Code endCode = codeService.getCacheByData(endCodeData); |
| | | |
| | | // valid lane |
| | |
| | | } |
| | | } |
| | | |
| | | return codeList.stream().findFirst().orElse(null); |
| | | return CODE_DATA_CACHE.stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | // --------------------------------------------------------------------------- |