Files
railwaysystem/docs/visual/architecture.html
T

281 lines
17 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>系统架构与技术栈 - RailwaySystem SYFJGYD学员管理系统</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%231d4ed8' d='M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4z'/></svg>">
<link rel="stylesheet" href="assets/docs.css">
<style>
/* 架构图专属容器与样式 */
.arch-canvas-card {
background: #ffffff;
border: 1px solid var(--border-light);
border-radius: var(--radius-lg);
padding: 2rem;
box-shadow: var(--shadow-card);
margin-bottom: 2.5rem;
}
.arch-svg-wrap {
width: 100%;
overflow-x: auto;
padding: 0.5rem 0;
}
.arch-svg {
min-width: 980px;
width: 100%;
height: auto;
display: block;
}
/* 架构分层文字卡片 */
.arch-layer-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 1.25rem;
margin-top: 1.5rem;
}
</style>
</head>
<body>
<!-- 顶部主导航 -->
<nav class="navbar">
<div class="nav-brand-wrap">
<a href="index.html" class="nav-brand">
<svg viewBox="0 0 24 24"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm1.5-6H6V6h12v5z"/></svg>
<div>
<div class="brand-title">RailwaySystem</div>
<div class="brand-sub">SYFJGYD学员管理系统</div>
</div>
</a>
<span class="brand-pill">Final Candidate · 待正式部署</span>
</div>
<ul class="nav-menu">
<li><a href="index.html" class="nav-link">首页</a></li>
<li><a href="business-flow.html" class="nav-link">业务</a></li>
<li><a href="architecture.html" class="nav-link active">系统</a></li>
<li><a href="testing.html" class="nav-link">质量</a></li>
<li><a href="release-status.html" class="nav-link">发布</a></li>
<li><a href="modules.html" class="nav-link">14大业务模块清单</a></li>
<li><a href="data-model.html" class="nav-link">实体关系模型(ER)</a></li>
<li><a href="deployment.html" class="nav-link">部署拓扑与脚本Delta</a></li>
<li><a href="http://192.168.139.218:9980/sict/railwaysystem/-/blob/feat/cicd-pipeline/docs/handbook/08-deployment-and-release.md" target="_blank" rel="noopener noreferrer" class="nav-handbook-link">&gt; 查阅部署发布手册</a></li>
<li><a href="http://192.168.139.218:9980/sict/railwaysystem/-/blob/feat/cicd-pipeline/docs/README.md" target="_blank" rel="noopener noreferrer" class="nav-back-link">&larr; 文档中心</a></li>
</ul>
</nav>
<!-- 页面主体容器 -->
<main class="page-container">
<header class="page-hero">
<div class="hero-pretitle">Technical System Architecture</div>
<h1 class="hero-title-main">分层系统架构与技术栈</h1>
<p class="hero-lead-text">
真实还原系统分层架构拓扑:中心纵向贯穿浏览器前端、API安全鉴权、培训业务领域层、持久层及人大金仓数据库;侧边协同缓存与系统工具,并严格区分当前实现的 Web 班牌与预留的外部硬件适配器。
</p>
</header>
<!-- 真正架构图 SVG 容器 -->
<section class="arch-canvas-card">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;">
<div>
<h2 style="font-size: 1.25rem; font-weight: 700; color: var(--navy-900);">系统全局分层拓扑与通信边界</h2>
<p style="font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem;">实线代表已上线的当前实现;虚线代表规划中的预留扩展接口</p>
</div>
<div style="display: flex; gap: 0.85rem; align-items: center; font-size: 0.8rem;">
<span style="display: inline-flex; align-items: center; gap: 4px;"><span style="width: 12px; height: 12px; background: #eff6ff; border: 1.5px solid #1d4ed8; border-radius: 2px;"></span> 当前实现 (IMPLEMENTED)</span>
<span style="display: inline-flex; align-items: center; gap: 4px;"><span style="width: 12px; height: 12px; background: #faf5ff; border: 1.5px dashed #a855f7; border-radius: 2px;"></span> 预留接口 (RESERVED)</span>
</div>
</div>
<div class="arch-svg-wrap">
<svg class="arch-svg" viewBox="0 0 1020 620" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrow" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto">
<path d="M0,1 L7,4 L0,7 Z" fill="#475569" />
</marker>
<marker id="arrow-blue" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto">
<path d="M0,1 L7,4 L0,7 Z" fill="#1d4ed8" />
</marker>
<marker id="arrow-purple" markerWidth="8" markerHeight="8" refX="6" refY="4" orient="auto">
<path d="M0,1 L7,4 L0,7 Z" fill="#a855f7" />
</marker>
</defs>
<!-- 1. 接入层 (Browser / Frontend) -->
<g id="layer-client">
<rect x="260" y="20" width="500" height="70" rx="8" fill="#ffffff" stroke="#1d4ed8" stroke-width="2" />
<text x="510" y="48" text-anchor="middle" font-size="14" font-weight="700" fill="#0f172a">Browser / Frontend (浏览器客户端)</text>
<text x="510" y="70" text-anchor="middle" font-size="11" fill="#64748b">Vue 2.6 · Element UI · Axios · 路由动态加载 sys_menu · Web 电子班牌路由 (/equip/board)</text>
</g>
<!-- Client -> API & Security -->
<line x1="510" y1="90" x2="510" y2="130" stroke="#1d4ed8" stroke-width="2" marker-end="url(#arrow-blue)" />
<text x="525" y="115" font-size="11" fill="#64748b">HTTP / JSON (RESTful API)</text>
<!-- 2. API & Security 层 -->
<g id="layer-api-security">
<rect x="260" y="130" width="500" height="80" rx="8" fill="#ffffff" stroke="#1d4ed8" stroke-width="2" />
<text x="510" y="158" text-anchor="middle" font-size="14" font-weight="700" fill="#0f172a">API & Security (接口网关与安全中枢)</text>
<text x="510" y="180" text-anchor="middle" font-size="11" fill="#334155">Spring Security 过滤器链 · JWT 无状态令牌解析 · RBAC 角色权限验证 (@PreAuthorize)</text>
<text x="510" y="198" text-anchor="middle" font-size="10" fill="#64748b">统一异常捕获 (GlobalExceptionHandler) · 身份证脱敏过滤器 (末4位掩码)</text>
</g>
<!-- 侧边左 1: Redis 缓存 -->
<g id="pillar-redis">
<rect x="40" y="130" width="180" height="180" rx="8" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" />
<text x="130" y="160" text-anchor="middle" font-size="13" font-weight="700" fill="#0f172a">Redis 缓存支撑</text>
<text x="130" y="185" text-anchor="middle" font-size="11" fill="#64748b">端口: 6379 (DB 0)</text>
<line x1="55" y1="200" x2="205" y2="200" stroke="#e2e8f0" stroke-width="1" />
<text x="65" y="225" font-size="11" fill="#334155">• 用户登录 Token 缓存</text>
<text x="65" y="250" font-size="11" fill="#334155">• 验证码防重放缓存</text>
<text x="65" y="275" font-size="11" fill="#334155">• 权限路由元数据</text>
</g>
<!-- API <-> Redis -->
<line x1="260" y1="170" x2="220" y2="170" stroke="#475569" stroke-width="1.5" marker-end="url(#arrow)" />
<!-- 侧边右 1: 系统工具与审计 -->
<g id="pillar-tools">
<rect x="800" y="130" width="180" height="180" rx="8" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" />
<text x="890" y="160" text-anchor="middle" font-size="13" font-weight="700" fill="#0f172a">System Tools & 审计</text>
<text x="890" y="185" text-anchor="middle" font-size="11" fill="#64748b">系统工具与合规底座</text>
<line x1="815" y1="200" x2="965" y2="200" stroke="#e2e8f0" stroke-width="1" />
<text x="825" y="225" font-size="11" fill="#334155">• Swagger 接口平台</text>
<text x="825" y="250" font-size="11" fill="#334155">• 操作日志 (OperLog)</text>
<text x="825" y="275" font-size="11" fill="#334155">• 表单构建与代码生成</text>
</g>
<!-- API <-> Tools -->
<line x1="760" y1="170" x2="800" y2="170" stroke="#475569" stroke-width="1.5" marker-end="url(#arrow)" />
<!-- API & Security -> Training Domain -->
<line x1="510" y1="210" x2="510" y2="250" stroke="#1d4ed8" stroke-width="2" marker-end="url(#arrow-blue)" />
<!-- 3. Training Domain 业务领域层 -->
<g id="layer-domain">
<rect x="260" y="250" width="500" height="150" rx="8" fill="#ffffff" stroke="#1d4ed8" stroke-width="2" />
<text x="510" y="278" text-anchor="middle" font-size="14" font-weight="700" fill="#0f172a">Training Domain (核心教务业务领域层)</text>
<!-- 子模块框 1 -->
<rect x="280" y="295" width="220" height="42" rx="4" fill="#f8fafc" stroke="#e2e8f0" />
<text x="390" y="315" text-anchor="middle" font-size="11" font-weight="600" fill="#0f172a">主数据服务 (Master Data)</text>
<text x="390" y="329" text-anchor="middle" font-size="9" fill="#64748b">教师/学员/课程/教室/场地</text>
<!-- 子模块框 2 -->
<rect x="520" y="295" width="220" height="42" rx="4" fill="#f8fafc" stroke="#e2e8f0" />
<text x="630" y="315" text-anchor="middle" font-size="11" font-weight="600" fill="#0f172a">排课调度引擎 (Scheduling)</text>
<text x="630" y="329" text-anchor="middle" font-size="9" fill="#64748b">四维预检 / Warning / 场地XOR</text>
<!-- 子模块框 3 -->
<rect x="280" y="345" width="220" height="42" rx="4" fill="#f8fafc" stroke="#e2e8f0" />
<text x="390" y="365" text-anchor="middle" font-size="11" font-weight="600" fill="#0f172a">现场执行服务 (Execution)</text>
<text x="390" y="379" text-anchor="middle" font-size="9" fill="#64748b">报到强事务 / 考勤打卡幂等性</text>
<!-- 子模块框 4 -->
<rect x="520" y="345" width="220" height="42" rx="4" fill="#f8fafc" stroke="#e2e8f0" />
<text x="630" y="365" text-anchor="middle" font-size="11" font-weight="600" fill="#0f172a">结训流转服务 (Completion)</text>
<text x="630" y="379" text-anchor="middle" font-size="9" fill="#64748b">Plan状态流转 / 退训保护不变量</text>
</g>
<!-- 侧边右 2: 班牌物联与外部适配器 -->
<g id="pillar-adapter">
<rect x="800" y="335" width="180" height="150" rx="8" fill="#ffffff" stroke="#cbd5e1" stroke-width="1.5" />
<text x="890" y="362" text-anchor="middle" font-size="13" font-weight="700" fill="#0f172a">电子班牌与物联适配</text>
<line x1="815" y1="375" x2="965" y2="375" stroke="#e2e8f0" stroke-width="1" />
<rect x="815" y="388" width="150" height="36" rx="4" fill="#eff6ff" stroke="#bfdbfe" />
<text x="890" y="405" text-anchor="middle" font-size="10" font-weight="700" fill="#1d4ed8">当前实现 (CURRENT)</text>
<text x="890" y="418" text-anchor="middle" font-size="9" fill="#1e40af">Web 班牌路由 / 降级映射</text>
<rect x="815" y="432" width="150" height="36" rx="4" fill="#faf5ff" stroke="#d8b4fe" stroke-dasharray="3 3" />
<text x="890" y="449" text-anchor="middle" font-size="10" font-weight="700" fill="#7e22ce">预留接口 (RESERVED)</text>
<text x="890" y="462" text-anchor="middle" font-size="9" fill="#6b21a8">硬件闸机 / 班牌外部协议</text>
</g>
<!-- Domain <-> Adapter -->
<line x1="760" y1="370" x2="800" y2="370" stroke="#475569" stroke-width="1.5" marker-end="url(#arrow)" />
<!-- Training Domain -> Persistence -->
<line x1="510" y1="400" x2="510" y2="440" stroke="#1d4ed8" stroke-width="2" marker-end="url(#arrow-blue)" />
<!-- 4. Persistence 持久层 -->
<g id="layer-persistence">
<rect x="260" y="440" width="500" height="65" rx="8" fill="#ffffff" stroke="#1d4ed8" stroke-width="2" />
<text x="510" y="468" text-anchor="middle" font-size="14" font-weight="700" fill="#0f172a">Persistence (数据持久层与连接池)</text>
<text x="510" y="490" text-anchor="middle" font-size="11" fill="#64748b">MyBatis 3.5 · PageHelper 分页插件 · Alibaba Druid 数据库连接池 (单主库配置)</text>
</g>
<!-- Persistence -> Kingbase -->
<line x1="510" y1="505" x2="510" y2="535" stroke="#1d4ed8" stroke-width="2" marker-end="url(#arrow-blue)" />
<!-- 5. 存储层: KingbaseES -->
<g id="layer-kingbase">
<rect x="230" y="540" width="560" height="60" rx="8" fill="#ecfdf5" stroke="#059669" stroke-width="1.5" />
<text x="510" y="562" text-anchor="middle" font-size="14" font-weight="700" fill="#065f46">KingbaseES (生产主库)</text>
<text x="510" y="584" text-anchor="middle" font-size="11" fill="#047857">KingbaseES V009R003C018 (JDBC依赖 8.6.0) · 物理外键与唯一索引保障 · 21张业务表</text>
</g>
</svg>
</div>
</section>
<!-- 架构核心能力说明分块 -->
<section class="content-section">
<div class="section-header">
<div>
<h2 class="section-title">架构设计原则与关键实现边界</h2>
<p class="section-subtitle">明确当前生产可用能力与后续规划接口的边界,坚守工程事实真实性。</p>
</div>
</div>
<div class="arch-layer-grid">
<div class="standard-card">
<div class="card-top">
<h3 class="card-title">安全鉴权与敏感数据保护</h3>
<span class="badge badge-pass">CURRENT</span>
</div>
<p class="card-body-text">
<strong>无状态 JWT 机制</strong>:采用标准 Bearer Token 进行会话保持,服务端通过 Redis 维护令牌白名单;
<br><strong>脱敏治理</strong>:学员身份证在落库时保存散列与哈希,前端统一返回末4位掩码,杜绝明文传输;
<br><strong>权限管控</strong>:依托 RuoYi 标准注解 <code>@PreAuthorize</code> 实现按钮级权限拦截。
</p>
</div>
<div class="standard-card">
<div class="card-top">
<h3 class="card-title">排课预检与强一致性保护</h3>
<span class="badge badge-pass">CURRENT</span>
</div>
<p class="card-body-text">
<strong>四维防重叠预检</strong>:将教师时间冲突作为阻断校验,教室/场地/班级重叠作为 Warning 预警由教务员决策;
<br><strong>零旁路保存</strong>:标准 POST 保存禁止 <code>force/override</code> 参数,保障排课合规;
<br><strong>场地 XOR 互斥</strong>:物理保证教室与实训场地二选一,不可并存或两空。
</p>
</div>
<div class="standard-card">
<div class="card-top">
<h3 class="card-title">物联网设备与外部适配器边界</h3>
<span class="badge badge-reserved">区分已实现 vs 预留</span>
</div>
<p class="card-body-text">
<strong>当前实现</strong>:提供标准 RESTful API 及 Web 电子班牌路由 <code>/equip/board</code>,课表根据教室班牌数量 (0/1/N) 智能映射 <code>boardSn</code>;
<br><strong>预留扩展 (RESERVED)</strong>:物理硬件人脸打卡闸机适配协议、专属嵌入式班牌通讯协议预留接口规范,暂未接入实际物理硬件。
</p>
</div>
</div>
</section>
</main>
<!-- 页脚 -->
<footer class="site-footer">
<p>RailwaySystem SYFJGYD学员管理系统 · 交付候选版 (Final Candidate)</p>
<p style="margin-top: 0.35rem; color: var(--text-muted);">
架构设计规范 · <a href="http://192.168.139.218:9980/sict/railwaysystem/-/blob/feat/cicd-pipeline/docs/handbook/03-system-architecture.md" target="_blank" rel="noopener noreferrer">查阅架构设计详细手册</a>
</p>
</footer>
<script src="assets/docs.js"></script>
</body>
</html>