Commit 268615d2b5b9dd907e86b3b8c72fcc491f423235

Authored by 潘钊
1 parent b44408ba

update

src/main/java/com/bsth/data/gpsdata/GpsRealData.java
@@ -68,7 +68,7 @@ public class GpsRealData implements CommandLineRunner{ @@ -68,7 +68,7 @@ public class GpsRealData implements CommandLineRunner{
68 @Override 68 @Override
69 public void run(String... arg0) throws Exception { 69 public void run(String... arg0) throws Exception {
70 logger.info("gpsDataLoader,20,6"); 70 logger.info("gpsDataLoader,20,6");
71 - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 4, TimeUnit.SECONDS); 71 + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
72 } 72 }
73 73
74 public GpsEntity add(GpsEntity gps) { 74 public GpsEntity add(GpsEntity gps) {
@@ -90,7 +90,7 @@ public class GpsRealData implements CommandLineRunner{ @@ -90,7 +90,7 @@ public class GpsRealData implements CommandLineRunner{
90 } 90 }
91 91
92 gpsMap.put(device, gps); 92 gpsMap.put(device, gps);
93 - if(StringUtils.isNotEmpty(gps.getLineId())) 93 + if(StringUtils.isNotBlank(gps.getLineId()))
94 lineCode2Devices.put(gps.getLineId(), device); 94 lineCode2Devices.put(gps.getLineId(), device);
95 return gps; 95 return gps;
96 } 96 }
@@ -194,6 +194,10 @@ public class GpsRealData implements CommandLineRunner{ @@ -194,6 +194,10 @@ public class GpsRealData implements CommandLineRunner{
194 194
195 String nbbm; 195 String nbbm;
196 for(GpsEntity gps : list){ 196 for(GpsEntity gps : list){
  197 + //没有设备号
  198 + if(StringUtils.isBlank(gps.getDeviceId()))
  199 + continue;
  200 +
197 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); 201 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
198 if(StringUtils.isBlank(nbbm)) 202 if(StringUtils.isBlank(nbbm))
199 gps.setAbnormal(true);//标记为异常数据 203 gps.setAbnormal(true);//标记为异常数据
@@ -249,7 +253,8 @@ public class GpsRealData implements CommandLineRunner{ @@ -249,7 +253,8 @@ public class GpsRealData implements CommandLineRunner{
249 return true; 253 return true;
250 } 254 }
251 } 255 }
252 - else if(BasicData.lineSEPointMap.containsKey(key+"E")){ 256 +
  257 + if(BasicData.lineSEPointMap.containsKey(key+"E")){
253 stationCode = BasicData.lineSEPointMap.get(key+"E"); 258 stationCode = BasicData.lineSEPointMap.get(key+"E");
254 if(gps.getStopNo().equals(stationCode)){ 259 if(gps.getStopNo().equals(stationCode)){
255 gps.setsEPoint(true); 260 gps.setsEPoint(true);
@@ -264,22 +269,22 @@ public class GpsRealData implements CommandLineRunner{ @@ -264,22 +269,22 @@ public class GpsRealData implements CommandLineRunner{
264 * @param gps 269 * @param gps
265 */ 270 */
266 public void correctUpdown(GpsEntity gps){ 271 public void correctUpdown(GpsEntity gps){
267 - Integer updown;  
268 - //如果走向未知,尝试根据站点纠正走向 272 + Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
  273 + if(updown != null && !updown.equals(gps.getUpDown()))
  274 + gps.setUpDown(updown);
  275 + /*//如果走向未知,尝试根据站点纠正走向
269 if(gps.getUpDown() == -1){ 276 if(gps.getUpDown() == -1){
270 - updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());  
271 - if(updown != null)  
272 - gps.setUpDown(updown);  
273 - } 277 +
  278 + }*/
274 279
275 if(isSEPoint(gps)) 280 if(isSEPoint(gps))
276 return; 281 return;
277 282
278 - //如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向 283 + /*//如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向
279 updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); 284 updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
280 if(updown != null && !gps.getUpDown().equals(updown)){ 285 if(updown != null && !gps.getUpDown().equals(updown)){
281 gps.setUpDown(updown); 286 gps.setUpDown(updown);
282 - } 287 + }*/
283 } 288 }
284 } 289 }
285 } 290 }
src/main/resources/static/real_control_v2/css/main.css
@@ -140,8 +140,9 @@ svg.line-chart path.station_link.down { @@ -140,8 +140,9 @@ svg.line-chart path.station_link.down {
140 140
141 svg.line-chart text.station_text { 141 svg.line-chart text.station_text {
142 writing-mode: tb; 142 writing-mode: tb;
143 - fill: #676767;  
144 - text-shadow: 1px 1px 1px #e0e0e0; 143 + fill: #3e3e3e;
  144 + letter-spacing: -.2px;
  145 + text-shadow: 0 0 2px #dadada;
145 } 146 }
146 147
147 svg.line-chart text.station_text.up { 148 svg.line-chart text.station_text.up {
@@ -165,17 +166,19 @@ svg.line-chart g.item:nth-last-child(3)>text { @@ -165,17 +166,19 @@ svg.line-chart g.item:nth-last-child(3)>text {
165 svg.line-chart g.gps-wrap>rect { 166 svg.line-chart g.gps-wrap>rect {
166 width: 28px; 167 width: 28px;
167 height: 24px; 168 height: 24px;
168 - fill: #fff;  
169 - rx: 5px; 169 + /*fill: #fff;*/
  170 + rx: 4px;
170 cursor: pointer; 171 cursor: pointer;
171 } 172 }
172 173
173 svg.line-chart g.gps-wrap>rect[updown="0"] { 174 svg.line-chart g.gps-wrap>rect[updown="0"] {
174 - stroke: #5e96d2; 175 + stroke: rgb(62, 80, 179);
  176 + fill: rgb(62, 80, 179);
175 } 177 }
176 178
177 svg.line-chart g.gps-wrap>rect[updown="1"] { 179 svg.line-chart g.gps-wrap>rect[updown="1"] {
178 - stroke: #c92121; 180 + stroke: #c94f21;
  181 + fill: #c94f21;
179 } 182 }
180 183
181 svg.line-chart g.gps-wrap>rect.hover { 184 svg.line-chart g.gps-wrap>rect.hover {
@@ -189,11 +192,11 @@ svg.line-chart g.gps-wrap>text { @@ -189,11 +192,11 @@ svg.line-chart g.gps-wrap>text {
189 } 192 }
190 193
191 svg.line-chart g.gps-wrap>text[updown="0"] { 194 svg.line-chart g.gps-wrap>text[updown="0"] {
192 - fill: #5e96d2; 195 + fill: #fff;
193 } 196 }
194 197
195 svg.line-chart g.gps-wrap>text[updown="1"] { 198 svg.line-chart g.gps-wrap>text[updown="1"] {
196 - fill: #c92121; 199 + fill: #fff;
197 } 200 }
198 201
199 svg.line-chart .merge_hide { 202 svg.line-chart .merge_hide {
@@ -204,8 +207,11 @@ svg.line-chart g.merge-item rect { @@ -204,8 +207,11 @@ svg.line-chart g.merge-item rect {
204 width: 24px; 207 width: 24px;
205 height: 24px; 208 height: 24px;
206 rx: 15px; 209 rx: 15px;
207 - fill: rgb(62, 80, 179); 210 + fill: #19a53a;
208 cursor: pointer; 211 cursor: pointer;
  212 + stroke: #19a53a;
  213 + stroke-dasharray: 1,2;
  214 + stroke-width: 3px;
209 } 215 }
210 216
211 svg.line-chart g.merge-item text { 217 svg.line-chart g.merge-item text {
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
@@ -97,7 +97,8 @@ var gb_svg_chart = (function() { @@ -97,7 +97,8 @@ var gb_svg_chart = (function() {
97 var c_clzz = { 97 var c_clzz = {
98 'station_circle': true 98 'station_circle': true
99 }; 99 };
100 - items.append('circle').classed(c_clzz) 100 + items.select(function (d) {return d.type!=1?this:null;})
  101 + .append('circle').classed(c_clzz)
101 .attr('cx', cx) 102 .attr('cx', cx)
102 .attr('cy', cy) 103 .attr('cy', cy)
103 .attr('data-id', function(d) { 104 .attr('data-id', function(d) {
@@ -106,13 +107,14 @@ var gb_svg_chart = (function() { @@ -106,13 +107,14 @@ var gb_svg_chart = (function() {
106 107
107 //down circle 108 //down circle
108 c_clzz.down = true; 109 c_clzz.down = true;
109 - items.append('circle').classed(c_clzz) 110 + items.select(function (d) {return d.type!=0?this:null;})
  111 + .append('circle').classed(c_clzz)
110 .attr('cx', cx) 112 .attr('cx', cx)
111 .attr('cy', function(d, i) { 113 .attr('cy', function(d, i) {
112 return cy(d, i) + chart_height; 114 return cy(d, i) + chart_height;
113 }) 115 })
114 .attr('data-id', function(d) { 116 .attr('data-id', function(d) {
115 - return d.id[1]; 117 + return d.type==1?d.id[0]:d.id[1];
116 }); 118 });
117 119
118 //station name text 120 //station name text
@@ -227,7 +229,7 @@ var gb_svg_chart = (function() { @@ -227,7 +229,7 @@ var gb_svg_chart = (function() {
227 if(!this.stopNo || this.stopNo=='') 229 if(!this.stopNo || this.stopNo=='')
228 return true; 230 return true;
229 if(this.sEPoint) 231 if(this.sEPoint)
230 - this.stopNo=this.stopNo+'_'+this.state; 232 + this.stopNo=this.stopNo+'_'+this.upDown;
231 list.push(this); 233 list.push(this);
232 }); 234 });
233 235
@@ -295,12 +297,12 @@ var gb_svg_chart = (function() { @@ -295,12 +297,12 @@ var gb_svg_chart = (function() {
295 //merge rect 297 //merge rect
296 mergerG.append('rect').attr('x', x - 12) 298 mergerG.append('rect').attr('x', x - 12)
297 .attr('y', function() { 299 .attr('y', function() {
298 - return isDown ? y + 5 : y - 30; 300 + return isDown ? y + 7 : y - 32;
299 }); 301 });
300 //merge text 302 //merge text
301 mergerG.append('text').text(gpsArr.length) 303 mergerG.append('text').text(gpsArr.length)
302 .attr('x', x - 4) 304 .attr('x', x - 4)
303 - .attr('y', isDown ? y + 22 : y - 12); 305 + .attr('y', isDown ? y + 24 : y - 14);
304 } 306 }
305 307
306 return { 308 return {