文档修正:校准Mermaid图方向与渲染可读性
This commit is contained in:
1 parent
18a3bfb50e
commit
29ce31f00e
6 files changed
+25
-35
No files matched your search
@@ -10,9 +10,9 @@
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Step1["1. 局域网共享试用<br/>段内业务老师与教务主管开展真实教学排课与考勤试用"]
|
||||
Step2["2. 问题归类与定级 (Triage)<br/>🔴 BUG:阻断缺陷,当日修复并自动化回归<br/>🟡 UX:界面与交互体验,周版本批次优化<br/>🔵 KNOWN_GAP:归入已知技术缺口专项排期<br/>⚪ REQUIREMENT:登记入甲方确认清单待批复"]
|
||||
Step3["3. 小版本迭代与发布 (Release Cycles)<br/>本地构建验证 → Surefire 全量通过 → 部署试用分支"]
|
||||
Step1["1. 局域网共享试用<br/>业务老师与主管开展教学排课/考勤试用"]
|
||||
Step2["2. 问题归类与定级 (Triage)<br/>🔴 BUG: 阻断缺陷,当日修复回归<br/>🟡 UX: 交互体验,周版本批次优化<br/>🔵 KNOWN_GAP: 归入已知缺口排期<br/>⚪ REQUIREMENT: 登记入甲方清单待批"]
|
||||
Step3["3. 小版本迭代发布 (Release Cycles)<br/>本地构建 → Surefire全量验证 → 部署试用"]
|
||||
|
||||
Step1 -->|"发现问题 / 提出需求"| Step2
|
||||
Step2 -->|"敏捷推进"| Step3
|
||||
|
||||
@@ -94,8 +94,8 @@ flowchart TB
|
||||
C1["设备属性:向 DMS 门锁下发的有效时间区间与电子钥匙凭据 (密码/卡片)<br/>状态流转:待下发 -> 平台已受理 -> 设备执行中 -> 设备生效 -> 撤销中 -> 已注销<br/>属性特征:依赖外部网络与硬件状态,可异步重试,失败不推翻住宿业务事实"]
|
||||
end
|
||||
|
||||
LayerB -->|"1 间宿舍可容纳多个住宿安排"| LayerA
|
||||
LayerC -->|"1 条住宿事实产生门禁授权要求"| LayerB
|
||||
LayerA -->|"1 间物理宿舍可对应多个住宿安排"| LayerB
|
||||
LayerB -->|"1 条住宿事实产生对应门禁授权需求"| LayerC
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
- **轮询架构设计**:
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Req["Web 请求 (如确认入住)"] --> LocalDB["本地持久化 Accommodation (已入住) 与 DoorAuthorization (ISSUING)<br/>提交本地数据库事务 (Commit Local DB)"]
|
||||
LocalDB --> AsyncDms["异步派发调用 DMS 创建钥匙 -> 返回 operationId (耗时 ~200ms)<br/>本地记录 ExternalOperationRecord (status = ACCEPTED, next_poll_time = now + 10s)<br/>快速向前端返回 HTTP 200 (附带提示:“住宿已分配,门锁授权下发中”)"]
|
||||
AsyncDms --> Scheduler["后台调度引擎 (Quartz / Spring Scheduled ThreadPool - 专用IO线程池)<br/>扫描 next_poll_time <= NOW() 的任务 -> 调用 /doorlock/query-operation-status<br/>更新操作记录与授权记录状态 -> 若为 success 则推为 ACTIVE"]
|
||||
Req["Web 请求 (如确认入住)"]
|
||||
--> LocalDB["本地事务持久化 (Commit Local DB)<br/>Accommodation (已入住) + DoorAuthorization (ISSUING)"]
|
||||
--> AsyncDms["异步派发 DMS 创建钥匙 (耗时约200ms)<br/>记录 ExternalOperationRecord (status=ACCEPTED, 10s后轮询)<br/>快速返回 HTTP 200 (提示:授权下发中)"]
|
||||
--> Scheduler["后台调度引擎轮询 (Dedicated IO Pool)<br/>扫描到期任务调用 /doorlock/query-operation-status<br/>操作成功推为 ACTIVE"]
|
||||
```
|
||||
|
||||
### 1.2 门锁 vs 网关轮询参数隔离
|
||||
|
||||
@@ -99,10 +99,10 @@
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Step1["管理员进入“门锁资源映射”界面"] --> Step2["点击“从 DMS 拉取房源目录”"]
|
||||
Step2 -->|"适配器调用 POST /rest/place/room/list"| Step3["系统解析出 DMS 的 Building, Floor, Room, placeId, 挂载的 lockId, 硬件SN"]
|
||||
Step3 --> Step4["系统依据“楼栋-楼层-房间”名称执行规则预匹配"]
|
||||
Step4 --> Step5["管理员在界面核对预配对结果,确认手动微调后点击“确认持久化绑定”"]
|
||||
Step5 --> Step6["写入 train_external_resource_mapping,完成两套系统物理基线的稳定锁定"]
|
||||
Step2 -->|"POST /rest/place/room/list"| Step3["系统解析 DMS 房源信息<br/>(Building, Floor, Room, placeId, lockId, SN)"]
|
||||
Step3 --> Step4["依据“楼栋-楼层-房间”名称执行规则预匹配"]
|
||||
Step4 --> Step5["管理员核对预配对结果<br/>手动微调后点击“确认持久化绑定”"]
|
||||
Step5 --> Step6["写入 train_external_resource_mapping<br/>完成两套系统物理基线锁定"]
|
||||
```
|
||||
- **核心保障**:同步操作仅建立与更新映射表,**绝不自动删除或篡改本地 `train_dormitory_info` 的基础房源台账**。本地房源依然是学员管理系统的独立主数据。
|
||||
|
||||
|
||||
@@ -77,18 +77,11 @@
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
UI["前端 Accommodation / 个人中心"] --> Domain["业务领域层: 住宿分配 / 换房补偿 / 报到联动<br/>(绝对 Source of Truth)"]
|
||||
Domain -->|"通过强类型 DTO,屏蔽外部厂商细节"| Gateway["中立网关接口: DoorAccessGateway<br/>(grant / revoke / query)"]
|
||||
|
||||
subgraph Adapter["DMS 集成适配器: DmsDoorAccessGateway (SPI 模式)"]
|
||||
direction TB
|
||||
TM["DmsTokenManager: 进程级单飞排他锁 (防并发覆盖踩踏)"]
|
||||
Clients["细分 HTTP 客户端: PlaceClient / DoorLockClient / KeyClient / OpClient"]
|
||||
Poller["DmsOperationPoller: 后台 10 秒对账调度器 (解除 HTTP 线程阻塞)"]
|
||||
end
|
||||
|
||||
Gateway --> Adapter
|
||||
Adapter -->|"HTTPS / Cookie 传递 token"| External["外部 DMS 物联网平台: https://dms.dmsiot.com"]
|
||||
UI["前端 Accommodation / 个人中心"]
|
||||
-->|"业务动作触发"| Domain["业务领域层 (绝对 Source of Truth)<br/>住宿分配 / 换房补偿 / 报到联动"]
|
||||
-->|"强类型 DTO 屏蔽厂商细节"| Gateway["中立网关接口: DoorAccessGateway<br/>(grant / revoke / query)"]
|
||||
-->|"SPI 适配器实现"| Adapter["DMS 适配器: DmsDoorAccessGateway<br/>- DmsTokenManager (进程级单飞排他锁)<br/>- 细分 HTTP 客户端 (Place / Lock / Key / Op)<br/>- DmsOperationPoller (10秒后台对账调度)"]
|
||||
-->|"HTTPS / Cookie 传递 Token"| External["外部 DMS 物联网平台<br/>(https://dms.dmsiot.com)"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -12,18 +12,14 @@
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Req["客户端 HTTP Request<br/>(仅携带 Bearer JWT Token,禁止/忽略 query 或 body 中的 identityId)"]
|
||||
Filter["Spring Security Filter: JwtAuthenticationTokenFilter<br/>(验签并提取 claims 中的 userId)"]
|
||||
SecCtx["SecurityContextHolder.getContext().getAuthentication()<br/>(获取受信任的 LoginUser.getUserId())"]
|
||||
Helper["Service 内部数据推导 (SecurityContextHelper)"]
|
||||
Req["客户端 HTTP Request<br/>(仅携带 Bearer JWT,忽略请求体中的 identityId)"]
|
||||
--> Filter["Spring Security Filter (JwtAuthenticationTokenFilter)<br/>验签并提取 claims 中的 userId"]
|
||||
--> SecCtx["SecurityContextHolder (受信任上下文)<br/>获取 LoginUser.getUserId()"]
|
||||
--> Helper["Service 内部推导 (SecurityContextHelper)"]
|
||||
|
||||
Req --> Filter
|
||||
Filter --> SecCtx
|
||||
SecCtx --> Helper
|
||||
|
||||
Helper -->|"拥有 train_teacher 角色"| TeacherRole["SELECT t_id FROM train_teacher WHERE user_id = #{userId}"]
|
||||
Helper -->|"拥有 train_student 角色"| StudentRole["SELECT s_id FROM train_student WHERE user_id = #{userId}"]
|
||||
Helper -->|"拥有 admin / train_admin 角色"| AdminRole["按管理员角色规则放行或基于组织机构过滤"]
|
||||
Helper -->|"拥有 train_teacher 角色"| TeacherRole["SELECT t_id FROM train_teacher<br/>WHERE user_id = #{userId}"]
|
||||
Helper -->|"拥有 train_student 角色"| StudentRole["SELECT s_id FROM train_student<br/>WHERE user_id = #{userId}"]
|
||||
Helper -->|"拥有 admin / train_admin 角色"| AdminRole["管理员放行 / 组织机构过滤"]
|
||||
```
|
||||
|
||||
### 1.1 核心铁律
|
||||
|
||||
Reference in new issue
Block a user