设备使用状态

This commit is contained in:
cbs 2025-06-04 08:55:11 +08:00
parent 4beceefef7
commit fc8c96e5c2
11 changed files with 24 additions and 17 deletions

View File

@ -35,6 +35,7 @@ management:
mqtt:
# host: tcp://123.57.12.40:1883
host: tcp://127.0.0.1:1883
# host: tcp://10.10.7.195:1883
username: adminuser
password: adminuser
qos: 2

View File

@ -19,4 +19,9 @@ public class RobotSkuInfoDTO {
* 物料数量
*/
private Long skuNumber;
/**
* 层数
*/
private Integer locationStorey;
}

View File

@ -88,7 +88,6 @@ public class PathApiImpl implements PathApi {
} finally {
MDC.clear();
}
// taskService.ppDistributionTask(message); 废弃了
});
}

View File

@ -338,6 +338,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
robotSkuInfo.setHaveSku(ZeroOneEnum.ONE.getType());
robotSkuInfo.setSkuNumber(wareHouseLocationDO.getSkuNumber());
robotSkuInfo.setSkuInfo(wareHouseLocationDO.getSkuInfo());
robotSkuInfo.setLocationStorey(wareHouseLocationDO.getLocationStorey());
redisUtil.set(RobotTaskChcheConstant.ROBOT_TASK_SKU_INFO + robotCompleteTaskDTO.getMac(), JSON.toJSONString(robotSkuInfo));
wareHouseLocationDO.setSkuInfo(null);
wareHouseLocationDO.setSkuNumber(0L);

View File

@ -74,8 +74,8 @@ public class DeviceInformationPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "设备使用状态(IDLE:空闲、USEING:使用中)")
private String deviceUseStatus;
@Schema(description = "设备使用状态(0:空闲、1:使用中)")
private Integer deviceUseStatus;
@Schema(description = "设备专有属性1自动充电类型充电桩、2手动充电类型充电桩")
private Integer deviceAttribute;

View File

@ -91,9 +91,9 @@ public class DeviceInformationRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "设备使用状态(IDLE:空闲、USEING:使用中)")
@ExcelProperty("设备使用状态(IDLE:空闲、USEING:使用中)")
private String deviceUseStatus;
@Schema(description = "设备使用状态(0:空闲、1:使用中)")
@ExcelProperty("设备使用状态(0:空闲、1:使用中)")
private Integer deviceUseStatus;
@Schema(description = "设备专有属性1自动充电类型充电桩、2手动充电类型充电桩")
@ExcelProperty("设备专有属性1自动充电类型充电桩、2手动充电类型充电桩")

View File

@ -72,8 +72,8 @@ public class DeviceInformationSaveReqVO {
@Schema(description = "设备最后通讯时间")
private LocalDateTime deviceLastTime;
@Schema(description = "设备使用状态(IDLE:空闲、USEING:使用中)")
private String deviceUseStatus;
@Schema(description = "设备使用状态(0:空闲、1:使用中)")
private Integer deviceUseStatus;
@Schema(description = "设备专有属性1自动充电类型充电桩、2手动充电类型充电桩")
private Integer deviceAttribute;

View File

@ -112,9 +112,9 @@ public class DeviceInformationDO extends BaseDO {
*/
private LocalDateTime deviceLastTime;
/**
* 设备使用状态IDLE:空闲USEING:使用中
* 设备使用状态0:空闲1:使用中
*/
private String deviceUseStatus;
private Integer deviceUseStatus;
/**
* 设备专有属性1自动充电类型充电桩2手动充电类型充电桩
*/

View File

@ -39,7 +39,7 @@ public interface DeviceInformationMapper extends BaseMapperX<DeviceInformationDO
* @param lastUser
*/
void updateDeviceUseStatus(@Param("deviceNo") String deviceNo,
@Param("deviceUseStatus") String deviceUseStatus,
@Param("deviceUseStatus") Integer deviceUseStatus,
@Param("lastUser") String lastUser);
/**
@ -47,7 +47,7 @@ public interface DeviceInformationMapper extends BaseMapperX<DeviceInformationDO
* @param lastUser
*/
void setDeviceReleaseByLastUser(@Param("lastUser") String lastUser,
@Param("deviceUseStatus") String deviceUseStatus);
@Param("deviceUseStatus") Integer deviceUseStatus);
/**
* 根据地图id删除

View File

@ -9,13 +9,13 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum DeviceUseStatusEnum {
IDLE("IDLE", "空闲"),
USEING("USEING", "使用中");
IDLE(0, "空闲"),
USEING(1, "使用中");
/**
* 类型
*/
private final String type;
private final Integer type;
/**
* 说明
*/

View File

@ -111,7 +111,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
List<DeviceInformationDO> deviceInformationDOS = deviceInformationMapper.selectList(new LambdaQueryWrapperX<DeviceInformationDO>()
.eq(DeviceInformationDO::getDeviceEnable, ZeroOneEnum.ONE.getType())
.eq(DeviceInformationDO::getDeviceUseStatus, DeviceUseStatusEnum.IDLE.getType())
.eq(DeviceInformationDO::getDeviceUseStatus, ZeroOneEnum.ZERO.getType())
.eq(DeviceInformationDO::getDeviceType, DeviceTypeEnum.CHARGING_STATION.getType()));
if (ObjectUtil.isEmpty(deviceInformationDOS)) {
@ -131,7 +131,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
}
List<RobotInformationDO> moveToWaitRobots = getCanLeaveChargingRobots(chargeIngRobots, chargeConfig, robots.size());
if (ObjectUtil.isEmpty(moveToWaitRobots)) {
log.info("充电中的车辆未充满电");
log.info("充电中的车辆未达到离开的阀值");
return;
}
robotPathPlanningService.moveRobotToWait(moveToWaitRobots);
@ -213,6 +213,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
Boolean adequateBatteryCapacity = remainingElectricityBigger(chargeConfig, robot);
if (adequateBatteryCapacity) {
robot.setRobotStatus(RobotStatusEnum.STAND_BY.getType());
String socKey = RobotTaskChcheConstant.ROBOT_INFORMATION_SOC + robot.getMacAddress();
Object o = redisUtil.get(socKey);
Integer soc = ObjectUtil.isEmpty(o) ? 0 : Integer.parseInt(o.toString());