#
luxiaotao1123
2025-01-06 b6c82c2a4b94e63d1afe506a7b943496cc9f8017
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/MainService.java
@@ -472,6 +472,7 @@
            // task
            for (Task task : taskList) {
                task.setTaskSts(TaskStsType.ASSIGN.val());
                task.setStartTime(now);
                task.setUpdateTime(now);
                if (!taskService.updateById(task)) {
                    throw new BusinessException(task.getUuid() + "任务更新失败");
@@ -641,7 +642,7 @@
     * 根据分片生成动作 ( 车辆可能已经做过一些任务了,正在等待下一段任务 )
     */
    @Transactional
    public synchronized void generateAction(Long agvId, List<Segment> segmentList, List<String> pathList) {
    public synchronized void generateAction(Long agvId, List<Segment> segmentList, List<String> pathList, Date algoStartTime) {
        try {
            if (Cools.isEmpty(agvId, segmentList)) { return; }
            Date now = new Date();
@@ -657,7 +658,6 @@
            assert agvSpeedType != null;
            AgvDetail agvDetail = agvDetailService.selectByAgvId(agvId);
            assert agvDetail != null;
            List<Action> actionList = new ArrayList<>();
            // start node
@@ -696,7 +696,7 @@
                            nextDirection = workDirection;
                            reverse = true;
                        }
                        if (!lastDirection.equals(nextDirection) || actionList.size() == 0) {
                        if (!lastDirection.equals(nextDirection) || actionList.isEmpty()) {
                            // turn
                            actionList.add(new Action(
                                    null,    // 编号
@@ -1010,6 +1010,9 @@
                item.setGroupId(groupId);
                item.setState(SegmentStateType.RUNNING.toString());
                item.setUpdateTime(now);
                if (null != algoStartTime) {
                    item.setAlgoTime((int) (now.getTime() - algoStartTime.getTime()));
                }
                if (!segmentService.updateById(item)) {
                    throw new CoolException("更新Segment失败");
                }