Commit a270146525a56c62cb5798b460ffdcc361e54afb

Authored by ljq
1 parent 44050385

设备向服务器发送消息

src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java
... ... @@ -46,7 +46,7 @@ public class WebSocketPushQueue {
46 46 }
47 47 linkedList.clear();
48 48 thread = new DataPushThread();
49   - //thread.start();
  49 + thread.start();
50 50 }
51 51  
52 52 public static int size(){
... ...
src/main/java/com/bsth/repository/subject/SubjectUserRepository.java
... ... @@ -13,7 +13,7 @@ public interface SubjectUserRepository extends BaseRepository<SubjectUser, Integ
13 13  
14 14  
15 15  
16   - @Query(value = "SELECT su FROM SubjectUser su where su.rq =?1 and su.userId =?2")
  16 + @Query(value = "SELECT su FROM SubjectUser su where su.rq =?1 and su.userId.id =?2")
17 17 List<SubjectUser> userAll(String rq, Integer userId);
18 18 @Transactional
19 19 @Modifying
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -140,7 +140,7 @@ public class SendUtils{
140 140 d80.getData().setNbbm(BasicData.deviceId2NbbmMap.get(d80.getDeviceId()));
141 141 JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(d80));
142 142 json.put("fn", "report80");
143   - socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), json.toJSONString());
  143 + socketHandler.sendMessage(json.toJSONString());
144 144 }
145 145  
146 146 public void refreshSch(ScheduleRealInfo sch) {
... ...
src/main/resources/static/real_control_v2/js/utils/tts.js
... ... @@ -32,7 +32,8 @@ var gb_tts = (function() {
32 32 if (defaultConfig.queueModel == 1)
33 33 synth.cancel();
34 34  
35   - var lineName=gb_data_basic.codeToLine[lineCode].name;
  35 + //var lineName=gb_data_basic.codeToLine[lineCode].name;
  36 + var lineName="测试线路";
36 37 try {
37 38 if (lineName)
38 39 lineName.replace('行', '航');
... ...
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
... ... @@ -28,7 +28,9 @@ var gb_sch_websocket = (function () {
28 28 schSock.onmessage = function (e) {
29 29 try {
30 30 var jsonMsg = $.parseJSON(e.data);
31   - msgHandle[jsonMsg.fn](jsonMsg);
  31 + if (jsonMsg.fn == "report80"){
  32 + msgHandle[jsonMsg.fn](jsonMsg);
  33 + }
32 34 } catch (e) {
33 35 console.log(e, e.data);
34 36 }
... ... @@ -68,7 +70,7 @@ var gb_sch_websocket = (function () {
68 70 * 计算未处理消息
69 71 */
70 72 var calcUntreated = function (lineCode) {
71   - var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length;
  73 + var size = $('li.line_schedule .sys-mailbox .sys-mail-item').length;
72 74 $('#badge_untreated_num_' + lineCode).text(size);
73 75 };
74 76  
... ... @@ -91,7 +93,6 @@ var gb_sch_websocket = (function () {
91 93 //tts
92 94 var ttsMsg = $item.find('.uk-panel-title').text();
93 95 gb_tts.speak(ttsMsg, msg.data.lineId);
94   -
95 96 calcUntreated(msg.data.lineId);
96 97 };
97 98  
... ... @@ -215,8 +216,7 @@ var gb_sch_websocket = (function () {
215 216 function findMailBox(lineCode) {
216 217 if (mailBoxs[lineCode])
217 218 return mailBoxs[lineCode];
218   -
219   - var mbox = $('li.line_schedule[data-id=' + lineCode + ']').find('div.sys-mailbox');
  219 + var mbox = $('li.line_schedule').find('div.sys-mailbox');
220 220 mailBoxs[lineCode] = mbox;
221 221 return mbox;
222 222 }
... ...