Commit a276fda896e5741b2b85ba2392527bf832afb675
Merge branch 'minhang' into qingpu
# Conflicts: # src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java # src/main/java/com/bsth/data/gpsdata/GpsRealData.java
Showing
15 changed files
with
67 additions
and
30 deletions
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
| ... | ... | @@ -51,7 +51,7 @@ public class ArrivalData_GPS implements CommandLineRunner{ |
| 51 | 51 | @Override |
| 52 | 52 | public void run(String... arg0) throws Exception { |
| 53 | 53 | logger.info("ArrivalData_GPS,30,10"); |
| 54 | - //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 30, 10, TimeUnit.SECONDS); | |
| 54 | + Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 30, 10, TimeUnit.SECONDS); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | @Component | ... | ... |
src/main/java/com/bsth/data/directive/FirstScheduleCheckThread.java
| ... | ... | @@ -43,9 +43,7 @@ public class FirstScheduleCheckThread extends Thread{ |
| 43 | 43 | List<ScheduleRealInfo> schList; |
| 44 | 44 | ScheduleRealInfo first; |
| 45 | 45 | for(String car : cars){ |
| 46 | - if(car.equals("SXC-CD1004")){ | |
| 47 | - System.out.println("debugger..."); | |
| 48 | - } | |
| 46 | + | |
| 49 | 47 | schList = dayOfSchedule.findByNbbm(car); |
| 50 | 48 | |
| 51 | 49 | if(null == schList || schList.size() == 0) | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -73,7 +73,7 @@ public class GpsRealData implements CommandLineRunner{ |
| 73 | 73 | @Override |
| 74 | 74 | public void run(String... arg0) throws Exception { |
| 75 | 75 | logger.info("gpsDataLoader,20,6"); |
| 76 | - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 7, TimeUnit.SECONDS); | |
| 76 | + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 6, TimeUnit.SECONDS); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public GpsEntity add(GpsEntity gps) { |
| ... | ... | @@ -189,6 +189,7 @@ public class GpsRealData implements CommandLineRunner{ |
| 189 | 189 | |
| 190 | 190 | String nbbm; |
| 191 | 191 | //附加车辆内部编码 |
| 192 | + Integer updown; | |
| 192 | 193 | for(GpsEntity gps : list){ |
| 193 | 194 | nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); |
| 194 | 195 | if(StringUtils.isBlank(nbbm)) |
| ... | ... | @@ -197,6 +198,12 @@ public class GpsRealData implements CommandLineRunner{ |
| 197 | 198 | gps.setNbbm(nbbm); |
| 198 | 199 | |
| 199 | 200 | gps.setStationName(BasicData.stationCode2NameMap.get(gps.getStopNo())); |
| 201 | + if(gps.getUpDown() == -1){ | |
| 202 | + //如果走向未知,尝试根据站点纠正走向 | |
| 203 | + updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 204 | + if(updown != null) | |
| 205 | + gps.setUpDown(updown); | |
| 206 | + } | |
| 200 | 207 | gpsRealData.add(gps); |
| 201 | 208 | } |
| 202 | 209 | } else | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -118,13 +118,13 @@ public class DayOfSchedule implements CommandLineRunner { |
| 118 | 118 | @Override |
| 119 | 119 | public void run(String... arg0) throws Exception { |
| 120 | 120 | //翻班线程 |
| 121 | - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 20, 120, TimeUnit.SECONDS); | |
| 121 | + Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 20, 240, TimeUnit.SECONDS); | |
| 122 | 122 | //入库 |
| 123 | 123 | Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); |
| 124 | 124 | //首班出场指令补发器 |
| 125 | - Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 10, 60, TimeUnit.SECONDS); | |
| 125 | + Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 10, 120, TimeUnit.SECONDS); | |
| 126 | 126 | //班次误点扫描 |
| 127 | - Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 127 | + //Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | public Map<String, String> getCurrSchDate() { | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | 9 | spring.jpa.show-sql= true |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201:3306/mh_control | |
| 11 | +spring.datasource.url= jdbc:mysql://127.0.0.1:3306/qp_control | |
| 12 | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= 123456 | |
| 13 | +spring.datasource.password= panzhao | |
| 14 | 14 | #DATASOURCE |
| 15 | 15 | spring.datasource.max-active=100 |
| 16 | 16 | spring.datasource.max-idle=8 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
| ... | ... | @@ -118,7 +118,7 @@ |
| 118 | 118 | <script> |
| 119 | 119 | (function() { |
| 120 | 120 | var modal = '#schedule-addsch-modal', |
| 121 | - sch, stationRoutes, parks; | |
| 121 | + sch, stationRoutes, parks, information; | |
| 122 | 122 | $(modal).on('init', function(e, data) { |
| 123 | 123 | sch = data.sch; |
| 124 | 124 | var formHtml = template('schedule-addsch-form-temp', sch); |
| ... | ... | @@ -146,6 +146,8 @@ |
| 146 | 146 | $.get('/basic/parks', function(rs){ |
| 147 | 147 | parks=rs; |
| 148 | 148 | }); |
| 149 | + //线路标准 | |
| 150 | + information=gb_data_basic.getLineInformation(sch.xlBm); | |
| 149 | 151 | |
| 150 | 152 | //submit |
| 151 | 153 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| ... | ... | @@ -194,12 +196,12 @@ |
| 194 | 196 | var qdz=$('[name=qdzCode]', f),zdz=$('[name=zdzCode]', f); |
| 195 | 197 | switch (bcType_e.val()) { |
| 196 | 198 | case 'out': |
| 197 | - qdz.html(park_opts); | |
| 199 | + qdz.html(park_opts).val(information.carPark); | |
| 198 | 200 | zdz.html(opts); |
| 199 | 201 | break; |
| 200 | 202 | case 'in': |
| 201 | 203 | qdz.html(opts); |
| 202 | - zdz.html(park_opts); | |
| 204 | + zdz.html(park_opts).val(information.carPark); | |
| 203 | 205 | break; |
| 204 | 206 | default: |
| 205 | 207 | qdz.html(opts); | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
| ... | ... | @@ -124,7 +124,7 @@ |
| 124 | 124 | <script> |
| 125 | 125 | (function() { |
| 126 | 126 | var modal = '#add-sub-task-other-modal', |
| 127 | - sch, stationRoutes, parks; | |
| 127 | + sch, stationRoutes, parks, information; | |
| 128 | 128 | var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; |
| 129 | 129 | $(modal).on('init', function(e, data) { |
| 130 | 130 | sch = data.sch; |
| ... | ... | @@ -153,6 +153,8 @@ |
| 153 | 153 | $.get('/basic/parks', function(rs){ |
| 154 | 154 | parks=rs; |
| 155 | 155 | }); |
| 156 | + //线路标准 | |
| 157 | + information=gb_data_basic.getLineInformation(sch.xlBm); | |
| 156 | 158 | |
| 157 | 159 | //submit |
| 158 | 160 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| ... | ... | @@ -185,12 +187,12 @@ |
| 185 | 187 | var qdz=$('[name=startStation]', f),zdz=$('[name=endStation]', f); |
| 186 | 188 | switch ($(this).val()) { |
| 187 | 189 | case '3'://出场 |
| 188 | - qdz.html(park_opts); | |
| 190 | + qdz.html(park_opts).val(information.carPark); | |
| 189 | 191 | zdz.html(opts); |
| 190 | 192 | break; |
| 191 | 193 | case '2'://进场 |
| 192 | 194 | qdz.html(opts); |
| 193 | - zdz.html(park_opts); | |
| 195 | + zdz.html(park_opts).val(information.carPark); | |
| 194 | 196 | break; |
| 195 | 197 | default: |
| 196 | 198 | qdz.html(opts); | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| 1 | 1 | <div> |
| 2 | 2 | <script id="line-schedule-table-temp" type="text/html"> |
| 3 | 3 | <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> |
| 4 | - <h3 class="header-title">上行/江月路地铁站</h3> | |
| 4 | + <h3 class="header-title"> | |
| 5 | + {{if dir==0}} | |
| 6 | + 上行/{{line.startStationName}} | |
| 7 | + {{else}} | |
| 8 | + 下行/{{line.endStationName}} | |
| 9 | + {{/if}} | |
| 10 | + </h3> | |
| 5 | 11 | <div class="schedule-body"> |
| 6 | 12 | <div class="ct_table_wrap"> |
| 7 | 13 | <div class="ct_table line-schedule-table"> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/tabs.html
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <div class="uk-margin" id="north_toolbar_panel"> |
| 4 | 4 | <nav class="uk-navbar"> |
| 5 | 5 | <a class="uk-navbar-brand" > |
| 6 | - <span><i class="uk-icon-user"></i> admin3,在线</span><i class="uk-icon-ellipsis-v"></i> | |
| 6 | + <span><i class="uk-icon-user"></i> <span id="north_toolbar_user">{{user.userName}}</span>,在线</span><i class="uk-icon-ellipsis-v"></i> | |
| 7 | 7 | </a> |
| 8 | 8 | <ul class="uk-navbar-nav"> |
| 9 | 9 | {{each list as obj i}} | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| ... | ... | @@ -2,10 +2,11 @@ |
| 2 | 2 | |
| 3 | 3 | var gb_data_basic = (function() { |
| 4 | 4 | |
| 5 | - var stationRoutes,lineCode2NameAll; | |
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", function(routes, code2Name) { | |
| 5 | + var stationRoutes,lineCode2NameAll,lineInformations; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", function(routes, code2Name, informations) { | |
| 7 | 7 | stationRoutes = routes; |
| 8 | 8 | lineCode2NameAll = code2Name; |
| 9 | + lineInformations = informations; | |
| 9 | 10 | gb_main_ep.emitLater('data-basic'); |
| 10 | 11 | }); |
| 11 | 12 | |
| ... | ... | @@ -30,6 +31,16 @@ var gb_data_basic = (function() { |
| 30 | 31 | ep.emit('stationRoutes', gb_common.groupBy(list, 'lineCode')); |
| 31 | 32 | }); |
| 32 | 33 | |
| 34 | + //线路标准信息 | |
| 35 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function(rs){ | |
| 36 | + var informations={}; | |
| 37 | + $.each(rs, function(){ | |
| 38 | + informations[this.line.lineCode] = this; | |
| 39 | + delete this['line']; | |
| 40 | + }); | |
| 41 | + ep.emit('lineInformations', informations); | |
| 42 | + }); | |
| 43 | + | |
| 33 | 44 | //line code to name |
| 34 | 45 | $.get('/basic/lineCode2Name', function(rs){ |
| 35 | 46 | ep.emit('lineCode2Name', rs); |
| ... | ... | @@ -52,6 +63,9 @@ var gb_data_basic = (function() { |
| 52 | 63 | return null; |
| 53 | 64 | } |
| 54 | 65 | |
| 66 | + var getLineInformation=function(lineCode){ | |
| 67 | + return lineInformations[lineCode]; | |
| 68 | + } | |
| 55 | 69 | //文件载入完毕 |
| 56 | 70 | res_load_ep.emitLater('load_data_basic'); |
| 57 | 71 | |
| ... | ... | @@ -59,6 +73,7 @@ var gb_data_basic = (function() { |
| 59 | 73 | activeLines: activeLines, |
| 60 | 74 | line_idx: line_idx, |
| 61 | 75 | codeToLine: codeToLine, |
| 76 | + getLineInformation: getLineInformation, | |
| 62 | 77 | stationRoutes: function(lineCode){return stationRoutes[lineCode]}, |
| 63 | 78 | findLineByCodes: findLineByCodes, |
| 64 | 79 | lineCode2NameAll: function(){return lineCode2NameAll}, | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
src/main/resources/static/real_control_v2/js/main.js
| ... | ... | @@ -22,7 +22,7 @@ var gb_main_ep = new EventProxy(), |
| 22 | 22 | gb_home_line_panel.init(g_emit('gps-time-refresh')); |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | - //start fixed time refresh | |
| 25 | + //start fixed time refresh gps | |
| 26 | 26 | eq.once('gps-time-refresh', function() { |
| 27 | 27 | gb_data_gps.fixedTimeRefresh(); |
| 28 | 28 | g_emit('line-schedule-layout')(); | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | var gb_northToolbar = (function() { |
| 4 | 4 | |
| 5 | 5 | var modal_opts={center: true,bgclose: false}; |
| 6 | + var currentUser; | |
| 6 | 7 | |
| 7 | 8 | $.get('/real_control_v2/fragments/north/toolbar.html', function(temp){ |
| 8 | 9 | ep.emit("template", temp); |
| ... | ... | @@ -12,14 +13,19 @@ var gb_northToolbar = (function() { |
| 12 | 13 | ep.emit("data", data); |
| 13 | 14 | }); |
| 14 | 15 | |
| 15 | - var ep = EventProxy.create("template", "data", function (temp, data) { | |
| 16 | + //当前用户信息 | |
| 17 | + $.get('/user/currentUser', function(user){ | |
| 18 | + ep.emit("user", user); | |
| 19 | + }); | |
| 20 | + | |
| 21 | + var ep = EventProxy.create("template", "data", "user" , function (temp, data, user) { | |
| 22 | + currentUser=user; | |
| 16 | 23 | var t = $('#north-toolbar-temp', temp).html() |
| 17 | - ,htmlStr = template.render(t)({list: data}); | |
| 24 | + ,htmlStr = template.render(t)({list: data, user: currentUser}); | |
| 18 | 25 | $('.north .north-toolbar').html(htmlStr); |
| 19 | 26 | |
| 20 | 27 | //exit |
| 21 | 28 | $('.north .north-toolbar .exit-system').on('click', function(){ |
| 22 | - alert(11); | |
| 23 | 29 | //关闭websocket 连接 |
| 24 | 30 | gb_sch_websocket.sock.close(); |
| 25 | 31 | window.location.href='/pages/control/lineallot/allot.html'; | ... | ... |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
| ... | ... | @@ -35,11 +35,11 @@ var gb_sch_websocket = (function() { |
| 35 | 35 | |
| 36 | 36 | //80协议上报 |
| 37 | 37 | var report80 = function(msg) { |
| 38 | - console.log('report80...', msg); | |
| 39 | - msg.dateStr = moment(msg.timestamp).format('HH:mm'); | |
| 40 | - msg.text = gb_common.reqCode80[msg.data.requestCode]; | |
| 41 | - | |
| 42 | - findMailBox(msg.data.lineId).prepend(temps['sys-note-80-temp'](msg)); | |
| 38 | +// console.log('report80...', msg); | |
| 39 | +// msg.dateStr = moment(msg.timestamp).format('HH:mm'); | |
| 40 | +// msg.text = gb_common.reqCode80[msg.data.requestCode]; | |
| 41 | +// | |
| 42 | +// findMailBox(msg.data.lineId).prepend(temps['sys-note-80-temp'](msg)); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | var waitRemoves = []; | ... | ... |