Commit 0f02d937d64bfbfc40a58b6576cc46b73d4dd6e7

Authored by 潘钊
2 parents 8bbb7773 c9a55ce4

Merge branch 'minhang' into pudong

Showing 55 changed files with 1483 additions and 376 deletions
src/main/java/com/bsth/Application.java
@@ -17,7 +17,7 @@ import java.util.concurrent.ScheduledExecutorService; @@ -17,7 +17,7 @@ import java.util.concurrent.ScheduledExecutorService;
17 @SpringBootApplication 17 @SpringBootApplication
18 public class Application extends SpringBootServletInitializer { 18 public class Application extends SpringBootServletInitializer {
19 19
20 - public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(15); 20 + public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(16);
21 21
22 @Override 22 @Override
23 protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { 23 protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
src/main/java/com/bsth/XDApplication.java
@@ -4,10 +4,14 @@ import com.bsth.data.BasicData; @@ -4,10 +4,14 @@ import com.bsth.data.BasicData;
4 import com.bsth.data.ThreadMonotor; 4 import com.bsth.data.ThreadMonotor;
5 import com.bsth.data.car_out_info.UpdateDBThread; 5 import com.bsth.data.car_out_info.UpdateDBThread;
6 import com.bsth.data.directive.DirectivesPstThread; 6 import com.bsth.data.directive.DirectivesPstThread;
  7 +import com.bsth.data.forecast.SampleTimeDataLoader;
7 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; 8 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
8 import com.bsth.data.gpsdata.thread.OfflineMonitorThread; 9 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
  10 +import com.bsth.data.msg_queue.DirectivePushQueue;
  11 +import com.bsth.data.msg_queue.WebSocketPushQueue;
9 import com.bsth.data.schedule.edit_logs.SeiPstThread; 12 import com.bsth.data.schedule.edit_logs.SeiPstThread;
10 import com.bsth.data.schedule.late_adjust.ScheduleLateThread; 13 import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
  14 +import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
11 import com.bsth.data.schedule.thread.CalcOilThread; 15 import com.bsth.data.schedule.thread.CalcOilThread;
12 import com.bsth.data.schedule.thread.SchedulePstThread; 16 import com.bsth.data.schedule.thread.SchedulePstThread;
13 import com.bsth.data.schedule.thread.ScheduleRefreshThread; 17 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
@@ -56,6 +60,9 @@ public class XDApplication implements CommandLineRunner { @@ -56,6 +60,9 @@ public class XDApplication implements CommandLineRunner {
56 ThreadMonotor threadMonotor; 60 ThreadMonotor threadMonotor;
57 @Autowired 61 @Autowired
58 SeiPstThread seiPstThread; 62 SeiPstThread seiPstThread;
  63 + @Autowired
  64 + SampleTimeDataLoader sampleTimeDataLoader;
  65 + SchSiginUpdateDBThread schSiginUpdateDBThread;
59 66
60 private static long timeDiff; 67 private static long timeDiff;
61 private static long timeDiffTraffic; 68 private static long timeDiffTraffic;
@@ -116,30 +123,31 @@ public class XDApplication implements CommandLineRunner { @@ -116,30 +123,31 @@ public class XDApplication implements CommandLineRunner {
116 public void prodInit(){ 123 public void prodInit(){
117 log.info("prodInit..."); 124 log.info("prodInit...");
118 ScheduledExecutorService sexec = Application.mainServices; 125 ScheduledExecutorService sexec = Application.mainServices;
119 - //发车信息  
120 - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);  
121 - //抓取GPS数据  
122 - sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);  
123 - //GPS设备掉离线  
124 - sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);  
125 - //班次更新线程  
126 - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);  
127 - //班次延迟入库线程  
128 - sexec.scheduleWithFixedDelay(schedulePstThread, 60, 10, TimeUnit.SECONDS);  
129 - //班次修正日志入库  
130 - sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);  
131 - //检查班次误点  
132 - sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);  
133 - //调度指令延迟入库  
134 - sexec.scheduleWithFixedDelay(directivesPstThread, 180, 100, TimeUnit.SECONDS); 126 +
  127 + /** 线调业务 */
  128 + sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);//抓取GPS数据
  129 + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  130 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);//班次更新线程
  131 + sexec.scheduleWithFixedDelay(schedulePstThread, 60, 10, TimeUnit.SECONDS);//班次延迟入库线程
  132 + sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);//班次修正日志入库
  133 + sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);//检查班次误点
  134 + sexec.scheduleWithFixedDelay(directivesPstThread, 180, 100, TimeUnit.SECONDS);//调度指令延迟入库
  135 + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  136 + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 12, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
  137 + sexec.scheduleWithFixedDelay(basicDataLoader, 2, 2, TimeUnit.HOURS);//基础数据更新
  138 + DirectivePushQueue.start();//消息队列 -指令,系统下发的
  139 + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  140 +
  141 + /** 线调为其他程序提供的数据 --写入数据库 */
  142 + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
  143 + //线路首末班数据(网关用,班次更新时写入)
  144 + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
  145 + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 60, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
135 146
136 //运管处静态数据提交 147 //运管处静态数据提交
137 log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); 148 log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
138 sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); 149 sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
139 //计算油、公里加注 150 //计算油、公里加注
140 sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); 151 sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
141 -  
142 - //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)  
143 - sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);  
144 } 152 }
145 } 153 }
src/main/java/com/bsth/controller/excep/NowOutboundController.java
1 package com.bsth.controller.excep; 1 package com.bsth.controller.excep;
2 2
  3 +import java.text.ParseException;
3 import java.util.HashMap; 4 import java.util.HashMap;
  5 +import java.util.List;
4 import java.util.Map; 6 import java.util.Map;
5 7
6 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -10,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam;
10 import org.springframework.web.bind.annotation.RestController; 12 import org.springframework.web.bind.annotation.RestController;
11 13
12 import com.bsth.controller.BaseController; 14 import com.bsth.controller.BaseController;
  15 +import com.bsth.data.BasicData;
13 import com.bsth.entity.excep.Outbound; 16 import com.bsth.entity.excep.Outbound;
  17 +import com.bsth.entity.excep.Speeding;
14 import com.bsth.entity.sys.SysUser; 18 import com.bsth.entity.sys.SysUser;
15 import com.bsth.service.excep.NowOutboundService; 19 import com.bsth.service.excep.NowOutboundService;
16 import com.bsth.util.PageObject; 20 import com.bsth.util.PageObject;
@@ -44,5 +48,11 @@ public class NowOutboundController extends BaseController<SysUser, Integer>{ @@ -44,5 +48,11 @@ public class NowOutboundController extends BaseController<SysUser, Integer>{
44 return modelMap; 48 return modelMap;
45 } 49 }
46 50
  51 + @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
  52 + public List<Outbound> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
  53 + String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
  54 + List<Outbound> listOutbound = nowOutboundService.findPosition(deviceid,startdate,enddate);
  55 + return listOutbound;
  56 + }
47 57
48 } 58 }
src/main/java/com/bsth/controller/oil/CwjyController.java
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam;
13 import org.springframework.web.bind.annotation.RestController; 13 import org.springframework.web.bind.annotation.RestController;
14 14
15 import com.bsth.controller.BaseController; 15 import com.bsth.controller.BaseController;
  16 +import com.bsth.data.BasicData;
  17 +import com.bsth.entity.Line;
16 import com.bsth.entity.oil.Cwjy; 18 import com.bsth.entity.oil.Cwjy;
17 import com.bsth.entity.oil.Ylxxb; 19 import com.bsth.entity.oil.Ylxxb;
18 import com.bsth.entity.sys.SysUser; 20 import com.bsth.entity.sys.SysUser;
@@ -30,12 +32,15 @@ public class CwjyController extends BaseController&lt;Cwjy, Integer&gt;{ @@ -30,12 +32,15 @@ public class CwjyController extends BaseController&lt;Cwjy, Integer&gt;{
30 SysUser sysUser = SecurityUtils.getCurrentUser(); 32 SysUser sysUser = SecurityUtils.getCurrentUser();
31 t.setCreateDate(new Date()); 33 t.setCreateDate(new Date());
32 t.setXgr(sysUser.getUserName()); 34 t.setXgr(sysUser.getUserName());
  35 + t.setNbbm(t.getNbbm().trim().toUpperCase());
  36 + Line line=BasicData.nbbm2LineMap.get(t.getNbbm());
  37 + t.setLine(line == null?"" : line.getLineCode());
33 return service.save(t); 38 return service.save(t);
34 } 39 }
35 40
36 @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) 41 @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET)
37 public int checkNbbm(Cwjy t){ 42 public int checkNbbm(Cwjy t){
38 - return service.checkNbbm(t.getNbbm().trim()); 43 + return service.checkNbbm(t);
39 } 44 }
40 45
41 @RequestMapping(value = "/queryList",method = RequestMethod.GET) 46 @RequestMapping(value = "/queryList",method = RequestMethod.GET)
src/main/java/com/bsth/data/BasicData.java
1 package com.bsth.data; 1 package com.bsth.data;
2 2
3 -import com.bsth.Application;  
4 import com.bsth.data.gpsdata.arrival.GeoCacheData; 3 import com.bsth.data.gpsdata.arrival.GeoCacheData;
5 import com.bsth.data.pinyin.PersionPinYinBuffer; 4 import com.bsth.data.pinyin.PersionPinYinBuffer;
6 import com.bsth.entity.*; 5 import com.bsth.entity.*;
@@ -13,12 +12,10 @@ import org.apache.commons.lang3.StringUtils; @@ -13,12 +12,10 @@ import org.apache.commons.lang3.StringUtils;
13 import org.slf4j.Logger; 12 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
15 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
16 -import org.springframework.boot.CommandLineRunner;  
17 import org.springframework.jdbc.core.JdbcTemplate; 15 import org.springframework.jdbc.core.JdbcTemplate;
18 import org.springframework.stereotype.Component; 16 import org.springframework.stereotype.Component;
19 17
20 import java.util.*; 18 import java.util.*;
21 -import java.util.concurrent.TimeUnit;  
22 19
23 /** 20 /**
24 * @author PanZhao 21 * @author PanZhao
@@ -27,7 +24,7 @@ import java.util.concurrent.TimeUnit; @@ -27,7 +24,7 @@ import java.util.concurrent.TimeUnit;
27 * @date 2016年8月10日 下午3:27:45 24 * @date 2016年8月10日 下午3:27:45
28 */ 25 */
29 @Component 26 @Component
30 -public class BasicData implements CommandLineRunner { 27 +public class BasicData {
31 28
32 //公司代码和公司名对照(K: 公司编码,V:公司名) 29 //公司代码和公司名对照(K: 公司编码,V:公司名)
33 public static Map<String, String> businessCodeNameMap; 30 public static Map<String, String> businessCodeNameMap;
@@ -80,14 +77,6 @@ public class BasicData implements CommandLineRunner { @@ -80,14 +77,6 @@ public class BasicData implements CommandLineRunner {
80 77
81 static Logger logger = LoggerFactory.getLogger(BasicData.class); 78 static Logger logger = LoggerFactory.getLogger(BasicData.class);
82 79
83 - @Autowired  
84 - BasicDataLoader dataLoader;  
85 -  
86 - @Override  
87 - public void run(String... arg0) throws Exception {  
88 - Application.mainServices.scheduleWithFixedDelay(dataLoader, 2, 2, TimeUnit.HOURS);  
89 - }  
90 -  
91 public static String getStationNameByCode(String code, String prefix){ 80 public static String getStationNameByCode(String code, String prefix){
92 String name = stationCode2NameMap.get(code); 81 String name = stationCode2NameMap.get(code);
93 return name != null? name: stationCode2NameMap.get(prefix + code); 82 return name != null? name: stationCode2NameMap.get(prefix + code);
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
1 package com.bsth.data.forecast; 1 package com.bsth.data.forecast;
2 2
3 -import com.bsth.Application;  
4 import com.bsth.data.forecast.entity.ForecastResult; 3 import com.bsth.data.forecast.entity.ForecastResult;
5 import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem; 4 import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem;
6 import com.bsth.data.forecast.entity.SimpleRoute; 5 import com.bsth.data.forecast.entity.SimpleRoute;
@@ -13,7 +12,6 @@ import com.google.common.collect.ArrayListMultimap; @@ -13,7 +12,6 @@ import com.google.common.collect.ArrayListMultimap;
13 import org.slf4j.Logger; 12 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
15 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
16 -import org.springframework.boot.CommandLineRunner;  
17 import org.springframework.stereotype.Component; 15 import org.springframework.stereotype.Component;
18 16
19 import java.text.DecimalFormat; 17 import java.text.DecimalFormat;
@@ -21,7 +19,6 @@ import java.util.ArrayList; @@ -21,7 +19,6 @@ import java.util.ArrayList;
21 import java.util.HashMap; 19 import java.util.HashMap;
22 import java.util.List; 20 import java.util.List;
23 import java.util.Map; 21 import java.util.Map;
24 -import java.util.concurrent.TimeUnit;  
25 22
26 /** 23 /**
27 * 24 *
@@ -32,10 +29,7 @@ import java.util.concurrent.TimeUnit; @@ -32,10 +29,7 @@ import java.util.concurrent.TimeUnit;
32 * 29 *
33 */ 30 */
34 @Component 31 @Component
35 -public class ForecastRealServer implements CommandLineRunner {  
36 -  
37 - @Autowired  
38 - SampleTimeDataLoader dataLoader; 32 +public class ForecastRealServer {
39 33
40 @Autowired 34 @Autowired
41 DayOfSchedule dayOfSchedule; 35 DayOfSchedule dayOfSchedule;
@@ -57,12 +51,6 @@ public class ForecastRealServer implements CommandLineRunner { @@ -57,12 +51,6 @@ public class ForecastRealServer implements CommandLineRunner {
57 forecastMap = new HashMap<>(); 51 forecastMap = new HashMap<>();
58 } 52 }
59 53
60 - @Override  
61 - public void run(String... arg0) throws Exception {  
62 - //2小时更新一次站点间耗时数据  
63 - Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS);  
64 - }  
65 -  
66 /** 54 /**
67 * 55 *
68 * @Title: forecast 56 * @Title: forecast
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
@@ -163,6 +163,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -163,6 +163,7 @@ public class InOutStationSignalHandle extends SignalHandle{
163 163
164 //实发时间 164 //实发时间
165 sch.setFcsjActualAll(rsT); 165 sch.setFcsjActualAll(rsT);
  166 + sch.setSiginCompate(1);
166 //通知客户端 167 //通知客户端
167 sendUtils.sendFcsj(sch); 168 sendUtils.sendFcsj(sch);
168 //持久化 169 //持久化
@@ -316,7 +317,7 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -316,7 +317,7 @@ public class InOutStationSignalHandle extends SignalHandle{
316 long rsT = lineConfigData.applyIn(sch, gps.getTimestamp()); 317 long rsT = lineConfigData.applyIn(sch, gps.getTimestamp());
317 318
318 sch.setZdsjActualAll(rsT); 319 sch.setZdsjActualAll(rsT);
319 - 320 + sch.setSiginCompate(2);
320 //通知误点停靠程序,有车辆到站 321 //通知误点停靠程序,有车辆到站
321 LateAdjustHandle.carArrive(gps); 322 LateAdjustHandle.carArrive(gps);
322 323
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
@@ -5,7 +5,6 @@ import com.bsth.service.directive.DirectiveService; @@ -5,7 +5,6 @@ import com.bsth.service.directive.DirectiveService;
5 import org.slf4j.Logger; 5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.BeansException; 7 import org.springframework.beans.BeansException;
8 -import org.springframework.boot.CommandLineRunner;  
9 import org.springframework.context.ApplicationContext; 8 import org.springframework.context.ApplicationContext;
10 import org.springframework.context.ApplicationContextAware; 9 import org.springframework.context.ApplicationContextAware;
11 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
@@ -17,7 +16,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; @@ -17,7 +16,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
17 * Created by panzhao on 2017/5/11. 16 * Created by panzhao on 2017/5/11.
18 */ 17 */
19 @Component 18 @Component
20 -public class DirectivePushQueue implements CommandLineRunner, ApplicationContextAware { 19 +public class DirectivePushQueue implements ApplicationContextAware {
21 20
22 static ConcurrentLinkedQueue<QueueData_Directive> linkedList; 21 static ConcurrentLinkedQueue<QueueData_Directive> linkedList;
23 static DataPushThread thread; 22 static DataPushThread thread;
@@ -80,10 +79,10 @@ public class DirectivePushQueue implements CommandLineRunner, ApplicationContext @@ -80,10 +79,10 @@ public class DirectivePushQueue implements CommandLineRunner, ApplicationContext
80 return linkedList.size(); 79 return linkedList.size();
81 } 80 }
82 81
83 - @Override 82 +/* @Override
84 public void run(String... strings) throws Exception { 83 public void run(String... strings) throws Exception {
85 start(); 84 start();
86 - } 85 + }*/
87 86
88 @Override 87 @Override
89 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { 88 public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java
@@ -3,7 +3,6 @@ package com.bsth.data.msg_queue; @@ -3,7 +3,6 @@ package com.bsth.data.msg_queue;
3 import com.bsth.common.Constants; 3 import com.bsth.common.Constants;
4 import org.slf4j.Logger; 4 import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory; 5 import org.slf4j.LoggerFactory;
6 -import org.springframework.boot.CommandLineRunner;  
7 import org.springframework.stereotype.Component; 6 import org.springframework.stereotype.Component;
8 import org.springframework.web.socket.TextMessage; 7 import org.springframework.web.socket.TextMessage;
9 import org.springframework.web.socket.WebSocketSession; 8 import org.springframework.web.socket.WebSocketSession;
@@ -15,7 +14,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; @@ -15,7 +14,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
15 * Created by panzhao on 2017/5/11. 14 * Created by panzhao on 2017/5/11.
16 */ 15 */
17 @Component 16 @Component
18 -public class WebSocketPushQueue implements CommandLineRunner { 17 +public class WebSocketPushQueue {
19 18
20 static ConcurrentLinkedQueue<QueueData> linkedList; 19 static ConcurrentLinkedQueue<QueueData> linkedList;
21 static DataPushThread thread; 20 static DataPushThread thread;
@@ -54,10 +53,6 @@ public class WebSocketPushQueue implements CommandLineRunner { @@ -54,10 +53,6 @@ public class WebSocketPushQueue implements CommandLineRunner {
54 return linkedList.size(); 53 return linkedList.size();
55 } 54 }
56 55
57 - @Override  
58 - public void run(String... strings) throws Exception {  
59 - start();  
60 - }  
61 56
62 public static class DataPushThread extends Thread { 57 public static class DataPushThread extends Thread {
63 58
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -729,7 +729,7 @@ public class DayOfSchedule { @@ -729,7 +729,7 @@ public class DayOfSchedule {
729 /** 729 /**
730 * @Title: prveNotExecNum 730 * @Title: prveNotExecNum
731 * @Description: TODO(班次之前未执行班次数量) 731 * @Description: TODO(班次之前未执行班次数量)
732 - */ 732 +
733 public int prveNotExecNum(ScheduleRealInfo sch) { 733 public int prveNotExecNum(ScheduleRealInfo sch) {
734 int n = 0; 734 int n = 0;
735 List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); 735 List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
@@ -741,29 +741,29 @@ public class DayOfSchedule { @@ -741,29 +741,29 @@ public class DayOfSchedule {
741 break; 741 break;
742 } 742 }
743 return n; 743 return n;
744 - } 744 + }*/
745 745
746 /** 746 /**
747 * @Title: validEndTime 747 * @Title: validEndTime
748 * @Description: TODO(是否是有效的到达时间) 748 * @Description: TODO(是否是有效的到达时间)
749 - */ 749 +
750 public boolean validEndTime(ScheduleRealInfo sch, Long ts) { 750 public boolean validEndTime(ScheduleRealInfo sch, Long ts) {
751 if (sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts) 751 if (sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts)
752 return false; 752 return false;
753 753
754 return validTime(sch, ts); 754 return validTime(sch, ts);
755 - } 755 + }*/
756 756
757 /** 757 /**
758 * @Title: validStartTime 758 * @Title: validStartTime
759 * @Description: TODO(是否是合适的发车时间) 759 * @Description: TODO(是否是合适的发车时间)
760 - */ 760 +
761 public boolean validStartTime(ScheduleRealInfo sch, Long ts) { 761 public boolean validStartTime(ScheduleRealInfo sch, Long ts) {
762 if (sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts) 762 if (sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts)
763 return false; 763 return false;
764 764
765 return validTime(sch, ts); 765 return validTime(sch, ts);
766 - } 766 + }*/
767 767
768 public boolean validTime(ScheduleRealInfo sch, Long ts) { 768 public boolean validTime(ScheduleRealInfo sch, Long ts) {
769 List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); 769 List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
@@ -875,9 +875,9 @@ public class DayOfSchedule { @@ -875,9 +875,9 @@ public class DayOfSchedule {
875 return outList; 875 return outList;
876 } 876 }
877 877
878 - public Set<String> allCar() { 878 +/* public Set<String> allCar() {
879 return nbbmScheduleMap.keySet(); 879 return nbbmScheduleMap.keySet();
880 - } 880 + }*/
881 881
882 public Collection<ScheduleRealInfo> findAll() { 882 public Collection<ScheduleRealInfo> findAll() {
883 return nbbmScheduleMap.values(); 883 return nbbmScheduleMap.values();
@@ -939,12 +939,12 @@ public class DayOfSchedule { @@ -939,12 +939,12 @@ public class DayOfSchedule {
939 return ups; 939 return ups;
940 } 940 }
941 941
942 - public void removeNbbm2SchMapp(ScheduleRealInfo sch, String nbbm) {  
943 - nbbmScheduleMap.remove(nbbm, sch); 942 + public void removeNbbm2SchMapp(ScheduleRealInfo sch) {
  943 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
944 } 944 }
945 945
946 - public void addNbbm2SchMapp(ScheduleRealInfo sch, String nbbm) {  
947 - nbbmScheduleMap.put(nbbm, sch); 946 + public void addNbbm2SchMapp(ScheduleRealInfo sch) {
  947 + nbbmScheduleMap.put(sch.getClZbh(), sch);
948 } 948 }
949 949
950 public void reCalcExecPlan(String nbbm) { 950 public void reCalcExecPlan(String nbbm) {
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
@@ -101,6 +101,7 @@ public class LateAdjustHandle implements ApplicationContextAware{ @@ -101,6 +101,7 @@ public class LateAdjustHandle implements ApplicationContextAware{
101 lateSchMap.remove(sch.getClZbh()); 101 lateSchMap.remove(sch.getClZbh());
102 sch.setLate2(false); 102 sch.setLate2(false);
103 sch.setLateMinute(0); 103 sch.setLateMinute(0);
  104 + sch.setDfAuto(false);
104 } 105 }
105 }catch (Exception e){ 106 }catch (Exception e){
106 logger.error("", e); 107 logger.error("", e);
src/main/java/com/bsth/data/schedule/signal/SchSiginUpdateDBThread.java 0 → 100644
  1 +package com.bsth.data.schedule.signal;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.stereotype.Component;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/8/14.
  9 + */
  10 +@Component
  11 +public class SchSiginUpdateDBThread extends Thread{
  12 +
  13 + SignalComplateHandler signalComplateHandler;
  14 +
  15 + Logger logger = LoggerFactory.getLogger(this.getClass());
  16 +
  17 + @Override
  18 + public void run() {
  19 + try{
  20 + signalComplateHandler.handler();
  21 + }catch (Exception e){
  22 + logger.error("", e);
  23 + }
  24 + }
  25 +}
src/main/java/com/bsth/data/schedule/signal/SignalComplateHandler.java 0 → 100644
  1 +package com.bsth.data.schedule.signal;
  2 +
  3 +import com.bsth.data.schedule.DayOfSchedule;
  4 +import com.bsth.data.schedule.signal.entity.SchSiginCompate;
  5 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  6 +import com.bsth.util.db.DBUtils_MS;
  7 +import org.apache.commons.lang3.StringUtils;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.jdbc.core.BatchPreparedStatementSetter;
  12 +import org.springframework.jdbc.core.JdbcTemplate;
  13 +import org.springframework.jdbc.datasource.DataSourceTransactionManager;
  14 +import org.springframework.stereotype.Component;
  15 +import org.springframework.transaction.TransactionDefinition;
  16 +import org.springframework.transaction.TransactionStatus;
  17 +import org.springframework.transaction.support.DefaultTransactionDefinition;
  18 +
  19 +import java.sql.PreparedStatement;
  20 +import java.sql.SQLException;
  21 +import java.util.ArrayList;
  22 +import java.util.Collection;
  23 +import java.util.Date;
  24 +import java.util.List;
  25 +
  26 +/**
  27 + * 班次信号补全(写入数据库,网关以补发的形式提交运管处)
  28 + * Created by panzhao on 2017/8/13.
  29 + */
  30 +@Component
  31 +public class SignalComplateHandler {
  32 +
  33 + @Autowired
  34 + DayOfSchedule dayOfSchedule;
  35 +
  36 + Logger log = LoggerFactory.getLogger(this.getClass());
  37 +
  38 + public void handler(){
  39 + Collection<ScheduleRealInfo> all = dayOfSchedule.findAll();
  40 + List<SchSiginCompate> list = new ArrayList<>();
  41 +
  42 + SchSiginCompate siginCompate;
  43 + Date d = new Date();
  44 + long et = System.currentTimeMillis() - (1000 * 60 * 60 * 2),
  45 + st = et - (1000 * 60 * 60 * 2);
  46 + for(ScheduleRealInfo sch : all){
  47 + if(sch.getDfsjT() > et || sch.getDfsjT() < st)
  48 + continue;
  49 +
  50 + //能自动完成的
  51 + if(sch.getSiginCompate() >= 2)
  52 + continue;
  53 +
  54 + //烂班
  55 + if(sch.isDestroy())
  56 + continue;
  57 +
  58 + //空驶任务
  59 + if(dayOfSchedule.emptyService(sch))
  60 + continue;
  61 +
  62 + siginCompate = new SchSiginCompate(sch);
  63 + if(siginCompate == null || StringUtils.isEmpty(siginCompate.getDeciveId()))
  64 + continue;
  65 +
  66 + //标记已经补发
  67 + sch.setSiginCompate(3);
  68 + //标记入库
  69 + dayOfSchedule.save(sch);
  70 + siginCompate.setCreateDate(d);
  71 + list.add(siginCompate);
  72 + }
  73 +
  74 + put(list);
  75 + }
  76 +
  77 + public void put(final List<SchSiginCompate> list){
  78 + if(null == list || list.size() == 0)
  79 + return;
  80 +
  81 + JdbcTemplate jdbcTemp = new JdbcTemplate(DBUtils_MS.getDataSource());
  82 + //编程式事务
  83 + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemp.getDataSource());
  84 + DefaultTransactionDefinition def = new DefaultTransactionDefinition();
  85 + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  86 + TransactionStatus status = tran.getTransaction(def);
  87 +
  88 + try{
  89 + jdbcTemp.batchUpdate("insert into bsth_t_sigin_complate(id, rq, line_code, decive_id, up_down, s_code, e_code, st, et, create_date, status) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
  90 + @Override
  91 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  92 + SchSiginCompate sc = list.get(i);
  93 + ps.setLong(1, sc.getId());
  94 + ps.setString(2, sc.getRq());
  95 + ps.setString(3, sc.getLineCode());
  96 + ps.setString(4, sc.getDeciveId());
  97 + ps.setInt(5, sc.getUpDown());
  98 + ps.setString(6, sc.getsCode());
  99 + ps.setString(7, sc.geteCode());
  100 + ps.setLong(8, sc.getSt());
  101 + ps.setLong(9, sc.getEt());
  102 + ps.setDate(10, new java.sql.Date(sc.getCreateDate().getTime()));
  103 + ps.setInt(11, sc.getStatus());
  104 + }
  105 +
  106 + @Override
  107 + public int getBatchSize() {
  108 + return list.size();
  109 + }
  110 + });
  111 +
  112 + tran.commit(status);
  113 + log.info("补信号班次入库," + list.size());
  114 + }catch (Exception e){
  115 + log.error("", e);
  116 + tran.rollback(status);
  117 + }
  118 + }
  119 +
  120 +
  121 +}
src/main/java/com/bsth/data/schedule/signal/entity/SchSiginCompate.java 0 → 100644
  1 +package com.bsth.data.schedule.signal.entity;
  2 +
  3 +import com.bsth.data.BasicData;
  4 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  5 +
  6 +import java.util.Date;
  7 +
  8 +/**
  9 + * 班次信号补偿
  10 + * Created by panzhao on 2017/8/13.
  11 + */
  12 +public class SchSiginCompate {
  13 +
  14 + /** 实际班次ID */
  15 + private long id;
  16 +
  17 + /** 班次日期 */
  18 + private String rq;
  19 +
  20 + /** 线路编码 */
  21 + private String lineCode;
  22 +
  23 + /** 设备号 */
  24 + private String deciveId;
  25 +
  26 + /** 上下行 */
  27 + private int upDown;
  28 +
  29 + /** 起始站编码 */
  30 + private String sCode;
  31 +
  32 + /** 终点站编码 */
  33 + private String eCode;
  34 +
  35 + /** 开始时间戳 */
  36 + private long st;
  37 +
  38 + /** 结束时间戳 */
  39 + private long et;
  40 +
  41 + /** 入库时间 */
  42 + private Date createDate;
  43 +
  44 + private int status = 0;
  45 +
  46 + public SchSiginCompate(ScheduleRealInfo sch) {
  47 + this.id = sch.getId();
  48 + this.rq = sch.getScheduleDateStr();
  49 + this.lineCode = sch.getXlBm();
  50 + this.upDown = Integer.parseInt(sch.getXlDir());
  51 + this.deciveId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  52 + this.sCode = sch.getQdzCode();
  53 + this.eCode = sch.getZdzCode();
  54 + this.st = sch.getDfsjT();
  55 + this.et = sch.getZdsjT();
  56 +
  57 + if(sch.getFcsjActualTime() != null)
  58 + this.st = sch.getFcsjActualTime();
  59 + if(sch.getZdsjActualTime() != null)
  60 + this.et = sch.getZdsjActualTime();
  61 + }
  62 +
  63 + public long getId() {
  64 + return id;
  65 + }
  66 +
  67 + public void setId(long id) {
  68 + this.id = id;
  69 + }
  70 +
  71 + public String getRq() {
  72 + return rq;
  73 + }
  74 +
  75 + public void setRq(String rq) {
  76 + this.rq = rq;
  77 + }
  78 +
  79 + public String getLineCode() {
  80 + return lineCode;
  81 + }
  82 +
  83 + public void setLineCode(String lineCode) {
  84 + this.lineCode = lineCode;
  85 + }
  86 +
  87 + public String getDeciveId() {
  88 + return deciveId;
  89 + }
  90 +
  91 + public void setDeciveId(String deciveId) {
  92 + this.deciveId = deciveId;
  93 + }
  94 +
  95 + public int getUpDown() {
  96 + return upDown;
  97 + }
  98 +
  99 + public void setUpDown(int upDown) {
  100 + this.upDown = upDown;
  101 + }
  102 +
  103 + public String getsCode() {
  104 + return sCode;
  105 + }
  106 +
  107 + public void setsCode(String sCode) {
  108 + this.sCode = sCode;
  109 + }
  110 +
  111 + public String geteCode() {
  112 + return eCode;
  113 + }
  114 +
  115 + public void seteCode(String eCode) {
  116 + this.eCode = eCode;
  117 + }
  118 +
  119 + public long getSt() {
  120 + return st;
  121 + }
  122 +
  123 + public void setSt(long st) {
  124 + this.st = st;
  125 + }
  126 +
  127 + public long getEt() {
  128 + return et;
  129 + }
  130 +
  131 + public void setEt(long et) {
  132 + this.et = et;
  133 + }
  134 +
  135 + public Date getCreateDate() {
  136 + return createDate;
  137 + }
  138 +
  139 + public void setCreateDate(Date createDate) {
  140 + this.createDate = createDate;
  141 + }
  142 +
  143 + public int getStatus() {
  144 + return status;
  145 + }
  146 +
  147 + public void setStatus(int status) {
  148 + this.status = status;
  149 + }
  150 +}
src/main/java/com/bsth/entity/excep/Outbound.java
@@ -34,9 +34,6 @@ public class Outbound { @@ -34,9 +34,6 @@ public class Outbound {
34 */ 34 */
35 private String lineName; 35 private String lineName;
36 36
37 -  
38 -  
39 -  
40 /** 37 /**
41 * 上下行(0 上行 , 1 下行 , -1 无效) 38 * 上下行(0 上行 , 1 下行 , -1 无效)
42 */ 39 */
@@ -57,18 +54,66 @@ public class Outbound { @@ -57,18 +54,66 @@ public class Outbound {
57 */ 54 */
58 private String location; 55 private String location;
59 56
  57 + /**
  58 + * 超速结束时经度
  59 + */
  60 + private Float endlon;
  61 +
  62 + /**
  63 + * 超速结束时纬度
  64 + */
  65 + private Float endlat;
60 66
61 /** 67 /**
62 * 时间戳 68 * 时间戳
63 */ 69 */
64 private Long timestamp; 70 private Long timestamp;
65 71
  72 + public Float getEndlon() {
  73 + return endlon;
  74 + }
  75 +
  76 + public void setEndlon(Float endlon) {
  77 + this.endlon = endlon;
  78 + }
  79 +
  80 + public Float getEndlat() {
  81 + return endlat;
  82 + }
  83 +
  84 + public void setEndlat(Float endlat) {
  85 + this.endlat = endlat;
  86 + }
  87 +
  88 + public Long getEndtimestamp() {
  89 + return endtimestamp;
  90 + }
  91 +
  92 + public void setEndtimestamp(Long endtimestamp) {
  93 + this.endtimestamp = endtimestamp;
  94 + }
  95 +
  96 + public String getEndtimestampDate() {
  97 + return endtimestampDate;
  98 + }
  99 +
  100 + public void setEndtimestampDate(String endtimestampDate) {
  101 + this.endtimestampDate = endtimestampDate;
  102 + }
  103 +
66 /** 104 /**
67 * 时间戳转换的时间 105 * 时间戳转换的时间
68 */ 106 */
69 private String timestampDate; 107 private String timestampDate;
70 108
71 109
  110 + //结束时间,单位:秒/s
  111 + @Transient
  112 + private Long endtimestamp;
  113 +
  114 + @Transient
  115 + private String endtimestampDate;
  116 +
72 /** 117 /**
73 * 时间 118 * 时间
74 */ 119 */
src/main/java/com/bsth/entity/oil/Cwjy.java
@@ -26,6 +26,11 @@ public class Cwjy { @@ -26,6 +26,11 @@ public class Cwjy {
26 private String xgr; 26 private String xgr;
27 27
28 private Date createDate; 28 private Date createDate;
  29 +
  30 + private String line;
  31 +
  32 + @Transient
  33 + private String linename;
29 34
30 @Transient 35 @Transient
31 private String gsname; 36 private String gsname;
@@ -95,6 +100,24 @@ public class Cwjy { @@ -95,6 +100,24 @@ public class Cwjy {
95 public void setFgsname(String fgsname) { 100 public void setFgsname(String fgsname) {
96 this.fgsname = fgsname; 101 this.fgsname = fgsname;
97 } 102 }
  103 +
  104 + public String getLine() {
  105 + return line;
  106 + }
  107 +
  108 + public void setLine(String line) {
  109 + this.line = line;
  110 + }
  111 +
  112 + public String getLinename() {
  113 + return BasicData.lineCode2NameMap.get(this.line);
  114 + }
  115 +
  116 + public void setLinename(String linename) {
  117 + this.linename = linename;
  118 + }
  119 +
  120 +
98 121
99 122
100 } 123 }
src/main/java/com/bsth/entity/oil/Ylxxb.java
@@ -44,7 +44,8 @@ public class Ylxxb { @@ -44,7 +44,8 @@ public class Ylxxb {
44 private String gsname; 44 private String gsname;
45 @Transient 45 @Transient
46 private String fgsname; 46 private String fgsname;
47 - 47 + @Transient
  48 + private String linename;
48 @Transient 49 @Transient
49 private Double zjzl; 50 private Double zjzl;
50 51
@@ -193,6 +194,12 @@ public class Ylxxb { @@ -193,6 +194,12 @@ public class Ylxxb {
193 public void setZjzl(Double zjzl) { 194 public void setZjzl(Double zjzl) {
194 this.zjzl = zjzl; 195 this.zjzl = zjzl;
195 } 196 }
  197 + public String getLinename() {
  198 + return linename;
  199 + }
  200 + public void setLinename(String linename) {
  201 + this.linename = linename;
  202 + }
196 203
197 204
198 205
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -214,6 +214,9 @@ public class ScheduleRealInfo { @@ -214,6 +214,9 @@ public class ScheduleRealInfo {
214 @JsonIgnore 214 @JsonIgnore
215 private int saveFailCount=0; 215 private int saveFailCount=0;
216 216
  217 + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/
  218 + private int siginCompate;
  219 +
217 public boolean isDfAuto() { 220 public boolean isDfAuto() {
218 return dfAuto; 221 return dfAuto;
219 } 222 }
@@ -303,10 +306,10 @@ public class ScheduleRealInfo { @@ -303,10 +306,10 @@ public class ScheduleRealInfo {
303 String old = this.getRemarks(); 306 String old = this.getRemarks();
304 if(StringUtils.isBlank(old)) 307 if(StringUtils.isBlank(old))
305 old = ""; 308 old = "";
306 - 309 +
307 old += remark + ";"; 310 old += remark + ";";
308 this.setRemarks(old); 311 this.setRemarks(old);
309 - 312 +
310 } 313 }
311 314
312 public Long getId() { 315 public Long getId() {
@@ -622,12 +625,12 @@ public class ScheduleRealInfo { @@ -622,12 +625,12 @@ public class ScheduleRealInfo {
622 this.dfsjT = dfsjT; 625 this.dfsjT = dfsjT;
623 this.dfsj = fmtHHmm.print(this.dfsjT); 626 this.dfsj = fmtHHmm.print(this.dfsjT);
624 } 627 }
625 - 628 +
626 public void setDfsjAll(String dfsj) { 629 public void setDfsjAll(String dfsj) {
627 this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj); 630 this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj);
628 this.dfsj = dfsj; 631 this.dfsj = dfsj;
629 } 632 }
630 - 633 +
631 public void calcEndTime(){ 634 public void calcEndTime(){
632 //计划终点时间 635 //计划终点时间
633 if(this.getBcsj() != null){ 636 if(this.getBcsj() != null){
@@ -665,33 +668,33 @@ public class ScheduleRealInfo { @@ -665,33 +668,33 @@ public class ScheduleRealInfo {
665 public void setSflj(boolean sflj) { 668 public void setSflj(boolean sflj) {
666 this.sflj = sflj; 669 this.sflj = sflj;
667 } 670 }
668 - 671 +
669 /** 672 /**
670 - *  
671 - * @Title: setFcsjAll  
672 - * @Description: TODO(设置计划发车时间) 673 + *
  674 + * @Title: setFcsjAll
  675 + * @Description: TODO(设置计划发车时间)
673 * @throws 676 * @throws
674 */ 677 */
675 public void setFcsjAll(String fcsj){ 678 public void setFcsjAll(String fcsj){
676 this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj); 679 this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj);
677 this.fcsj = fcsj; 680 this.fcsj = fcsj;
678 } 681 }
679 - 682 +
680 /** 683 /**
681 - *  
682 - * @Title: setFcsjAll  
683 - * @Description: TODO(设置计划发车时间) 684 + *
  685 + * @Title: setFcsjAll
  686 + * @Description: TODO(设置计划发车时间)
684 * @throws 687 * @throws
685 */ 688 */
686 public void setFcsjAll(Long fcsjT){ 689 public void setFcsjAll(Long fcsjT){
687 this.fcsjT = fcsjT; 690 this.fcsjT = fcsjT;
688 this.fcsj = fmtHHmm.print(fcsjT); 691 this.fcsj = fmtHHmm.print(fcsjT);
689 } 692 }
690 - 693 +
691 /** 694 /**
692 - *  
693 - * @Title: setFcsjActualAll  
694 - * @Description: TODO(设置实际发车时间 字符串) 695 + *
  696 + * @Title: setFcsjActualAll
  697 + * @Description: TODO(设置实际发车时间 字符串)
695 * @throws 698 * @throws
696 */ 699 */
697 public void setFcsjActualAll(String fcsjActual){ 700 public void setFcsjActualAll(String fcsjActual){
@@ -699,11 +702,11 @@ public class ScheduleRealInfo { @@ -699,11 +702,11 @@ public class ScheduleRealInfo {
699 this.fcsjActual = fcsjActual; 702 this.fcsjActual = fcsjActual;
700 calcStatus(); 703 calcStatus();
701 } 704 }
702 - 705 +
703 /** 706 /**
704 - *  
705 - * @Title: setFcsjActualAll  
706 - * @Description: TODO(设置实际发车时间 时间戳) 707 + *
  708 + * @Title: setFcsjActualAll
  709 + * @Description: TODO(设置实际发车时间 时间戳)
707 * @throws 710 * @throws
708 */ 711 */
709 public void setFcsjActualAll(Long t){ 712 public void setFcsjActualAll(Long t){
@@ -713,25 +716,25 @@ public class ScheduleRealInfo { @@ -713,25 +716,25 @@ public class ScheduleRealInfo {
713 //更新班次状态 716 //更新班次状态
714 calcStatus(); 717 calcStatus();
715 } 718 }
716 - 719 +
717 /** 720 /**
718 - *  
719 - * @Title: setFcsjActualAll  
720 - * @Description: TODO(设置实际终点时间) 721 + *
  722 + * @Title: setFcsjActualAll
  723 + * @Description: TODO(设置实际终点时间)
721 * @throws 724 * @throws
722 */ 725 */
723 public void setZdsjActualAll(Long t){ 726 public void setZdsjActualAll(Long t){
724 this.zdsjActualTime = t; 727 this.zdsjActualTime = t;
725 this.zdsjActual = fmtHHmm.print(t); 728 this.zdsjActual = fmtHHmm.print(t);
726 - 729 +
727 //更新班次状态 730 //更新班次状态
728 calcStatus(); 731 calcStatus();
729 } 732 }
730 - 733 +
731 /** 734 /**
732 - *  
733 - * @Title: setFcsjActualAll  
734 - * @Description: TODO(设置实际终点时间) 735 + *
  736 + * @Title: setFcsjActualAll
  737 + * @Description: TODO(设置实际终点时间)
735 * @throws 738 * @throws
736 */ 739 */
737 public void setZdsjActualAll(String zdsjActual){ 740 public void setZdsjActualAll(String zdsjActual){
@@ -740,7 +743,7 @@ public class ScheduleRealInfo { @@ -740,7 +743,7 @@ public class ScheduleRealInfo {
740 743
741 calcStatus(); 744 calcStatus();
742 } 745 }
743 - 746 +
744 public Long getSpId() { 747 public Long getSpId() {
745 return spId; 748 return spId;
746 } 749 }
@@ -760,11 +763,11 @@ public class ScheduleRealInfo { @@ -760,11 +763,11 @@ public class ScheduleRealInfo {
760 public void calcStatus() { 763 public void calcStatus() {
761 if(this.status == -1) 764 if(this.status == -1)
762 return; 765 return;
763 - 766 +
764 this.status = 0; 767 this.status = 0;
765 if(StringUtils.isNotBlank(this.fcsjActual)){ 768 if(StringUtils.isNotBlank(this.fcsjActual)){
766 this.status = 1; 769 this.status = 1;
767 - 770 +
768 //进出场班次并且没有计划里程的 771 //进出场班次并且没有计划里程的
769 if((this.bcType.equals("out") || this.bcType.equals("in")) 772 if((this.bcType.equals("out") || this.bcType.equals("in"))
770 && this.jhlc == null){ 773 && this.jhlc == null){
@@ -774,7 +777,7 @@ public class ScheduleRealInfo { @@ -774,7 +777,7 @@ public class ScheduleRealInfo {
774 if(StringUtils.isNotBlank(this.zdsjActual)) 777 if(StringUtils.isNotBlank(this.zdsjActual))
775 this.status = 2; 778 this.status = 2;
776 } 779 }
777 - 780 +
778 public void destroy(){ 781 public void destroy(){
779 this.jhlc = 0.0; 782 this.jhlc = 0.0;
780 if(this.isSflj()) 783 if(this.isSflj())
@@ -782,11 +785,11 @@ public class ScheduleRealInfo { @@ -782,11 +785,11 @@ public class ScheduleRealInfo {
782 this.status = -1; 785 this.status = -1;
783 this.clearFcsjActual(); 786 this.clearFcsjActual();
784 } 787 }
785 - 788 +
786 public boolean isDestroy(){ 789 public boolean isDestroy(){
787 return this.status == -1; 790 return this.status == -1;
788 } 791 }
789 - 792 +
790 /* public boolean isNotDestroy(){ 793 /* public boolean isNotDestroy(){
791 return this.status != -1; 794 return this.status != -1;
792 }*/ 795 }*/
@@ -806,18 +809,18 @@ public class ScheduleRealInfo { @@ -806,18 +809,18 @@ public class ScheduleRealInfo {
806 public void setScheduleDateStr(String scheduleDateStr) { 809 public void setScheduleDateStr(String scheduleDateStr) {
807 this.scheduleDateStr = scheduleDateStr; 810 this.scheduleDateStr = scheduleDateStr;
808 } 811 }
809 - 812 +
810 public void clearFcsjActual(){ 813 public void clearFcsjActual(){
811 this.setFcsjActual(null); 814 this.setFcsjActual(null);
812 this.setFcsjActualTime(null); 815 this.setFcsjActualTime(null);
813 this.calcStatus(); 816 this.calcStatus();
814 } 817 }
815 - 818 +
816 //清除实际终点时间 819 //清除实际终点时间
817 public void clearZdsjActual(){ 820 public void clearZdsjActual(){
818 this.setZdsjActual(null); 821 this.setZdsjActual(null);
819 this.setZdsjActualTime(null); 822 this.setZdsjActualTime(null);
820 - 823 +
821 calcStatus(); 824 calcStatus();
822 } 825 }
823 826
@@ -922,4 +925,12 @@ public class ScheduleRealInfo { @@ -922,4 +925,12 @@ public class ScheduleRealInfo {
922 public void setSaveFailCount(int saveFailCount) { 925 public void setSaveFailCount(int saveFailCount) {
923 this.saveFailCount = saveFailCount; 926 this.saveFailCount = saveFailCount;
924 } 927 }
  928 +
  929 + public int getSiginCompate() {
  930 + return siginCompate;
  931 + }
  932 +
  933 + public void setSiginCompate(int siginCompate) {
  934 + this.siginCompate = siginCompate;
  935 + }
925 } 936 }
src/main/java/com/bsth/repository/oil/CwjyRepository.java
@@ -30,5 +30,8 @@ public interface CwjyRepository extends BaseRepository&lt;Cwjy, Integer&gt;{ @@ -30,5 +30,8 @@ public interface CwjyRepository extends BaseRepository&lt;Cwjy, Integer&gt;{
30 @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3%",nativeQuery=true) 30 @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3%",nativeQuery=true)
31 List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm); 31 List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm);
32 32
  33 + @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% and line =?4",nativeQuery=true)
  34 + List<Cwjy> selectAll_s(String nbbm,String gsdm,String fgsdm,String line);
  35 +
33 36
34 } 37 }
src/main/java/com/bsth/service/excep/NowOutboundService.java
1 package com.bsth.service.excep; 1 package com.bsth.service.excep;
2 2
  3 +import java.util.List;
3 import java.util.Map; 4 import java.util.Map;
4 5
5 import com.bsth.entity.excep.Outbound; 6 import com.bsth.entity.excep.Outbound;
@@ -8,4 +9,6 @@ import com.bsth.util.PageObject; @@ -8,4 +9,6 @@ import com.bsth.util.PageObject;
8 public interface NowOutboundService { 9 public interface NowOutboundService {
9 PageObject <Outbound> Pagequery(Map<String, Object> map) ; 10 PageObject <Outbound> Pagequery(Map<String, Object> map) ;
10 Map<String, Object> getReport( Map<String, Object> map); 11 Map<String, Object> getReport( Map<String, Object> map);
  12 + List<Outbound> findPosition(String deviceid, String startdate,
  13 + String enddate);
11 } 14 }
src/main/java/com/bsth/service/excep/impl/NowOutboundServiceImpl.java
@@ -14,16 +14,16 @@ import java.util.Map; @@ -14,16 +14,16 @@ import java.util.Map;
14 14
15 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.jdbc.core.JdbcTemplate; 16 import org.springframework.jdbc.core.JdbcTemplate;
17 -import org.springframework.jdbc.core.RowMapper;  
18 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
19 18
20 import com.bsth.data.BasicData; 19 import com.bsth.data.BasicData;
21 import com.bsth.entity.excep.Outbound; 20 import com.bsth.entity.excep.Outbound;
22 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
23 import com.bsth.service.excep.NowOutboundService; 21 import com.bsth.service.excep.NowOutboundService;
24 import com.bsth.util.EchartConver; 22 import com.bsth.util.EchartConver;
25 import com.bsth.util.PageHelper; 23 import com.bsth.util.PageHelper;
26 import com.bsth.util.PageObject; 24 import com.bsth.util.PageObject;
  25 +import com.bsth.util.TransGPS;
  26 +import com.bsth.util.TransGPS.Location;
27 import com.bsth.util.db.DBUtils_MS; 27 import com.bsth.util.db.DBUtils_MS;
28 import com.github.abel533.echarts.Option; 28 import com.github.abel533.echarts.Option;
29 import com.google.gson.Gson; 29 import com.google.gson.Gson;
@@ -37,7 +37,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -37,7 +37,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{
37 ResultSet rs = null; 37 ResultSet rs = null;
38 int page=Integer.parseInt(map.get("page").toString()); 38 int page=Integer.parseInt(map.get("page").toString());
39 List<Outbound> list=new ArrayList<Outbound>(); 39 List<Outbound> list=new ArrayList<Outbound>();
40 - String sql="select * from bsth_c_outbound where 1=1 "; 40 + String sql="select * from bsth_c_outbound_handle where 1=1 ";
41 Object line=map.get("line"); 41 Object line=map.get("line");
42 Object nbbm=map.get("nbbm"); 42 Object nbbm=map.get("nbbm");
43 Object updown=map.get("updown"); 43 Object updown=map.get("updown");
@@ -61,7 +61,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -61,7 +61,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{
61 try { 61 try {
62 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 62 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
63 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 63 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
64 - sql += " and timestamp >="+t1 +" and timestamp <="+t2; 64 + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2;
65 } catch (ParseException e) { 65 } catch (ParseException e) {
66 // TODO Auto-generated catch block 66 // TODO Auto-generated catch block
67 e.printStackTrace(); 67 e.printStackTrace();
@@ -69,8 +69,10 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -69,8 +69,10 @@ public class NowOutboundServiceImpl implements NowOutboundService{
69 } 69 }
70 70
71 } 71 }
72 - // sql +=" order by id limit ?,?";  
73 - sql +=" order by timestamp limit ?,?"; 72 +
  73 + sql +=" and endtimestamp - starttimestamp >10000 ";//越界超过30秒的才显示,有待探讨。
  74 +
  75 + sql +=" order by starttimestamp limit ?,?";
74 76
75 try { 77 try {
76 conn = DBUtils_MS.getConnection(); 78 conn = DBUtils_MS.getConnection();
@@ -90,22 +92,29 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -90,22 +92,29 @@ public class NowOutboundServiceImpl implements NowOutboundService{
90 } 92 }
91 93
92 static List<Outbound> resultSet2Set(ResultSet rs) throws SQLException{ 94 static List<Outbound> resultSet2Set(ResultSet rs) throws SQLException{
93 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 95 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
94 List<Outbound> list=new ArrayList<Outbound>(); 96 List<Outbound> list=new ArrayList<Outbound>();
95 Outbound outbound; 97 Outbound outbound;
  98 + Location location;
96 while(rs.next()){ 99 while(rs.next()){
97 outbound=new Outbound(); 100 outbound=new Outbound();
98 - // outbound.setId(Integer.valueOf(rs.getObject("id").toString())); 101 + outbound.setId(Integer.valueOf(rs.getObject("id").toString()));
99 outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); 102 outbound.setLine(Integer.valueOf(rs.getObject("line").toString()));
100 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); 103 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
101 - outbound.setLon(Float.valueOf(rs.getObject("lon").toString()));  
102 - outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); 104 + //将gps的经纬度转成百度的经纬度
  105 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("startLon"), rs.getFloat("startLat"))));
  106 + outbound.setLon((float)location.getLng());
  107 + outbound.setLat((float)location.getLat());
  108 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("endLon"), rs.getFloat("endLat"))));
  109 + outbound.setEndlon((float)location.getLng());
  110 + outbound.setEndlat((float)location.getLat());
  111 + outbound.setTimestamp((Long.valueOf(rs.getObject("startTimestamp").toString())));
  112 + outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
  113 + outbound.setEndtimestamp((Long.valueOf(rs.getObject("endTimestamp").toString())));
  114 + outbound.setEndtimestampDate(sdf.format(new Date(outbound.getEndtimestamp())));
103 //run 时注解 115 //run 时注解
104 outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); 116 outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString()));
105 - outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));  
106 - outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));  
107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); 117 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
108 -// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());  
109 list.add(outbound); 118 list.add(outbound);
110 } 119 }
111 return list; 120 return list;
@@ -114,7 +123,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -114,7 +123,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{
114 @Override 123 @Override
115 public PageObject<Outbound> Pagequery(Map<String, Object> map) { 124 public PageObject<Outbound> Pagequery(Map<String, Object> map) {
116 // TODO Auto-generated method stub PageObject<Outbound> Pagequery 125 // TODO Auto-generated method stub PageObject<Outbound> Pagequery
117 - String sql="select count(*) record from bsth_c_outbound where 1=1 "; 126 + String sql="select count(*) record from bsth_c_outbound_handle where 1=1 ";
118 Object line=map.get("line"); 127 Object line=map.get("line");
119 Object nbbm=map.get("nbbm"); 128 Object nbbm=map.get("nbbm");
120 Object updown=map.get("updown"); 129 Object updown=map.get("updown");
@@ -139,7 +148,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -139,7 +148,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{
139 try { 148 try {
140 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); 149 Long t1=sdf.parse(date.toString()+" 00:00:00").getTime();
141 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); 150 Long t2=sdf.parse(date.toString()+" 23:59:59").getTime();
142 - sql += " and timestamp >="+t1 +" and timestamp <="+t2; 151 + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2;
143 } catch (ParseException e) { 152 } catch (ParseException e) {
144 // TODO Auto-generated catch block 153 // TODO Auto-generated catch block
145 e.printStackTrace(); 154 e.printStackTrace();
@@ -147,6 +156,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -147,6 +156,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{
147 } 156 }
148 157
149 } 158 }
  159 +
  160 + sql +=" and endtimestamp - starttimestamp >10000 ";//yue越界超过10秒的才显示,有待探讨。
  161 +
150 Connection conn = null; 162 Connection conn = null;
151 PreparedStatement ps = null; 163 PreparedStatement ps = null;
152 ResultSet rs = null; 164 ResultSet rs = null;
@@ -165,10 +177,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -165,10 +177,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{
165 }finally { 177 }finally {
166 DBUtils_MS.close(rs, ps, conn); 178 DBUtils_MS.close(rs, ps, conn);
167 } 179 }
168 -  
169 PageHelper pageHelper = new PageHelper(totalData, map); 180 PageHelper pageHelper = new PageHelper(totalData, map);
170 List<Outbound> list=findAll(pageHelper.getMap()); 181 List<Outbound> list=findAll(pageHelper.getMap());
171 - for (int i = 0; i < list.size(); i++) { 182 +/* for (int i = 0; i < list.size(); i++) {
172 String nbbm2=list.get(i).getVehicle() ; 183 String nbbm2=list.get(i).getVehicle() ;
173 Long d1=list.get(i).getTimestamp(); 184 Long d1=list.get(i).getTimestamp();
174 Date datess = new Date(d1); 185 Date datess = new Date(d1);
@@ -194,7 +205,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -194,7 +205,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{
194 205
195 } 206 }
196 207
197 - } 208 + }*/
198 PageObject<Outbound> pageObject = pageHelper.getPageObject(); 209 PageObject<Outbound> pageObject = pageHelper.getPageObject();
199 pageObject.setDataList(list); 210 pageObject.setDataList(list);
200 return pageObject; 211 return pageObject;
@@ -319,4 +330,45 @@ public class NowOutboundServiceImpl implements NowOutboundService{ @@ -319,4 +330,45 @@ public class NowOutboundServiceImpl implements NowOutboundService{
319 330
320 return dataList; 331 return dataList;
321 } 332 }
  333 +
  334 + @Override
  335 + public List<Outbound> findPosition(String deviceid, String startdate,
  336 + String enddate){
  337 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  338 + String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where vehicle = ? and timestamp >= ? and timestamp <= ? order by timestamp ";
  339 + Connection conn = null;
  340 + PreparedStatement ps = null;
  341 + ResultSet rs = null;
  342 + List<Outbound> listResult = new ArrayList<Outbound>();
  343 + Outbound outbound = null;
  344 + try {
  345 + conn = DBUtils_MS.getConnection();
  346 + ps = conn.prepareStatement(sql);
  347 + long startTime = sdf.parse(startdate).getTime();
  348 + long endTime = sdf.parse(enddate).getTime();
  349 + ps.setString(1, deviceid);
  350 + ps.setLong(2,startTime);
  351 + ps.setLong(3,endTime);
  352 + rs = ps.executeQuery();
  353 + Location location;
  354 + while (rs.next()) {
  355 + outbound = new Outbound();
  356 + outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
  357 + location = TransGPS.LocationMake(rs.getFloat("lon"), rs.getFloat("lat"));
  358 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  359 + outbound.setLon((float)location.getLng());
  360 + outbound.setLat((float)location.getLat());
  361 + outbound.setTimestamp(rs.getLong("timestamp"));
  362 + // 上下行
  363 + listResult.add(outbound);
  364 + }
  365 + } catch (Exception e) {
  366 + e.printStackTrace();
  367 + } finally {
  368 + DBUtils_MS.close(rs, ps, conn);
  369 + }
  370 + return listResult;
  371 +
  372 + }
  373 +
322 } 374 }
src/main/java/com/bsth/service/excep/impl/NowSpeedingServiceImpl.java
@@ -39,7 +39,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { @@ -39,7 +39,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
39 ResultSet rs = null; 39 ResultSet rs = null;
40 int page=Integer.parseInt(map.get("page").toString()); 40 int page=Integer.parseInt(map.get("page").toString());
41 List<Speeding> list=new ArrayList<Speeding>(); 41 List<Speeding> list=new ArrayList<Speeding>();
42 - String sql="select * from bsth_c_speedingmh where 1=1 "; 42 + String sql="select * from bsth_c_speeding_handle where 1=1 ";
43 Object line=map.get("line"); 43 Object line=map.get("line");
44 Object updown=map.get("updown"); 44 Object updown=map.get("updown");
45 Object startDate=map.get("startDate"); 45 Object startDate=map.get("startDate");
@@ -128,7 +128,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { @@ -128,7 +128,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
128 128
129 @Override 129 @Override
130 public PageObject<Speeding> Pagequery(Map<String, Object> map) { 130 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
131 - String sql="select count(*) record from bsth_c_speedingmh where 1=1 "; 131 + String sql="select count(*) record from bsth_c_speeding_handle where 1=1 ";
132 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 132 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
133 Object line=map.get("line"); 133 Object line=map.get("line");
134 Object updown=map.get("updown"); 134 Object updown=map.get("updown");
src/main/java/com/bsth/service/oil/CwjyService.java
@@ -15,5 +15,5 @@ public interface CwjyService extends BaseService&lt;Cwjy, Integer&gt;{ @@ -15,5 +15,5 @@ public interface CwjyService extends BaseService&lt;Cwjy, Integer&gt;{
15 15
16 Map<String, Object> savejzl(Map<String, Object> map) throws Exception ; 16 Map<String, Object> savejzl(Map<String, Object> map) throws Exception ;
17 17
18 - int checkNbbm(String nbbm); 18 + int checkNbbm(Cwjy t);
19 } 19 }
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
24 import com.alibaba.fastjson.JSONArray; 24 import com.alibaba.fastjson.JSONArray;
25 import com.alibaba.fastjson.JSONObject; 25 import com.alibaba.fastjson.JSONObject;
26 import com.bsth.common.ResponseCode; 26 import com.bsth.common.ResponseCode;
  27 +import com.bsth.data.BasicData;
27 import com.bsth.entity.oil.Cwjy; 28 import com.bsth.entity.oil.Cwjy;
28 import com.bsth.entity.oil.Cyl; 29 import com.bsth.entity.oil.Cyl;
29 import com.bsth.entity.oil.Ylb; 30 import com.bsth.entity.oil.Ylb;
@@ -281,6 +282,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -281,6 +282,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
281 String gsdm=map.get("gsdm_like").toString(); 282 String gsdm=map.get("gsdm_like").toString();
282 283
283 String fgsdm=map.get("fgsdm_like").toString(); 284 String fgsdm=map.get("fgsdm_like").toString();
  285 + String line =map.get("line_like").toString().trim();
284 /*String sql="SELECT a.gsdm as gsdm,a.fgsdm as fgsdm,a.nbbm as nbbm," 286 /*String sql="SELECT a.gsdm as gsdm,a.fgsdm as fgsdm,a.nbbm as nbbm,"
285 + "b.jyggh as jyggh,b.jzl as jzl ,b.stationid as stationid,b.jsy as jsy," 287 + "b.jyggh as jyggh,b.jzl as jzl ,b.stationid as stationid,b.jsy as jsy,"
286 + "b.nylx as nylx,b.yj as yj,b.bz as bz,b.id as id ,c.jsy as ldgh FROM bsth_c_cwjy a "+ 288 + "b.nylx as nylx,b.yj as yj,b.bz as bz,b.id as id ,c.jsy as ldgh FROM bsth_c_cwjy a "+
@@ -318,7 +320,13 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -318,7 +320,13 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
318 return t; 320 return t;
319 } 321 }
320 }); 322 });
321 - List<Cwjy> cwList=repository.selectAll(nbbm, gsdm, fgsdm); 323 + List<Cwjy> cwList=null;
  324 + if(line.equals("")){
  325 + cwList = repository.selectAll(nbbm, gsdm, fgsdm);
  326 + }else{
  327 + cwList = repository.selectAll_s(nbbm, gsdm, fgsdm, line);
  328 + }
  329 +
322 String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " 330 String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE "
323 + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND " 331 + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND "
324 + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; 332 + " fgsdm = '"+fgsdm+"' GROUP BY nbbm";
@@ -338,9 +346,6 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -338,9 +346,6 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
338 Ylxxb y=null; 346 Ylxxb y=null;
339 for (int i = 0; i < cwList.size(); i++) { 347 for (int i = 0; i < cwList.size(); i++) {
340 Cwjy cwjy=cwList.get(i); 348 Cwjy cwjy=cwList.get(i);
341 - if(cwjy.getNbbm().equals("W7B-092")){  
342 - System.out.println();  
343 - }  
344 y=new Ylxxb(); 349 y=new Ylxxb();
345 y.setNylx(0); 350 y.setNylx(0);
346 y.setId(0); 351 y.setId(0);
@@ -348,6 +353,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -348,6 +353,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
348 y.setGsdm(cwjy.getGsdm()); 353 y.setGsdm(cwjy.getGsdm());
349 y.setFgsdm(cwjy.getFgsdm()); 354 y.setFgsdm(cwjy.getFgsdm());
350 y.setNbbm(cwjy.getNbbm()); 355 y.setNbbm(cwjy.getNbbm());
  356 + y.setLinename(cwjy.getLinename());
351 for (int j = 0; j < yList.size(); j++) { 357 for (int j = 0; j < yList.size(); j++) {
352 Ylxxb ylxxb=yList.get(j); 358 Ylxxb ylxxb=yList.get(j);
353 if(y.getNbbm().equals(ylxxb.getNbbm())){ 359 if(y.getNbbm().equals(ylxxb.getNbbm())){
@@ -379,9 +385,10 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw @@ -379,9 +385,10 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
379 } 385 }
380 386
381 @Override 387 @Override
382 - public int checkNbbm(String nbbm) { 388 + public int checkNbbm(Cwjy t) {
383 // TODO Auto-generated method stub 389 // TODO Auto-generated method stub
384 - String sql="select count(*) from bsth_c_cwjy where nbbm ='"+nbbm+"'"; 390 + String sql="select count(*) from bsth_c_cwjy where nbbm ='"+t.getNbbm()+"'"
  391 + + " and gsdm ='"+t.getFgsdm()+"' and fgsdm ='"+t.getFgsdm()+"'";
385 int cs=jdbcTemplate.queryForObject(sql, Integer.class); 392 int cs=jdbcTemplate.queryForObject(sql, Integer.class);
386 393
387 return cs; 394 return cs;
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -384,6 +384,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -384,6 +384,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
384 for (int i = 0; i < ylxxList.size(); i++) { 384 for (int i = 0; i < ylxxList.size(); i++) {
385 Ylxxb ylxxb = ylxxList.get(i); 385 Ylxxb ylxxb = ylxxList.get(i);
386 if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) 386 if (map.get("clZbh").toString().equals(ylxxb.getNbbm())
  387 + && map.get("jGh").toString().equals(ylxxb.getJsy())
387 && ylxxb.getJylx()==1) { 388 && ylxxb.getJylx()==1) {
388 if(ylxxb.getJzl()>0){ 389 if(ylxxb.getJzl()>0){
389 fage2=true; 390 fage2=true;
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
@@ -176,6 +176,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements @@ -176,6 +176,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
176 String jsy =jsonObject.getString("jsy"); 176 String jsy =jsonObject.getString("jsy");
177 Ylxxb ylxxb=repository.findOne(id); 177 Ylxxb ylxxb=repository.findOne(id);
178 ylxxb.setJsy(jsy); 178 ylxxb.setJsy(jsy);
  179 + ylxxb.setJylx(1);
179 repository.save(ylxxb); 180 repository.save(ylxxb);
180 } 181 }
181 newMap.put("status", ResponseCode.SUCCESS); 182 newMap.put("status", ResponseCode.SUCCESS);
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2737,7 +2737,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2737,7 +2737,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2737 if (a == 2) { 2737 if (a == 2) {
2738 x = b + 1; 2738 x = b + 1;
2739 y = x * 2; 2739 y = x * 2;
2740 - } else if (b == 1) { 2740 + } else if (a == 1) {
2741 x = b + 1; 2741 x = b + 1;
2742 y = x * 2 - 1; 2742 y = x * 2 - 1;
2743 } else { 2743 } else {
@@ -3011,10 +3011,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3011,10 +3011,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3011 if (sch == null) 3011 if (sch == null)
3012 continue; 3012 continue;
3013 3013
3014 - if (cpc.getClZbh() != null && !carExist(sch.getGsBm(), cpc.getClZbh())) {  
3015 - rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!");  
3016 - rs.put("status", ResponseCode.ERROR);  
3017 - return rs; 3014 + if (cpc.getClZbh() != null) {
  3015 + if(!carExist(sch.getGsBm(), cpc.getClZbh())) {
  3016 + rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!");
  3017 + rs.put("status", ResponseCode.ERROR);
  3018 + return rs;
  3019 + }
  3020 + else if(!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))){
  3021 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆");
  3022 + rs.put("status", ResponseCode.ERROR);
  3023 + return rs;
  3024 + }
3018 } 3025 }
3019 3026
3020 if (StringUtils.isNotEmpty(cpc.getJsy())) { 3027 if (StringUtils.isNotEmpty(cpc.getJsy())) {
@@ -4068,7 +4075,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4068,7 +4075,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4068 if((zdsj_-zdsjActual_)>0){ 4075 if((zdsj_-zdsjActual_)>0){
4069 zdsjk =String.valueOf(zdsj_-zdsjActual_); 4076 zdsjk =String.valueOf(zdsj_-zdsjActual_);
4070 }else{ 4077 }else{
4071 - zdsjm =String.valueOf(zdsj_-zdsjActual_); 4078 + zdsjm =String.valueOf(zdsjActual_-zdsj_);
4072 } 4079 }
4073 } 4080 }
4074 tempMap.put("zdsjk" + x, zdsjk); 4081 tempMap.put("zdsjk" + x, zdsjk);
@@ -4095,7 +4102,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4095,7 +4102,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4095 if((zdsj_-fcsjActural_)>0){ 4102 if((zdsj_-fcsjActural_)>0){
4096 fcsjk =String.valueOf(zdsj_-fcsjActural_); 4103 fcsjk =String.valueOf(zdsj_-fcsjActural_);
4097 }else{ 4104 }else{
4098 - fcsjm =String.valueOf(zdsj_-fcsjActural_); 4105 + fcsjm =String.valueOf(fcsjActural_-zdsj_);
4099 } 4106 }
4100 } 4107 }
4101 tempMap.put("fcsjk" + x, fcsjk); 4108 tempMap.put("fcsjk" + x, fcsjk);
@@ -4439,9 +4446,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4439,9 +4446,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4439 try { 4446 try {
4440 List<String> leftList = Splitter.on(",").splitToList(leftIdx); 4447 List<String> leftList = Splitter.on(",").splitToList(leftIdx);
4441 List<String> rightList = Splitter.on(",").splitToList(rightIdx); 4448 List<String> rightList = Splitter.on(",").splitToList(rightIdx);
4442 -  
4443 - //有班次变更的车辆  
4444 - Set<String> cars = new HashSet<>(); 4449 + Set<String> lpSet = new HashSet<>();
4445 4450
4446 List<ScheduleRealInfo> largeList, smallList; 4451 List<ScheduleRealInfo> largeList, smallList;
4447 if (leftList.size() > rightList.size()) { 4452 if (leftList.size() > rightList.size()) {
@@ -4462,7 +4467,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4462,7 +4467,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4462 //不对称时多出来的 4467 //不对称时多出来的
4463 lpChangeByLeft(leftSch, largeList.get(i - 1), type); 4468 lpChangeByLeft(leftSch, largeList.get(i - 1), type);
4464 ts.add(leftSch); 4469 ts.add(leftSch);
4465 - cars.add(leftSch.getClZbh()); 4470 + lpSet.add(leftSch.getXlBm() + "_" + leftSch.getLpName());
4466 continue; 4471 continue;
4467 } 4472 }
4468 4473
@@ -4470,13 +4475,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4470,13 +4475,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4470 lpChange(leftSch, rightSch, type); 4475 lpChange(leftSch, rightSch, type);
4471 ts.add(leftSch); 4476 ts.add(leftSch);
4472 4477
4473 - cars.add(leftSch.getClZbh());  
4474 - cars.add(rightSch.getClZbh()); 4478 + lpSet.add(leftSch.getXlBm() + "_" + leftSch.getLpName());
  4479 + lpSet.add(rightSch.getXlBm() + "_" + rightSch.getLpName());
4475 } 4480 }
4476 4481
4477 - //重新计算起点应到时间  
4478 - for(String nbbm : cars){  
4479 - ts.addAll(dayOfSchedule.updateQdzTimePlan(nbbm)); 4482 + //重新计算路牌的起点应到时间
  4483 + for(String lpName : lpSet){
  4484 + ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName));
4480 } 4485 }
4481 4486
4482 for (ScheduleRealInfo sch : ts) { 4487 for (ScheduleRealInfo sch : ts) {
@@ -4504,6 +4509,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4504,6 +4509,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4504 4509
4505 @Override 4510 @Override
4506 public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { 4511 public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
  4512 + //释放班次映射
  4513 + if(type > 0) {
  4514 + dayOfSchedule.removeNbbm2SchMapp(leftSch);
  4515 + dayOfSchedule.removeNbbm2SchMapp(rightSch);
  4516 + }
  4517 +
  4518 + //对调数据
4507 LpData leftData = new LpData(leftSch); 4519 LpData leftData = new LpData(leftSch);
4508 LpData rightData = new LpData(rightSch); 4520 LpData rightData = new LpData(rightSch);
4509 4521
@@ -4511,12 +4523,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4511,12 +4523,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4511 rightData.appendTo(leftSch, type); 4523 rightData.appendTo(leftSch, type);
4512 4524
4513 if(type > 0){ 4525 if(type > 0){
4514 - //更新车辆和班次映射信息  
4515 - dayOfSchedule.removeNbbm2SchMapp(leftSch, leftData.getNbbm());  
4516 - dayOfSchedule.removeNbbm2SchMapp(rightSch, rightData.getNbbm());  
4517 -  
4518 - dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm());  
4519 - dayOfSchedule.addNbbm2SchMapp(rightSch, leftData.getNbbm()); 4526 + //重新映射
  4527 + dayOfSchedule.addNbbm2SchMapp(leftSch);
  4528 + dayOfSchedule.addNbbm2SchMapp(rightSch);
4520 } 4529 }
4521 } 4530 }
4522 4531
@@ -4527,14 +4536,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4527,14 +4536,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4527 * @param type 4536 * @param type
4528 */ 4537 */
4529 public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { 4538 public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
4530 - LpData rightData = new LpData(rightSch); 4539 + //释放班次映射
  4540 + if(type > 0)
  4541 + dayOfSchedule.removeNbbm2SchMapp(leftSch);
4531 4542
  4543 + LpData rightData = new LpData(rightSch);
4532 rightData.appendTo(leftSch, type); 4544 rightData.appendTo(leftSch, type);
4533 4545
4534 - if(type > 0){  
4535 - //更新车辆和班次映射信息  
4536 - dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm());  
4537 - } 4546 + //重新映射
  4547 + if(type > 0)
  4548 + dayOfSchedule.addNbbm2SchMapp(leftSch);
  4549 +
4538 } 4550 }
4539 4551
4540 @Override 4552 @Override
src/main/resources/static/pages/base/interval/edit.html
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 <div class="col-md-12" style="margin-top:10px"> 49 <div class="col-md-12" style="margin-top:10px">
50 <label class="control-label col-md-5"> 间隔等级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label> 50 <label class="control-label col-md-5"> 间隔等级&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
51 <div class="col-md-4"> 51 <div class="col-md-4">
52 - <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级"> 52 + <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级" readonly>
53 </div> 53 </div>
54 </div> 54 </div>
55 55
src/main/resources/static/pages/base/interval/js/interval-add-form.js
@@ -30,21 +30,18 @@ $(function(){ @@ -30,21 +30,18 @@ $(function(){
30 focusInvalid : true, 30 focusInvalid : true,
31 // 需要验证的表单元素 31 // 需要验证的表单元素
32 rules : { 32 rules : {
33 - // 公司名称编码  
34 'level' : { 33 'level' : {
35 // 必填项 34 // 必填项
36 required : true, 35 required : true,
37 // 最大长度 36 // 最大长度
38 maxlength: 10 37 maxlength: 10
39 }, 38 },
40 - // 公司名称  
41 'peak' : { 39 'peak' : {
42 // 必填项 40 // 必填项
43 required : true, 41 required : true,
44 // 最大长度 42 // 最大长度
45 maxlength: 10 43 maxlength: 10
46 }, 44 },
47 - // 公司名称  
48 'trough' : { 45 'trough' : {
49 // 必填项 46 // 必填项
50 required : true, 47 required : true,
src/main/resources/static/pages/base/interval/js/interval-edit-form.js
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 var intervalId = $.url().param('no'); 12 var intervalId = $.url().param('no');
13 // 如果参数ID不为空 13 // 如果参数ID不为空
14 if(intervalId) { 14 if(intervalId) {
15 - // 获取线路Id元素并设值 15 + // 获取间隔信息Id元素并设值
16 $('#intervalId').val(intervalId); 16 $('#intervalId').val(intervalId);
17 /** 根据ID查询详细信息 */ 17 /** 根据ID查询详细信息 */
18 $get('/interval/' + intervalId ,null, function(result){ 18 $get('/interval/' + intervalId ,null, function(result){
@@ -50,21 +50,18 @@ @@ -50,21 +50,18 @@
50 focusInvalid : true, 50 focusInvalid : true,
51 // 需要验证的表单元素 51 // 需要验证的表单元素
52 rules : { 52 rules : {
53 - // 公司名称编码  
54 'level' : { 53 'level' : {
55 // 必填项 54 // 必填项
56 required : true, 55 required : true,
57 // 最大长度 56 // 最大长度
58 maxlength: 10 57 maxlength: 10
59 }, 58 },
60 - // 公司名称  
61 'peak' : { 59 'peak' : {
62 // 必填项 60 // 必填项
63 required : true, 61 required : true,
64 // 最大长度 62 // 最大长度
65 maxlength: 10 63 maxlength: 10
66 }, 64 },
67 - // 公司名称  
68 'trough' : { 65 'trough' : {
69 // 必填项 66 // 必填项
70 required : true, 67 required : true,
src/main/resources/static/pages/base/interval/js/interval-list-table.js
@@ -114,6 +114,25 @@ @@ -114,6 +114,25 @@
114 // 把数据填充到模版中 114 // 把数据填充到模版中
115 var tbodyHtml = template('interval_list_temp',{list:result.content}); 115 var tbodyHtml = template('interval_list_temp',{list:result.content});
116 $('#datatable_interval tbody').html(tbodyHtml); 116 $('#datatable_interval tbody').html(tbodyHtml);
  117 + /**
  118 + * 绑定删除事件。
  119 + */
  120 + $(".delete").click(function(){
  121 + var intervalId = $(this).data('id');
  122 + layer.confirm('是否要删除间隔信息?', {
  123 + btn: ['确定','取消'] //按钮
  124 + }, function(){
  125 + $.ajax({
  126 + url: '/interval/' + intervalId,
  127 + type: 'DELETE',
  128 + success: function(result) {
  129 + window.location.href = 'list.html';
  130 + }
  131 + });
  132 + }, function(){
  133 + });
  134 + });
  135 +
117 // 是重新分页且返回数据长度大于0 136 // 是重新分页且返回数据长度大于0
118 if(isPon && result.content.length > 0){ 137 if(isPon && result.content.length > 0){
119 // 重新分页 138 // 重新分页
@@ -154,4 +173,5 @@ @@ -154,4 +173,5 @@
154 } 173 }
155 }); 174 });
156 } 175 }
  176 +
157 })(); 177 })();
158 \ No newline at end of file 178 \ No newline at end of file
src/main/resources/static/pages/base/interval/list.html
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <span class="caption-subject font-dark sbold uppercase">间隔信息</span> 25 <span class="caption-subject font-dark sbold uppercase">间隔信息</span>
26 </div> 26 </div>
27 <div class="actions"> 27 <div class="actions">
28 - <div class="btn-group btn-group-devided" data-toggle="buttons"> 28 + <div class="btn-group btn-group-devided" data-toggle="buttons" style="display:none">
29 <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a> 29 <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a>
30 </div> 30 </div>
31 </div> 31 </div>
@@ -36,7 +36,6 @@ @@ -36,7 +36,6 @@
36 <thead> 36 <thead>
37 <tr role="row" class="heading"> 37 <tr role="row" class="heading">
38 <th >序号</th> 38 <th >序号</th>
39 - <th >间隔ID</th>  
40 <th >间隔等级</th> 39 <th >间隔等级</th>
41 <th >高峰间隔时间</th> 40 <th >高峰间隔时间</th>
42 <th >低谷间隔时间</th> 41 <th >低谷间隔时间</th>
@@ -47,7 +46,6 @@ @@ -47,7 +46,6 @@
47 <td></td> 46 <td></td>
48 <td></td> 47 <td></td>
49 <td></td> 48 <td></td>
50 - <td></td>  
51 <td> 49 <td>
52 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 50 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
53 <i class="fa fa-search"></i> 搜索 51 <i class="fa fa-search"></i> 搜索
@@ -76,9 +74,6 @@ @@ -76,9 +74,6 @@
76 {{(list.page*10)+(i+1)}} 74 {{(list.page*10)+(i+1)}}
77 </td> 75 </td>
78 <td> 76 <td>
79 - {{obj.id}}  
80 - </td>  
81 - <td>  
82 {{obj.level}} 77 {{obj.level}}
83 </td> 78 </td>
84 <td> 79 <td>
@@ -89,7 +84,7 @@ @@ -89,7 +84,7 @@
89 </td> 84 </td>
90 <td> 85 <td>
91 <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a> 86 <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a>
92 - <a class="btn btn-danger btn-sm" onclick="del({{obj.id}})"> 删除</a> 87 + <a class="btn btn-danger btn-sm delete" data-id={{obj.id}}> 删除</a>
93 </td> 88 </td>
94 </tr> 89 </tr>
95 {{/each}} 90 {{/each}}
@@ -99,22 +94,4 @@ @@ -99,22 +94,4 @@
99 </tr> 94 </tr>
100 {{/if}} 95 {{/if}}
101 </script> 96 </script>
102 -<!-- <script src="/pages/base/line/js/tipso.js"></script> -->  
103 -<!-- 线路信息片段JS模块 -->  
104 -<script src="/pages/base/interval/js/interval-list-table.js"></script>  
105 -<script>  
106 - function del(intervalId){  
107 - layer.confirm('确定要删除间隔信息吗?', {  
108 - btn: ['确定','取消'] //按钮  
109 - }, function(){  
110 - $.ajax({  
111 - url: '/interval/' + intervalId,  
112 - type: 'DELETE',  
113 - success: function(result) {  
114 - window.location.href = 'list.html';  
115 - }  
116 - });  
117 - }, function(){  
118 - });  
119 - }  
120 -</script>  
121 \ No newline at end of file 97 \ No newline at end of file
  98 +<script src="/pages/base/interval/js/interval-list-table.js"></script>
122 \ No newline at end of file 99 \ No newline at end of file
src/main/resources/static/pages/excep/js/line-list-function.js
@@ -48,7 +48,7 @@ var PublicFunctions = function () { @@ -48,7 +48,7 @@ var PublicFunctions = function () {
48 linePanlThree : function(lineId,data,direction) { 48 linePanlThree : function(lineId,data,direction) {
49 /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ 49 /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
50 $get('/stationroute/getStationRouteCenterPoints',{lineId:lineId,direction:direction},function(resultdata) { 50 $get('/stationroute/getStationRouteCenterPoints',{lineId:lineId,direction:direction},function(resultdata) {
51 - SpeedingMap.clearMarkAndOverlays(); 51 + BasicMap.clearMarkAndOverlays();
52 var polyline_center; 52 var polyline_center;
53 // 如果站点路由数据不为空 53 // 如果站点路由数据不为空
54 if(resultdata.length>0) { 54 if(resultdata.length>0) {
@@ -66,7 +66,7 @@ var PublicFunctions = function () { @@ -66,7 +66,7 @@ var PublicFunctions = function () {
66 // 设置中心点 66 // 设置中心点
67 var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); 67 var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]);
68 /** 在地图上画点 @param:<point_center:中心坐标点> */ 68 /** 在地图上画点 @param:<point_center:中心坐标点> */
69 - SpeedingMap.drawingUpStationPoint(point_center,stationName,s+1); 69 + BasicMap.drawingUpStationPoint(point_center,stationName,s+1);
70 } 70 }
71 71
72 } 72 }
@@ -91,7 +91,7 @@ var PublicFunctions = function () { @@ -91,7 +91,7 @@ var PublicFunctions = function () {
91 polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); 91 polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
92 } 92 }
93 /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ 93 /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
94 - SpeedingMap.drawingUpline01(polylineArray,polyline_center,data[d]); 94 + BasicMap.drawingUpline01(polylineArray,polyline_center,data[d]);
95 } 95 }
96 } 96 }
97 }); 97 });
src/main/resources/static/pages/excep/js/map.js 0 → 100644
  1 +/**
  2 + * 百度地图
  3 + *
  4 + * - - - - - -》init:地图初始化
  5 + *
  6 + * - - - - - -》getDistanceAndDuration:获取距离与时间
  7 + *
  8 + * - - - - - -》drawingUpline:在地图上画出上行线路走向
  9 + *
  10 + * - - - - - -》stationsPointsToLibraryPoint:根据站点坐标匹配库中的公交站点(手动规划)
  11 + */
  12 +
  13 +var BasicMap = function () {
  14 +
  15 + /** BasicMap 全局变量定义 mapBValue:地图对象;polyUpline:走向折线;sectionList:截取过的路段 ;pointIndex:计算路段被切的次数;
  16 + * firstPoint:截取路段的第一个点;iseditStatus:路段是否在编辑状态;isCutSection : 获取路段是否在截取状态*/
  17 + var mapBValue = '', polyUpline='', sectionList = [], pointIndex = 0, iseditStatus = false, firstPoint = {}, isCutSection = false;
  18 +
  19 + var Bmap = {
  20 +
  21 + init : function() {
  22 +
  23 + // 设置中心点,
  24 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  25 +
  26 + // 百度API Key
  27 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  28 +
  29 + // 初始化百度地图
  30 + mapBValue = new BMap.Map("BasicMap");
  31 +
  32 + //中心点和缩放级别
  33 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat),15);
  34 +
  35 + //启用地图拖拽事件,默认启用(可不写)
  36 + mapBValue.enableDragging();
  37 +
  38 + //启用地图滚轮放大缩小
  39 + mapBValue.enableScrollWheelZoom();
  40 +
  41 + //禁用鼠标双击放大
  42 + mapBValue.disableDoubleClickZoom();
  43 +
  44 + //启用键盘上下左右键移动地图
  45 + mapBValue.enableKeyboard();
  46 +
  47 + return mapBValue;
  48 + },
  49 + /** 获取第一个切路段的点 @return Point*/
  50 + getFirstPoint : function() {
  51 + return firstPoint;
  52 + },
  53 + /** 获取地图对象 @return 地图对象map */
  54 + getmapBValue : function() {
  55 +
  56 + return mapBValue;
  57 +
  58 + },
  59 +
  60 + getPolyUpline : function() {
  61 +
  62 + return polyUpline;
  63 + },
  64 +
  65 + /** 获取截取过的路段 @return 路段对象List */
  66 + getSectionList : function() {
  67 +
  68 + return sectionList;
  69 +
  70 + },
  71 + setSectionList : function(list) {
  72 +
  73 + sectionList = list;
  74 + },
  75 + initCutSectionPoint : function() {
  76 + sectionList = [];
  77 + var tbodyHtml = template('section_list',{list : sectionList});
  78 + $('#section_table tbody').html(tbodyHtml);
  79 + },
  80 + /** 获取切路段的点下标 @return int*/
  81 + setPointIndex : function(index) {
  82 + pointIndex = index;
  83 + },
  84 + getPointIndex : function() {
  85 +
  86 + return pointIndex;
  87 +
  88 + },
  89 + /** 获取路段是否在编辑状态 @return boolean*/
  90 + getIsEditStatus : function() {
  91 + return iseditStatus;
  92 + },
  93 + setIsEditStatus : function(v) {
  94 + iseditStatus = v ;
  95 + },
  96 +
  97 + /** 获取路段是否在截取状态 @return boolean*/
  98 + getIsCutSection : function() {
  99 + return isCutSection;
  100 + },
  101 + setIsCutSection : function(v) {
  102 + isCutSection = v ;
  103 + },
  104 +
  105 + /** 获取距离与时间 @param <points:坐标点集合> */
  106 + getDistanceAndDuration : function(points,callback){
  107 +
  108 + // 获取长度
  109 + var len = points.length;
  110 + (function(){
  111 +
  112 + if (!arguments.callee.count) {
  113 +
  114 + arguments.callee.count = 0;
  115 +
  116 + }
  117 +
  118 + arguments.callee.count++;
  119 +
  120 + var index = parseInt(arguments.callee.count) - 1;
  121 +
  122 + if (index >= len-1) {
  123 +
  124 + callback && callback(points);
  125 +
  126 + return;
  127 + }
  128 +
  129 + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。)
  130 + var f = arguments.callee;
  131 + // 起点坐标 <坐标格式:40.056878,116.30815>
  132 + var origin = points[index].potion.lat + ',' + points[index].potion.lng;
  133 +
  134 + // 终点坐标 <坐标格式:40.056878,116.30815>
  135 + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng;
  136 + var region = '上海';
  137 +
  138 + var origin_region = '上海';
  139 +
  140 + var destination_region = '上海';
  141 +
  142 + var output = 'json';
  143 +
  144 + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk';
  145 +
  146 + /**
  147 + * origin:起点名称或经纬度;
  148 + *
  149 + * destination:终点名称或经纬度;
  150 + *
  151 + * origin_region:起始点所在城市,驾车导航时必填。
  152 + *
  153 + * destination_region:终点所在城市,驾车导航时必填。
  154 + *
  155 + * output :表示输出类型,可设置为xml或json,默认为xml。
  156 + *
  157 + **/
  158 + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My};
  159 +
  160 + /** @description :未认证开发者默认配额为:2000次/天。 */
  161 + $.ajax({
  162 +
  163 + // 百度地图根据坐标获取两点之间的时间与距离
  164 + url: 'http://api.map.baidu.com/direction/v1?mode=transit',
  165 +
  166 + data: paramsB,
  167 +
  168 + dataType: 'jsonp',
  169 +
  170 + success: function(r){
  171 +
  172 + if(r) {
  173 +
  174 + if(r.message=='ok') {
  175 +
  176 + if(r.result.taxi==null) {
  177 +
  178 + // 获取距离(单位:米)
  179 + points[index+1].distance = 0;
  180 +
  181 + // 获取时间(单位:秒)
  182 + points[index+1].duration = 0;
  183 +
  184 + }else {
  185 +
  186 + // 获取距离(单位:米)
  187 + points[index+1].distance = r.result.taxi.distance;
  188 +
  189 + // 获取时间(单位:秒)
  190 + points[index+1].duration = r.result.taxi.duration;
  191 +
  192 + }
  193 +
  194 +
  195 + }
  196 +
  197 + }
  198 +
  199 + f();
  200 + }
  201 + });
  202 +
  203 + })();
  204 +
  205 + },
  206 + // 在地图上画出上行线路走向
  207 + drawingUpline01 : function (polylineArray,polyline_center,data) {
  208 + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
  209 + // 创建线路走向
  210 + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  211 + polyUpline01.data = data;
  212 + // 把折线添加到地图上
  213 + mapBValue.addOverlay(polyUpline01);
  214 + var sectionPoint = [];
  215 + // 线路单击事件
  216 + polyUpline01.addEventListener('click',function(e) {
  217 + if(BasicMap.getIsEditStatus()) {
  218 + layer.msg('请先保存正在编辑的路段信息...');
  219 + return false;
  220 + }
  221 + if(BasicMap.getIsCutSection()) {
  222 + layer.msg('请先撤销所有切路段的点...');
  223 + return false;
  224 + }
  225 + polyUpline01.enableEditing();
  226 + BasicMap.setIsEditStatus(true);
  227 + });
  228 +
  229 + // 添加路段双击事件
  230 + polyUpline01.addEventListener("dblclick",function(e){
  231 + if(BasicMap.getIsCutSection()) {
  232 + layer.msg('请先撤销所有切路段的点...');
  233 + return false;
  234 + }
  235 + BasicMap.setIsEditStatus(false);
  236 + // 关闭
  237 + layer.closeAll();
  238 + polyUpline01.disableEditing();
  239 + EditSectionObj.setEitdSection(polyUpline01.data);
  240 + // 获取折线坐标集合
  241 + var editPloyLineArray = polyUpline01.getPath();
  242 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
  243 + sectionList = [];
  244 + var tbodyHtml = template('section_list',{list : sectionList});
  245 + // 截取路段
  246 + $('#section_table tbody').html(tbodyHtml);
  247 + // 加载修改路段弹出层mobal页面
  248 + $.get('editsection.html', function(m){
  249 + $(pjaxContainer).append(m);
  250 + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [BasicMap,GetAjaxData,EditSectionObj,PublicFunctions]);
  251 + });
  252 + });
  253 +
  254 + // 路段右击事件
  255 + var editSection = function(e,ee,marker){
  256 + if(BasicMap.getIsEditStatus()) {
  257 + layer.msg('请先保存正在编辑的路段信息...');
  258 + return false;
  259 + }
  260 + var lng = e.lng;
  261 + var lat = e.lat;
  262 + var sectionName = null;
  263 + var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点
  264 + marker.isFlag = true;
  265 + if(pointIndex == 0) {
  266 + sectionPoint[pointIndex] = {lng:lng , lat:lat};
  267 + layer.msg('进入切路段状态,请选择本路段的终点!');
  268 + mapBValue.addOverlay(marker);// 添加覆盖物
  269 + firstPoint = {lng:lng, lat:lat};
  270 + pointIndex++;
  271 + EditSectionObj.setEitdSection(polyUpline01.data);
  272 + // 获取折线坐标集合
  273 + var editPloyLineArray = polyUpline01.getPath();
  274 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
  275 + } else if (pointIndex > 0) {
  276 + layer.prompt({title: '请输入路段名!'}, function(sectionName, index){
  277 + pointList = [];
  278 + sectionPoint[pointIndex] = {lng:lng , lat:lat};
  279 + pointList[0] = sectionPoint[pointIndex-1];
  280 + pointList[1] = sectionPoint[pointIndex];
  281 + sectionList.push({name:sectionName, section:pointList});
  282 + layer.close(index);
  283 + layer.msg('路段截取成功,请选择下一个路段的终点');
  284 + mapBValue.addOverlay(marker);// 添加覆盖物
  285 + var tbodyHtml = template('section_list',{list : sectionList});
  286 + // 截取路段
  287 + $('#section_table tbody').html(tbodyHtml);
  288 + pointIndex++;
  289 + });
  290 + }
  291 + BasicMap.setIsCutSection(true);
  292 + }
  293 + var markerMenu=new BMap.ContextMenu();
  294 + markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01)));
  295 + polyUpline01.addContextMenu(markerMenu);
  296 +
  297 +
  298 + var PanOptions_ ={noAnimation :true};
  299 + mapBValue.reset();
  300 + mapBValue.panTo(polyline_center,PanOptions_);
  301 + mapBValue.panBy(500,-510,PanOptions_);
  302 + mapBValue.setZoom(14);
  303 + },
  304 + // 删除点刷新cutSectionTable
  305 + refreshCutSectionTable : function() {
  306 + var tbodyHtml = template('section_list',{list : sectionList});
  307 + $('#section_table tbody').html(tbodyHtml);
  308 + },
  309 + // 删除点刷新覆盖物
  310 + deleteCutSectionPoint : function(point) {
  311 + var lng = point.lng;
  312 + var lat = point.lat;
  313 + var allOverlay = mapBValue.getOverlays();
  314 + // 删除最后一个点
  315 + for (var i = 0; i < allOverlay.length -1; i++){
  316 + if(allOverlay[i].isFlag) {
  317 + if(allOverlay[i].point.lng == lng && allOverlay[i].point.lat == lat){
  318 + mapBValue.removeOverlay(allOverlay[i]);
  319 + break;
  320 + }
  321 + }
  322 + }
  323 + },
  324 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  325 + drawingUpStationPoint : function(point_center,stationName,s) {
  326 +
  327 + // 自定义标注物图片
  328 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10));
  329 +
  330 + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">'
  331 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  332 + + '</div>'
  333 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>';
  334 +
  335 +
  336 + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{
  337 + "anchor" : new BMap.Size(-10,8),
  338 + "enableDragging" : true});
  339 +
  340 +
  341 + myRichMarker1.disableDragging();
  342 + mapBValue.addOverlay(myRichMarker1);
  343 +
  344 +
  345 + // 创建标注物
  346 + marker = new BMap.Marker(point_center,{icon : icon_target});
  347 +
  348 + // 允许覆盖物在map.clearOverlays方法中被清除。
  349 + marker.enableMassClear();
  350 +
  351 + mapBValue.addOverlay(marker);
  352 + },
  353 +
  354 + // 根据站点坐标匹配库中的公交站点(手动规划)
  355 + stationsPointsToLibraryPoint : function(arra,callback) {
  356 + // 获取长度
  357 + var len = arra.length;
  358 + var station = {};
  359 + var stationList = [];
  360 + (function(){
  361 + if (!arguments.callee.count) {
  362 + arguments.callee.count = 0;
  363 + }
  364 + arguments.callee.count++;
  365 + var index = parseInt(arguments.callee.count) - 1;
  366 + if (index >= len) {
  367 + callback && callback(stationList);
  368 + return ;
  369 + }
  370 + var f = arguments.callee;
  371 + station = arra[index];
  372 + if(arra[index].name!=''){
  373 +
  374 + $.get('/station/matchStation',station,function(resultStation) {
  375 + stationList.push({name:resultStation.name ,wgs:arra[index].wgs,potion:{lng:resultStation.potion_lng, lat:resultStation.potion_lat}, isHave:resultStation.isHave , id:resultStation.id});
  376 + f();
  377 + });
  378 + }else {
  379 + f();
  380 + }
  381 + })()
  382 + },
  383 + clearMarkAndOverlays : function() {
  384 +
  385 + // 清楚地图覆盖物
  386 + mapBValue.clearOverlays();
  387 +
  388 + mapBValue.removeOverlay();
  389 +
  390 + }
  391 +
  392 + }
  393 +
  394 + return Bmap;
  395 +
  396 +}();
0 \ No newline at end of file 397 \ No newline at end of file
src/main/resources/static/pages/excep/mhspeedingList.html
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" 128 data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}"
129 data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" 129 data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}"
130 data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}"> 130 data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}">
131 - 查看轨迹 131 + 轨迹回放
132 </a> 132 </a>
133 </td> 133 </td>
134 <td> 134 <td>
@@ -270,7 +270,6 @@ $(function(){ @@ -270,7 +270,6 @@ $(function(){
270 index++; 270 index++;
271 }); 271 });
272 })(); 272 })();
273 - console.log(listResult);  
274 }); 273 });
275 } 274 }
276 275
src/main/resources/static/pages/excep/outBoundMap.html deleted 100644 → 0
1 -<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" />  
2 -<div class="portlet-body">  
3 - <!-- 地图 -->  
4 - <div id="bmap_basic" class="bmaps"></div>  
5 -</div>  
6 -<!-- load事件 -->  
7 -<script src="/pages/excep/js/outboundmap-load.js"></script>  
8 -<!-- 线路类 -->  
9 -<script src="/pages/excep/js/outboundline.js"></script>  
10 -<!-- 绘图类 -->  
11 -<script src="/pages/base/stationroute/js/drawingManager.js"></script>  
12 -<!-- 地图类 -->  
13 -<script src="/pages/excep/js/outbound-map.js"></script>  
14 -<!-- 函数与方法 -->  
15 -<script src="/pages/excep/js/outboundmap-function.js"></script>  
16 -<!-- ajax请求类 -->  
17 -<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>  
18 -  
src/main/resources/static/pages/excep/outboundMap.html 0 → 100644
  1 +<style>
  2 + .play_back-layer .layui-layer-title{
  3 + height: 36px;
  4 + border-bottom: none;
  5 + }
  6 +</style>
  7 +
  8 +<div id="titleMap">
  9 +<button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button>
  10 +</div>
  11 +<div id="BasicMap">
  12 +</div>
  13 +<style type="text/css">
  14 +
  15 +#BasicMap{
  16 + width: 100%;
  17 + border: 2px solid #fdfdfd;
  18 + height: calc(100% - 30px);
  19 + overflow: hidden;
  20 +}
  21 +</style>
  22 +<script type="text/javascript" src="/pages/excep/js/map.js"></script>
  23 +<script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script>
  24 +
  25 +<script type="text/javascript">
  26 +$(function(){
  27 + var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间
  28 + localStorage.clear();//清楚前端缓存
  29 + var vehicle = dataArr[0];
  30 + var startdate = dataArr[1];
  31 + var enddate = dataArr[2];
  32 + var lon = dataArr[3];//起点经度
  33 + var lat = dataArr[4];//起点纬度
  34 + var endLon = dataArr[5];//终点经度
  35 + var endLat = dataArr[6];//终点纬度
  36 + var lineid = dataArr[7];
  37 + var directionData = dataArr[8];
  38 + var pointObj;//坐标和速度组成的对象
  39 + var Points = [];//坐标和速度对象的集合
  40 + var coordinateArr = [];//坐标点数组
  41 + $.ajax({
  42 + type: "GET",
  43 + async:false,
  44 + url: '/nowbound/findPosition',
  45 + data: {vehicle:vehicle,startdate:startdate,enddate:enddate},
  46 + success: function(data){
  47 + $.each(data,function(i,item){
  48 + if(item.lon>1 && item.lat>1){
  49 + pointObj = new Object();
  50 + pointObj.coordinate = new BMap.Point(item.lon,item.lat);
  51 + pointObj.vehicle = item.vehicle;
  52 + Points.push(pointObj);
  53 + }
  54 + });
  55 + }
  56 + });
  57 + setTimeout(function(){
  58 + var map = BasicMap.init();//创建地图
  59 + $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) {
  60 + // 在地图上画出线路走向
  61 + PublicFunctions.linePanlThree(lineid,data,directionData);
  62 + });
  63 + var myP1 = new BMap.Point(lon,lat); //起点
  64 + var myP2 = new BMap.Point(endLon,endLat); //终点
  65 + for(i in Points){
  66 + coordinateArr.push(Points[i].coordinate);
  67 + }
  68 + var polyline = new BMap.Polyline(coordinateArr, {strokeColor:"red", strokeWeight:5, strokeOpacity:0.5});//创建折线
  69 + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片
  70 + imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。
  71 + });
  72 +
  73 + var carMk;
  74 + $(document).on('click', '#run', function() {
  75 + map.centerAndZoom(new BMap.Point(lon,lat),16);//地图中心点坐标 */
  76 + if(typeof(carMk)!="undefined"){
  77 + map.removeOverlay(carMk);//清空上一次的轨迹
  78 + }
  79 + carMk = new BMap.Marker(coordinateArr[0],{icon:myIcon});
  80 + map.addOverlay(polyline);//增加折线
  81 + var paths = coordinateArr.length;//获得有几个点
  82 + map.addOverlay(carMk);
  83 + i=0;
  84 + setTimeout(function(){
  85 + resetMkPoint(0);
  86 + },500);
  87 + function resetMkPoint(i){
  88 + carMk.setPosition(coordinateArr[i]);
  89 + if(i < paths-1){
  90 + setTimeout(function(){
  91 + i++;
  92 + resetMkPoint(i);
  93 + },500);
  94 + }
  95 + };
  96 +
  97 + });
  98 + }, 500);
  99 + });
  100 +</script>
  101 +
  102 +
src/main/resources/static/pages/excep/pdboundList.html
@@ -56,26 +56,21 @@ @@ -56,26 +56,21 @@
56 <th width="3%">#</th> 56 <th width="3%">#</th>
57 <th width="15%">线路</th> 57 <th width="15%">线路</th>
58 <th width="13%">车辆自编号</th> 58 <th width="13%">车辆自编号</th>
59 - <th width="100">车辆坐标</th>  
60 - <th width="11%">路牌名</th>  
61 <th width="10%">上下行</th> 59 <th width="10%">上下行</th>
62 - <th width="18%">时间</th> 60 + <th width="10%">越界位置</th>
  61 + <th width="18%">越界开始时间</th>
  62 + <th width="100">查看轨迹</th>
63 <th width="18%">操作</th> 63 <th width="18%">操作</th>
64 </tr> 64 </tr>
65 <tr role="row" class="filter"> 65 <tr role="row" class="filter">
66 <td></td> 66 <td></td>
67 <td> 67 <td>
68 -<!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> -->  
69 <select class="form-control" name="line" id="line" style="width: 150px;"></select> 68 <select class="form-control" name="line" id="line" style="width: 150px;"></select>
70 </td> 69 </td>
71 <td> 70 <td>
72 -<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> -->  
73 <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> 71 <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select>
74 </td> 72 </td>
75 <td> 73 <td>
76 - </td>  
77 - <td></td>  
78 - <td>  
79 <select class="form-control form-filter " name="updown"> 74 <select class="form-control form-filter " name="updown">
80 <option value="">请选择...</option> 75 <option value="">请选择...</option>
81 <option value="0">上行</option> 76 <option value="0">上行</option>
@@ -84,8 +79,11 @@ @@ -84,8 +79,11 @@
84 </select> 79 </select>
85 </td> 80 </td>
86 <td> 81 <td>
  82 + </td>
  83 + <td>
87 <input class="form-control" type="date" name="date" /> 84 <input class="form-control" type="date" name="date" />
88 </td> 85 </td>
  86 + <td></td>
89 <td> 87 <td>
90 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 88 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
91 <i class="fa fa-search"></i> 搜索</button> 89 <i class="fa fa-search"></i> 搜索</button>
@@ -119,15 +117,6 @@ @@ -119,15 +117,6 @@
119 {{obj.vehicle}} 117 {{obj.vehicle}}
120 </td> 118 </td>
121 <td> 119 <td>
122 - <a href="/pages/excep/outBoundMap.html?no={{obj.line}},{{obj.upDown}},{{obj.lon}},{{obj.lat}}"  
123 - class="btn default blue-stripe btn-sm" data-pjax>  
124 - 查看车辆位置  
125 - </a>  
126 - </td>  
127 - <td>  
128 - {{obj.lpname}}  
129 - </td>  
130 - <td>  
131 {{if obj.upDown==0}} 120 {{if obj.upDown==0}}
132 上行 121 上行
133 {{else if obj.upDown==1}} 122 {{else if obj.upDown==1}}
@@ -137,9 +126,20 @@ @@ -137,9 +126,20 @@
137 {{/if}} 126 {{/if}}
138 </td> 127 </td>
139 <td> 128 <td>
  129 + {{obj.address}}
  130 + </td>
  131 + <td>
140 {{obj.timestampDate}} 132 {{obj.timestampDate}}
141 </td> 133 </td>
142 <td> 134 <td>
  135 + <a class="btn default blue-stripe btn-sm lookTrajectory" data-vehicle ="{{obj.vehicle}}"
  136 + data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}"
  137 + data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}"
  138 + data-endlat="{{obj.endlat}}" data-lineid="{{obj.line}}" data-updown="{{obj.upDown}}">
  139 + 轨迹回放
  140 + </a>
  141 + </td>
  142 + <td>
143 143
144 </td> 144 </td>
145 </tr> 145 </tr>
@@ -170,7 +170,6 @@ $(function(){ @@ -170,7 +170,6 @@ $(function(){
170 jsDoQuery(parameter,true); 170 jsDoQuery(parameter,true);
171 //重置 171 //重置
172 $('tr.filter .filter-cancel').on('click', function(){ 172 $('tr.filter .filter-cancel').on('click', function(){
173 - debugger;  
174 $('tr.filter input, select').val('').change(); 173 $('tr.filter input, select').val('').change();
175 jsDoQuery(null, true); 174 jsDoQuery(null, true);
176 }); 175 });
@@ -205,19 +204,55 @@ $(function(){ @@ -205,19 +204,55 @@ $(function(){
205 params['page'] = page; 204 params['page'] = page;
206 var i = layer.load(2); 205 var i = layer.load(2);
207 $get('/nowbound/pagequery' ,params, function(data){ 206 $get('/nowbound/pagequery' ,params, function(data){
208 -// $.each(data.content, function(i, obj) {  
209 -// obj.lastLoginDate = moment(obj.lastLoginDate).format("YYYY-MM-DD HH:mm:ss");  
210 -// });  
211 - var bodyHtm = template('bound_list_temp', {list: data.dataList});  
212 - $('#datatable_bound tbody').html(bodyHtm)  
213 - .find('.icheck').iCheck(icheckOptions)  
214 - .on('ifChanged', iCheckChange);  
215 - if(pagination && data.dataList.length > 0){  
216 - //重新分页  
217 - initPagination = true;  
218 - showPagination(data);  
219 - }  
220 - layer.close(i); 207 + var listResult = data.dataList;
  208 + var index=0;
  209 + (function(){
  210 + var f = arguments.callee;
  211 + if(index >= listResult.length){
  212 + var bodyHtm = template('bound_list_temp', {list:listResult});
  213 + $('#datatable_bound tbody').html(bodyHtm).find('.icheck').iCheck(icheckOptions).on('ifChanged', iCheckChange);
  214 + if(pagination && data.dataList.length > 0){
  215 + //重新分页
  216 + initPagination = true;
  217 + showPagination(data);
  218 + }
  219 + layer.close(i);
  220 + $(".lookTrajectory").click(function(){
  221 + var vehicle = $(this).data('vehicle');
  222 + var startDate = $(this).data('startdate');
  223 + var endDate = $(this).data('enddate');
  224 + var lon = $(this).data('lon');
  225 + var lat = $(this).data('lat');
  226 + var endLon = $(this).data('endlon');
  227 + var endLat = $(this).data('endlat');
  228 + var lineid = $(this).data('lineid');
  229 + var upDown = $(this).data('updown');
  230 + var storage = window.localStorage;
  231 + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown);
  232 + $.get('/pages/excep/outboundMap.html?',function (result) {
  233 + layer.open({
  234 + type: 1,
  235 + title:'<i class="uk-icon-play-circle"></i>轨迹回放',
  236 + shadeClose: true,
  237 + shade: true,
  238 + scrollbar: false,
  239 + maxmin: false, //开启最大化最小化按钮
  240 + area: ['100%', '100%'],
  241 + content:result,//内容
  242 + });
  243 + });
  244 + })
  245 + return;
  246 + }
  247 + var result = listResult[index];
  248 + new BMap.Geocoder().getLocation(new BMap.Point(result.lon,result.lat), function(rs){
  249 + var addComp = rs.addressComponents;
  250 + result.address = addComp.district+addComp.street+addComp.streetNumber;
  251 + f();
  252 + index++;
  253 + });
  254 + })();
  255 +
221 }); 256 });
222 } 257 }
223 258
@@ -345,7 +380,6 @@ $(&#39;#nbbm&#39;).select2({ @@ -345,7 +380,6 @@ $(&#39;#nbbm&#39;).select2({
345 380
346 //改变状态 381 //改变状态
347 function changeEnabled(id,enabled){ 382 function changeEnabled(id,enabled){
348 - debugger  
349 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ 383 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
350 jsDoQuery(null, true); 384 jsDoQuery(null, true);
351 }) 385 })
src/main/resources/static/pages/excep/speedingCount.html
@@ -142,8 +142,6 @@ @@ -142,8 +142,6 @@
142 {{/if}} 142 {{/if}}
143 </script> 143 </script>
144 144
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 145 <script>
148 $(function(){ 146 $(function(){
149 var page = 0, initPagination; 147 var page = 0, initPagination;
src/main/resources/static/pages/excep/speedingList.html
@@ -142,8 +142,6 @@ @@ -142,8 +142,6 @@
142 {{/if}} 142 {{/if}}
143 </script> 143 </script>
144 144
145 -<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>  
146 -  
147 <script> 145 <script>
148 $(function(){ 146 $(function(){
149 var page = 0, initPagination; 147 var page = 0, initPagination;
src/main/resources/static/pages/excep/speedingMap.html
@@ -8,23 +8,24 @@ @@ -8,23 +8,24 @@
8 <div id="titleMap"> 8 <div id="titleMap">
9 <button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button> 9 <button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button>
10 </div> 10 </div>
11 -<div id="speedingMap"> 11 +<div id="BasicMap">
12 </div> 12 </div>
13 <style type="text/css"> 13 <style type="text/css">
14 14
15 -#speedingMap{ 15 +#BasicMap{
16 width: 100%; 16 width: 100%;
17 border: 2px solid #fdfdfd; 17 border: 2px solid #fdfdfd;
18 height: calc(100% - 30px); 18 height: calc(100% - 30px);
19 overflow: hidden; 19 overflow: hidden;
20 } 20 }
21 </style> 21 </style>
22 -<script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script> 22 +<script type="text/javascript" src="/pages/excep/js/map.js"></script>
23 <script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script> 23 <script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script>
24 24
25 <script type="text/javascript"> 25 <script type="text/javascript">
26 $(function(){ 26 $(function(){
27 var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间 27 var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间
  28 + localStorage.clear();//清楚前端缓存
28 var vehicle = dataArr[0]; 29 var vehicle = dataArr[0];
29 var startdate = dataArr[1]; 30 var startdate = dataArr[1];
30 var enddate = dataArr[2]; 31 var enddate = dataArr[2];
@@ -55,16 +56,14 @@ $(function(){ @@ -55,16 +56,14 @@ $(function(){
55 } 56 }
56 }); 57 });
57 setTimeout(function(){ 58 setTimeout(function(){
58 - var map = SpeedingMap.init();//创建地图 59 + var map = BasicMap.init();//创建地图
  60 + debugger;
59 $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) { 61 $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) {
60 // 在地图上画出线路走向 62 // 在地图上画出线路走向
61 PublicFunctions.linePanlThree(lineid,data,directionData); 63 PublicFunctions.linePanlThree(lineid,data,directionData);
62 }); 64 });
63 var myP1 = new BMap.Point(lon,lat); //起点 65 var myP1 = new BMap.Point(lon,lat); //起点
64 var myP2 = new BMap.Point(endLon,endLat); //终点 66 var myP2 = new BMap.Point(endLon,endLat); //终点
65 -/* var centerLon = (parseFloat(lon)+parseFloat(endLon))/2;  
66 - var centerLat = (parseFloat(lat)+parseFloat(endLat))/2;  
67 - map.centerAndZoom(new BMap.Point(centerLon,centerLat),18);//地图中心点坐标 */  
68 for(i in Points){ 67 for(i in Points){
69 coordinateArr.push(Points[i].coordinate); 68 coordinateArr.push(Points[i].coordinate);
70 } 69 }
src/main/resources/static/pages/oil/jyglList.html
@@ -58,15 +58,15 @@ @@ -58,15 +58,15 @@
58 <tr role="row" class="heading"> 58 <tr role="row" class="heading">
59 <th width="2%">#</th> 59 <th width="2%">#</th>
60 <th width="10%">日期</th> 60 <th width="10%">日期</th>
61 - <th width="10%">公司</th>  
62 - <th width="10%">分公司</th> 61 + <th width="8%">公司</th>
  62 + <th width="8%">分公司</th>
  63 + <th width="8%">线路</th>
63 <th width="8%">车辆</th> 64 <th width="8%">车辆</th>
64 <th width="14%">驾驶员</th> 65 <th width="14%">驾驶员</th>
65 <th width="5%">加注量</th> 66 <th width="5%">加注量</th>
66 <th width="4%">加油站</th> 67 <th width="4%">加油站</th>
67 <th width="3%">加油类型</th> 68 <th width="3%">加油类型</th>
68 <th width="5%">加油工工号</th> 69 <th width="5%">加油工工号</th>
69 - <th width="3%">油价</th>  
70 <th width="4%">路单工号</th> 70 <th width="4%">路单工号</th>
71 <th width="4%">备注</th> 71 <th width="4%">备注</th>
72 <th width="10%">操作</th> 72 <th width="10%">操作</th>
@@ -83,6 +83,9 @@ @@ -83,6 +83,9 @@
83 <select class="form-control" name="fgsdm_like" id="jyglListFgsdmId" ></select> 83 <select class="form-control" name="fgsdm_like" id="jyglListFgsdmId" ></select>
84 </td> 84 </td>
85 <td> 85 <td>
  86 + <select class="form-control" name="line_like" id="line" style="width: 120px;"></select>
  87 + </td>
  88 + <td>
86 <input type="text" class="form-control form-filter input-sm" name="nbbh" id="nbbh"> 89 <input type="text" class="form-control form-filter input-sm" name="nbbh" id="nbbh">
87 </td> 90 </td>
88 <td></td> 91 <td></td>
@@ -92,7 +95,6 @@ @@ -92,7 +95,6 @@
92 <td></td> 95 <td></td>
93 <td></td> 96 <td></td>
94 <td></td> 97 <td></td>
95 - <td></td>  
96 <td> 98 <td>
97 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 99 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
98 <i class="fa fa-search"></i> 搜索</button> 100 <i class="fa fa-search"></i> 搜索</button>
@@ -124,6 +126,7 @@ @@ -124,6 +126,7 @@
124 <td> 126 <td>
125 {{obj.fgsname}} 127 {{obj.fgsname}}
126 </td> 128 </td>
  129 + <td>{{obj.linename}}</td>
127 <td> 130 <td>
128 {{obj.nbbm}} 131 {{obj.nbbm}}
129 </td> 132 </td>
@@ -153,7 +156,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep @@ -153,7 +156,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
153 <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jyggh" 156 <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jyggh"
154 type="text" value="{{obj.jyggh}}" style=" width:45px" /> 157 type="text" value="{{obj.jyggh}}" style=" width:45px" />
155 </td> 158 </td>
156 - <td></td> 159 +
157 <td>{{obj.ldgh}}</td> 160 <td>{{obj.ldgh}}</td>
158 <td> 161 <td>
159 <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_bz" 162 <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_bz"
@@ -234,6 +237,27 @@ $(function(){ @@ -234,6 +237,27 @@ $(function(){
234 }); 237 });
235 238
236 239
  240 +
  241 + $.get('/report/lineList',function(xlList){
  242 + var data = [];
  243 + data.push({id: " ", text: "全部线路"});
  244 + $.get('/user/companyData', function(result){
  245 + for(var i = 0; i < result.length; i++){
  246 + var companyCode = result[i].companyCode;
  247 + var children = result[i].children;
  248 + for(var j = 0; j < children.length; j++){
  249 + var code = children[j].code;
  250 + for(var k=0;k < xlList.length;k++ ){
  251 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  252 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  253 + }
  254 + }
  255 + }
  256 + }
  257 + initPinYinSelect2('#line',data,'');
  258 +
  259 + });
  260 + });
237 // var gsqx=""; 261 // var gsqx="";
238 // var fgsqx=""; 262 // var fgsqx="";
239 263
src/main/resources/static/pages/oil/jyszAdd.html
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <label class="col-md-3 control-label">内部编码</label> 33 <label class="col-md-3 control-label">内部编码</label>
34 <div class="col-md-9"> 34 <div class="col-md-9">
35 <!-- <select class="form-control input-medium " name="nbbm" id="nbbm" ></select> --> 35 <!-- <select class="form-control input-medium " name="nbbm" id="nbbm" ></select> -->
36 - <input type="text" class="form-control input-medium" name="nbbm" > 36 + <input type="text" class="form-control" name="nbbm" style="width: 180px">
37 </div> 37 </div>
38 </div> 38 </div>
39 </div> 39 </div>
@@ -87,6 +87,8 @@ $(function(){ @@ -87,6 +87,8 @@ $(function(){
87 $('#fgsdm').html(options); 87 $('#fgsdm').html(options);
88 } 88 }
89 89
  90 +
  91 +
90 //提交 92 //提交
91 $('#addJyszModuleButton').on('click', function() { 93 $('#addJyszModuleButton').on('click', function() {
92 form.submit(); 94 form.submit();
@@ -98,7 +100,7 @@ $(function(){ @@ -98,7 +100,7 @@ $(function(){
98 focusInvalid : false, 100 focusInvalid : false,
99 rules : { 101 rules : {
100 nbbm : { 102 nbbm : {
101 - minlength : 2, 103 + minlength : 4,
102 required : true, 104 required : true,
103 maxlength : 10 105 maxlength : 10
104 } 106 }
@@ -125,7 +127,7 @@ $(function(){ @@ -125,7 +127,7 @@ $(function(){
125 error.hide(); 127 error.hide();
126 $get('/cwjy/checkNbbm',params,function(result){ 128 $get('/cwjy/checkNbbm',params,function(result){
127 if(result>0){ 129 if(result>0){
128 - layer.msg('该车辆已经添加.'); 130 + layer.msg('分公司该车辆已经添加.');
129 }else{ 131 }else{
130 $post('/cwjy', params, function(result){ 132 $post('/cwjy', params, function(result){
131 layer.msg('新增加油设置成功.'); 133 layer.msg('新增加油设置成功.');
src/main/resources/static/pages/oil/jyszList.html
@@ -21,8 +21,9 @@ @@ -21,8 +21,9 @@
21 </div> 21 </div>
22 <div class="actions"> 22 <div class="actions">
23 <!-- <a class="btn btn-circle blue" href="jyszAdd.html" data-pjax><i class="fa fa-plus"></i> 添加</a> --> 23 <!-- <a class="btn btn-circle blue" href="jyszAdd.html" data-pjax><i class="fa fa-plus"></i> 添加</a> -->
24 - <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-trash"></i> 添加</button>  
25 -<!-- <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> --> 24 + <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-plus"></i> 添加</button>
  25 +<!--
  26 + <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> -->
26 27
27 <!-- <div class="btn-group"> 28 <!-- <div class="btn-group">
28 <a class="btn red btn-outline btn-circle" href="javascript:;" 29 <a class="btn red btn-outline btn-circle" href="javascript:;"
@@ -60,8 +61,9 @@ @@ -60,8 +61,9 @@
60 <th width="15%">公司</th> 61 <th width="15%">公司</th>
61 <th width="13%">分公司</th> 62 <th width="13%">分公司</th>
62 <th width="10%">车辆</th> 63 <th width="10%">车辆</th>
  64 + <th width="10%">线路</th>
63 <th width="10%">修改人</th> 65 <th width="10%">修改人</th>
64 - <th width="20%">日期</th> 66 + <th width="10%">日期</th>
65 <th width="19%">操作</th> 67 <th width="19%">操作</th>
66 </tr> 68 </tr>
67 <tr role="row" class="filter"> 69 <tr role="row" class="filter">
@@ -77,6 +79,8 @@ @@ -77,6 +79,8 @@
77 </td> 79 </td>
78 <td> 80 <td>
79 </td> 81 </td>
  82 + <td>
  83 + </td>
80 <td></td> 84 <td></td>
81 <td> 85 <td>
82 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > 86 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
@@ -107,6 +111,7 @@ @@ -107,6 +111,7 @@
107 <td>{{obj.gsname}}</td> 111 <td>{{obj.gsname}}</td>
108 <td>{{obj.fgsname}}</td> 112 <td>{{obj.fgsname}}</td>
109 <td>{{obj.nbbm}}</td> 113 <td>{{obj.nbbm}}</td>
  114 + <td>{{obj.linename}}</td>
110 <td>{{obj.xgr}}</td> 115 <td>{{obj.xgr}}</td>
111 <td>{{obj.createDate}}</td> 116 <td>{{obj.createDate}}</td>
112 <td> 117 <td>
@@ -236,6 +241,7 @@ $(function(){ @@ -236,6 +241,7 @@ $(function(){
236 $.each(data.content, function(i, obj) { 241 $.each(data.content, function(i, obj) {
237 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); 242 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD");
238 }); 243 });
  244 + console.log(data.content);
239 var bodyHtm = template('jysz_list_temp', {list: data.content}); 245 var bodyHtm = template('jysz_list_temp', {list: data.content});
240 246
241 $('#datatable_jysz tbody').html(bodyHtm) 247 $('#datatable_jysz tbody').html(bodyHtm)
@@ -288,7 +294,7 @@ $(function(){ @@ -288,7 +294,7 @@ $(function(){
288 for(var j = 0, item; item = items[j++];){ 294 for(var j = 0, item; item = items[j++];){
289 name = $(item).attr('name'); 295 name = $(item).attr('name');
290 if(name){ 296 if(name){
291 - params[name] = $(item).val(); 297 + params[name] = $(item).val().replace(/(^\s*)|(\s*$)/g, "");
292 } 298 }
293 } 299 }
294 }); 300 });
@@ -315,7 +321,6 @@ $(function(){ @@ -315,7 +321,6 @@ $(function(){
315 $.get('jyszAdd.html', function(m){$(pjaxContainer).append(m);}); 321 $.get('jyszAdd.html', function(m){$(pjaxContainer).append(m);});
316 }); 322 });
317 323
318 -  
319 }); 324 });
320 325
321 326
src/main/resources/static/pages/permission/authorize_all/user_auth.html
@@ -141,7 +141,8 @@ @@ -141,7 +141,8 @@
141 '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)', 141 '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)',
142 '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)', 142 '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)',
143 '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_6': '南汇公司(航头枢纽站)', 143 '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_6': '南汇公司(航头枢纽站)',
144 - '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)' 144 + '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)',
  145 + '77_78': '闵行公司', '99_100': '青浦公交'
145 }; 146 };
146 147
147 var defauleConfig; 148 var defauleConfig;
src/main/resources/static/pages/summary/work_hours/list.html
@@ -263,8 +263,8 @@ @@ -263,8 +263,8 @@
263 } 263 }
264 264
265 //日期选择器 265 //日期选择器
266 - $('[name=rq_eq]', f).val('2017-07-31');  
267 - flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-07-31', minDate: '2017-07-01'}); 266 + $('[name=rq_eq]', f).val('2017-08-03');
  267 + flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-08-03', minDate: '2017-07-01'});
268 268
269 var comps; 269 var comps;
270 //构建公司级联下拉框 270 //构建公司级联下拉框
src/main/resources/static/real_control_v2/css/ct_table.css
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 .ct_table>.ct_table_body { 33 .ct_table>.ct_table_body {
34 width: 100%; 34 width: 100%;
35 border-bottom: 1px solid #dedede; 35 border-bottom: 1px solid #dedede;
36 - color: #000; 36 + /*color: #000;*/
37 } 37 }
38 38
39 .ct_table dl { 39 .ct_table dl {
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -771,27 +771,30 @@ input.i-cbox[type=checkbox]{ @@ -771,27 +771,30 @@ input.i-cbox[type=checkbox]{
771 771
772 772
773 .sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) { 773 .sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) {
774 - width: 30%; 774 + width: 25%;
775 } 775 }
776 .sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) { 776 .sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) {
777 - width: 25%; 777 + width: 18%;
778 } 778 }
779 .sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) { 779 .sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) {
780 - width: 25%; 780 + width: 21%;
781 } 781 }
782 .sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) { 782 .sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) {
783 - width: 20%; 783 + width: 21%;
  784 +}
  785 +.sch-tzrc-table dl dt:nth-of-type(5), .sch-tzrc-table dl dd:nth-of-type(5) {
  786 + width: 15%;
784 } 787 }
785 788
786 .ct-form-modal .uk-autocomplete{ 789 .ct-form-modal .uk-autocomplete{
787 width: 100%; 790 width: 100%;
788 } 791 }
789 792
790 -.sch-tzrc-table.ct_table dl.active, 793 +/*.sch-tzrc-table.ct_table dl.active,
791 .sch-tzrc-table.ct_table>.ct_table_body dl.active:hover, 794 .sch-tzrc-table.ct_table>.ct_table_body dl.active:hover,
792 .sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{ 795 .sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{
793 background: #e6e6e6; 796 background: #e6e6e6;
794 -} 797 +}*/
795 798
796 .search_sch_panel{ 799 .search_sch_panel{
797 float: right; 800 float: right;
src/main/resources/static/real_control_v2/css/main.css
@@ -1597,3 +1597,62 @@ ul.left_tabs_lg li{ @@ -1597,3 +1597,62 @@ ul.left_tabs_lg li{
1597 text-decoration: underline; 1597 text-decoration: underline;
1598 font-size: 13px; 1598 font-size: 13px;
1599 } 1599 }
  1600 +
  1601 +#schedule-tzrc-modal input[type=checkbox]{
  1602 + margin-right: 9px;
  1603 +}
  1604 +
  1605 +#schedule-tzrc-modal span.ct_zt_yzx{
  1606 + color: #2196F3;
  1607 + font-size: 12px;
  1608 +}
  1609 +
  1610 +#schedule-tzrc-modal span.ct_zt_lb{
  1611 + color: red;
  1612 + font-size: 12px;
  1613 +}
  1614 +
  1615 +#schedule-tzrc-modal span.ct_zt_zzzx{
  1616 + font-size: 12px;
  1617 + color: #38ad3c;
  1618 +}
  1619 +
  1620 +#schedule-tzrc-modal .tzrc_form{
  1621 + padding: 20px;
  1622 + border: 1px solid #f0eded;
  1623 + box-shadow: 0px -3px 15px rgba(0,0,0,0.08);
  1624 + background: #f9f9f9;
  1625 +}
  1626 +
  1627 +.uk-panel.ct_search_panel{
  1628 + padding: 15px;
  1629 + border: 1px solid #f0eded;
  1630 + box-shadow: 0px 3px 15px rgba(0,0,0,0.08);
  1631 + background: #f9f9f9;
  1632 +}
  1633 +
  1634 +.sch-tzrc-table.ct_table dl.active,
  1635 +.sch-tzrc-table.ct_table>.ct_table_body dl.active:hover{
  1636 + background: #5bd460;
  1637 + color: white;
  1638 +}
  1639 +
  1640 +#schedule-tzrc-modal dl.active span.ct_zt_yzx{
  1641 + color: #545252;
  1642 +}
  1643 +
  1644 +#schedule-tzrc-modal dl.active span.ct_zt_lb{
  1645 + color: #d64949;
  1646 +}
  1647 +
  1648 +#schedule-tzrc-modal dl.active span.ct_zt_zzzx{
  1649 + color: white;
  1650 +}
  1651 +
  1652 +#schedule-tzrc-modal dl.active input[type=checkbox]{
  1653 + border: 0;
  1654 +}
  1655 +
  1656 +#schedule-tzrc-modal dl.active input[type=checkbox]:before{
  1657 + color: #ffffff;
  1658 +}
1600 \ No newline at end of file 1659 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html
@@ -100,7 +100,7 @@ @@ -100,7 +100,7 @@
100 else if (sch.status == 2) { 100 else if (sch.status == 2) {
101 $f('destroy', f).parents('label').remove(); 101 $f('destroy', f).parents('label').remove();
102 $f('endDate', f).val(sch.zdsjActual); 102 $f('endDate', f).val(sch.zdsjActual);
103 - $('input,select', f).attr('disabled', 'disabled'); 103 + //$('input,select', f).attr('disabled', 'disabled');
104 } 104 }
105 } 105 }
106 106
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html
@@ -85,10 +85,13 @@ @@ -85,10 +85,13 @@
85 }); 85 });
86 86
87 87
88 - function addTaskForm() { 88 + function addTaskForm(upDownInput) {
89 var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); 89 var htmlStr = template('sub-task-v2-form-temp', {sch: sch});
90 var f = $(htmlStr); 90 var f = $(htmlStr);
91 $('.forms', wrap).append(f); 91 $('.forms', wrap).append(f);
  92 +
  93 + if(upDownInput)
  94 + f.append(upDownInput);
92 //字典转换 95 //字典转换
93 dictionaryUtils.transformDom($('.nt-dictionary', f)); 96 dictionaryUtils.transformDom($('.nt-dictionary', f));
94 97
@@ -110,8 +113,8 @@ @@ -110,8 +113,8 @@
110 function disabled_form(f) { 113 function disabled_form(f) {
111 //$('input,select',f).attr('disabled', 'disabled'); 114 //$('input,select',f).attr('disabled', 'disabled');
112 $f('type2', f).attr('disabled', 'disabled'); 115 $f('type2', f).attr('disabled', 'disabled');
113 - $f('startStation', f).attr('disabled', 'disabled');  
114 - $f('endStation', f).attr('disabled', 'disabled'); 116 + //$f('startStation', f).attr('disabled', 'disabled');
  117 + //$f('endStation', f).attr('disabled', 'disabled');
115 $f('mileageType', f).attr('disabled', 'disabled'); 118 $f('mileageType', f).attr('disabled', 'disabled');
116 $f('destroy', f).attr('disabled', 'disabled'); 119 $f('destroy', f).attr('disabled', 'disabled');
117 return f; 120 return f;
@@ -138,10 +141,12 @@ @@ -138,10 +141,12 @@
138 141
139 //烂班1 142 //烂班1
140 df1 = destroyForm(disabled_form(addTaskForm())); 143 df1 = destroyForm(disabled_form(addTaskForm()));
  144 +
  145 + var u_d_input = '<input name="upDown" type="hidden" value="'+nextSch.xlDir+'">';
141 //烂班2 146 //烂班2
142 - df2 = destroyForm(disabled_form(addTaskForm())); 147 + df2 = destroyForm(disabled_form(addTaskForm(u_d_input)));
143 //营运2 148 //营运2
144 - f2 = disabled_form(addTaskForm()); 149 + f2 = disabled_form(addTaskForm(u_d_input));
145 $('.domains', f2).empty(); 150 $('.domains', f2).empty();
146 151
147 152
@@ -149,16 +154,19 @@ @@ -149,16 +154,19 @@
149 $f('endStation', f1).val(eCode).trigger('change'); 154 $f('endStation', f1).val(eCode).trigger('change');
150 //烂班1起点 155 //烂班1起点
151 $f('startStation', df1).val(eCode).trigger('change'); 156 $f('startStation', df1).val(eCode).trigger('change');
  157 +
  158 + //nextSch
  159 + var d_code = searchParallelStation($('#turnStationSelect>option:selected', topf).text());
152 //烂班2 160 //烂班2
153 - $f('startStation', df2).val(sch.zdzCode);  
154 - $f('endStation', df2).val(eCode);  
155 - $f('mileage', df2).val($f('mileage', df1).val()).trigger('input'); 161 + $f('startStation', df2).val(nextSch.qdzCode);
  162 + $f('endStation', df2).val(d_code).trigger('change');
  163 + //$f('mileage', df2).val($f('mileage', df1).val()).trigger('input');
156 $('[sch_id_inp]', df2).val(nextSch.id); 164 $('[sch_id_inp]', df2).val(nextSch.id);
157 //营运2 165 //营运2
158 - $f('startStation', f2).val(eCode);  
159 - $f('endStation', f2).val(sch.qdzCode);  
160 - $f('startDate',f2).val($f('endDate',f1).val());  
161 - $f('mileage', f2).val($f('mileage', f1).val()).trigger('input'); 166 + $f('startStation', f2).val(d_code).trigger('change');
  167 + $f('endStation', f2).val(nextSch.zdzCode);
  168 + //$f('startDate',f2).val($f('endDate',f1).val());
  169 + //$f('mileage', f2).val($f('mileage', f1).val()).trigger('input');
162 $('[sch_id_inp]', f2).val(nextSch.id); 170 $('[sch_id_inp]', f2).val(nextSch.id);
163 171
164 //set css 172 //set css
@@ -285,6 +293,18 @@ @@ -285,6 +293,18 @@
285 }); 293 });
286 return flag; 294 return flag;
287 } 295 }
  296 +
  297 +
  298 + //返回另一个走向对应的站点
  299 + function searchParallelStation(stationName) {
  300 + var routes = stationRoutes[nextSch.xlDir]
  301 + , len = routes.length;
  302 +
  303 + for (var i = 0; i < len; i++) {
  304 + if (routes[i].stationName == stationName)
  305 + return routes[i].stationCode;
  306 + }
  307 + }
288 })(); 308 })();
289 </script> 309 </script>
290 </div> 310 </div>
291 \ No newline at end of file 311 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 <div class="uk-form-row"> 59 <div class="uk-form-row">
60 <label class="uk-form-label">起点 </label> 60 <label class="uk-form-label">起点 </label>
61 <div class="uk-form-controls"> 61 <div class="uk-form-controls">
62 - <select name="startStation" ></select> 62 + <select name="startStation" required></select>
63 </div> 63 </div>
64 </div> 64 </div>
65 </div> 65 </div>
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 <div class="uk-form-row"> 67 <div class="uk-form-row">
68 <label class="uk-form-label">终点</label> 68 <label class="uk-form-label">终点</label>
69 <div class="uk-form-controls"> 69 <div class="uk-form-controls">
70 - <select name="endStation" ></select> 70 + <select name="endStation" required></select>
71 </div> 71 </div>
72 </div> 72 </div>
73 </div> 73 </div>
@@ -300,8 +300,10 @@ @@ -300,8 +300,10 @@
300 */ 300 */
301 function reCalcInputs_type() { 301 function reCalcInputs_type() {
302 var f = $(this).parents('.sub_task_form_v2'); 302 var f = $(this).parents('.sub_task_form_v2');
303 -  
304 - var routes = stationRoutes[sch.xlDir] 303 + var upDown = sch.xlDir;
  304 + if($('[name=upDown]', f).length>0)
  305 + upDown = $('[name=upDown]', f).val();
  306 + var routes = stationRoutes[upDown]
305 , lastCode = routes[routes.length - 1].stationCode 307 , lastCode = routes[routes.length - 1].stationCode
306 , opts = '', park_opts = ''; 308 , opts = '', park_opts = '';
307 //station options 309 //station options
@@ -374,7 +376,9 @@ @@ -374,7 +376,9 @@
374 upDown = inout_updown(zdzCode, sch); 376 upDown = inout_updown(zdzCode, sch);
375 break; 377 break;
376 default: 378 default:
377 - upDown = sch.xlDir 379 + upDown = sch.xlDir;
  380 + if($('[name=upDown]',f).length>0)
  381 + upDown = $('[name=upDown]',f).val();
378 } 382 }
379 383
380 //从站到场里获取数据 384 //从站到场里获取数据
@@ -572,22 +576,25 @@ @@ -572,22 +576,25 @@
572 if(!st_park_data) 576 if(!st_park_data)
573 return; 577 return;
574 var stp; 578 var stp;
575 - var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; 579 + try{
  580 + var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0];
576 581
577 - var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text,  
578 - zdzName=zdSelect.options[zdSelect.options.selectedIndex].text,  
579 - type2 = $f('type2', f).val(); 582 + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text,
  583 + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text,
  584 + type2 = $f('type2', f).val();
580 585
581 - if(type2!=2 && type2!=3)  
582 - return; 586 + if(type2!=2 && type2!=3)
  587 + return;
583 588
584 - $.each(st_park_data, function () {  
585 - if((type2==2 && this.stationName==qdzName && this.parkName==zdzName)  
586 - || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){  
587 - stp = this;  
588 - return false;  
589 - }  
590 - }); 589 + $.each(st_park_data, function () {
  590 + if((type2==2 && this.stationName==qdzName && this.parkName==zdzName)
  591 + || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){
  592 + stp = this;
  593 + return false;
  594 + }
  595 + });
  596 + }catch (e){
  597 + console.log(e);}
591 598
592 return stp; 599 return stp;
593 } 600 }
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
5 <h2>调整人车</h2></div> 5 <h2>调整人车</h2></div>
6 - <div class="uk-panel uk-panel-box uk-panel-box-primary"> 6 + <div class="uk-panel ct_search_panel">
7 <form class="uk-form uk-form-horizontal search-form"> 7 <form class="uk-form uk-form-horizontal search-form">
8 <div class="uk-grid"> 8 <div class="uk-grid">
9 <div class="uk-width-1-3"> 9 <div class="uk-width-1-3">
@@ -26,21 +26,23 @@ @@ -26,21 +26,23 @@
26 </form> 26 </form>
27 </div> 27 </div>
28 28
29 - <div class="ct_table_wrap ct_table_no_border tzrc-table-wrap" style="height: 300px;">  
30 - <div class="ct_table sch-tzrc-table">  
31 - <div class="ct_table_head">  
32 - <dl>  
33 - <dt><input type="checkbox" id="globalCheckBox" class="i-cbox" style="margin-top: 0px;">时间</dt>  
34 - <dt>车辆</dt>  
35 - <dt>驾驶员</dt>  
36 - <dt>售票员</dt>  
37 - </dl> 29 + <form class="uk-form">
  30 + <div class="ct_table_wrap ct_table_no_border tzrc-table-wrap" style="height: 340px;">
  31 + <div class="ct_table sch-tzrc-table">
  32 + <div class="ct_table_head">
  33 + <dl>
  34 + <dt><input type="checkbox" id="globalCheckBox" class="i-cbox" >时间</dt>
  35 + <dt>车辆</dt>
  36 + <dt>驾驶员</dt>
  37 + <dt>售票员</dt>
  38 + <dt>状态</dt>
  39 + </dl>
  40 + </div>
  41 + <div class="ct_table_body"></div>
38 </div> 42 </div>
39 - <div class="ct_table_body"></div>  
40 </div> 43 </div>
41 - </div>  
42 -  
43 - <form class="uk-form uk-form-horizontal tzrc_form" style="padding-top: 20px;border-top: 1px solid whitesmoke;"> 44 + </form>
  45 + <form class="uk-form uk-form-horizontal tzrc_form">
44 <div class="uk-grid"> 46 <div class="uk-grid">
45 <div class="uk-width-1-2"> 47 <div class="uk-width-1-2">
46 <div class="uk-form-row"> 48 <div class="uk-form-row">
@@ -77,7 +79,7 @@ @@ -77,7 +79,7 @@
77 </div> 79 </div>
78 <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> 80 <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
79 <button type="button" class="uk-button uk-modal-close">取消</button> 81 <button type="button" class="uk-button uk-modal-close">取消</button>
80 - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存 82 + <button type="submit" class="uk-button uk-button-primary" ><i class="uk-icon-check"></i> &nbsp;保存
81 </button> 83 </button>
82 </div> 84 </div>
83 </form> 85 </form>
@@ -85,31 +87,38 @@ @@ -85,31 +87,38 @@
85 87
86 <script id="schedule-tzrc-table-temp" type="text/html"> 88 <script id="schedule-tzrc-table-temp" type="text/html">
87 {{each list as sch i}} 89 {{each list as sch i}}
88 - <dl data-id="{{sch.id}}"> 90 + <dl data-id="{{sch.id}}" {{if sch.status==0}}class="no_exec_sch_row"{{/if}}>
89 <dd> 91 <dd>
90 - <label>  
91 - <input type="checkbox" value=1 name="schCBox" class="i-cbox" style="margin-top: 0px;">  
92 - {{sch.dfsj}}  
93 - {{if sch.bcType == "out"}}  
94 - <span class="uk-badge uk-badge-success">出场</span>  
95 - {{else if sch.bcType == "in"}}  
96 - <span class="uk-badge uk-badge-warning">进场</span>  
97 - {{else if sch.bcType == "venting"}}  
98 - <span class="uk-badge uk-badge-danger">直放</span>  
99 - {{else if sch.bcType == "major"}}  
100 - <span class="uk-badge uk-badge-danger">放站</span>  
101 - {{/if}}  
102 - {{if sch.sflj}}  
103 - <span class="uk-badge uk-badge-danger">临加</span>  
104 - {{/if}}  
105 - {{if sch.cTasks.length > 0}}  
106 - <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>  
107 - {{/if}}  
108 - </label> 92 + <input type="checkbox" value=1 name="schCBox" class="i-cbox" >
  93 + {{sch.dfsj}}
  94 + {{if sch.bcType == "out"}}
  95 + <span class="uk-badge uk-badge-success">出场</span>
  96 + {{else if sch.bcType == "in"}}
  97 + <span class="uk-badge uk-badge-warning">进场</span>
  98 + {{else if sch.bcType == "venting"}}
  99 + <span class="uk-badge uk-badge-danger">直放</span>
  100 + {{else if sch.bcType == "major"}}
  101 + <span class="uk-badge uk-badge-danger">放站</span>
  102 + {{/if}}
  103 + {{if sch.sflj}}
  104 + <span class="uk-badge uk-badge-danger">临加</span>
  105 + {{/if}}
  106 + {{if sch.cTasks.length > 0}}
  107 + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>
  108 + {{/if}}
109 </dd> 109 </dd>
110 <dd>{{sch.clZbh}}</dd> 110 <dd>{{sch.clZbh}}</dd>
111 <dd>{{sch.jGh}}/{{sch.jName}}</dd> 111 <dd>{{sch.jGh}}/{{sch.jName}}</dd>
112 <dd>{{sch.sGh}}/{{sch.sName}}</dd> 112 <dd>{{sch.sGh}}/{{sch.sName}}</dd>
  113 + <dd>
  114 + {{if sch.status==2}}
  115 + <span class="ct_zt_yzx">已执行</span>
  116 + {{else if sch.status==1}}
  117 + <span class="ct_zt_zzzx">正在执行</span>
  118 + {{else if sch.status==-1}}
  119 + <span class="ct_zt_lb">烂班</span>
  120 + {{/if}}
  121 + </dd>
113 </dl> 122 </dl>
114 {{/each}} 123 {{/each}}
115 </script> 124 </script>
@@ -151,17 +160,21 @@ @@ -151,17 +160,21 @@
151 $('.tzrc-table-wrap', modal).perfectScrollbar('update'); 160 $('.tzrc-table-wrap', modal).perfectScrollbar('update');
152 }); 161 });
153 162
154 - $(modal).on('click', '.sch-tzrc-table .ct_table_body dl input[type=checkbox]', function () {  
155 - if ($(this).attr('disabled')) return;  
156 - var dl = $(this).parents('dl');  
157 - if (this.checked) {  
158 - dl.addClass('active'); 163 + $(modal).on('click', '.sch-tzrc-table .ct_table_body dl', function () {
  164 + var cbox = $('input[type=checkbox]',this)[0];
  165 + //var active = $();
  166 + if(!$(this).hasClass('active')){
  167 + $(this).addClass('active');
  168 + cbox.checked = true;
159 var lineCode = $('[name=lineSelect]', modal).val(); 169 var lineCode = $('[name=lineSelect]', modal).val();
160 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')]; 170 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[$(this).data('id')];
161 171
162 writeSch2Form(sch); 172 writeSch2Form(sch);
163 - } else  
164 - dl.removeClass('active'); 173 + }
  174 + else{
  175 + $(this).removeClass('active');
  176 + cbox.checked = false;
  177 + }
165 }); 178 });
166 179
167 //默认选中项 180 //默认选中项
@@ -191,18 +204,16 @@ @@ -191,18 +204,16 @@
191 //}); 204 //});
192 205
193 //submit 206 //submit
194 - var f = $('form.tzrc_form', modal).formValidation({  
195 - framework: 'uikit',  
196 - locale: 'zh_CN'  
197 - });  
198 - f.on('success.form.fv', function (e) {  
199 - e.preventDefault();  
200 - var param = $(this).serializeJSON();  
201 - var data = []; 207 + var f = $('form.tzrc_form', modal);
  208 + f.on('submit', function (e) {
  209 + e.stopPropagation();
  210 +
202 var checkeds = $('.sch-tzrc-table .ct_table_body input[type=checkbox]:checked', modal); 211 var checkeds = $('.sch-tzrc-table .ct_table_body input[type=checkbox]:checked', modal);
203 if (checkeds.length == 0) 212 if (checkeds.length == 0)
204 return notify_err('请选中要调整的班次'); 213 return notify_err('请选中要调整的班次');
205 214
  215 + var param = $(this).serializeJSON();
  216 + var data = [];
206 var schId; 217 var schId;
207 $.each(checkeds, function () { 218 $.each(checkeds, function () {
208 schId = $(this).parents('dl').data('id'); 219 schId = $(this).parents('dl').data('id');
@@ -213,6 +224,7 @@ @@ -213,6 +224,7 @@
213 clZbh: param.clZbh 224 clZbh: param.clZbh
214 }); 225 });
215 }); 226 });
  227 +
216 gb_common.$post('/realSchedule/multi_tzrc', { 228 gb_common.$post('/realSchedule/multi_tzrc', {
217 cpcsJson: JSON.stringify(data) 229 cpcsJson: JSON.stringify(data)
218 }, function (rs) { 230 }, function (rs) {
@@ -222,6 +234,7 @@ @@ -222,6 +234,7 @@
222 notify_succ('调整人车成功'); 234 notify_succ('调整人车成功');
223 } 235 }
224 }); 236 });
  237 + return false;
225 }); 238 });
226 }); 239 });
227 240
@@ -235,11 +248,28 @@ @@ -235,11 +248,28 @@
235 248
236 //全选 249 //全选
237 $('#globalCheckBox', modal).on('click', function () { 250 $('#globalCheckBox', modal).on('click', function () {
  251 + clearCheckAll();
238 var status = this.checked; 252 var status = this.checked;
239 - $('input[name=schCBox]', modal).each(function () {  
240 - this.checked = status;  
241 - }); 253 + if(status){
  254 + var id;
  255 + $('.no_exec_sch_row', modal).each(function () {
  256 + $(this).addClass('active');
  257 + $('input[type=checkbox]',this)[0].checked = true;
  258 + id = $(this).data('id');
  259 + });
  260 +
  261 + var lineCode = $('[name=lineSelect]', modal).val();
  262 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  263 + writeSch2Form(sch);
  264 + }
242 }); 265 });
  266 +
  267 + function clearCheckAll() {
  268 + $('.sch-tzrc-table .ct_table_body>dl', modal).each(function () {
  269 + $(this).removeClass('active');
  270 + $('input[type=checkbox]',this)[0].checked = false;
  271 + });
  272 + }
243 })(); 273 })();
244 </script> 274 </script>
245 </div> 275 </div>
src/main/resources/static/real_control_v2/js/common.js
@@ -112,7 +112,7 @@ var gb_common = (function () { @@ -112,7 +112,7 @@ var gb_common = (function () {
112 }); 112 });
113 }; 113 };
114 114
115 - var errorHead = '<span style="color:red;">服务器出现异常:</span>'; 115 + var errorHead = '<span style="color:red;">异常:</span>';
116 116
117 function successHandle(json, handle) { 117 function successHandle(json, handle) {
118 var status = json.status; 118 var status = json.status;
src/main/resources/static/real_control_v2/js/main.js
@@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 function showUpdateDescription() { 169 function showUpdateDescription() {
170 //更新说明 170 //更新说明
171 var updateDescription = { 171 var updateDescription = {
172 - date: '2017-07-26',  
173 - text: '<h5>1、修复一个临时性的小问题,这个问题导致26号上午,起点站和第2站缓冲区重叠的几条线路发不出去!</h5>' 172 + date: '2017-08-13',
  173 + text: '<h5>1、修复了 “子任务-区间调头” 当上下行里程不等时,站间距公里提示错误的问题!</h5>'
174 }; 174 };
175 175
176 var storage = window.localStorage 176 var storage = window.localStorage