Commit 096cd356accd36800dd4c3ece09965190c35944e

Authored by 王通
1 parent b94f2938

1.加入超速报警

src/main/java/com/bsth/message/entity/AlarmDSMVo.java
... ... @@ -103,6 +103,21 @@ public class AlarmDSMVo implements AlarmVo {
103 103  
104 104 private String lineCode;
105 105  
  106 + /**
  107 + * 限速值(0.01km/h)
  108 + */
  109 + private int speedLimit;
  110 +
  111 + /**
  112 + * 超速速度峰值(0.01km/h)
  113 + */
  114 + private int speedPeak;
  115 +
  116 + /**
  117 + * 超速持续时长(S)
  118 + */
  119 + private int duration;
  120 +
106 121 public String getClientId() {
107 122 return clientId;
108 123 }
... ... @@ -252,6 +267,34 @@ public class AlarmDSMVo implements AlarmVo {
252 267 this.lineCode = lineCode;
253 268 }
254 269  
  270 + public int getSpeedLimit() {
  271 + return speedLimit;
  272 + }
  273 +
  274 + public void setSpeedLimit(int speedLimit) {
  275 + this.speedLimit = speedLimit;
  276 + }
  277 +
  278 + public int getSpeedPeak() {
  279 + return speedPeak;
  280 + }
  281 +
  282 + public void setSpeedPeak(int speedPeak) {
  283 + this.speedPeak = speedPeak;
  284 + }
  285 +
  286 + public int getDuration() {
  287 + return duration;
  288 + }
  289 +
  290 + public void setDuration(int duration) {
  291 + this.duration = duration;
  292 + }
  293 +
  294 + public String getAttach() {
  295 + return String.format("峰值(km/h):%d[%d],持续(s):%d", speedPeak / 100, speedLimit/ 100, duration);
  296 + }
  297 +
255 298 @Override
256 299 public int hashCode() {
257 300 return String.format("%s_%d_%d", this.clientId, this.alarmTimeBegin, this.type).hashCode();
... ...
src/main/java/com/bsth/message/handler/RabbitMessageHandler.java
... ... @@ -42,6 +42,9 @@ public class RabbitMessageHandler {
42 42 alarmVo = mapper.readValue(message, AlarmDSMVo.class);
43 43 } else if ("adas".equals(data.get("alarmType"))) {
44 44 alarmVo = mapper.readValue(message, AlarmADASVo.class);
  45 + } else if ("over-speed".equals(data.get("alarmType"))) {
  46 + alarmVo = mapper.readValue(message, AlarmDSMVo.class);
  47 + ((AlarmDSMVo)alarmVo).setType(17);
45 48 }
46 49 if (alarmVo != null) {
47 50 if (alarmVo.getVehicleCode() == null) {
... ... @@ -50,6 +53,7 @@ public class RabbitMessageHandler {
50 53 }
51 54 GpsEntity gps = gpsRealData.getByNbbm(alarmVo.getVehicleCode());
52 55 if (gps == null || gps.getLineId() == null) {
  56 + alarmVo.setLineCode("249231");
53 57 log.warn("报警未匹配到线路,alarmVo: {}", alarmVo);
54 58 } else {
55 59 alarmVo.setLineCode(gps.getLineId());
... ...
src/main/resources/application-dev.properties
... ... @@ -18,9 +18,9 @@ spring.datasource.driver-class-name= com.mysql.jdbc.Driver
18 18 ##spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
19 19 #spring.datasource.username= root
20 20 #spring.datasource.password=
21   -spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  21 +spring.datasource.url= jdbc:mysql://192.168.168.152/control_dy?useUnicode=true&characterEncoding=utf-8&useSSL=false
22 22 spring.datasource.username= root
23   -spring.datasource.password= root
  23 +spring.datasource.password= root2jsp
24 24 #spring.datasource.url= jdbc:mysql://192.168.168.241/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
25 25 #spring.datasource.username= root
26 26 #spring.datasource.password= root2jsp
... ... @@ -46,16 +46,16 @@ spring.kafka.consumer.key-deserializer= org.apache.kafka.common.serialization.St
46 46 spring.kafka.consumer.value-deserializer= org.apache.kafka.common.serialization.StringDeserializer
47 47  
48 48 rabbit.use= true
49   -spring.rabbitmq.host= 10.10.2.21
  49 +spring.rabbitmq.host= 192.168.168.167
50 50 spring.rabbitmq.port= 5672
51 51 spring.rabbitmq.username= bsth
52 52 spring.rabbitmq.password= bsth001
53 53 spring.rabbitmq.virtual-host= /dsm
54 54  
55   -minio.url= http://10.10.2.21:9008
56   -minio.accessKey= umupRhEzO9EiVhLnJ7b9
57   -minio.secretKey= VzjQUTN6c8p70HyX8AryRrB6ZjEsF2K28ndctHQh
58   -minio.bucket= dsm
  55 +minio.url= http://192.168.168.167:9000
  56 +minio.accessKey= RY5KuSaAPpfZ6D6mIR3x
  57 +minio.secretKey= BexuwVnJ2ikqV03OpO1wSKabU1x9gGtEf6NCFgpu
  58 +minio.bucket= adas
59 59  
60 60 sso.enabled= false
61 61 sso.systemcode = SYS0019
... ...
src/main/resources/application.properties
1   -spring.profiles.active = cloud
  1 +spring.profiles.active = dev
2 2  
3 3 spring.view.suffix=.html
4 4 server.session-timeout=-1
... ...
src/main/resources/static/pages/base/station/list.html
... ... @@ -50,7 +50,9 @@
50 50 <td>
51 51 <input type="text" class="form-control form-filter input-sm" id="stationCode" name="stationCode_like">
52 52 </td>
53   - <td></td>
  53 + <td>
  54 + <input type="text" class="form-control form-filter input-sm" id="passLines" name="passLines_like">
  55 + </td>
54 56 <td>
55 57 <input type="text" class="form-control form-filter input-sm" id="standardStationCode" name="standardStationCode_like">
56 58 </td>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/alarm/dsm.html
... ... @@ -22,8 +22,7 @@
22 22 <option value="3">抽烟报警</option>
23 23 <option value="4">分神驾驶报警</option>
24 24 <option value="5">驾驶员异常报警</option>
25   - <option value="6">用户自定义报警</option>
26   - <option value="7">用户自定义报警</option>
  25 + <option value="17">超速报警</option>
27 26 </select>
28 27 <button class="uk-button">检索</button>
29 28 <!--<a id="showSSSpVedioModal" style="color: red;float: right;font-size: 12px;">查看实时视频</a>-->
... ... @@ -40,8 +39,7 @@
40 39 <th style="width: 12%;">异常类型</th>
41 40 <th style="width: 16%;">时间</th>
42 41 <th style="width: 16%;">报警等级</th>
43   - <th style="width: 16%;">疲劳程度</th>
44   - <th style="width: 10%;">附件</th>
  42 + <th style="width: 20%;">附件/附加信息</th>
45 43 </tr>
46 44 </thead>
47 45 <tbody data-uk-observe>
... ... @@ -57,15 +55,18 @@
57 55 <script id="alarm-dsm-table-template" type="text/html">
58 56 {{each array as dsm i}}
59 57 <tr>
60   - <td style="width: 14%;">{{dsm.lineCode}}</td>
61   - <td style="width: 14%;">{{dsm.vehicleCode}}</td>
62   - <td style="width: 13%;">{{dsm.vehiclePlate}}</td>
63   - <td style="width: 13%;">{{dsm.alarmDescription}}</td>
64   - <td style="width: 10%;">{{dsm.timeStr}}</td>
65   - <td style="width: 10%;">{{dsm.level}}</td>
66   - <td style="width: 10%;">{{dsm.fatigueDegree}}</td>
67   - <td>
  58 + <td style="width: 10%;">{{dsm.lineCode}}</td>
  59 + <td style="width: 11%;">{{dsm.vehicleCode}}</td>
  60 + <td style="width: 12%;">{{dsm.vehiclePlate}}</td>
  61 + <td style="width: 12%;">{{dsm.alarmDescription}}</td>
  62 + <td style="width: 16%;">{{dsm.timeStr}}</td>
  63 + <td style="width: 16%;">{{dsm.level}}</td>
  64 + <td style="width: 20%;">
  65 + {{if dsm.speedLimit == 0}}
68 66 <a class="image_link" click="" data-url="{{dsm.paths.join(',')}}" title="{{dsm.title}}">查看</a>
  67 + {{else}}
  68 + {{dsm.attach}}
  69 + {{/if}}
69 70 </td>
70 71 </tr>
71 72 {{/each}}
... ...
src/main/resources/static/real_control_v2/js/alarm/alarm.js
... ... @@ -4,18 +4,22 @@
4 4 var gb_alarm = (function () {
5 5 var code2des = {
6 6 6401: '前向碰撞报警', 6402: '车道偏离报警', 6403: '车距过近报警', 6404: '行人碰撞报警', 6405: '频繁变道报警', 6406: '道路标识超限报警', 6407: '障碍物报警',
7   - 6501: '疲劳驾驶报警', 6502: '接打电话报警', 6503: '抽烟报警', 6504: '分神驾驶报警', 6505: '驾驶员异常报警', 6506: '用户自定义报警', 6507: '用户自定义报警'
  7 + 6501: '疲劳驾驶报警', 6502: '接打电话报警', 6503: '抽烟报警', 6504: '分神驾驶报警', 6505: '驾驶员异常报警', 6506: '用户自定义报警', 6507: '用户自定义报警', 6517: '超速报警'
8 8 };
9 9 var $wrap = $('.multi_plat_msg_pop_wrap');
10 10 var max = 5;
11 11  
12 12 var pop = function (data) {
13 13 //时间格式化
14   - data.timeStr = moment(data.alarmTimeBegin).format('/');
  14 + data.timeStr = moment(data.ts).format('HH时mm分ss秒');
15 15 if (data.alarmType === 'adas') {
16 16 data.content = '[' + code2des[6400 + data.type] + ']';
17 17 } else if (data.alarmType === 'dsm') {
18 18 data.content = '[' + code2des[6500 + data.type] + ']';
  19 + } else if (data.alarmType === 'over-speed') {
  20 + debugger
  21 + data.content = '[' + code2des[6500 + data.type] + ']';
  22 +
19 23 }
20 24 data.url = data.paths.join(',');
21 25  
... ...
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
... ... @@ -110,12 +110,14 @@ var gb_safe_driv = (function () {
110 110 case 'adas':
111 111 var urls = $(this).data('url').split(','), items = [];
112 112 urls.forEach(function (url, idx) {
113   - if (url.endsWith('.bin')) return;
  113 + if (!url || url.endsWith('.bin')) return;
114 114 items.push({title: '附件' + (idx + 1), source: 'http://118.113.164.50:9008/dsm/' + url});
115 115 });
116 116 $(this).remove();
117 117  
118   - UIkit.lightbox.create(items, {keyboard: true}).show();
  118 + if (items.length > 0) {
  119 + UIkit.lightbox.create(items, {keyboard: true}).show();
  120 + }
119 121 break;
120 122 default:
121 123 break;
... ...