| | |
| | | import javax.annotation.PreDestroy; |
| | | import java.util.*; |
| | | import java.util.concurrent.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 大车设备逻辑处理器 |
| | |
| | | // 如果有多设备任务上下文,则记录本次MES下发的玻璃ID列表到上下文,供分批校验使用 |
| | | if (params != null) { |
| | | Object ctxObj = params.get("_taskContext"); |
| | | if (ctxObj instanceof com.mes.task.model.TaskExecutionContext) { |
| | | com.mes.task.model.TaskExecutionContext ctx = (com.mes.task.model.TaskExecutionContext) ctxObj; |
| | | if (ctxObj instanceof TaskExecutionContext) { |
| | | TaskExecutionContext ctx = (TaskExecutionContext) ctxObj; |
| | | List<String> batchIds = new ArrayList<>(); |
| | | for (GlassTaskInfo g : glasses) { |
| | | if (g != null && g.glassId != null && !g.glassId.isEmpty()) { |
| | |
| | | String taskType = isOutbound ? "出片" : "进片"; |
| | | String glassIds = glasses.stream() |
| | | .map(g -> g.glassId) |
| | | .collect(java.util.stream.Collectors.joining(",")); |
| | | .collect(Collectors.joining(",")); |
| | | log.info("MES{}任务已创建: deviceId={}, glassCount={}, glassIds=[{}], 起始位置={}格, 目标位置={}格, 距离{}格->{}格, gotime={}ms({}秒), cartime={}ms({}秒)", |
| | | taskType, deviceId, glasses.size(), glassIds, |
| | | firstGlass.startPosition, firstGlass.targetPosition, |