feat(ops): 手动派单放宽校验,支持跨区域和向忙碌设备派单
移除 canAcceptNewOrder、区域绑定和区域匹配校验,仅保留在线检查。 手动派单由调度员人工判断合理性,自动派单的校验仍在 BadgeDeviceAreaAssignStrategy 中完成。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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