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 68 @Override
69 69 public void run(String... arg0) throws Exception {
70 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 74 public GpsEntity add(GpsEntity gps) {
... ... @@ -90,7 +90,7 @@ public class GpsRealData implements CommandLineRunner{
90 90 }
91 91  
92 92 gpsMap.put(device, gps);
93   - if(StringUtils.isNotEmpty(gps.getLineId()))
  93 + if(StringUtils.isNotBlank(gps.getLineId()))
94 94 lineCode2Devices.put(gps.getLineId(), device);
95 95 return gps;
96 96 }
... ... @@ -194,6 +194,10 @@ public class GpsRealData implements CommandLineRunner{
194 194  
195 195 String nbbm;
196 196 for(GpsEntity gps : list){
  197 + //没有设备号
  198 + if(StringUtils.isBlank(gps.getDeviceId()))
  199 + continue;
  200 +
197 201 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
198 202 if(StringUtils.isBlank(nbbm))
199 203 gps.setAbnormal(true);//标记为异常数据
... ... @@ -249,7 +253,8 @@ public class GpsRealData implements CommandLineRunner{
249 253 return true;
250 254 }
251 255 }
252   - else if(BasicData.lineSEPointMap.containsKey(key+"E")){
  256 +
  257 + if(BasicData.lineSEPointMap.containsKey(key+"E")){
253 258 stationCode = BasicData.lineSEPointMap.get(key+"E");
254 259 if(gps.getStopNo().equals(stationCode)){
255 260 gps.setsEPoint(true);
... ... @@ -264,22 +269,22 @@ public class GpsRealData implements CommandLineRunner{
264 269 * @param gps
265 270 */
266 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 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 280 if(isSEPoint(gps))
276 281 return;
277 282  
278   - //如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向
  283 + /*//如果站点编码和走向相反(即上行站点ID,走向为下行),尝试根据站点纠正走向
279 284 updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());
280 285 if(updown != null && !gps.getUpDown().equals(updown)){
281 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 140  
141 141 svg.line-chart text.station_text {
142 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 148 svg.line-chart text.station_text.up {
... ... @@ -165,17 +166,19 @@ svg.line-chart g.item:nth-last-child(3)>text {
165 166 svg.line-chart g.gps-wrap>rect {
166 167 width: 28px;
167 168 height: 24px;
168   - fill: #fff;
169   - rx: 5px;
  169 + /*fill: #fff;*/
  170 + rx: 4px;
170 171 cursor: pointer;
171 172 }
172 173  
173 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 179 svg.line-chart g.gps-wrap>rect[updown="1"] {
178   - stroke: #c92121;
  180 + stroke: #c94f21;
  181 + fill: #c94f21;
179 182 }
180 183  
181 184 svg.line-chart g.gps-wrap>rect.hover {
... ... @@ -189,11 +192,11 @@ svg.line-chart g.gps-wrap>text {
189 192 }
190 193  
191 194 svg.line-chart g.gps-wrap>text[updown="0"] {
192   - fill: #5e96d2;
  195 + fill: #fff;
193 196 }
194 197  
195 198 svg.line-chart g.gps-wrap>text[updown="1"] {
196   - fill: #c92121;
  199 + fill: #fff;
197 200 }
198 201  
199 202 svg.line-chart .merge_hide {
... ... @@ -204,8 +207,11 @@ svg.line-chart g.merge-item rect {
204 207 width: 24px;
205 208 height: 24px;
206 209 rx: 15px;
207   - fill: rgb(62, 80, 179);
  210 + fill: #19a53a;
208 211 cursor: pointer;
  212 + stroke: #19a53a;
  213 + stroke-dasharray: 1,2;
  214 + stroke-width: 3px;
209 215 }
210 216  
211 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 97 var c_clzz = {
98 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 102 .attr('cx', cx)
102 103 .attr('cy', cy)
103 104 .attr('data-id', function(d) {
... ... @@ -106,13 +107,14 @@ var gb_svg_chart = (function() {
106 107  
107 108 //down circle
108 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 112 .attr('cx', cx)
111 113 .attr('cy', function(d, i) {
112 114 return cy(d, i) + chart_height;
113 115 })
114 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 120 //station name text
... ... @@ -227,7 +229,7 @@ var gb_svg_chart = (function() {
227 229 if(!this.stopNo || this.stopNo=='')
228 230 return true;
229 231 if(this.sEPoint)
230   - this.stopNo=this.stopNo+'_'+this.state;
  232 + this.stopNo=this.stopNo+'_'+this.upDown;
231 233 list.push(this);
232 234 });
233 235  
... ... @@ -295,12 +297,12 @@ var gb_svg_chart = (function() {
295 297 //merge rect
296 298 mergerG.append('rect').attr('x', x - 12)
297 299 .attr('y', function() {
298   - return isDown ? y + 5 : y - 30;
  300 + return isDown ? y + 7 : y - 32;
299 301 });
300 302 //merge text
301 303 mergerG.append('text').text(gpsArr.length)
302 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 308 return {
... ...