Commit 1c00f1730683174036e9ec21ca4eabe306667647
1 parent
3b1634ff
Exists in
master
消息推送修改
Showing
2 changed files
with
10 additions
and
10 deletions
Show diff stats
cloud/dahua/src/main/java/com/example/dahua/MyTask.java
... | ... | @@ -443,7 +443,7 @@ public class MyTask implements ApplicationRunner { |
443 | 443 | mqttManager = new MqttManager(); |
444 | 444 | mqttManager.init(); |
445 | 445 | } |
446 | - myScheduledTask.sendMQMess(content); | |
446 | + myScheduledTask.sendMQMess(content,deviceId); | |
447 | 447 | |
448 | 448 | //记录学生考勤签到记录 |
449 | 449 | FileUtils.getInstance().writeLogs(content, FileUtils.qiandaoSuccess); | ... | ... |
cloud/dahua/src/main/java/com/example/dahua/async/MyScheduledTask.java
... | ... | @@ -204,7 +204,7 @@ public class MyScheduledTask { |
204 | 204 | // System.out.println("indexLineNum:"+indexLineNum+" ----------readLineNum:"+readLineNum); |
205 | 205 | if (indexLineNum >= readLineNum) { |
206 | 206 | readLineNum++; |
207 | - sendMQMess(content); | |
207 | + sendMQMess(content,""); | |
208 | 208 | } |
209 | 209 | |
210 | 210 | } |
... | ... | @@ -235,21 +235,22 @@ public class MyScheduledTask { |
235 | 235 | |
236 | 236 | } |
237 | 237 | |
238 | - public void sendMQMess(String content) { | |
238 | + public void sendMQMess(String content,String deviceId) { | |
239 | 239 | String cardNum = content.substring(content.indexOf("卡号") + 3, content.indexOf("卡号") + 11); |
240 | 240 | |
241 | -// System.out.println("cardNum:" + cardNum); | |
242 | - | |
243 | 241 | String inOrOut = content.substring(content.indexOf("方向:") + 3, content.indexOf("方向:") + 5).endsWith("进门") ? "0" : "1"; |
244 | 242 | |
245 | - String qiandaoDevId = content.substring(content.indexOf("设备") + 3, content.indexOf("设备") + 12); | |
243 | + //判断是否一体机,发送消息看板 | |
244 | + String qiandaoDevId=""; | |
245 | + if(StringUtils.isEmpty(deviceId)){ | |
246 | + qiandaoDevId = content.substring(content.indexOf("设备") + 3, content.indexOf("设备") + 12); | |
247 | + }else{ | |
248 | + qiandaoDevId =deviceId; | |
249 | + } | |
246 | 250 | |
247 | 251 | //获取寝室关联的场景id |
248 | 252 | String placeId = userDao.getPlaceIdWithKaoqinDevid(qiandaoDevId); |
249 | 253 | |
250 | -// System.out.println("qiandaoDevId:" + qiandaoDevId); | |
251 | -// System.out.println("placeId:" + placeId); | |
252 | - | |
253 | 254 | if (null != placeId) { |
254 | 255 | //关联的显示看板设备 |
255 | 256 | List<String> kanbanIds = userDao.getKanBanIdWithPlaceId(placeId); |
... | ... | @@ -272,7 +273,6 @@ public class MyScheduledTask { |
272 | 273 | } |
273 | 274 | } |
274 | 275 | |
275 | - | |
276 | 276 | } |
277 | 277 | |
278 | 278 | ... | ... |