#
vincentlu
2025-05-13 ebd2f4397a92c6a5096de1b86d59154363344720
zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
@@ -10,6 +10,7 @@
import com.zy.acs.manager.manager.enums.SegmentStateType;
import com.zy.acs.manager.manager.enums.TaskStsType;
import com.zy.acs.manager.manager.service.*;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -35,6 +36,8 @@
    private TaskService taskService;
    @Autowired
    private BusService busService;
    @Autowired
    private SqlSession sqlSession;
    @Override
    public List<MissionVo> getList(Long agvId, String groupNo) {
@@ -67,12 +70,12 @@
        Long recentCode = agvDetail.getRecentCode();
        String currCode = null;
        if (null != recentCode) {
            currCode = codeService.getById(recentCode).getData();
            currCode = codeService.getCacheById(recentCode).getData();
        }
        // action -------------------------------
        List<Action> actionList = actionService.list(new LambdaQueryWrapper<Action>()
                .eq(Action::getGroupId, groupNo).orderByDesc(Action::getPriority));
                .eq(Action::getGroupId, groupNo).ne(Action::getActionSts, ActionStsType.EXPIRED.val()).orderByDesc(Action::getPriority));
        if (Cools.isEmpty(actionList)) {
            return null;
        }
@@ -101,7 +104,7 @@
            return null;
        }
        List<Action> actionList = actionService.list(new LambdaQueryWrapper<Action>()
                .eq(Action::getGroupId, groupNo).orderByDesc(Action::getPriority));
                .eq(Action::getGroupId, groupNo).ne(Action::getActionSts, ActionStsType.EXPIRED.val()).orderByDesc(Action::getPriority));
        if (Cools.isEmpty(actionList)) {
            return null;
        }
@@ -124,12 +127,16 @@
        if (Cools.isEmpty(actionList)) {
            return Boolean.FALSE;
        }
        String actionGroupId = actionService.getById(actionList.get(0).getId()).getGroupId();
        List<Long> actionIds = actionList.stream().map(Action::getId).collect(Collectors.toList());
        String actionGroupId = actionService.getById(actionIds.get(0)).getGroupId();
        actionService.updateStsByGroupId(actionGroupId, ActionStsType.EXPIRED.val());
        List<Action> newActionList = new ArrayList<>();
        Date now = new Date();
        for (Action item : actionList) {
            Action action = actionService.getById(item.getId());
        for (Long actionId : actionIds) {
            sqlSession.clearCache();
            Action action = actionService.getById(actionId);
            action.setActionSts(ActionStsType.PREPARE.val());
            action.setIoTime(now);
            action.setUpdateTime(now);