Index: ssts-web/src/main/webapp/homepage/portalPage.jsp =================================================================== diff -u -r38629 -r39038 --- ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 38629) +++ ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 39038) @@ -856,4 +856,10 @@ $('#windowBox').show(); } + + + + + + Index: ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.jsp =================================================================== diff -u -r29513 -r39038 --- ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.jsp (.../websocketClient.jsp) (revision 29513) +++ ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.jsp (.../websocketClient.jsp) (revision 39038) @@ -7,6 +7,7 @@ LoginUserData loginUser = AcegiHelper.getLoginUser(); String moduleName = request.getParameter("module"); String taskGroup = request.getParameter("taskGroup"); + String websocketName = request.getParameter("websocketName"); String ipHostAndContext = request.getServerName() + ":" + request.getServerPort(); String contextPath = request.getContextPath(); @@ -24,7 +25,7 @@ var taskGroup = '<%=taskGroup %>'; var noticeTypeCodeInit = '<%=NoticeType.INIT.getCode() %>'; var noticeTypeCodeRefresh = '<%=NoticeType.REFRESH.getCode() %>'; - +var websocketName = '<%=websocketName %>'; //服务端的ip:端口(/上下文根) var ipHostAndContext = '<%=ipHostAndContext %>'; Index: ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.js =================================================================== diff -u -r27974 -r39038 --- ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.js (.../websocketClient.js) (revision 27974) +++ ssts-web/src/main/webapp/disinfectsystem/websocket/websocketClient.js (.../websocketClient.js) (revision 39038) @@ -38,7 +38,7 @@ } function readyFun(){ - createWebsocket(userCode, currentOrgUnitCode, currentModule, taskGroup); + createWebsocket(userCode, currentOrgUnitCode, currentModule, taskGroup, websocketName); } var websocket = null; @@ -54,7 +54,7 @@ * @param module * @param taskGroup */ -function createWebsocket(userCode, orgUnitCoding, module, taskGroup){ +function createWebsocket(userCode, orgUnitCoding, module, taskGroup, websocketName){ var host = document.location.host; this.userCode = userCode; this.orgUnitCoding = orgUnitCoding; @@ -65,7 +65,11 @@ //showResultWithoutSpeak("浏览器支持Websocket"); try{ //websocket = new WebSocket('ws://'+host+'/websocket/' + userName); - websocket = new WebSocket('ws://'+ipHostAndContext+'/websocket'); + if(websocketName == 'urgentNotifyWebsocket' && sstsConfig.enableUrgentVoiceNotificationsFunction){ + websocket = new WebSocket('ws://'+ipHostAndContext+'/urgentNotifyWebsocket/'+userCode+'/'+orgUnitCoding); + }else { + websocket = new WebSocket('ws://'+ipHostAndContext+'/websocket'); + } websocket.onerror = onWebsocketError; websocket.onopen = onWebsocketOpen; websocket.onmessage = onWebsocketMessage; @@ -111,6 +115,31 @@ //调用业务方法(比如装配、审核等模块接收通知函数) try{ var webSocketSessionJson = JSON.parse(webSocketSession); + if(websocketName == 'urgentNotifyWebsocket'){ + var msgArr = []; + for(var i=0;i 0){ + var version = getChromeVersion(); + if(version && version >= 85){ + speakerUrgentVoice(msgArr,0); + }else { + speaker.speak(msgArr.join(';')); + } + } + return + } sessionId = webSocketSessionJson.sessionId; var webSocketMessageJson = webSocketSessionJson.webSocketMessage; var noticeTypeCode = webSocketMessageJson.noticeTypeCode; Index: ssts-web/src/main/webapp/homepage/portalPage.js =================================================================== diff -u -r38749 -r39038 --- ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 38749) +++ ssts-web/src/main/webapp/homepage/portalPage.js (.../portalPage.js) (revision 39038) @@ -2374,7 +2374,12 @@ showWarningWin(); } +var urgentTimeOut; +var urgentTime = 60; function speakerUrgentVoice(msg,index){ + showResultWithoutSpeak(msg); + urgentTime = 60; + setUrgentVoiceNotificationsTimeout(); var myAudio = new Audio(); myAudio.preload = true; myAudio.controls = true; @@ -2385,13 +2390,14 @@ function playEndedHandler(){ if(msg.length > (index + 1)){ setTimeout(function(){ - speakerUrgentVoice(msg,index+1) + speakerUrgentVoice(msg,index+1); }, 5000); } } } -if(sstsConfig.enableUrgentVoiceNotificationsFunction){ +//GDSRMYY-604:加急提醒 +function urgentNotification(){ Ext4.Ajax.request({ url : WWWROOT + '/disinfectSystem/baseData/notification/urgentNotificationController/urgentNotification.mhtml', method : 'POST', @@ -2418,13 +2424,37 @@ speakerUrgentVoice(msgArr,0); }else { speaker.speak(msgArr.join(';')); + showResultWithoutSpeak(msgArr.join(';')); + urgentTime = 60; + setUrgentVoiceNotificationsTimeout(); } } + }else { + urgentTime = 60; + setUrgentVoiceNotificationsTimeout(); } } }); } +function setUrgentVoiceNotificationsTimeout(){ + if(urgentTimeOut){ + clearTimeout(urgentTimeOut) + } + if(urgentTime >= 0){ + urgentTimeOut = setTimeout(function(){ + urgentTime-- + setUrgentVoiceNotificationsTimeout(); + }, 1000); + }else { + urgentNotification(); + } +} + +if(sstsConfig.enableUrgentVoiceNotificationsFunction){ + setUrgentVoiceNotificationsTimeout(); +} + var doSync = false; function doShowSystemWarningWinByParam(isFirstOnLoad){ if(doSync){