Commit 2c3c7b2ce6927b58a3033fa167e3fb0d6ecede55

Authored by 潘钊
2 parents f134136e e446403e

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.java
#	src/main/java/com/bsth/data/gpsdata/arrival/SignalHandle.java
#	src/main/java/com/bsth/data/gpsdata/arrival/entity/RouteReverse.java
#	src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
#	src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java
#	src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
#	src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
Showing 61 changed files with 1723 additions and 850 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
13 13 import org.springframework.web.bind.annotation.RequestParam;
14 14 import org.springframework.web.bind.annotation.RestController;
15 15  
  16 +import com.bsth.data.BasicData;
16 17 import com.bsth.entity.mcy_forms.Allline;
17 18 import com.bsth.entity.mcy_forms.Changetochange;
  19 +import com.bsth.entity.mcy_forms.Daily;
18 20 import com.bsth.entity.mcy_forms.Executionrate;
19 21 import com.bsth.entity.mcy_forms.Linepasswengerflow;
20 22 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -231,7 +233,7 @@ public class ExportController {
231 233 listI.add(resList.iterator());
232 234 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
233 235 ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls",
234   - path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("dat").toString())) + ".xls");
  236 + path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("data").toString())) + ".xls");
235 237 } catch (Exception e) {
236 238 e.printStackTrace();
237 239 }
... ... @@ -319,8 +321,31 @@ public class ExportController {
319 321 List<Turnoutrate> turnoutrate = formsService.turnoutrate(map);
320 322 Map<String, Object> map1 = new HashMap<String, Object>();
321 323 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  324 + /*Float xlts=0f;
  325 + Float jh=0f;
  326 + Float sj=0f;
  327 + Float qz=0f;
  328 + Float ccl=0f;
  329 + Float bcjh=0f;
  330 + Float bcsj=0f;
  331 + Float bczxl=0f;
  332 + Float gs=0f;
  333 + Float zhgs=0f;*/
  334 +
322 335 for (Turnoutrate l : turnoutrate) {
323 336 Map<String, Object> m = new HashMap<String, Object>();
  337 +
  338 + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs());
  339 + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs());
  340 + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl());
  341 + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh());
  342 + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj());
  343 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  344 + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh());
  345 + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  346 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  347 +
  348 + */
324 349 m.put("rq", l.getRq());
325 350 m.put("gs", l.getGs());
326 351 m.put("zhgs", l.getZhgs());
... ... @@ -334,6 +359,19 @@ public class ExportController {
334 359 m.put("bbzxl", l.getBbzxl());
335 360 m.put("sm", l.getSm());
336 361 resList.add(m);
  362 +
  363 + /*m=new HashMap<String,Object>();
  364 + m.put("total_xlts", jh);
  365 + m.put("total_jh", jh);
  366 + m.put("total_sj", sj);
  367 + m.put("total_qz", qz);
  368 + m.put("total_ccl", ccl);
  369 + m.put("total_bcjh", bcjh);
  370 + m.put("total_bcsj", bcsj);
  371 + m.put("total_bczxl", bczxl);
  372 + m.put("total_gs", gs);
  373 + m.put("total_zhgs", zhgs);
  374 + */
337 375 }
338 376  
339 377 try {
... ... @@ -356,8 +394,29 @@ public class ExportController {
356 394 List<Executionrate> executionrate = formsService.executionrate(map);
357 395 Map<String, Object> map1 = new HashMap<String, Object>();
358 396 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  397 + /* Float xlts=0f;
  398 + Float jh=0f;
  399 + Float sj=0f;
  400 + Float ccl=0f;
  401 + Float bcjh=0f;
  402 + Float bcsj=0f;
  403 + Float bczxl=0f;
  404 + Float gs=0f;
  405 + Float zhgs=0f;*/
  406 +
359 407 for (Executionrate l : executionrate) {
360 408 Map<String, Object> m = new HashMap<String, Object>();
  409 + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs());
  410 + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs());
  411 + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl());
  412 + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh());
  413 + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj());
  414 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  415 + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh());
  416 + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  417 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  418 +
  419 + */
361 420 m.put("rq", l.getRq());
362 421 m.put("gs", l.getGs());
363 422 m.put("zhgs", l.getZhgs());
... ... @@ -370,6 +429,19 @@ public class ExportController {
370 429 m.put("bbzxl", l.getBbzxl());
371 430 m.put("sm", l.getSm());
372 431 resList.add(m);
  432 +
  433 +
  434 + /* m=new HashMap<String,Object>();
  435 + m.put("total_xlts", jh);
  436 + m.put("total_jh", jh);
  437 + m.put("total_sj", sj);
  438 + m.put("total_ccl", ccl);
  439 + m.put("total_bcjh", bcjh);
  440 + m.put("total_bcsj", bcsj);
  441 + m.put("total_bczxl", bczxl);
  442 + m.put("total_gs", gs);
  443 + m.put("total_zhgs", zhgs);*/
  444 +
373 445 }
374 446  
375 447 try {
... ... @@ -393,12 +465,31 @@ public class ExportController {
393 465 List<Allline> allline = formsService.allline(map);
394 466 Map<String, Object> map1 = new HashMap<String, Object>();
395 467 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  468 + /* Integer jh=0;
  469 + Integer sj=0;
  470 + Integer ccl=0;
  471 + Integer bcjh=0;
  472 + Float bcsj=0f;
  473 + Integer bczxl=0;
  474 + Integer gs=0;
  475 + Float zhgs=0f;
  476 + */
396 477 for (Allline l : allline) {
397 478 Map<String, Object> m = new HashMap<String, Object>();
  479 +
  480 + /*jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs());
  481 + sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs());
  482 + ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh());
  483 + bcjh +=l.getCchsj()==""?0: Integer.valueOf(l.getCchsj());
  484 + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl());
  485 + bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh());
  486 + gs +=l.getBbzxl()==""?0: Integer.valueOf(l.getBbzxl());
  487 + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl());
  488 + */
398 489 m.put("rq", l.getRq());
399   - m.put("gs", l.getGs());
400   - m.put("zhgs", l.getZhgs());
401   - m.put("xl", l.getXl());
  490 + m.put("gs", l.getGsgs());
  491 + m.put("zhgs", l.getFgsgs());
  492 + //m.put("xl", l.getXl());
402 493 m.put("cchjh", l.getCchjh());
403 494 m.put("cchsj", l.getCchsj());
404 495 m.put("chl", l.getChl());
... ... @@ -407,6 +498,17 @@ public class ExportController {
407 498 m.put("bbzxl", l.getBbzxl());
408 499 m.put("sm", l.getSm());
409 500 resList.add(m);
  501 +
  502 + /*m=new HashMap<String,Object>();
  503 + m.put("total_jh", jh);
  504 + m.put("total_sj", sj);
  505 + m.put("total_ccl", ccl);
  506 + m.put("total_bcjh", bcjh);
  507 + m.put("total_bcsj", bcsj);
  508 + m.put("total_bczxl", bczxl);
  509 + m.put("total_gs", gs);
  510 + m.put("total_zhgs", zhgs);
  511 + */
410 512 }
411 513  
412 514 try {
... ... @@ -422,6 +524,56 @@ public class ExportController {
422 524  
423 525  
424 526  
  527 + //班次日报表
  528 + @RequestMapping(value = "/dailyExport", method = RequestMethod.POST)
  529 + public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) {
  530 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  531 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  532 + ReportUtils ee = new ReportUtils();
  533 + List<Daily> allline = formsService.daily(map);
  534 +
  535 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  536 + Float zgl=0f;
  537 + Float ks=0f;
  538 + Float yh=0f;
  539 + Float bc=0f;
  540 + Map<String, Object> m ;
  541 + for (Daily d : allline) {
  542 + m = new HashMap<String, Object>();
  543 + zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc());
  544 + ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1());
  545 + yh +=d.getYh()==""?0f:Float.valueOf(d.getYh());
  546 + bc +=d.getBc()==""?0f:Float.valueOf(d.getBc());
  547 + m.put("zbh", d.getZbh());
  548 + m.put("jgh",d.getJgh());
  549 + m.put("jName", d.getjName());
  550 + m.put("zlc", d.getZlc());
  551 + m.put("jzl1", d.getJzl1());
  552 + m.put("yh", d.getYh());
  553 + m.put("bc", d.getBc());
  554 +
  555 + resList.add(m);
  556 + }
  557 +
  558 + m=new HashMap<String,Object>();
  559 + m.put("total_zgl", zgl);
  560 + m.put("total_ks", ks);
  561 + m.put("total_yh", yh);
  562 + m.put("total_bc", bc);
  563 +
  564 + m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString()));
  565 + m.put("date", map.get("date").toString());
  566 + try {
  567 + listI.add(resList.iterator());
  568 + String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
  569 + ee.excelReplace(listI, new Object[] { m }, path + "mould\\daily.xls", path + "export\\班次日报表"
  570 + + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
  571 + } catch (Exception e) {
  572 + e.printStackTrace();
  573 + }
  574 + return resList;
  575 + }
  576 +
425 577  
426 578  
427 579 }
... ...
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
... ... @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
11 11  
12 12 import com.bsth.entity.mcy_forms.Allline;
13 13 import com.bsth.entity.mcy_forms.Changetochange;
  14 +import com.bsth.entity.mcy_forms.Daily;
14 15 import com.bsth.entity.mcy_forms.Executionrate;
15 16 import com.bsth.entity.mcy_forms.Linepasswengerflow;
16 17 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -112,4 +113,12 @@ public class MCY_FormsController {
112 113  
113 114 return formsService.allline(map);
114 115 }
  116 +
  117 + // 营运线路名称统计表
  118 + @RequestMapping(value = "/daily", method = RequestMethod.POST)
  119 + public List<Daily> daily(@RequestParam Map<String, Object> map) {
  120 +
  121 + return formsService.daily(map);
  122 + }
  123 +
115 124 }
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -64,6 +64,11 @@ public class ReportController {
64 64 return service.tbodyTime3(line, ttinfo);
65 65 }
66 66  
  67 + @RequestMapping(value = "/tbodyTime4", method = RequestMethod.GET)
  68 + public List<Map<String, Object>> tbodyTime4(@RequestParam String line,@RequestParam String ttinfo) {
  69 + return service.tbodyTime4(line, ttinfo);
  70 + }
  71 +
67 72 @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET)
68 73 public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String ttinfo) {
69 74 return service.tbodyTime5(line, ttinfo);
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
1   -package com.bsth.data.gpsdata.arrival;
2   -
3   -import com.bsth.data.gpsdata.GpsEntity;
4   -import com.bsth.data.gpsdata.arrival.handlers.*;
5   -import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
6   -import org.slf4j.Logger;
7   -import org.slf4j.LoggerFactory;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Component;
10   -
11   -import java.util.List;
12   -import java.util.concurrent.CountDownLatch;
13   -import java.util.concurrent.ExecutorService;
14   -import java.util.concurrent.Executors;
15   -
16   -/**
17   - * gps 实时数据分析
18   - * Created by panzhao on 2016/12/27.
19   - */
20   -@Component
21   -public class GpsRealAnalyse {
22   -
23   - Logger logger = LoggerFactory.getLogger(this.getClass());
24   -
25   - @Autowired
26   - OfflineSignalHandle offlineSignalHandle;
27   - @Autowired
28   - CorrectSignalHandle correctSignalHandle;
29   - @Autowired
30   - StationInsideHandle stationInsideHandle;
31   - @Autowired
32   - InOutStationSignalHandle inOutStationSignalHandle;
33   - @Autowired
34   - ReverseSignalHandle reverseSignalHandle;
35   -
36   - //50个线程
37   - static ExecutorService threadPool = Executors.newFixedThreadPool(50);
38   -
39   - public void analyse(List<GpsEntity> list) {
40   - CountDownLatch count = new CountDownLatch(list.size());
41   -
42   - for(GpsEntity gps : list)
43   - threadPool.execute(new SignalHandleThread(gps, count));
44   -
45   - try {
46   - //等待子线程结束
47   - count.await();
48   - } catch (InterruptedException e) {
49   - logger.error("", e);
50   - }
51   - }
52   -
53   - public class SignalHandleThread implements Runnable {
54   -
55   - GpsEntity gps;
56   - CountDownLatch count;
57   -
58   - SignalHandleThread(GpsEntity gps, CountDownLatch count) {
59   - this.gps = gps;
60   - this.count = count;
61   - }
62   -
63   - @Override
64   - public void run() {
65   -
66   - try {
67   - CircleQueue<GpsEntity> prevs = GeoCacheData.getGps(gps.getNbbm());
68   - //掉线处理
69   - offlineSignalHandle.handle(gps, prevs);
70   - //状态处理
71   - if(!correctSignalHandle.handle(gps, prevs))
72   - return;
73   - //场,站内外判断
74   - stationInsideHandle.handle(gps, prevs);
75   - //反向处理
76   - reverseSignalHandle.handle(gps, prevs);
77   - //进出站动作处理
78   - inOutStationSignalHandle.handle(gps, prevs);
79   - GeoCacheData.putGps(gps);
80   -
81   - } catch (Exception e) {
82   - logger.error("", e);
83   - } finally {
84   - count.countDown();
85   - }
86   - }
87   - }
88   -}
  1 +package com.bsth.data.gpsdata.arrival;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.handlers.*;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import java.util.List;
  12 +import java.util.concurrent.CountDownLatch;
  13 +import java.util.concurrent.ExecutorService;
  14 +import java.util.concurrent.Executors;
  15 +
  16 +/**
  17 + * gps 实时数据分析
  18 + * Created by panzhao on 2016/12/27.
  19 + */
  20 +@Component
  21 +public class GpsRealAnalyse {
  22 +
  23 + Logger logger = LoggerFactory.getLogger(this.getClass());
  24 +
  25 + @Autowired
  26 + OfflineSignalHandle offlineSignalHandle;
  27 + @Autowired
  28 + CorrectSignalHandle correctSignalHandle;
  29 + @Autowired
  30 + StationInsideHandle stationInsideHandle;
  31 + @Autowired
  32 + InOutStationSignalHandle inOutStationSignalHandle;
  33 + @Autowired
  34 + ReverseSignalHandle reverseSignalHandle;
  35 +
  36 + //50个线程
  37 + static ExecutorService threadPool = Executors.newFixedThreadPool(50);
  38 +
  39 + public void analyse(List<GpsEntity> list) {
  40 + CountDownLatch count = new CountDownLatch(list.size());
  41 +
  42 + for(GpsEntity gps : list)
  43 + threadPool.execute(new SignalHandleThread(gps, count));
  44 +
  45 + try {
  46 + //等待子线程结束
  47 + count.await();
  48 + } catch (InterruptedException e) {
  49 + logger.error("", e);
  50 + }
  51 + }
  52 +
  53 + public class SignalHandleThread implements Runnable {
  54 +
  55 + GpsEntity gps;
  56 + CountDownLatch count;
  57 +
  58 + SignalHandleThread(GpsEntity gps, CountDownLatch count) {
  59 + this.gps = gps;
  60 + this.count = count;
  61 + }
  62 +
  63 + @Override
  64 + public void run() {
  65 +
  66 + try {
  67 + CircleQueue<GpsEntity> prevs = GeoCacheData.getGps(gps.getNbbm());
  68 + //掉线处理
  69 + offlineSignalHandle.handle(gps, prevs);
  70 + //状态处理
  71 + if(!correctSignalHandle.handle(gps, prevs))
  72 + return;
  73 + //场,站内外判断
  74 + stationInsideHandle.handle(gps, prevs);
  75 + //反向处理
  76 + reverseSignalHandle.handle(gps, prevs);
  77 + //进出站动作处理
  78 + inOutStationSignalHandle.handle(gps, prevs);
  79 + GeoCacheData.putGps(gps);
  80 +
  81 + } catch (Exception e) {
  82 + logger.error("", e);
  83 + } finally {
  84 + count.countDown();
  85 + }
  86 + }
  87 + }
  88 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/SignalHandle.java
... ... @@ -64,4 +64,4 @@ public abstract class SignalHandle {
64 64 gps.setStopNo(station.getCode());
65 65 }
66 66 }
67 67 -}
  68 +}
68 69 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/arrival/entity/RouteReverse.java
... ... @@ -79,4 +79,4 @@ public class RouteReverse {
79 79 public void setNbbm(String nbbm) {
80 80 this.nbbm = nbbm;
81 81 }
82 82 -}
  83 +}
83 84 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/arrival/entity/StationRoute.java
1   -package com.bsth.data.gpsdata.arrival.entity;
2   -
3   -import com.vividsolutions.jts.geom.Point;
4   -import com.vividsolutions.jts.geom.Polygon;
5   -
6   -/**
7   - * Created by panzhao on 2016/12/23.
8   - */
9   -public class StationRoute {
10   -
11   - /**
12   - * 线路编码
13   - */
14   - private String lineCode;
15   -
16   - /**
17   - * 上下行
18   - */
19   - private int directions;
20   -
21   - /**
22   - * 站点编码
23   - */
24   - private String code;
25   -
26   - /**
27   - * 路由顺序
28   - */
29   - private int routeSort;
30   -
31   - /**
32   - * 站点位置
33   - */
34   - private Point point;
35   -
36   - /**
37   - * 圆形半径
38   - */
39   - private Float radius;
40   -
41   - /**
42   - * 多边形电子围栏
43   - */
44   - private Polygon polygon;
45   -
46   - /**
47   - * 站点标记
48   - */
49   - private String mark;
50   -
51   - /**
52   - * 下一站
53   - */
54   - private StationRoute next;
55   -
56   - /**
57   - * 上一站
58   - */
59   - private StationRoute prve;
60   -
61   - private String name;
62   -
63   - public String getCode() {
64   - return code;
65   - }
66   -
67   - public void setCode(String code) {
68   - this.code = code;
69   - }
70   -
71   - public int getRouteSort() {
72   - return routeSort;
73   - }
74   -
75   - public void setRouteSort(int routeSort) {
76   - this.routeSort = routeSort;
77   - }
78   -
79   - public Point getPoint() {
80   - return point;
81   - }
82   -
83   - public void setPoint(Point point) {
84   - this.point = point;
85   - }
86   -
87   - public Float getRadius() {
88   - return radius;
89   - }
90   -
91   - public void setRadius(Float radius) {
92   - this.radius = radius;
93   - }
94   -
95   - public Polygon getPolygon() {
96   - return polygon;
97   - }
98   -
99   - public void setPolygon(Polygon polygon) {
100   - this.polygon = polygon;
101   - }
102   -
103   - public String getLineCode() {
104   - return lineCode;
105   - }
106   -
107   - public void setLineCode(String lineCode) {
108   - this.lineCode = lineCode;
109   - }
110   -
111   - public int getDirections() {
112   - return directions;
113   - }
114   -
115   - public void setDirections(int directions) {
116   - this.directions = directions;
117   - }
118   -
119   - public StationRoute getNext() {
120   - return next;
121   - }
122   -
123   - public void setNext(StationRoute next) {
124   - this.next = next;
125   - }
126   -
127   - public StationRoute getPrve() {
128   - return prve;
129   - }
130   -
131   - public void setPrve(StationRoute prve) {
132   - this.prve = prve;
133   - }
134   -
135   - public String getMark() {
136   - return mark;
137   - }
138   -
139   - public void setMark(String mark) {
140   - this.mark = mark;
141   - }
142   -
143   - public String getName() {
144   - return name;
145   - }
146   -
147   - public void setName(String name) {
148   - this.name = name;
149   - }
150   -}
151   -
  1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +import com.vividsolutions.jts.geom.Point;
  4 +import com.vividsolutions.jts.geom.Polygon;
  5 +
  6 +/**
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class StationRoute {
  10 +
  11 + /**
  12 + * 线路编码
  13 + */
  14 + private String lineCode;
  15 +
  16 + /**
  17 + * 上下行
  18 + */
  19 + private int directions;
  20 +
  21 + /**
  22 + * 站点编码
  23 + */
  24 + private String code;
  25 +
  26 + /**
  27 + * 路由顺序
  28 + */
  29 + private int routeSort;
  30 +
  31 + /**
  32 + * 站点位置
  33 + */
  34 + private Point point;
  35 +
  36 + /**
  37 + * 圆形半径
  38 + */
  39 + private Float radius;
  40 +
  41 + /**
  42 + * 多边形电子围栏
  43 + */
  44 + private Polygon polygon;
  45 +
  46 + /**
  47 + * 站点标记
  48 + */
  49 + private String mark;
  50 +
  51 + /**
  52 + * 下一站
  53 + */
  54 + private StationRoute next;
  55 +
  56 + /**
  57 + * 上一站
  58 + */
  59 + private StationRoute prve;
  60 +
  61 + private String name;
  62 +
  63 + public String getCode() {
  64 + return code;
  65 + }
  66 +
  67 + public void setCode(String code) {
  68 + this.code = code;
  69 + }
  70 +
  71 + public int getRouteSort() {
  72 + return routeSort;
  73 + }
  74 +
  75 + public void setRouteSort(int routeSort) {
  76 + this.routeSort = routeSort;
  77 + }
  78 +
  79 + public Point getPoint() {
  80 + return point;
  81 + }
  82 +
  83 + public void setPoint(Point point) {
  84 + this.point = point;
  85 + }
  86 +
  87 + public Float getRadius() {
  88 + return radius;
  89 + }
  90 +
  91 + public void setRadius(Float radius) {
  92 + this.radius = radius;
  93 + }
  94 +
  95 + public Polygon getPolygon() {
  96 + return polygon;
  97 + }
  98 +
  99 + public void setPolygon(Polygon polygon) {
  100 + this.polygon = polygon;
  101 + }
  102 +
  103 + public String getLineCode() {
  104 + return lineCode;
  105 + }
  106 +
  107 + public void setLineCode(String lineCode) {
  108 + this.lineCode = lineCode;
  109 + }
  110 +
  111 + public int getDirections() {
  112 + return directions;
  113 + }
  114 +
  115 + public void setDirections(int directions) {
  116 + this.directions = directions;
  117 + }
  118 +
  119 + public StationRoute getNext() {
  120 + return next;
  121 + }
  122 +
  123 + public void setNext(StationRoute next) {
  124 + this.next = next;
  125 + }
  126 +
  127 + public StationRoute getPrve() {
  128 + return prve;
  129 + }
  130 +
  131 + public void setPrve(StationRoute prve) {
  132 + this.prve = prve;
  133 + }
  134 +
  135 + public String getMark() {
  136 + return mark;
  137 + }
  138 +
  139 + public void setMark(String mark) {
  140 + this.mark = mark;
  141 + }
  142 +
  143 + public String getName() {
  144 + return name;
  145 + }
  146 +
  147 + public void setName(String name) {
  148 + this.name = name;
  149 + }
  150 +}
  151 +
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java
1   -package com.bsth.data.gpsdata.arrival.handlers;
2   -
3   -import com.bsth.data.gpsdata.GpsEntity;
4   -import com.bsth.data.gpsdata.arrival.SignalHandle;
5   -import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
6   -import com.bsth.data.schedule.DayOfSchedule;
7   -import com.bsth.entity.realcontrol.ChildTaskPlan;
8   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
9   -import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.stereotype.Component;
11   -
12   -/**
13   - * 信号状态纠正
14   - * Created by panzhao on 2016/12/27.
15   - */
16   -@Component
17   -public class CorrectSignalHandle extends SignalHandle {
18   -
19   - @Autowired
20   - DayOfSchedule dayOfSchedule;
21   -
22   - @Override
23   - public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
24   - Object task = dayOfSchedule.executeCurr(gps.getNbbm());
25   - if(task == null)
26   - return false;
27   - ScheduleRealInfo sch;
28   -
29   - //子任务
30   - if(task.getClass().isAssignableFrom(ChildTaskPlan.class)){
31   - ChildTaskPlan childTask = (ChildTaskPlan) task;
32   - sch = childTask.getSchedule();
33   - }
34   - else
35   - sch = (ScheduleRealInfo) task;
36   -
37   - int updown = Integer.parseInt(sch.getXlDir());
38   - //走向
39   - if(gps.getUpDown() != updown){
40   - gps.setUpDown(updown);
41   - gps.setState(0);
42   - }
43   -
44   -
45   - return true;
46   - }
47   -}
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import com.bsth.data.schedule.DayOfSchedule;
  7 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  8 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +/**
  13 + * 信号状态纠正
  14 + * Created by panzhao on 2016/12/27.
  15 + */
  16 +@Component
  17 +public class CorrectSignalHandle extends SignalHandle {
  18 +
  19 + @Autowired
  20 + DayOfSchedule dayOfSchedule;
  21 +
  22 + @Override
  23 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  24 + Object task = dayOfSchedule.executeCurr(gps.getNbbm());
  25 + if(task == null)
  26 + return false;
  27 + ScheduleRealInfo sch;
  28 +
  29 + //子任务
  30 + if(task.getClass().isAssignableFrom(ChildTaskPlan.class)){
  31 + ChildTaskPlan childTask = (ChildTaskPlan) task;
  32 + sch = childTask.getSchedule();
  33 + }
  34 + else
  35 + sch = (ScheduleRealInfo) task;
  36 +
  37 + int updown = Integer.parseInt(sch.getXlDir());
  38 + //走向
  39 + if(gps.getUpDown() != updown){
  40 + gps.setUpDown(updown);
  41 + gps.setState(0);
  42 + }
  43 +
  44 +
  45 + return true;
  46 + }
  47 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java
... ... @@ -40,4 +40,4 @@ public class OfflineSignalHandle extends SignalHandle{
40 40 }
41 41 return true;
42 42 }
43 43 -}
  44 +}
44 45 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
... ... @@ -127,4 +127,4 @@ public class ReverseSignalHandle extends SignalHandle {
127 127 }
128 128 return false;
129 129 }
130 130 -}
  131 +}
131 132 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/StationInsideHandle.java
1   -package com.bsth.data.gpsdata.arrival.handlers;
2   -
3   -import com.bsth.data.gpsdata.GpsEntity;
4   -import com.bsth.data.gpsdata.arrival.GeoCacheData;
5   -import com.bsth.data.gpsdata.arrival.SignalHandle;
6   -import com.bsth.data.gpsdata.arrival.entity.StationRoute;
7   -import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
8   -import com.bsth.data.gpsdata.arrival.utils.GeoUtils;
9   -import org.springframework.stereotype.Component;
10   -
11   -import java.util.List;
12   -
13   -/**
14   - * 站内站外判定
15   - * Created by panzhao on 2016/12/27.
16   - */
17   -@Component
18   -public class StationInsideHandle extends SignalHandle {
19   -
20   -
21   - @Override
22   - public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
23   - //是否在场内
24   - String parkCode = GeoUtils.gpsInCarpark(gps);
25   - if (parkCode != null) {
26   - gps.setInstation(2);
27   - gps.setStopNo(parkCode);
28   - }
29   -
30   - //是否在站内
31   - List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown());
32   - StationRoute station = GeoUtils.gpsInStation(gps, srs);
33   - if (station != null) {
34   - gps.setInstation(1);
35   - gps.setStopNo(station.getCode());
36   - gps.setStation(station);
37   - }
38   -
39   - //在场,站外
40   - if(gps.getInstation() == 0 && isNotEmpty(prevs)){
41   - //继承上一个点的站点编码
42   - GpsEntity prev = prevs.getTail();
43   - gps.setStopNo(prev.getStopNo());
44   - }
45   -
46   - return true;
47   - }
48   -}
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  6 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  7 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  8 +import com.bsth.data.gpsdata.arrival.utils.GeoUtils;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * 站内站外判定
  15 + * Created by panzhao on 2016/12/27.
  16 + */
  17 +@Component
  18 +public class StationInsideHandle extends SignalHandle {
  19 +
  20 +
  21 + @Override
  22 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  23 + //是否在场内
  24 + String parkCode = GeoUtils.gpsInCarpark(gps);
  25 + if (parkCode != null) {
  26 + gps.setInstation(2);
  27 + gps.setStopNo(parkCode);
  28 + }
  29 +
  30 + //是否在站内
  31 + List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown());
  32 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  33 + if (station != null) {
  34 + gps.setInstation(1);
  35 + gps.setStopNo(station.getCode());
  36 + gps.setStation(station);
  37 + }
  38 +
  39 + //在场,站外
  40 + if(gps.getInstation() == 0 && isNotEmpty(prevs)){
  41 + //继承上一个点的站点编码
  42 + GpsEntity prev = prevs.getTail();
  43 + gps.setStopNo(prev.getStopNo());
  44 + }
  45 +
  46 + return true;
  47 + }
  48 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/utils/CircleQueue.java
1   -package com.bsth.data.gpsdata.arrival.utils;
2   -
3   -import java.util.Arrays;
4   -
5   -/**
6   - * 循环队列
7   - * Created by panzhao on 2016/12/23.
8   - */
9   -public class CircleQueue<T> {
10   -
11   - /**
12   - * (循环队列)数组的容量
13   - */
14   - public int capacity;
15   -
16   - /**
17   - * 数组:保存循环队列的元素
18   - */
19   - public Object[] elementData;
20   -
21   - /**
22   - * 头
23   - */
24   - public int head = 0;
25   -
26   - /**
27   - * 尾
28   - */
29   - public int tail = 0;
30   -
31   - /**
32   - * 以指定长度的数组来创建循环队列
33   - *
34   - * @param initSize
35   - */
36   - public CircleQueue(final int initSize) {
37   - capacity = initSize;
38   - elementData = new Object[capacity];
39   - }
40   -
41   - /**
42   - * 获取循环队列的大小
43   - */
44   - public int size() {
45   - if (isEmpty()) {
46   - return 0;
47   - } else if (isFull()) {
48   - return capacity;
49   - } else {
50   - return tail + 1;
51   - }
52   - }
53   -
54   - /**
55   - * 插入队尾一个元素
56   - */
57   - public void add(final T element) {
58   - if (isEmpty()) {
59   - elementData[0] = element;
60   - } else if (isFull()) {
61   - elementData[head] = element;
62   - head++;
63   - tail++;
64   - head = head == capacity ? 0 : head;
65   - tail = tail == capacity ? 0 : tail;
66   - } else {
67   - elementData[tail + 1] = element;
68   - tail++;
69   - }
70   - }
71   -
72   - public boolean isEmpty() {
73   - return tail == head && tail == 0 && elementData[tail] == null;
74   - }
75   -
76   - public boolean isFull() {
77   - return head != 0 && head - tail == 1 || head == 0 && tail == capacity - 1;
78   - }
79   -
80   - public void clear() {
81   - Arrays.fill(elementData, null);
82   - head = 0;
83   - tail = 0;
84   - }
85   -
86   - /**
87   - * @return 取 循环队列里的值(先进的index=0)
88   - */
89   - public Object[] getQueue() {
90   - final Object[] elementDataSort;
91   - final Object[] elementDataCopy = elementData.clone();
92   - if (isEmpty()) {
93   - elementDataSort = new Object[0];
94   - } else if (isFull()) {
95   - elementDataSort = new Object[capacity];
96   - int indexMax = capacity;
97   - int indexSort = 0;
98   - for (int i = head; i < indexMax;) {
99   - elementDataSort[indexSort] = elementDataCopy[i];
100   - indexSort++;
101   - i++;
102   - if (i == capacity) {
103   - i = 0;
104   - indexMax = head;
105   - }
106   - }
107   - } else {
108   - elementDataSort = new Object[tail];
109   - for (int i = 0; i < tail; i++) {
110   - elementDataSort[i] = elementDataCopy[i];
111   - }
112   - }
113   - return elementDataSort;
114   - }
115   -
116   - /**
117   - * 取最后一个值
118   - * @return
119   - */
120   - public T getTail(){
121   - return elementData[tail] == null?null:(T)elementData[tail];
122   - }
  1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import java.util.Arrays;
  4 +
  5 +/**
  6 + * 循环队列
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class CircleQueue<T> {
  10 +
  11 + /**
  12 + * (循环队列)数组的容量
  13 + */
  14 + public int capacity;
  15 +
  16 + /**
  17 + * 数组:保存循环队列的元素
  18 + */
  19 + public Object[] elementData;
  20 +
  21 + /**
  22 + * 头
  23 + */
  24 + public int head = 0;
  25 +
  26 + /**
  27 + * 尾
  28 + */
  29 + public int tail = 0;
  30 +
  31 + /**
  32 + * 以指定长度的数组来创建循环队列
  33 + *
  34 + * @param initSize
  35 + */
  36 + public CircleQueue(final int initSize) {
  37 + capacity = initSize;
  38 + elementData = new Object[capacity];
  39 + }
  40 +
  41 + /**
  42 + * 获取循环队列的大小
  43 + */
  44 + public int size() {
  45 + if (isEmpty()) {
  46 + return 0;
  47 + } else if (isFull()) {
  48 + return capacity;
  49 + } else {
  50 + return tail + 1;
  51 + }
  52 + }
  53 +
  54 + /**
  55 + * 插入队尾一个元素
  56 + */
  57 + public void add(final T element) {
  58 + if (isEmpty()) {
  59 + elementData[0] = element;
  60 + } else if (isFull()) {
  61 + elementData[head] = element;
  62 + head++;
  63 + tail++;
  64 + head = head == capacity ? 0 : head;
  65 + tail = tail == capacity ? 0 : tail;
  66 + } else {
  67 + elementData[tail + 1] = element;
  68 + tail++;
  69 + }
  70 + }
  71 +
  72 + public boolean isEmpty() {
  73 + return tail == head && tail == 0 && elementData[tail] == null;
  74 + }
  75 +
  76 + public boolean isFull() {
  77 + return head != 0 && head - tail == 1 || head == 0 && tail == capacity - 1;
  78 + }
  79 +
  80 + public void clear() {
  81 + Arrays.fill(elementData, null);
  82 + head = 0;
  83 + tail = 0;
  84 + }
  85 +
  86 + /**
  87 + * @return 取 循环队列里的值(先进的index=0)
  88 + */
  89 + public Object[] getQueue() {
  90 + final Object[] elementDataSort;
  91 + final Object[] elementDataCopy = elementData.clone();
  92 + if (isEmpty()) {
  93 + elementDataSort = new Object[0];
  94 + } else if (isFull()) {
  95 + elementDataSort = new Object[capacity];
  96 + int indexMax = capacity;
  97 + int indexSort = 0;
  98 + for (int i = head; i < indexMax;) {
  99 + elementDataSort[indexSort] = elementDataCopy[i];
  100 + indexSort++;
  101 + i++;
  102 + if (i == capacity) {
  103 + i = 0;
  104 + indexMax = head;
  105 + }
  106 + }
  107 + } else {
  108 + elementDataSort = new Object[tail];
  109 + for (int i = 0; i < tail; i++) {
  110 + elementDataSort[i] = elementDataCopy[i];
  111 + }
  112 + }
  113 + return elementDataSort;
  114 + }
  115 +
  116 + /**
  117 + * 取最后一个值
  118 + * @return
  119 + */
  120 + public T getTail(){
  121 + return elementData[tail] == null?null:(T)elementData[tail];
  122 + }
123 123 }
124 124 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/arrival/utils/GeoUtils.java
1   -package com.bsth.data.gpsdata.arrival.utils;
2   -
3   -import com.bsth.data.gpsdata.GpsEntity;
4   -import com.bsth.data.gpsdata.arrival.GeoCacheData;
5   -import com.bsth.data.gpsdata.arrival.entity.StationRoute;
6   -import com.vividsolutions.jts.geom.Coordinate;
7   -import com.vividsolutions.jts.geom.GeometryFactory;
8   -import com.vividsolutions.jts.geom.Point;
9   -import com.vividsolutions.jts.geom.Polygon;
10   -
11   -import java.util.List;
12   -import java.util.Map;
13   -import java.util.Set;
14   -
15   -/**
16   - * Created by panzhao on 2016/12/23.
17   - */
18   -public class GeoUtils {
19   -
20   - private final static double EARTHRADIUS = 6378137;
21   -
22   - private static GeometryFactory geometryFactory = new GeometryFactory();
23   - /**
24   - * gps是否在路由上的某个站内
25   - *
26   - * @param gps
27   - * @param srs
28   - * @return
29   - */
30   - public static StationRoute gpsInStation(GpsEntity gps, List<StationRoute> srs) {
31   - Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
32   - double min = -1, distance, distance2;
33   - StationRoute stationRoute = null;
34   -
35   - for (StationRoute sr : srs) {
36   - if (sr.getPolygon() == null) {
37   - //圆形
38   - distance = getDistance(sr.getPoint(), point);//sr.getPoint().distance(point);
39   -
40   - if (distance > sr.getRadius())
41   - continue;
42   -
43   - if (min > distance || min == -1) {
44   - min = distance;
45   - stationRoute = sr;
46   - }
47   - } else {
48   - //多边形
49   - if (sr.getPolygon().contains(point)) {
50   - stationRoute = sr;
51   - break;
52   - }
53   - }
54   - }
55   - return stationRoute;
56   - }
57   -
58   - public static double getDistance(Point p1, Point p2) {
59   - double lng1 = getLoop(p1.getY(), -180, 180), lat1 = getRange(
60   - p1.getX(), -74, 74);
61   - double lng2 = getLoop(p2.getY(), -180, 180), lat2 = getRange(
62   - p2.getX(), -74, 74);
63   -
64   - double x1, x2, y1, y2;
65   - x1 = degreeToRad(lng1);
66   - y1 = degreeToRad(lat1);
67   - x2 = degreeToRad(lng2);
68   - y2 = degreeToRad(lat2);
69   - return EARTHRADIUS
70   - * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1)
71   - * Math.cos(y2) * Math.cos(x2 - x1)));
72   - }
73   -
74   - private static double getLoop(double v, double a, double b) {
75   - while (v > b) {
76   - v -= b - a;
77   - }
78   - while (v < a) {
79   - v += b - a;
80   - }
81   - return v;
82   - }
83   -
84   - private static double getRange(double v, double a, double b) {
85   - v = Math.min(Math.max(v, a), b);
86   - return v;
87   - }
88   -
89   - private static double degreeToRad(double degree) {
90   - return Math.PI * degree / 180;
91   - }
92   -
93   -
94   - /**
95   - * gps 是否在某个停车场内
96   - * @param gps
97   - * @return
98   - */
99   - public static String gpsInCarpark(GpsEntity gps){
100   - Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
101   -
102   - Map<String, Polygon> carparkMap = GeoCacheData.tccMap;
103   - Set<String> codes = carparkMap.keySet();
104   - Polygon polygon;
105   - for(String code : codes){
106   - polygon = carparkMap.get(code);
107   - if(point.within(polygon)){
108   - return code;
109   - }
110   - }
111   - return null;
112   - }
113   -
114   - /**
115   - * 是否是有效的连续点
116   - * @param prevGps
117   - * @param gps
118   - * @return
119   - */
120   - public static boolean overdue(GpsEntity prevGps, GpsEntity gps) {
121   - return gps.getTimestamp() - prevGps.getTimestamp() < 120000;
122   - }
123   -}
  1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  6 +import com.vividsolutions.jts.geom.Coordinate;
  7 +import com.vividsolutions.jts.geom.GeometryFactory;
  8 +import com.vividsolutions.jts.geom.Point;
  9 +import com.vividsolutions.jts.geom.Polygon;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +import java.util.Set;
  14 +
  15 +/**
  16 + * Created by panzhao on 2016/12/23.
  17 + */
  18 +public class GeoUtils {
  19 +
  20 + private final static double EARTHRADIUS = 6378137;
  21 +
  22 + private static GeometryFactory geometryFactory = new GeometryFactory();
  23 + /**
  24 + * gps是否在路由上的某个站内
  25 + *
  26 + * @param gps
  27 + * @param srs
  28 + * @return
  29 + */
  30 + public static StationRoute gpsInStation(GpsEntity gps, List<StationRoute> srs) {
  31 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  32 + double min = -1, distance, distance2;
  33 + StationRoute stationRoute = null;
  34 +
  35 + for (StationRoute sr : srs) {
  36 + if (sr.getPolygon() == null) {
  37 + //圆形
  38 + distance = getDistance(sr.getPoint(), point);//sr.getPoint().distance(point);
  39 +
  40 + if (distance > sr.getRadius())
  41 + continue;
  42 +
  43 + if (min > distance || min == -1) {
  44 + min = distance;
  45 + stationRoute = sr;
  46 + }
  47 + } else {
  48 + //多边形
  49 + if (sr.getPolygon().contains(point)) {
  50 + stationRoute = sr;
  51 + break;
  52 + }
  53 + }
  54 + }
  55 + return stationRoute;
  56 + }
  57 +
  58 + public static double getDistance(Point p1, Point p2) {
  59 + double lng1 = getLoop(p1.getY(), -180, 180), lat1 = getRange(
  60 + p1.getX(), -74, 74);
  61 + double lng2 = getLoop(p2.getY(), -180, 180), lat2 = getRange(
  62 + p2.getX(), -74, 74);
  63 +
  64 + double x1, x2, y1, y2;
  65 + x1 = degreeToRad(lng1);
  66 + y1 = degreeToRad(lat1);
  67 + x2 = degreeToRad(lng2);
  68 + y2 = degreeToRad(lat2);
  69 + return EARTHRADIUS
  70 + * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1)
  71 + * Math.cos(y2) * Math.cos(x2 - x1)));
  72 + }
  73 +
  74 + private static double getLoop(double v, double a, double b) {
  75 + while (v > b) {
  76 + v -= b - a;
  77 + }
  78 + while (v < a) {
  79 + v += b - a;
  80 + }
  81 + return v;
  82 + }
  83 +
  84 + private static double getRange(double v, double a, double b) {
  85 + v = Math.min(Math.max(v, a), b);
  86 + return v;
  87 + }
  88 +
  89 + private static double degreeToRad(double degree) {
  90 + return Math.PI * degree / 180;
  91 + }
  92 +
  93 +
  94 + /**
  95 + * gps 是否在某个停车场内
  96 + * @param gps
  97 + * @return
  98 + */
  99 + public static String gpsInCarpark(GpsEntity gps){
  100 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  101 +
  102 + Map<String, Polygon> carparkMap = GeoCacheData.tccMap;
  103 + Set<String> codes = carparkMap.keySet();
  104 + Polygon polygon;
  105 + for(String code : codes){
  106 + polygon = carparkMap.get(code);
  107 + if(point.within(polygon)){
  108 + return code;
  109 + }
  110 + }
  111 + return null;
  112 + }
  113 +
  114 + /**
  115 + * 是否是有效的连续点
  116 + * @param prevGps
  117 + * @param gps
  118 + * @return
  119 + */
  120 + public static boolean overdue(GpsEntity prevGps, GpsEntity gps) {
  121 + return gps.getTimestamp() - prevGps.getTimestamp() < 120000;
  122 + }
  123 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/utils/StationRouteComp.java
1   -package com.bsth.data.gpsdata.arrival.utils;
2   -
3   -import com.bsth.data.gpsdata.arrival.entity.StationRoute;
4   -
5   -import java.util.Comparator;
6   -
7   -/**
8   - * Created by panzhao on 2016/12/24.
9   - */
10   -public class StationRouteComp implements Comparator<StationRoute>{
11   - @Override
12   - public int compare(StationRoute s1, StationRoute s2) {
13   - return s1.getRouteSort() - s2.getRouteSort();
14   - }
15   -}
  1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  4 +
  5 +import java.util.Comparator;
  6 +
  7 +/**
  8 + * Created by panzhao on 2016/12/24.
  9 + */
  10 +public class StationRouteComp implements Comparator<StationRoute>{
  11 + @Override
  12 + public int compare(StationRoute s1, StationRoute s2) {
  13 + return s1.getRouteSort() - s2.getRouteSort();
  14 + }
  15 +}
... ...
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
... ... @@ -28,7 +28,7 @@ import java.util.concurrent.Executors;
28 28 * Created by panzhao on 2016/12/24.
29 29 */
30 30 @Component
31   -public class GpsDataRecovery implements ApplicationContextAware{
  31 +public class GpsDataRecovery implements ApplicationContextAware {
32 32  
33 33 static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class);
34 34  
... ... @@ -48,7 +48,7 @@ public class GpsDataRecovery implements ApplicationContextAware{
48 48 //按车辆分组数据
49 49 ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create();
50 50 for (GpsEntity gps : list) {
51   - if(gps.getNbbm() != null)
  51 + if (gps.getNbbm() != null)
52 52 listMap.put(gps.getNbbm(), gps);
53 53 }
54 54  
... ... @@ -126,7 +126,7 @@ public class GpsDataRecovery implements ApplicationContextAware{
126 126 reverseSignalHandle = applicationContext.getBean(ReverseSignalHandle.class);
127 127 }
128 128  
129   - public static class GpsComp implements Comparator<GpsEntity>{
  129 + public static class GpsComp implements Comparator<GpsEntity> {
130 130  
131 131 @Override
132 132 public int compare(GpsEntity g1, GpsEntity g2) {
... ... @@ -134,21 +134,22 @@ public class GpsDataRecovery implements ApplicationContextAware{
134 134 }
135 135 }
136 136  
137   - public static class RecoveryThread implements Runnable{
  137 + public static class RecoveryThread implements Runnable {
138 138 List<GpsEntity> list;
139 139 CountDownLatch count;
140 140  
141   - RecoveryThread(List<GpsEntity> list, CountDownLatch count){
  141 + RecoveryThread(List<GpsEntity> list, CountDownLatch count) {
142 142 this.list = list;
143 143 this.count = count;
144 144 }
  145 +
145 146 @Override
146 147 public void run() {
147 148 try {
148 149 //循环gps恢复数据
149 150 CircleQueue<GpsEntity> prevs;
150 151  
151   - for(GpsEntity gps : list){
  152 + for (GpsEntity gps : list) {
152 153 /* if(gps.getTimestamp() == 1483081260000L)
153 154 System.out.println("aaa");*/
154 155  
... ... @@ -156,7 +157,7 @@ public class GpsDataRecovery implements ApplicationContextAware{
156 157 //掉线处理
157 158 offlineSignalHandle.handle(gps, prevs);
158 159 //状态处理
159   - if(!correctSignalHandle.handle(gps, prevs))
  160 + if (!correctSignalHandle.handle(gps, prevs))
160 161 continue;
161 162 //场,站内外判断
162 163 stationInsideHandle.handle(gps, prevs);
... ... @@ -166,10 +167,9 @@ public class GpsDataRecovery implements ApplicationContextAware{
166 167 inOutStationSignalHandle.handle(gps, prevs);
167 168 GeoCacheData.putGps(gps);
168 169 }
169   - }catch (Exception e){
  170 + } catch (Exception e) {
170 171 logger.error("", e);
171   - }
172   - finally {
  172 + } finally {
173 173 count.countDown();
174 174 }
175 175 }
... ...
src/main/java/com/bsth/entity/mcy_forms/Daily.java 0 → 100644
  1 +package com.bsth.entity.mcy_forms;
  2 +
  3 +public class Daily {
  4 +
  5 + private String rq;//日期
  6 +
  7 + public String getRq() {
  8 + return rq;
  9 + }
  10 +
  11 + public void setRq(String rq) {
  12 + this.rq = rq;
  13 + }
  14 +
  15 + private String zbh;//车牌号
  16 +
  17 + private String jgh;//员工号
  18 +
  19 + private String jName;//驾驶员
  20 +
  21 + private String zlc;//里程
  22 +
  23 + private String jzl1;//空驶公里
  24 +
  25 + private String yh;//油耗
  26 +
  27 + private String bc;//班次
  28 +
  29 + public String getZbh() {
  30 + return zbh;
  31 + }
  32 +
  33 + public void setZbh(String zbh) {
  34 + this.zbh = zbh;
  35 + }
  36 +
  37 + public String getJgh() {
  38 + return jgh;
  39 + }
  40 +
  41 + public void setJgh(String jgh) {
  42 + this.jgh = jgh;
  43 + }
  44 +
  45 + public String getjName() {
  46 + return jName;
  47 + }
  48 +
  49 + public void setjName(String jName) {
  50 + this.jName = jName;
  51 + }
  52 +
  53 + public String getZlc() {
  54 + return zlc;
  55 + }
  56 +
  57 + public void setZlc(String zlc) {
  58 + this.zlc = zlc;
  59 + }
  60 +
  61 + public String getJzl1() {
  62 + return jzl1;
  63 + }
  64 +
  65 + public void setJzl1(String jzl1) {
  66 + this.jzl1 = jzl1;
  67 + }
  68 +
  69 + public String getYh() {
  70 + return yh;
  71 + }
  72 +
  73 + public void setYh(String yh) {
  74 + this.yh = yh;
  75 + }
  76 +
  77 + public String getBc() {
  78 + return bc;
  79 + }
  80 +
  81 + public void setBc(String bc) {
  82 + this.bc = bc;
  83 + }
  84 +
  85 +
  86 +
  87 +
  88 +
  89 +}
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -71,7 +71,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
71 71 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0")
72 72 int findLjbc(String jName,String clZbh,String lpName);
73 73  
74   - @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code = ?3",nativeQuery=true)
  74 + @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id like %?1% and c.inside_code like %?3%",nativeQuery=true)
75 75 List<Object[]> account(String line,String date,String code);
76 76  
77 77 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') "
... ... @@ -125,4 +125,4 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
125 125 @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm")
126 126 List<Map<String,Object>> setDDRBGroup(String date);
127 127  
128   -}
  128 +}
129 129 \ No newline at end of file
... ...
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
... ... @@ -46,23 +46,33 @@ public class OfflineServiceImpl implements OfflineService {
46 46 Object line=map.get("line");
47 47 Object nbbm=map.get("nbbm");
48 48 Object updown=map.get("updown");
49   -
  49 + Object date=map.get("date");
50 50  
51 51 if(line!=null){
52   - if(line.toString()!="")
53   - sql +=" and line="+line;
  52 + sql +=" and line like'%"+line.toString()+"%'";
54 53 }
55 54  
56 55 if(nbbm!=null){
57   - if(nbbm.toString()!="")
58   - sql +=" and vehicle like '%"+nbbm+"%'";
  56 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
59 57 }
60 58  
61 59 if(updown!=null){
62   - if(updown.toString() !="")
63   - sql +="and up_down ="+updown;
  60 + sql +="and up_down like '%"+updown.toString()+"%'";
  61 + }
  62 + if(date!=null){
  63 + if (date.toString().length()>0) {
  64 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  65 + try {
  66 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  67 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  68 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  69 + } catch (ParseException e) {
  70 + // TODO Auto-generated catch block
  71 + e.printStackTrace();
  72 + }
  73 + }
  74 +
64 75 }
65   -
66 76 sql +=" order by id limit ?,?";
67 77  
68 78 try {
... ... @@ -118,19 +128,32 @@ public class OfflineServiceImpl implements OfflineService {
118 128 Object nbbm=map.get("nbbm");
119 129 Object updown=map.get("updown");
120 130  
  131 + Object date=map.get("date");
  132 +
121 133 if(line!=null){
122   - if(line.toString()!="")
123   - sql +=" and line="+line;
  134 + sql +=" and line like'%"+line.toString()+"%'";
124 135 }
125 136  
126 137 if(nbbm!=null){
127   - if(nbbm.toString()!="")
128   - sql +=" and vehicle like '%"+nbbm+"%'";
  138 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
129 139 }
130 140  
131 141 if(updown!=null){
132   - if(updown.toString() !="")
133   - sql +="and up_down ="+updown;
  142 + sql +="and up_down like '%"+updown.toString()+"%'";
  143 + }
  144 + if(date!=null){
  145 + if (date.toString().length()>0) {
  146 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  147 + try {
  148 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  149 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  150 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  151 + } catch (ParseException e) {
  152 + // TODO Auto-generated catch block
  153 + e.printStackTrace();
  154 + }
  155 + }
  156 +
134 157 }
135 158  
136 159 Connection conn = null;
... ...
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
... ... @@ -36,23 +36,33 @@ public class OutboundServiceImpl implements OutboundService{
36 36 Object line=map.get("line");
37 37 Object nbbm=map.get("nbbm");
38 38 Object updown=map.get("updown");
  39 + Object date=map.get("date");
39 40  
40   -
41 41 if(line!=null){
42   - if(line.toString()!="")
43   - sql +=" and line="+line;
  42 + sql +=" and line like'%"+line.toString()+"%'";
44 43 }
45 44  
46 45 if(nbbm!=null){
47   - if(nbbm.toString()!="")
48   - sql +=" and vehicle like '%"+nbbm+"%'";
  46 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
49 47 }
50 48  
51 49 if(updown!=null){
52   - if(updown.toString() !="")
53   - sql +="and up_down ="+updown;
  50 + sql +="and up_down like '%"+updown.toString()+"%'";
  51 + }
  52 + if(date!=null){
  53 + if (date.toString().length()>0) {
  54 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  55 + try {
  56 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  57 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  58 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  59 + } catch (ParseException e) {
  60 + // TODO Auto-generated catch block
  61 + e.printStackTrace();
  62 + }
  63 + }
  64 +
54 65 }
55   -
56 66 sql +=" order by id limit ?,?";
57 67  
58 68  
... ... @@ -102,20 +112,32 @@ public class OutboundServiceImpl implements OutboundService{
102 112 Object line=map.get("line");
103 113 Object nbbm=map.get("nbbm");
104 114 Object updown=map.get("updown");
105   -
  115 + Object date=map.get("date");
106 116 if(line!=null){
107   - if(line.toString()!="")
108   - sql +=" and line="+line;
  117 + sql +=" and line like '%"+line.toString()+"%'";
  118 +
109 119 }
110 120  
111 121 if(nbbm!=null){
112   - if(nbbm.toString()!="")
113   - sql +=" and vehicle like '%"+nbbm+"%'";
  122 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
114 123 }
115 124  
116 125 if(updown!=null){
117   - if(updown.toString() !="")
118   - sql +="and up_down ="+updown;
  126 + sql +=" and up_down like '%"+updown.toString()+"%'";
  127 + }
  128 + if(date!=null){
  129 + if (date.toString().length()>0) {
  130 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  131 + try {
  132 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  133 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  134 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  135 + } catch (ParseException e) {
  136 + // TODO Auto-generated catch block
  137 + e.printStackTrace();
  138 + }
  139 + }
  140 +
119 141 }
120 142 Connection conn = null;
121 143 PreparedStatement ps = null;
... ... @@ -214,7 +236,7 @@ public class OutboundServiceImpl implements OutboundService{
214 236 times=sdf.format(new Date());
215 237 }
216 238 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
217   - String times1=times+" 00:00:01";
  239 + String times1=times+" 00:00:00";
218 240 String times2=times+" 23:59:59";
219 241  
220 242 Connection conn = null;
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -38,22 +38,34 @@ public class SpeedingServiceImpl implements SpeedingService {
38 38 Object line=map.get("line");
39 39 Object nbbm=map.get("nbbm");
40 40 Object updown=map.get("updown");
41   -
  41 + Object date=map.get("date");
42 42  
43 43 if(line!=null){
44   - if(line.toString()!="")
45   - sql +=" and line="+line;
  44 + sql +=" and line like'%"+line.toString()+"%'";
46 45 }
47 46  
48 47 if(nbbm!=null){
49   - if(nbbm.toString()!="")
50   - sql +=" and vehicle like '%"+nbbm+"%'";
  48 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
51 49 }
52 50  
53 51 if(updown!=null){
54   - if(updown.toString() !="")
55   - sql +="and up_down ="+updown;
  52 + sql +="and up_down like '%"+updown.toString()+"%'";
  53 + }
  54 + if(date!=null){
  55 + if (date.toString().length()>0) {
  56 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  57 + try {
  58 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  59 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  60 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  61 + } catch (ParseException e) {
  62 + // TODO Auto-generated catch block
  63 + e.printStackTrace();
  64 + }
  65 + }
  66 +
56 67 }
  68 +
57 69  
58 70 sql +=" order by id limit ?,?";
59 71  
... ... @@ -103,19 +115,32 @@ public class SpeedingServiceImpl implements SpeedingService {
103 115 Object nbbm=map.get("nbbm");
104 116 Object updown=map.get("updown");
105 117  
  118 + Object date=map.get("date");
  119 +
106 120 if(line!=null){
107   - if(line.toString()!="")
108   - sql +=" and line="+line;
  121 + sql +=" and line like'%"+line.toString()+"%'";
109 122 }
110 123  
111 124 if(nbbm!=null){
112   - if(nbbm.toString()!="")
113   - sql +=" and vehicle like '%"+nbbm+"%'";
  125 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
114 126 }
115 127  
116 128 if(updown!=null){
117   - if(updown.toString() !="")
118   - sql +="and up_down ="+updown;
  129 + sql +="and up_down like '%"+updown.toString()+"%'";
  130 + }
  131 + if(date!=null){
  132 + if (date.toString().length()>0) {
  133 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS");
  134 + try {
  135 + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
  136 + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
  137 + sql += " and timestamp >="+t1 +" and timestamp <="+t2;
  138 + } catch (ParseException e) {
  139 + // TODO Auto-generated catch block
  140 + e.printStackTrace();
  141 + }
  142 + }
  143 +
119 144 }
120 145 Connection conn = null;
121 146 PreparedStatement ps = null;
... ...
src/main/java/com/bsth/service/forms/ExportService.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.forms;
2 2  
3 3 import java.util.List;
4 4  
  5 +import com.bsth.entity.mcy_forms.Daily;
5 6 import com.bsth.entity.mcy_forms.Linepasswengerflow;
6 7 import com.bsth.entity.mcy_forms.Operationservice;
7 8 import com.bsth.entity.mcy_forms.Shifday;
... ... @@ -28,6 +29,6 @@ public interface ExportService {
28 29 public void operationservice(String startDate, String endDate, String lpName,
29 30 List<Operationservice> resList);
30 31  
31   -
  32 +
32 33  
33 34 }
... ...
src/main/java/com/bsth/service/forms/FormsService.java
... ... @@ -5,6 +5,7 @@ import java.util.Map;
5 5  
6 6 import com.bsth.entity.mcy_forms.Allline;
7 7 import com.bsth.entity.mcy_forms.Changetochange;
  8 +import com.bsth.entity.mcy_forms.Daily;
8 9 import com.bsth.entity.mcy_forms.Executionrate;
9 10 import com.bsth.entity.mcy_forms.Linepasswengerflow;
10 11 import com.bsth.entity.mcy_forms.Operationservice;
... ... @@ -39,4 +40,6 @@ public interface FormsService {
39 40 public List<Executionrate> executionrate(Map<String, Object> map);
40 41  
41 42 public List<Allline> allline(Map<String, Object> map);
  43 +
  44 + public List<Daily> daily(Map<String, Object> map);
42 45 }
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -25,6 +25,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
25 25 import com.bsth.entity.mcy_forms.Waybillday;
26 26 import com.bsth.entity.mcy_forms.Allline;
27 27 import com.bsth.entity.mcy_forms.Changetochange;
  28 +import com.bsth.entity.mcy_forms.Daily;
28 29 import com.bsth.entity.mcy_forms.Executionrate;
29 30 import com.bsth.service.forms.CommonService;
30 31 import com.bsth.service.forms.FormsService;
... ... @@ -290,6 +291,7 @@ public class FormsServiceImpl implements FormsService {
290 291  
291 292 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
292 293  
  294 +
293 295 @Override
294 296 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
295 297 Changetochange chan = new Changetochange();
... ... @@ -314,6 +316,7 @@ public class FormsServiceImpl implements FormsService {
314 316 return list;
315 317 }
316 318  
  319 +
317 320 // 路单数据
318 321 @Override
319 322 public List<Singledata> singledata(Map<String, Object> map) {
... ... @@ -706,4 +709,46 @@ public class FormsServiceImpl implements FormsService {
706 709  
707 710 return list;
708 711 }
  712 +
  713 + @Override
  714 + public List<Daily> daily(Map<String, Object> map) {
  715 +
  716 + String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  717 + + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm "
  718 + + " WHERE 1 = 1"
  719 + + " and r.xl_bm='" + map.get("line").toString() + "'"
  720 + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')"
  721 + + " AND r.gs_bm is not null";
  722 +
  723 + if(map.get("gsdmDaily").toString()!=""){
  724 + sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'";
  725 + }
  726 + if(map.get("fgsdmDaily").toString()!=""){
  727 + sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'";
  728 + }
  729 + sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  730 +
  731 + List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
  732 + @Override
  733 + public Daily mapRow(ResultSet arg0, int arg1) throws SQLException {
  734 + Daily daily = new Daily();
  735 + daily.setRq(arg0.getString("schedule_date_str"));
  736 + daily.setZbh(arg0.getString("cl_zbh"));
  737 + daily.setJgh(arg0.getString("j_gh"));
  738 + daily.setjName(arg0.getString("j_name"));
  739 + daily.setYh(arg0.getString("YH"));
  740 + return daily;
  741 + }
  742 + });
  743 +
  744 + for(int i=0;i<list.size();i++){
  745 + Daily d=list.get(i);
  746 + Map<String, Object> maps = new HashMap<>();
  747 + maps = commonService.findKMBC2(d.getJgh(),d.getZbh(),d.getRq());
  748 + d.setJzl1(maps.get("ksgl").toString());
  749 + d.setZlc(maps.get("realMileage").toString());
  750 + d.setBc(maps.get("sjbc").toString());
  751 + }
  752 + return list;
  753 + }
709 754 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1212,7 +1212,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1212 1212 map.put("ljbc", ljbc);
1213 1213 map.put("sjbc", jhbc-cjbc+ljbc);
1214 1214 map.put("jcclc", jcclc);
1215   - map.put("zkslc", ksgl+jcclc);
  1215 + map.put("zkslc", format.format(ksgl+jcclc));
1216 1216 return map;
1217 1217 }
1218 1218  
... ... @@ -1226,7 +1226,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1226 1226 if(obj != null){
1227 1227 map = new HashMap<String,Object>();
1228 1228 map.put("xlName", xlName);
1229   - map.put("clZbh", code);
  1229 + map.put("clZbh", obj[3]);
1230 1230 map.put("company", obj[0]);
1231 1231 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1]+"")).toUpperCase());
1232 1232 map.put("requestTime", obj[2]);
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -24,6 +24,8 @@ public interface ReportService {
24 24 Map<String, Object> tbodyTime2(String line ,String ttinfo);
25 25  
26 26 List<Map<String, Object>> tbodyTime3(String line ,String ttinfo);
  27 +
  28 + List<Map<String, Object>> tbodyTime4(String line ,String ttinfo);
27 29 List<Map<String, Object>> tbodyTime5(String line ,String ttinfo);
28 30  
29 31 List<Map<String, Object>> getTtinfo(Map<String, Object> map);
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -451,21 +451,36 @@ public class ReportServiceImpl implements ReportService{
451 451 System.out.println(609360%60);
452 452 }
453 453 @Override
454   - public List<Map<String, Object>> tbodyTime3(String line, String date) {
  454 + public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {
455 455 // TODO Auto-generated method stub
456 456 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
457   - String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where "
458   - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' "
459   - + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union "
460   - + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info "
461   - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
462   - + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union "
463   - + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info "
464   - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
465   - + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union "
466   - + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info "
467   - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
468   - + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name";
  457 +
  458 +
  459 +
  460 + String sqlZd=" select t.*,x.station_name as qdz_name from ("
  461 + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'zqc' as lx "
  462 + + " from bsth_c_s_ttinfo_detail where "
  463 + + " bc_type='normal' and ttinfo ='"+ttinfo+"' "
  464 + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz,lp) t1"
  465 + + " group by qdz "
  466 + + " union "
  467 + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'wqc' as lx "
  468 + + " from bsth_c_s_ttinfo_detail where "
  469 + + " bc_type='normal' and ttinfo ='"+ttinfo+"' "
  470 + + " and fcsj>'16:01' and fcsj<'18:00' group by qdz,lp) t2"
  471 + + " group by qdz "
  472 + + " union "
  473 + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'zqj' as lx "
  474 + + " from bsth_c_s_ttinfo_detail where "
  475 + + " bc_type='region' and ttinfo ='"+ttinfo+"' "
  476 + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz,lp) t3"
  477 + + " group by qdz "
  478 + + " union "
  479 + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'wqj' as lx "
  480 + + " from bsth_c_s_ttinfo_detail where "
  481 + + " bc_type='region' and ttinfo ='"+ttinfo+"' "
  482 + + " and fcsj>'16:01' and fcsj<'18:00' group by qdz,lp) t4"
  483 + + " group by qdz ) t left join bsth_c_station x on t.qdz=x.id";
469 484  
470 485 List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
471 486 new RowMapper<Map<String, Object>>(){
... ... @@ -526,55 +541,238 @@ public class ReportServiceImpl implements ReportService{
526 541 }
527 542 return list;
528 543 }
  544 +
529 545 @Override
530   - public List<Map<String, Object>> tbodyTime5(String line, String date) {
  546 + public List<Map<String, Object>> tbodyTime4(String line, String ttinfo) {
  547 + List<Map<String, Object>> list =new ArrayList<>();
531 548 // TODO Auto-generated method stub
532   - String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where "
533   - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
534   - + " and bc_type='out' and xl_dir=0 union "
535   - + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where "
536   - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
537   - + " and bc_type='out' and xl_dir=1";
538   - List<Map<String, Object>> lists= jdbcTemplate.query(sql,
539   - new RowMapper<Map<String, Object>>(){
  549 + //最早营运时间 区分夜宵线
  550 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  551 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  552 +
  553 + //查询全程
  554 + String sqlqc="select t.*,x.station_name as qdz_name from ( "
  555 + + "(SELECT fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  556 + + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj <='"+minfcsj+"' ) "
  557 + + " union "
  558 + + " (SELECT fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  559 + + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj > '"+minfcsj+"') "
  560 + + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id";
  561 + List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
  562 + new RowMapper<Map<String, String>>(){
540 563 @Override
541   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
542   - Map<String, Object> m=new HashMap<String,Object>();
543   - m.put("lx", rs.getString("lx"));
  564 + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
  565 + Map<String, String> m=new HashMap<String,String>();
  566 + m.put("qdz_name", rs.getString("qdz_name"));
544 567 m.put("fcsj", rs.getString("fcsj"));
  568 + m.put("xl", rs.getString("xl_dir"));
545 569 return m;
546 570 }
  571 +
547 572 });
  573 +
  574 + Map<String, Object> qcMap=new HashMap<String,Object>();
  575 + int num=0;
  576 + String sxfcsj="";
  577 + String xxfcsj="";
  578 + String sxzd="";
  579 + String xxzd="";
  580 + for (int i = 0; i < qclist.size(); i++) {
  581 + Map<String, String> map=qclist.get(i);
  582 + if(map.get("xl").equals("0")){
  583 + if(sxzd.equals("")){
  584 + sxzd=map.get("qdz_name").toString();
  585 + qcMap.put("sxzm", sxzd);
  586 + sxfcsj +=map.get("fcsj").toString()+"-";
  587 + }
  588 + if(!(qclist.get(i+1).get("xl").equals("0"))){
  589 + sxfcsj +=map.get("fcsj").toString();
  590 + qcMap.put("sxsj",sxfcsj);
  591 + qcMap.put("sxbc", i+1);
  592 + num=i+1;
  593 + }
  594 + }
  595 + if(map.get("xl").equals("1")){
  596 + if(xxzd.equals("")){
  597 + xxzd=map.get("qdz_name").toString();
  598 + xxfcsj+=map.get("fcsj").toString()+"-";
  599 + qcMap.put("xxzm", xxzd);
  600 + }
  601 + }
  602 + }
  603 + xxfcsj +=qclist.get(qclist.size()-1).get("fcsj").toString();
  604 + qcMap.put("xxsj", xxfcsj);
  605 + qcMap.put("xxbc", qclist.size()-num);
  606 + list.add(qcMap);
548 607  
549   - String sqlList="select * from bsth_c_s_sp_info where "
550   - + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
551   - + " and bc_type='normal' order by fcsj";
552   - List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList,
553   - new RowMapper<SchedulePlanInfo>(){
  608 +
  609 + //查询区间
  610 + String sqlqj="select t.*,x.station_name as qdz_name from ( "
  611 + + "(SELECT fcsj,qdz,'1' as gf,xl_dir FROM bsth_c_s_ttinfo_detail "
  612 + + "where ttinfo ='"+ttinfo+"' and bc_type='region' and fcsj >='06:31'"
  613 + + "and fcsj <'08:30')"
  614 + + " union ( SELECT fcsj,qdz,'2' as gf,xl_dir FROM bsth_c_s_ttinfo_detail "
  615 + + "where ttinfo ='"+ttinfo+"' and bc_type='region' "
  616 + + "and fcsj > '16:01' and fcsj < '18:00') order by xl_dir,gf,fcsj ) t "
  617 + + "left join bsth_c_station x on t.qdz=x.id";
  618 +
  619 + List<Map<String, String>> qjlist= jdbcTemplate.query(sqlqj,
  620 + new RowMapper<Map<String, String>>(){
554 621 @Override
555   - public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
556   - SchedulePlanInfo m=new SchedulePlanInfo();
557   - m.setBcsj(rs.getInt("bcsj"));
558   - m.setXlDir(rs.getString("xl_dir"));
559   - m.setFcsj(rs.getString("fcsj"));
  622 + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
  623 + Map<String, String> m=new HashMap<String,String>();
  624 + m.put("qdz_name", rs.getString("qdz_name"));
  625 + m.put("fcsj", rs.getString("fcsj"));
  626 + m.put("xl", rs.getString("xl_dir"));
  627 + m.put("gf", rs.getString("gf"));
560 628 return m;
561 629 }
562 630 });
563   - //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较)
564   - String lx0="";
565   - String lx1="";
566   - for (int x = 0; x < lists.size(); x++) {
567   - if(lists.get(x).get("lx").equals("lx0")){
568   - lx0=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString();
  631 +
  632 + Map<String, Object> qjzMap=new HashMap<String,Object>();
  633 + Map<String, Object> qjwMap=new HashMap<String,Object>();
  634 + int numqj=0;
  635 + String sxfcsjqj="";
  636 + String xxfcsjqj="";
  637 + String sxzdqj="";
  638 + String xxzdqj="";
  639 + for(int i=0;i<qjlist.size();i++){
  640 + Map<String, String> map=qjlist.get(i);
  641 + if(map.get("xl").toString().equals("0")){
  642 + if(map.get("gf").toString().equals("1")){
  643 + if(sxzdqj.equals("")){
  644 + sxzdqj =map.get("qdz_name").toString();
  645 + qjzMap.put("sxzm", sxzdqj);
  646 + sxfcsjqj +=map.get("fcsj").toString()+"-";
  647 + }
  648 + if(i<qjlist.size()-1){
  649 + if(!(qjlist.get(i+1).get("gf").equals("1"))){
  650 + sxfcsjqj +=map.get("fcsj").toString();
  651 + qjzMap.put("sxsj",sxfcsjqj);
  652 + qjzMap.put("sxbc", i+1);
  653 + numqj=i+1;
  654 + sxzdqj ="";
  655 + sxfcsjqj="";
  656 + }
  657 + }else{
  658 + qjzMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString());
  659 + qjzMap.put("sxbc", i+1);
  660 + numqj=i+1;
  661 + sxzdqj ="";
  662 + sxfcsjqj="";
  663 + }
  664 + }
  665 + if(map.get("gf").toString().equals("2")){
  666 + if(sxzdqj.equals("")){
  667 + sxzdqj =map.get("qdz_name").toString();
  668 + qjwMap.put("sxzm", sxzdqj);
  669 + sxfcsjqj +=map.get("fcsj").toString()+"-";
  670 + }
  671 + if(i<qjlist.size()-1){
  672 + if(!(qjlist.get(i+1).get("xl").equals("0"))){
  673 + sxfcsjqj +=map.get("fcsj").toString();
  674 + qjwMap.put("sxsj",sxfcsjqj);
  675 + qjwMap.put("sxbc", i+1-numqj);
  676 + numqj=i+1;
  677 + }
  678 + }else{
  679 + qjwMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString());
  680 + qjwMap.put("sxbc", i+1-numqj);
  681 + numqj=i+1;
  682 + }
  683 + }
  684 +
569 685 }else{
570   - lx1=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString();
  686 + if(map.get("gf").toString().equals("1")){
  687 + if(xxzdqj.equals("")){
  688 + xxzdqj =map.get("qdz_name").toString();
  689 + qjzMap.put("xxzm", xxzdqj);
  690 + xxfcsjqj +=map.get("fcsj").toString()+"-";
  691 + }
  692 + if(i<qjlist.size()-1){
  693 + if(!(qjlist.get(i+1).get("gf").equals("1"))){
  694 + xxfcsjqj +=map.get("fcsj").toString();
  695 + qjzMap.put("xxsj",xxfcsjqj);
  696 + qjzMap.put("xxbc", i+1-numqj);
  697 + numqj=i+1;
  698 + xxzdqj ="";
  699 + xxfcsjqj="";
  700 + }
  701 + }else{
  702 + qjzMap.put("xxsj",xxfcsjqj+"-"+map.get("fcsj").toString());
  703 + qjzMap.put("xxbc", i+1-numqj);
  704 + numqj=i+1;
  705 + xxzdqj ="";
  706 + xxfcsjqj="";
  707 + }
  708 + }
  709 + if(map.get("gf").toString().equals("2")){
  710 + if(xxzdqj.equals("")){
  711 + xxzdqj =map.get("qdz_name").toString();
  712 + qjwMap.put("xxzm", xxzdqj);
  713 + xxfcsjqj +=map.get("fcsj").toString()+"-";
  714 + }
  715 + if(i<qjlist.size()){
  716 + if(i==qjlist.size()-1){
  717 + xxfcsjqj +=map.get("fcsj").toString();
  718 + qjwMap.put("xxsj",xxfcsjqj);
  719 + qjwMap.put("xxbc", i+1-numqj);
  720 + numqj=i+1;
  721 + }
  722 + }else{
  723 + qjwMap.put("xxsj",xxfcsjqj+"-"+xxfcsjqj);
  724 + qjwMap.put("xxbc", i+1-numqj);
  725 + numqj=i+1;
  726 + }
  727 + }
  728 +
  729 +
571 730 }
572 731 }
573 732  
574   - String[] lx0sj = lx0.split(":");
575   - int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]);
576   - String[] lx1sj = lx1.split(":");
577   - int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]);
  733 + if(!qjzMap.isEmpty()){
  734 + list.add(qjzMap);
  735 + }
  736 + if(!qjwMap.isEmpty()){
  737 + list.add(qjwMap);
  738 +
  739 + }
  740 + return list;
  741 + }
  742 + @Override
  743 + public List<Map<String, Object>> tbodyTime5(String line, String ttinfo) {
  744 + // TODO Auto-generated method stub
  745 + //最早营运时间 区分夜宵线
  746 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  747 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  748 + String[] minSjs = minfcsj.split(":");
  749 + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
  750 + //查询时间里程
  751 + String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,2 as xh FROM "
  752 + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
  753 + + " fcsj <='"+minfcsj+"' and bc_type = 'normal') "
  754 + + " union "
  755 + + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,1 as xh FROM "
  756 + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
  757 + + " fcsj >'"+minfcsj+"' and bc_type ='normal') "
  758 + + " order by xl_dir, xh,fcsj";
  759 +
  760 + Map<String, Object> map=new HashMap<String,Object>();
  761 + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
  762 + new RowMapper<Map<String, Object>>(){
  763 + @Override
  764 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  765 + Map<String, Object> m=new HashMap<String,Object>();
  766 + m.put("fcsj", rs.getString("fcsj"));
  767 + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
  768 + m.put("bcsj", rs.getString("bcsj"));
  769 + m.put("bcType", rs.getString("bc_type"));
  770 + m.put("lp", rs.getString("lp"));
  771 + m.put("dir", rs.getString("xl_dir"));
  772 + return m;
  773 + }
  774 + });
  775 +
578 776 //班次
579 777 int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60;
580 778  
... ... @@ -587,17 +785,17 @@ public class ReportServiceImpl implements ReportService{
587 785 //车距 (发车时间的间距) i--MIN a--MAX
588 786 int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1;
589 787 int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1;
590   -// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  788 +
591 789 for(int i=0;i<list.size();i++){
592   - SchedulePlanInfo t=list.get(i);
593   - String xlDir=t.getXlDir();
594   - int bcsj=t.getBcsj();
595   - String fcsj=t.getFcsj();
  790 + Map<String, Object> ttMap=list.get(i);
  791 + String xlDir=ttMap.get("dir").toString();
  792 + int bcsj=Integer.parseInt(ttMap.get("bcsj").toString());
  793 + String fcsj=ttMap.get("fcsj").toString();
596 794 String[] fcsjs=fcsj.split(":");
597 795 int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);
598 796  
599 797 if(xlDir.equals("0")){
600   - if(fcsjNum>=sxFc && fcsjNum<sj_0){
  798 + if(fcsjNum>=minSj && fcsjNum<sj_0){
601 799 ccsj0 +=bcsj;
602 800 if(aC<0){
603 801 cfc0 =fcsjNum;
... ... @@ -672,7 +870,7 @@ public class ReportServiceImpl implements ReportService{
672 870 }
673 871 jcfc0W=fcsjNum;
674 872 }
675   - }else if(fcsjNum<sxFc){
  873 + }else if(fcsjNum<minSj){
676 874 jcsj0 +=bcsj;
677 875 if(aJcZ<0){
678 876 jcfc0Z=fcsjNum;
... ... @@ -690,7 +888,7 @@ public class ReportServiceImpl implements ReportService{
690 888  
691 889  
692 890 }else{
693   - if(fcsjNum>=xxFc && fcsjNum<sj_0){
  891 + if(fcsjNum>=minSj && fcsjNum<sj_0){
694 892 ccsj1 +=bcsj;
695 893 if(aC1<0){
696 894 cfc1=fcsjNum;
... ... @@ -762,7 +960,7 @@ public class ReportServiceImpl implements ReportService{
762 960  
763 961 jcfc1W=fcsjNum;
764 962 }
765   - }else if(fcsjNum<xxFc){
  963 + }else if(fcsjNum<minSj){
766 964 jcsj1 +=bcsj;
767 965 if(aJc1Z<0){
768 966 jcfc1Z=fcsjNum;
... ... @@ -860,4 +1058,5 @@ public class ReportServiceImpl implements ReportService{
860 1058 }
861 1059 return list;
862 1060 }
  1061 +
863 1062 }
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
... ... @@ -180,6 +180,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
180 180  
181 181  
182 182 } catch (Exception e) {
  183 +
183 184 // TODO Auto-generated catch block
184 185 e.printStackTrace();
185 186 }
... ... @@ -313,6 +314,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
313 314 // TODO Auto-generated catch block
314 315 e.printStackTrace();
315 316 }
  317 + String companyName = "", subCompanyName = "";
  318 +
316 319 for(String key : keyMap.keySet()){
317 320 Map<String, Object> tempMap = new HashMap<String, Object>();
318 321 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>();
... ... @@ -323,6 +326,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
323 326 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0;
324 327 for(ScheduleRealInfo schedule : keyMap.get(key)){
325 328 // schedule.setFcsjAll(schedule.getFcsj());
  329 + if(companyName.length() == 0 && schedule.getGsName() != null)
  330 + companyName = schedule.getGsName();
  331 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  332 + subCompanyName = schedule.getFgsName();
326 333  
327 334 //早晚高峰时段执行率
328 335 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
... ... @@ -424,6 +431,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
424 431  
425 432 }
426 433  
  434 + tempMap.put("company", companyName);
  435 + tempMap.put("subCompany", subCompanyName);
427 436 tempMap.put("date", date);
428 437 tempMap.put("line", key);
429 438 tempMap.put("jhbc", jhbc);
... ... @@ -509,6 +518,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
509 518 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
510 519 schedule.setXlName(rs.getString("xl_name"));
511 520 schedule.setBcType(rs.getString("bc_type"));
  521 + schedule.setGsName(rs.getString("gs_name"));
  522 + schedule.setFgsName(rs.getString("fgs_name"));
512 523 schedule.setBcs(rs.getInt("bcs"));
513 524 schedule.setFcno(rs.getInt("fcno"));
514 525 schedule.setFcsj(rs.getString("fcsj"));
... ... @@ -588,6 +599,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
588 599 }
589 600 }
590 601 }
  602 + String companyName = "", subCompanyName = "";
591 603 for(String key : keyMap.keySet()){
592 604 Map<String, Object> tempMap = new HashMap<String, Object>();
593 605 List<Integer> fcsj = new ArrayList<Integer>();
... ... @@ -595,6 +607,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
595 607 int jhbc = 0;
596 608 int sjbc = 0;
597 609 for(ScheduleRealInfo schedule : keyMap.get(key)){
  610 + if(companyName.length() == 0 && schedule.getGsName() != null)
  611 + companyName = schedule.getGsName();
  612 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  613 + subCompanyName = schedule.getFgsName();
  614 +
598 615 tempMap.put("date", schedule.getScheduleDateStr());
599 616 tempMap.put("bcsj", schedule.getBcsj());
600 617 if(schedule.getFcsjActual() != null){
... ... @@ -654,6 +671,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
654 671 tempMap.put("zmys", "/");
655 672 tempMap.put("pjys", "/");
656 673 }
  674 + tempMap.put("company", companyName);
  675 + tempMap.put("subCompany", subCompanyName);
657 676 String[] split = key.split("/");
658 677 tempMap.put("line", split[0]);
659 678 tempMap.put("qdz", split[1]);
... ...
src/main/resources/static/pages/excep/boundList.html
... ... @@ -82,7 +82,9 @@
82 82 <option value="-1">无效</option>
83 83 </select>
84 84 </td>
85   - <td></td>
  85 + <td>
  86 + <input class="form-control" type="date" name="date" />
  87 + </td>
86 88 <td>
87 89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
88 90 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -237,8 +239,20 @@ $(function(){
237 239 initPagination = false;
238 240 return;
239 241 }
  242 + var cells = $('tr.filter')[0].cells
  243 + ,params = {}
  244 + ,name;
  245 + $.each(cells, function(i, cell){
  246 + var items = $('input,select', cell);
  247 + for(var j = 0, item; item = items[j++];){
  248 + name = $(item).attr('name');
  249 + if(name){
  250 + params[name] = $(item).val();
  251 + }
  252 + }
  253 + });
240 254 page = num - 1;
241   - jsDoQuery(null, false);
  255 + jsDoQuery(params, false);
242 256 }
243 257 });
244 258 }
... ...
src/main/resources/static/pages/excep/offlineList.html
... ... @@ -82,7 +82,9 @@
82 82 <option value="-1">无效</option>
83 83 </select>
84 84 </td>
85   - <td></td>
  85 + <td>
  86 + <input class="form-control" type="date" name="date" />
  87 + </td>
86 88 <td>
87 89 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
88 90 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -242,7 +244,20 @@ $(function(){
242 244  
243 245  
244 246 page = num - 1;
245   - jsDoQuery(null, false);
  247 +
  248 + var cells = $('tr.filter')[0].cells
  249 + ,params = {}
  250 + ,name;
  251 + $.each(cells, function(i, cell){
  252 + var items = $('input,select', cell);
  253 + for(var j = 0, item; item = items[j++];){
  254 + name = $(item).attr('name');
  255 + if(name){
  256 + params[name] = $(item).val();
  257 + }
  258 + }
  259 + });
  260 + jsDoQuery(params, false);
246 261 }
247 262 });
248 263 }
... ...
src/main/resources/static/pages/excep/speedingList.html
... ... @@ -72,6 +72,7 @@
72 72 <input type="text" class="form-control form-filter input-sm" name="nbbm">
73 73 </td>
74 74 <td>
  75 + <input class="form-control" type="date" name="date" />
75 76 </td>
76 77 <td></td>
77 78 <td>
... ... @@ -238,7 +239,19 @@ $(function(){
238 239 return;
239 240 }
240 241 page = num - 1;
241   - jsDoQuery(null, false);
  242 + var cells = $('tr.filter')[0].cells
  243 + ,params = {}
  244 + ,name;
  245 + $.each(cells, function(i, cell){
  246 + var items = $('input,select', cell);
  247 + for(var j = 0, item; item = items[j++];){
  248 + name = $(item).attr('name');
  249 + if(name){
  250 + params[name] = $(item).val();
  251 + }
  252 + }
  253 + });
  254 + jsDoQuery(params, false);
242 255 }
243 256 });
244 257 }
... ...
src/main/resources/static/pages/forms/mould/allline.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
... ... @@ -133,7 +133,7 @@
133 133  
134 134 $("#query").on("click",function(){
135 135 var line = $("#line").val();
136   - var xlName = $("#line").text();
  136 + var xlName = $("#select2-line-container").html();
137 137 var date = $("#date").val();
138 138 var code = $("#code").val();
139 139 $(".hidden").removeClass("hidden");
... ...
src/main/resources/static/pages/forms/statement/correctForm.html
... ... @@ -49,7 +49,7 @@
49 49 </div>
50 50 <div class="form-group">
51 51 <input class="btn btn-default" type="button" id="query" value="筛选"/>
52   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  52 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
53 53 </div>
54 54 </form>
55 55 </div>
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -26,7 +26,15 @@
26 26 <div class="col-md-12">
27 27 <div class="portlet light porttlet-fit bordered">
28 28 <div class="portlet-title">
29   - <form class="form-inline" action="">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdmDaily" style="width: 140px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 140px;"></select>
  37 + </div>
30 38 <div style="display: inline-block;">
31 39 <span class="item-label" style="width: 80px;">线路: </span>
32 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
... ... @@ -64,15 +72,15 @@
64 72 <td>班次</td>
65 73 </tr>
66 74 </thead>
67   - <tbody class="dailyInfo">
  75 + <tbody id="tbody">
68 76  
69 77 </tbody>
70 78 <tr>
71 79 <td colspan="3">小计</td>
72 80 <td><span id="total_zgl">&nbsp;</span></td>
73   - <td><span id="total_ksgl">&nbsp;</span></td>
  81 + <td><span id="total_ks">&nbsp;</span></td>
74 82 <td><span id="total_yh">&nbsp;</span></td>
75   - <td><span id="total_bcs">&nbsp;</span></td>
  83 + <td><span id="total_bc">&nbsp;</span></td>
76 84 </tr>
77 85 </table>
78 86 </div>
... ... @@ -82,7 +90,9 @@
82 90 </div>
83 91  
84 92 <script>
85   - $(function(){
  93 + $(function(){
  94 + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
  95 +
86 96 // 关闭左侧栏
87 97 if (!$('body').hasClass('page-sidebar-closed'))
88 98 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -92,6 +102,42 @@
92 102 locale : 'zh-cn'
93 103 });
94 104  
  105 + var obj = [];
  106 + $.get('/user/companyData', function(result){
  107 + obj = result;
  108 + var options = '';
  109 + for(var i = 0; i < obj.length; i++){
  110 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  111 + }
  112 +
  113 + if(obj.length ==0){
  114 + $("#gsdmDiv_daily").css('display','none');
  115 + $('#gsdmDiv_daily').css('display','none');
  116 + }else if(obj.length ==1){
  117 + $("#fgsdmDiv_daily").css('display','none');
  118 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  119 + $('#fgsdmDiv_daily').css('display','none');
  120 + }
  121 + $('#gsdmDaily').html(options);
  122 + updateCompany();
  123 + });
  124 +
  125 + $("#gsdmDaily").on("change",updateCompany);
  126 + function updateCompany(){
  127 + var company = $('#gsdmDaily').val();
  128 + var options = '';
  129 + for(var i = 0; i < obj.length; i++){
  130 + if(obj[i].companyCode == company){
  131 + var children = obj[i].children;
  132 + for(var j = 0; j < children.length; j++){
  133 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  134 + }
  135 + }
  136 + }
  137 + $('#fgsdmDaily').html(options);
  138 + }
  139 +
  140 +
95 141 $.get('/basic/lineCode2Name',function(result){
96 142 var data=[];
97 143  
... ... @@ -101,50 +147,82 @@
101 147 initPinYinSelect2('#line',data,'');
102 148  
103 149 })
104   - var line;
105   - var date;
106   - $("#query").on("click",function(){
107   - line = $("#line").val();
108   - var lineName=$("#select2-line-container").html();
109   - date = $("#date").val();
110   - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){
111   - $("#form_line").text(lineName);
112   - $("#form_date").text(date);
113   - var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0;
114   - $.each(result, function(i, obj) {
115   - total_zgl = Number(obj.zgl)+Number(total_zgl);
116   - total_ksgl = Number(obj.ksgl)+Number(total_ksgl);
117   - total_yh = Number(0)+Number(total_yh);
118   - total_bcs = Number(obj.bcs)+Number(total_bcs);
119   - });
120   - $("#total_zgl").text(total_zgl.toFixed(2));
121   - $("#total_ksgl").text(total_ksgl.toFixed(2));
122   - $("#total_yh").text(total_yh.toFixed(2));
123   - $("#total_bcs").text(total_bcs);
124   -
125   - // 把数据填充到模版中
126   - var tbodyHtml = template('dailyInfo',{list:result});
127   - // 把渲染好的模版html文本追加到表格中
128   - $('#forms .dailyInfo').html(tbodyHtml);
129   - });
  150 +
  151 + var line;
  152 + var date;
  153 + var gsdmDaily;
  154 + var fgsdmDaily;
  155 + $("#query").on("click",function(){
  156 +
  157 + line = $("#line").val();
  158 + var lineName=$("#select2-line-container").html();
  159 + date = $("#date").val();
  160 + gsdmDaily=$("#gsdmDaily").val();
  161 + fgsdmDaily = $("#fgsdmDaily").val();
  162 +
  163 + $post('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){
  164 + $("#form_line").text(lineName);
  165 + $("#form_date").text(date);
  166 + // 把数据填充到模版中
  167 + var tbodyHtml = template('dailyInfo',{list:result});
  168 + // 把渲染好的模版html文本追加到表格中
  169 + $('#tbody').html(tbodyHtml);
  170 + line = $("#line").val();
  171 +
  172 + startDate = $("#startDate").val();
  173 + endDate = $("#endDate").val();
  174 + $("#sDate").text(startDate);
  175 + $("#eDate").text(endDate);
  176 +
  177 + var total_zgl = 0,total_ks = 0;
  178 + var total_yh = 0,total_bc = 0;
  179 +
  180 + $.each(result, function(i, obj) {
  181 + total_zgl +=Number(obj.zlc);
  182 + total_ks +=Number(obj.jzl1);
  183 + total_yh += Number(obj.yh);
  184 + total_bc += Number(obj.bc);
  185 +
  186 + });
  187 + $("#total_zgl").text(total_zgl.toFixed(2));
  188 + $("#total_ks").text(total_ks.toFixed(2));
  189 + $("#total_yh").text(total_yh.toFixed(2));
  190 + $("#total_bc").text(total_bc.toFixed(2));
  191 +
  192 + var temp = {};
  193 + var today_account = 0;
  194 +
  195 + temp["line"] = $("#line").text();
  196 + $.each(result, function(i, obj) {
  197 + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){
  198 + today_account++;
  199 + }
  200 + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");
  201 + });
  202 + })
  203 + });
  204 +
  205 + $("#export").on("click",function(){
  206 + line = $("#line").val();
  207 + date = $("#date").val();
  208 + gsdmDaily=$("#gsdmDaily").val();
  209 + fgsdmDaily = $("#fgsdmDaily").val();
  210 + $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export'},function(result){
  211 + window.open("/downloadFile/download?fileName=班次日报表"+moment(date).format("YYYYMMDD"));
130 212 });
131   - $("#export").on("click",function(){
132   - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'export'},function(result){
133   - window.open("/downloadFile/download?fileName=班次日报"+moment(date).format("YYYYMMDD"));
134   - });
135   - });
136   - });
  213 + });
  214 +});
137 215 </script>
138 216 <script type="text/html" id="dailyInfo">
139 217 {{each list as obj i}}
140 218 <tr>
141   - <td>{{obj.clZbh}}</td>
142   - <td>{{obj.jGh}}</td>
  219 + <td>{{obj.zbh}}</td>
  220 + <td>{{obj.jgh}}</td>
143 221 <td>{{obj.jName}}</td>
144   - <td>{{obj.zgl}}</td>
145   - <td>{{obj.ksgl}}</td>
146   - <td>0</td>
147   - <td>{{obj.bcs}}</td>
  222 + <td>{{obj.zlc}}</td>
  223 + <td>{{obj.jzl1}}</td>
  224 + <td>{{obj.yh}}</td>
  225 + <td>{{obj.bc}}</td>
148 226 </tr>
149 227 {{/each}}
150 228 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
... ... @@ -97,6 +97,7 @@
97 97  
98 98 <script>
99 99 $(function(){
  100 + $('#export').attr('disabled', "true");
100 101  
101 102 // 关闭左侧栏
102 103 if (!$('body').hasClass('page-sidebar-closed'))
... ... @@ -186,11 +187,22 @@
186 187 // 把渲染好的模版html文本追加到表格中
187 188 $('#forms tbody').html(tbodyHtml);
188 189  
  190 + if(result.length == 0)
  191 + $("#export").attr('disabled',"true");
  192 + else
  193 + $("#export").removeAttr("disabled");
189 194 });
190 195 }
191 196  
192 197 $("#export").on("click",function(){
193   - $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){
  198 + var params = {};
  199 + params['company'] = company;
  200 + params['subCompany'] = subCompany;
  201 + params['line'] = line;
  202 + params['line'] = line;
  203 + params['date'] = date;
  204 + params['type'] = "export";
  205 + $get('/pcpc/firstAndLastBus', params, function(result){
194 206 window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
195 207 });
196 208 });
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
... ... @@ -41,7 +41,7 @@
41 41 </div>
42 42 <div class="form-group">
43 43 <input class="btn btn-default" type="button" id="query" value="筛选"/>
44   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  44 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
45 45 </div>
46 46 </form>
47 47 </div>
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
... ... @@ -80,6 +80,7 @@
80 80  
81 81 <script>
82 82 $(function(){
  83 + $('#export').attr('disabled', "true");
83 84  
84 85 // 关闭左侧栏
85 86 if (!$('body').hasClass('page-sidebar-closed'))
... ... @@ -168,11 +169,21 @@
168 169 // 把渲染好的模版html文本追加到表格中
169 170 $('#forms tbody').html(tbodyHtml);
170 171  
  172 + if(result.length == 0)
  173 + $("#export").attr('disabled',"true");
  174 + else
  175 + $("#export").removeAttr("disabled");
171 176 });
172 177 }
173 178  
174 179 $("#export").on("click",function(){
175   - $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){
  180 + var params = {};
  181 + params['company'] = company;
  182 + params['subCompany'] = subCompany;
  183 + params['line'] = line;
  184 + params['date'] = date;
  185 + params['type'] = "export";
  186 + $get('/pcpc/queryPeopleCar', params, function(result){
176 187 window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD"));
177 188 });
178 189 });
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -65,18 +65,21 @@
65 65 <table class="table table-bordered table-hover table-checkable" id="forms">
66 66 <thead>
67 67 <tr class="hidden">
68   - <th width="10%">线路</th>
69   - <th width="10%">起点站名</th>
70   - <th width="8%">计发时间</th>
71   - <th width="8%">计划运送时间(分)</th>
72   - <th width="8%">计划完成次数</th>
73   - <th width="8%">完成次数</th>
74   - <th width="8%">最早发车时间</th>
75   - <th width="8%">最晚发车时间</th>
76   - <th width="8%">平均发车时间</th>
77   - <th width="8%">最慢运送时间(分)</th>
78   - <th width="8%">最快运送时间(分)</th>
79   - <th width="8%">平均运送时间(分)</th>
  68 + <th style="display: none;"></th>
  69 + <th width="8%">公司</th>
  70 + <th width="8%">分公司</th>
  71 + <th width="8%">线路</th>
  72 + <th width="8%">起点站名</th>
  73 + <th width="6%">计发时间</th>
  74 + <th width="6%">计划运送时间(分)</th>
  75 + <th width="6%">计划完成次数</th>
  76 + <th width="6%">完成次数</th>
  77 + <th width="6%">最早发车时间</th>
  78 + <th width="6%">最晚发车时间</th>
  79 + <th width="6%">平均发车时间</th>
  80 + <th width="6%">最慢运送时间(分)</th>
  81 + <th width="6%">最快运送时间(分)</th>
  82 + <th width="6%">平均运送时间(分)</th>
80 83 </tr>
81 84 </thead>
82 85 <tbody>
... ... @@ -95,6 +98,7 @@
95 98 <script>
96 99 $(function(){
97 100 var page = 0, initPagination;
  101 + $('#export').attr('disabled', "true");
98 102  
99 103 // 关闭左侧栏
100 104 if (!$('body').hasClass('page-sidebar-closed'))
... ... @@ -200,6 +204,11 @@
200 204 // 把渲染好的模版html文本追加到表格中
201 205 $('#forms tbody').html(tbodyHtml);
202 206  
  207 + if(result.dataList.length == 0)
  208 + $("#export").attr('disabled',"true");
  209 + else
  210 + $("#export").removeAttr("disabled");
  211 +
203 212 if(pagination && result.dataList.length > 0){
204 213 //重新分页
205 214 initPagination = true;
... ... @@ -213,7 +222,16 @@
213 222 }
214 223  
215 224 $("#export").on("click",function(){
216   - $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){
  225 + var params = {};
  226 + params['page'] = page;
  227 + params['line'] = line;
  228 + params['startDate'] = startDate;
  229 + params['endDate'] = endDate;
  230 + params['model'] = model;
  231 + params['company'] = company;
  232 + params['subCompany'] = subCompany;
  233 + params['type'] = "export";
  234 + $get('/pcpc/scheduleAnaly', params, function(result){
217 235 window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
218 236 });
219 237 });
... ... @@ -289,6 +307,9 @@
289 307 <script type="text/html" id="list_scheduleAnaly">
290 308 {{each list as obj i}}
291 309 <tr>
  310 + <th style="display: none;"></th>
  311 + <td>{{obj.company}}</td>
  312 + <td>{{obj.subCompany}}</td>
292 313 <td>{{obj.line}}</td>
293 314 <td>{{obj.qdz}}</td>
294 315 <td>{{obj.jhfc}}</td>
... ... @@ -305,7 +326,7 @@
305 326 {{/each}}
306 327 {{if list.length == 0}}
307 328 <tr>
308   - <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td>
  329 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
309 330 </tr>
310 331 {{/if}}
311 332 </script>
312 333 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -37,7 +37,7 @@
37 37 </div>
38 38 <div class="form-group">
39 39 <input class="btn btn-default" type="button" id="query" value="查询"/>
40   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  40 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
41 41 </div>
42 42 </form>
43 43 </div>
... ...
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
... ... @@ -61,20 +61,20 @@
61 61 <th colspan="3" style="text-align:center;vertical-align:middle;">驾驶员</th>
62 62 <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
63 63 <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
64   - <th rowspan="3" style="text-align:center;vertical-align:middle;">记录项目</th>
65   - <th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
66   - <th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
67   - <th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
68   - <th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
69   - <th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
70   - <th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
71   - <th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
72   - <th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
73   - <th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
74   - <th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
75   - <th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
76   - <th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
77   - <th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
  64 + <th rowspan="4" style="text-align:center;vertical-align:middle;">记录项目</th>
  65 + <th colspan="4" style="text-align:center;vertical-align:middle;">1</th>
  66 + <th colspan="4" style="text-align:center;vertical-align:middle;">2</th>
  67 + <th colspan="4" style="text-align:center;vertical-align:middle;">3</th>
  68 + <th colspan="4" style="text-align:center;vertical-align:middle;">4</th>
  69 + <th colspan="4" style="text-align:center;vertical-align:middle;">5</th>
  70 + <th colspan="4" style="text-align:center;vertical-align:middle;">6</th>
  71 + <th colspan="4" style="text-align:center;vertical-align:middle;">7</th>
  72 + <th colspan="4" style="text-align:center;vertical-align:middle;">8</th>
  73 + <th colspan="4" style="text-align:center;vertical-align:middle;">9</th>
  74 + <th colspan="4" style="text-align:center;vertical-align:middle;">10</th>
  75 + <th colspan="4" style="text-align:center;vertical-align:middle;">11</th>
  76 + <th colspan="4" style="text-align:center;vertical-align:middle;">12</th>
  77 + <th colspan="4" style="text-align:center;vertical-align:middle;">13</th>
78 78  
79 79 </tr>
80 80 <tr>
... ... @@ -86,42 +86,55 @@
86 86 <th rowspan="2">到达</th>
87 87 <th rowspan="2">早/迟</th>
88 88 <th rowspan="2">开出</th>
  89 + <th rowspan="2">备注</th>
89 90 <th rowspan="2">到达</th>
90 91 <th rowspan="2">早/迟</th>
91 92 <th rowspan="2">开出</th>
  93 + <th rowspan="2">备注</th>
92 94 <th rowspan="2">到达</th>
93 95 <th rowspan="2">早/迟</th>
94 96 <th rowspan="2">开出</th>
  97 + <th rowspan="2">备注</th>
95 98 <th rowspan="2">到达</th>
96 99 <th rowspan="2">早/迟</th>
97 100 <th rowspan="2">开出</th>
  101 + <th rowspan="2">备注</th>
98 102 <th rowspan="2">到达</th>
99 103 <th rowspan="2">早/迟</th>
100 104 <th rowspan="2">开出</th>
  105 + <th rowspan="2">备注</th>
101 106 <th rowspan="2">到达</th>
102 107 <th rowspan="2">早/迟</th>
103 108 <th rowspan="2">开出</th>
  109 + <th rowspan="2">备注</th>
104 110 <th rowspan="2">到达</th>
105 111 <th rowspan="2">早/迟</th>
106 112 <th rowspan="2">开出</th>
  113 + <th rowspan="2">备注</th>
107 114 <th rowspan="2">到达</th>
108 115 <th rowspan="2">早/迟</th>
109 116 <th rowspan="2">开出</th>
  117 + <th rowspan="2">备注</th>
110 118 <th rowspan="2">到达</th>
111 119 <th rowspan="2">早/迟</th>
112 120 <th rowspan="2">开出</th>
  121 + <th rowspan="2">备注</th>
113 122 <th rowspan="2">到达</th>
114 123 <th rowspan="2">早/迟</th>
115 124 <th rowspan="2">开出</th>
  125 + <th rowspan="2">备注</th>
116 126 <th rowspan="2">到达</th>
117 127 <th rowspan="2">早/迟</th>
118 128 <th rowspan="2">开出</th>
  129 + <th rowspan="2">备注</th>
119 130 <th rowspan="2">到达</th>
120 131 <th rowspan="2">早/迟</th>
121 132 <th rowspan="2">开出</th>
  133 + <th rowspan="2">备注</th>
122 134 <th rowspan="2">到达</th>
123 135 <th rowspan="2">早/迟</th>
124 136 <th rowspan="2">开出</th>
  137 + <th rowspan="2">备注</th>
125 138 </tr>
126 139 <tr>
127 140 <th>出场</th>
... ... @@ -134,17 +147,80 @@
134 147 </thead>
135 148 <tbody>
136 149 <tr >
137   - <td></td>
  150 + <td>1</td>
138 151 <td>
  152 + YT-CD001
139 153 </td>
140   - <td></td>
141   - <td></td>
142   - <td></td>
143   - <td colspan="46">
144   - <div>
145   -
146   - </div>
  154 + <td>
  155 +
  156 + </td>
  157 + <td>
  158 + 1
  159 + </td>
  160 + <td>
  161 + 00001
  162 + </td>
  163 + <td >
  164 + 04:30
147 165 </td>
  166 + <td></td>
  167 + <td></td>
  168 + <td></td>
  169 + <td></td>
  170 + <td>1</td>
  171 + <td></td>
  172 + <td>06:50</td>
  173 + <td>1</td>
  174 + <td>06:00</td>
  175 + <td></td>
  176 + <td>08:02</td>
  177 + <td>-2</td>
  178 + <td>07:10</td>
  179 + <td></td>
  180 + <td></td>
  181 + <td></td>
  182 + <td></td>
  183 + <td></td>
  184 + <td></td>
  185 + <td></td>
  186 + <td></td>
  187 + <td></td>
  188 + <td></td>
  189 + <td></td>
  190 + <td></td>
  191 + <td></td>
  192 + <td></td>
  193 + <td></td>
  194 + <td></td>
  195 + <td></td>
  196 + <td></td>
  197 + <td></td>
  198 + <td></td>
  199 + <td></td>
  200 + <td></td>
  201 + <td></td>
  202 + <td></td>
  203 + <td></td>
  204 + <td></td>
  205 + <td></td>
  206 + <td></td>
  207 + <td></td>
  208 + <td></td>
  209 + <td></td>
  210 + <td></td>
  211 + <td></td>
  212 + <td></td>
  213 + <td></td>
  214 + <td></td>
  215 + <td></td>
  216 + <td></td>
  217 + <td></td>
  218 + <td></td>
  219 + <td></td>
  220 + <td></td>
  221 + <td></td>
  222 + <td></td>
  223 + <td></td>
148 224 </tr>
149 225  
150 226 </tbody>
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily .html
... ... @@ -37,7 +37,7 @@
37 37 </div>
38 38 <div class="form-group">
39 39 <input class="btn btn-default" type="button" id="query" value="查询"/>
40   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  40 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
41 41 </div>
42 42 </form>
43 43 </div>
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -39,7 +39,7 @@
39 39 <input class="btn btn-default" type="button" id="query" value="查询"/>
40 40 <input class="btn btn-default" type="button" id="export" value="导出"/>
41 41 <input class="btn btn-default" type="button" id="print" value="打印"/>
42   - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
  42 +<!-- <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> -->
43 43 </div>
44 44 </form>
45 45 </div>
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -55,11 +55,13 @@
55 55 <thead>
56 56 <tr class="hidden">
57 57 <th width="80px">日期</th>
58   - <th width="100px">线路</th>
  58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
59 61 <th>计划班次</th>
60 62 <th>待发调整</th>
61   - <th>待发调整比率</th>
62   - <th>出场率</th>
  63 + <th width="60px">待发调整比率</th>
  64 + <th width="60px">出场率</th>
63 65 <th width="46px">上行发快</th>
64 66 <th width="46px">上行到快</th>
65 67 <th width="46px">下行发快</th>
... ... @@ -68,9 +70,9 @@
68 70 <th width="46px">上行到慢</th>
69 71 <th width="46px">下行发慢</th>
70 72 <th width="46px">下行到慢</th>
71   - <th>误点总数(快/慢)</th>
72   - <th>首末班准点率</th>
73   - <th>高峰班次执行率(早/晚)</th>
  73 + <th width="75px">误点总数(快/慢)</th>
  74 + <th width="100px">首末班准点率</th>
  75 + <th width="100px">高峰班次执行率(早/晚)</th>
74 76 </tr>
75 77 </thead>
76 78 <tbody>
... ... @@ -88,6 +90,7 @@
88 90  
89 91 <script>
90 92 $(function(){
  93 + $('#export').attr('disabled', "true");
91 94  
92 95 // 关闭左侧栏
93 96 if (!$('body').hasClass('page-sidebar-closed'))
... ... @@ -176,11 +179,21 @@
176 179 // 把渲染好的模版html文本追加到表格中
177 180 $('#forms tbody').html(tbodyHtml);
178 181  
  182 + if(result.length == 0)
  183 + $("#export").attr('disabled',"true");
  184 + else
  185 + $("#export").removeAttr("disabled");
179 186 });
180 187 }
181 188  
182 189 $("#export").on("click",function(){
183   - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  190 + var params = {};
  191 + params['line'] = line;
  192 + params['date'] = date;
  193 + params['type'] = "export";
  194 + params['company'] = company;
  195 + params['subCompany'] = subCompany;
  196 + $get('/pcpc/workDaily', params, function(result){
184 197 window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
185 198 });
186 199 });
... ... @@ -193,6 +206,8 @@
193 206 {{each list as obj i}}
194 207 <tr>
195 208 <td>{{obj.date}}</td>
  209 + <td>{{obj.company}}</td>
  210 + <td>{{obj.subCompany}}</td>
196 211 <td>{{obj.line}}</td>
197 212 <td>{{obj.jhbc}}</td>
198 213 <td>{{obj.dftz}}</td>
... ... @@ -213,7 +228,7 @@
213 228 {{/each}}
214 229 {{if list.length == 0}}
215 230 <tr>
216   - <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
  231 + <td colspan="19"><h6 class="muted">没有找到相关数据</h6></td>
217 232 </tr>
218 233 {{/if}}
219 234 </script>
220 235 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/allline.html renamed to src/main/resources/static/pages/mforms/alllines/allline.html
... ... @@ -230,8 +230,7 @@
230 230 var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0;
231 231 var total_gs = 0;
232 232 var total_zhgs = 0;
233   - $
234   - .each(
  233 + $.each(
235 234 result,
236 235 function(i, obj) {
237 236 total_gs += Number(obj.gsgs);
... ...
src/main/resources/static/pages/forms/statement/changetochange.html renamed to src/main/resources/static/pages/mforms/changetochanges/changetochange.html
src/main/resources/static/pages/forms/statement/executionrate.html renamed to src/main/resources/static/pages/mforms/executionrates/executionrate.html
src/main/resources/static/pages/forms/statement/linepassengerflow.html renamed to src/main/resources/static/pages/mforms/linepassengerflows/linepassengerflow.html
src/main/resources/static/pages/forms/statement/operationservice.html renamed to src/main/resources/static/pages/mforms/operationservices/operationservice.html
src/main/resources/static/pages/forms/statement/shifday.html renamed to src/main/resources/static/pages/mforms/shifdays/shifday.html
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html renamed to src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
src/main/resources/static/pages/forms/statement/singledata.html renamed to src/main/resources/static/pages/mforms/singledatas/singledata.html
src/main/resources/static/pages/forms/statement/turnoutrate.html renamed to src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
src/main/resources/static/pages/forms/statement/vehicleloading.html renamed to src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
src/main/resources/static/pages/forms/statement/waybillday.html renamed to src/main/resources/static/pages/mforms/waybilldays/waybillday.html
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -294,17 +294,18 @@
294 294 var id=params[0].split("\\")[0];
295 295 var fcsj = $('.in_carpark_fcsj[data-id='+id+']', '#forms').html();
296 296 var ddsj= $('.in_carpark_zdsj[data-id='+id+']', '#forms').html();
297   -
298   - $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
299   - var xlmc="线路: "+$("#select2-line-container").html();
300   - var clmc="车辆: "+nbbm;
301   - var rqmc="日期: "+rq;
302   - var bcmc="班次: "+fcsj+"-"+ddsj;
303   - $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
304   - var ludan_ll_1 = template('ludan_ll_1',{list:result});
305   - // 把渲染好的模版html文本追加到表格中
306   - $('#forms1 .ludan_ll_1').html(ludan_ll_1);
307   - });
  297 + if(!(typeof(fcsj)=='undefined'|| typeof(ddsj)=='undefined')){
  298 + $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
  299 + var xlmc="线路: "+$("#select2-line-container").html();
  300 + var clmc="车辆: "+nbbm;
  301 + var rqmc="日期: "+rq;
  302 + var bcmc="班次: "+fcsj+"-"+ddsj;
  303 + $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
  304 + var ludan_ll_1 = template('ludan_ll_1',{list:result});
  305 + // 把渲染好的模版html文本追加到表格中
  306 + $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  307 + });
  308 + }
308 309 })
309 310  
310 311 $("#query2").click(function(){
... ...
src/main/resources/static/pages/report/message/message.html
... ... @@ -18,7 +18,7 @@
18 18  
19 19 <div class="page-head">
20 20 <div class="page-title">
21   - <h1>行车路单</h1>
  21 + <h1>调度消息分析</h1>
22 22 </div>
23 23 </div>
24 24  
... ... @@ -41,9 +41,9 @@
41 41 </div>
42 42 <div class="form-group" style="display: inline-block;margin-left: 15px;">
43 43 <input class="btn btn-default" type="button" id="query" value="查询"/>
44   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  44 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
45 45 <input class="btn btn-default" type="button" id="print" value="打印"/>
46   - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
  46 +<!-- <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> -->
47 47 </div>
48 48 </form>
49 49 </div>
... ... @@ -235,12 +235,12 @@
235 235 {{each list as obj i}}
236 236 <tr>
237 237 <td>{{i+1}}</td>
  238 + <td>{{obj[4]}}</td>
  239 + <td>{{obj[6]}}</td>
238 240 <td>{{obj[0]}}</td>
239 241 <td>{{obj[1]}}</td>
240   - <td>{{obj[2]}}</td>
241 242 <td>{{obj[3]}}</td>
242   - <td>{{obj[4]}}</td>
243   - <td>{{obj[5]}}</td>
  243 + <td>{{obj[2]}}</td>
244 244 </tr>
245 245 {{/each}}
246 246 {{if list.length == 0}}
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -141,21 +141,21 @@
141 141 <div class="portlet-body">
142 142 <div class="row">
143 143 <div class="col-md-6" >
144   - <table class="table table-bordered table-checkable">
  144 + <table class="table table-bordered table-checkable" id="formsTime4">
145 145 <tr>
146 146 <td colspan="6">调度形式</td>
147 147 </tr>
148 148 <tr>
149   - <td colspan="3" align="center">上行向()站</td>
150   - <td colspan="3" align="center">下行向()站</td>
  149 + <td colspan="3" align="center">上行向(<span id="skb_sxzd"></span>)站</td>
  150 + <td colspan="3" align="center">下行向(<span id="skb_xxzd"></span>)站</td>
151 151 </tr>
152 152 <tr>
153   - <td>起讫站</td>
154   - <td>起讫时间</td>
155   - <td>班次</td>
156   - <td>起讫站</td>
157   - <td>起讫时间</td>
158   - <td>班次</td>
  153 + <td width="22%">起讫站</td>
  154 + <td width="20%">起讫时间</td>
  155 + <td width="8%">班次</td>
  156 + <td width="22%">起讫站</td>
  157 + <td width="20%">起讫时间</td>
  158 + <td width="8%">班次</td>
159 159 </tr>
160 160 <tbody class="tbody_time_4">
161 161  
... ... @@ -283,26 +283,25 @@
283 283 $.get('/report/tbodyTime2',{line:line,ttinfo:ttinfo},function(result){
284 284 var tbodyTime2 = template('tbodyTime2',{map:result});
285 285 $('#formsTime2 .tbody_time_2').html(tbodyTime2);
286   - });/*
  286 + });
287 287 $.get('/report/tbodyTime3',{line:line,ttinfo:ttinfo},function(result){
288   -
289 288 var tbodyTime3 = template('tbodyTime3',{list:result});
290 289 $('#formsTime3 .tbody_time_3').html(tbodyTime3);
291 290 var divTime3 = window.document.getElementById('formsTime3');
292 291 var divTime2 = window.document.getElementById('formsTime2');
293   - console.log(divTime3.offsetHeight);
294 292 divTime2.style.height=divTime3.offsetHeight+"px";
295   - }); */
  293 + });
296 294  
297   - /*
298   - $.get('/report/tbodyTime4',{line:line,date:date},function(result){
299   - var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
300   - $('#forms .scheduleDaily_3').html(scheduleDaily_3);
301   - });*/
302   - /* $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){
  295 + $.get('/report/tbodyTime4',{line:line,ttinfo:ttinfo},function(result){
  296 + $("#skb_sxzd").html(result[0].sxzm);
  297 + $("#skb_xxzd").html(result[0].xxzm);
  298 + var tbodyTime4 = template('tbodyTime4',{list:result});
  299 + $('#formsTime4 .tbody_time_4').html(tbodyTime4);
  300 + });
  301 + $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){
303 302 var tbodyTime5 = template('tbodyTime5',{list:result});
304 303 $('#formsTime5 .tbody_time_5').html(tbodyTime5);
305   - }); */
  304 + });
306 305 }
307 306  
308 307  
... ... @@ -352,6 +351,27 @@
352 351 </script>
353 352  
354 353  
  354 +
  355 +
  356 +<script type="text/html" id="tbodyTime4">
  357 +{{each list as result i}}
  358 +
  359 + <tr>
  360 + <td align="center">{{result.sxzm}}</td>
  361 + <td align="center">{{result.sxsj}}</td>
  362 + <td align="center">{{result.sxbc}}</td>
  363 + <td align="center">{{result.xxzm}}</td>
  364 + <td align="center">{{result.xxsj}}</td>
  365 + <td align="center">{{result.xxbc}}</td>
  366 + </tr>
  367 +{{/each}}
  368 +{{if list.length == 0}}
  369 + <tr>
  370 + <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td>
  371 + </tr>
  372 + {{/if}}
  373 +</script>
  374 +
355 375 <script type="text/html" id="tbodyTime5">
356 376 {{each list as result i}}
357 377 <tr>
... ...