diff --git a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusService.java b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusService.java
deleted file mode 100644
index bbe2909..0000000
--- a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusService.java
+++ /dev/null
@@ -1,229 +0,0 @@
-package com.viewsh.module.ops.core.badge;
-
-import com.viewsh.module.ops.api.badge.BadgeDeviceStatusDTO;
-import com.viewsh.module.ops.enums.BadgeDeviceStatusEnum;
-
-import java.util.List;
-
-/**
- * 工牌设备状态服务接口
- *
- * 职责:
- * 1. 管理工牌设备状态(Redis 存储和查询)
- * 2. 处理设备心跳更新
- * 3. 状态转换(IDLE ↔ BUSY ↔ PAUSED ↔ OFFLINE)
- * 4. 区域设备查询
- * 5. 当前任务关联
- *
- * 设计原则:
- * - 状态存储在 Redis 中,不依赖数据库表
- * - 与保洁员状态解耦,只关注设备本身
- * - 为调度引擎提供设备状态查询能力
- *
- * @author lzh
- */
-public interface BadgeDeviceStatusService {
-
- // ==================== 状态管理 ====================
-
- /**
- * 更新工牌设备状态
- *
- * 状态转换会记录状态变更时间和操作原因
- *
- * @param deviceId 设备ID
- * @param status 目标状态
- * @param operatorId 操作人ID(可为null,表示系统操作)
- * @param reason 状态变更原因
- */
- void updateBadgeStatus(Long deviceId, BadgeDeviceStatusEnum status, Long operatorId, String reason);
-
- /**
- * 批量更新工牌设备状态
- *
- * @param deviceIds 设备ID列表
- * @param status 目标状态
- * @param operatorId 操作人ID
- * @param reason 状态变更原因
- */
- void batchUpdateBadgeStatus(List deviceIds, BadgeDeviceStatusEnum status, Long operatorId, String reason);
-
- // ==================== 状态查询 ====================
-
- /**
- * 获取工牌设备状态
- *
- * @param deviceId 设备ID
- * @return 设备状态DTO,不存在返回null
- */
- BadgeDeviceStatusDTO getBadgeStatus(Long deviceId);
-
- /**
- * 批量获取工牌设备状态
- *
- * @param deviceIds 设备ID列表
- * @return 设备状态DTO列表
- */
- List batchGetBadgeStatus(List deviceIds);
-
- /**
- * 获取指定区域的工牌设备列表
- *
- * 只返回非 OFFLINE 状态的设备
- *
- * @param areaId 区域ID
- * @return 设备状态DTO列表
- */
- List listBadgesByArea(Long areaId);
-
- /**
- * 获取可接单的工牌设备(IDLE 状态)
- *
- * @param areaId 区域ID
- * @return 可接单设备列表
- */
- List listAvailableBadges(Long areaId);
-
- /**
- * 获取所有活跃的工牌设备(非OFFLINE状态)
- *
- * @return 活跃设备列表
- */
- List listActiveBadges();
-
- // ==================== 心跳处理 ====================
-
- /**
- * 处理工牌设备心跳
- *
- * 更新最后心跳时间和电量:
- *
- * - 如果设备之前为 OFFLINE,转为 IDLE
- * - 如果设备已存在,更新心跳时间和电量
- * - 如果设备不存在,创建新记录(状态为 IDLE)
- *
- *
- * @param deviceId 设备ID
- * @param deviceCode 设备编码
- * @param batteryLevel 电量(0-100)
- */
- void handleHeartbeat(Long deviceId, String deviceCode, Integer batteryLevel);
-
- /**
- * 处理工牌设备心跳(带区域信息)
- *
- * @param deviceId 设备ID
- * @param deviceCode 设备编码
- * @param batteryLevel 电量(0-100)
- * @param areaId 当前所在区域ID
- * @param areaName 当前所在区域名称
- */
- void handleHeartbeatWithArea(Long deviceId, String deviceCode, Integer batteryLevel,
- Long areaId, String areaName);
-
- // ==================== 在线状态检查 ====================
-
- /**
- * 检查工牌设备是否在线(非OFFLINE状态)
- *
- * @param deviceId 设备ID
- * @return 是否在线
- */
- boolean isBadgeOnline(Long deviceId);
-
- /**
- * 检查工牌设备心跳是否超时
- *
- * @param deviceId 设备ID
- * @param thresholdMinutes 超时阈值(分钟)
- * @return 是否超时
- */
- boolean isHeartbeatTimeout(Long deviceId, int thresholdMinutes);
-
- /**
- * 检查心跳超时并将超时设备设为OFFLINE
- *
- * 定时任务调用,默认超时时间为30分钟
- */
- void checkAndMarkOfflineDevices();
-
- // ==================== 工单关联 ====================
-
- /**
- * 设置当前工单
- *
- * @param deviceId 设备ID
- * @param orderId 工单ID
- */
- void setCurrentOrder(Long deviceId, Long orderId);
-
- /**
- * 清除当前工单
- *
- * @param deviceId 设备ID
- */
- void clearCurrentOrder(Long deviceId);
-
- /**
- * 获取当前有工单的设备列表
- *
- * @return 有工单的设备列表
- */
- List listBadgesWithCurrentOrder();
-
- // ==================== 区域管理 ====================
-
- /**
- * 更新工牌设备所在区域
- *
- * @param deviceId 设备ID
- * @param areaId 区域ID
- * @param areaName 区域名称
- */
- void updateBadgeArea(Long deviceId, Long areaId, String areaName);
-
- /**
- * 初始化区域设备索引
- *
- * 从 ops_area_device_relation 表加载 BADGE 类型的设备,
- * 建立区域到设备的索引关系
- */
- void initAreaDeviceIndex();
-
- /**
- * 刷新区域设备索引
- *
- * 重新从数据库加载区域设备关系
- */
- void refreshAreaDeviceIndex();
-
- /**
- * 将设备添加到区域索引
- *
- * @param deviceId 设备ID
- * @param areaId 区域ID
- */
- void addToAreaIndex(Long deviceId, Long areaId);
-
- /**
- * 从区域索引移除设备
- *
- * @param deviceId 设备ID
- * @param areaId 区域ID
- */
- void removeFromAreaIndex(Long deviceId, Long areaId);
-
- // ==================== 设备管理 ====================
-
- /**
- * 删除工牌设备状态
- *
- * @param deviceId 设备ID
- */
- void deleteBadgeStatus(Long deviceId);
-
- /**
- * 清理所有离线设备的状态
- */
- void clearOfflineBadges();
-}
diff --git a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusServiceImpl.java b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusServiceImpl.java
deleted file mode 100644
index d65ac77..0000000
--- a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/core/badge/BadgeDeviceStatusServiceImpl.java
+++ /dev/null
@@ -1,581 +0,0 @@
-package com.viewsh.module.ops.core.badge;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.viewsh.module.ops.api.badge.BadgeDeviceStatusDTO;
-import com.viewsh.module.ops.enums.BadgeDeviceStatusEnum;
-import jakarta.annotation.Resource;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Service;
-
-import java.time.LocalDateTime;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-/**
- * 工牌设备状态服务实现
- *
- * 基于 Redis Hash 存储设备状态,Set 维护区域设备索引
- *
- * @author lzh
- */
-@Slf4j
-@Service
-public class BadgeDeviceStatusServiceImpl implements BadgeDeviceStatusService, InitializingBean {
-
- @Resource
- private RedisTemplate redisTemplate;
-
- @Resource
- private ObjectMapper objectMapper;
-
- /**
- * Redis Key 前缀
- */
- private static final String BADGE_STATUS_KEY_PREFIX = "ops:badge:status:";
- private static final String AREA_BADGES_KEY_PREFIX = "ops:area:badges:";
-
- /**
- * 心跳超时时间(分钟)
- */
- private static final int HEARTBEAT_TIMEOUT_MINUTES = 30;
-
- /**
- * 状态过期时间(小时)
- */
- private static final int STATUS_EXPIRE_HOURS = 24;
-
- @Override
- public void afterPropertiesSet() {
- // 启动时初始化区域设备索引
- initAreaDeviceIndex();
- }
-
- // ==================== 状态管理 ====================
-
- @Override
- public void updateBadgeStatus(Long deviceId, BadgeDeviceStatusEnum status, Long operatorId, String reason) {
- if (deviceId == null || status == null) {
- return;
- }
-
- try {
- String key = BADGE_STATUS_KEY_PREFIX + deviceId;
-
- // 获取当前状态
- BadgeDeviceStatusDTO currentStatus = getBadgeStatus(deviceId);
-
- // 验证状态转换
- if (currentStatus != null && currentStatus.getStatus() != null) {
- if (!currentStatus.getStatus().canTransitionTo(status)) {
- log.warn("非法的状态转换: deviceId={}, from={}, to={}, reason={}",
- deviceId, currentStatus.getStatus(), status, reason);
- return;
- }
- }
-
- // 更新状态
- Map statusMap = new HashMap<>();
- statusMap.put("deviceId", deviceId);
- statusMap.put("status", status.getCode());
- statusMap.put("statusChangeTime", LocalDateTime.now().toString());
-
- if (currentStatus != null) {
- statusMap.put("deviceCode", currentStatus.getDeviceCode());
- statusMap.put("batteryLevel", currentStatus.getBatteryLevel());
- statusMap.put("currentAreaId", currentStatus.getCurrentAreaId());
- statusMap.put("currentAreaName", currentStatus.getCurrentAreaName());
- statusMap.put("currentOpsOrderId", currentStatus.getCurrentOpsOrderId());
- statusMap.put("lastHeartbeatTime", currentStatus.getLastHeartbeatTime());
- }
-
- redisTemplate.opsForHash().putAll(key, statusMap);
- redisTemplate.expire(key, STATUS_EXPIRE_HOURS, TimeUnit.HOURS);
-
- log.info("更新工牌设备状态: deviceId={}, status={}, operatorId={}, reason={}",
- deviceId, status, operatorId, reason);
-
- } catch (Exception e) {
- log.error("更新工牌设备状态失败: deviceId={}, status={}", deviceId, status, e);
- }
- }
-
- @Override
- public void batchUpdateBadgeStatus(List deviceIds, BadgeDeviceStatusEnum status, Long operatorId, String reason) {
- if (deviceIds == null || deviceIds.isEmpty() || status == null) {
- return;
- }
-
- for (Long deviceId : deviceIds) {
- updateBadgeStatus(deviceId, status, operatorId, reason);
- }
-
- log.info("批量更新工牌设备状态: count={}, status={}, operatorId={}", deviceIds.size(), status, operatorId);
- }
-
- // ==================== 状态查询 ====================
-
- @Override
- public BadgeDeviceStatusDTO getBadgeStatus(Long deviceId) {
- if (deviceId == null) {
- return null;
- }
-
- try {
- String key = BADGE_STATUS_KEY_PREFIX + deviceId;
- Map