| | |
| | | import com.zy.asrs.wcs.core.model.command.LiftCommand; |
| | | import com.zy.asrs.wcs.core.model.enums.*; |
| | | import com.zy.asrs.wcs.core.service.*; |
| | | import com.zy.asrs.wcs.core.utils.OpenUtils; |
| | | import com.zy.asrs.wcs.core.utils.RedisUtil; |
| | | import com.zy.asrs.wcs.core.utils.ShuttleDispatcher; |
| | | import com.zy.asrs.wcs.core.utils.Utils; |
| | | import com.zy.asrs.wcs.core.utils.*; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.SlaveConnection; |
| | | import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant; |
| | |
| | | private OpenUtils openUtils; |
| | | @Autowired |
| | | private LiftAction liftAction; |
| | | @Autowired |
| | | private NavigateUtils navigateUtils; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | */ |
| | | public synchronized void generateInboundWrk() { |
| | | try { |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskCtg,7)); |
| | | if (!Cools.isEmpty(tasks)){ |
| | | return; |
| | | } |
| | | // 根据输送线plc遍历 |
| | | List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>() |
| | | .eq(Device::getDeviceType, DeviceCtgType.CONVEYOR.val()) |
| | |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo >= 9990 && workNo <= 9999)) |
| | | && staProtocol.getIsIn() == (short)1 |
| | | && staProtocol.isPakMk() |
| | | ) { |
| | | |
| | |
| | | * 出库 ====>> 同一时间一台穿梭车只能有一个出库任务 |
| | | */ |
| | | public synchronized void analyzeOutBoundTask() { |
| | | List<Task> moveTask = taskService.selectWaitAnalyzeMoveTask(); |
| | | if (!moveTask.isEmpty()) { |
| | | return; |
| | | } |
| | | List<Task> tasks = taskService.selectPakOut(); |
| | | if (tasks.isEmpty()) { |
| | | return; |
| | |
| | | // continue; |
| | | // } |
| | | |
| | | // //同库位组校验 |
| | | // List<String> outerLoc = Utils.getGroupOuterLoc(wrkMast.getSourceLocNo()); |
| | | // List<LocMast> outerLocMasts = locMastService.selectNotEmptyLocNos(outerLoc); |
| | | // if (!outerLocMasts.isEmpty()) { |
| | | // News.info("{}任务,浅库位存在货物,系统等待中", wrkMast.getWrkNo()); |
| | | // continue;//浅库位存在未执行任务 |
| | | // } |
| | | //检测货物是否可出 |
| | | boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId()); |
| | | if(!checkLocPathIsAvailable) { |
| | | continue; |
| | | } |
| | | |
| | | if (Cools.isEmpty(task.getShuttleNo()) || task.getShuttleNo() ==0) { |
| | | //分配小车 |
| | |
| | | } |
| | | |
| | | //搜索其他楼层充电桩 |
| | | List<ShuttleChargeSta> list2 = shuttleChargeStaService.list(new LambdaQueryWrapper<ShuttleChargeSta>() |
| | | .notIn(ShuttleChargeSta::getDeviceLev, lev) |
| | | .eq(ShuttleChargeSta::getStatus, 1)); |
| | | if (!list2.isEmpty()) { |
| | | allChargeLoc.addAll(list2); |
| | | } |
| | | // List<ShuttleChargeSta> list2 = shuttleChargeStaService.list(new LambdaQueryWrapper<ShuttleChargeSta>() |
| | | // .notIn(ShuttleChargeSta::getDeviceLev, lev) |
| | | // .eq(ShuttleChargeSta::getStatus, 1)); |
| | | // if (!list2.isEmpty()) { |
| | | // allChargeLoc.addAll(list2); |
| | | // } |
| | | |
| | | //没有找到充电桩 |
| | | if (allChargeLoc.isEmpty()) { |
| | |
| | | // 解析小车载货移动工作档 |
| | | public synchronized void analyzeLadenMoveTask() { |
| | | for (Task task : taskService.selectWaitAnalyzeLadenMoveTask()) { |
| | | //检测货物是否可出 |
| | | boolean checkLocPathIsAvailable = navigateUtils.checkLocPathIsAvailable(task.getOriginLoc(), task.getHostId()); |
| | | if(!checkLocPathIsAvailable) { |
| | | continue; |
| | | } |
| | | |
| | | if (Cools.isEmpty(task.getShuttleNo())) { |
| | | //分配小车 |
| | | //搜索空闲车 |