# 综述和报警流程
报警版管理后台用来处理报警。
报警流程大致如下:
- 设备报警:当智能照明模块发生报警,会自动向数据库表插入一条记录。
![](img/bj02.png)
- 收到报警:手机端收到报警
- 确认维修:用户在手机上点击"确认维修"
![](img/bj01.png)
- 客服派单:当用户确认维修之后,客服在管理后台把报警单派发给电工
![](img/bj03.png)
- 电工接单:电工在管理后台确认接单
![](img/bj04.png)
- 确认维修完成:电工确认接单后,会去现场维修,维修完毕,电工在管理后台点击`确认维修完成`
![](img/bj05.png)
- 系统确认报警解除:系统会自动确认报警是否解除
![](img/bj06.png)
# 创建人员
- 管理员
- 客服
- 电工
> 首先创建名称为"客服"的岗位,创建名称为"电工"的岗位,创建名称为"报警版管理员"的岗位。然后分别在这几个岗位下添加人员。
# 客服
- 未派单报警:即查看WarningStatus='ApplyConfirmed '的报警
```
客服可以点击派单按钮,让报警状态变成已派单,即WarningStatus='Dispatched',并且,DispatchedTime=当前时间
```
- 电工未接单报警:即查看WarningStatus='Dispatched'的报警
- 电工已接单报警:即查看WarningStatus='Accepted'的报警
- 电工已处理报警:即查看WarningStatus='Repaired'的报警
- 报警已闭环
# 电工
- 未接单报警:即查看WarningStatus='Dispatched'的报警
```
电工可以点击接单按钮,让报警状态变成已接单,即WarningStatus='Accepted',并且,AcceptedTime=当前时间
```
- 已接单报警: 即查看WarningStatus='Accepted'的报警
```
电工可以点击已处理按钮,让报警状态变成已处理,即WarningStatus='Repaired',并且,RepairTime=当前时间
```
- 已处理报警:即查看WarningStatus='Repaired'的报警
- 报警已闭环
# 管理员
- 客户未确认报警:即查看WarningStatus='Created'的报警
- 客户已确认报警:
- 未派单报警:
- 电工未接单报警:即查看WarningStatus='Dispatched'的报警
- 电工已接单报警:即查看WarningStatus='Accepted'的报警
- 电工已处理报警:即查看WarningStatus='Repaired'的报警,加一个"系统已确认"按钮
- 报警已闭环
- 人员管理
```
- 客服管理
- 电工管理
```
# 关于warnings表中的BreakerId
```
某某电箱某某开关名称,开关名称在breakers表中的Name获取,
```
# 附录
报警状态
```
///
/// 被创建
///
Created
///
/// 用户申请被确认
///
ApplyConfirmed
///
/// 客服派单已完成
///
Dispatched
///
/// 电工已接单
///
Accepted
///
/// 电工已维修
///
Repaired
///
/// 报警已解除
///
Finished
```
报警级别
```
public enum WarningLevel
{
///
/// 蓝色预警
///
Blue = 0,
///
/// 黄色预警
///
Yellow = 1,
///
/// 橙色预警
///
Orange = 2,
///
/// 红色报警
///
Red = 3,
///
/// 绿色正常
///
Green = 4
}
```
报警类型
```
///
/// 报警类型
///
public enum WarningType
{
///
/// 过压报警
///
GuoYa = 0,
///
/// 过压预警
///
GuoYaYuJing = 24,
///
/// 欠压报警
///
QianYa = 1,
///
/// 欠压预警
///
QianYaYuJing = 25,
///
/// 线温报警
///
GuoWen = 2,
///
/// 线温预警
///
GuoWenYuJing = 30,
///
/// 低温报警
///
DiWen = 3,
///
/// 低温预警
///
DiWenYuJing = 32,
///
/// 漏电报警
///
LouDian = 4,
///
/// 漏电预警
///
LouDianYuJing = 22,
///
/// 漏电未关
///
LouDianNoClose = 28,
///
/// 过流报警
///
GuoLiu = 5,
///
/// 过流预警
///
GuoLiuYuJing = 23,
///
/// 过流未关报警
///
GuoLiuNoClose = 20,
///
/// 过载报警
///
GuoGong = 6,
///
/// 过载预警
///
GuoGongYuJing = 31,
///
/// 过载未关报警
///
GuoZaiNoClose = 21,
///
/// 离线报警
///
LiXian = 7,
///
/// 电流限定报警
///
DianLiuXianDing = 8,
///
/// 打火报警
///
DaHuo = 9,
///
/// 短路报警
///
DuanLu = 10,
///
/// 漏电自检30
///
LouDianZiJian = 11,
///
/// 漏电保护功能
///
LouDianBaoHuGongNeng = 12,
///
/// 浪涌报警
///
LangYong = 13,
///
/// 功率限定报警
///
GongLvXianDing = 14,
///
/// 空载报警
///
KongZai = 15,
///
/// 三相不平衡报警
///
SanXiangPingHeng = 16,
///
/// 缺相报警
///
QueXiang = 17,
///
/// 三相相序报警
///
SanXiangXiangXu = 18,
///
/// 手动分断报警
///
ShouDongCaoZuo = 19,
///
/// 零线报警
///
LingXianBaoJing = 26,
///
/// 零线预警
///
LingXianYuJing = 27,
///
/// 打火未关
///
DaHuoNoClose = 29,
//以上最大32
///
/// 防雷报警
///
FangLei =35,
///
/// 漏电测试成功
///
LouDianCeShiSuccess=36,
///
/// 模块与某个线路通信失败
///
TongXun=37,
///
/// 漏电测试失败
///
LouDianCeShiFail=38,
///
/// 输入缺相
///
ShuRuQueXiang=39,
///
/// A相短路
///
AXiangDuanLu=40,
///
/// A相过功
///
AXiangGuoGong=41,
///
/// A相过流
///
AXiangGuoLiu=42,
///
/// A相过压
///
AXiangGuoYa=43,
///
/// A相欠压
///
AXiangQianYa=44,
///
/// A相温度
///
AXiangWenDu =45,
AXiangDaHuo=46,
AXiangDianLiuYuJing=47,
AXiangGuoYaYuJing=48,
AXiangQianYaYuJing=49,
AXiangShuRuQueXiang=50,
BXiangDuanLu=51,
BXiangGuoGong=52,
BXiangGuoLiu=53,
BXiangGuoYa=54,
BXiangQianYa=55,
BXiangWenDu=56,
BXiangDaHuo=57,
BXiangDianLiuYuJing=58,
BXiangGuoYaYuJing=59,
BXiangQianYaYuJing=60,
BXiangShuRuQianXiang=61,
CXiangDuanLu=62,
CXiangGuoGong=63,
CXiangGuoLiu=64,
CXiangGuoYa=65,
CXiangQianYa=66,
CXiangWenDu=67,
CXiangDaHuo=68,
CXiangDianLiuYuJing=69,
CXiangGuoYaYuJing=70,
CXiangQianYaYuJing=71,
CXiangShuRuQueXiang=72,
None=73
}
```