远遥优化
This commit is contained in:
parent
e49ae4cc98
commit
a5f790ca04
@ -8,7 +8,6 @@ import cn.iocoder.yudao.module.system.api.remote.dto.RemoteRobotDTO;
|
||||
import cn.iocoder.yudao.module.system.api.remote.dto.RemoteRobotStatusDTO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
public interface RemoteRobotService {
|
||||
|
@ -8,7 +8,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
|
@ -281,7 +281,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode ROBOT_ALREADY_RECOVERY = new ErrorCode(1_002_052_003, "车辆已经恢复");
|
||||
// ========== 远遥设备信息 1_002_053_001 ==========
|
||||
ErrorCode CONTROLLER_INFORMATION_NOT_EXISTS = new ErrorCode(1_002_053_001, "远遥设备信息不存在");
|
||||
ErrorCode REMOTE_DEVICE_NOT_SET_UP = new ErrorCode(1_002_053_002, "远遥设备未设置通讯信息");
|
||||
ErrorCode REMOTE_DEVICE_NOT_SET_UP = new ErrorCode(1_002_053_002, "远遥设备未选择车辆");
|
||||
ErrorCode REMOTE_DEVICE_NEED_AUTOMATIC = new ErrorCode(1_002_053_003, "首次进入远遥设置,只能是自动模式");
|
||||
ErrorCode REMOTE_DEVICE_CONTROLLER = new ErrorCode(1_002_053_004, "目前远遥设备控制的机器人是 ");
|
||||
ErrorCode REMOTE_NOT_HAVE_TASK = new ErrorCode(1_002_053_005, "车辆没有处理中的任务,不能切换成手动模式");
|
||||
|
@ -432,6 +432,10 @@ public class RemoteControllerInformationServiceImpl extends ServiceImpl<RemoteCo
|
||||
} else {
|
||||
//任务完成
|
||||
taskDetailService.manuallyCompleted(robotDoingTaskNo.get(0).getId(), " 远遥点击任务完成 ");
|
||||
information.setRemoteMode(RemoteModeEnum.FREE.getType());
|
||||
information.setTaskDetailId(null);
|
||||
information.setCollaborativeControl(ZeroOneEnum.ZERO.getType());
|
||||
controllerInformationMapper.updateById(information);
|
||||
}
|
||||
|
||||
}
|
||||
@ -487,6 +491,7 @@ public class RemoteControllerInformationServiceImpl extends ServiceImpl<RemoteCo
|
||||
throw exception(REMOTE_TASK_NOT_TAKE_RELEASE);
|
||||
}
|
||||
RobotTaskDetailSaveReqVO updateReqVO = BeanUtils.toBean(taskDetail, RobotTaskDetailSaveReqVO.class);
|
||||
updateReqVO.setOccurError(ZeroOneEnum.ZERO.getType());
|
||||
taskDetailService.updateTaskDetail(updateReqVO);
|
||||
|
||||
List<RobotTaskDetailActionLogDO> taskDetailActionLog = taskDetailActionLogService.getTaskDetailActionLogByDetailId(data.getId());
|
||||
@ -607,10 +612,14 @@ public class RemoteControllerInformationServiceImpl extends ServiceImpl<RemoteCo
|
||||
|
||||
//自动切手动
|
||||
if (RemoteModeEnum.AUTOMATIC.getType().equals(information.getRemoteMode()) && RemoteModeEnum.HAND_MOVEMENT.getType().equals(remoteMode)) {
|
||||
List<RobotTaskDO> doingTask = informationService.selectDoingTaskByRobotNo(robotNo);
|
||||
if (ObjectUtil.isEmpty(doingTask)) {
|
||||
List<RobotDoingTaskDTO> robotDoingTaskNo = taskDetailService.getRobotDoingTaskNo(robotNo);
|
||||
if (ObjectUtil.isEmpty(robotDoingTaskNo)) {
|
||||
throw exception(REMOTE_NOT_HAVE_TASK);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(robotDoingTaskNo) && robotDoingTaskNo.size() > 1) {
|
||||
throw exception(REMOTE_ROBOT_HAVE_MORE_TASK);
|
||||
}
|
||||
|
||||
String operateAction = information.getRemoteIp() + " 切换远遥模式为 " + RemoteModeEnum.getMsg(remoteMode);
|
||||
setRemoteChangeLog(information, robotNo, remoteMode, operateAction);
|
||||
sendRemoteMsgToPP(robotNo, PathPlanningTopicConstant.START_REMOTE_CONTROLLER, RemoteOperationModeEnum.MAN.getType());
|
||||
@ -620,8 +629,8 @@ public class RemoteControllerInformationServiceImpl extends ServiceImpl<RemoteCo
|
||||
|
||||
//自动切自由
|
||||
if (RemoteModeEnum.AUTOMATIC.getType().equals(information.getRemoteMode()) && RemoteModeEnum.FREE.getType().equals(remoteMode)) {
|
||||
List<RobotTaskDO> doingTask = informationService.selectDoingTaskByRobotNo(robotNo);
|
||||
if (ObjectUtil.isNotEmpty(doingTask)) {
|
||||
List<RobotDoingTaskDTO> robotDoingTaskNo = taskDetailService.getRobotDoingTaskNo(robotNo);
|
||||
if (ObjectUtil.isNotEmpty(robotDoingTaskNo)) {
|
||||
throw exception(REMOTE_HAVE_TASK);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user