Merge branch 'master' into feat/multi-tenant

# Conflicts:
#	viewsh-module-ops/viewsh-module-environment-biz/src/main/java/com/viewsh/module/ops/environment/dal/redis/TrafficActiveOrderRedisDAO.java
#	viewsh-module-ops/viewsh-module-environment-biz/src/main/java/com/viewsh/module/ops/environment/service/badge/BadgeDeviceStatusServiceImpl.java
#	viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/service/dispatch/UserDispatchStatusServiceImpl.java
This commit is contained in:
lzh
2026-04-13 14:35:27 +08:00
57 changed files with 3612 additions and 106 deletions

View File

@@ -39,14 +39,20 @@ public interface AreaDeviceApi {
@PathVariable("areaId") Long areaId
);
@GetMapping(PREFIX + "/{areaId}/devices")
@Operation(summary = "查询区域设备列表(按类型)")
CommonResult<List<AreaDeviceDTO>> getDevicesByAreaAndType(
@Parameter(description = "区域ID", required = true, example = "1302")
@PathVariable("areaId") Long areaId,
@Parameter(description = "关联类型BADGE/TRAFFIC_COUNTER/BEACON", required = false, example = "BADGE")
@RequestParam(value = "relationType", required = false) String relationType
);
@GetMapping(PREFIX + "/{areaId}/devices")
@Operation(summary = "查询区域设备列表(按类型)")
CommonResult<List<AreaDeviceDTO>> getDevicesByAreaAndType(
@Parameter(description = "区域ID", required = true, example = "1302")
@PathVariable("areaId") Long areaId,
@Parameter(description = "关联类型BADGE/TRAFFIC_COUNTER/BEACON", required = false, example = "BADGE")
@RequestParam(value = "relationType", required = false) String relationType
);
// ==================== 全量查询 ====================
@GetMapping(PREFIX + "/beacons/all")
@Operation(summary = "查询所有启用的Beacon设备轨迹检测用")
CommonResult<List<AreaDeviceDTO>> getAllEnabledBeacons();
// ==================== 按设备查询 ====================

View File

@@ -9,7 +9,10 @@ import lombok.NoArgsConstructor;
/**
* 工牌实时状态详情响应 DTO
* <p>
* 用于工牌详情页展示
* 用于工牌详情页展示,包含:
* - 设备基础信息(状态、电量、上线时间)
* - 工牌物理位置(来自 IoT 轨迹检测)
* - 当前工单信息(来自工牌状态 Redis
*
* @author lzh
*/
@@ -20,6 +23,8 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class BadgeRealtimeStatusRespDTO {
// ==================== 设备基础信息 ====================
@Schema(description = "设备ID", example = "3001")
private Long deviceId;
@@ -32,18 +37,31 @@ public class BadgeRealtimeStatusRespDTO {
@Schema(description = "电量0-100", example = "72")
private Integer batteryLevel;
@Schema(description = "最后心跳时间", example = "2026-01-23 15:00:30")
private String lastHeartbeatTime;
@Schema(description = "设备上线时间", example = "2026-01-23 15:00:30")
private String onlineTime;
@Schema(description = "信号强度dBm", example = "-42")
private Integer rssi;
// ==================== 工牌物理位置(轨迹检测) ====================
@Schema(description = "是否在区域内", example = "true")
@Schema(description = "是否在区域内(基于 IoT 信标检测)", example = "true")
private Boolean isInArea;
@Schema(description = "当前区域ID", example = "101")
@Schema(description = "当前物理所在区域ID", example = "101")
private Long areaId;
@Schema(description = "当前区域名称", example = "A区洗手间")
@Schema(description = "当前物理所在区域名称", example = "A区洗手间")
private String areaName;
// ==================== 当前工单信息 ====================
@Schema(description = "当前工单ID", example = "1234567890")
private Long currentOrderId;
@Schema(description = "当前工单状态", example = "ARRIVED")
private String currentOrderStatus;
@Schema(description = "工单目标区域ID", example = "101")
private Long orderAreaId;
@Schema(description = "工单目标区域名称", example = "A区洗手间")
private String orderAreaName;
}

View File

@@ -0,0 +1,22 @@
package com.viewsh.module.ops.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 轨迹离开原因枚举
*
* @author lzh
*/
@Getter
@AllArgsConstructor
public enum LeaveReasonEnum {
SIGNAL_LOSS("SIGNAL_LOSS", "信号丢失"),
AREA_SWITCH("AREA_SWITCH", "切换到其他区域"),
DEVICE_OFFLINE("DEVICE_OFFLINE", "设备离线");
private final String reason;
private final String description;
}