本功能实现了 Issue #70 要求的"应急推演(爆管模拟 + 水质异常处置预案)",包括:
prod_emergency_simulation: 应急推演记录表prod_emergency_plan: 应急预案表POST /api/emergency/dispatch/quick-pipe-burst
Content-Type: application/json
{
"lng": 116.4074,
"lat": 39.9042,
"pipeDiameter": "DN100",
"operatorName": "operator_name"
}
响应示例:
{
"success": true,
"simulation": {
"simulationNo": "SIM-20240614010001",
"scenarioType": "pipe_burst",
"scenarioName": "爆管应急推演",
"affectedArea": "半径500m圆形区域",
"affectedCustomers": 230,
"estimatedRecoveryHours": 4,
"status": "completed"
},
"executionResult": {
"impactAnalysis": {
"affectedArea": "半径500m圆形区域",
"affectedCustomers": 230,
"estimatedRecoveryHours": 4
},
"emergencyMeasures": {
"valveShutdown": "关闭上游阀门 V-001, V-002",
"emergencyWater": "启动应急供水方案 B",
"userNotification": "通知受影响用户(短信+公告)",
"repairTeam": "调度抢修队出发"
}
},
"suggestedCommands": [
{
"title": "爆管应急推演",
"type": "emergency",
"priority": "high",
"content": "爆管应急响应..."
}
]
}
POST /api/emergency/dispatch/quick-water-quality
Content-Type: application/json
{
"area": "市中心区域",
"pollutant": "重金属",
"lng": 116.4074,
"lat": 39.9042,
"operatorName": "operator_name"
}
# 创建预案
POST /api/emergency/plan/create
?planName=预案名称&planType=disaster&scenario=爆管&operatorName=operator_name
# 激活预案
POST /api/emergency/plan/{planId}/activate
?operatorName=operator_name
# 查询预案列表
GET /api/emergency/plan/list
?page=1&size=10&planType=all&status=active
GET /api/emergency/dispatch/status
响应示例:
{
"success": true,
"status": {
"alertLevel": "medium",
"preparednessScore": 85,
"recentSimulations": [...],
"activePlans": [...],
"activeCommands": [...]
}
}
GET /api/emergency/dispatch/report?period=week
| 字段 | 类型 | 描述 |
|---|---|---|
| simulationNo | String | 推演编号 |
| scenarioType | String | 推演类型(pipe_burst/water_quality) |
| scenarioName | String | 推演名称 |
| locationLng | Double | 经度 |
| locationLat | Double | 纬度 |
| pipeDiameter | String | 管道直径 |
| affectedArea | String | 影响区域 |
| affectedCustomers | Integer | 受影响用户数 |
| estimatedRecoveryHours | Integer | 预计恢复时间 |
| status | String | 状态(draft/executing/completed/with_plan) |
| 字段 | 类型 | 描述 |
|---|---|---|
| planNo | String | 预案编号 |
| planName | String | 预案名称 |
| planType | String | 预案类型(disaster/accident/emergency) |
| scenario | String | 适用场景 |
| triggerConditions | String | 触发条件 |
| responseProcedure | String | 响应流程 |
| responsibleDepartments | String | 责任部门 |
| contactInfo | String | 联系信息 |
| resourceRequirements | String | 资源需求 |
| backupSolutions | String | 备用方案 |
| status | String | 状态(draft/active/inactive/expired) |
触发条件检测
影响分析
应急措施
恢复重建
触发条件检测
影响分析
应急措施
恢复重建
运行测试脚本验证功能:
cd water-management-system
python test_emergency_simulation.py
-- 执行数据库迁移脚本
psql -d water_management -f wm-production/src/main/resources/db/V3__emergency_simulation.sql
psql -d water_management -f wm-production/src/main/resources/db/V3__emergency_simulation_data.sql
在 application.yml 中添加:
spring:
datasource:
url: jdbc:postgresql://localhost:5432/water_management
username: water_user
password: water_pass
数据库连接失败
API接口返回500错误
推演结果异常
# 查看应用日志
tail -f logs/wm-production.log
# 查看数据库日志
tail -f postgresql.log
AI驱动的智能推演
3D可视化
移动端支持
缓存机制
异步处理
负载均衡
如有问题请联系: