#
luxiaotao1123
2024-10-25 fff2e8aa532540036088744c76efe5bffc7733a3
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -211,6 +211,25 @@
                }
                return;
            }
            for (Task task : taskList) {
                Agv agv = missionAssignService.execute(task);
                if (null == agv) {
                    log.warn("Task[{}] has an issue, because it failed to checkout agv which is idle...", task.getSeqNum());
                    continue;
                }
                task.setAgvId(agv.getId());
                task.setTaskSts(TaskStsType.WAITING.val());
                task.setIoTime(now);
                task.setUpdateTime(now);
                if (!taskService.updateById(task)) {
                    throw new BusinessException("seqNum: " + task.getSeqNum() + " failed to update");
                }
            }
            // ------------------------------------------
            List<Long> taskIds = taskList.stream().map(Task::getId).distinct().collect(Collectors.toList());
            Map<String, List<Long>> taskAllot = new HashMap<>();
@@ -236,11 +255,6 @@
                    taskAllot.put(agv.getUuid(), Utils.singletonList(task.getId()));
                }
            }
//            bus.setUpdateTime(now);
//            if (!busService.updateById(bus)) {
//                throw new BusinessException(bus.getSeqNum() + "总线更新失败");
//            }
        } catch (Exception e) {
            log.error("mainService.infuseAgvForTask", e);
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -274,7 +288,7 @@
            taskList.sort(new Comparator<Task>() {
                @Override
                public int compare(Task o1, Task o2) {
                    return 0;
                    return o1.getPriority() - o2.getPriority();
                }
            });
            Integer backpack = agvService.getBackpack(agv);