Merge branch 'master' into feat/multi-tenant
Resolve conflicts by accepting master changes for: - Jenkinsfile (CI/CD release/next branch support) - OrderCodeGenerator (Redis seq sync fix) - OrderCodeGeneratorTest (updated tests) 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;
|
||||
|
||||
|
||||
@@ -55,15 +55,9 @@ public class CleanOrderBusinessStrategy implements OrderBusinessStrategy {
|
||||
if (!badge.isOnline()) {
|
||||
throw new IllegalStateException("目标保洁设备当前离线,不能手动派单");
|
||||
}
|
||||
if (!badge.canAcceptNewOrder()) {
|
||||
throw new IllegalStateException("目标保洁设备当前不可接单");
|
||||
}
|
||||
if (order.getAreaId() != null && badge.getCurrentAreaId() == null) {
|
||||
throw new IllegalStateException("目标保洁设备当前未绑定区域,不能手动派单");
|
||||
}
|
||||
if (order.getAreaId() != null && !order.getAreaId().equals(badge.getCurrentAreaId())) {
|
||||
throw new IllegalStateException("目标保洁设备不在当前工单所属区域");
|
||||
}
|
||||
// 注意:以下校验已按产品需求移除,由调度员人工判断合理性:
|
||||
// 1. canAcceptNewOrder() — 允许向 BUSY/PAUSED 工牌手动派单,工单进入 QUEUED 排队
|
||||
// 2. 区域一致性校验 — 允许跨区域分配,支持灵活调度场景
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -87,4 +81,11 @@ public class CleanOrderBusinessStrategy implements OrderBusinessStrategy {
|
||||
log.info("[CleanStrategy] 升级优先级后置完成: orderId={}, newPriority={}, queueId={}",
|
||||
cmd.getOrderId(), newPriority, queueDTO.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterDispatch(DispatchOrderCommand cmd, OpsOrderDO order) {
|
||||
// TODO: 转派场景下(order.getAssigneeId() != null && !order.getAssigneeId().equals(cmd.getAssigneeId())),
|
||||
// 应向旧工牌发送震动/语音通知告知任务已转移,避免旧工牌持有者继续前往已无效的区域。
|
||||
// 实现参考:cleanOrderNotificationService.sendReassignNotification(oldBadgeId, order.getOrderCode())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user