| | |
| | | import com.zy.asrs.common.utils.HttpHandler; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wcs.core.domain.dto.MatDto; |
| | | import com.zy.asrs.wcs.core.domain.dto.RedisMapDto; |
| | | import com.zy.asrs.wcs.core.domain.dto.StaDto; |
| | |
| | | /** |
| | | * 出库 ====>> 同一时间一台穿梭车只能有一个出库任务 |
| | | */ |
| | | public synchronized void generateOutboundWrkMast() { |
| | | public synchronized void analyzeOutBoundTask() { |
| | | List<Task> tasks = taskService.selectPakOut(); |
| | | if (tasks.isEmpty()) { |
| | | return; |
| | |
| | | // continue;//浅库位存在未执行任务 |
| | | // } |
| | | |
| | | if (Cools.isEmpty(task.getShuttleNo())) { |
| | | //分配小车 |
| | | //搜索空闲车 |
| | | ShuttleThread shuttleThread = shuttleDispatcher.searchIdleShuttle(task); |
| | | if (shuttleThread == null) { |
| | | News.info("{}任务未找到空闲穿梭车", task.getTaskNo()); |
| | | continue; |
| | | } |
| | | |
| | | task.setShuttleNo(Integer.valueOf(shuttleThread.getDevice().getDeviceNo()));//保存穿梭车号 |
| | | task.setUpdateTime(new Date()); |
| | | if (!taskService.updateById(task)) { |
| | | News.info("{}任务更新穿梭车号失败", task.getTaskNo()); |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | // generate motion list |
| | | List<Motion> motionList = analyzeService.generateMotion(task); |
| | | if (Cools.isEmpty(motionList)) { |
| | |
| | | } |
| | | } |
| | | |
| | | // 解析小车移动工作档 |
| | | public synchronized void analyzeMoveTask() { |
| | | for (Task task : taskService.selectWaitAnalyzeMoveTask()) { |
| | | // generate motion list |
| | | List<Motion> motionList = analyzeService.generateMotion(task); |
| | | if (motionList.isEmpty()) { |
| | | continue; |
| | | } |
| | | motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo())); |
| | | |
| | | // 更新工作主档 |
| | | task.setTaskSts(TaskStsType.ANALYZE_MOVE.sts); // 工作状态 |
| | | task.setUpdateTime(new Date()); |
| | | if (!taskService.updateById(task)) { |
| | | News.error("更新工作档失败!!! [工作号:{}]", task.getTaskNo()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 四向穿梭车电量检测 ===>> 发起充电 |
| | | */ |