feat(ops): 工牌状态返回昵称字段,手动派单支持传入设备名称
- BadgeStatusRespDTO 新增 nickname 字段,透传设备昵称 - CleanManualDispatchReqDTO 新增 assigneeName,派单时携带设备显示名 - CleanWorkOrderServiceImpl 将 assigneeName 传递给派单引擎 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -275,6 +275,7 @@ public class CleanBadgeServiceImpl implements CleanBadgeService {
|
||||
return BadgeStatusRespDTO.builder()
|
||||
.deviceId(status.getDeviceId())
|
||||
.deviceKey(status.getDeviceCode())
|
||||
.nickname(status.getNickname())
|
||||
.status(status.getStatusCode())
|
||||
.batteryLevel(status.getBatteryLevel())
|
||||
.lastHeartbeatTime(formatTimestamp(status.getLastHeartbeatTime()))
|
||||
|
||||
@@ -347,6 +347,7 @@ public class CleanWorkOrderServiceImpl implements CleanWorkOrderService {
|
||||
.orderId(req.getOrderId())
|
||||
.operator(OperatorContext.ofAdmin(req.getOperatorId(), resolveUserName(req.getOperatorId())))
|
||||
.assigneeId(req.getAssigneeId())
|
||||
.assigneeName(req.getAssigneeName())
|
||||
.reason(req.getRemark())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.viewsh.module.ops.environment.service.cleanorder.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,10 @@ public class CleanManualDispatchReqDTO {
|
||||
@NotNull(message = "目标设备ID不能为空")
|
||||
private Long assigneeId;
|
||||
|
||||
@Schema(description = "目标设备名称(昵称或设备编码)", example = "男卫-01")
|
||||
@Size(max = 100, message = "设备名称不能超过100字符")
|
||||
private String assigneeName;
|
||||
|
||||
@Schema(description = "派单备注", example = "紧急情况,指定该设备处理")
|
||||
private String remark;
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ public class BadgeStatusRespDTO {
|
||||
@Schema(description = "设备编码", example = "badge_001")
|
||||
private String deviceKey;
|
||||
|
||||
@Schema(description = "设备昵称(用户可读的显示名称)", example = "张三的工牌")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "状态(IDLE/BUSY/OFFLINE/PAUSED)", example = "IDLE")
|
||||
private String status;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user