| | |
| | | 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; |
| | |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private BusService busService; |
| | | @Autowired |
| | | private SqlSession sqlSession; |
| | | |
| | | @Override |
| | | public List<MissionVo> getList(Long agvId, String groupNo) { |
| | |
| | | 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; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | 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); |