WarningLog.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. namespace App\Models;
  3. use App\Traits\ModelHelpers;
  4. use Illuminate\Database\Eloquent\Model;
  5. class WarningLog extends Model
  6. {
  7. use ModelHelpers;
  8. //
  9. protected $table = 'warning_logs';
  10. //备用
  11. const TYPE_DEFAULT = 0;
  12. // 电池电量低
  13. const TYPE_BATTERY_LOW = 11;
  14. //异常订单
  15. const TYPE_ABNORMAL_ORDER = 12;
  16. // 电车骑出骑行区域
  17. const TYPE_BIKE_OUT_AREA = 21;
  18. // 电车骑出骑行区域的辐射范围
  19. const TYPE_BIKE_OUT_AREA_ = 22;
  20. //车辆定位出现问题
  21. const TYPE_BIKE_LOCATION_ERROR = 51;
  22. //备用电池低电告警
  23. const TYPE_WARNING_BATTERY_LOW = 31;
  24. //震动报警
  25. const TYPE_WARNING_BIKE_SHOCK = 32;
  26. //非法打开电门报警
  27. const TYPE_WARNING_BIKE_OPEN = 33;
  28. //电子围栏报警
  29. const TYPE_WARNING_FENCE = 34;
  30. // BMS异常报警
  31. const TYPE_WARNING_BMS = 35;
  32. // 断电报警、GPS自检测
  33. const TYPE_WARNING_CLOSE_ELECTRIC = 36;
  34. // 超速告警
  35. const TYPE_WARNING_OVER_SPEED = 37;
  36. //轮动告警
  37. const TYPE_WARNING_WHEEL_MOVE = 38;
  38. //车辆故障
  39. const TYPE_WARNING_BIKE_TROUBLE = 39;
  40. //登录日志
  41. const TYPE_REBOOT_LOG = 40;
  42. // 车辆离线
  43. const TYPE_BIKE_OFF_LINE = 41;
  44. public static $typeMaps = [
  45. // self::TYPE_DEFAULT => '备用',
  46. self::TYPE_BATTERY_LOW => '电池电量低',
  47. self::TYPE_BIKE_OUT_AREA => '电车骑出骑行区域',
  48. self::TYPE_BIKE_OUT_AREA_ => '电车骑出骑行区域的辐射范围',
  49. self::TYPE_WARNING_BATTERY_LOW => '备用电池低电告警',
  50. self::TYPE_WARNING_BIKE_SHOCK => '震动报警',
  51. self::TYPE_WARNING_BIKE_OPEN => '非法打开电门报警',
  52. self::TYPE_WARNING_FENCE => '电子围栏报警',
  53. self::TYPE_WARNING_BMS => 'BMS异常报警',
  54. self::TYPE_WARNING_CLOSE_ELECTRIC => '断电报警、GPS自检测',
  55. self::TYPE_WARNING_OVER_SPEED => '超速告警',
  56. self::TYPE_WARNING_WHEEL_MOVE => '轮动告警',
  57. self::TYPE_WARNING_BIKE_TROUBLE => '车辆故障',
  58. self::TYPE_BIKE_OFF_LINE => '车辆离线',
  59. self::TYPE_ABNORMAL_ORDER => '无订单异常骑行',
  60. self::TYPE_BIKE_LOCATION_ERROR => '车辆定位出现问题(车可能进入室内或定位器坏了)',
  61. self::TYPE_REBOOT_LOG => '登录中控',
  62. ];
  63. /**
  64. * 错误等级
  65. */
  66. // 默认
  67. const ERROR_GRADE_DEFAULT = 0;
  68. // 次要
  69. const ERROR_GRADE_MINOR = 1;
  70. // 一般
  71. const ERROR_GRADE_MAJOR = 2;
  72. // 重要
  73. const ERROR_GRADE_CRITICAL = 3;
  74. //立马解决/**/
  75. const ERROR_GRADE_NOW = 4;
  76. public static $reasonMaps = [
  77. 0 => '未知原因重启',
  78. 1 => 'GPS连续10分钟输出错误,重启系统',
  79. 2 => 'GPRS连续超过30分钟未登陆成功重启设备',
  80. 3 => 'GPRS链路心跳包超时未收到重启设备',
  81. 4 => '心跳包超过时间没有收到发生的系统重启修复动作',
  82. 5 => '当用户被修改时导致的重登陆',
  83. 6 => '当终端SIM被修改时导致的重登陆',
  84. 7 => '当终端收到激活短信时导致的重登陆',
  85. 8 => '当终端收到短信的重登陆指令时',
  86. 9 => '用户下发的主动复位指令,让系统主动复位',
  87. 10 => '用户下发的主动关机指令,让系统主动关机',
  88. 11 => '当用户下发的免激活之后重登陆指令',
  89. 12 => '当APN被修改时导致的用户重登陆操作',
  90. 13 => '当域名被修改时导致的重登陆',
  91. 14 => '当上网模式被修改时导致的重登陆',
  92. 15 => '当UDP,TCP模式切换时导致的重登陆',
  93. 16 => '当终端的TID被修改时导致的重登陆',
  94. 17 => '当GSENCOR超过一定的次数还没有修复成功的时候,就进行重启修复一次',
  95. 18 => '当SIM卡插入时自动重启设备一次',
  96. 19 => '当设备中的超级猫号码更改时导致的重登陆',
  97. 20 => '当设备的PDP激活次数超过系统规定的时间时,重启一次系统',
  98. 21 => '设备从FLASH中加载重启原因发生错误',
  99. 22 => '设备远程升级之后的自动重启功能',
  100. 23 => '用户下发的格式化指令',
  101. 24 => '系统自修复重启机制',
  102. 25 => '系统自修复重启机制',
  103. 30 => '主域名与备用IP间的5分钟切换导致的重登陆',
  104. 37 => 'GPS长时间没有吐出PUBX语句导致的重启',
  105. ];
  106. }