Commit 05743b50ce084b94c43103c1939e5244f1aadab2
1 parent
cbca7767
语音通话上送设备号
Showing
8 changed files
with
52 additions
and
23 deletions
src/main/java/com/bsth/data/zndd/OutEntrance.java
| ... | ... | @@ -71,9 +71,12 @@ public class OutEntrance { |
| 71 | 71 | m.put("lineName",BasicData.lineCode2NameMap.get(ssLogger.getLineCode())); |
| 72 | 72 | m.put("num",ssLogger.getNum()); |
| 73 | 73 | m.put("dir",ssLogger.getDir()); |
| 74 | - | |
| 74 | + m.put("calleeId",ssLogger.getCalleeId()); | |
| 75 | 75 | //线调页面推送 |
| 76 | - sendUtils.stationcf(m); | |
| 76 | + if(ssLogger.getNum()>15){ | |
| 77 | + sendUtils.stationcf(m); | |
| 78 | + } | |
| 79 | + | |
| 77 | 80 | |
| 78 | 81 | //查询班次情况自动回复 |
| 79 | 82 | //当前日期 |
| ... | ... | @@ -130,6 +133,10 @@ public class OutEntrance { |
| 130 | 133 | return rtn; |
| 131 | 134 | } |
| 132 | 135 | String num=jsonObject.getString("num"); |
| 136 | + if(Integer.parseInt(num)<15){ | |
| 137 | + rtn.put("status",ResponseCode.SUCCESS); | |
| 138 | + return rtn; | |
| 139 | + } | |
| 133 | 140 | String image=jsonObject.getString("image"); |
| 134 | 141 | String img=uploadBase64Img(image); |
| 135 | 142 | JSONArray jsonArray = jsonObject.getJSONArray("stations"); |
| ... | ... | @@ -139,16 +146,17 @@ public class OutEntrance { |
| 139 | 146 | JSONObject line=jsonArray.getJSONObject(i); |
| 140 | 147 | String lineCode = line.get("lineCode").toString(); |
| 141 | 148 | String stationCode = line.get("stationCode").toString(); |
| 142 | - StationRoute stationRoute=BasicData.stationCode2StationMap.get(lineCode+"_"+stationCode); | |
| 149 | + String dir = line.get("dir").toString(); | |
| 150 | + /*StationRoute stationRoute=BasicData.stationCode2StationMap.get(lineCode+"_"+stationCode);*/ | |
| 143 | 151 | Map m = new HashMap(); |
| 144 | 152 | m.put("image", img); |
| 145 | 153 | m.put("stationCode", stationCode); |
| 146 | - m.put("lineCode", stationRoute.getLineCode()); | |
| 147 | - m.put("stationName",BasicData.stationCode2NameMap.get(stationRoute.getLineCode()+"_"+stationRoute.getDirections()+"_"+stationRoute.getStationCode())); | |
| 148 | - m.put("lineName",BasicData.lineCode2NameMap.get(stationRoute.getLineCode())); | |
| 154 | + m.put("lineCode", lineCode); | |
| 155 | + m.put("stationName",BasicData.stationCode2NameMap.get(lineCode+"_"+dir+"_"+stationCode)); | |
| 156 | + m.put("lineName",BasicData.lineCode2NameMap.get(lineCode)); | |
| 149 | 157 | m.put("num",num); |
| 150 | - m.put("xlDir",stationRoute.getDirections()); | |
| 151 | - List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(stationRoute.getLineCode(),stationRoute.getDirections()); | |
| 158 | + m.put("xlDir",dir); | |
| 159 | + List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(lineCode,Integer.parseInt(dir)); | |
| 152 | 160 | List<ScheduleRealInfo> sl=new ArrayList<>(); |
| 153 | 161 | for (ScheduleRealInfo scheduleRealInfo : srList) {//筛选出运营班次 |
| 154 | 162 | if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region"))){ |
| ... | ... | @@ -165,7 +173,7 @@ public class OutEntrance { |
| 165 | 173 | for (int i1 = 0; i1 < sl.size(); i1++) {//最近的已发车班次 |
| 166 | 174 | ScheduleRealInfo scheduleRealInfo=sl.get(i1); |
| 167 | 175 | LocalTime fcsj=LocalTime.parse(scheduleRealInfo.getFcsj(),dateTimeFormatter); |
| 168 | - if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region")) &&scheduleRealInfo.getXlDir().equals(String.valueOf(stationRoute.getDirections())) && fcsj.isAfter(localTime)){ | |
| 176 | + if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region")) &&scheduleRealInfo.getXlDir().equals(dir) && fcsj.isAfter(localTime)){ | |
| 169 | 177 | schedule =sl.get(i1-1);; |
| 170 | 178 | break; |
| 171 | 179 | } | ... | ... |
src/main/java/com/bsth/data/zndd/carMonitor.java
| ... | ... | @@ -26,7 +26,7 @@ public class carMonitor { |
| 26 | 26 | public List<Map> carMonitor(String lineCode,String directions,String station) { |
| 27 | 27 | |
| 28 | 28 | List<Map> list = new ArrayList<>(); //返回的接口数据 |
| 29 | - url = "http://127.0.0.1:9777/xxfb/jd/carMonitor?lineid="+lineCode+"&stopid="+station+"&direction="+directions; | |
| 29 | + url = "http://58.34.52.130:9777/xxfb/jd/carMonitor?lineid="+lineCode+"&stopid="+station+"&direction="+directions; | |
| 30 | 30 | InputStream in = null; |
| 31 | 31 | OutputStream out = null; |
| 32 | 32 | try { | ... | ... |
src/main/java/com/bsth/entity/zndd/StationSignsLogger.java
| ... | ... | @@ -28,6 +28,8 @@ public class StationSignsLogger { |
| 28 | 28 | |
| 29 | 29 | private String sign; |
| 30 | 30 | |
| 31 | + private String calleeId; | |
| 32 | + | |
| 31 | 33 | |
| 32 | 34 | |
| 33 | 35 | public String getLineCode() { |
| ... | ... | @@ -101,4 +103,12 @@ public class StationSignsLogger { |
| 101 | 103 | public void setSign(String sign) { |
| 102 | 104 | this.sign = sign; |
| 103 | 105 | } |
| 106 | + | |
| 107 | + public String getCalleeId() { | |
| 108 | + return calleeId; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setCalleeId(String calleeId) { | |
| 112 | + this.calleeId = calleeId; | |
| 113 | + } | |
| 104 | 114 | } | ... | ... |
src/main/resources/static/real_control_v2/call/assets/css/index.css
| ... | ... | @@ -133,18 +133,19 @@ p { |
| 133 | 133 | } */ |
| 134 | 134 | |
| 135 | 135 | .container-fluid { |
| 136 | - /* height: 52px; */ | |
| 136 | + height: 52px; | |
| 137 | + width: 105px; | |
| 137 | 138 | padding: 14px 0; |
| 138 | 139 | border-color: #40a3fc; |
| 139 | 140 | background: #40a3fc; |
| 140 | - /* border-radius: 26px; */ | |
| 141 | + border-radius: 26px; | |
| 141 | 142 | box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.17); |
| 142 | 143 | font-size: 1.2em; |
| 143 | 144 | display: flex; |
| 144 | 145 | justify-content: center; |
| 145 | 146 | align-items: center; |
| 146 | - margin: 0 10px; | |
| 147 | 147 | color: #fff !important; |
| 148 | + margin-top:400px; | |
| 148 | 149 | } |
| 149 | 150 | |
| 150 | 151 | .login-form_ownid { |
| ... | ... | @@ -429,7 +430,7 @@ p { |
| 429 | 430 | /* */ |
| 430 | 431 | .invitation { |
| 431 | 432 | padding: 40px 15px; |
| 432 | - width: 420px; | |
| 433 | + width: 100%; | |
| 433 | 434 | background-color: #169bd5; |
| 434 | 435 | } |
| 435 | 436 | |
| ... | ... | @@ -442,7 +443,7 @@ p { |
| 442 | 443 | background: url(../images/call_bg.png) no-repeat; |
| 443 | 444 | background-position: center; |
| 444 | 445 | background-size: initial; |
| 445 | - border-radius: 20px; | |
| 446 | + /*border-radius: 20px;*/ | |
| 446 | 447 | box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3); |
| 447 | 448 | } |
| 448 | 449 | ... | ... |
src/main/resources/static/real_control_v2/call/assets/js/index.js
| ... | ... | @@ -1325,13 +1325,14 @@ var OperationPackge = { |
| 1325 | 1325 | }, |
| 1326 | 1326 | p2p: { |
| 1327 | 1327 | // 语音呼叫 |
| 1328 | - makeVoiceCall: async function () { | |
| 1328 | + makeVoiceCall: async function (calleeId) { | |
| 1329 | 1329 | // 关闭设置 |
| 1330 | 1330 | await OperationPackge.p2p.closeSeting(); |
| 1331 | 1331 | // 获取输入的用户 |
| 1332 | - var oPeerId = await OperationPackge.p2p.getPeerUserId(); | |
| 1332 | + /*var oPeerId = await OperationPackge.p2p.getPeerUserId();*/ | |
| 1333 | 1333 | // 查询输入用户合法性 |
| 1334 | - Store.peerUserId = await OperationPackge.p2p.peerUserVaplidity(oPeerId); | |
| 1334 | + console.log("呼叫:"+calleeId) | |
| 1335 | + Store.peerUserId = await OperationPackge.p2p.peerUserVaplidity(calleeId); | |
| 1335 | 1336 | if (Store.peerUserId) { |
| 1336 | 1337 | Store.repetitionClick = true; |
| 1337 | 1338 | Store.network = Object.assign(Store.network, { |
| ... | ... | @@ -2783,9 +2784,10 @@ var OperationPackge = { |
| 2783 | 2784 | Utils.inputChangId("#userInputs > input"); |
| 2784 | 2785 | // 语音呼叫 |
| 2785 | 2786 | $("#p2pAudioMakeCall").click(function () { |
| 2787 | + var calleeId=$(this).val(); | |
| 2786 | 2788 | if (navigator.onLine && Store.lineworkRTC && Store.lineworkRTM) { |
| 2787 | 2789 | if (!Store.repetitionClick) { |
| 2788 | - OperationPackge.p2p.makeVoiceCall(); | |
| 2790 | + OperationPackge.p2p.makeVoiceCall(calleeId); | |
| 2789 | 2791 | } |
| 2790 | 2792 | } else { |
| 2791 | 2793 | // 页面提示 | ... | ... |
src/main/resources/static/real_control_v2/call/index.html
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | |
| 33 | 33 | > |
| 34 | 34 | <!-- --> |
| 35 | - <div class="login d-flex flex-row align-items-stretch"> | |
| 35 | + <div> | |
| 36 | 36 | <!-- 警告框 --> |
| 37 | 37 | <div class="warning_box" id="warningBox"></div> |
| 38 | 38 | <!-- --> |
| ... | ... | @@ -726,4 +726,11 @@ |
| 726 | 726 | </div> |
| 727 | 727 | <script src="/real_control_v2/call/assets/js/index.js"></script> |
| 728 | 728 | </body> |
| 729 | +<script> | |
| 730 | + (function() { | |
| 731 | + const urlParams = new URLSearchParams(window.location.search); | |
| 732 | + const calleeId = urlParams.get('calleeId'); | |
| 733 | + $("#p2pAudioMakeCall").val(calleeId); | |
| 734 | + })(); | |
| 735 | +</script> | |
| 729 | 736 | </html> | ... | ... |
src/main/resources/static/real_control_v2/js/stationcf/stationcf.js
| ... | ... | @@ -26,7 +26,8 @@ var gb_stationcf = (function () { |
| 26 | 26 | |
| 27 | 27 | $wrap.on('click', '.all', function () { |
| 28 | 28 | var type = $(this).data('ip'); |
| 29 | - let pageUrl ="/real_control_v2/call/index.html"; | |
| 29 | + var calleeId = $(this).data('call') | |
| 30 | + let pageUrl ="/real_control_v2/call/index.html?calleeId="+calleeId; | |
| 30 | 31 | //将片段路径写入 localStorage |
| 31 | 32 | window.localStorage.setItem('real_control_form_embed_pageUrl', pageUrl); |
| 32 | 33 | var index = layer.open({ | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -236,7 +236,7 @@ |
| 236 | 236 | <script src="/real_control_v2/js/forms/form_embed.js" merge="custom_js"></script> |
| 237 | 237 | <!-- 模态框扩展 --> |
| 238 | 238 | <script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> |
| 239 | - | |
| 239 | +<script src="/real_control_v2/call/assets/js/index.js" merge="custom_js"></script> | |
| 240 | 240 | <!-- #### 安全驾驶 start ### --> |
| 241 | 241 | <div class="multi_plat_msg_pop_wrap" ></div> |
| 242 | 242 | <script id="sd_plat_msg_template" type="text/html"> |
| ... | ... | @@ -270,7 +270,7 @@ |
| 270 | 270 | <span class="tests">站点人数 {{num}}</span> |
| 271 | 271 | <span class="time">催发时间:{{timeStr}}</span> |
| 272 | 272 | </div> |
| 273 | - <button class="all uk-button uk-modal-close" class="title" data-ip="{{dir}}" value="{{dir}}">拨打站台电话</button> | |
| 273 | + <button class="all uk-button uk-modal-close" class="title" data-call="{{calleeId}}" data-ip="{{dir}}" value="{{dir}}">拨打站台电话</button> | |
| 274 | 274 | <button class="images uk-button uk-modal-close" data-image="{{image}}" value="{{dir}}">查看图片</button> |
| 275 | 275 | </div> |
| 276 | 276 | </script> | ... | ... |