修改车辆信息

This commit is contained in:
cbs 2025-02-06 14:53:34 +08:00
parent 05f17d31c0
commit afccb0e06b
11 changed files with 79 additions and 9 deletions

View File

@ -89,4 +89,12 @@ public class PositionMapController {
public void downloadFile(HttpServletResponse response) throws IOException { public void downloadFile(HttpServletResponse response) throws IOException {
positionMapService.downloadFile(response); positionMapService.downloadFile(response);
} }
@GetMapping("/getAllMap")
@Operation(summary = "获得所有仓库点位地图Map")
@PreAuthorize("@ss.hasPermission('system:position-map:getAllMap')")
public CommonResult<List<PositionMapDO>> getAllMap() {
List<PositionMapDO> list = positionMapService.getAllMap();
return success(list);
}
} }

View File

@ -27,6 +27,9 @@ public class RobotInformationPageReqVO extends PageParam {
@Schema(description = "任务模式0拒收任务、1正常") @Schema(description = "任务模式0拒收任务、1正常")
private Integer robotTaskModel; private Integer robotTaskModel;
@Schema(description = "自动充电电量")
private Integer autoCharge;
@Schema(description = "mac地址") @Schema(description = "mac地址")
private String macAddress; private String macAddress;

View File

@ -34,6 +34,9 @@ public class RobotInformationPageRespVO {
@ExcelProperty("状态0待命、1任务中、2锁定、3离线、4:充电中、5:故障)") @ExcelProperty("状态0待命、1任务中、2锁定、3离线、4:充电中、5:故障)")
private Integer robotStatus; private Integer robotStatus;
@Schema(description = "自动充电电量")
private Integer autoCharge;
@Schema(description = "楼层") @Schema(description = "楼层")
@ExcelProperty("楼层") @ExcelProperty("楼层")
public String floor; public String floor;
@ -46,10 +49,10 @@ public class RobotInformationPageRespVO {
@ExcelProperty("信息") @ExcelProperty("信息")
public String msg; public String msg;
@Schema(description = "mac地址")
private String macAddress; private String macAddress;
/**
* 任务模式0拒收任务1正常 @Schema(description = "任务模式0拒收任务、1正常")
*/
private Integer robotTaskModel; private Integer robotTaskModel;
} }

View File

@ -62,5 +62,9 @@ public class RobotInformationRespVO {
@ExcelProperty("电量") @ExcelProperty("电量")
private String electricity; private String electricity;
@Schema(description = "自动充电电量")
@ExcelProperty("自动充电电量")
private Integer autoCharge;
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.robot.vo; package cn.iocoder.yudao.module.system.controller.admin.robot.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
@ -43,4 +44,7 @@ public class RobotInformationSaveReqVO {
@NotEmpty(message = "楼层/区域不能为空") @NotEmpty(message = "楼层/区域不能为空")
private Set<Long> floorAreaJson; private Set<Long> floorAreaJson;
@Schema(description = "自动充电电量")
private Integer autoCharge;
} }

View File

@ -7,6 +7,10 @@ import lombok.Data;
*/ */
@Data @Data
public class RobotPositionMapVO { public class RobotPositionMapVO {
/**
* ware_position_map的id
*/
private Long id;
/** /**
* 楼层 * 楼层
*/ */

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.dal.dataobject.robot; package cn.iocoder.yudao.module.system.dal.dataobject.robot;
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@ -61,4 +62,9 @@ public class RobotInformationDO extends BaseDO {
@TableField(typeHandler = JsonLongSetTypeHandler.class) @TableField(typeHandler = JsonLongSetTypeHandler.class)
private Set<Long> floorAreaJson; private Set<Long> floorAreaJson;
/**
* 自动充电电量
*/
private Integer autoCharge;
} }

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.system.enums.robot;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 车辆分页的状态
*/
@Getter
@AllArgsConstructor
public enum RobotInformationPageStatusEnum {
STANDBY(0),//待命
INTASK(1),//任务中
DOLOCK(2),//锁定
OFFLINE(3),//离线
CHARGE(4),//充电中
FAULT(5);//故障
/**
* 类型
*/
private final Integer type;
}

View File

@ -10,6 +10,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.List;
/** /**
* 仓库点位地图 Service 接口 * 仓库点位地图 Service 接口
@ -87,4 +88,10 @@ public interface PositionMapService extends IService<PositionMapDO> {
* @param area * @param area
*/ */
String downloadPngBase64(Integer floor, String area); String downloadPngBase64(Integer floor, String area);
/**
* 获得所有仓库点位地图Map
* @return
*/
List<PositionMapDO> getAllMap();
} }

View File

@ -295,5 +295,12 @@ public class PositionMapServiceImpl extends ServiceImpl<PositionMapMapper, Posit
return encodedString; return encodedString;
} }
@Override
public List<PositionMapDO> getAllMap() {
List<PositionMapDO> positionMapDOS = positionMapMapper.selectList(new LambdaQueryWrapperX<PositionMapDO>()
.orderByAsc(PositionMapDO::getFloor));
return positionMapDOS;
}
} }

View File

@ -97,6 +97,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
// 更新 // 更新
RobotInformationDO updateObj = BeanUtils.toBean(updateReqVO, RobotInformationDO.class); RobotInformationDO updateObj = BeanUtils.toBean(updateReqVO, RobotInformationDO.class);
informationMapper.updateById(updateObj); informationMapper.updateById(updateObj);
redisUtil.set(RobotTaskChcheConstant.ROBOT_NO_MAPPING_MAC + updateObj.getMacAddress(),updateObj.getRobotNo());
} }
@Override @Override
@ -165,10 +166,10 @@ public class RobotInformationServiceImpl implements RobotInformationService {
} }
if (ObjectUtil.isEmpty(object)) { if (ObjectUtil.isEmpty(object)) {
v.setRobotStatus(3); v.setRobotStatus(RobotInformationPageStatusEnum.OFFLINE.getType());
v.setMsg("车辆已经离线"); v.setMsg("车辆已经离线");
}else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) { }else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
v.setRobotStatus(2); v.setRobotStatus(RobotInformationPageStatusEnum.DOLOCK.getType());
v.setMsg("车辆已经锁定"); v.setMsg("车辆已经锁定");
}else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) { }else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) {
//查看机器人最后做的任务是不是充电 //查看机器人最后做的任务是不是充电
@ -179,20 +180,20 @@ public class RobotInformationServiceImpl implements RobotInformationService {
if (ObjectUtil.isNotEmpty(robotTaskDetailDO) if (ObjectUtil.isNotEmpty(robotTaskDetailDO)
&& RobotTaskTypeEnum.CHARGE.getType().equals(robotTaskDetailDO.getTaskType()) && RobotTaskTypeEnum.CHARGE.getType().equals(robotTaskDetailDO.getTaskType())
&& RobotTaskStatusEnum.DOING.getType().equals(robotTaskDetailDO.getTaskStatus())) { && RobotTaskStatusEnum.DOING.getType().equals(robotTaskDetailDO.getTaskStatus())) {
v.setRobotStatus(4); v.setRobotStatus(RobotInformationPageStatusEnum.CHARGE.getType());
v.setMsg("车辆正在充电"); v.setMsg("车辆正在充电");
}else { }else {
v.setRobotStatus(0); v.setRobotStatus(RobotInformationPageStatusEnum.STANDBY.getType());
v.setMsg("车辆正在待命"); v.setMsg("车辆正在待命");
} }
}else if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus()) && ObjectUtil.isNotEmpty(action)) { }else if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus()) && ObjectUtil.isNotEmpty(action)) {
v.setRobotStatus(1); v.setRobotStatus(RobotInformationPageStatusEnum.INTASK.getType());
CommandTypeEnum commandType = CommandTypeEnum.getCommandType(String.valueOf(action)); CommandTypeEnum commandType = CommandTypeEnum.getCommandType(String.valueOf(action));
if (ObjectUtil.isNotEmpty(commandType)) { if (ObjectUtil.isNotEmpty(commandType)) {
v.setMsg("车辆正在"+commandType.getMsg()); v.setMsg("车辆正在"+commandType.getMsg());
} }
} else { } else {
v.setRobotStatus(5); v.setRobotStatus(RobotInformationPageStatusEnum.FAULT.getType());
v.setMsg("车辆发生异常"); v.setMsg("车辆发生异常");
} }