Commit 806da7abe0ff312d9951e0c1630de5948f8a5076

Authored by 廖磊
2 parents 3756d5fe 5a6550d7

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
src/main/java/com/bsth/XDApplication.java
@@ -84,6 +84,7 @@ public class XDApplication implements CommandLineRunner { @@ -84,6 +84,7 @@ public class XDApplication implements CommandLineRunner {
84 } 84 }
85 85
86 public void devInit(){ 86 public void devInit(){
  87 + log.info("devInit...");
87 ScheduledExecutorService sexec = Application.mainServices; 88 ScheduledExecutorService sexec = Application.mainServices;
88 //抓取GPS数据 89 //抓取GPS数据
89 gpsDataLoader.setFlag(-1); 90 gpsDataLoader.setFlag(-1);
@@ -98,12 +99,13 @@ public class XDApplication implements CommandLineRunner { @@ -98,12 +99,13 @@ public class XDApplication implements CommandLineRunner {
98 } 99 }
99 100
100 public void prodInit(){ 101 public void prodInit(){
  102 + log.info("prodInit...");
101 ScheduledExecutorService sexec = Application.mainServices; 103 ScheduledExecutorService sexec = Application.mainServices;
102 //发车信息 104 //发车信息
103 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS); 105 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);
104 //抓取GPS数据 106 //抓取GPS数据
105 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); 107 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
106 - //检查设备掉离线 108 + //GPS设备掉离线
107 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); 109 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
108 //实际排班更新线程 110 //实际排班更新线程
109 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 111 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
src/main/java/com/bsth/data/ThreadMonotor.java
@@ -26,7 +26,7 @@ public class ThreadMonotor extends Thread{ @@ -26,7 +26,7 @@ public class ThreadMonotor extends Thread{
26 } 26 }
27 27
28 if(GpsRealAnalyse.isIdle()){ 28 if(GpsRealAnalyse.isIdle()){
29 - //尝试使用网关的GPS实时对照数据 29 + //切换到备用的网关实时GPS对照数据
30 GpsDataLoaderThread.setFlag(-1); 30 GpsDataLoaderThread.setFlag(-1);
31 } 31 }
32 32
@@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{ @@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{
42 DirectivePushQueue.start(); 42 DirectivePushQueue.start();
43 } 43 }
44 } 44 }
45 -} 45 +}
46 \ No newline at end of file 46 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
@@ -93,7 +93,7 @@ public class GpsEntity { @@ -93,7 +93,7 @@ public class GpsEntity {
93 * 1:网关 93 * 1:网关
94 * 0:转发 94 * 0:转发
95 */ 95 */
96 - private int source; 96 + private int source = -1;
97 97
98 public String getDeviceId() { 98 public String getDeviceId() {
99 return deviceId; 99 return deviceId;
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
@@ -56,9 +56,9 @@ public class GpsRealAnalyse { @@ -56,9 +56,9 @@ public class GpsRealAnalyse {
56 56
57 public void analyse(List<GpsEntity> list) { 57 public void analyse(List<GpsEntity> list) {
58 try { 58 try {
59 - st = System.currentTimeMillis();  
60 - if (GpsDataRecovery.run) 59 + if(list.size() == 0 || GpsDataRecovery.run)
61 return; 60 return;
  61 + st = System.currentTimeMillis();
62 62
63 //按线路分组gps 63 //按线路分组gps
64 ArrayListMultimap multimap = ArrayListMultimap.create(); 64 ArrayListMultimap multimap = ArrayListMultimap.create();
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
@@ -176,6 +176,10 @@ public class GpsDataLoaderThread extends Thread { @@ -176,6 +176,10 @@ public class GpsDataLoaderThread extends Thread {
176 String nbbm; 176 String nbbm;
177 for (GpsEntity gps : list) { 177 for (GpsEntity gps : list) {
178 178
  179 + //没有设备号
  180 + if (StringUtils.isBlank(gps.getDeviceId()))
  181 + continue;
  182 +
179 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); 183 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
180 if (StringUtils.isBlank(nbbm)) 184 if (StringUtils.isBlank(nbbm))
181 gps.setIncomplete(true);//标记为异常数据 185 gps.setIncomplete(true);//标记为异常数据
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
@@ -21,7 +21,7 @@ import java.util.List; @@ -21,7 +21,7 @@ import java.util.List;
21 @Component 21 @Component
22 public class SafeDrivDataLoadThread extends Thread{ 22 public class SafeDrivDataLoadThread extends Thread{
23 23
24 - private final static String url = "http://180.166.5.82:9988//bsth-safedriving/Crlcxb/realtimeInterface.do"; 24 + private final static String url = "http://118.178.187.115/bsth-safedriving/Crlcxb/realtimeInterface.do";
25 25
26 Logger logger = LoggerFactory.getLogger(this.getClass()); 26 Logger logger = LoggerFactory.getLogger(this.getClass());
27 27
src/main/resources/static/pages/control/lineallot/allot.html
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 } 7 }
8 8
9 .line-select.selected { 9 .line-select.selected {
10 - height: 190px; 10 + height: 210px;
11 } 11 }
12 12
13 .line-select .company { 13 .line-select .company {
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 icnames="cl.insideCode" 73 icnames="cl.insideCode"
74 datatype="cci2" 74 datatype="cci2"
75 dataassociate="true" 75 dataassociate="true"
76 - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id, 'isCancel_eq': false} | json }}" 76 + dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"
77 mlp="true" 77 mlp="true"
78 required > 78 required >
79 </sa-Select3> 79 </sa-Select3>
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 icnames="cl.insideCode" 73 icnames="cl.insideCode"
74 datatype="cci2" 74 datatype="cci2"
75 dataassociate="true" 75 dataassociate="true"
76 - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id, 'isCancel_eq': false} | json }}" 76 + dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"
77 mlp="true" 77 mlp="true"
78 required > 78 required >
79 </sa-Select3> 79 </sa-Select3>
src/main/resources/static/real_control_v2/css/home.css
@@ -306,4 +306,7 @@ span.signal-state-speed-limit{ @@ -306,4 +306,7 @@ span.signal-state-speed-limit{
306 306
307 .home-gps-table dl.offline dd:nth-of-type(1) a{ 307 .home-gps-table dl.offline dd:nth-of-type(1) a{
308 color: #a3a2a2; 308 color: #a3a2a2;
  309 +}
  310 +.uk-tab>li:nth-child(n+2)>a{
  311 + margin-left: 0 !important;
309 } 312 }
310 \ No newline at end of file 313 \ No newline at end of file
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -17,12 +17,12 @@ @@ -17,12 +17,12 @@
17 } 17 }
18 18
19 .line_schedule .footer-chart { 19 .line_schedule .footer-chart {
20 - height: 243px; 20 + height: 233px;
21 margin-top: 5px; 21 margin-top: 5px;
22 } 22 }
23 23
24 .line_schedule .uk-grid.top-container { 24 .line_schedule .uk-grid.top-container {
25 - height: calc(100% - 260px); 25 + height: calc(100% - 250px);
26 margin-top: 5px; 26 margin-top: 5px;
27 overflow: hidden; 27 overflow: hidden;
28 } 28 }
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 } 127 }
128 128
129 .schedule-body { 129 .schedule-body {
130 - height: calc(100% - 37px); 130 + height: calc(100% - 31px);
131 background: #fff; 131 background: #fff;
132 } 132 }
133 133
src/main/resources/static/real_control_v2/css/north.css
1 .north { 1 .north {
2 - height: 120px; 2 + /*height: 120px;*/
3 position: relative; 3 position: relative;
4 transition: all .3s ease; 4 transition: all .3s ease;
  5 + padding-bottom: 0;
5 } 6 }
6 7
7 .north.main { 8 .north.main {
8 background: linear-gradient(to right, #082F4A, #125688, #0a3f64); 9 background: linear-gradient(to right, #082F4A, #125688, #0a3f64);
9 /*background-image: url('/assets/img/title-bg.jpg');*/ 10 /*background-image: url('/assets/img/title-bg.jpg');*/
  11 + padding-bottom: 0;
10 } 12 }
11 13
12 .north.monitor { 14 .north.monitor {
@@ -65,10 +67,10 @@ @@ -65,10 +67,10 @@
65 } 67 }
66 68
67 .north .north-tabs { 69 .north .north-tabs {
68 - position: absolute;  
69 width: 100%; 70 width: 100%;
70 bottom: 1px; 71 bottom: 1px;
71 margin-left: -14px; 72 margin-left: -14px;
  73 + margin-top: 35px;
72 } 74 }
73 75
74 .north .north-tabs .uk-tab { 76 .north .north-tabs .uk-tab {
@@ -81,7 +83,7 @@ @@ -81,7 +83,7 @@
81 } 83 }
82 84
83 .north .north-tabs .uk-tab > li.tab-line > a { 85 .north .north-tabs .uk-tab > li.tab-line > a {
84 - padding: 8px 0px 8px 12px; 86 + padding: 8px 0px 8px 17px;
85 } 87 }
86 88
87 .north .north-tabs .uk-tab > li > a:hover, 89 .north .north-tabs .uk-tab > li > a:hover,
@@ -352,4 +354,15 @@ @@ -352,4 +354,15 @@
352 .user_detail_tip .qtip-content{ 354 .user_detail_tip .qtip-content{
353 width: 300px; 355 width: 300px;
354 height: 220px; 356 height: 220px;
  357 +}
  358 +
  359 +.op-beijingtime-time{
  360 + padding-left: 0px;
  361 + width: 107px;
  362 +}
  363 +
  364 +.op-beijingtime-time>span{
  365 + font-size: 18px !important;
  366 + font-family: Microsoft Yahei !important;
  367 + color: blue !important;
355 } 368 }
356 \ No newline at end of file 369 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
@@ -55,6 +55,9 @@ @@ -55,6 +55,9 @@
55 </li> 55 </li>
56 {{/each}} 56 {{/each}}
57 </ul> 57 </ul>
  58 + <a class="uk-navbar-brand op-beijingtime-time" title="每次秒数到0与服务器同步一次,睡眠状态唤醒会短暂异常,可鼠标右击横幅任意区域立刻同步!">
  59 + <span></span>
  60 + </a>
58 <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> 61 <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;">
59 <div class="uk-button-group"> 62 <div class="uk-button-group">
60 <button class="uk-button uk-button-danger exit-system">退出线调</button> 63 <button class="uk-button uk-button-danger exit-system">退出线调</button>
src/main/resources/static/real_control_v2/js/main.js
@@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 function showUpdateDescription() { 169 function showUpdateDescription() {
170 //更新说明 170 //更新说明
171 var updateDescription = { 171 var updateDescription = {
172 - date: '2017-05-12',  
173 - text: '<h5>现在班次调整时,备注是必填项</h5><h5>现在中途更换设备后,需要刷新缓存数据后,再刷新线调页面。</h5><h5>分班套跑车辆将在上午最后一个班次完成后发送线路切换指令。捕捉到出场信号时也会切换至出场班次所在线路,驾驶员请求出场时候也会同步一次状态</h5><h5>修复了一些其他问题。</h5>' 172 + date: '2017-05-16',
  173 + text: '<h5>菜单栏加入了服务器时间</h5>'
174 }; 174 };
175 175
176 var storage = window.localStorage 176 var storage = window.localStorage
src/main/resources/static/real_control_v2/js/north/second_timer.js 0 → 100644
  1 +/**
  2 + * 工具栏上的时钟
  3 + * @type {{}}
  4 + */
  5 +var gb_second_timer = (function () {
  6 +
  7 + var now;
  8 + var _this;
  9 + var secondTimer;
  10 + var contextFlag;
  11 +
  12 + var init = function () {
  13 + _this = $('.op-beijingtime-time>span')[0];
  14 + getServerTime(function (time) {
  15 + now = time;
  16 + $('div.north').bind("contextmenu", function () {
  17 + contextFlag = true;
  18 + });
  19 + setTime();
  20 +
  21 + secondTimer = window.setInterval(function () {
  22 + if(0 == now.getSeconds() || true == contextFlag){
  23 + minuteTimer();
  24 + contextFlag = false;
  25 + }
  26 +
  27 + now = new Date(now.getTime() + 1e3);
  28 + setTime();
  29 + }, 1e3);
  30 + });
  31 + };
  32 +
  33 + var getServerTime = function (callback) {
  34 + function oncallback(jqXHR) {
  35 + var time = jqXHR && jqXHR.getResponseHeader("Date");
  36 + if (time)
  37 + callback(new Date(time))
  38 + }
  39 +
  40 + if ("function" == typeof callback)
  41 + $.ajax({
  42 + url: "/real_control_v2/assets/imgs/time.gif",
  43 + type: "HEAD"
  44 + }).done(function (data, textStatus, jqXHR) {
  45 + oncallback(jqXHR)
  46 + }).fail(function (jqXHR, textStatus, errorThrown) {
  47 + oncallback(jqXHR)
  48 + })
  49 + };
  50 +
  51 + var timeFormat = function(str) {
  52 + return ("0" + str).slice(-2)
  53 + };
  54 +
  55 + var setTime = function () {
  56 + _this.innerHTML = timeFormat(now.getHours()) + ':' + timeFormat(now.getMinutes()) + '.' + timeFormat(now.getSeconds());
  57 + };
  58 +
  59 + var minuteTimer = function () {
  60 + getServerTime(function(time) {
  61 + now = time;
  62 + setTime()
  63 + })
  64 + };
  65 +
  66 + window.setTimeout(init, 6000);
  67 +})();
0 \ No newline at end of file 68 \ No newline at end of file
src/main/resources/static/real_control_v2/js/north/tabs.js
@@ -17,6 +17,7 @@ var gb_tabs = (function() { @@ -17,6 +17,7 @@ var gb_tabs = (function() {
17 $('.north-tabs').html(tabHtmlStr); 17 $('.north-tabs').html(tabHtmlStr);
18 $('.main-container').html(tabContentHtmlStr); 18 $('.main-container').html(tabContentHtmlStr);
19 19
  20 + setTimeout(renderStyle, 4000);
20 //地图选项卡初始点击 21 //地图选项卡初始点击
21 $('#north_tabs_map_btn').one('click', function () { 22 $('#north_tabs_map_btn').one('click', function () {
22 if(typeof(gb_map_overlay_mge)!="undefined"){ 23 if(typeof(gb_map_overlay_mge)!="undefined"){
@@ -37,6 +38,15 @@ var gb_tabs = (function() { @@ -37,6 +38,15 @@ var gb_tabs = (function() {
37 }); 38 });
38 }; 39 };
39 40
  41 + function renderStyle(){
  42 + var rows = parseInt($('.north-tabs').height() / 32);
  43 + if(rows > 1){
  44 + var contHeight = 120 + ((rows - 1) * 36 - 15);
  45 + $('.main-container').css('height', 'calc(100% - '+contHeight+'px)');
  46 + $('.north .north-tabs').css('margin-top', '20px');
  47 + }
  48 + }
  49 +
40 //文件载入完毕 50 //文件载入完毕
41 res_load_ep.emitLater('load_tab'); 51 res_load_ep.emitLater('load_tab');
42 52
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
@@ -13,7 +13,7 @@ var gb_safe_driv = (function () { @@ -13,7 +13,7 @@ var gb_safe_driv = (function () {
13 'A7': '与人交谈' 13 'A7': '与人交谈'
14 }; 14 };
15 15
16 - var path = 'http://180.166.5.82:9988/CurrentSafeDriving/'; 16 + var path = 'http://118.178.187.115/CurrentSafeDriving/';
17 17
18 var $wrap = $('.safe_driv_pop_wrap'); 18 var $wrap = $('.safe_driv_pop_wrap');
19 var max = 5; 19 var max = 5;
src/main/resources/static/real_control_v2/main.html
@@ -163,6 +163,7 @@ @@ -163,6 +163,7 @@
163 <!-- north js --> 163 <!-- north js -->
164 <script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script> 164 <script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script>
165 <script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script> 165 <script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script>
  166 +<script src="/real_control_v2/js/north/second_timer.js" merge="custom_js"></script>
166 <!-- home js --> 167 <!-- home js -->
167 <script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> 168 <script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script>
168 <script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> 169 <script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script>
src/test/resources/testdata/problem.properties
@@ -32,4 +32,4 @@ @@ -32,4 +32,4 @@
32 32
33 31=规则修改,路牌范围,人员范围可以拖动 33 31=规则修改,路牌范围,人员范围可以拖动
34 ##32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入 34 ##32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入
35 -33=时刻表明细班次,里添加,是否停驶选项(计算工时使用) 35 +##33=时刻表明细班次,里添加,是否停驶选项(计算工时使用)