Commit 18f3a9427eb50ad5cce81ca288899e97bbf6aa76

Authored by 廖磊
2 parents 6af4597f 2033f1c4

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into

minhang
Showing 99 changed files with 3321 additions and 2175 deletions
src/main/java/com/bsth/controller/BusIntervalController.java
@@ -22,6 +22,11 @@ public class BusIntervalController { @@ -22,6 +22,11 @@ public class BusIntervalController {
22 public List<Map<String,Object>> getDir(@RequestParam Map<String, Object> map){ 22 public List<Map<String,Object>> getDir(@RequestParam Map<String, Object> map){
23 return busIntervalService.getDir(map); 23 return busIntervalService.getDir(map);
24 } 24 }
  25 +
  26 + @RequestMapping(value = "/getLp", method = RequestMethod.GET)
  27 + public List<Map<String,Object>> getLp(@RequestParam Map<String, Object> map){
  28 + return busIntervalService.getLp(map);
  29 + }
25 30
26 @RequestMapping(value = "/interval", method = RequestMethod.GET) 31 @RequestMapping(value = "/interval", method = RequestMethod.GET)
27 public List<Map<String,Object>> interval(@RequestParam Map<String, Object> map){ 32 public List<Map<String,Object>> interval(@RequestParam Map<String, Object> map){
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -231,7 +231,7 @@ public class ExportController { @@ -231,7 +231,7 @@ public class ExportController {
231 listI.add(resList.iterator()); 231 listI.add(resList.iterator());
232 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; 232 String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\";
233 ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls", 233 ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls",
234 - path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("dat").toString())) + ".xls"); 234 + path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("data").toString())) + ".xls");
235 } catch (Exception e) { 235 } catch (Exception e) {
236 e.printStackTrace(); 236 e.printStackTrace();
237 } 237 }
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
@@ -131,13 +131,13 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -131,13 +131,13 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
131 * @Title: adjust @Description: TODO(调整人车) @param @param id 131 * @Title: adjust @Description: TODO(调整人车) @param @param id
132 * 班次ID @param @param nbbm 内部编码 @param @param jsy 驾驶员 @param @param spy 132 * 班次ID @param @param nbbm 内部编码 @param @param jsy 驾驶员 @param @param spy
133 * 售票员 @throws 133 * 售票员 @throws
134 - */ 134 +
135 @RequestMapping(value = "/adjust", method = RequestMethod.POST) 135 @RequestMapping(value = "/adjust", method = RequestMethod.POST)
136 public Map<String, Object> adjust(@RequestParam Long id, String nbbm, String jsy, 136 public Map<String, Object> adjust(@RequestParam Long id, String nbbm, String jsy,
137 String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr) { 137 String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr) {
138 return scheduleRealInfoService.adjust(id, nbbm, jsy, spy, revertLine, borrowLine, borrowTimeStr, revertTimeStr); 138 return scheduleRealInfoService.adjust(id, nbbm, jsy, spy, revertLine, borrowLine, borrowTimeStr, revertTimeStr);
139 } 139 }
140 - 140 + */
141 /** 141 /**
142 * 142 *
143 * @Title: realOutAdjust 143 * @Title: realOutAdjust
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; 3 import com.bsth.Application;
4 -import com.bsth.data.gpsdata.analyse.GeoCacheData; 4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
5 import com.bsth.entity.*; 5 import com.bsth.entity.*;
6 import com.bsth.entity.schedule.CarConfigInfo; 6 import com.bsth.entity.schedule.CarConfigInfo;
7 import com.bsth.repository.*; 7 import com.bsth.repository.*;
src/main/java/com/bsth/data/LineConfigData.java
1 package com.bsth.data; 1 package com.bsth.data;
2 2
3 -import java.util.Collection;  
4 -import java.util.HashMap;  
5 -import java.util.Iterator;  
6 -import java.util.Map;  
7 -import java.util.Set;  
8 -  
9 -import org.slf4j.Logger;  
10 -import org.slf4j.LoggerFactory;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.boot.CommandLineRunner;  
13 -import org.springframework.stereotype.Component;  
14 -  
15 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
16 import com.bsth.entity.realcontrol.D80ReplyTemp; 4 import com.bsth.entity.realcontrol.D80ReplyTemp;
17 import com.bsth.entity.realcontrol.LineConfig; 5 import com.bsth.entity.realcontrol.LineConfig;
18 import com.bsth.oplog.normal.OpLogger; 6 import com.bsth.oplog.normal.OpLogger;
19 import com.bsth.service.LineService; 7 import com.bsth.service.LineService;
20 import com.bsth.service.realcontrol.LineConfigService; 8 import com.bsth.service.realcontrol.LineConfigService;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.boot.CommandLineRunner;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import java.util.*;
21 16
22 /** 17 /**
23 * 18 *
@@ -92,7 +87,7 @@ public class LineConfigData implements CommandLineRunner { @@ -92,7 +87,7 @@ public class LineConfigData implements CommandLineRunner {
92 //出场时间类型 87 //出场时间类型
93 conf.setOutConfig(1); 88 conf.setOutConfig(1);
94 //进场时间类型 89 //进场时间类型
95 - conf.setInConfig(1); 90 + //conf.setInConfig(1);
96 //短语模板 91 //短语模板
97 conf.setPhraseTemps(""); 92 conf.setPhraseTemps("");
98 //调度指令模板 93 //调度指令模板
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
1 package com.bsth.data.gpsdata; 1 package com.bsth.data.gpsdata;
2 2
3 -import com.bsth.data.gpsdata.analyse.StationRoute; 3 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
4 import com.fasterxml.jackson.annotation.JsonIgnore; 4 import com.fasterxml.jackson.annotation.JsonIgnore;
5 5
6 /** 6 /**
@@ -78,15 +78,15 @@ public class GpsEntity { @@ -78,15 +78,15 @@ public class GpsEntity {
78 private boolean sEPoint; 78 private boolean sEPoint;
79 */ 79 */
80 80
81 - /** 站内 */  
82 - private boolean instation; 81 + /** 0: 站外 1:站内 2:场内 */
  82 + private int instation;
83 83
84 /** 站点信息,站内时有值 */ 84 /** 站点信息,站内时有值 */
85 @JsonIgnore 85 @JsonIgnore
86 private StationRoute station; 86 private StationRoute station;
87 87
88 /** 状态 */ 88 /** 状态 */
89 - private String state2; 89 + private String signalState;
90 90
91 public Integer getCompanyCode() { 91 public Integer getCompanyCode() {
92 return companyCode; 92 return companyCode;
@@ -233,14 +233,6 @@ public class GpsEntity { @@ -233,14 +233,6 @@ public class GpsEntity {
233 this.version = version; 233 this.version = version;
234 } 234 }
235 235
236 - public boolean isInstation() {  
237 - return instation;  
238 - }  
239 -  
240 - public void setInstation(boolean instation) {  
241 - this.instation = instation;  
242 - }  
243 -  
244 public StationRoute getStation() { 236 public StationRoute getStation() {
245 return station; 237 return station;
246 } 238 }
@@ -257,11 +249,19 @@ public class GpsEntity { @@ -257,11 +249,19 @@ public class GpsEntity {
257 this.abnormal = abnormal; 249 this.abnormal = abnormal;
258 } 250 }
259 251
260 - public String getState2() {  
261 - return state2; 252 + public String getSignalState() {
  253 + return signalState;
262 } 254 }
263 255
264 - public void setState2(String state2) {  
265 - this.state2 = state2; 256 + public void setSignalState(String signalState) {
  257 + this.signalState = signalState;
  258 + }
  259 +
  260 + public int getInstation() {
  261 + return instation;
  262 + }
  263 +
  264 + public void setInstation(int instation) {
  265 + this.instation = instation;
266 } 266 }
267 } 267 }
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 import com.bsth.Application; 5 import com.bsth.Application;
6 import com.bsth.data.BasicData; 6 import com.bsth.data.BasicData;
7 import com.bsth.data.forecast.ForecastRealServer; 7 import com.bsth.data.forecast.ForecastRealServer;
8 -import com.bsth.data.gpsdata.analyse.GpsAnalyse; 8 +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
9 import com.bsth.data.gpsdata.recovery.GpsDataRecovery; 9 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
10 import com.bsth.data.schedule.DayOfSchedule; 10 import com.bsth.data.schedule.DayOfSchedule;
11 import com.bsth.entity.realcontrol.ScheduleRealInfo; 11 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -29,256 +29,187 @@ import java.util.*; @@ -29,256 +29,187 @@ import java.util.*;
29 import java.util.concurrent.TimeUnit; 29 import java.util.concurrent.TimeUnit;
30 30
31 /** 31 /**
32 - * 32 + * @author PanZhao
33 * @ClassName: GpsRealData 33 * @ClassName: GpsRealData
34 * @Description: TODO(实时GPS数据集合) 34 * @Description: TODO(实时GPS数据集合)
35 - * @author PanZhao  
36 * @date 2016年8月12日 下午2:04:41 35 * @date 2016年8月12日 下午2:04:41
37 - *  
38 */ 36 */
39 @Component 37 @Component
40 -public class GpsRealData implements CommandLineRunner{  
41 -  
42 - static Logger logger = LoggerFactory.getLogger(GpsRealData.class);  
43 -  
44 - private static Map<String, GpsEntity> gpsMap;  
45 -  
46 - //按线路分组设备号  
47 - private static TreeMultimap<String, String> lineCode2Devices;  
48 -  
49 - // 网关数据接口地址  
50 - private static String url;  
51 -  
52 - @Autowired  
53 - GpsDataLoader gpsDataLoader;  
54 -  
55 - @Autowired  
56 - DayOfSchedule dayOfSchedule;  
57 -  
58 - @Autowired  
59 - ForecastRealServer forecastRealServer;  
60 -  
61 -  
62 -  
63 - /**  
64 - * 构造函数  
65 - */  
66 - public GpsRealData(){  
67 - gpsMap = new HashMap<>();  
68 - lineCode2Devices = TreeMultimap.create();  
69 - url = ConfigUtil.get("http.gps.real.url");  
70 - }  
71 -  
72 - @Override  
73 - public void run(String... arg0) throws Exception {  
74 - logger.info("gpsDataLoader,20,6");  
75 - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 40, 20, TimeUnit.SECONDS);  
76 - }  
77 -  
78 - public GpsEntity add(GpsEntity gps) {  
79 - String device = gps.getDeviceId();  
80 - GpsEntity old = gpsMap.get(device);  
81 -  
82 - //分析gps  
83 - if(isAvailable(gps) && (old == null || old.getTimestamp() != gps.getTimestamp()))  
84 - GpsAnalyse.start(gps);  
85 -  
86 - if(!StringUtils.isEmpty(gps.getStopNo())){  
87 - //定时定距数据附带站点编码改变  
88 - if(null == old || !gps.getStopNo().equals(old.getStopNo())){  
89 - gps.setArrTime(gps.getTimestamp());  
90 - //预测到达终点时间  
91 - forecastRealServer.forecast(gps.getNbbm(), gps);  
92 - }  
93 - else{  
94 - gps.setArrTime(old.getArrTime());  
95 - //不预测, 重新计算终点时间  
96 - gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm()));  
97 - }  
98 - }  
99 -  
100 - gpsMap.put(device, gps);  
101 - if(StringUtils.isNotBlank(gps.getLineId()))  
102 - lineCode2Devices.put(gps.getLineId(), device);  
103 - return gps;  
104 - }  
105 -  
106 - public boolean isAvailable(GpsEntity gps){  
107 - return StringUtils.isNotEmpty(gps.getLineId()) &&  
108 - dayOfSchedule.getCurrSchDate().containsKey(gps.getLineId());  
109 - }  
110 -  
111 - /**  
112 - *  
113 - * @Title: get @Description: TODO(设备号获取GPS)  
114 - */  
115 - public GpsEntity get(String deviceId) {  
116 - return gpsMap.get(deviceId);  
117 - }  
118 -  
119 - /**  
120 - *  
121 - * @Title: get @Description: TODO(线路编码获取GPS集合) @throws  
122 - */  
123 - public List<GpsEntity> getByLine(String lineCode) {  
124 - NavigableSet<String> set = lineCode2Devices.get(lineCode);  
125 -  
126 - List<GpsEntity> rs = new ArrayList<>();  
127 - GpsEntity gps;  
128 - ScheduleRealInfo sch;  
129 - for(String device : set){  
130 - gps = gpsMap.get(device);  
131 - //过滤异常GPS数据  
132 - if(gps.isAbnormal())  
133 - continue;  
134 -  
135 - sch = dayOfSchedule.execPlanMap().get(gps.getNbbm());  
136 - if(null != sch)  
137 - gps.setSchId(sch.getId());  
138 - rs.add(gps);  
139 - }  
140 -  
141 - return rs;  
142 - }  
143 -  
144 - public List<GpsEntity> get(List<String> pArray){  
145 - List<GpsEntity> list = new ArrayList<>();  
146 -  
147 - for(String code : pArray)  
148 - list.addAll(getByLine(code));  
149 - return list;  
150 - }  
151 -  
152 - public Set<String> allDevices(){  
153 - return gpsMap.keySet();  
154 - }  
155 -  
156 - public GpsEntity findByDeviceId(String deviceId) {  
157 - return gpsMap.get(deviceId);  
158 - }  
159 -  
160 - public Collection<GpsEntity> all(){  
161 - return gpsMap.values();  
162 - }  
163 -  
164 - public void remove(String device){  
165 - gpsMap.remove(device);  
166 - }  
167 - @Component  
168 - public static class GpsDataLoader extends Thread{  
169 -  
170 - Logger logger = LoggerFactory.getLogger(GpsDataLoader.class);  
171 -  
172 - @Autowired  
173 - GpsRealData gpsRealData;  
174 -  
175 - @Override  
176 - public void run() {  
177 - try{  
178 - //如果正在恢复数据  
179 - if(GpsDataRecovery.run){  
180 - return;  
181 - }  
182 -  
183 - load();  
184 - }catch(Exception e){  
185 - logger.error("", e);  
186 - }  
187 - }  
188 -  
189 - public void load() throws Exception {  
190 - List<GpsEntity> list = new ArrayList<>();  
191 - CloseableHttpClient httpClient = null;  
192 - CloseableHttpResponse response = null;  
193 - try {  
194 - httpClient = HttpClients.createDefault();  
195 - HttpGet get = new HttpGet(url);  
196 -  
197 - response = httpClient.execute(get);  
198 -  
199 - HttpEntity entity = response.getEntity();  
200 - if (null != entity) {  
201 - // 返回数据量比较大,建议以流的形式读取  
202 - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));  
203 - StringBuffer stringBuffer = new StringBuffer();  
204 - String str = "";  
205 - while ((str = br.readLine()) != null)  
206 - stringBuffer.append(str);  
207 -  
208 - JSONObject jsonObj = JSON.parseObject(stringBuffer.toString());  
209 -  
210 - if (jsonObj != null)  
211 - list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class);  
212 -  
213 - String nbbm;  
214 - for(GpsEntity gps : list){  
215 - //没有设备号  
216 - if(StringUtils.isBlank(gps.getDeviceId()))  
217 - continue;  
218 -  
219 - nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());  
220 - if(StringUtils.isBlank(nbbm))  
221 - gps.setAbnormal(true);//标记为异常数据  
222 - else  
223 - gps.setNbbm(nbbm);  
224 -  
225 - gps.setStationName(BasicData.stationCode2NameMap.get(gps.getStopNo()));  
226 - gpsRealData.add(gps);  
227 -  
228 - //纠正走向  
229 - //correctUpdown(gps);  
230 - }  
231 - } else  
232 - logger.error("result is null");  
233 - } catch(Exception e){  
234 - logger.error("", e);  
235 - }  
236 - finally {  
237 - if (null != httpClient)  
238 - httpClient.close();  
239 - if(null != response)  
240 - response.close();  
241 - }  
242 - }  
243 -  
244 - /**  
245 - * 是否是起终点  
246 - * @param gps  
247 - * @return  
248 -  
249 - public boolean isSEPoint(GpsEntity gps){  
250 - String key = gps.getLineId()+"_"+gps.getUpDown()+"_"  
251 - ,stationCode;  
252 -  
253 - if(BasicData.lineSEPointMap.containsKey(key+"B")){  
254 - stationCode = BasicData.lineSEPointMap.get(key+"B");  
255 - if(gps.getStopNo().equals(stationCode)){  
256 - gps.setsEPoint(true);  
257 - return true;  
258 - }  
259 - }  
260 -  
261 - if(BasicData.lineSEPointMap.containsKey(key+"E")){  
262 - stationCode = BasicData.lineSEPointMap.get(key+"E");  
263 - if(gps.getStopNo().equals(stationCode)){  
264 - gps.setsEPoint(true);  
265 - return true;  
266 - }  
267 - }  
268 - return false;  
269 - }*/  
270 -  
271 - /**  
272 - * 纠正上下行  
273 - * @param gps  
274 -  
275 - public void correctUpdown(GpsEntity gps){  
276 - Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());  
277 - if(updown != null && !updown.equals(gps.getUpDown()))  
278 - gps.setUpDown(updown);  
279 -  
280 - if(isSEPoint(gps))  
281 - return;  
282 - }*/  
283 - } 38 +public class GpsRealData implements CommandLineRunner {
  39 +
  40 + static Logger logger = LoggerFactory.getLogger(GpsRealData.class);
  41 +
  42 + private static Map<String, GpsEntity> gpsMap;
  43 +
  44 + //按线路分组设备号
  45 + private static TreeMultimap<String, String> lineCode2Devices;
  46 +
  47 + // 网关数据接口地址
  48 + private static String url;
  49 +
  50 + @Autowired
  51 + GpsDataLoader gpsDataLoader;
  52 +
  53 + @Autowired
  54 + DayOfSchedule dayOfSchedule;
  55 +
  56 + @Autowired
  57 + ForecastRealServer forecastRealServer;
  58 +
  59 + /**
  60 + * 构造函数
  61 + */
  62 + public GpsRealData() {
  63 + gpsMap = new HashMap<>();
  64 + lineCode2Devices = TreeMultimap.create();
  65 + url = ConfigUtil.get("http.gps.real.url");
  66 + }
  67 +
  68 + @Override
  69 + public void run(String... arg0) throws Exception {
  70 + logger.info("gpsDataLoader,40,6");
  71 + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 40, 6, TimeUnit.SECONDS);
  72 + }
  73 +
  74 + public void put(GpsEntity gps) {
  75 + gpsMap.put(gps.getDeviceId(), gps);
  76 + }
  77 +
  78 + /**
  79 + * @Title: get @Description: TODO(设备号获取GPS)
  80 + */
  81 + public GpsEntity get(String deviceId) {
  82 + return gpsMap.get(deviceId);
  83 + }
  84 +
  85 + /**
  86 + * @Title: get @Description: TODO(线路编码获取GPS集合) @throws
  87 + */
  88 + public List<GpsEntity> getByLine(String lineCode) {
  89 + NavigableSet<String> set = lineCode2Devices.get(lineCode);
  90 +
  91 + List<GpsEntity> rs = new ArrayList<>();
  92 + GpsEntity gps;
  93 + ScheduleRealInfo sch;
  94 + for (String device : set) {
  95 + gps = gpsMap.get(device);
  96 + //过滤异常GPS数据
  97 + if (gps.isAbnormal())
  98 + continue;
  99 +
  100 + sch = dayOfSchedule.execPlanMap().get(gps.getNbbm());
  101 + if (null != sch)
  102 + gps.setSchId(sch.getId());
  103 + rs.add(gps);
  104 + }
  105 +
  106 + return rs;
  107 + }
  108 +
  109 + public List<GpsEntity> get(List<String> pArray) {
  110 + List<GpsEntity> list = new ArrayList<>();
  111 +
  112 + for (String code : pArray)
  113 + list.addAll(getByLine(code));
  114 + return list;
  115 + }
  116 +
  117 + public Set<String> allDevices() {
  118 + return gpsMap.keySet();
  119 + }
  120 +
  121 + public GpsEntity findByDeviceId(String deviceId) {
  122 + return gpsMap.get(deviceId);
  123 + }
  124 +
  125 + public Collection<GpsEntity> all() {
  126 + return gpsMap.values();
  127 + }
  128 +
  129 + public void remove(String device) {
  130 + gpsMap.remove(device);
  131 + }
  132 +
  133 + @Component
  134 + public static class GpsDataLoader extends Thread {
  135 +
  136 + Logger logger = LoggerFactory.getLogger(GpsDataLoader.class);
  137 +
  138 + @Autowired
  139 + GpsRealData gpsRealData;
  140 +
  141 + @Autowired
  142 + GpsRealAnalyse gpsRealAnalyse;
  143 +
  144 + @Override
  145 + public void run() {
  146 + try {
  147 + //如果正在恢复数据
  148 + if (GpsDataRecovery.run)
  149 + return;
  150 +
  151 + load();
  152 + } catch (Exception e) {
  153 + logger.error("", e);
  154 + }
  155 + }
  156 +
  157 + public void load() throws Exception {
  158 + List<GpsEntity> list = null;
  159 + List<GpsEntity> updateList = new ArrayList<>();
  160 + CloseableHttpClient httpClient = null;
  161 + CloseableHttpResponse response = null;
  162 + try {
  163 + httpClient = HttpClients.createDefault();
  164 + HttpGet get = new HttpGet(url);
  165 +
  166 + response = httpClient.execute(get);
  167 +
  168 + HttpEntity entity = response.getEntity();
  169 + if (null != entity) {
  170 + BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));
  171 + StringBuffer stringBuffer = new StringBuffer();
  172 + String str = "";
  173 + while ((str = br.readLine()) != null)
  174 + stringBuffer.append(str);
  175 +
  176 + JSONObject jsonObj = JSON.parseObject(stringBuffer.toString());
  177 +
  178 + if (jsonObj != null)
  179 + list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class);
  180 +
  181 + String nbbm;
  182 + GpsEntity old;
  183 + for (GpsEntity gps : list) {
  184 + //没有设备号
  185 + if (StringUtils.isBlank(gps.getDeviceId()))
  186 + continue;
  187 +
  188 + old = gpsMap.get(gps.getDeviceId());
  189 + if (old != null &&
  190 + old.getTimestamp() == gps.getTimestamp())
  191 + continue;
  192 +
  193 + nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
  194 + if (StringUtils.isBlank(nbbm))
  195 + gps.setAbnormal(true);//标记为异常数据
  196 + else
  197 + gps.setNbbm(nbbm);
  198 + //有更新的点位
  199 + updateList.add(gps);
  200 + }
  201 + //分析数据
  202 + gpsRealAnalyse.analyse(updateList);
  203 + } else
  204 + logger.error("real gps result is null");
  205 + } catch (Exception e) {
  206 + logger.error("", e);
  207 + } finally {
  208 + if (null != httpClient)
  209 + httpClient.close();
  210 + if (null != response)
  211 + response.close();
  212 + }
  213 + }
  214 + }
284 } 215 }
285 \ No newline at end of file 216 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/GpsAnalyse.java deleted 100644 → 0
1 -package com.bsth.data.gpsdata.analyse;  
2 -  
3 -import com.bsth.data.gpsdata.GpsEntity;  
4 -import com.bsth.data.gpsdata.analyse.components.GpsArrival;  
5 -import org.slf4j.Logger;  
6 -import org.slf4j.LoggerFactory;  
7 -  
8 -import java.util.concurrent.ExecutorService;  
9 -import java.util.concurrent.Executors;  
10 -  
11 -/**  
12 - * 分析gps状态信息  
13 - * Created by panzhao on 2016/12/23.  
14 - */  
15 -public class GpsAnalyse {  
16 -  
17 - static Logger logger = LoggerFactory.getLogger(GpsAnalyse.class);  
18 -  
19 - //线程池  
20 - static ExecutorService threadPool = Executors.newFixedThreadPool(50);  
21 -  
22 - public static void start(GpsEntity gps) {  
23 - threadPool.execute(new ArrivalMatchThread(gps));  
24 - }  
25 -  
26 - public static class ArrivalMatchThread implements Runnable {  
27 -  
28 - private GpsEntity gps;  
29 -  
30 - public ArrivalMatchThread(GpsEntity gps) {  
31 - this.gps = gps;  
32 - }  
33 -  
34 - @Override  
35 - public void run() {  
36 - GpsArrival.arrival(gps);  
37 - }  
38 - }  
39 -}  
40 \ No newline at end of file 0 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsArrival.java deleted 100644 → 0
1 -package com.bsth.data.gpsdata.analyse.components;  
2 -  
3 -import com.bsth.data.LineConfigData;  
4 -import com.bsth.data.gpsdata.GpsEntity;  
5 -import com.bsth.data.gpsdata.analyse.CircleQueue;  
6 -import com.bsth.data.gpsdata.analyse.GeoCacheData;  
7 -import com.bsth.data.gpsdata.analyse.StationRoute;  
8 -import com.bsth.data.gpsdata.analyse.util.GeoUtils;  
9 -import com.bsth.data.schedule.DayOfSchedule;  
10 -import com.bsth.entity.realcontrol.LineConfig;  
11 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
12 -import org.slf4j.Logger;  
13 -import org.slf4j.LoggerFactory;  
14 -import org.springframework.beans.BeansException;  
15 -import org.springframework.context.ApplicationContext;  
16 -import org.springframework.context.ApplicationContextAware;  
17 -import org.springframework.stereotype.Component;  
18 -  
19 -import java.util.List;  
20 -  
21 -/**  
22 - * gps 到离站判断  
23 - * Created by panzhao on 2016/12/24.  
24 - */  
25 -@Component  
26 -public class GpsArrival implements ApplicationContextAware {  
27 -  
28 - static Logger logger = LoggerFactory.getLogger(GpsArrival.class);  
29 -  
30 - static DayOfSchedule dayOfSchedule;  
31 -  
32 - static LineConfigData lineConfigData;  
33 -  
34 - public static void arrival(GpsEntity gps) {  
35 -  
36 - if (gps.getLat() == 0 || gps.getLon() == 0) {  
37 - //logger.error("无效的gps");  
38 - return;  
39 - }  
40 -  
41 - Object task = DayOfSchedule.executeCurr(gps.getNbbm());  
42 - if (task == null)  
43 - return;  
44 - if (task.getClass().isAssignableFrom(ScheduleRealInfo.class)) {  
45 - ScheduleRealInfo sch = (ScheduleRealInfo) task;  
46 - //和班次同步走向  
47 - gps.setUpDown(Integer.parseInt(sch.getXlDir()));  
48 -  
49 - //出场  
50 - if (sch.getBcType().equals("out")) {  
51 - outCarpark(gps, sch);  
52 - }  
53 - else if (sch.getBcType().equals("normal"))  
54 - normalInOut(gps, sch);  
55 - else if(sch.getBcType().equals("in")){  
56 - inCarpark(gps, sch);  
57 - }  
58 - }  
59 -  
60 - GeoCacheData.putGps(gps);  
61 - }  
62 -  
63 - /**  
64 - * 正常班次  
65 - *  
66 - * @param gps  
67 - * @param sch  
68 - */  
69 - private static void normalInOut(GpsEntity gps, ScheduleRealInfo sch) {  
70 - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());  
71 - GpsEntity prev = null;  
72 - if (queue != null)  
73 - prev = queue.getTail();  
74 -  
75 - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown());  
76 - StationRoute station = GeoUtils.gpsInStation(gps, srs);  
77 -  
78 - if (station != null) {  
79 - //站内  
80 - gps.setStopNo(station.getCode());  
81 - gps.setInstation(true);  
82 - stationInside(gps, prev, sch);  
83 - } else {  
84 - //站外  
85 - stationOutside(gps, prev, sch);  
86 - }  
87 - }  
88 -  
89 - /**  
90 - * GPS在站点内  
91 - *  
92 - * @param gps  
93 - * @param prev  
94 - * @param sch  
95 - */  
96 - private static void stationInside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) {  
97 - if(prev == null)  
98 - return;  
99 -  
100 - if (gps.getStopNo().equals(sch.getZdzCode()) && sch.getZdsjActual() == null) {  
101 - //到终点站  
102 - arriveEnd(sch, gps);  
103 - return;  
104 - }  
105 -  
106 - //上一个点在站外  
107 - if(!prev.isInstation())  
108 - return;  
109 - //超过 (待发时间 + 90%的单程运送时间),还在起点站。默认烂一圈  
110 - if (prev.getStopNo().equals(gps.getStopNo())){  
111 - if(gps.getStopNo().equals(sch.getQdzCode())  
112 - && gps.getTimestamp() > sch.getDfsjT() + (sch.getBcsj() * 60 * 1000 * 0.9)){  
113 -  
114 - ScheduleRealInfo next = dayOfSchedule.next(dayOfSchedule.next(sch));  
115 - dayOfSchedule.addExecPlan(next);  
116 - }  
117 - return;  
118 - }  
119 -  
120 - //发车  
121 - if (prev.getStopNo().equals(sch.getQdzCode())) {  
122 - busWillDepart(sch, gps);  
123 - return;  
124 - }  
125 -  
126 - //中途站  
127 - StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), prev.getUpDown(), prev.getStopNo());  
128 - StationRoute currStation = GeoCacheData.getStation(gps.getLineId(), gps.getUpDown(), gps.getStopNo());  
129 - if (currStation.getRouteSort() < prevStation.getRouteSort()) {  
130 - //开始下一个班次  
131 - finishPlan(sch);  
132 -  
133 - logger.info("路由反向。。。。。。:" + gps.getTimestamp());  
134 - //为班次补上实际时间  
135 -  
136 - }  
137 - }  
138 -  
139 - /**  
140 - * GPS在站点外  
141 - *  
142 - * @param gps  
143 - * @param prev  
144 - * @param sch  
145 - */  
146 - private static void stationOutside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) {  
147 - if(prev == null)  
148 - return;  
149 -  
150 - gps.setStopNo(prev.getStopNo());  
151 - if (prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {  
152 - //发车  
153 - busWillDepart(sch, gps);  
154 - return;  
155 - }  
156 - }  
157 -  
158 - /**  
159 - * 公交车起点发出  
160 - */  
161 - final static long DRIFT_VAL_TIME = 1000 * 60 * 10;  
162 - //班次最大差值1小时  
163 - final static long MAX_DIFF = 1000 * 60 * 60;  
164 - private static void busWillDepart(ScheduleRealInfo sch, GpsEntity gps) {  
165 - //实发时间不覆盖  
166 - if (sch.getFcsjActual() == null && Math.abs(gps.getTimestamp() - sch.getDfsjT()) < MAX_DIFF) {  
167 -  
168 - //提前10分钟以上发出,判断一下是否是漂移  
169 - if(sch.getDfsjT() - gps.getTimestamp() > DRIFT_VAL_TIME){  
170 - ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);  
171 - if(schPrev != null && schPrev.getZdsjActual() != null){  
172 - //计划停站时间  
173 - long stopTimeJH = sch.getDfsjT() - schPrev.getZdsjT();  
174 - //实际停站时间  
175 - long actualStopTime = gps.getTimestamp() - schPrev.getZdsjActualTime();  
176 - /*  
177 - 没停够计划百分之60的,算漂移  
178 - (这里出现的误判,由程序在车辆到中途站的时候进行补偿)  
179 - */  
180 - if(stopTimeJH * 0.6 < actualStopTime){  
181 - logger.info("漂移.... 车辆:" + gps.getNbbm() + " ts: " + gps.getTimestamp());  
182 - return;  
183 - }  
184 - }  
185 - }  
186 -  
187 - LineConfig config = lineConfigData.get(sch.getXlBm());  
188 - if(config != null && config.getOutConfig() == 2){  
189 - //出站既出场  
190 - ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);  
191 - if(schPrev.getBcType().equals("out")){  
192 - schPrev.setFcsjActualAll(schPrev.getDfsjT());  
193 - schPrev.setZdsjActualAll(schPrev.getZdsjT());  
194 - }  
195 - }  
196 -  
197 - sch.setFcsjActualAll(gps.getTimestamp());  
198 - logger.info("(站外)班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual());  
199 - }  
200 - }  
201 -  
202 - /**  
203 - * 公交车到达终点  
204 - *  
205 - * @param sch  
206 - * @param gps  
207 - */  
208 - private static void arriveEnd(ScheduleRealInfo sch, GpsEntity gps) {  
209 - sch.setZdsjActualAll(gps.getTimestamp());  
210 - ScheduleRealInfo next = finishPlan(sch);  
211 - logger.info("班次:" + sch.getDfsj() + "到达终点, 时间:" + sch.getZdsjActual());  
212 -  
213 - if (next == null)  
214 - return;  
215 -  
216 - //将gps转换为下一个班次走向的站内信号  
217 - int updown = Integer.parseInt(next.getXlDir());  
218 - List<StationRoute> srs = GeoCacheData.getStationRoute(next.getXlBm(), updown);  
219 - StationRoute station = GeoUtils.gpsInStation(gps, srs);  
220 - if (station != null) {  
221 - gps.setUpDown(updown);  
222 - gps.setStopNo(station.getCode());  
223 - }  
224 - }  
225 -  
226 - /**  
227 - * 出场班次  
228 - *  
229 - * @param gps  
230 - * @param sch  
231 - */  
232 - private static void outCarpark(GpsEntity gps, ScheduleRealInfo sch) {  
233 - String carpark = GeoUtils.gpsInCarpark(gps);  
234 - if (carpark != null) {  
235 - gps.setInstation(true);  
236 - gps.setStopNo(carpark);  
237 - return; // 还在场内  
238 - }  
239 -  
240 - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());  
241 - if (queue == null)  
242 - return;  
243 - //上一个gps  
244 - GpsEntity prev = queue.getTail();  
245 -  
246 - if (carpark == null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {  
247 - gps.setStopNo(prev.getStopNo());  
248 - //停车场发出  
249 - busWillDepart(sch, gps);  
250 - return;  
251 - }  
252 -  
253 - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown());  
254 - StationRoute station = GeoUtils.gpsInStation(gps, srs);  
255 -  
256 - if (station != null && station.getCode().equals(sch.getZdzCode())) {  
257 - gps.setStopNo(station.getCode());  
258 - //到达终点  
259 - arriveEnd(sch, gps);  
260 - }  
261 - }  
262 -  
263 -  
264 - /**  
265 - * 进场班次  
266 - * @param gps  
267 - * @param sch  
268 - */  
269 - private static void inCarpark(GpsEntity gps, ScheduleRealInfo sch) {  
270 - String carpark = GeoUtils.gpsInCarpark(gps);  
271 - if (carpark != null && carpark.equals(sch.getZdzCode())) {  
272 - //进场班次取第一个实际进场时间  
273 - if(sch.getZdsjActual() != null)  
274 - return;  
275 -  
276 - //进场  
277 - arriveEnd(sch, gps);  
278 - return;  
279 - }  
280 -  
281 - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());  
282 - if (queue == null)  
283 - return;  
284 - //上一个gps  
285 - GpsEntity prev = queue.getTail();  
286 -  
287 - if (carpark == null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) {  
288 - gps.setStopNo(prev.getStopNo());  
289 - //进场班次发出  
290 - busWillDepart(sch, gps);  
291 - return;  
292 - }  
293 - }  
294 -  
295 - /**  
296 - * 完成班次 -返回下一个班次  
297 - *  
298 - * @param sch  
299 - */  
300 - private static ScheduleRealInfo finishPlan(ScheduleRealInfo sch) {  
301 - ScheduleRealInfo next = dayOfSchedule.next(sch);  
302 - if (next != null) {  
303 - next.setQdzArrDatesj(sch.getZdsjActual());  
304 - dayOfSchedule.addExecPlan(next);  
305 - }  
306 - return next;  
307 - }  
308 -  
309 - @Override  
310 - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {  
311 - dayOfSchedule = applicationContext.getBean(DayOfSchedule.class);  
312 - lineConfigData = applicationContext.getBean(LineConfigData.class);  
313 - }  
314 -}  
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsStateCorrective.java deleted 100644 → 0
1 -package com.bsth.data.gpsdata.analyse.components;  
2 -  
3 -import com.bsth.data.gpsdata.GpsEntity;  
4 -import com.bsth.data.schedule.DayOfSchedule;  
5 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
6 -import com.vividsolutions.jts.geom.GeometryFactory;  
7 -import org.joda.time.format.DateTimeFormat;  
8 -import org.joda.time.format.DateTimeFormatter;  
9 -import org.slf4j.Logger;  
10 -import org.slf4j.LoggerFactory;  
11 -import org.springframework.beans.BeansException;  
12 -import org.springframework.context.ApplicationContext;  
13 -import org.springframework.context.ApplicationContextAware;  
14 -import org.springframework.stereotype.Component;  
15 -  
16 -/**  
17 - * GPS状态纠正  
18 - * Created by panzhao on 2016/12/23.  
19 - */  
20 -@Component  
21 -public class GpsStateCorrective implements ApplicationContextAware {  
22 -  
23 - static Logger logger = LoggerFactory.getLogger(GpsStateCorrective.class);  
24 -  
25 - static DayOfSchedule dayOfSchedule;  
26 -  
27 - private static GeometryFactory geometryFactory = new GeometryFactory();  
28 -  
29 - public static void correct(GpsEntity gps, ScheduleRealInfo sch){  
30 -/* int upDown = Integer.parseInt(sch.getXlDir());  
31 - gps.setUpDown(upDown);  
32 - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), upDown);  
33 -  
34 - Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));  
35 -  
36 - //之前的点位  
37 - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm());  
38 - GpsEntity prev = null;  
39 - if(queue != null)  
40 - prev = queue.getTail();  
41 -  
42 - //线路上,站点间  
43 - StationRoute station = GeoUtils.pointInStation(point, srs);  
44 - //在站内  
45 - if(station != null){  
46 - gps.setStopNo(station.getCode());  
47 - gps.setInstation(true);  
48 - gps.setStation(station);  
49 -  
50 - if(prev != null && prev.getUpDown() == upDown){  
51 - StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), upDown, prev.getStopNo());  
52 -  
53 - //倒着开??  
54 - if(prevStation.getRouteSort() > station.getRouteSort()){  
55 - reversalHandle(gps, prev, sch);  
56 - }  
57 - }  
58 - }  
59 - else{  
60 - if(prev != null)  
61 - gps.setStopNo(prev.getStopNo());  
62 - }  
63 -  
64 - //是否在停车场内  
65 - Map<String, Polygon> carparkMap = GeoCacheData.tccMap;  
66 - Set<String> codes = carparkMap.keySet();  
67 - Polygon p;  
68 - for(String code : codes){  
69 - p = carparkMap.get(code);  
70 - //场内  
71 - if(p.contains(point)){  
72 - gps.setCarparkNo(code);  
73 - if(sch.getBcType().equals("out")){  
74 - gps.setInstation(true);  
75 - gps.setStopNo(code);  
76 - }  
77 - }  
78 - }*/  
79 - }  
80 -  
81 - private static DateTimeFormatter fmt = DateTimeFormat.forPattern("HH:mm");  
82 -  
83 - private static void reversalHandle(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch){  
84 - /*if(sch.getBcType().equals("out") && gps.getTimestamp() < sch.getZdsjT())  
85 - return;  
86 -  
87 - //先假设没到终点,直接开始了下一个班次  
88 - ScheduleRealInfo next = dayOfSchedule.next(sch);  
89 - String log = "倒着开??? nbbm: " + gps.getNbbm() + " 当前:" + gps.getStopNo() + " 上一站:" + prev.getStopNo() + " 当前班次:" + sch.getDfsj();  
90 - if(next != null){  
91 - dayOfSchedule.addExecPlan(next);  
92 -  
93 - log += (" 下一个班次:" + next.getDfsj());  
94 - }  
95 -  
96 - log += (" GPS时间:" + fmt.print(gps.getTimestamp()));  
97 -  
98 - logger.info(log);*/  
99 - }  
100 -  
101 - @Override  
102 - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {  
103 - dayOfSchedule = applicationContext.getBean(DayOfSchedule.class);  
104 - }  
105 -}  
src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.java
1 -package com.bsth.data.gpsdata.analyse; 1 +package com.bsth.data.gpsdata.arrival;
2 2
3 import com.bsth.data.gpsdata.GpsEntity; 3 import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import com.bsth.data.gpsdata.arrival.utils.StationRouteComp;
4 import com.google.common.collect.ArrayListMultimap; 7 import com.google.common.collect.ArrayListMultimap;
5 import com.vividsolutions.jts.geom.Coordinate; 8 import com.vividsolutions.jts.geom.Coordinate;
6 import com.vividsolutions.jts.geom.GeometryFactory; 9 import com.vividsolutions.jts.geom.GeometryFactory;
@@ -26,8 +29,8 @@ public class GeoCacheData { @@ -26,8 +29,8 @@ public class GeoCacheData {
26 29
27 static Logger logger = LoggerFactory.getLogger(GeoCacheData.class); 30 static Logger logger = LoggerFactory.getLogger(GeoCacheData.class);
28 31
29 - //每辆车缓存最后200条gps  
30 - private static final int CACHE_SIZE = 200; 32 + //每辆车缓存最后500条gps
  33 + private static final int CACHE_SIZE = 500;
31 private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>(); 34 private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>();
32 35
33 //线路路段走向 36 //线路路段走向
@@ -36,6 +39,9 @@ public class GeoCacheData { @@ -36,6 +39,9 @@ public class GeoCacheData {
36 //线路站点路由 39 //线路站点路由
37 private static ArrayListMultimap<String, StationRoute> stationCacheMap; 40 private static ArrayListMultimap<String, StationRoute> stationCacheMap;
38 41
  42 + //线路_上下行_站点编码 ——> 站点
  43 + private static Map<String, StationRoute> routeCodeMap;
  44 +
39 //停车场 45 //停车场
40 public static Map<String, Polygon> tccMap; 46 public static Map<String, Polygon> tccMap;
41 47
@@ -49,9 +55,9 @@ public class GeoCacheData { @@ -49,9 +55,9 @@ public class GeoCacheData {
49 public static void putGps(GpsEntity gps) { 55 public static void putGps(GpsEntity gps) {
50 CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm()); 56 CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm());
51 if (queue == null) { 57 if (queue == null) {
52 - //第一个点从站内开始  
53 - if(!gps.isInstation())  
54 - return; 58 + /*//第一个点从站内开始
  59 + if (gps.getInstation() == 0)
  60 + return;*/
55 61
56 queue = new CircleQueue<>(CACHE_SIZE); 62 queue = new CircleQueue<>(CACHE_SIZE);
57 gpsCacheMap.put(gps.getNbbm(), queue); 63 gpsCacheMap.put(gps.getNbbm(), queue);
@@ -59,6 +65,20 @@ public class GeoCacheData { @@ -59,6 +65,20 @@ public class GeoCacheData {
59 queue.add(gps); 65 queue.add(gps);
60 } 66 }
61 67
  68 + public static void clear(String nbbm) {
  69 + try {
  70 + CircleQueue<GpsEntity> queue = gpsCacheMap.get(nbbm);
  71 + if (queue != null)
  72 + queue.clear();
  73 + } catch (Exception e) {
  74 + logger.error("", e);
  75 + }
  76 + }
  77 +
  78 + public static StationRoute getRouteCode(GpsEntity gps){
  79 + return routeCodeMap.get(gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo());
  80 + }
  81 +
62 public static List<StationRoute> getStationRoute(String lineCode, int directions) { 82 public static List<StationRoute> getStationRoute(String lineCode, int directions) {
63 return stationCacheMap.get(lineCode + "_" + directions); 83 return stationCacheMap.get(lineCode + "_" + directions);
64 } 84 }
@@ -74,14 +94,14 @@ public class GeoCacheData { @@ -74,14 +94,14 @@ public class GeoCacheData {
74 return null; 94 return null;
75 } 95 }
76 96
77 - public static Polygon getTccPolygon(String code){ 97 + public static Polygon getTccPolygon(String code) {
78 return tccMap.get(code); 98 return tccMap.get(code);
79 } 99 }
80 100
81 public void loadData() { 101 public void loadData() {
82 final GeometryFactory geometryFactory = new GeometryFactory(); 102 final GeometryFactory geometryFactory = new GeometryFactory();
83 //加载站点路由 103 //加载站点路由
84 - String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code"; 104 + String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE,s.STATION_NAME from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code";
85 List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() { 105 List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() {
86 @Override 106 @Override
87 public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException { 107 public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException {
@@ -93,11 +113,12 @@ public class GeoCacheData { @@ -93,11 +113,12 @@ public class GeoCacheData {
93 sRoute.setRadius(rs.getFloat("RADIUS")); 113 sRoute.setRadius(rs.getFloat("RADIUS"));
94 sRoute.setRouteSort(rs.getInt("STATION_ROUTE_CODE")); 114 sRoute.setRouteSort(rs.getInt("STATION_ROUTE_CODE"));
95 sRoute.setMark(rs.getString("STATION_MARK")); 115 sRoute.setMark(rs.getString("STATION_MARK"));
  116 + sRoute.setName(rs.getString("STATION_NAME"));
96 117
97 String shapesType = rs.getString("SHAPES_TYPE"); 118 String shapesType = rs.getString("SHAPES_TYPE");
98 //多边形电子围栏 119 //多边形电子围栏
99 if (StringUtils.isNotEmpty(shapesType) && shapesType.equals("d")) { 120 if (StringUtils.isNotEmpty(shapesType) && shapesType.equals("d")) {
100 - geometryFactory.createPolygon(parsePolygon(rs.getString("G_POLYGON_GRID"))); 121 + sRoute.setPolygon(geometryFactory.createPolygon(parsePolygon(rs.getString("G_POLYGON_GRID"))));
101 } 122 }
102 return sRoute; 123 return sRoute;
103 } 124 }
@@ -105,8 +126,11 @@ public class GeoCacheData { @@ -105,8 +126,11 @@ public class GeoCacheData {
105 //按线路和走向分组 126 //按线路和走向分组
106 if (routeList.size() > 0) { 127 if (routeList.size() > 0) {
107 ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create(); 128 ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();
  129 + Map<String, StationRoute> codeMap = new HashMap<>(routeList.size());
108 for (StationRoute sr : routeList) { 130 for (StationRoute sr : routeList) {
109 tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr); 131 tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);
  132 + //站点编码 ——> 和路由顺序对照
  133 + codeMap.put(sr.getLineCode() + "_" + sr.getDirections() + "_" + sr.getCode(), sr);
110 } 134 }
111 135
112 StationRouteComp srCom = new StationRouteComp(); 136 StationRouteComp srCom = new StationRouteComp();
@@ -118,6 +142,7 @@ public class GeoCacheData { @@ -118,6 +142,7 @@ public class GeoCacheData {
118 } 142 }
119 143
120 stationCacheMap = tempMap; 144 stationCacheMap = tempMap;
  145 + routeCodeMap = codeMap;
121 } 146 }
122 147
123 //加载停车场数据 148 //加载停车场数据
@@ -133,11 +158,11 @@ public class GeoCacheData { @@ -133,11 +158,11 @@ public class GeoCacheData {
133 tccTempMap.put(tMap.get("PARK_CODE").toString() 158 tccTempMap.put(tMap.get("PARK_CODE").toString()
134 , polygon); 159 , polygon);
135 } catch (Exception e) { 160 } catch (Exception e) {
136 - logger.error("停车场:" + tMap.get("PARK_CODE") , e); 161 + logger.error("停车场:" + tMap.get("PARK_CODE"), e);
137 } 162 }
138 } 163 }
139 164
140 - if(tccTempMap.size() > 0) 165 + if (tccTempMap.size() > 0)
141 tccMap = tccTempMap; 166 tccMap = tccTempMap;
142 } 167 }
143 168
@@ -166,5 +191,4 @@ public class GeoCacheData { @@ -166,5 +191,4 @@ public class GeoCacheData {
166 } 191 }
167 return cds; 192 return cds;
168 } 193 }
169 -  
170 } 194 }
171 \ No newline at end of file 195 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.handlers.*;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import java.util.List;
  12 +import java.util.concurrent.CountDownLatch;
  13 +import java.util.concurrent.ExecutorService;
  14 +import java.util.concurrent.Executors;
  15 +
  16 +/**
  17 + * gps 实时数据分析
  18 + * Created by panzhao on 2016/12/27.
  19 + */
  20 +@Component
  21 +public class GpsRealAnalyse {
  22 +
  23 + Logger logger = LoggerFactory.getLogger(this.getClass());
  24 +
  25 + @Autowired
  26 + OfflineSignalHandle offlineSignalHandle;
  27 + @Autowired
  28 + CorrectSignalHandle correctSignalHandle;
  29 + @Autowired
  30 + StationInsideHandle stationInsideHandle;
  31 + @Autowired
  32 + InOutStationSignalHandle inOutStationSignalHandle;
  33 + @Autowired
  34 + ReverseSignalHandle reverseSignalHandle;
  35 +
  36 + //50个线程
  37 + static ExecutorService threadPool = Executors.newFixedThreadPool(50);
  38 +
  39 + public void analyse(List<GpsEntity> list) {
  40 + CountDownLatch count = new CountDownLatch(list.size());
  41 +
  42 + for(GpsEntity gps : list)
  43 + threadPool.execute(new SignalHandleThread(gps, count));
  44 +
  45 + try {
  46 + //等待子线程结束
  47 + count.await();
  48 + } catch (InterruptedException e) {
  49 + logger.error("", e);
  50 + }
  51 + }
  52 +
  53 + public class SignalHandleThread implements Runnable {
  54 +
  55 + GpsEntity gps;
  56 + CountDownLatch count;
  57 +
  58 + SignalHandleThread(GpsEntity gps, CountDownLatch count) {
  59 + this.gps = gps;
  60 + this.count = count;
  61 + }
  62 +
  63 + @Override
  64 + public void run() {
  65 +
  66 + try {
  67 + CircleQueue<GpsEntity> prevs = GeoCacheData.getGps(gps.getNbbm());
  68 + //掉线处理
  69 + offlineSignalHandle.handle(gps, prevs);
  70 + //状态处理
  71 + if(!correctSignalHandle.handle(gps, prevs))
  72 + return;
  73 + //场,站内外判断
  74 + stationInsideHandle.handle(gps, prevs);
  75 + //反向处理
  76 + reverseSignalHandle.handle(gps, prevs);
  77 + //进出站动作处理
  78 + inOutStationSignalHandle.handle(gps, prevs);
  79 + GeoCacheData.putGps(gps);
  80 +
  81 + } catch (Exception e) {
  82 + logger.error("", e);
  83 + } finally {
  84 + count.countDown();
  85 + }
  86 + }
  87 + }
  88 +}
src/main/java/com/bsth/data/gpsdata/arrival/SignalHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  5 +
  6 +/**
  7 + * Created by panzhao on 2016/12/27.
  8 + */
  9 +public abstract class SignalHandle {
  10 +
  11 + public abstract boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs);
  12 +
  13 + protected boolean isNotEmpty(CircleQueue<GpsEntity> prevs) {
  14 + return prevs != null && prevs.size() > 0 && prevs.getTail() != null;
  15 + }
  16 +
  17 + /**
  18 + * 是不是异常信号
  19 + *
  20 + * @param gps
  21 + * @return
  22 + */
  23 + protected boolean isAbnormal(GpsEntity gps) {
  24 + return gps.getLat() == 0 || gps.getLon() == 0;
  25 + }
  26 +
  27 + /**
  28 + * 连续异常信号个数统计
  29 + *
  30 + * @param prevs
  31 + * @return
  32 + */
  33 + protected int abnormalCount(CircleQueue<GpsEntity> prevs) {
  34 + int count = 0;
  35 +
  36 + if (!isNotEmpty(prevs))
  37 + return count;
  38 +
  39 + GpsEntity[] array = (GpsEntity[]) prevs.getQueue();
  40 + GpsEntity gps;
  41 + for (int i = array.length - 1; i > 0; i--) {
  42 + gps = array[i];
  43 +
  44 + if (isAbnormal(gps))
  45 + count++;
  46 + else
  47 + break;
  48 + }
  49 +
  50 + return count;
  51 + }
  52 +
  53 + /**
  54 + * 车辆运行轨迹(最近20分钟)
  55 + * 0:上行 1:下行 -1:未知
  56 + *
  57 + * @param gps
  58 + * @return
  59 + */
  60 + protected int runTrack(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  61 + int rs = -1, count = 0;
  62 +
  63 + long et = gps.getTimestamp() - (1000 * 60 * 20);
  64 + Object[] array = prevs.getQueue();
  65 + GpsEntity prev;
  66 + for(Object obj : array){
  67 + prev = (GpsEntity) obj;
  68 + if(prev.getTimestamp() < et)
  69 + break;
  70 +
  71 +
  72 + }
  73 + //for()
  74 + return 0;
  75 + }
  76 +
  77 +}
src/main/java/com/bsth/data/gpsdata/arrival/entity/RouteReverse.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +/** 路由反转
  4 + * Created by panzhao on 2016/12/28.
  5 + */
  6 +public class RouteReverse {
  7 +
  8 + //反转个数
  9 + private int count;
  10 +
  11 + //详细 1,2,3,2,1
  12 + private String detail;
  13 +
  14 + //掉头站点
  15 + private String turned;
  16 +
  17 + //开始时间
  18 + private long st;
  19 +
  20 + //掉头时间
  21 + private long zt;
  22 +
  23 + //结束时间
  24 + private long et;
  25 +
  26 + //是否闭合
  27 + private boolean close;
  28 +
  29 + public int getCount() {
  30 + return count;
  31 + }
  32 +
  33 + public void setCount(int count) {
  34 + this.count = count;
  35 + }
  36 +
  37 + public String getDetail() {
  38 + return detail;
  39 + }
  40 +
  41 + public void setDetail(String detail) {
  42 + this.detail = detail;
  43 + }
  44 +
  45 + public String getTurned() {
  46 + return turned;
  47 + }
  48 +
  49 + public void setTurned(String turned) {
  50 + this.turned = turned;
  51 + }
  52 +
  53 + public long getSt() {
  54 + return st;
  55 + }
  56 +
  57 + public void setSt(long st) {
  58 + this.st = st;
  59 + }
  60 +
  61 + public long getEt() {
  62 + return et;
  63 + }
  64 +
  65 + public void setEt(long et) {
  66 + this.et = et;
  67 + }
  68 +
  69 + public boolean isClose() {
  70 + return close;
  71 + }
  72 +
  73 + public void setClose(boolean close) {
  74 + this.close = close;
  75 + }
  76 +
  77 + public long getZt() {
  78 + return zt;
  79 + }
  80 +
  81 + public void setZt(long zt) {
  82 + this.zt = zt;
  83 + }
  84 +}
src/main/java/com/bsth/data/gpsdata/analyse/StationRoute.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/entity/StationRoute.java
1 -package com.bsth.data.gpsdata.analyse; 1 +package com.bsth.data.gpsdata.arrival.entity;
2 2
3 import com.vividsolutions.jts.geom.Point; 3 import com.vividsolutions.jts.geom.Point;
4 import com.vividsolutions.jts.geom.Polygon; 4 import com.vividsolutions.jts.geom.Polygon;
@@ -58,6 +58,8 @@ public class StationRoute { @@ -58,6 +58,8 @@ public class StationRoute {
58 */ 58 */
59 private StationRoute prve; 59 private StationRoute prve;
60 60
  61 + private String name;
  62 +
61 public String getCode() { 63 public String getCode() {
62 return code; 64 return code;
63 } 65 }
@@ -137,5 +139,13 @@ public class StationRoute { @@ -137,5 +139,13 @@ public class StationRoute {
137 public void setMark(String mark) { 139 public void setMark(String mark) {
138 this.mark = mark; 140 this.mark = mark;
139 } 141 }
  142 +
  143 + public String getName() {
  144 + return name;
  145 + }
  146 +
  147 + public void setName(String name) {
  148 + this.name = name;
  149 + }
140 } 150 }
141 151
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import com.bsth.data.schedule.DayOfSchedule;
  7 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  8 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +/**
  13 + * 信号状态纠正
  14 + * Created by panzhao on 2016/12/27.
  15 + */
  16 +@Component
  17 +public class CorrectSignalHandle extends SignalHandle {
  18 +
  19 + @Autowired
  20 + DayOfSchedule dayOfSchedule;
  21 +
  22 + @Override
  23 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  24 + Object task = dayOfSchedule.executeCurr(gps.getNbbm());
  25 + if(task == null)
  26 + return false;
  27 + ScheduleRealInfo sch;
  28 +
  29 + //子任务
  30 + if(task.getClass().isAssignableFrom(ChildTaskPlan.class)){
  31 + ChildTaskPlan childTask = (ChildTaskPlan) task;
  32 + sch = childTask.getSchedule();
  33 + }
  34 + else
  35 + sch = (ScheduleRealInfo) task;
  36 +
  37 + int updown = Integer.parseInt(sch.getXlDir());
  38 + //走向
  39 + if(gps.getUpDown() != updown){
  40 + gps.setUpDown(updown);
  41 + gps.setState(0);
  42 + }
  43 +
  44 +
  45 + return true;
  46 + }
  47 +}
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.LineConfigData;
  4 +import com.bsth.data.gpsdata.GpsEntity;
  5 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  6 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  7 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  8 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  9 +import com.bsth.data.gpsdata.arrival.utils.GeoUtils;
  10 +import com.bsth.data.schedule.DayOfSchedule;
  11 +import com.bsth.entity.realcontrol.LineConfig;
  12 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  13 +import com.bsth.service.directive.DirectiveService;
  14 +import com.bsth.websocket.handler.SendUtils;
  15 +import org.slf4j.Logger;
  16 +import org.slf4j.LoggerFactory;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.stereotype.Component;
  19 +
  20 +import java.util.List;
  21 +
  22 +/**
  23 + * 进出站动作处理
  24 + * Created by panzhao on 2016/12/27.
  25 + */
  26 +@Component
  27 +public class InOutStationSignalHandle extends SignalHandle{
  28 +
  29 + Logger logger = LoggerFactory.getLogger(this.getClass());
  30 +
  31 + @Autowired
  32 + DayOfSchedule dayOfSchedule;
  33 +
  34 + @Autowired
  35 + LineConfigData lineConfigData;
  36 +
  37 + @Autowired
  38 + SendUtils sendUtils;
  39 +
  40 + @Autowired
  41 + DirectiveService directiveService;
  42 +
  43 + @Override
  44 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  45 +
  46 + if(isNotEmpty(prevs)){
  47 + GpsEntity prev = prevs.getTail();
  48 + if(isOutStation(gps, prev))
  49 + outStation(gps, prev);
  50 +
  51 +
  52 + if(isInStation(gps, prev))
  53 + inStation(gps, prev);
  54 + }
  55 +
  56 + return true;
  57 + }
  58 +
  59 + private boolean isOutStation(GpsEntity gps, GpsEntity prev){
  60 + //从站内到站外
  61 + if(prev.getInstation() > 0 && gps.getInstation() == 0)
  62 + return true;
  63 +
  64 + //从站内到另一个站内
  65 + if(prev.getInstation() > 0 && gps.getInstation() > 0
  66 + && !prev.getStopNo().equals(gps.getStopNo()))
  67 + return true;
  68 + return false;
  69 + }
  70 +
  71 + private boolean isInStation(GpsEntity gps, GpsEntity prev){
  72 + //从站外到站内
  73 + if(prev.getInstation() == 0 && gps.getInstation() > 0
  74 + /*&& !prev.getStopNo().equals(gps.getStopNo())*/){
  75 + return true;
  76 + }
  77 +
  78 + //从站内到另一个站内
  79 + if(prev.getInstation() > 0 && gps.getInstation() > 0
  80 + && !prev.getStopNo().equals(gps.getStopNo()))
  81 + return true;
  82 + return false;
  83 + }
  84 +
  85 + /**
  86 + * 出站
  87 + * @param gps 当前点
  88 + * @param prev 上一个点
  89 + */
  90 + private void outStation(GpsEntity gps, GpsEntity prev) {
  91 + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
  92 + String qdzCode = sch.getQdzCode();
  93 +
  94 +
  95 + //if(sch.getFcsjActual() != )
  96 +
  97 + //起点发车
  98 + if(qdzCode != null && prev.getStopNo().equals(qdzCode)
  99 + && !willDepart(gps, prev, sch)){
  100 +
  101 + sch.setFcsjActualAll(gps.getTimestamp());
  102 + //通知客户端
  103 + sendUtils.sendFcsj(sch);
  104 + //持久化
  105 + dayOfSchedule.save(sch);
  106 +
  107 + //出站既出场
  108 + outStationAndOutPark(sch);
  109 + logger.info("班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual());
  110 + }
  111 + }
  112 +
  113 + private void outStationAndOutPark(ScheduleRealInfo sch){
  114 + LineConfig config = lineConfigData.get(sch.getXlBm());
  115 + if (config != null && config.getOutConfig() == 2) {
  116 + //出站既出场
  117 + ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
  118 + if (schPrev != null && schPrev.getBcType().equals("out")) {
  119 + schPrev.setFcsjActualAll(sch.getFcsjActual());
  120 + schPrev.setZdsjActualAll(sch.getFcsjActual());
  121 + }
  122 + }
  123 + }
  124 +
  125 + /**
  126 + * 进站
  127 + * @param gps 当前点
  128 + * @param prev 上一个点
  129 + */
  130 + private void inStation(GpsEntity gps, GpsEntity prev){
  131 + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
  132 + String zdzCode = sch.getZdzCode();
  133 +
  134 + if(zdzCode != null && gps.getStopNo().equals(zdzCode)){
  135 +
  136 + sch.setZdsjActualAll(gps.getTimestamp());
  137 + //已完成班次数
  138 + int doneSum = dayOfSchedule.doneSum(sch.getClZbh());
  139 + ScheduleRealInfo next = dayOfSchedule.next(sch);
  140 + //通知客户端
  141 + sendUtils.sendZdsj(sch, next, doneSum);
  142 + //持久化
  143 + dayOfSchedule.save(sch);
  144 + //下发调度指令
  145 + //directiveService.send60Dispatch(next, doneSum, "到站@系统");
  146 +
  147 + //准备执行下一个班次
  148 + if (next != null) {
  149 + next.setQdzArrDatesj(sch.getZdsjActual());
  150 + dayOfSchedule.addExecPlan(next);
  151 +
  152 + //进站既进场
  153 + inStationAndInPark(sch, next);
  154 +
  155 + //将gps转换为下一个班次走向的站内信号
  156 + int updown = Integer.parseInt(next.getXlDir());
  157 + List<StationRoute> srs = GeoCacheData.getStationRoute(next.getXlBm(), updown);
  158 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  159 + if (station != null) {
  160 + gps.setUpDown(updown);
  161 + gps.setStopNo(station.getCode());
  162 + }
  163 + }
  164 + }
  165 + /* //如果出场班次计划终点时间5分钟后还未完成,检查一下车辆轨迹,是否已经在执行线路上班次
  166 + else if(sch.getBcType().equals("out")
  167 + && sch.getZdsj() != null
  168 + && gps.getTimestamp() - sch.getZdsjT() >= 1000 * 60 * 5){
  169 + logger.info("出场班次计划终点时间5分钟后还未完成");
  170 +
  171 + }*/
  172 + }
  173 +
  174 + /**
  175 + * 进站既进场
  176 + * @param sch
  177 + */
  178 + private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next){
  179 + LineConfig config = lineConfigData.get(sch.getXlBm());
  180 + if (next.getBcType().equals("in") &&
  181 + config != null && config.getOutConfig() == 2) {
  182 + next.setFcsjActualAll(sch.getZdsjActual());
  183 + next.setZdsjActualAll(sch.getZdsjActual());
  184 + }
  185 + }
  186 +
  187 + /**
  188 + * 发车漂移判定(这里出现的误判,由车辆到达中途站的时候补偿)
  189 + * @param gps
  190 + * @param prev
  191 + * @param task
  192 + * @return
  193 + */
  194 + private boolean willDepart(GpsEntity gps, GpsEntity prev, Object task){
  195 +
  196 +/* ScheduleRealInfo sch = (ScheduleRealInfo) task;
  197 + ScheduleRealInfo prevTask = dayOfSchedule.prev(sch);
  198 + if(prevTask == null || prevTask.getBcType().equals("out"))
  199 + return false;
  200 +
  201 + //计划停站时间
  202 + int stopTimePlan = (int) (sch.getDfsjT() - prevTask.getZdsjT());
  203 +
  204 + if(stopTimePlan < 1000 * 60 * 10)
  205 + return false;
  206 +
  207 + //实际停站时间
  208 + if(prevTask.getZdsjActual() != null){
  209 + int actualTime = (int) (gps.getTimestamp() - prevTask.getZdsjActualTime());
  210 +
  211 + if(actualTime < stopTimePlan * 0.8){
  212 + logger.info("漂移判定");
  213 +
  214 + return true;
  215 + }
  216 + }*/
  217 + return false;
  218 + }
  219 +}
src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  6 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 信号断线重连处理
  11 + * Created by panzhao on 2016/12/27.
  12 + */
  13 +@Component
  14 +public class OfflineSignalHandle extends SignalHandle{
  15 +
  16 + //断开3分钟,标记为重连信号
  17 + private final static int OFFLINE_TIME = 1000 * 60 * 3;
  18 +
  19 + //断开70分钟,之前的信号不再有参考价值
  20 + private final static int CLEAR_TIME = 1000 * 60 * 70;
  21 +
  22 + @Override
  23 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  24 + //异常信号不管
  25 + if(isAbnormal(gps)){
  26 + return true;
  27 + }
  28 +
  29 + if(isNotEmpty(prevs)){
  30 + GpsEntity prev = prevs.getTail();
  31 + int space = (int) (gps.getTimestamp() - prev.getTimestamp());
  32 + if(space > OFFLINE_TIME)
  33 + gps.setSignalState("reconnection");
  34 +
  35 + if(space > CLEAR_TIME){
  36 + //清理缓存的信号
  37 + GeoCacheData.clear(gps.getNbbm());
  38 + }
  39 + }
  40 + return true;
  41 + }
  42 +}
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.bsth.data.gpsdata.GpsEntity;
  5 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  6 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  7 +import com.bsth.data.gpsdata.arrival.entity.RouteReverse;
  8 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  9 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  10 +import com.bsth.data.schedule.DayOfSchedule;
  11 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +/**
  18 + * 路由反向信号处理
  19 + * Created by panzhao on 2016/12/28.
  20 + */
  21 +@Component
  22 +public class ReverseSignalHandle extends SignalHandle {
  23 +
  24 + Logger logger = LoggerFactory.getLogger(this.getClass());
  25 +
  26 + @Autowired
  27 + DayOfSchedule dayOfSchedule;
  28 +
  29 + @Override
  30 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  31 + if (!isNotEmpty(prevs))
  32 + return false;
  33 +
  34 + GpsEntity prev = prevs.getTail();
  35 +
  36 + if (isReverse(gps, prev)) {
  37 + RouteReverse reverse = reverseSearch(prevs, gps);
  38 +
  39 + if (reverse.getCount() >= 2) {
  40 + //切换到下一个班次
  41 + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
  42 + if (sch.getBcType().equals("out") && sch.getZdsjT() != null && sch.getZdsjT() > gps.getTimestamp()) {
  43 + return false;
  44 + }
  45 + dayOfSchedule.addExecPlan(dayOfSchedule.next(sch));
  46 +
  47 + if (reverse.isClose()) {
  48 + logger.info("区间掉头,车辆:" + gps.getNbbm() + " -" + JSON.toJSONString(reverse));
  49 + }
  50 + }
  51 + }
  52 + return false;
  53 + }
  54 +
  55 + /**
  56 + * 搜索路由反向详细
  57 + *
  58 + * @param prevs
  59 + * @param gps
  60 + * @return
  61 + */
  62 + public RouteReverse reverseSearch(CircleQueue<GpsEntity> prevs, GpsEntity gps) {
  63 + RouteReverse routeReverse = new RouteReverse();
  64 + int count = 0;
  65 + String path = "";
  66 + String turned = null;
  67 +
  68 + //当前站点
  69 + StationRoute curr = GeoCacheData.getRouteCode(gps), sr;
  70 + GpsEntity prev;
  71 + Object[] array = prevs.getQueue();
  72 + for (int i = array.length - 1; i > 0; i--) {
  73 + prev = (GpsEntity) array[i];
  74 +
  75 + if(!prev.getUpDown().equals(gps.getUpDown()))
  76 + break;
  77 +
  78 + if (prev.getInstation() == 1) {
  79 + sr = GeoCacheData.getRouteCode(prev);
  80 +
  81 + if (sr.getRouteSort() > curr.getRouteSort()) {
  82 + path += (curr.getCode() + ",");
  83 + count++;
  84 + } else if (sr.getRouteSort() < curr.getRouteSort()) {
  85 + path += (curr.getCode() + ",");
  86 + //掉头点
  87 + if (turned == null)
  88 + turned = prev.getStopNo();
  89 +
  90 + //路径闭合
  91 + if (sr.getCode().equals(gps.getStopNo())) {
  92 + routeReverse.setClose(true);
  93 + path += sr.getCode();
  94 + break;
  95 + }
  96 + }
  97 +
  98 + curr = sr;
  99 + }
  100 + }
  101 +
  102 + routeReverse.setCount(count);
  103 + routeReverse.setDetail(path);
  104 + routeReverse.setTurned(turned);
  105 + return routeReverse;
  106 + }
  107 +
  108 + /**
  109 + * 是否反向
  110 + *
  111 + * @param gps
  112 + * @param prev
  113 + * @return
  114 + */
  115 + public boolean isReverse(GpsEntity gps, GpsEntity prev) {
  116 + if (gps.getInstation() == 1
  117 + &&
  118 + gps.getUpDown().equals(prev.getUpDown())
  119 + && !gps.getStopNo().equals(prev.getStopNo())) {
  120 +
  121 + StationRoute currStation = GeoCacheData.getRouteCode(gps);
  122 + StationRoute prevStation = GeoCacheData.getRouteCode(prev);
  123 +
  124 + if (currStation == null || prevStation == null)
  125 + return false;
  126 +
  127 + if (currStation.getRouteSort() < prevStation.getRouteSort())
  128 + return true;
  129 + }
  130 + return false;
  131 + }
  132 +}
src/main/java/com/bsth/data/gpsdata/arrival/handlers/StationInsideHandle.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.handlers;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.SignalHandle;
  6 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  7 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  8 +import com.bsth.data.gpsdata.arrival.utils.GeoUtils;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * 站内站外判定
  15 + * Created by panzhao on 2016/12/27.
  16 + */
  17 +@Component
  18 +public class StationInsideHandle extends SignalHandle {
  19 +
  20 +
  21 + @Override
  22 + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
  23 + //是否在场内
  24 + String parkCode = GeoUtils.gpsInCarpark(gps);
  25 + if (parkCode != null) {
  26 + gps.setInstation(2);
  27 + gps.setStopNo(parkCode);
  28 + }
  29 +
  30 + //是否在站内
  31 + List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown());
  32 + StationRoute station = GeoUtils.gpsInStation(gps, srs);
  33 + if (station != null) {
  34 + gps.setInstation(1);
  35 + gps.setStopNo(station.getCode());
  36 + gps.setStation(station);
  37 + }
  38 +
  39 + //在场,站外
  40 + if(gps.getInstation() == 0 && isNotEmpty(prevs)){
  41 + //继承上一个点的站点编码
  42 + GpsEntity prev = prevs.getTail();
  43 + gps.setStopNo(prev.getStopNo());
  44 + }
  45 +
  46 + return true;
  47 + }
  48 +}
src/main/java/com/bsth/data/gpsdata/analyse/CircleQueue.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/CircleQueue.java
1 -package com.bsth.data.gpsdata.analyse; 1 +package com.bsth.data.gpsdata.arrival.utils;
2 2
3 import java.util.Arrays; 3 import java.util.Arrays;
4 4
@@ -19,12 +19,12 @@ public class CircleQueue&lt;T&gt; { @@ -19,12 +19,12 @@ public class CircleQueue&lt;T&gt; {
19 public Object[] elementData; 19 public Object[] elementData;
20 20
21 /** 21 /**
22 - * 队头(先进先出) 22 + *
23 */ 23 */
24 public int head = 0; 24 public int head = 0;
25 25
26 /** 26 /**
27 - * 27 + *
28 */ 28 */
29 public int tail = 0; 29 public int tail = 0;
30 30
@@ -39,7 +39,7 @@ public class CircleQueue&lt;T&gt; { @@ -39,7 +39,7 @@ public class CircleQueue&lt;T&gt; {
39 } 39 }
40 40
41 /** 41 /**
42 - * 获取循环队列的大小(包含元素的个数) 42 + * 获取循环队列的大小
43 */ 43 */
44 public int size() { 44 public int size() {
45 if (isEmpty()) { 45 if (isEmpty()) {
@@ -87,10 +87,12 @@ public class CircleQueue&lt;T&gt; { @@ -87,10 +87,12 @@ public class CircleQueue&lt;T&gt; {
87 * @return 取 循环队列里的值(先进的index=0) 87 * @return 取 循环队列里的值(先进的index=0)
88 */ 88 */
89 public Object[] getQueue() { 89 public Object[] getQueue() {
90 - final Object[] elementDataSort = new Object[capacity]; 90 + final Object[] elementDataSort;
91 final Object[] elementDataCopy = elementData.clone(); 91 final Object[] elementDataCopy = elementData.clone();
92 if (isEmpty()) { 92 if (isEmpty()) {
  93 + elementDataSort = new Object[0];
93 } else if (isFull()) { 94 } else if (isFull()) {
  95 + elementDataSort = new Object[capacity];
94 int indexMax = capacity; 96 int indexMax = capacity;
95 int indexSort = 0; 97 int indexSort = 0;
96 for (int i = head; i < indexMax;) { 98 for (int i = head; i < indexMax;) {
@@ -103,6 +105,7 @@ public class CircleQueue&lt;T&gt; { @@ -103,6 +105,7 @@ public class CircleQueue&lt;T&gt; {
103 } 105 }
104 } 106 }
105 } else { 107 } else {
  108 + elementDataSort = new Object[tail];
106 for (int i = 0; i < tail; i++) { 109 for (int i = 0; i < tail; i++) {
107 elementDataSort[i] = elementDataCopy[i]; 110 elementDataSort[i] = elementDataCopy[i];
108 } 111 }
@@ -110,6 +113,10 @@ public class CircleQueue&lt;T&gt; { @@ -110,6 +113,10 @@ public class CircleQueue&lt;T&gt; {
110 return elementDataSort; 113 return elementDataSort;
111 } 114 }
112 115
  116 + /**
  117 + * 取最后一个值
  118 + * @return
  119 + */
113 public T getTail(){ 120 public T getTail(){
114 return elementData[tail] == null?null:(T)elementData[tail]; 121 return elementData[tail] == null?null:(T)elementData[tail];
115 } 122 }
src/main/java/com/bsth/data/gpsdata/analyse/util/GeoUtils.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/GeoUtils.java
1 -package com.bsth.data.gpsdata.analyse.util; 1 +package com.bsth.data.gpsdata.arrival.utils;
2 2
3 import com.bsth.data.gpsdata.GpsEntity; 3 import com.bsth.data.gpsdata.GpsEntity;
4 -import com.bsth.data.gpsdata.analyse.GeoCacheData;  
5 -import com.bsth.data.gpsdata.analyse.StationRoute; 4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
6 import com.vividsolutions.jts.geom.Coordinate; 6 import com.vividsolutions.jts.geom.Coordinate;
7 import com.vividsolutions.jts.geom.GeometryFactory; 7 import com.vividsolutions.jts.geom.GeometryFactory;
8 import com.vividsolutions.jts.geom.Point; 8 import com.vividsolutions.jts.geom.Point;
src/main/java/com/bsth/data/gpsdata/analyse/StationRouteComp.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/StationRouteComp.java
1 -package com.bsth.data.gpsdata.analyse; 1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
2 4
3 import java.util.Comparator; 5 import java.util.Comparator;
4 6
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
@@ -2,13 +2,19 @@ package com.bsth.data.gpsdata.recovery; @@ -2,13 +2,19 @@ package com.bsth.data.gpsdata.recovery;
2 2
3 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
4 import com.bsth.data.gpsdata.GpsEntity; 4 import com.bsth.data.gpsdata.GpsEntity;
5 -import com.bsth.data.gpsdata.analyse.components.GpsArrival; 5 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  6 +import com.bsth.data.gpsdata.arrival.handlers.*;
  7 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
6 import com.bsth.util.db.DBUtils_MS; 8 import com.bsth.util.db.DBUtils_MS;
7 import com.google.common.collect.ArrayListMultimap; 9 import com.google.common.collect.ArrayListMultimap;
8 import org.slf4j.Logger; 10 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 11 import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.BeansException;
  13 +import org.springframework.context.ApplicationContext;
  14 +import org.springframework.context.ApplicationContextAware;
10 import org.springframework.jdbc.core.JdbcTemplate; 15 import org.springframework.jdbc.core.JdbcTemplate;
11 import org.springframework.jdbc.core.RowMapper; 16 import org.springframework.jdbc.core.RowMapper;
  17 +import org.springframework.stereotype.Component;
12 18
13 import java.sql.ResultSet; 19 import java.sql.ResultSet;
14 import java.sql.SQLException; 20 import java.sql.SQLException;
@@ -18,20 +24,25 @@ import java.util.concurrent.ExecutorService; @@ -18,20 +24,25 @@ import java.util.concurrent.ExecutorService;
18 import java.util.concurrent.Executors; 24 import java.util.concurrent.Executors;
19 25
20 /** 26 /**
21 - * 数据恢复 27 + * gps数据恢复
22 * Created by panzhao on 2016/12/24. 28 * Created by panzhao on 2016/12/24.
23 */ 29 */
24 -public class GpsDataRecovery { 30 +@Component
  31 +public class GpsDataRecovery implements ApplicationContextAware{
25 32
26 static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class); 33 static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class);
27 34
28 public static boolean run; 35 public static boolean run;
29 36
30 - static ExecutorService threadPool = Executors.newFixedThreadPool(50); 37 + static ExecutorService threadPool = Executors.newFixedThreadPool(10);
31 38
32 - private static CountDownLatch count; 39 + static OfflineSignalHandle offlineSignalHandle;
  40 + static CorrectSignalHandle correctSignalHandle;
  41 + static StationInsideHandle stationInsideHandle;
  42 + static InOutStationSignalHandle inOutStationSignalHandle;
  43 + static ReverseSignalHandle reverseSignalHandle;
33 44
34 - public static void recovery() { 45 + public void recovery() {
35 List<GpsEntity> list = loadData(); 46 List<GpsEntity> list = loadData();
36 47
37 //按车辆分组数据 48 //按车辆分组数据
@@ -41,18 +52,20 @@ public class GpsDataRecovery { @@ -41,18 +52,20 @@ public class GpsDataRecovery {
41 listMap.put(gps.getNbbm(), gps); 52 listMap.put(gps.getNbbm(), gps);
42 } 53 }
43 54
44 - count = new CountDownLatch(listMap.keySet().size());  
45 55
46 Set<String> keys = listMap.keySet(); 56 Set<String> keys = listMap.keySet();
  57 +
  58 + CountDownLatch count = new CountDownLatch(keys.size());
  59 + GpsComp comp = new GpsComp();
47 for (String nbbm : keys) { 60 for (String nbbm : keys) {
48 - threadPool.execute(new RecoveryDataThread(listMap.get(nbbm), count));  
49 - /*if(nbbm.equals("W9A-250"))  
50 - new RecoveryDataThread(listMap.get(nbbm), count).run();*/ 61 + Collections.sort(listMap.get(nbbm), comp);
  62 + threadPool.execute(new RecoveryThread(listMap.get(nbbm), count));
51 } 63 }
  64 +
52 try { 65 try {
53 - //等待子线程结束  
54 count.await(); 66 count.await();
55 - logger.info("GPS 数据恢复完成...."); 67 + run = false;
  68 + logger.info("数据恢复完成....");
56 } catch (InterruptedException e) { 69 } catch (InterruptedException e) {
57 logger.error("", e); 70 logger.error("", e);
58 } 71 }
@@ -63,11 +76,11 @@ public class GpsDataRecovery { @@ -63,11 +76,11 @@ public class GpsDataRecovery {
63 * 76 *
64 * @return 77 * @return
65 */ 78 */
66 - public static List<GpsEntity> loadData() { 79 + public List<GpsEntity> loadData() {
67 Calendar calendar = Calendar.getInstance(); 80 Calendar calendar = Calendar.getInstance();
68 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); 81 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
69 82
70 - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from BSTH_C_GPS_INFO where days_year=" + dayOfYear; 83 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear;
71 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); 84 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
72 85
73 List<GpsEntity> list = 86 List<GpsEntity> list =
@@ -102,43 +115,58 @@ public class GpsDataRecovery { @@ -102,43 +115,58 @@ public class GpsDataRecovery {
102 return (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0); 115 return (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0);
103 } 116 }
104 117
105 - public static class RecoveryDataThread implements Runnable { 118 + @Override
  119 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  120 + offlineSignalHandle = applicationContext.getBean(OfflineSignalHandle.class);
  121 + correctSignalHandle = applicationContext.getBean(CorrectSignalHandle.class);
  122 + stationInsideHandle = applicationContext.getBean(StationInsideHandle.class);
  123 + inOutStationSignalHandle = applicationContext.getBean(InOutStationSignalHandle.class);
  124 + reverseSignalHandle = applicationContext.getBean(ReverseSignalHandle.class);
  125 + }
  126 +
  127 + public static class GpsComp implements Comparator<GpsEntity>{
  128 +
  129 + @Override
  130 + public int compare(GpsEntity g1, GpsEntity g2) {
  131 + return g1.getTimestamp().compareTo(g2.getTimestamp());
  132 + }
  133 + }
106 134
  135 + public static class RecoveryThread implements Runnable{
107 List<GpsEntity> list; 136 List<GpsEntity> list;
108 CountDownLatch count; 137 CountDownLatch count;
109 138
110 - public RecoveryDataThread(List<GpsEntity> list, CountDownLatch count) { 139 + RecoveryThread(List<GpsEntity> list, CountDownLatch count){
111 this.list = list; 140 this.list = list;
112 this.count = count; 141 this.count = count;
113 } 142 }
114 -  
115 @Override 143 @Override
116 public void run() { 144 public void run() {
117 try { 145 try {
118 - //排序  
119 - Collections.sort(list, new GpsComp());  
120 - //依次跑完gps  
121 - //int i = 0; 146 + //循环gps恢复数据
  147 + CircleQueue<GpsEntity> prevs;
  148 +
122 for(GpsEntity gps : list){ 149 for(GpsEntity gps : list){
123 - /* i++;  
124 - if(i == 383){  
125 - System.out.println("aaa");  
126 - }*/  
127 - GpsArrival.arrival(gps); 150 + prevs = GeoCacheData.getGps(gps.getNbbm());
  151 + //掉线处理
  152 + offlineSignalHandle.handle(gps, prevs);
  153 + //状态处理
  154 + if(!correctSignalHandle.handle(gps, prevs))
  155 + continue;
  156 + //场,站内外判断
  157 + stationInsideHandle.handle(gps, prevs);
  158 + //反向处理
  159 + reverseSignalHandle.handle(gps, prevs);
  160 + //进出站动作处理
  161 + inOutStationSignalHandle.handle(gps, prevs);
  162 + GeoCacheData.putGps(gps);
128 } 163 }
129 - } catch (Exception e) { 164 + }catch (Exception e){
130 logger.error("", e); 165 logger.error("", e);
131 - } finally { 166 + }
  167 + finally {
132 count.countDown(); 168 count.countDown();
133 } 169 }
134 } 170 }
135 } 171 }
136 -  
137 - public static class GpsComp implements Comparator<GpsEntity>{  
138 -  
139 - @Override  
140 - public int compare(GpsEntity g1, GpsEntity g2) {  
141 - return (int) (g1.getTimestamp() - g2.getTimestamp());  
142 - }  
143 - }  
144 -} 172 +}
145 \ No newline at end of file 173 \ No newline at end of file
src/main/java/com/bsth/data/pilot80/PilotReport.java
1 package com.bsth.data.pilot80; 1 package com.bsth.data.pilot80;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.Collection;  
5 -import java.util.List;  
6 -  
7 -import org.slf4j.Logger;  
8 -import org.slf4j.LoggerFactory;  
9 -import org.springframework.beans.factory.annotation.Autowired;  
10 -import org.springframework.stereotype.Component;  
11 -  
12 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
13 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
14 import com.bsth.data.gpsdata.GpsEntity; 5 import com.bsth.data.gpsdata.GpsEntity;
@@ -23,6 +14,14 @@ import com.bsth.repository.directive.D80Repository; @@ -23,6 +14,14 @@ import com.bsth.repository.directive.D80Repository;
23 import com.bsth.service.directive.DirectiveService; 14 import com.bsth.service.directive.DirectiveService;
24 import com.bsth.websocket.handler.SendUtils; 15 import com.bsth.websocket.handler.SendUtils;
25 import com.google.common.collect.ArrayListMultimap; 16 import com.google.common.collect.ArrayListMultimap;
  17 +import org.slf4j.Logger;
  18 +import org.slf4j.LoggerFactory;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Component;
  21 +
  22 +import java.util.ArrayList;
  23 +import java.util.Collection;
  24 +import java.util.List;
26 25
27 /** 26 /**
28 * 27 *
@@ -180,7 +179,7 @@ public class PilotReport { @@ -180,7 +179,7 @@ public class PilotReport {
180 return; 179 return;
181 180
182 LineConfig conf = lineConfigData.get(sch.getXlBm()); 181 LineConfig conf = lineConfigData.get(sch.getXlBm());
183 - if(conf.getInConfig() == 1){ 182 + if(conf.getOutConfig() == 1){
184 //为相关班次写入进场时间 183 //为相关班次写入进场时间
185 sch.setZdsjActualAll(d80.getTimestamp()); 184 sch.setZdsjActualAll(d80.getTimestamp());
186 185
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -37,547 +37,538 @@ import java.util.*; @@ -37,547 +37,538 @@ import java.util.*;
37 import java.util.concurrent.TimeUnit; 37 import java.util.concurrent.TimeUnit;
38 38
39 /** 39 /**
40 - * 40 + * @author PanZhao
41 * @ClassName: DayOfSchedule 41 * @ClassName: DayOfSchedule
42 * @Description: TODO(当日实际排班) 42 * @Description: TODO(当日实际排班)
43 - * @author PanZhao  
44 * @date 2016年8月15日 上午10:16:12 43 * @date 2016年8月15日 上午10:16:12
45 - *  
46 */ 44 */
47 @Component 45 @Component
48 public class DayOfSchedule implements CommandLineRunner { 46 public class DayOfSchedule implements CommandLineRunner {
49 47
50 - Logger logger = LoggerFactory.getLogger(this.getClass());  
51 -  
52 - // 按车辆分组的班次数据  
53 - private static ArrayListMultimap<String, ScheduleRealInfo> nbbmScheduleMap;  
54 -  
55 - // 班次主键映射  
56 - private static Map<Long, ScheduleRealInfo> id2SchedulMap;  
57 -  
58 - // 车辆和排班起终点站对照(包括进出的停车场,区间起终点)  
59 - private static TreeMultimap<String, String> nbbm2SEStationMap;  
60 -  
61 - //车辆 ——> 当前执行班次  
62 - private static Map<String, ScheduleRealInfo> carExecutePlanMap;  
63 -  
64 - // 持久化缓冲区  
65 - public static LinkedList<ScheduleRealInfo> pstBuffer;  
66 -  
67 - // 排序器  
68 - private static ScheduleComparator.FCSJ schFCSJComparator;  
69 -  
70 - @Autowired  
71 - LineConfigData lineConfigData;  
72 -  
73 - @Autowired  
74 - ScheduleRealInfoRepository schRepository;  
75 -  
76 - @Autowired  
77 - SchedulePlanInfoService schPlanService;  
78 -  
79 - @Autowired  
80 - SchAttrCalculator schAttrCalculator;  
81 -  
82 - @Autowired  
83 - SendUtils sendUtils;  
84 -  
85 - @Autowired  
86 - GpsRealData gpsRealData;  
87 -  
88 - /** 线路当前使用的排班的日期 */  
89 - public static Map<String, String> currSchDateMap;  
90 -  
91 - static {  
92 - nbbmScheduleMap = ArrayListMultimap.create();  
93 - id2SchedulMap = new HashMap<>();  
94 - pstBuffer = new LinkedList<>();  
95 - schFCSJComparator = new ScheduleComparator.FCSJ();  
96 - currSchDateMap = new HashMap<>();  
97 - nbbm2SEStationMap = TreeMultimap.create();  
98 - carExecutePlanMap = new HashMap<>();  
99 - }  
100 -  
101 - @Autowired  
102 - ScheduleRefreshThread scheduleRefreshThread;  
103 -  
104 - @Autowired  
105 - SchedulePstThread schedulePstThread;  
106 -  
107 - @Autowired  
108 - FirstScheduleCheckThread firstScheduleCheckThread;  
109 -  
110 - @Autowired  
111 - ScheduleLateThread scheduleLateThread;  
112 -  
113 - @Autowired  
114 - SubmitToTrafficManage submitToTrafficManage;  
115 -  
116 - @Autowired  
117 - LineConfigData lineConfigs;  
118 -  
119 - @Autowired  
120 - BasicData.BasicDataLoader dataLoader;  
121 -  
122 - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd")  
123 - ,fmtHHmm = DateTimeFormat.forPattern("HH:mm");  
124 -  
125 - @Override  
126 - public void run(String... arg0) throws Exception {  
127 - //加载基础数据  
128 - dataLoader.loadAllData();  
129 - //从数据库恢复排班  
130 - //dataRecovery();  
131 -  
132 - //翻班线程  
133 - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);  
134 - //入库  
135 - Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);  
136 - //首班出场指令补发器  
137 -// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS);  
138 - //班次误点扫描  
139 - Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);  
140 -  
141 - //每天凌晨2点20提交数据到运管处  
142 - long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis();  
143 - if(diff < 0)  
144 - diff+=(1000*60*60*24);  
145 -  
146 - logger.info(diff/1000/60 + "分钟之后提交到运管处");  
147 - //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);  
148 - }  
149 -  
150 - //数据恢复  
151 - private void dataRecovery() {  
152 - GpsDataRecovery.run = true;  
153 -  
154 - Collection<LineConfig> confs = lineConfigs.getAll();  
155 - String lineCode, currSchDate;  
156 - for(LineConfig conf : confs){  
157 - lineCode = conf.getLine().getLineCode();  
158 - currSchDate = calcSchDate(lineCode);  
159 - //加载班次数据  
160 - reloadSch(lineCode, currSchDate, false);  
161 - } 48 + Logger logger = LoggerFactory.getLogger(this.getClass());
162 49
163 - //恢复gps数据  
164 - GpsDataRecovery.recovery();  
165 - }  
166 -  
167 - public Map<String, String> getCurrSchDate() {  
168 - return currSchDateMap;  
169 - }  
170 -  
171 - /**  
172 - *  
173 - * @Title: calcSchDateB  
174 - * @Description: TODO(计算线路当前应该使用的排班日期)  
175 - */  
176 - public String calcSchDate(String lineCode) {  
177 - LineConfig conf = lineConfigData.get(lineCode);  
178 - long ct = System.currentTimeMillis();  
179 -  
180 - String schDate = fmtyyyyMMdd.print(ct);  
181 - // 小于当天起始运营时间,则取前一天的排班  
182 - if (ct < conf.getCurrStartTime())  
183 - schDate = DateUtils.subtractDay(schDate, 1);  
184 -  
185 - return schDate;  
186 - }  
187 -  
188 - /**  
189 - * @Title: reloadSch  
190 - * @Title: reloadSch  
191 - * @Description: TODO(重新载入排班)  
192 - * @param @param  
193 - * lineCode 线路编码  
194 - * @param @param  
195 - * schDate 班次日期 yyyy-MM-dd  
196 - * @param @param  
197 - * forcePlan 强制从计划调度重新抓取  
198 - */  
199 - public int reloadSch(String lineCode, String schDate, boolean forcePlan) {  
200 - try {  
201 - List<ScheduleRealInfo> list;  
202 -  
203 - if (forcePlan)  
204 - removeRealSch(lineCode, schDate);  
205 - else  
206 - clearRAMData(lineCode);  
207 -  
208 - if (existRealSch(lineCode, schDate))  
209 - list = loadRealSch(lineCode, schDate);// 从实际排班表加载  
210 - else {  
211 - list = loadPlanSch(lineCode, schDate);// 从计划排班表加载  
212 - // 写入数据库  
213 - batchSave(list);  
214 - }  
215 -  
216 - //更新线路和班次日期对照  
217 - currSchDateMap.put(lineCode, schDate);  
218 - //添加到缓存  
219 - putAll(list);  
220 -  
221 - Set<String> cars = searchAllCars(list);  
222 - for(String nbbm : cars){  
223 - //计算“起点站应到”时间  
224 - schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));  
225 - //车辆 ——> 要执行的班次对照  
226 - carExecutePlanMap.put(nbbm, schAttrCalculator.calcCurrentExecSch(nbbmScheduleMap.get(nbbm)));  
227 - }  
228 -  
229 - //是否是出站即出场  
230 - LineConfig conf = lineConfigData.get(lineCode);  
231 - if(conf.getOutConfig() == 2){  
232 - for(String nbbm : cars)  
233 - schAttrCalculator.connectOutSchedule(nbbmScheduleMap.get(nbbm));  
234 - }  
235 -  
236 - // 页面 翻班通知  
237 - sendUtils.shiftSchedule(lineCode);  
238 - } catch (Exception e) {  
239 - logger.error("", e);  
240 - return -1;  
241 - } 50 + // 按车辆分组的班次数据
  51 + private static ArrayListMultimap<String, ScheduleRealInfo> nbbmScheduleMap;
242 52
243 - return 0;  
244 - }  
245 -  
246 - /**  
247 - *  
248 - * @Title: searchAllCars  
249 - * @Description: TODO(搜索班次集合中的车辆)  
250 - */  
251 - private Set<String> searchAllCars(List<ScheduleRealInfo> list) {  
252 - Set<String> cars = new HashSet<>();  
253 - for(ScheduleRealInfo sch : list)  
254 - cars.add(sch.getClZbh());  
255 -  
256 - return cars;  
257 - }  
258 -  
259 - private void putAll(List<ScheduleRealInfo> list) {  
260 - for (ScheduleRealInfo sch : list)  
261 - put(sch);  
262 - }  
263 -  
264 - /**  
265 - * @Title: removeRealSch  
266 - * @Description: TODO(清除实际排班,包括数据库和内存数据)  
267 - * @param @param  
268 - * lineCode 线路编码  
269 - * @param @param  
270 - * schDate 班次日期 yyyy-MM-dd  
271 - */  
272 - public void removeRealSch(String lineCode, String schDate) throws Exception {  
273 - try {  
274 - // 清理数据库数据  
275 - schRepository.deleteByLineCodeAndDate(lineCode + "", schDate);  
276 -  
277 - // 清理内存数据  
278 - clearRAMData(lineCode + "");  
279 - } catch (Exception e) {  
280 - logger.error("removeRealSch error, " + lineCode + " -" + schDate, e);  
281 - throw e;  
282 - }  
283 - }  
284 -  
285 - /**  
286 - *  
287 - * @Title: clearRAMData  
288 - * @Description: TODO(清理内存数据)  
289 - */  
290 - public void clearRAMData(String lineCode) {  
291 - int count = 0;  
292 - List<ScheduleRealInfo> remList = new ArrayList<>();  
293 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
294 - for (ScheduleRealInfo sch : schs) {  
295 - if (sch.getXlBm().equals(lineCode))  
296 - remList.add(sch);  
297 - }  
298 -  
299 - for(ScheduleRealInfo sch : remList){  
300 - if(null != sch){  
301 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
302 - id2SchedulMap.remove(sch.getId());  
303 - count ++;  
304 - }  
305 - }  
306 -  
307 - logger.info(lineCode + "排班清理 " + count);  
308 - }  
309 -  
310 - /**  
311 - * @Title: existRealSch  
312 - * @Description: TODO(实际排班是否已存在)  
313 - */  
314 - public boolean existRealSch(String lineCode, String schDate) {  
315 - int count = schRepository.countByLineCodeAndDate(lineCode, schDate);  
316 - return count > 0;  
317 - }  
318 -  
319 - /**  
320 - * @Title: loadRealSch  
321 - * @Description: TODO(从实际排班表加载数据)  
322 - */  
323 - public List<ScheduleRealInfo> loadRealSch(String lineCode, String schDate) {  
324 - return schRepository.findByLineCodeAndDate(lineCode, schDate);  
325 - }  
326 -  
327 - /**  
328 - * @Title: loadPlanSch  
329 - * @Description: TODO(从计划排班表加载数据)  
330 - */  
331 - public List<ScheduleRealInfo> loadPlanSch(String lineCode, String schDate) {  
332 - logger.info("从计划排班表恢复排班,lineCode: " + lineCode + ", schDate: " + schDate);  
333 - List<ScheduleRealInfo> realList = new ArrayList<>();  
334 -  
335 - try {  
336 - Map<String, Object> data = new HashMap<>();  
337 -  
338 - data.put("scheduleDate_eq", fmtyyyyMMdd.parseDateTime(schDate).toDate());  
339 - data.put("xlBm_eq", lineCode);  
340 -  
341 - // 查询计划排班  
342 - List<SchedulePlanInfo> planItr = cleanSchPlanItr(schPlanService.list(data).iterator());  
343 -  
344 - // 转换为实际排班  
345 - realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class);  
346 -  
347 - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");  
348 - String fcsj;  
349 - for (ScheduleRealInfo sch : realList) {  
350 - sch.setScheduleDateStr(fmtyyyyMMdd.print(sch.getScheduleDate().getTime()));  
351 - sch.setRealExecDate(sch.getScheduleDateStr());  
352 -  
353 - if(StringUtils.isEmpty(sch.getFcsj()))  
354 - sch.setFcsj("00:00");  
355 -  
356 - fcsj=sch.getFcsj().trim();  
357 - //处理一下发车时间格式没有:号的问题  
358 - if(fcsj.indexOf(":") == -1 && fcsj.length() >= 4){  
359 - sch.setFcsj(fcsj.substring(0, 2) + ":" + fcsj.substring(2, 4));  
360 - }  
361 -  
362 - try {  
363 - sdf.parse(sch.getFcsj());  
364 - } catch (ParseException e) {  
365 - //发车时间仍然校验不过的,直接写成00:00  
366 - sch.setFcsj("00:00");  
367 - }  
368 - sch.setDfsj(sch.getFcsj());  
369 -  
370 - // 计划终点时间  
371 - if (sch.getBcsj() != null) {  
372 - sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000)));  
373 - sch.setLate(false);  
374 - }  
375 - //计划里程为0,设置NULL  
376 - if(sch.getJhlc() != null && sch.getJhlc() == 0)  
377 - sch.setJhlc(null);  
378 - }  
379 - } catch (Exception e) {  
380 - logger.error("", e);  
381 - }  
382 - return realList;  
383 - }  
384 -  
385 - /**  
386 - * @Title: batchSave  
387 - * @Description: TODO(批量入库)  
388 - */  
389 - private void batchSave(List<ScheduleRealInfo> list) {  
390 - // 查询数据库最大ID  
391 - Long id = schRepository.getMaxId();  
392 - if (null == id)  
393 - id = 0L;  
394 - id++;  
395 -  
396 - SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");  
397 - for (ScheduleRealInfo item : list) {  
398 - item.setSpId(item.getId());// 保留原始的计划ID  
399 - item.setId(id++);// 设置ID  
400 - item.setScheduleDateStr(sdfyyyyMMdd.format(item.getScheduleDate()));  
401 - } 53 + // 班次主键映射
  54 + private static Map<Long, ScheduleRealInfo> id2SchedulMap;
402 55
403 - // 入库  
404 - new BatchSaveUtils<ScheduleRealInfo>().saveList(list, ScheduleRealInfo.class);  
405 - } 56 + // 车辆和排班起终点站对照(包括进出的停车场,区间起终点)
  57 + private static TreeMultimap<String, String> nbbm2SEStationMap;
406 58
407 - private List<SchedulePlanInfo> cleanSchPlanItr(Iterator<SchedulePlanInfo> itrab) {  
408 - List<SchedulePlanInfo> list = new ArrayList<>(); 59 + //车辆 ——> 当前执行班次
  60 + private static Map<String, ScheduleRealInfo> carExecutePlanMap;
409 61
410 - SchedulePlanInfo sp;  
411 - while (itrab.hasNext()) {  
412 - sp = itrab.next();  
413 - sp.setSchedulePlan(null);  
414 - list.add(sp);  
415 - }  
416 - return list;  
417 - }  
418 -  
419 - /**  
420 - *  
421 - * @Title: findByLineCode  
422 - * @Description: TODO(lineCode 获取班次)  
423 - */  
424 - public List<ScheduleRealInfo> findByLineCode(String lineCode) {  
425 - List<ScheduleRealInfo> rs = new ArrayList<>(); 62 + // 持久化缓冲区
  63 + public static LinkedList<ScheduleRealInfo> pstBuffer;
426 64
427 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
428 - for (ScheduleRealInfo sch : schs) {  
429 - if (sch.getXlBm().equals(lineCode))  
430 - rs.add(sch);  
431 - }  
432 - return rs;  
433 - }  
434 -  
435 - /**  
436 - *  
437 - * @Title: findCarByLineCode  
438 - * @Description: TODO(线路下运营的车辆)  
439 - */  
440 - public Set<String> findCarByLineCode(String lineCode){  
441 - Set<String> rs = new HashSet<>();  
442 -  
443 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
444 - for (ScheduleRealInfo sch : schs) {  
445 - if (sch.getXlBm().equals(lineCode))  
446 - rs.add(sch.getClZbh());  
447 - }  
448 -  
449 - return rs;  
450 - }  
451 -  
452 - public List<ScheduleRealInfo> findByNbbm(String nbbm) {  
453 - return nbbmScheduleMap.get(nbbm);  
454 - }  
455 -  
456 - /**  
457 - *  
458 - * @Title: findByLineAndUpDown  
459 - * @Description: TODO(lineCode 和走向获取班次)  
460 - */  
461 - public List<ScheduleRealInfo> findByLineAndUpDown(String lineCode, Integer upDown) {  
462 - List<ScheduleRealInfo> list = findByLineCode(lineCode), rs = new ArrayList<>();  
463 -  
464 - for (ScheduleRealInfo sch : list) {  
465 - if (sch.getXlDir().equals(upDown + ""))  
466 - rs.add(sch);  
467 - }  
468 - return rs;  
469 - }  
470 -  
471 - public ScheduleRealInfo get(long id) {  
472 - return id2SchedulMap.get(id);  
473 - }  
474 -  
475 - public Set<String> getSEStationList(String nbbm) {  
476 - return nbbm2SEStationMap.get(nbbm);  
477 - }  
478 -  
479 - /**  
480 - *  
481 - * @Title: next  
482 - * @Description: TODO(下一个班次)  
483 - */  
484 - public ScheduleRealInfo next(ScheduleRealInfo sch) {  
485 -  
486 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
487 - int outConfig = -1;  
488 - LineConfig config = lineConfigData.get(sch.getXlBm());  
489 - if(config != null)  
490 - outConfig = config.getOutConfig();  
491 -  
492 - boolean flag = false;  
493 - ScheduleRealInfo next = null;  
494 - for(ScheduleRealInfo temp : list){  
495 - if(temp.getId() == sch.getId()){  
496 - flag = true;  
497 - continue;  
498 - }  
499 - //忽略烂班  
500 - if(temp.isDestroy())  
501 - continue; 65 + // 排序器
  66 + private static ScheduleComparator.FCSJ schFCSJComparator;
502 67
503 - //出站既出场,忽略出场班次  
504 - if(outConfig == 2 && temp.getBcType().equals("out"))  
505 - continue;  
506 -  
507 - if(flag){  
508 - next = temp;  
509 - break;  
510 - }  
511 - }  
512 - return next;  
513 - }  
514 -  
515 - /**  
516 - * 上一个班次  
517 - * @param sch  
518 - * @return  
519 - */  
520 - public ScheduleRealInfo prev(ScheduleRealInfo sch){  
521 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
522 -  
523 - //boolean flag = false;  
524 - ScheduleRealInfo prev = null;  
525 - int size = list.size();  
526 -  
527 - for(int i = 0; i < size; i ++){  
528 - if(list.get(i).isDestroy())  
529 - continue; 68 + @Autowired
  69 + LineConfigData lineConfigData;
  70 +
  71 + @Autowired
  72 + ScheduleRealInfoRepository schRepository;
  73 +
  74 + @Autowired
  75 + SchedulePlanInfoService schPlanService;
  76 +
  77 + @Autowired
  78 + SchAttrCalculator schAttrCalculator;
  79 +
  80 + @Autowired
  81 + SendUtils sendUtils;
  82 +
  83 + @Autowired
  84 + GpsRealData gpsRealData;
  85 +
  86 + /**
  87 + * 线路当前使用的排班的日期
  88 + */
  89 + public static Map<String, String> currSchDateMap;
  90 +
  91 + static {
  92 + nbbmScheduleMap = ArrayListMultimap.create();
  93 + id2SchedulMap = new HashMap<>();
  94 + pstBuffer = new LinkedList<>();
  95 + schFCSJComparator = new ScheduleComparator.FCSJ();
  96 + currSchDateMap = new HashMap<>();
  97 + nbbm2SEStationMap = TreeMultimap.create();
  98 + carExecutePlanMap = new HashMap<>();
  99 + }
  100 +
  101 + @Autowired
  102 + ScheduleRefreshThread scheduleRefreshThread;
  103 +
  104 + @Autowired
  105 + SchedulePstThread schedulePstThread;
  106 +
  107 + @Autowired
  108 + FirstScheduleCheckThread firstScheduleCheckThread;
  109 +
  110 + @Autowired
  111 + ScheduleLateThread scheduleLateThread;
  112 +
  113 + @Autowired
  114 + SubmitToTrafficManage submitToTrafficManage;
  115 +
  116 + @Autowired
  117 + LineConfigData lineConfigs;
  118 +
  119 + @Autowired
  120 + BasicData.BasicDataLoader dataLoader;
  121 +
  122 + @Autowired
  123 + GpsDataRecovery gpsDataRecovery;
  124 +
  125 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  126 +
  127 + @Override
  128 + public void run(String... arg0) throws Exception {
  129 + //加载基础数据
  130 + dataLoader.loadAllData();
  131 + //从数据库恢复排班
  132 + dataRecovery();
  133 +
  134 + //翻班线程
  135 +// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
  136 + //入库
  137 +// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);
  138 + //首班出场指令补发器
  139 +// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS);
  140 + //班次误点扫描
  141 + Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
  142 +
  143 + //每天凌晨2点20提交数据到运管处
  144 + long diff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
  145 + if (diff < 0)
  146 + diff += (1000 * 60 * 60 * 24);
  147 +
  148 + logger.info(diff / 1000 / 60 + "分钟之后提交到运管处");
  149 + //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  150 + }
  151 +
  152 + //数据恢复
  153 + private void dataRecovery() {
  154 + GpsDataRecovery.run = true;
  155 +
  156 + Collection<LineConfig> confs = lineConfigs.getAll();
  157 + String lineCode, currSchDate;
  158 + for (LineConfig conf : confs) {
  159 + lineCode = conf.getLine().getLineCode();
  160 + currSchDate = calcSchDate(lineCode);
  161 + //加载班次数据
  162 + reloadSch(lineCode, currSchDate, false);
  163 + }
  164 +
  165 + //恢复gps数据
  166 + gpsDataRecovery.recovery();
  167 + }
  168 +
  169 + public Map<String, String> getCurrSchDate() {
  170 + return currSchDateMap;
  171 + }
  172 +
  173 + /**
  174 + * @Title: calcSchDateB
  175 + * @Description: TODO(计算线路当前应该使用的排班日期)
  176 + */
  177 + public String calcSchDate(String lineCode) {
  178 + LineConfig conf = lineConfigData.get(lineCode);
  179 + long ct = System.currentTimeMillis();
  180 +
  181 + String schDate = fmtyyyyMMdd.print(ct);
  182 + // 小于当天起始运营时间,则取前一天的排班
  183 + if (ct < conf.getCurrStartTime())
  184 + schDate = DateUtils.subtractDay(schDate, 1);
  185 +
  186 + return schDate;
  187 + }
  188 +
  189 + /**
  190 + * @param @param lineCode 线路编码
  191 + * @param @param schDate 班次日期 yyyy-MM-dd
  192 + * @param @param forcePlan 强制从计划调度重新抓取
  193 + * @Title: reloadSch
  194 + * @Title: reloadSch
  195 + * @Description: TODO(重新载入排班)
  196 + */
  197 + public int reloadSch(String lineCode, String schDate, boolean forcePlan) {
  198 + try {
  199 + List<ScheduleRealInfo> list;
  200 +
  201 + if (forcePlan)
  202 + removeRealSch(lineCode, schDate);
  203 + else
  204 + clearRAMData(lineCode);
  205 +
  206 + if (existRealSch(lineCode, schDate))
  207 + list = loadRealSch(lineCode, schDate);// 从实际排班表加载
  208 + else {
  209 + list = loadPlanSch(lineCode, schDate);// 从计划排班表加载
  210 + // 写入数据库
  211 + batchSave(list);
  212 + }
  213 +
  214 + //更新线路和班次日期对照
  215 + currSchDateMap.put(lineCode, schDate);
  216 + //添加到缓存
  217 + putAll(list);
  218 +
  219 + Set<String> cars = searchAllCars(list);
  220 + for (String nbbm : cars) {
  221 + //计算“起点站应到”时间
  222 + schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));
  223 + //车辆 ——> 要执行的班次对照
  224 + reCalcExecPlan(nbbm);
  225 + }
  226 +
  227 + //是否是出站即出场
  228 + LineConfig conf = lineConfigData.get(lineCode);
  229 + if (conf.getOutConfig() == 2) {
  230 + for (String nbbm : cars)
  231 + schAttrCalculator.connectOutSchedule(nbbmScheduleMap.get(nbbm));
  232 + }
  233 +
  234 + // 页面 翻班通知
  235 + sendUtils.shiftSchedule(lineCode);
  236 + } catch (Exception e) {
  237 + logger.error("", e);
  238 + return -1;
  239 + }
  240 +
  241 + return 0;
  242 + }
  243 +
  244 + /**
  245 + * @Title: searchAllCars
  246 + * @Description: TODO(搜索班次集合中的车辆)
  247 + */
  248 + private Set<String> searchAllCars(List<ScheduleRealInfo> list) {
  249 + Set<String> cars = new HashSet<>();
  250 + for (ScheduleRealInfo sch : list)
  251 + cars.add(sch.getClZbh());
  252 +
  253 + return cars;
  254 + }
  255 +
  256 + private void putAll(List<ScheduleRealInfo> list) {
  257 + for (ScheduleRealInfo sch : list)
  258 + put(sch);
  259 + }
  260 +
  261 + /**
  262 + * @param @param lineCode 线路编码
  263 + * @param @param schDate 班次日期 yyyy-MM-dd
  264 + * @Title: removeRealSch
  265 + * @Description: TODO(清除实际排班,包括数据库和内存数据)
  266 + */
  267 + public void removeRealSch(String lineCode, String schDate) throws Exception {
  268 + try {
  269 + // 清理数据库数据
  270 + schRepository.deleteByLineCodeAndDate(lineCode + "", schDate);
  271 +
  272 + // 清理内存数据
  273 + clearRAMData(lineCode + "");
  274 + } catch (Exception e) {
  275 + logger.error("removeRealSch error, " + lineCode + " -" + schDate, e);
  276 + throw e;
  277 + }
  278 + }
  279 +
  280 + /**
  281 + * @Title: clearRAMData
  282 + * @Description: TODO(清理内存数据)
  283 + */
  284 + public void clearRAMData(String lineCode) {
  285 + int count = 0;
  286 + List<ScheduleRealInfo> remList = new ArrayList<>();
  287 + Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();
  288 + for (ScheduleRealInfo sch : schs) {
  289 + if (sch.getXlBm().equals(lineCode))
  290 + remList.add(sch);
  291 + }
  292 +
  293 + for (ScheduleRealInfo sch : remList) {
  294 + if (null != sch) {
  295 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
  296 + id2SchedulMap.remove(sch.getId());
  297 + count++;
  298 + }
  299 + }
  300 +
  301 + logger.info(lineCode + "排班清理 " + count);
  302 + }
  303 +
  304 + /**
  305 + * @Title: existRealSch
  306 + * @Description: TODO(实际排班是否已存在)
  307 + */
  308 + public boolean existRealSch(String lineCode, String schDate) {
  309 + int count = schRepository.countByLineCodeAndDate(lineCode, schDate);
  310 + return count > 0;
  311 + }
  312 +
  313 + /**
  314 + * @Title: loadRealSch
  315 + * @Description: TODO(从实际排班表加载数据)
  316 + */
  317 + public List<ScheduleRealInfo> loadRealSch(String lineCode, String schDate) {
  318 + return schRepository.findByLineCodeAndDate(lineCode, schDate);
  319 + }
  320 +
  321 + /**
  322 + * @Title: loadPlanSch
  323 + * @Description: TODO(从计划排班表加载数据)
  324 + */
  325 + public List<ScheduleRealInfo> loadPlanSch(String lineCode, String schDate) {
  326 + logger.info("从计划排班表恢复排班,lineCode: " + lineCode + ", schDate: " + schDate);
  327 + List<ScheduleRealInfo> realList = new ArrayList<>();
  328 +
  329 + try {
  330 + Map<String, Object> data = new HashMap<>();
  331 +
  332 + data.put("scheduleDate_eq", fmtyyyyMMdd.parseDateTime(schDate).toDate());
  333 + data.put("xlBm_eq", lineCode);
  334 +
  335 + // 查询计划排班
  336 + List<SchedulePlanInfo> planItr = cleanSchPlanItr(schPlanService.list(data).iterator());
  337 +
  338 + // 转换为实际排班
  339 + realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class);
  340 +
  341 + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
  342 + String fcsj;
  343 + for (ScheduleRealInfo sch : realList) {
  344 + sch.setScheduleDateStr(fmtyyyyMMdd.print(sch.getScheduleDate().getTime()));
  345 + sch.setRealExecDate(sch.getScheduleDateStr());
  346 +
  347 + if (StringUtils.isEmpty(sch.getFcsj()))
  348 + sch.setFcsj("00:00");
  349 +
  350 + fcsj = sch.getFcsj().trim();
  351 + //处理一下发车时间格式没有:号的问题
  352 + if (fcsj.indexOf(":") == -1 && fcsj.length() >= 4) {
  353 + sch.setFcsj(fcsj.substring(0, 2) + ":" + fcsj.substring(2, 4));
  354 + }
  355 +
  356 + try {
  357 + sdf.parse(sch.getFcsj());
  358 + } catch (ParseException e) {
  359 + //发车时间仍然校验不过的,直接写成00:00
  360 + sch.setFcsj("00:00");
  361 + }
  362 + sch.setDfsj(sch.getFcsj());
  363 +
  364 + // 计划终点时间
  365 + if (sch.getBcsj() != null) {
  366 + sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000)));
  367 + sch.setLate(false);
  368 + }
  369 + //计划里程为0,设置NULL
  370 + if (sch.getJhlc() != null && sch.getJhlc() == 0)
  371 + sch.setJhlc(null);
  372 + }
  373 + } catch (Exception e) {
  374 + logger.error("", e);
  375 + }
  376 + return realList;
  377 + }
  378 +
  379 + /**
  380 + * @Title: batchSave
  381 + * @Description: TODO(批量入库)
  382 + */
  383 + private void batchSave(List<ScheduleRealInfo> list) {
  384 + // 查询数据库最大ID
  385 + Long id = schRepository.getMaxId();
  386 + if (null == id)
  387 + id = 0L;
  388 + id++;
  389 +
  390 + SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");
  391 + for (ScheduleRealInfo item : list) {
  392 + item.setSpId(item.getId());// 保留原始的计划ID
  393 + item.setId(id++);// 设置ID
  394 + item.setScheduleDateStr(sdfyyyyMMdd.format(item.getScheduleDate()));
  395 + }
  396 +
  397 + // 入库
  398 + new BatchSaveUtils<ScheduleRealInfo>().saveList(list, ScheduleRealInfo.class);
  399 + }
  400 +
  401 + private List<SchedulePlanInfo> cleanSchPlanItr(Iterator<SchedulePlanInfo> itrab) {
  402 + List<SchedulePlanInfo> list = new ArrayList<>();
  403 +
  404 + SchedulePlanInfo sp;
  405 + while (itrab.hasNext()) {
  406 + sp = itrab.next();
  407 + sp.setSchedulePlan(null);
  408 + list.add(sp);
  409 + }
  410 + return list;
  411 + }
  412 +
  413 + /**
  414 + * @Title: findByLineCode
  415 + * @Description: TODO(lineCode 获取班次)
  416 + */
  417 + public List<ScheduleRealInfo> findByLineCode(String lineCode) {
  418 + List<ScheduleRealInfo> rs = new ArrayList<>();
  419 +
  420 + Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();
  421 + for (ScheduleRealInfo sch : schs) {
  422 + if (sch.getXlBm().equals(lineCode))
  423 + rs.add(sch);
  424 + }
  425 + return rs;
  426 + }
  427 +
  428 + /**
  429 + * @Title: findCarByLineCode
  430 + * @Description: TODO(线路下运营的车辆)
  431 + */
  432 + public Set<String> findCarByLineCode(String lineCode) {
  433 + Set<String> rs = new HashSet<>();
  434 +
  435 + Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();
  436 + for (ScheduleRealInfo sch : schs) {
  437 + if (sch.getXlBm().equals(lineCode))
  438 + rs.add(sch.getClZbh());
  439 + }
  440 +
  441 + return rs;
  442 + }
  443 +
  444 + public List<ScheduleRealInfo> findByNbbm(String nbbm) {
  445 + return nbbmScheduleMap.get(nbbm);
  446 + }
  447 +
  448 + /**
  449 + * @Title: findByLineAndUpDown
  450 + * @Description: TODO(lineCode 和走向获取班次)
  451 + */
  452 + public List<ScheduleRealInfo> findByLineAndUpDown(String lineCode, Integer upDown) {
  453 + List<ScheduleRealInfo> list = findByLineCode(lineCode), rs = new ArrayList<>();
  454 +
  455 + for (ScheduleRealInfo sch : list) {
  456 + if (sch.getXlDir().equals(upDown + ""))
  457 + rs.add(sch);
  458 + }
  459 + return rs;
  460 + }
  461 +
  462 + public ScheduleRealInfo get(long id) {
  463 + return id2SchedulMap.get(id);
  464 + }
  465 +
  466 + public Set<String> getSEStationList(String nbbm) {
  467 + return nbbm2SEStationMap.get(nbbm);
  468 + }
  469 +
  470 + /**
  471 + * @Title: next
  472 + * @Description: TODO(下一个班次)
  473 + */
  474 + public ScheduleRealInfo next(ScheduleRealInfo sch) {
  475 +
  476 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  477 + int outConfig = -1;
  478 + LineConfig config = lineConfigData.get(sch.getXlBm());
  479 + if (config != null)
  480 + outConfig = config.getOutConfig();
  481 +
  482 + boolean flag = false;
  483 + ScheduleRealInfo next = null;
  484 + for (ScheduleRealInfo temp : list) {
  485 + if (temp.getId() == sch.getId()) {
  486 + flag = true;
  487 + continue;
  488 + }
  489 + //忽略烂班
  490 + if (temp.isDestroy())
  491 + continue;
  492 +
  493 + //出站既出场,忽略出场班次
  494 + if (outConfig == 2 && temp.getBcType().equals("out"))
  495 + continue;
  496 +
  497 + if (flag) {
  498 + next = temp;
  499 + break;
  500 + }
  501 + }
  502 + return next;
  503 + }
  504 +
  505 + /**
  506 + * 上一个班次
  507 + *
  508 + * @param sch
  509 + * @return
  510 + */
  511 + public ScheduleRealInfo prev(ScheduleRealInfo sch) {
  512 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  513 +
  514 + //boolean flag = false;
  515 + ScheduleRealInfo prev = null;
  516 + int size = list.size();
  517 +
  518 + for (int i = 0; i < size; i++) {
  519 + if (list.get(i).isDestroy())
  520 + continue;
  521 +
  522 + if (list.get(i).getId().equals(sch.getId())) {
  523 + return prev;
  524 + }
  525 + prev = list.get(i);
  526 + }
  527 + return prev;
  528 + }
  529 +
  530 + public void put(ScheduleRealInfo sch) {
  531 + schAttrCalculator
  532 + .calcRealDate(sch)
  533 + .calcAllTimeByFcsj(sch);
  534 +
  535 + String nbbm = sch.getClZbh();
  536 + nbbmScheduleMap.put(nbbm, sch);
  537 + nbbm2SEStationMap.put(nbbm, sch.getQdzCode());
  538 + nbbm2SEStationMap.put(nbbm, sch.getZdzCode());
  539 +
  540 + //主键索引
  541 + id2SchedulMap.put(sch.getId(), sch);
  542 + //跨24点的,再save一次
  543 + if (!sch.getRealExecDate().equals(sch.getScheduleDateStr()))
  544 + save(sch);
  545 + }
  546 +
  547 + public void delete(ScheduleRealInfo sch) {
  548 + //ScheduleRealInfo sch = id2SchedulMap.get(id);
  549 + if (!sch.isSflj())
  550 + return;
  551 +
  552 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
  553 + id2SchedulMap.remove(sch.getId());
  554 + //return sch;
  555 + }
530 556
531 - if(list.get(i).getId().equals(sch.getId())){  
532 - return prev;  
533 - }  
534 - prev = list.get(i);  
535 - }  
536 - return prev;  
537 - }  
538 -  
539 - public void put(ScheduleRealInfo sch) {  
540 - schAttrCalculator  
541 - .calcRealDate(sch)  
542 - .calcAllTimeByFcsj(sch);  
543 -  
544 - String nbbm = sch.getClZbh();  
545 - nbbmScheduleMap.put(nbbm, sch);  
546 - nbbm2SEStationMap.put(nbbm, sch.getQdzCode());  
547 - nbbm2SEStationMap.put(nbbm, sch.getZdzCode());  
548 -  
549 - //主键索引  
550 - id2SchedulMap.put(sch.getId(), sch);  
551 - //跨24点的,再save一次  
552 - if(!sch.getRealExecDate().equals(sch.getScheduleDateStr()))  
553 - save(sch);  
554 - }  
555 -  
556 - public void delete(ScheduleRealInfo sch) {  
557 - //ScheduleRealInfo sch = id2SchedulMap.get(id);  
558 - if(!sch.isSflj())  
559 - return;  
560 -  
561 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
562 - id2SchedulMap.remove(sch.getId());  
563 - //return sch;  
564 - }  
565 -  
566 // public void calcQdzTimePlan(String nbbm){ 557 // public void calcQdzTimePlan(String nbbm){
567 // schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm)); 558 // schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));
568 // } 559 // }
569 -  
570 - public List<ScheduleRealInfo> updateQdzTimePlan(String nbbm){  
571 - return schAttrCalculator.updateQdzTimePlan(nbbmScheduleMap.get(nbbm));  
572 - }  
573 -  
574 - /**  
575 - *  
576 - * @Title: nextAll  
577 - * @Description: TODO(之后的所有班次)  
578 - */ 560 +
  561 + public List<ScheduleRealInfo> updateQdzTimePlan(String nbbm) {
  562 + return schAttrCalculator.updateQdzTimePlan(nbbmScheduleMap.get(nbbm));
  563 + }
  564 +
  565 + /**
  566 + *
  567 + * @Title: nextAll
  568 + * @Description: TODO(之后的所有班次)
  569 + */
579 /* public List<ScheduleRealInfo> nextAll(ScheduleRealInfo sch) { 570 /* public List<ScheduleRealInfo> nextAll(ScheduleRealInfo sch) {
580 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); 571 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
581 // 排序 572 // 排序
582 Collections.sort(list, schFCSJComparator); 573 Collections.sort(list, schFCSJComparator);
583 574
@@ -592,190 +583,229 @@ public class DayOfSchedule implements CommandLineRunner { @@ -592,190 +583,229 @@ public class DayOfSchedule implements CommandLineRunner {
592 return rs; 583 return rs;
593 }*/ 584 }*/
594 585
595 - /**  
596 - *  
597 - * @Title: doneSum  
598 - * @Description: TODO(已完成班次总数)  
599 - */  
600 - public int doneSum(String clZbh) {  
601 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(clZbh);  
602 - int rs = 0;  
603 -  
604 - for(ScheduleRealInfo sch : list){  
605 - if(sch.getStatus() == 2 && !sch.isDestroy())  
606 - rs ++;  
607 - }  
608 - return rs;  
609 - }  
610 -  
611 - /**  
612 - *  
613 - * @Title: prveNotExecNum  
614 - * @Description: TODO(班次之前未执行班次数量)  
615 - */  
616 - public int prveNotExecNum(ScheduleRealInfo sch){  
617 - int n = 0;  
618 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
619 - for(ScheduleRealInfo s : list){  
620 - if(s.getFcsjActual() == null && !s.isDestroy())  
621 - n ++;  
622 -  
623 - if(s.getId().equals(sch.getId()))  
624 - break;  
625 - }  
626 - return n;  
627 - }  
628 -  
629 - /**  
630 - *  
631 - * @Title: validEndTime  
632 - * @Description: TODO(是否是有效的到达时间)  
633 - */  
634 - public boolean validEndTime(ScheduleRealInfo sch, Long ts) {  
635 - if(sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts)  
636 - return false;  
637 -  
638 - return validTime(sch, ts);  
639 - }  
640 -  
641 - /**  
642 - *  
643 - * @Title: validStartTime  
644 - * @Description: TODO(是否是合适的发车时间)  
645 - */  
646 - public boolean validStartTime(ScheduleRealInfo sch, Long ts) {  
647 - if(sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts)  
648 - return false;  
649 -  
650 - return validTime(sch, ts);  
651 - }  
652 -  
653 - public boolean validTime(ScheduleRealInfo sch, Long ts){  
654 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
655 - int ci = list.indexOf(sch);  
656 - ScheduleRealInfo prve, next;  
657 - if(ci > 0){  
658 - //之前班次实际时间不能大于该时间  
659 - for(int i = ci - 1; i >= 0; i --){  
660 - prve = list.get(i);  
661 - if(prve.getZdsjActualTime() != null && prve.getZdsjActualTime() > ts )  
662 - return false;  
663 -  
664 - if(prve.getFcsjActualTime() != null && prve.getFcsjActualTime() > ts)  
665 - return false;  
666 - }  
667 - }  
668 -  
669 - if(ci < list.size() - 1){  
670 - //之后班次实际时间不能小于该时间  
671 - for(int i = ci + 1; i < list.size(); i ++){  
672 - next = list.get(i);  
673 - if(next.getFcsjActualTime() != null && next.getFcsjActualTime() < ts)  
674 - return false;  
675 -  
676 - if(next.getZdsjActualTime() != null && next.getZdsjActualTime() < ts)  
677 - return false;  
678 - }  
679 - }  
680 - return true;  
681 - }  
682 -  
683 - public void save(ScheduleRealInfo sch){  
684 - //schRepository.save(sch);  
685 - pstBuffer.add(sch);  
686 - }  
687 -  
688 -  
689 - /**  
690 - *  
691 - * @Title: nextByBcType  
692 - * @Description: TODO(获取下一个指定班次类型的班次)  
693 - */  
694 - public ScheduleRealInfo nextByBcType(String nbbm, String bcType){  
695 - List<ScheduleRealInfo> list = findByBcType(nbbm, bcType);  
696 -  
697 - Collections.sort(list, schFCSJComparator);  
698 - ScheduleRealInfo sch = null;  
699 - for(ScheduleRealInfo temp : list){  
700 - if(temp.getFcsjActual() == null)  
701 - sch = temp;  
702 - }  
703 -  
704 - return sch;  
705 - }  
706 -  
707 - public List<ScheduleRealInfo> findByBcType(String nbbm, String bcType){  
708 - List<ScheduleRealInfo> all = nbbmScheduleMap.get(nbbm)  
709 - ,outList = new ArrayList<>();  
710 -  
711 - for(ScheduleRealInfo sch : all){  
712 - if(sch.getBcType().equals(bcType))  
713 - outList.add(sch);  
714 - }  
715 - return outList;  
716 - }  
717 -  
718 - public Set<String> allCar(){  
719 - return nbbmScheduleMap.keySet();  
720 - }  
721 -  
722 - public Collection<ScheduleRealInfo> findAll(){  
723 - return nbbmScheduleMap.values();  
724 - }  
725 -  
726 - public void addExecPlan(ScheduleRealInfo sch){  
727 - carExecutePlanMap.put(sch.getClZbh(), sch);  
728 - }  
729 -  
730 - public void removeExecPlan(String clzbh){  
731 - carExecutePlanMap.remove(clzbh);  
732 - }  
733 -  
734 - public Map<String, ScheduleRealInfo> execPlanMap(){  
735 - return carExecutePlanMap;  
736 - }  
737 -  
738 - /**  
739 - * 车辆当前执行的班次  
740 - * @param nbbm  
741 - * @return  
742 - */  
743 - public static ScheduleRealInfo executeCurr(String nbbm){  
744 - return carExecutePlanMap.get(nbbm);  
745 - }  
746 -  
747 - /**  
748 - * @Title: changeCar  
749 - * @Description: TODO(班次换车) 返回有更新的班次  
750 - * @param @param sch  
751 - * @param @param newClZbh 新的车辆自编号  
752 - */  
753 - public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch , String newClZbh){  
754 - List<ScheduleRealInfo> ups = new ArrayList<>();  
755 - String oldClzbh = sch.getClZbh();  
756 - if(oldClzbh.equals(newClZbh))  
757 - return ups;  
758 -  
759 -  
760 - //变更相关映射信息  
761 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
762 -  
763 - sch.setClZbh(newClZbh);  
764 - nbbmScheduleMap.put(newClZbh, sch);  
765 - nbbm2SEStationMap.put(newClZbh, sch.getQdzCode());  
766 - nbbm2SEStationMap.put(newClZbh, sch.getZdzCode());  
767 -  
768 - //重新计算班次应到时间  
769 - ups.addAll(updateQdzTimePlan(oldClzbh));  
770 - ups.addAll(updateQdzTimePlan(newClZbh));  
771 - return ups;  
772 - }  
773 -  
774 - /**  
775 - *  
776 - * @Title: linkToSchPlan  
777 - * @Description: TODO(车辆关联到班次)  
778 - */ 586 + /**
  587 + * @Title: doneSum
  588 + * @Description: TODO(已完成班次总数)
  589 + */
  590 + public int doneSum(String clZbh) {
  591 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(clZbh);
  592 + int rs = 0;
  593 +
  594 + for (ScheduleRealInfo sch : list) {
  595 + if (sch.getStatus() == 2 && !sch.isDestroy())
  596 + rs++;
  597 + }
  598 + return rs;
  599 + }
  600 +
  601 + /**
  602 + * @Title: prveNotExecNum
  603 + * @Description: TODO(班次之前未执行班次数量)
  604 + */
  605 + public int prveNotExecNum(ScheduleRealInfo sch) {
  606 + int n = 0;
  607 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  608 + for (ScheduleRealInfo s : list) {
  609 + if (s.getFcsjActual() == null && !s.isDestroy())
  610 + n++;
  611 +
  612 + if (s.getId().equals(sch.getId()))
  613 + break;
  614 + }
  615 + return n;
  616 + }
  617 +
  618 + /**
  619 + * @Title: validEndTime
  620 + * @Description: TODO(是否是有效的到达时间)
  621 + */
  622 + public boolean validEndTime(ScheduleRealInfo sch, Long ts) {
  623 + if (sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts)
  624 + return false;
  625 +
  626 + return validTime(sch, ts);
  627 + }
  628 +
  629 + /**
  630 + * @Title: validStartTime
  631 + * @Description: TODO(是否是合适的发车时间)
  632 + */
  633 + public boolean validStartTime(ScheduleRealInfo sch, Long ts) {
  634 + if (sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts)
  635 + return false;
  636 +
  637 + return validTime(sch, ts);
  638 + }
  639 +
  640 + public boolean validTime(ScheduleRealInfo sch, Long ts) {
  641 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
  642 + int ci = list.indexOf(sch);
  643 + ScheduleRealInfo prve, next;
  644 + if (ci > 0) {
  645 + //之前班次实际时间不能大于该时间
  646 + for (int i = ci - 1; i >= 0; i--) {
  647 + prve = list.get(i);
  648 + if (prve.getZdsjActualTime() != null && prve.getZdsjActualTime() > ts)
  649 + return false;
  650 +
  651 + if (prve.getFcsjActualTime() != null && prve.getFcsjActualTime() > ts)
  652 + return false;
  653 + }
  654 + }
  655 +
  656 + if (ci < list.size() - 1) {
  657 + //之后班次实际时间不能小于该时间
  658 + for (int i = ci + 1; i < list.size(); i++) {
  659 + next = list.get(i);
  660 + if (next.getFcsjActualTime() != null && next.getFcsjActualTime() < ts)
  661 + return false;
  662 +
  663 + if (next.getZdsjActualTime() != null && next.getZdsjActualTime() < ts)
  664 + return false;
  665 + }
  666 + }
  667 + return true;
  668 + }
  669 +
  670 + public void save(ScheduleRealInfo sch) {
  671 + //schRepository.save(sch);
  672 + pstBuffer.add(sch);
  673 + }
  674 +
  675 +
  676 + /**
  677 + * @Title: nextByBcType
  678 + * @Description: TODO(获取下一个指定班次类型的班次)
  679 + */
  680 + public ScheduleRealInfo nextByBcType(String nbbm, String bcType) {
  681 + List<ScheduleRealInfo> list = findByBcType(nbbm, bcType);
  682 +
  683 + Collections.sort(list, schFCSJComparator);
  684 + ScheduleRealInfo sch = null;
  685 + for (ScheduleRealInfo temp : list) {
  686 + if (temp.getFcsjActual() == null)
  687 + sch = temp;
  688 + }
  689 +
  690 + return sch;
  691 + }
  692 +
  693 + public List<ScheduleRealInfo> findByBcType(String nbbm, String bcType) {
  694 + List<ScheduleRealInfo> all = nbbmScheduleMap.get(nbbm), outList = new ArrayList<>();
  695 +
  696 + for (ScheduleRealInfo sch : all) {
  697 + if (sch.getBcType().equals(bcType))
  698 + outList.add(sch);
  699 + }
  700 + return outList;
  701 + }
  702 +
  703 + public Set<String> allCar() {
  704 + return nbbmScheduleMap.keySet();
  705 + }
  706 +
  707 + public Collection<ScheduleRealInfo> findAll() {
  708 + return nbbmScheduleMap.values();
  709 + }
  710 +
  711 + public void addExecPlan(ScheduleRealInfo sch) {
  712 + if(sch != null)
  713 + carExecutePlanMap.put(sch.getClZbh(), sch);
  714 + }
  715 +
  716 + public void removeExecPlan(String clzbh) {
  717 + carExecutePlanMap.remove(clzbh);
  718 + }
  719 +
  720 + public Map<String, ScheduleRealInfo> execPlanMap() {
  721 + return carExecutePlanMap;
  722 + }
  723 +
  724 + /**
  725 + * 车辆当前执行的班次
  726 + *
  727 + * @param nbbm
  728 + * @return
  729 + */
  730 + public ScheduleRealInfo executeCurr(String nbbm) {
  731 + return carExecutePlanMap.get(nbbm);
  732 + }
  733 +
  734 + /**
  735 + * @param @param sch
  736 + * @param @param newClZbh 新的车辆自编号
  737 + * @Title: changeCar
  738 + * @Description: TODO(班次换车) 返回有更新的班次
  739 + */
  740 + public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch, String newClZbh) {
  741 + List<ScheduleRealInfo> ups = new ArrayList<>();
  742 + String oldClzbh = sch.getClZbh();
  743 + if (oldClzbh.equals(newClZbh))
  744 + return ups;
  745 +
  746 +
  747 + //变更相关映射信息
  748 + nbbmScheduleMap.remove(sch.getClZbh(), sch);
  749 +
  750 + sch.setClZbh(newClZbh);
  751 + nbbmScheduleMap.put(newClZbh, sch);
  752 + nbbm2SEStationMap.put(newClZbh, sch.getQdzCode());
  753 + nbbm2SEStationMap.put(newClZbh, sch.getZdzCode());
  754 +
  755 + //重新计算班次应到时间
  756 + ups.addAll(updateQdzTimePlan(oldClzbh));
  757 + ups.addAll(updateQdzTimePlan(newClZbh));
  758 +
  759 + //重新计算车辆当前执行班次
  760 + reCalcExecPlan(newClZbh);
  761 + reCalcExecPlan(sch.getClZbh());
  762 + return ups;
  763 + }
  764 +
  765 + public void reCalcExecPlan(String nbbm){
  766 + carExecutePlanMap.put(nbbm, schAttrCalculator.calcCurrentExecSch(nbbmScheduleMap.get(nbbm)));
  767 + }
  768 +
  769 + /**
  770 + * 是否在执行首班出场
  771 + * @param nbbm
  772 + * @return
  773 + */
  774 + public boolean isExecFirstOut(String nbbm, long time){
  775 + try {
  776 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(nbbm);
  777 + ScheduleRealInfo second = list.get(2),
  778 + first = executeCurr(nbbm);
  779 +
  780 + if(first.getBcType().equals("out")
  781 + && first.getDfsjT() < second.getDfsjT()
  782 + && doneSum(nbbm) == 0 && second.getDfsjT() > time)
  783 + return true;
  784 + } catch (Exception e) {
  785 + logger.error("", e);
  786 + }
  787 +
  788 + return false;
  789 + }
  790 +
  791 + /**
  792 + * 获取班次的计划停站时间
  793 + * @param sch
  794 + * @return
  795 +
  796 + public int stopTimePlan(Object task) {
  797 +
  798 + ScheduleRealInfo sch = prev((ScheduleRealInfo) task);
  799 +
  800 + sch.getzdsj
  801 + return -1;
  802 + }*/
  803 +
  804 + /**
  805 + *
  806 + * @Title: linkToSchPlan
  807 + * @Description: TODO(车辆关联到班次)
  808 + */
779 /* public void linkToSchPlan(String nbbm) { 809 /* public void linkToSchPlan(String nbbm) {
780 //当前GPS状态 810 //当前GPS状态
781 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); 811 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm));
src/main/java/com/bsth/entity/Cars.java
@@ -23,7 +23,7 @@ import java.util.Date; @@ -23,7 +23,7 @@ import java.util.Date;
23 23
24 @Entity 24 @Entity
25 @Table(name = "bsth_c_cars") 25 @Table(name = "bsth_c_cars")
26 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
27 public class Cars extends BEntity implements Serializable { 27 public class Cars extends BEntity implements Serializable {
28 28
29 /** 主键Id */ 29 /** 主键Id */
src/main/java/com/bsth/entity/Line.java
@@ -24,7 +24,7 @@ import java.util.Date; @@ -24,7 +24,7 @@ import java.util.Date;
24 24
25 @Entity 25 @Entity
26 @Table(name = "bsth_c_line") 26 @Table(name = "bsth_c_line")
27 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 27 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
28 public class Line implements Serializable { 28 public class Line implements Serializable {
29 29
30 @Id 30 @Id
src/main/java/com/bsth/entity/Personnel.java
@@ -21,7 +21,7 @@ import javax.persistence.*; @@ -21,7 +21,7 @@ import javax.persistence.*;
21 21
22 @Entity 22 @Entity
23 @Table(name = "bsth_c_personnel") 23 @Table(name = "bsth_c_personnel")
24 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 24 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
25 public class Personnel extends BEntity { 25 public class Personnel extends BEntity {
26 26
27 /** 主键Id */ 27 /** 主键Id */
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
1 package com.bsth.entity.realcontrol; 1 package com.bsth.entity.realcontrol;
2 2
  3 +import com.bsth.entity.Line;
  4 +
  5 +import javax.persistence.*;
3 import java.text.ParseException; 6 import java.text.ParseException;
4 import java.text.SimpleDateFormat; 7 import java.text.SimpleDateFormat;
5 import java.util.Date; 8 import java.util.Date;
6 import java.util.HashSet; 9 import java.util.HashSet;
7 import java.util.Set; 10 import java.util.Set;
8 11
9 -import javax.persistence.CascadeType;  
10 -import javax.persistence.Entity;  
11 -import javax.persistence.GeneratedValue;  
12 -import javax.persistence.Id;  
13 -import javax.persistence.NamedAttributeNode;  
14 -import javax.persistence.NamedEntityGraph;  
15 -import javax.persistence.NamedEntityGraphs;  
16 -import javax.persistence.OneToMany;  
17 -import javax.persistence.OneToOne;  
18 -import javax.persistence.Table;  
19 -import javax.persistence.Transient;  
20 -  
21 -import com.bsth.entity.Line;  
22 -import com.bsth.util.DateUtils;  
23 -  
24 /** 12 /**
25 * 13 *
26 * @ClassName: LineConfig 14 * @ClassName: LineConfig
@@ -59,9 +47,6 @@ public class LineConfig { @@ -59,9 +47,6 @@ public class LineConfig {
59 /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */ 47 /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */
60 private int outConfig; 48 private int outConfig;
61 49
62 - /** 进场时间设置 0:真实进场(设备进入缓冲区时间) 1:请求进场时间 2:出站即出场*/  
63 - private int inConfig;  
64 -  
65 /** 短语模板 , 号分隔多个 */ 50 /** 短语模板 , 号分隔多个 */
66 private String phraseTemps; 51 private String phraseTemps;
67 52
@@ -111,14 +96,6 @@ public class LineConfig { @@ -111,14 +96,6 @@ public class LineConfig {
111 this.outConfig = outConfig; 96 this.outConfig = outConfig;
112 } 97 }
113 98
114 - public int getInConfig() {  
115 - return inConfig;  
116 - }  
117 -  
118 - public void setInConfig(int inConfig) {  
119 - this.inConfig = inConfig;  
120 - }  
121 -  
122 public String getPhraseTemps() { 99 public String getPhraseTemps() {
123 return phraseTemps; 100 return phraseTemps;
124 } 101 }
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
@@ -19,7 +19,7 @@ import java.util.Date; @@ -19,7 +19,7 @@ import java.util.Date;
19 @NamedAttributeNode("cl") 19 @NamedAttributeNode("cl")
20 }) 20 })
21 }) 21 })
22 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 22 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
23 public class CarConfigInfo extends BEntity implements Serializable { 23 public class CarConfigInfo extends BEntity implements Serializable {
24 24
25 /** 主健Id */ 25 /** 主健Id */
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
@@ -22,7 +22,7 @@ import java.io.Serializable; @@ -22,7 +22,7 @@ import java.io.Serializable;
22 @NamedAttributeNode("xl") 22 @NamedAttributeNode("xl")
23 }) 23 })
24 }) 24 })
25 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 25 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
26 public class EmployeeConfigInfo extends BEntity implements Serializable { 26 public class EmployeeConfigInfo extends BEntity implements Serializable {
27 27
28 /** 主键Id */ 28 /** 主键Id */
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
@@ -15,7 +15,7 @@ import javax.persistence.*; @@ -15,7 +15,7 @@ import javax.persistence.*;
15 @NamedAttributeNode("xl") 15 @NamedAttributeNode("xl")
16 }) 16 })
17 }) 17 })
18 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 18 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
19 public class GuideboardInfo extends BEntity { 19 public class GuideboardInfo extends BEntity {
20 20
21 /** 主键Id */ 21 /** 主键Id */
src/main/java/com/bsth/entity/sys/SysUser.java
@@ -9,7 +9,7 @@ import java.util.Set; @@ -9,7 +9,7 @@ import java.util.Set;
9 9
10 @Entity 10 @Entity
11 @Table(name = "bsth_c_sys_user") 11 @Table(name = "bsth_c_sys_user")
12 -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 12 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"})
13 public class SysUser { 13 public class SysUser {
14 14
15 @Id 15 @Id
src/main/java/com/bsth/service/BusIntervalService.java
@@ -8,6 +8,8 @@ public interface BusIntervalService { @@ -8,6 +8,8 @@ public interface BusIntervalService {
8 8
9 List<Map<String, Object>> getDir(Map<String, Object> map); 9 List<Map<String, Object>> getDir(Map<String, Object> map);
10 10
  11 + List<Map<String, Object>> getLp(Map<String, Object> map);
  12 +
11 List<Map<String, Object>> interval(Map<String, Object> map); 13 List<Map<String, Object>> interval(Map<String, Object> map);
12 14
13 Map<String, Object> timeAndSpeed(Map<String, Object> map); 15 Map<String, Object> timeAndSpeed(Map<String, Object> map);
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -290,6 +290,7 @@ public class FormsServiceImpl implements FormsService { @@ -290,6 +290,7 @@ public class FormsServiceImpl implements FormsService {
290 290
291 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { 291 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
292 292
  293 +
293 @Override 294 @Override
294 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { 295 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
295 Changetochange chan = new Changetochange(); 296 Changetochange chan = new Changetochange();
@@ -314,6 +315,7 @@ public class FormsServiceImpl implements FormsService { @@ -314,6 +315,7 @@ public class FormsServiceImpl implements FormsService {
314 return list; 315 return list;
315 } 316 }
316 317
  318 +
317 // 路单数据 319 // 路单数据
318 @Override 320 @Override
319 public List<Singledata> singledata(Map<String, Object> map) { 321 public List<Singledata> singledata(Map<String, Object> map) {
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
  3 +import java.math.BigDecimal;
  4 +import java.math.RoundingMode;
3 import java.sql.ResultSet; 5 import java.sql.ResultSet;
4 import java.sql.SQLException; 6 import java.sql.SQLException;
5 import java.text.DecimalFormat; 7 import java.text.DecimalFormat;
@@ -11,12 +13,14 @@ import java.util.Date; @@ -11,12 +13,14 @@ import java.util.Date;
11 import java.util.HashMap; 13 import java.util.HashMap;
12 import java.util.List; 14 import java.util.List;
13 import java.util.Map; 15 import java.util.Map;
  16 +import java.util.Set;
14 17
15 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
16 import org.springframework.jdbc.core.JdbcTemplate; 19 import org.springframework.jdbc.core.JdbcTemplate;
17 import org.springframework.jdbc.core.RowMapper; 20 import org.springframework.jdbc.core.RowMapper;
18 import org.springframework.stereotype.Service; 21 import org.springframework.stereotype.Service;
19 22
  23 +import com.bsth.entity.realcontrol.ChildTaskPlan;
20 import com.bsth.entity.realcontrol.ScheduleRealInfo; 24 import com.bsth.entity.realcontrol.ScheduleRealInfo;
21 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 25 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
22 import com.bsth.service.BusIntervalService; 26 import com.bsth.service.BusIntervalService;
@@ -36,9 +40,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -36,9 +40,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
36 private JdbcTemplate jdbcTemplate; 40 private JdbcTemplate jdbcTemplate;
37 41
38 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 42 private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
39 - private DecimalFormat df = new DecimalFormat("##0.00"); 43 + private DecimalFormat df = new DecimalFormat("0.##");
40 44
41 - public List<ScheduleRealInfo> getSchedule(String company, String subCompany, String line, String startDate, String endDate, String model, String times){ 45 + public List<ScheduleRealInfo> getSchedule(String company, String subCompany, String line, String startDate, String endDate, String model, String times, boolean normal){
42 List<Long> ttList = new ArrayList<Long>(); 46 List<Long> ttList = new ArrayList<Long>();
43 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 47 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
44 List<ScheduleRealInfo> resList = new ArrayList<ScheduleRealInfo>(); 48 List<ScheduleRealInfo> resList = new ArrayList<ScheduleRealInfo>();
@@ -56,14 +60,18 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -56,14 +60,18 @@ public class BusIntervalServiceImpl implements BusIntervalService {
56 if(company.length() != 0){ 60 if(company.length() != 0){
57 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 61 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
58 } 62 }
59 - sql += " and bc_type = 'normal'"; 63 + if(normal){
  64 + sql += " and bc_type != 'in' and bc_type != 'out'";
  65 + }
60 66
61 - list =jdbcTemplate.query(sql, 67 + list = jdbcTemplate.query(sql,
62 new RowMapper<ScheduleRealInfo>(){ 68 new RowMapper<ScheduleRealInfo>(){
63 @Override 69 @Override
64 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 70 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
65 ScheduleRealInfo schedule = new ScheduleRealInfo(); 71 ScheduleRealInfo schedule = new ScheduleRealInfo();
66 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 72 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  73 + schedule.setRealExecDate(rs.getString("real_exec_date"));
  74 + schedule.setXlBm(rs.getString("xl_bm"));
67 schedule.setXlName(rs.getString("xl_name")); 75 schedule.setXlName(rs.getString("xl_name"));
68 schedule.setLpName(rs.getString("lp_name")); 76 schedule.setLpName(rs.getString("lp_name"));
69 schedule.setBcType(rs.getString("bc_type")); 77 schedule.setBcType(rs.getString("bc_type"));
@@ -75,6 +83,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -75,6 +83,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
75 schedule.setFcsjActual(rs.getString("fcsj_actual")); 83 schedule.setFcsjActual(rs.getString("fcsj_actual"));
76 schedule.setZdsj(rs.getString("zdsj")); 84 schedule.setZdsj(rs.getString("zdsj"));
77 schedule.setZdsjActual(rs.getString("zdsj_actual")); 85 schedule.setZdsjActual(rs.getString("zdsj_actual"));
  86 + schedule.setQdzCode(rs.getString("qdz_code"));
78 schedule.setQdzName(rs.getString("qdz_name")); 87 schedule.setQdzName(rs.getString("qdz_name"));
79 schedule.setZdzName(rs.getString("zdz_name")); 88 schedule.setZdzName(rs.getString("zdz_name"));
80 schedule.setXlDir(rs.getString("xl_dir")); 89 schedule.setXlDir(rs.getString("xl_dir"));
@@ -88,15 +97,57 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -88,15 +97,57 @@ public class BusIntervalServiceImpl implements BusIntervalService {
88 schedule.setjGh(rs.getString("j_gh")); 97 schedule.setjGh(rs.getString("j_gh"));
89 schedule.setjName(rs.getString("j_name")); 98 schedule.setjName(rs.getString("j_name"));
90 schedule.setSpId(rs.getLong("sp_id")); 99 schedule.setSpId(rs.getLong("sp_id"));
  100 + schedule.setSflj(rs.getBoolean("sflj"));
  101 +
  102 + String[] split1 = schedule.getFcsj().split(":");
  103 + String[] split3 = schedule.getZdsj().split(":");
  104 + long fcsj = Long.valueOf(split1[0]) * 60 + Long.valueOf(split1[1]);
  105 + long zdsj = Long.valueOf(split3[0]) * 60 + Long.valueOf(split3[1]);
  106 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate())){
  107 + fcsj += 1440l;
  108 + zdsj += 1440l;
  109 + }
  110 + if(zdsj < fcsj)
  111 + zdsj += 1440l;
  112 + if(schedule.getDfsj() != null){
  113 + String[] split0 = schedule.getDfsj().split(":");
  114 + long dfsj = Long.valueOf(split0[0]) * 60 + Long.valueOf(split0[1]);
  115 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  116 + dfsj += 1440l;
  117 + schedule.setDfsj(dfsj/60 + ":" + dfsj%60);
  118 + schedule.setDfsjT(dfsj);
  119 + }
  120 + if(schedule.getFcsjActual() != null){
  121 + String[] split2 = schedule.getFcsjActual().split(":");
  122 + long fcsjA = Long.valueOf(split2[0]) * 60 + Long.valueOf(split2[1]);
  123 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  124 + fcsjA += 1440l;
  125 + schedule.setFcsjActual(fcsjA/60 + ":" + fcsjA%60);
  126 + schedule.setFcsjActualTime(fcsjA);
  127 + }
  128 + if(schedule.getZdsjActual() != null){
  129 + String[] split4 = schedule.getZdsjActual().split(":");
  130 + long zdsjA = Long.valueOf(split4[0]) * 60 + Long.valueOf(split4[1]);
  131 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  132 + zdsjA += 1440l;
  133 + if(schedule.getFcsjActualTime() != null && zdsjA < schedule.getFcsjActualTime())
  134 + zdsjA += 1440l;
  135 + schedule.setZdsjActual(zdsjA/60 + ":" + zdsjA%60);
  136 + schedule.setZdsjActualTime(zdsjA);
  137 + }
  138 + schedule.setFcsj(fcsj/60 + ":" + fcsj%60);
  139 + schedule.setZdsj(zdsj/60 + ":" + zdsj%60);
  140 + schedule.setFcsjT(fcsj);
  141 + schedule.setZdsjT(zdsj);
91 return schedule; 142 return schedule;
92 } 143 }
93 }); 144 });
94 145
95 if(model.length() != 0){ 146 if(model.length() != 0){
96 -// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";  
97 - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type = 'normal'"; 147 +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
  148 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'";
98 149
99 - ttList =jdbcTemplate.query(sql, 150 + ttList = jdbcTemplate.query(sql,
100 new RowMapper<Long>(){ 151 new RowMapper<Long>(){
101 @Override 152 @Override
102 public Long mapRow(ResultSet rs, int rowNum) throws SQLException { 153 public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
@@ -143,7 +194,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -143,7 +194,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
143 } 194 }
144 } 195 }
145 } 196 }
146 - 197 +
147 list = new ArrayList<ScheduleRealInfo>(); 198 list = new ArrayList<ScheduleRealInfo>();
148 List<Long> keyList = new ArrayList<Long>(); 199 List<Long> keyList = new ArrayList<Long>();
149 Map<Long, List<ScheduleRealInfo>> keyMap = new HashMap<Long, List<ScheduleRealInfo>>(); 200 Map<Long, List<ScheduleRealInfo>> keyMap = new HashMap<Long, List<ScheduleRealInfo>>();
@@ -161,7 +212,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -161,7 +212,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
161 list.add(schedule); 212 list.add(schedule);
162 } 213 }
163 } 214 }
164 - 215 +
165 return list; 216 return list;
166 } 217 }
167 218
@@ -176,7 +227,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -176,7 +227,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
176 227
177 String sql = "select start_station_name, end_station_name from bsth_c_line where line_code = '"+line+"'"; 228 String sql = "select start_station_name, end_station_name from bsth_c_line where line_code = '"+line+"'";
178 229
179 - list =jdbcTemplate.query(sql, 230 + list = jdbcTemplate.query(sql,
180 new RowMapper<Map<String, Object>>(){ 231 new RowMapper<Map<String, Object>>(){
181 @Override 232 @Override
182 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { 233 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
@@ -205,8 +256,45 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -205,8 +256,45 @@ public class BusIntervalServiceImpl implements BusIntervalService {
205 } 256 }
206 257
207 @Override 258 @Override
  259 + public List<Map<String, Object>> getLp(Map<String, Object> map){
  260 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  261 +
  262 + String line = map.get("line").toString();
  263 + String ttId = map.get("ttId").toString();
  264 +
  265 + try {
  266 + String sql = "select td.lp, lp.lp_name from bsth_c_s_ttinfo_detail td" +
  267 + " left join bsth_c_s_gbi lp on td.lp = lp.id" +
  268 + " left join bsth_c_line cl on cl.id = td.xl where 1=1";
  269 + if(line.length() != 0)
  270 + sql += " and cl.line_code = '"+line+"'";
  271 + if(ttId.length() != 0)
  272 + sql += " and td.ttinfo = '"+ttId+"'";
  273 + sql += " group by td.lp";
  274 +
  275 + list = jdbcTemplate.query(sql,
  276 + new RowMapper<Map<String, Object>>(){
  277 + @Override
  278 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  279 + Map<String, Object> map = new HashMap<String, Object>();
  280 + map.put("id", rs.getString("lp"));
  281 + map.put("name", rs.getString("lp_name"));
  282 + return map;
  283 + }
  284 +
  285 + });
  286 + } catch (Exception e) {
  287 + // TODO: handle exception
  288 + e.printStackTrace();
  289 + }
  290 +
  291 + return list;
  292 + }
  293 +
  294 + @Override
208 public List<Map<String, Object>> interval(Map<String, Object> map) { 295 public List<Map<String, Object>> interval(Map<String, Object> map) {
209 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 296 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  297 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
210 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); 298 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
211 299
212 String company = map.get("company").toString(); 300 String company = map.get("company").toString();
@@ -215,7 +303,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -215,7 +303,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
215 String startDate = map.get("startDate").toString(); 303 String startDate = map.get("startDate").toString();
216 String endDate = map.get("endDate").toString(); 304 String endDate = map.get("endDate").toString();
217 String model = map.get("model").toString(); 305 String model = map.get("model").toString();
218 - String times = map.get("times").toString(); 306 + String statu = map.get("statu").toString();
  307 +// String times = map.get("times").toString();
219 String type = map.get("type").toString(); 308 String type = map.get("type").toString();
220 309
221 if(startDate.length() == 0){ 310 if(startDate.length() == 0){
@@ -224,273 +313,737 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -224,273 +313,737 @@ public class BusIntervalServiceImpl implements BusIntervalService {
224 if(endDate.length() == 0){ 313 if(endDate.length() == 0){
225 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 314 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
226 } 315 }
227 - if(times.length() == 0){  
228 - times = "06:00-07:00"; 316 + if(statu.equals("0")){
  317 + line = "";
229 } 318 }
  319 +// if(times.length() == 0){
  320 +// times = "06:00-07:00";
  321 +// }
230 322
231 - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, times); 323 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, "", true);
232 324
233 String[] date1 = startDate.split("-"); 325 String[] date1 = startDate.split("-");
234 String[] date2 = endDate.split("-"); 326 String[] date2 = endDate.split("-");
235 startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; 327 startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日";
236 endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; 328 endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日";
  329 + String Date = "";
  330 + if(startDate.equals(endDate))
  331 + Date = startDate;
  332 + else
  333 + Date = startDate + "--" + endDate;
237 334
238 - String[] split = times.split("-");  
239 - int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);  
240 - int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); 335 +// String[] split = times.split("-");
  336 +// int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
  337 +// int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
241 338
242 - //分组统计班次间隔  
243 for(ScheduleRealInfo schedule : list){ 339 for(ScheduleRealInfo schedule : list){
244 - long fcsj = schedule.getFcsjT();  
245 - if(endTime != 0?(fcsj >= startTime && fcsj <= endTime):(fcsj >= startTime)){  
246 - String key = schedule.getXlName() + "/" + schedule.getQdzName();  
247 - if(!keyMap.containsKey(key))  
248 - keyMap.put(key, new ArrayList<ScheduleRealInfo>());  
249 - keyMap.get(key).add(schedule);  
250 - } 340 + String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName();
  341 + if(!keyMap.containsKey(key))
  342 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  343 + keyMap.get(key).add(schedule);
251 } 344 }
  345 +
  346 + List<String> keyList = new ArrayList<String>();
  347 + Map<String, List<Long>> temp0 = new HashMap<String, List<Long>>();
  348 + Map<String, List<Long>> temp1 = new HashMap<String, List<Long>>();
  349 + String companyName = "", subCompanyName = "";
252 for(String key : keyMap.keySet()){ 350 for(String key : keyMap.keySet()){
253 - long jhInterval = 0;  
254 - long sjInterval = 0;  
255 - int jhNum = 0;  
256 - int sjNum = 0;  
257 - String companyName = "", subCompanyName = "";  
258 - Map<String, Object> tempMap = new HashMap<String, Object>();  
259 - Map<String, List<ScheduleRealInfo>> temp = new HashMap<String, List<ScheduleRealInfo>>(); 351 + if(keyMap.get(key).size() < 2)
  352 + continue;
  353 + Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>();
260 for(ScheduleRealInfo schedule : keyMap.get(key)){ 354 for(ScheduleRealInfo schedule : keyMap.get(key)){
  355 + if(companyName.length() == 0 && schedule.getGsName() != null)
  356 + companyName = schedule.getGsName();
  357 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  358 + subCompanyName = schedule.getFgsName();
261 String date = schedule.getScheduleDateStr(); 359 String date = schedule.getScheduleDateStr();
262 - if(!temp.containsKey(date))  
263 - temp.put(date, new ArrayList<ScheduleRealInfo>());  
264 - temp.get(date).add(schedule); 360 + if(!keyMap2.containsKey(date))
  361 + keyMap2.put(date, new ArrayList<ScheduleRealInfo>());
  362 + keyMap2.get(date).add(schedule);
265 } 363 }
266 - for(String date : temp.keySet()){  
267 - List<ScheduleRealInfo> tempList = temp.get(date);  
268 - for(int i = 1; i < tempList.size(); i++){  
269 - jhNum++;  
270 - ScheduleRealInfo schedule1 = tempList.get(i - 1);  
271 - ScheduleRealInfo schedule2 = tempList.get(i);  
272 -  
273 - if(schedule1.getGsName() != null && companyName.length() == 0)  
274 - companyName = schedule1.getGsName();  
275 - if(schedule1.getFgsName() != null && subCompanyName.length() == 0)  
276 - subCompanyName = schedule1.getFgsName();  
277 -  
278 - jhInterval += schedule2.getFcsjT();  
279 - jhInterval -= schedule1.getFcsjT();  
280 - if(schedule1.getFcsjActual()!=null && schedule2.getFcsjActual()!=null){  
281 - sjNum++;  
282 - sjInterval += schedule2.getFcsjActualTime();  
283 - sjInterval -= schedule1.getFcsjActualTime(); 364 + Map<Long, List<Long>> timeMap0 = new HashMap<Long, List<Long>>();
  365 + Map<Long, List<Long>> timeMap1 = new HashMap<Long, List<Long>>();
  366 + List<Long> timeList = new ArrayList<Long>();
  367 + for(String date : keyMap2.keySet()){
  368 + if(keyMap2.get(date).size() < 2)
  369 + continue;
  370 + List<Long> fcsjs = new ArrayList<Long>();
  371 + List<Long> fcsjAs = new ArrayList<Long>();
  372 + for(ScheduleRealInfo schedule : keyMap2.get(date)){
  373 + if(schedule.getFcsjT() != null && !schedule.isSflj())
  374 + fcsjs.add(schedule.getFcsjT());
  375 + if(schedule.getFcsjActualTime() != null && schedule.getStatus() != -1)
  376 + fcsjAs.add(schedule.getFcsjActualTime());
  377 + }
  378 + Collections.sort(fcsjs);
  379 + Collections.sort(fcsjAs);
  380 +
  381 + if(statu.equals("1")){
  382 + for(int i = 1; i < fcsjs.size(); i++){
  383 + long fcsj1 = fcsjs.get(i - 1);
  384 + long fcsj2 = fcsjs.get(i);
  385 + Long time = fcsj1/60;
  386 + if(!timeMap0.containsKey(time) && !timeMap1.containsKey(time)){
  387 + timeMap0.put(time, new ArrayList<Long>());
  388 + timeMap1.put(time, new ArrayList<Long>());
  389 + timeList.add(time);
  390 + }
  391 + timeMap0.get(time).add(fcsj2 - fcsj1);
  392 + }
  393 + for(int i = 1; i < fcsjAs.size(); i++){
  394 + long fcsj1 = fcsjAs.get(i - 1);
  395 + long fcsj2 = fcsjAs.get(i);
  396 + Long time = fcsj1/60;
  397 + if(timeMap1.containsKey(time)){
  398 + timeMap1.get(time).add(fcsj2 - fcsj1);
  399 + }
  400 + }
  401 + }else if(statu.equals("0")){
  402 + for(int i = 1; i < fcsjs.size(); i++){
  403 + long fcsj1 = fcsjs.get(i - 1);
  404 + long fcsj2 = fcsjs.get(i);
  405 + if(!temp0.containsKey(key) && !temp1.containsKey(key)){
  406 + temp0.put(key, new ArrayList<Long>());
  407 + temp1.put(key, new ArrayList<Long>());
  408 + if(!keyList.contains(key))
  409 + keyList.add(key);
  410 + }
  411 + temp0.get(key).add(fcsj2 - fcsj1);
  412 + }
  413 + for(int i = 1; i < fcsjAs.size(); i++){
  414 + long fcsj1 = fcsjAs.get(i - 1);
  415 + long fcsj2 = fcsjAs.get(i);
  416 + temp1.get(key).add(fcsj2 - fcsj1);
284 } 417 }
285 } 418 }
286 } 419 }
287 - if(startDate.equals(endDate))  
288 - tempMap.put("date", startDate);  
289 - else  
290 - tempMap.put("date", startDate + "--" + endDate);  
291 - String[] keys = key.split("/");  
292 - tempMap.put("line", keys[0]);  
293 - tempMap.put("qdz", keys[1]);  
294 - tempMap.put("times", times);  
295 - tempMap.put("company", companyName);  
296 - tempMap.put("subCompany", subCompanyName);  
297 - if(jhNum != 0)  
298 - tempMap.put("jhInterval", jhInterval/jhNum);  
299 - else  
300 - tempMap.put("jhInterval", "/");  
301 - if(sjNum != 0){  
302 - tempMap.put("sjInterval", sjInterval/sjNum);  
303 - tempMap.put("deviation", sjInterval/sjNum - jhInterval/jhNum);  
304 - }  
305 - else{  
306 - tempMap.put("sjInterval", "/");  
307 - tempMap.put("deviation", "/"); 420 +
  421 + if(statu.equals("1")){
  422 + for(Long time : timeList){
  423 + Map<String, Object> tempMap = new HashMap<String, Object>();
  424 + List<Long> fcsjs = timeMap0.get(time);
  425 + List<Long> fcsjAs = timeMap1.get(time);
  426 + Collections.sort(fcsjs);
  427 + Collections.sort(fcsjAs);
  428 + String[] split = key.split("/");
  429 + tempMap.put("date", Date);
  430 + tempMap.put("line", split[1]);
  431 + tempMap.put("qdz", split[2]);
  432 + tempMap.put("company", companyName);
  433 + tempMap.put("subCompany", subCompanyName);
  434 + long jhInterval = 0l;
  435 + long sjInterval = 0l;
  436 + for(Long i : fcsjs)
  437 + jhInterval += i;
  438 + for(Long i : fcsjAs)
  439 + sjInterval += i;
  440 + tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)jhInterval/fcsjs.size()):"/");
  441 + tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)sjInterval/fcsjAs.size()):"/");
  442 + tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/");
  443 + tempMap.put("MinInterval", fcsjAs.size()>0?fcsjAs.get(0):"/");
  444 + tempMap.put("times", (time>9?time:"0"+time) + ":00-" + (time+1>9?(time+1):"0"+(time+1)) + ":00");
  445 + if(tempMap.get("jhInterval").toString().equals("/")
  446 + ||tempMap.get("sjInterval").toString().equals("/")){
  447 + tempMap.put("deviation", "/");
  448 + } else {
  449 + tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString())
  450 + - Double.valueOf(tempMap.get("jhInterval").toString())));
  451 + }
  452 + tempList.add(tempMap);
  453 + }
308 } 454 }
309 - if(tempMap.get("jhInterval") != null && !tempMap.get("jhInterval").toString().equals("0") && !tempMap.get("jhInterval").toString().equals("/"))  
310 - resList.add(tempMap);  
311 } 455 }
312 456
313 - //排序  
314 - Map<String, List<Map<String, Object>>> temp = new HashMap<String, List<Map<String, Object>>>();  
315 - List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();  
316 - for(Map<String, Object> m : resList){  
317 - String key = m.get("line").toString();  
318 - if(!temp.containsKey(key))  
319 - temp.put(key, new ArrayList<Map<String, Object>>());  
320 - temp.get(key).add(m);  
321 - }  
322 - for(String key : temp.keySet()){  
323 - for(Map<String, Object> m : temp.get(key)){  
324 - tempList.add(m); 457 + if(statu.equals("1")){
  458 + List<Long> sortList = new ArrayList<Long>();
  459 + Map<Long, List<Map<String, Object>>> sortMap = new HashMap<Long, List<Map<String, Object>>>();
  460 + for(Map<String, Object> m : tempList){
  461 + Long sort = Long.valueOf(m.get("times").toString().substring(0, 2));
  462 + if(!sortMap.containsKey(sort)){
  463 + sortMap.put(sort, new ArrayList<Map<String, Object>>());
  464 + sortList.add(sort);
  465 + }
  466 + sortMap.get(sort).add(m);
  467 + }
  468 + Collections.sort(sortList);
  469 + for(Long sort : sortList){
  470 + for(Map<String, Object> m : sortMap.get(sort))
  471 + resList.add(m);
  472 + }
  473 + }else if(statu.equals("0")){
  474 + List<Long> longList = new ArrayList<Long>();
  475 + for(String key : keyList){
  476 + long xlBm = Long.valueOf(key.split("/")[0]);
  477 + if(!longList.contains(xlBm))
  478 + longList.add(xlBm);
  479 + Collections.sort(longList);
  480 + }
  481 + for(long xlBm : longList){
  482 + for(String key : keyList){
  483 + String[] split = key.split("/");
  484 + if((long)Long.valueOf(split[0]) == xlBm){
  485 + Map<String, Object> tempMap = new HashMap<String, Object>();
  486 + List<Long> fcsjs = temp0.get(key);
  487 + List<Long> fcsjAs = temp1.get(key);
  488 + Collections.sort(fcsjs);
  489 + Collections.sort(fcsjAs);
  490 + long fcsj = 0l;
  491 + long fcsjA = 0l;
  492 + for(long l : fcsjs)
  493 + fcsj += l;
  494 + for(long l : fcsjAs)
  495 + fcsjA += l;
  496 + tempMap.put("date", Date);
  497 + tempMap.put("line", split[1]);
  498 + tempMap.put("qdz", split[2]);
  499 + tempMap.put("company", companyName);
  500 + tempMap.put("subCompany", subCompanyName);
  501 + tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/");
  502 + tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/");
  503 + tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/");
  504 + tempMap.put("MinInterval", fcsjAs.size()>0?fcsjAs.get(0):"/");
  505 + if(tempMap.get("jhInterval").toString().equals("/")
  506 + ||tempMap.get("sjInterval").toString().equals("/")){
  507 + tempMap.put("deviation", "/");
  508 + } else {
  509 + tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString())
  510 + - Double.valueOf(tempMap.get("jhInterval").toString())));
  511 + }
  512 + resList.add(tempMap);
  513 + }
  514 + }
325 } 515 }
326 } 516 }
327 517
328 - return tempList; 518 + return resList;
329 } 519 }
330 520
331 @Override 521 @Override
332 public Map<String, Object> timeAndSpeed(Map<String, Object> map) { 522 public Map<String, Object> timeAndSpeed(Map<String, Object> map) {
  523 + List<Long> ttList = new ArrayList<Long>();
  524 + List<ChildTaskPlan> cList = new ArrayList<ChildTaskPlan>();
  525 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
333 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 526 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
334 - List<Map<String, Object>> dateList = new ArrayList<Map<String, Object>>(); 527 + List<Map<String, Object>> dataList = new ArrayList<Map<String, Object>>();
335 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); 528 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  529 + Map<String, List<ChildTaskPlan>> cMap = new HashMap<String, List<ChildTaskPlan>>();
336 Map<String, Object> modelMap = new HashMap<String, Object>(); 530 Map<String, Object> modelMap = new HashMap<String, Object>();
337 - 531 +
338 String company = map.get("company").toString(); 532 String company = map.get("company").toString();
339 String subCompany = map.get("subCompany").toString(); 533 String subCompany = map.get("subCompany").toString();
  534 + String lp = map.get("lp").toString();
340 String line = map.get("line").toString(); 535 String line = map.get("line").toString();
  536 + String statu = map.get("statu").toString();
341 String startDate = map.get("startDate").toString(); 537 String startDate = map.get("startDate").toString();
342 String endDate = map.get("endDate").toString(); 538 String endDate = map.get("endDate").toString();
343 String model = map.get("model").toString(); 539 String model = map.get("model").toString();
344 - String times = map.get("times").toString();  
345 String type = map.get("type").toString(); 540 String type = map.get("type").toString();
346 - String zdzName = map.get("upDown").toString();  
347 - 541 +
348 if(startDate.length() == 0){ 542 if(startDate.length() == 0){
349 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 543 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
350 } 544 }
351 if(endDate.length() == 0){ 545 if(endDate.length() == 0){
352 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 546 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
353 } 547 }
354 - if(times.length() == 0){  
355 - times = "06:00-07:00"; 548 +
  549 + try {
  550 +
  551 + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'";
  552 + if(line.length() != 0 && statu.equals("1")){
  553 + sql += " and xl_bm = '"+line+"'";
  554 + }
  555 + if(lp.length() != 0 && statu.equals("1")){
  556 + sql += " and lp_name = '"+lp+"'";
  557 + }
  558 + if(company.length() != 0){
  559 + sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
  560 + }
  561 + sql += " and bc_type != 'in' and bc_type != 'out' order by fcsj";
  562 +
  563 + list = jdbcTemplate.query(sql,
  564 + new RowMapper<ScheduleRealInfo>(){
  565 + @Override
  566 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  567 + ScheduleRealInfo schedule = new ScheduleRealInfo();
  568 + schedule.setId(rs.getLong("id"));
  569 + schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  570 + schedule.setRealExecDate(rs.getString("real_exec_date"));
  571 + schedule.setXlName(rs.getString("xl_name"));
  572 + schedule.setLpName(rs.getString("lp_name"));
  573 + schedule.setBcType(rs.getString("bc_type"));
  574 + schedule.setBcs(rs.getInt("bcs"));
  575 + schedule.setBcsj(rs.getInt("bcsj"));
  576 + schedule.setJhlc(rs.getDouble("jhlc"));
  577 + schedule.setDfsj(rs.getString("dfsj"));
  578 + schedule.setFcsj(rs.getString("fcsj"));
  579 + schedule.setFcsjActual(rs.getString("fcsj_actual"));
  580 + schedule.setZdsj(rs.getString("zdsj"));
  581 + schedule.setZdsjActual(rs.getString("zdsj_actual"));
  582 + schedule.setQdzName(rs.getString("qdz_name"));
  583 + schedule.setZdzName(rs.getString("zdz_name"));
  584 + schedule.setXlDir(rs.getString("xl_dir"));
  585 + schedule.setStatus(rs.getInt("status"));
  586 + schedule.setRemarks(rs.getString("remarks"));
  587 + schedule.setGsName(rs.getString("gs_name"));
  588 + schedule.setFgsName(rs.getString("fgs_name"));
  589 + schedule.setDfAuto(rs.getBoolean("df_auto"));
  590 + schedule.setOnline(rs.getBoolean("online"));
  591 + schedule.setClZbh(rs.getString("cl_zbh"));
  592 + schedule.setjGh(rs.getString("j_gh"));
  593 + schedule.setjName(rs.getString("j_name"));
  594 + schedule.setStatus(rs.getInt("status"));
  595 + schedule.setSpId(rs.getLong("sp_id"));
  596 + if(schedule.getDfsj() != null){
  597 + String[] split0 = schedule.getDfsj().split(":");
  598 + long dfsj = Long.valueOf(split0[0]) * 60 + Long.valueOf(split0[1]);
  599 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  600 + dfsj += 1440l;
  601 + schedule.setDfsj(dfsj/60 + ":" + dfsj%60);
  602 + schedule.setDfsjT(dfsj);
  603 + }
  604 + if(schedule.getFcsjActual() != null){
  605 + String[] split2 = schedule.getFcsjActual().split(":");
  606 + long fcsjA = Long.valueOf(split2[0]) * 60 + Long.valueOf(split2[1]);
  607 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  608 + fcsjA += 1440l;
  609 + schedule.setFcsjActual(fcsjA/60 + ":" + fcsjA%60);
  610 + schedule.setFcsjActualTime(fcsjA);
  611 + }
  612 + if(schedule.getZdsjActual() != null){
  613 + String[] split4 = schedule.getZdsjActual().split(":");
  614 + long zdsjA = Long.valueOf(split4[0]) * 60 + Long.valueOf(split4[1]);
  615 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate()))
  616 + zdsjA += 1440l;
  617 + schedule.setZdsjActual(zdsjA/60 + ":" + zdsjA%60);
  618 + schedule.setZdsjActualTime(zdsjA);
  619 + }
  620 + String[] split1 = schedule.getFcsj().split(":");
  621 + String[] split3 = schedule.getZdsj().split(":");
  622 + long fcsj = Long.valueOf(split1[0]) * 60 + Long.valueOf(split1[1]);
  623 + long zdsj = Long.valueOf(split3[0]) * 60 + Long.valueOf(split3[1]);
  624 +
  625 + if(!schedule.getScheduleDateStr().equals(schedule.getRealExecDate())){
  626 + fcsj += 1440l;
  627 + zdsj += 1440l;
  628 + }
  629 + schedule.setFcsj(fcsj/60 + ":" + fcsj%60);
  630 + schedule.setZdsj(zdsj/60 + ":" + zdsj%60);
  631 + schedule.setFcsjT(fcsj);
  632 + schedule.setZdsjT(zdsj);
  633 + return schedule;
  634 + }
  635 + });
  636 +
  637 + sql = "select * from bsth_c_s_child_task order by start_date";
  638 +
  639 + cList = jdbcTemplate.query(sql,
  640 + new RowMapper<ChildTaskPlan>(){
  641 + @Override
  642 + public ChildTaskPlan mapRow(ResultSet rs, int rowNum) throws SQLException {
  643 + ChildTaskPlan cTask = new ChildTaskPlan();
  644 + cTask.setDestroy(rs.getBoolean("destroy"));
  645 + cTask.setStartDate(rs.getString("start_date"));
  646 + cTask.setEndDate(rs.getString("end_date"));
  647 + cTask.setMileage(rs.getFloat("mileage"));
  648 + cTask.setMileageType(rs.getString("mileage_type"));
  649 + cTask.setRemarks(rs.getString("schedule"));
  650 + return cTask;
  651 + }
  652 + });
  653 +
  654 + if(model.length() != 0){
  655 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'";
  656 +
  657 + ttList = jdbcTemplate.query(sql,
  658 + new RowMapper<Long>(){
  659 + @Override
  660 + public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
  661 + return rs.getLong("id");
  662 + }
  663 + });
  664 + }
  665 +
  666 + } catch (Exception e) {
  667 + // TODO: handle exception
  668 + e.printStackTrace();
356 } 669 }
357 -  
358 - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, times);  
359 670
  671 +
360 String[] date1 = startDate.split("-"); 672 String[] date1 = startDate.split("-");
361 String[] date2 = endDate.split("-"); 673 String[] date2 = endDate.split("-");
  674 + String date = "";
362 startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; 675 startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日";
363 endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; 676 endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日";
364 -  
365 - String[] split = times.split("-");  
366 - int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);  
367 - int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); 677 + if(startDate.equals(endDate)){
  678 + date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日";
  679 + } else {
  680 + date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日--" +
  681 + date2[0] + "年" + date2[1] + "月" + date2[2] + "日";
  682 + }
  683 +
  684 + for(ChildTaskPlan cTask : cList){
  685 + String key = cTask.getRemarks();
  686 + if(!cMap.containsKey(key))
  687 + cMap.put(key, new ArrayList<ChildTaskPlan>());
  688 + cMap.get(key).add(cTask);
  689 + }
368 690
369 for(ScheduleRealInfo schedule : list){ 691 for(ScheduleRealInfo schedule : list){
370 - if(zdzName.length() != 0 && !zdzName.equals(schedule.getZdzName())){  
371 - continue;  
372 - }  
373 - int fcsj = Integer.valueOf(schedule.getFcsjT() + "");  
374 - if(!(endTime != 0?(fcsj >= startTime && fcsj < endTime):(fcsj >= startTime))){  
375 - continue;  
376 - }  
377 - String key = schedule.getXlName() + "/" + schedule.getLpName() + "/" + schedule.getZdzName();  
378 - if(!keyMap.containsKey(key)){  
379 - keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 692 + if(model.length() != 0){
  693 + for(Long tt : ttList)
  694 + if((long) tt == (long)schedule.getSpId()){
  695 + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
  696 + if(!keyMap.containsKey(key))
  697 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  698 + keyMap.get(key).add(schedule);
  699 + }
  700 + }else{
  701 + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
  702 + if(!keyMap.containsKey(key))
  703 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  704 + keyMap.get(key).add(schedule);
380 } 705 }
381 - keyMap.get(key).add(schedule);  
382 } 706 }
383 -  
384 - long yysjSum = 0;  
385 - double yysdSum = 0;  
386 - long yssjSum = 0;  
387 - double yssdSum = 0; 707 +
  708 + String companyName = "", subCompanyName = "";
388 for(String key : keyMap.keySet()){ 709 for(String key : keyMap.keySet()){
389 Map<String, Object> tempMap = new HashMap<String, Object>(); 710 Map<String, Object> tempMap = new HashMap<String, Object>();
390 - long yysj = 0;  
391 - double yysd = 0;  
392 - long yssj = 0;  
393 - double yssd = 0;  
394 - int yyNum = 0;  
395 - int ysNum = 0;  
396 - String companyName = "", subCompanyName = "";  
397 - for(ScheduleRealInfo schedule : keyMap.get(key)){  
398 - if(schedule.getGsName() != null && companyName.length() == 0) 711 + Map<Long, ScheduleRealInfo> sortMap = new HashMap<Long, ScheduleRealInfo>();
  712 + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
  713 + List<Long> keyList = new ArrayList<Long>();
  714 + List<ScheduleRealInfo> list2 = keyMap.get(key);
  715 + long jhyysj = 0, sjyysj = 0;
  716 + long jhyssj = 0, sjyssj = 0;
  717 + double jhlc = 0, sjlc = 0;
  718 + for(ScheduleRealInfo schedule : list2){
  719 + if(companyName.length() == 0 && schedule.getGsName() != null){
399 companyName = schedule.getGsName(); 720 companyName = schedule.getGsName();
400 - if(schedule.getFgsName() != null && subCompanyName.length() == 0) 721 + }
  722 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null){
401 subCompanyName = schedule.getFgsName(); 723 subCompanyName = schedule.getFgsName();
402 - if(!tempMap.containsKey("xlDir"))  
403 - tempMap.put("xlDir", schedule.getXlDir());  
404 - if(!tempMap.containsKey("qdz_zdz") && schedule.getXlDir().equals("0"))  
405 - tempMap.put("qdz_zdz", schedule.getQdzName() + "--" + schedule.getZdzName());  
406 - else if(!tempMap.containsKey("qdz_zdz"))  
407 - tempMap.put("qdz_zdz", schedule.getZdzName() + "--" + schedule.getQdzName());  
408 - if(schedule.getBcsj() != null && schedule.getJhlc() != null){  
409 - int bcsj = schedule.getBcsj();  
410 - double jhlc = schedule.getJhlc();  
411 - yysd += jhlc/bcsj;  
412 - yysj += bcsj;  
413 - yyNum++;  
414 - if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){  
415 - long time = schedule.getZdsjActualTime() - schedule.getFcsjActualTime();  
416 - yssd += jhlc/time;  
417 - yssj += time;  
418 - ysNum++; 724 + }
  725 + long fcsj = schedule.getFcsjT();
  726 + if(sortMap.containsKey(fcsj)){
  727 + if(sortMap.get(fcsj).getFcsjActual() != null)
  728 + continue;
  729 + } else {
  730 + keyList.add(fcsj);
  731 + }
  732 + sortMap.put(fcsj, schedule);
  733 + }
  734 + Collections.sort(keyList);
  735 +
  736 + for(int i = 1; i < keyList.size(); i++){
  737 + ScheduleRealInfo schedule1 = sortMap.get(keyList.get(i - 1));
  738 + ScheduleRealInfo schedule2 = sortMap.get(keyList.get(i));
  739 + jhyysj += schedule2.getFcsjT() - schedule1.getFcsjT();
  740 +
  741 + long zdsj2 = schedule2.getZdsjT();
  742 + long fcsj2 = schedule2.getFcsjT();
  743 + if(fcsj2 > zdsj2)
  744 + zdsj2 += 1440l;
  745 + jhyssj += zdsj2 - fcsj2;
  746 + jhlc += schedule2.getJhlc()==null?0:schedule2.getJhlc();
  747 + if(i == 1){
  748 + long zdsj1 = schedule1.getZdsjT();
  749 + long fcsj1 = schedule1.getFcsjT();
  750 + if(fcsj1 > zdsj1)
  751 + zdsj1 += 1440l;
  752 + jhyssj += zdsj1 - fcsj1;
  753 + jhlc += schedule1.getJhlc()==null?0:schedule1.getJhlc();
  754 + }
  755 + }
  756 +
  757 + for(int i = 0; i < keyList.size(); i++){
  758 + Map<String, Object> m = new HashMap<String, Object>();
  759 + ScheduleRealInfo schedule = sortMap.get(keyList.get(i));
  760 +
  761 + if(cMap.containsKey(schedule.getId())){
  762 + List<ChildTaskPlan> cTasks = cMap.get(schedule.getId());
  763 + for(ChildTaskPlan childTaskPlan : cTasks){
  764 + Map<String, Object> temp = new HashMap<String, Object>();
  765 + if(childTaskPlan.getMileageType().equals("empty") || childTaskPlan.isDestroy()){
  766 + temp.put("lc", null);
  767 + temp.put("fcsj", null);
  768 + temp.put("zdsj", null);
  769 + }else{
  770 + temp.put("lc", childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  771 + if(childTaskPlan.getStartDate() != null && childTaskPlan.getEndDate() != null){
  772 + String[] split1 = childTaskPlan.getStartDate().split(":");
  773 + Long fcsj = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]);
  774 + temp.put("fcsj", fcsj);
  775 + String[] split2 = childTaskPlan.getEndDate().split(":");
  776 + Long zdsj = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]);
  777 + temp.put("zdsj", zdsj);
  778 + }else{
  779 + temp.put("zdsj", null);
  780 + temp.put("fcsj", null);
  781 + }
  782 + }
  783 + mapList.add(temp);
  784 + }
  785 + }else{
  786 + m.put("lc", schedule.getJhlc()==null?0:schedule.getJhlc());
  787 + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null && schedule.getStatus() != -1){
  788 + String[] split1 = schedule.getFcsjActual().split(":");
  789 + Long fcsj = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]);
  790 + schedule.setFcsjActualTime(fcsj);
  791 + m.put("fcsj", fcsj);
  792 + String[] split2 = schedule.getZdsjActual().split(":");
  793 + Long zdsj = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]);
  794 + schedule.setZdsjActualTime(zdsj);
  795 + m.put("zdsj", zdsj);
  796 + }else{
  797 + m.put("zdsj", null);
  798 + m.put("fcsj", null);
419 } 799 }
  800 + mapList.add(m);
  801 + }
  802 + }
  803 + for(int i = 1; i < mapList.size(); i++){
  804 + Map<String, Object> m1 = mapList.get(i - 1);
  805 + Map<String, Object> m2 = mapList.get(i);
  806 + if(m1.get("fcsj") != null && m2.get("fcsj") != null){
  807 + sjyysj += Long.valueOf(m2.get("fcsj").toString()) - Long.valueOf(m1.get("fcsj").toString());
  808 + }
  809 + if(m2.get("fcsj") != null){
  810 + long zdsj = Long.valueOf(m2.get("zdsj").toString());
  811 + long fcsj = Long.valueOf(m2.get("fcsj").toString());
  812 + if(fcsj > zdsj)
  813 + zdsj += 1440l;
  814 + sjyssj += zdsj - fcsj;
  815 + sjlc += Double.valueOf(m2.get("lc").toString());
  816 + }
  817 + if(i == 1 && m1.get("fcsj") != null){
  818 + long zdsj = Long.valueOf(m1.get("zdsj").toString());
  819 + long fcsj = Long.valueOf(m1.get("fcsj").toString());
  820 + if(fcsj > zdsj)
  821 + zdsj += 1440l;
  822 + sjyssj += zdsj - fcsj;
  823 + sjlc += Double.valueOf(m1.get("lc").toString());
420 } 824 }
421 } 825 }
422 - if(startTime != endTime)  
423 - tempMap.put("date", startDate + "--" + endDate);  
424 - else  
425 - tempMap.put("date", startDate);  
426 - tempMap.put("times", times);  
427 - String[] keys = key.split("/");  
428 - tempMap.put("line", keys[0]);  
429 - tempMap.put("lp", keys[1]);  
430 - tempMap.put("zdz", keys[2]);  
431 tempMap.put("company", companyName); 826 tempMap.put("company", companyName);
432 tempMap.put("subCompany", subCompanyName); 827 tempMap.put("subCompany", subCompanyName);
  828 + String[] split = key.split("/");
  829 + tempMap.put("date", split[0]);
  830 + tempMap.put("line", split[1]);
  831 + tempMap.put("lp", split[2]);
  832 + tempMap.put("jhlc", jhlc);
  833 + tempMap.put("sjlc", sjlc);
  834 +
  835 + if(jhyysj == 0){
  836 + tempMap.put("jhyysj", "0");
  837 + tempMap.put("jhyycs", "0");
  838 + } else {
  839 + tempMap.put("jhyysj", df.format((float)jhyysj / 60));
  840 + tempMap.put("jhyycs", df.format(jhlc == 0 ? 0 : jhlc / jhyysj * 60));
  841 + }
433 842
434 - tempMap.put("yysj", (yysj/60) + "小时" + (yysj%60) + "分钟");  
435 - yysjSum += yysj;  
436 - if(yyNum != 0){  
437 - tempMap.put("yysd", df.format((yysd/yyNum)*60) + "公里/小时");  
438 - yysdSum += Double.valueOf(df.format((yysd/yyNum)*60)); 843 + if(jhyssj == 0){
  844 + tempMap.put("jhyssj", "0");
  845 + tempMap.put("jhyscs", "0");
439 } else { 846 } else {
440 - tempMap.put("yysd", "/"); 847 + tempMap.put("jhyssj", df.format((float)jhyssj / 60));
  848 + tempMap.put("jhyscs", df.format(jhlc == 0 ? 0 : jhlc / jhyssj * 60));
441 } 849 }
442 850
443 - tempMap.put("yssj", (yssj/60) + "小时" + (yssj%60) + "分钟");  
444 - yssjSum += yssj;  
445 - if(ysNum != 0){  
446 - tempMap.put("yssd", df.format((yssd/ysNum)*60) + "公里/小时");  
447 - yssdSum += Double.valueOf(df.format((yssd/ysNum)*60)); 851 + if(sjyysj == 0){
  852 + tempMap.put("sjyysj", "0");
  853 + tempMap.put("sjyycs", "0");
448 } else { 854 } else {
449 - tempMap.put("yssd", "/"); 855 + tempMap.put("sjyysj", df.format((float)sjyysj / 60));
  856 + tempMap.put("sjyycs", df.format(sjlc == 0 ? 0 : sjlc / sjyysj * 60));
450 } 857 }
451 858
452 - dateList.add(tempMap); 859 + if(sjyssj == 0){
  860 + tempMap.put("sjyssj", "0");
  861 + tempMap.put("sjyscs", "0");
  862 + } else {
  863 + tempMap.put("sjyssj", df.format((float)sjyssj / 60));
  864 + tempMap.put("sjyscs", df.format(sjlc == 0 ? 0 : sjlc / sjyssj * 60));
  865 + }
  866 + resList.add(tempMap);
453 } 867 }
454 - int size = keyMap.keySet().size();  
455 - size = size == 0 ? 1 : size;  
456 - modelMap.put("yysj", (yysjSum/size)/60 + "小时" + (yysjSum/size)%60 + "分钟");  
457 - modelMap.put("yysd", df.format(yysdSum/size) + "公里/小时");  
458 - modelMap.put("yssj", (yssjSum/size)/60 + "小时" + (yssjSum/size)%60 + "分钟");  
459 - modelMap.put("yssd", df.format(yssdSum/size) + "公里/小时");  
460 -  
461 Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>(); 868 Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>();
462 - for(Map<String, Object> m : dateList){  
463 - String key = m.get("line").toString(); 869 + for(Map<String, Object> m : resList){
  870 + String key = m.get("line").toString() + "/" + m.get("lp").toString();
464 if(!keyMap2.containsKey(key)) 871 if(!keyMap2.containsKey(key))
465 keyMap2.put(key, new ArrayList<Map<String, Object>>()); 872 keyMap2.put(key, new ArrayList<Map<String, Object>>());
466 keyMap2.get(key).add(m); 873 keyMap2.get(key).add(m);
467 } 874 }
468 - for(String key : keyMap2.keySet()){  
469 - List<Integer> keyList = new ArrayList<Integer>();  
470 - Map<Integer, List<Map<String, Object>>> temp = new HashMap<Integer, List<Map<String,Object>>>();  
471 - for(Map<String, Object> m : keyMap2.get(key)){  
472 - String lp = m.get("lp").toString();  
473 - String str = "";  
474 - for(int i = 0; i < lp.length(); i++){  
475 - str += (int)lp.charAt(i); 875 + Set<String> keySet = keyMap2.keySet();
  876 + List<String> list3 = new ArrayList<String>();
  877 + List<Map<String, Object>> list4 = new ArrayList<Map<String, Object>>();
  878 + list3.addAll(keySet);
  879 + Collections.sort(list3, new Comparator<String>() {
  880 +
  881 + public int compare(String o1, String o2) {
  882 +
  883 + Long a = 0l;
  884 + Long b = 0l;
  885 + String[] split1 = o1.split("/");
  886 + String[] split2 = o2.split("/");
  887 + char[] charArray1 = split1[1].toCharArray();
  888 + char[] charArray2 = split2[1].toCharArray();
  889 + for(int i = 0; i < charArray1.length; i++){
  890 + long temp = 1l;
  891 + for(int j = 0; j < i; j++)
  892 + temp *= 10;
  893 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
476 } 894 }
477 - Integer num = Integer.valueOf(str)*10+Integer.valueOf(m.get("xlDir").toString());  
478 - if(!temp.containsKey(num)){  
479 - temp.put(num, new ArrayList<Map<String, Object>>());  
480 - keyList.add(num); 895 + for(int i = 0; i < charArray2.length; i++){
  896 + long temp = 1l;
  897 + for(int j = 0; j < i; j++)
  898 + temp *= 10;
  899 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
481 } 900 }
482 - temp.get(num).add(m); 901 +
  902 + return a.compareTo(b);
483 } 903 }
484 - Collections.sort(keyList);  
485 - for(Integer lp : keyList){  
486 - List<Map<String, Object>> tempList = temp.get(lp);  
487 - for(Map<String, Object> m : tempList){  
488 - resList.add(m); 904 + });
  905 + Collections.sort(list3, new Comparator<String>() {
  906 +
  907 + public int compare(String o1, String o2) {
  908 +
  909 + Long a = 0l;
  910 + Long b = 0l;
  911 + String[] split1 = o1.split("/");
  912 + String[] split2 = o2.split("/");
  913 + char[] charArray1 = split1[0].toCharArray();
  914 + char[] charArray2 = split2[0].toCharArray();
  915 + for(int i = 0; i < charArray1.length; i++){
  916 + long temp = 1l;
  917 + for(int j = 0; j < i; j++)
  918 + temp *= 10;
  919 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  920 + }
  921 + for(int i = 0; i < charArray2.length; i++){
  922 + long temp = 1l;
  923 + for(int j = 0; j < i; j++)
  924 + temp *= 10;
  925 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  926 + }
  927 +
  928 + return a.compareTo(b);
  929 + }
  930 + });
  931 + for(String key : list3){
  932 + Map<String, Object> tempMap = new HashMap<String, Object>();
  933 + BigDecimal jhyysj = new BigDecimal(0), jhyssj = new BigDecimal(0);
  934 + BigDecimal jhyycs = new BigDecimal(0), jhyscs = new BigDecimal(0);
  935 + BigDecimal sjyysj = new BigDecimal(0), sjyssj = new BigDecimal(0);
  936 + BigDecimal sjyycs = new BigDecimal(0), sjyscs = new BigDecimal(0);
  937 + for(Map<String, Object> m : keyMap2.get(key)){
  938 + jhyysj = jhyysj.add(new BigDecimal(m.get("jhyysj").toString()));
  939 + jhyssj = jhyssj.add(new BigDecimal(m.get("jhyssj").toString()));
  940 + jhyycs = jhyycs.add(new BigDecimal(m.get("jhyycs").toString()));
  941 + jhyscs = jhyscs.add(new BigDecimal(m.get("jhyscs").toString()));
  942 + sjyysj = sjyysj.add(new BigDecimal(m.get("sjyysj").toString()));
  943 + sjyssj = sjyssj.add(new BigDecimal(m.get("sjyssj").toString()));
  944 + sjyycs = sjyycs.add(new BigDecimal(m.get("sjyycs").toString()));
  945 + sjyscs = sjyscs.add(new BigDecimal(m.get("sjyscs").toString()));
  946 + }
  947 + BigDecimal size = new BigDecimal(keyMap2.get(key).size());
  948 + tempMap.put("jhyysj", jhyysj.equals(0)?0:jhyysj.divide(size, 2, RoundingMode.HALF_UP));
  949 + tempMap.put("jhyssj", jhyssj.equals(0)?0:jhyssj.divide(size, 2, RoundingMode.HALF_UP));
  950 + tempMap.put("jhyycs", jhyycs.equals(0)?0:jhyycs.divide(size, 2, RoundingMode.HALF_UP));
  951 + tempMap.put("jhyscs", jhyscs.equals(0)?0:jhyscs.divide(size, 2, RoundingMode.HALF_UP));
  952 + tempMap.put("sjyysj", sjyysj.equals(0)?0:sjyysj.divide(size, 2, RoundingMode.HALF_UP));
  953 + tempMap.put("sjyssj", sjyssj.equals(0)?0:sjyssj.divide(size, 2, RoundingMode.HALF_UP));
  954 + tempMap.put("sjyycs", sjyycs.equals(0)?0:sjyycs.divide(size, 2, RoundingMode.HALF_UP));
  955 + tempMap.put("sjyscs", sjyscs.equals(0)?0:sjyscs.divide(size, 2, RoundingMode.HALF_UP));
  956 + String[] split = key.split("/");
  957 + tempMap.put("line", split[0]);
  958 + tempMap.put("lp", split[1]);
  959 + tempMap.put("company", companyName);
  960 + tempMap.put("subCompany", subCompanyName);
  961 + tempMap.put("date", date);
  962 + list4.add(tempMap);
  963 + }
  964 + modelMap.put("dataList", list4);
  965 +
  966 + if(statu.equals("0")){
  967 + Map<String, List<Map<String, Object>>> keyMap4 = new HashMap<String, List<Map<String, Object>>>();
  968 + List<Map<String, Object>> list5 = new ArrayList<Map<String, Object>>();
  969 + List<String> keyList = new ArrayList<String>();
  970 + for(Map<String, Object> m : list4){
  971 + String key = m.get("line").toString();
  972 + if(!keyMap4.containsKey(key)){
  973 + keyList.add(key);
  974 + keyMap4.put(key, new ArrayList<Map<String, Object>>());
  975 + }
  976 + keyMap4.get(key).add(m);
  977 + }
  978 + for(String key : keyList){
  979 + Map<String, Object> tempMap = new HashMap<String, Object>();
  980 + BigDecimal jhyysj = new BigDecimal(0), jhyssj = new BigDecimal(0);
  981 + BigDecimal jhyycs = new BigDecimal(0), jhyscs = new BigDecimal(0);
  982 + BigDecimal sjyysj = new BigDecimal(0), sjyssj = new BigDecimal(0);
  983 + BigDecimal sjyycs = new BigDecimal(0), sjyscs = new BigDecimal(0);
  984 + for(Map<String, Object> m : keyMap4.get(key)){
  985 + jhyysj = jhyysj.add(new BigDecimal(m.get("jhyysj").toString()));
  986 + jhyssj = jhyssj.add(new BigDecimal(m.get("jhyssj").toString()));
  987 + jhyycs = jhyycs.add(new BigDecimal(m.get("jhyycs").toString()));
  988 + jhyscs = jhyscs.add(new BigDecimal(m.get("jhyscs").toString()));
  989 + sjyysj = sjyysj.add(new BigDecimal(m.get("sjyysj").toString()));
  990 + sjyssj = sjyssj.add(new BigDecimal(m.get("sjyssj").toString()));
  991 + sjyycs = sjyycs.add(new BigDecimal(m.get("sjyycs").toString()));
  992 + sjyscs = sjyscs.add(new BigDecimal(m.get("sjyscs").toString()));
489 } 993 }
  994 + BigDecimal size = new BigDecimal(keyMap4.get(key).size());
  995 + tempMap.put("jhyysj", jhyysj.equals(0)?0:jhyysj.divide(size, 2, RoundingMode.HALF_UP));
  996 + tempMap.put("jhyssj", jhyssj.equals(0)?0:jhyssj.divide(size, 2, RoundingMode.HALF_UP));
  997 + tempMap.put("jhyycs", jhyycs.equals(0)?0:jhyycs.divide(size, 2, RoundingMode.HALF_UP));
  998 + tempMap.put("jhyscs", jhyscs.equals(0)?0:jhyscs.divide(size, 2, RoundingMode.HALF_UP));
  999 + tempMap.put("sjyysj", sjyysj.equals(0)?0:sjyysj.divide(size, 2, RoundingMode.HALF_UP));
  1000 + tempMap.put("sjyssj", sjyssj.equals(0)?0:sjyssj.divide(size, 2, RoundingMode.HALF_UP));
  1001 + tempMap.put("sjyycs", sjyycs.equals(0)?0:sjyycs.divide(size, 2, RoundingMode.HALF_UP));
  1002 + tempMap.put("sjyscs", sjyscs.equals(0)?0:sjyscs.divide(size, 2, RoundingMode.HALF_UP));
  1003 + tempMap.put("line", key);
  1004 + tempMap.put("lp", keyMap4.get(key).size());
  1005 + tempMap.put("company", companyName);
  1006 + tempMap.put("subCompany", subCompanyName);
  1007 + tempMap.put("date", date);
  1008 + tempMap.put("work", keyMap4.get(key));
  1009 + list5.add(tempMap);
  1010 + }
  1011 +
  1012 +
  1013 + modelMap.put("dataList", list5);
  1014 + }
  1015 + modelMap.put("statu", statu);
  1016 +
  1017 + dataList = (List<Map<String, Object>>)modelMap.get("dataList");
  1018 + if(dataList.size() != 0){
  1019 + BigDecimal jhyysj = new BigDecimal(0), jhyssj = new BigDecimal(0);
  1020 + BigDecimal jhyycs = new BigDecimal(0), jhyscs = new BigDecimal(0);
  1021 + BigDecimal sjyysj = new BigDecimal(0), sjyssj = new BigDecimal(0);
  1022 + BigDecimal sjyycs = new BigDecimal(0), sjyscs = new BigDecimal(0);
  1023 + for(Map<String, Object> m : dataList){
  1024 + jhyysj = jhyysj.add(new BigDecimal(m.get("jhyysj").toString()));
  1025 + jhyssj = jhyssj.add(new BigDecimal(m.get("jhyssj").toString()));
  1026 + jhyycs = jhyycs.add(new BigDecimal(m.get("jhyycs").toString()));
  1027 + jhyscs = jhyscs.add(new BigDecimal(m.get("jhyscs").toString()));
  1028 + sjyysj = sjyysj.add(new BigDecimal(m.get("sjyysj").toString()));
  1029 + sjyssj = sjyssj.add(new BigDecimal(m.get("sjyssj").toString()));
  1030 + sjyycs = sjyycs.add(new BigDecimal(m.get("sjyycs").toString()));
  1031 + sjyscs = sjyscs.add(new BigDecimal(m.get("sjyscs").toString()));
490 } 1032 }
  1033 + BigDecimal size = new BigDecimal(dataList.size());
  1034 + modelMap.put("jhyysj", jhyysj.equals(0)?0:jhyysj.divide(size, 2, RoundingMode.HALF_UP));
  1035 + modelMap.put("jhyssj", jhyssj.equals(0)?0:jhyssj.divide(size, 2, RoundingMode.HALF_UP));
  1036 + modelMap.put("jhyycs", jhyycs.equals(0)?0:jhyycs.divide(size, 2, RoundingMode.HALF_UP));
  1037 + modelMap.put("jhyscs", jhyscs.equals(0)?0:jhyscs.divide(size, 2, RoundingMode.HALF_UP));
  1038 + modelMap.put("sjyysj", sjyysj.equals(0)?0:sjyysj.divide(size, 2, RoundingMode.HALF_UP));
  1039 + modelMap.put("sjyssj", sjyssj.equals(0)?0:sjyssj.divide(size, 2, RoundingMode.HALF_UP));
  1040 + modelMap.put("sjyycs", sjyycs.equals(0)?0:sjyycs.divide(size, 2, RoundingMode.HALF_UP));
  1041 + modelMap.put("sjyscs", sjyscs.equals(0)?0:sjyscs.divide(size, 2, RoundingMode.HALF_UP));
  1042 + modelMap.put("company", companyName);
  1043 + modelMap.put("subCompany", subCompanyName);
  1044 + modelMap.put("dataList", dataList);
491 } 1045 }
492 1046
493 - modelMap.put("dateList", resList);  
494 return modelMap; 1047 return modelMap;
495 } 1048 }
496 1049
@@ -523,7 +1076,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -523,7 +1076,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
523 times = "06:00-07:00"; 1076 times = "06:00-07:00";
524 } 1077 }
525 1078
526 - list = getSchedule(company, subCompany, line, startDate, endDate, model, times); 1079 + list = getSchedule(company, subCompany, line, startDate, endDate, model, times, true);
527 1080
528 String[] date1 = startDate.split("-"); 1081 String[] date1 = startDate.split("-");
529 String[] date2 = endDate.split("-"); 1082 String[] date2 = endDate.split("-");
@@ -534,7 +1087,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -534,7 +1087,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
534 int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); 1087 int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]);
535 int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); 1088 int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
536 1089
537 -  
538 for(ScheduleRealInfo schedule : list){ 1090 for(ScheduleRealInfo schedule : list){
539 if(qdzName.length() != 0 && !qdzName.equals(schedule.getQdzName())){ 1091 if(qdzName.length() != 0 && !qdzName.equals(schedule.getQdzName())){
540 continue; 1092 continue;
@@ -550,26 +1102,11 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -550,26 +1102,11 @@ public class BusIntervalServiceImpl implements BusIntervalService {
550 } 1102 }
551 for(String key : keyMap.keySet()){ 1103 for(String key : keyMap.keySet()){
552 Map<String, Object> tempMap = new HashMap<String, Object>(); 1104 Map<String, Object> tempMap = new HashMap<String, Object>();
553 - int jhbc = 0;  
554 - int sjbc = 0;  
555 - int kbc = 0;  
556 - int mbc = 0;  
557 - long jhdf = 0l;  
558 - long sjdf = 0l;  
559 - long wddf1 = 0l;  
560 - long wddf2 = 0l;  
561 - long jhfc = 0l;  
562 - long sjfc = 0l;  
563 - long wdfc1 = 0l;  
564 - long wdfc2 = 0l;  
565 - long jhys = 0l;  
566 - long sjys = 0l;  
567 - long yssjMax = 0l;  
568 - long yssjMin = 0l;  
569 - long jhtz = 0l;  
570 - long sjtz = 0l;  
571 - long tzsjMax = 0l;  
572 - long tzsjMin = 0l; 1105 + int jhbc = 0, sjbc = 0, wdfz = 0;
  1106 + long jhdf = 0l, sjdf = 0l, wddf1 = 0l, wddf2 = 0l;
  1107 + long jhfc = 0l, sjfc = 0l, wdfc1 = 0l, wdfc2 = 0l;
  1108 + long jhys = 0l, sjys = 0l, yssjMax = 0l, yssjMin = 0l;
  1109 + long jhtz = 0l, sjtz = 0l, tzsjMax = 0l, tzsjMin = 0l;
573 String companyName = "", subCompanyName = ""; 1110 String companyName = "", subCompanyName = "";
574 for(ScheduleRealInfo schedule : keyMap.get(key)){ 1111 for(ScheduleRealInfo schedule : keyMap.get(key)){
575 if(schedule.getGsName() != null && companyName.length() == 0) 1112 if(schedule.getGsName() != null && companyName.length() == 0)
@@ -590,10 +1127,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -590,10 +1127,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
590 yssj += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); 1127 yssj += schedule.getZdsjActualTime() - schedule.getFcsjActualTime();
591 if(schedule.getFcsjActualTime() - schedule.getFcsjT() < 0){ 1128 if(schedule.getFcsjActualTime() - schedule.getFcsjT() < 0){
592 wdfc1 += schedule.getFcsjT() - schedule.getFcsjActualTime(); 1129 wdfc1 += schedule.getFcsjT() - schedule.getFcsjActualTime();
593 - kbc++; 1130 +// kbc++;
594 } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 0){ 1131 } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 0){
595 wdfc2 += schedule.getFcsjActualTime() - schedule.getFcsjT(); 1132 wdfc2 += schedule.getFcsjActualTime() - schedule.getFcsjT();
596 - mbc++; 1133 +// mbc++;
597 } 1134 }
598 1135
599 if(schedule.getDfsj() != null){ 1136 if(schedule.getDfsj() != null){
@@ -660,8 +1197,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -660,8 +1197,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
660 tempMap.put("pjys", "0分"); 1197 tempMap.put("pjys", "0分");
661 tempMap.put("pjtz", "0分"); 1198 tempMap.put("pjtz", "0分");
662 } 1199 }
663 - tempMap.put("kbc", kbc);  
664 - tempMap.put("mbc", mbc); 1200 +// tempMap.put("kbc", kbc);
  1201 +// tempMap.put("mbc", mbc);
  1202 + if(!tempMap.get("jhfc").toString().equals("/") && !tempMap.get("sjfc").toString().equals("/")){
  1203 + String[] temp1 = tempMap.get("jhfc").toString().split(":");
  1204 + String[] temp2 = tempMap.get("sjfc").toString().split(":");
  1205 + tempMap.put("wdfz", (Integer.valueOf(temp2[0])*60 + Integer.valueOf(temp2[1]))
  1206 + - (Integer.valueOf(temp1[0])*60 + Integer.valueOf(temp1[1])));
  1207 + }else{
  1208 + tempMap.put("wdfz", "/");
  1209 + }
665 tempMap.put("jhys", jhys); 1210 tempMap.put("jhys", jhys);
666 tempMap.put("sjys", sjys); 1211 tempMap.put("sjys", sjys);
667 tempMap.put("yssjMin", yssjMin); 1212 tempMap.put("yssjMin", yssjMin);
@@ -776,7 +1321,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -776,7 +1321,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
776 1321
777 return resList; 1322 return resList;
778 } 1323 }
779 - 1324 +
780 @Override 1325 @Override
781 public List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map) { 1326 public List<Map<String, Object>> lbStatuAnaly(Map<String, Object> map) {
782 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 1327 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
@@ -802,7 +1347,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -802,7 +1347,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
802 times = "06:00-07:00"; 1347 times = "06:00-07:00";
803 } 1348 }
804 1349
805 - list = getSchedule(company, subCompany, line, startDate, endDate, model, times); 1350 + list = getSchedule(company, subCompany, line, startDate, endDate, model, times, true);
806 1351
807 String[] date1 = startDate.split("-"); 1352 String[] date1 = startDate.split("-");
808 String[] date2 = endDate.split("-"); 1353 String[] date2 = endDate.split("-");
@@ -974,9 +1519,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -974,9 +1519,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
974 if(company.length() != 0){ 1519 if(company.length() != 0){
975 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 1520 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
976 } 1521 }
977 - sql += " and bc_type = 'normal'"; 1522 + sql += " and bc_type != 'in' and bc_type != 'out'";
978 1523
979 - list =jdbcTemplate.query(sql, 1524 + list = jdbcTemplate.query(sql,
980 new RowMapper<ScheduleRealInfo>(){ 1525 new RowMapper<ScheduleRealInfo>(){
981 @Override 1526 @Override
982 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 1527 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -27,8 +27,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -27,8 +27,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
27 27
28 List<Map<String, String>> sreachVehic(String nbbm); 28 List<Map<String, String>> sreachVehic(String nbbm);
29 29
30 - Map<String, Object> adjust(Long id, String nbbm, String jsy, String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr);  
31 - 30 +/* Map<String, Object> adjust(Long id, String nbbm, String jsy, String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr);
  31 + */
32 /** 32 /**
33 * 33 *
34 * @Title: adjustCar 34 * @Title: adjustCar
src/main/java/com/bsth/service/realcontrol/buffer/GetSchedulePlanThread.java
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 //import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 20 //import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
21 //import com.bsth.repository.schedule.SchedulePlanInfoRepository; 21 //import com.bsth.repository.schedule.SchedulePlanInfoRepository;
22 //import com.bsth.util.BatchSaveUtils; 22 //import com.bsth.util.BatchSaveUtils;
23 -//import com.bsth.websocket.handler.RealControlSocketHandler; 23 +//import com.bsth.websocket.handlers.RealControlSocketHandler;
24 // 24 //
25 ///** 25 ///**
26 // * 26 // *
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
@@ -70,7 +70,7 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt; @@ -70,7 +70,7 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
70 LineConfig conf = lineConfigData.get(lineCode); 70 LineConfig conf = lineConfigData.get(lineCode);
71 71
72 conf.setOutConfig(type); 72 conf.setOutConfig(type);
73 - conf.setInConfig(type); 73 + //conf.setInConfig(type);
74 lineConfigData.set(conf); 74 lineConfigData.set(conf);
75 75
76 rs.put("status", ResponseCode.SUCCESS); 76 rs.put("status", ResponseCode.SUCCESS);
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -382,7 +382,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -382,7 +382,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
382 return list; 382 return list;
383 } 383 }
384 384
385 - @Override 385 +/* @Override
386 public Map<String, Object> adjust(Long id, String nbbm, String jsy, String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr) { 386 public Map<String, Object> adjust(Long id, String nbbm, String jsy, String spy, Integer revertLine, Integer borrowLine, String borrowTimeStr, String revertTimeStr) {
387 // 班次 387 // 班次
388 ScheduleRealInfo schedule = dayOfSchedule.get(id); 388 ScheduleRealInfo schedule = dayOfSchedule.get(id);
@@ -435,7 +435,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -435,7 +435,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
435 map.put("status", 200); 435 map.put("status", 200);
436 map.put("t", schedule); 436 map.put("t", schedule);
437 return map; 437 return map;
438 - } 438 + }*/
439 439
440 @Override 440 @Override
441 public void adjustCar(ScheduleRealInfo schedule, String car) { 441 public void adjustCar(ScheduleRealInfo schedule, String car) {
@@ -678,7 +678,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -678,7 +678,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
678 sch.addRemarks(remarks); 678 sch.addRemarks(remarks);
679 sch.calcStatus(); 679 sch.calcStatus();
680 680
681 - scheduleRealInfoRepository.save(sch); 681 + dayOfSchedule.save(sch);
  682 + //scheduleRealInfoRepository.save(sch);
682 683
683 ts.add(sch); 684 ts.add(sch);
684 685
@@ -881,10 +882,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -881,10 +882,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
881 next.setQdzArrDateSJ(zdsjActual); 882 next.setQdzArrDateSJ(zdsjActual);
882 ts.add(next); 883 ts.add(next);
883 } 884 }
  885 +
  886 + //重新计算车辆执行班次
  887 + dayOfSchedule.reCalcExecPlan(sch.getClZbh());
884 } 888 }
885 } 889 }
886 else { 890 else {
887 - if(sch.getZdsjActual() != null){ 891 + /*if(sch.getZdsjActual() != null){
888 //将对应的到离站数据标记为不可信 892 //将对应的到离站数据标记为不可信
889 List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh()); 893 List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh());
890 for(ArrivalEntity arr : list){ 894 for(ArrivalEntity arr : list){
@@ -896,7 +900,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -896,7 +900,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
896 break; 900 break;
897 } 901 }
898 } 902 }
899 - } 903 + }*/
900 904
901 //清除实达时间 905 //清除实达时间
902 sch.clearZdsjActual(); 906 sch.clearZdsjActual();
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
@@ -77,6 +77,48 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -77,6 +77,48 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
77 schedule.setsGh(rs.getString("s_gh")); 77 schedule.setsGh(rs.getString("s_gh"));
78 schedule.setsName(rs.getString("s_name")); 78 schedule.setsName(rs.getString("s_name"));
79 schedule.setSpId(rs.getLong("sp_id")); 79 schedule.setSpId(rs.getLong("sp_id"));
  80 +
  81 + if(schedule.getFcsj() != null && schedule.getZdsj() != null){
  82 + String[] split1 = schedule.getFcsj().split(":");
  83 + String[] split2 = schedule.getZdsj().split(":");
  84 + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]);
  85 + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]);
  86 + if(fcsj > zdsj){
  87 + zdsj += 1440;
  88 + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60));
  89 + }
  90 + }
  91 + if(schedule.getFcsj() != null){
  92 + String[] split = schedule.getFcsj().split(":");
  93 + int fcsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]);
  94 + schedule.setFcsjT((long)fcsj);
  95 + }
  96 + if(schedule.getZdsj() != null){
  97 + String[] split = schedule.getZdsj().split(":");
  98 + int zdsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]);
  99 + schedule.setZdsjT((long)zdsj);
  100 + }
  101 + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){
  102 + String[] split1 = schedule.getFcsjActual().split(":");
  103 + String[] split2 = schedule.getZdsjActual().split(":");
  104 + int fcsjA = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]);
  105 + int zdsjA = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]);
  106 + if(fcsjA > zdsjA){
  107 + zdsjA += 1440;
  108 + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60));
  109 + }
  110 + }
  111 + if(schedule.getFcsjActual() != null){
  112 + String[] split = schedule.getFcsjActual().split(":");
  113 + int fcsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]);
  114 + schedule.setFcsjActualTime((long)fcsjA);
  115 + }
  116 + if(schedule.getZdsjActual() != null){
  117 + String[] split = schedule.getZdsjActual().split(":");
  118 + int zdsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]);
  119 + schedule.setZdsjActualTime((long)zdsjA);
  120 + }
  121 +
80 return schedule; 122 return schedule;
81 } 123 }
82 }); 124 });
@@ -259,14 +301,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -259,14 +301,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
259 Long wgfEnd = 0l; 301 Long wgfEnd = 0l;
260 try { 302 try {
261 //早晚高峰时段 303 //早晚高峰时段
262 - zgfBegin = sdf.parse(date + "06:30").getTime();  
263 - zgfEnd = sdf.parse(date + "08:30").getTime();  
264 - wgfBegin = sdf.parse(date + "16:00").getTime();  
265 - wgfEnd = sdf.parse(date + "18:00").getTime();  
266 - } catch (ParseException e) { 304 +// zgfBegin = sdf.parse(date + "06:30").getTime();
  305 +// zgfEnd = sdf.parse(date + "08:30").getTime();
  306 +// wgfBegin = sdf.parse(date + "16:00").getTime();
  307 +// wgfEnd = sdf.parse(date + "18:00").getTime();
  308 + zgfBegin = 6l * 60l + 30l;
  309 + zgfEnd = 8l * 60l + 30l;
  310 + wgfBegin = 16l * 60l + 0l;
  311 + wgfEnd = 18l * 60l + 0l;
  312 + } catch (Exception e) {
267 // TODO Auto-generated catch block 313 // TODO Auto-generated catch block
268 e.printStackTrace(); 314 e.printStackTrace();
269 } 315 }
  316 + String companyName = "", subCompanyName = "";
  317 +
270 for(String key : keyMap.keySet()){ 318 for(String key : keyMap.keySet()){
271 Map<String, Object> tempMap = new HashMap<String, Object>(); 319 Map<String, Object> tempMap = new HashMap<String, Object>();
272 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>(); 320 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>();
@@ -276,7 +324,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -276,7 +324,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
276 int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0; 324 int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0;
277 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0; 325 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0;
278 for(ScheduleRealInfo schedule : keyMap.get(key)){ 326 for(ScheduleRealInfo schedule : keyMap.get(key)){
279 - schedule.setFcsjAll(schedule.getFcsj()); 327 +// schedule.setFcsjAll(schedule.getFcsj());
  328 + if(companyName.length() == 0 && schedule.getGsName() != null)
  329 + companyName = schedule.getGsName();
  330 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  331 + subCompanyName = schedule.getFgsName();
280 332
281 //早晚高峰时段执行率 333 //早晚高峰时段执行率
282 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ 334 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
@@ -299,13 +351,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -299,13 +351,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
299 if(schedule.getFcsjActual() != null){ 351 if(schedule.getFcsjActual() != null){
300 if(schedule.getBcType().equals("out")) 352 if(schedule.getBcType().equals("out"))
301 sjcc++; 353 sjcc++;
302 - schedule.setFcsjActualAll(schedule.getFcsjActual());  
303 - if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ 354 +// schedule.setFcsjActualAll(schedule.getFcsjActual());
  355 + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -1){
304 if(schedule.getXlDir().equals("0")) 356 if(schedule.getXlDir().equals("0"))
305 upfk++; 357 upfk++;
306 else if (schedule.getXlDir().equals("1")) 358 else if (schedule.getXlDir().equals("1"))
307 dnfk++; 359 dnfk++;
308 - } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ 360 + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 3){
309 if(schedule.getXlDir().equals("0")) 361 if(schedule.getXlDir().equals("0"))
310 upfm++; 362 upfm++;
311 else if (schedule.getXlDir().equals("1")) 363 else if (schedule.getXlDir().equals("1"))
@@ -314,15 +366,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -314,15 +366,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
314 } 366 }
315 //到站时间快慢 367 //到站时间快慢
316 if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){ 368 if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){
317 - schedule.setZdsjActualAll(schedule.getZdsjActual());  
318 - schedule.setDfsjAll(schedule.getDfsj());  
319 - schedule.calcEndTime();  
320 - if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -60000){ 369 +// schedule.setZdsjActualAll(schedule.getZdsjActual());
  370 +// schedule.setDfsjAll(schedule.getDfsj());
  371 +// schedule.calcEndTime();
  372 + schedule.setZdsjT(schedule.getFcsjT() + schedule.getBcsj());
  373 + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -1){
321 if(schedule.getXlDir().equals("0")) 374 if(schedule.getXlDir().equals("0"))
322 updk++; 375 updk++;
323 else if (schedule.getXlDir().equals("1")) 376 else if (schedule.getXlDir().equals("1"))
324 dndk++; 377 dndk++;
325 - } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ 378 + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 3){
326 if(schedule.getXlDir().equals("0")) 379 if(schedule.getXlDir().equals("0"))
327 updm++; 380 updm++;
328 else if (schedule.getXlDir().equals("1")) 381 else if (schedule.getXlDir().equals("1"))
@@ -337,7 +390,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -337,7 +390,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
337 } 390 }
338 } 391 }
339 392
340 - if(schedule.getBcType().equals("normal")){ 393 + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")){
341 String clZbh = schedule.getClZbh(); 394 String clZbh = schedule.getClZbh();
342 if(!listMap.containsKey(clZbh)) 395 if(!listMap.containsKey(clZbh))
343 listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); 396 listMap.put(clZbh, new ArrayList<ScheduleRealInfo>());
@@ -366,17 +419,19 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -366,17 +419,19 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
366 // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj()); 419 // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj());
367 jhsb++; 420 jhsb++;
368 if(shouban.getFcsjActual() != null){ 421 if(shouban.getFcsjActual() != null){
369 - if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) 422 + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -1 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 3)
370 sjsb++; 423 sjsb++;
371 } 424 }
372 jhmb++; 425 jhmb++;
373 if(moban.getFcsjActual() != null){ 426 if(moban.getFcsjActual() != null){
374 - if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) 427 + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -1 && moban.getFcsjActualTime() - moban.getFcsjT() <= 3)
375 sjmb++; 428 sjmb++;
376 } 429 }
377 430
378 } 431 }
379 432
  433 + tempMap.put("company", companyName);
  434 + tempMap.put("subCompany", subCompanyName);
380 tempMap.put("date", date); 435 tempMap.put("date", date);
381 tempMap.put("line", key); 436 tempMap.put("line", key);
382 tempMap.put("jhbc", jhbc); 437 tempMap.put("jhbc", jhbc);
@@ -452,7 +507,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -452,7 +507,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
452 if(company.length() != 0){ 507 if(company.length() != 0){
453 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 508 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
454 } 509 }
455 - sql += " and bc_type = 'normal'"; 510 + sql += " and bc_type != 'in' and bc_type != 'out'";
456 511
457 list = jdbcTemplate.query(sql, 512 list = jdbcTemplate.query(sql,
458 new RowMapper<ScheduleRealInfo>(){ 513 new RowMapper<ScheduleRealInfo>(){
@@ -462,6 +517,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -462,6 +517,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
462 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 517 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
463 schedule.setXlName(rs.getString("xl_name")); 518 schedule.setXlName(rs.getString("xl_name"));
464 schedule.setBcType(rs.getString("bc_type")); 519 schedule.setBcType(rs.getString("bc_type"));
  520 + schedule.setGsName(rs.getString("gs_name"));
  521 + schedule.setFgsName(rs.getString("fgs_name"));
465 schedule.setBcs(rs.getInt("bcs")); 522 schedule.setBcs(rs.getInt("bcs"));
466 schedule.setFcno(rs.getInt("fcno")); 523 schedule.setFcno(rs.getInt("fcno"));
467 schedule.setFcsj(rs.getString("fcsj")); 524 schedule.setFcsj(rs.getString("fcsj"));
@@ -471,13 +528,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -471,13 +528,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
471 schedule.setBcsj(rs.getInt("bcsj")); 528 schedule.setBcsj(rs.getInt("bcsj"));
472 schedule.setQdzName(rs.getString("qdz_name")); 529 schedule.setQdzName(rs.getString("qdz_name"));
473 schedule.setSpId(rs.getLong("sp_id")); 530 schedule.setSpId(rs.getLong("sp_id"));
  531 +
  532 + if(schedule.getFcsj() != null && schedule.getZdsj() != null){
  533 + String[] split1 = schedule.getFcsj().split(":");
  534 + String[] split2 = schedule.getZdsj().split(":");
  535 + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]);
  536 + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]);
  537 + if(zdsj < fcsj){
  538 + zdsj += 1440;
  539 + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60));
  540 + }
  541 + schedule.setFcsjT((long)fcsj);
  542 + schedule.setZdsjT((long)zdsj);
  543 + }
  544 + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){
  545 + String[] split3 = schedule.getFcsjActual().split(":");
  546 + String[] split4 = schedule.getZdsjActual().split(":");
  547 + int fcsjA = Integer.valueOf(split3[0]) * 60 + Integer.valueOf(split3[1]);
  548 + int zdsjA = Integer.valueOf(split4[0]) * 60 + Integer.valueOf(split4[1]);
  549 + if(fcsjA > zdsjA){
  550 + zdsjA += 1440;
  551 + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60));
  552 + }
  553 + schedule.setFcsjActualTime((long)fcsjA);
  554 + schedule.setZdsjActualTime((long)zdsjA);
  555 + }
  556 +
474 return schedule; 557 return schedule;
475 } 558 }
476 }); 559 });
477 560
478 if(model.length() != 0){ 561 if(model.length() != 0){
479 -// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'";  
480 - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type = 'normal'"; 562 +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
  563 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'";
481 564
482 ttList = jdbcTemplate.query(sql, 565 ttList = jdbcTemplate.query(sql,
483 new RowMapper<Long>(){ 566 new RowMapper<Long>(){
@@ -515,6 +598,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -515,6 +598,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
515 } 598 }
516 } 599 }
517 } 600 }
  601 + String companyName = "", subCompanyName = "";
518 for(String key : keyMap.keySet()){ 602 for(String key : keyMap.keySet()){
519 Map<String, Object> tempMap = new HashMap<String, Object>(); 603 Map<String, Object> tempMap = new HashMap<String, Object>();
520 List<Integer> fcsj = new ArrayList<Integer>(); 604 List<Integer> fcsj = new ArrayList<Integer>();
@@ -522,6 +606,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -522,6 +606,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
522 int jhbc = 0; 606 int jhbc = 0;
523 int sjbc = 0; 607 int sjbc = 0;
524 for(ScheduleRealInfo schedule : keyMap.get(key)){ 608 for(ScheduleRealInfo schedule : keyMap.get(key)){
  609 + if(companyName.length() == 0 && schedule.getGsName() != null)
  610 + companyName = schedule.getGsName();
  611 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  612 + subCompanyName = schedule.getFgsName();
  613 +
525 tempMap.put("date", schedule.getScheduleDateStr()); 614 tempMap.put("date", schedule.getScheduleDateStr());
526 tempMap.put("bcsj", schedule.getBcsj()); 615 tempMap.put("bcsj", schedule.getBcsj());
527 if(schedule.getFcsjActual() != null){ 616 if(schedule.getFcsjActual() != null){
@@ -581,6 +670,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -581,6 +670,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
581 tempMap.put("zmys", "/"); 670 tempMap.put("zmys", "/");
582 tempMap.put("pjys", "/"); 671 tempMap.put("pjys", "/");
583 } 672 }
  673 + tempMap.put("company", companyName);
  674 + tempMap.put("subCompany", subCompanyName);
584 String[] split = key.split("/"); 675 String[] split = key.split("/");
585 tempMap.put("line", split[0]); 676 tempMap.put("line", split[0]);
586 tempMap.put("qdz", split[1]); 677 tempMap.put("qdz", split[1]);
@@ -784,7 +875,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -784,7 +875,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
784 List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); 875 List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
785 876
786 for(ScheduleRealInfo schedule : list){ 877 for(ScheduleRealInfo schedule : list){
787 - if(!schedule.getBcType().equals("normal")) 878 + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
788 continue; 879 continue;
789 String key = schedule.getXlName(); 880 String key = schedule.getXlName();
790 if(!keyMap.containsKey(key)) 881 if(!keyMap.containsKey(key))
src/main/resources/static/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.js
@@ -2625,7 +2625,7 @@ angular.module(&#39;ui.bootstrap.dropdown&#39;, [&#39;ui.bootstrap.position&#39;]) @@ -2625,7 +2625,7 @@ angular.module(&#39;ui.bootstrap.dropdown&#39;, [&#39;ui.bootstrap.position&#39;])
2625 2625
2626 var closeDropdown = function(evt) { 2626 var closeDropdown = function(evt) {
2627 // This method may still be called during the same mouse event that 2627 // This method may still be called during the same mouse event that
2628 - // unbound this event handler. So check openScope before proceeding. 2628 + // unbound this event handlers. So check openScope before proceeding.
2629 if (!openScope) { return; } 2629 if (!openScope) { return; }
2630 2630
2631 if (evt && openScope.getAutoClose() === 'disabled') { return ; } 2631 if (evt && openScope.getAutoClose() === 'disabled') { return ; }
@@ -6982,7 +6982,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;, [&#39;ui.bootstrap.position&#39;]) @@ -6982,7 +6982,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;, [&#39;ui.bootstrap.position&#39;])
6982 selected = false; 6982 selected = false;
6983 }); 6983 });
6984 6984
6985 - // Keep reference to click handler to unbind it. 6985 + // Keep reference to click handlers to unbind it.
6986 var dismissClickHandler = function(evt) { 6986 var dismissClickHandler = function(evt) {
6987 // Issue #3973 6987 // Issue #3973
6988 // Firefox treats right click as a click on document 6988 // Firefox treats right click as a click on document
@@ -7490,7 +7490,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;) @@ -7490,7 +7490,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;)
7490 selected = false; 7490 selected = false;
7491 }); 7491 });
7492 7492
7493 - // Keep reference to click handler to unbind it. 7493 + // Keep reference to click handlers to unbind it.
7494 var dismissClickHandler = function(evt) { 7494 var dismissClickHandler = function(evt) {
7495 // Issue #3973 7495 // Issue #3973
7496 // Firefox treats right click as a click on document 7496 // Firefox treats right click as a click on document
src/main/resources/static/assets/bower_components/angular-bootstrap/ui-bootstrap.js
@@ -2624,7 +2624,7 @@ angular.module(&#39;ui.bootstrap.dropdown&#39;, [&#39;ui.bootstrap.position&#39;]) @@ -2624,7 +2624,7 @@ angular.module(&#39;ui.bootstrap.dropdown&#39;, [&#39;ui.bootstrap.position&#39;])
2624 2624
2625 var closeDropdown = function(evt) { 2625 var closeDropdown = function(evt) {
2626 // This method may still be called during the same mouse event that 2626 // This method may still be called during the same mouse event that
2627 - // unbound this event handler. So check openScope before proceeding. 2627 + // unbound this event handlers. So check openScope before proceeding.
2628 if (!openScope) { return; } 2628 if (!openScope) { return; }
2629 2629
2630 if (evt && openScope.getAutoClose() === 'disabled') { return ; } 2630 if (evt && openScope.getAutoClose() === 'disabled') { return ; }
@@ -6981,7 +6981,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;, [&#39;ui.bootstrap.position&#39;]) @@ -6981,7 +6981,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;, [&#39;ui.bootstrap.position&#39;])
6981 selected = false; 6981 selected = false;
6982 }); 6982 });
6983 6983
6984 - // Keep reference to click handler to unbind it. 6984 + // Keep reference to click handlers to unbind it.
6985 var dismissClickHandler = function(evt) { 6985 var dismissClickHandler = function(evt) {
6986 // Issue #3973 6986 // Issue #3973
6987 // Firefox treats right click as a click on document 6987 // Firefox treats right click as a click on document
@@ -7489,7 +7489,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;) @@ -7489,7 +7489,7 @@ angular.module(&#39;ui.bootstrap.typeahead&#39;)
7489 selected = false; 7489 selected = false;
7490 }); 7490 });
7491 7491
7492 - // Keep reference to click handler to unbind it. 7492 + // Keep reference to click handlers to unbind it.
7493 var dismissClickHandler = function(evt) { 7493 var dismissClickHandler = function(evt) {
7494 // Issue #3973 7494 // Issue #3973
7495 // Firefox treats right click as a click on document 7495 // Firefox treats right click as a click on document
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileDrop.js
@@ -47,7 +47,7 @@ export default (FileDirective) =&gt; { @@ -47,7 +47,7 @@ export default (FileDirective) =&gt; {
47 getFilters() { 47 getFilters() {
48 } 48 }
49 /** 49 /**
50 - * Event handler 50 + * Event handlers
51 */ 51 */
52 onDrop(event) { 52 onDrop(event) {
53 var transfer = this._getTransfer(event); 53 var transfer = this._getTransfer(event);
@@ -59,7 +59,7 @@ export default (FileDirective) =&gt; { @@ -59,7 +59,7 @@ export default (FileDirective) =&gt; {
59 this.uploader.addToQueue(transfer.files, options, filters); 59 this.uploader.addToQueue(transfer.files, options, filters);
60 } 60 }
61 /** 61 /**
62 - * Event handler 62 + * Event handlers
63 */ 63 */
64 onDragOver(event) { 64 onDragOver(event) {
65 var transfer = this._getTransfer(event); 65 var transfer = this._getTransfer(event);
@@ -69,7 +69,7 @@ export default (FileDirective) =&gt; { @@ -69,7 +69,7 @@ export default (FileDirective) =&gt; {
69 forEach(this.uploader._directives.over, this._addOverClass, this); 69 forEach(this.uploader._directives.over, this._addOverClass, this);
70 } 70 }
71 /** 71 /**
72 - * Event handler 72 + * Event handlers
73 */ 73 */
74 onDragLeave(event) { 74 onDragLeave(event) {
75 if(event.currentTarget === this.element[0]) return; 75 if(event.currentTarget === this.element[0]) return;
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileSelect.js
@@ -56,7 +56,7 @@ export default (FileDirective) =&gt; { @@ -56,7 +56,7 @@ export default (FileDirective) =&gt; {
56 return !!this.element.attr('multiple'); 56 return !!this.element.attr('multiple');
57 } 57 }
58 /** 58 /**
59 - * Event handler 59 + * Event handlers
60 */ 60 */
61 onChange() { 61 onChange() {
62 var files = this.uploader.isHTML5 ? this.element[0].files : this.element[0]; 62 var files = this.uploader.isHTML5 ? this.element[0].files : this.element[0];
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileUploader.js
@@ -526,7 +526,7 @@ export default (fileUploaderOptions, $rootScope, $http, $window, FileLikeObject, @@ -526,7 +526,7 @@ export default (fileUploaderOptions, $rootScope, $http, $window, FileLikeObject,
526 // Note that if non standard 4xx or 5xx error code returned 526 // Note that if non standard 4xx or 5xx error code returned
527 // from WS then response content can be accessed without error 527 // from WS then response content can be accessed without error
528 // but 'XHR' status becomes 200. In order to avoid confusion 528 // but 'XHR' status becomes 200. In order to avoid confusion
529 - // returning response via same 'success' event handler. 529 + // returning response via same 'success' event handlers.
530 530
531 // fixed angular.contents() for iframes 531 // fixed angular.contents() for iframes
532 html = iframe[0].contentDocument.body.innerHTML; 532 html = iframe[0].contentDocument.body.innerHTML;
src/main/resources/static/assets/bower_components/angular-mocks/angular-mocks.js
@@ -229,7 +229,7 @@ angular.mock.$ExceptionHandlerProvider = function() { @@ -229,7 +229,7 @@ angular.mock.$ExceptionHandlerProvider = function() {
229 * mode stores an array of errors in `$exceptionHandler.errors`, to allow later 229 * mode stores an array of errors in `$exceptionHandler.errors`, to allow later
230 * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and 230 * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and
231 * {@link ngMock.$log#reset reset()} 231 * {@link ngMock.$log#reset reset()}
232 - * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there 232 + * - `rethrow`: If any errors are passed to the handlers in tests, it typically means that there
233 * is a bug in the application or test, so this mock will make these tests fail. 233 * is a bug in the application or test, so this mock will make these tests fail.
234 * For any implementations that expect exceptions to be thrown, the `rethrow` mode 234 * For any implementations that expect exceptions to be thrown, the `rethrow` mode
235 * will also maintain a log of thrown errors. 235 * will also maintain a log of thrown errors.
src/main/resources/static/assets/bower_components/angular-touch/angular-touch.js
@@ -277,10 +277,10 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;, @@ -277,10 +277,10 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;,
277 // - element's touchstart: Starts a touch 277 // - element's touchstart: Starts a touch
278 // (- touchcancel ends the touch, no click follows) 278 // (- touchcancel ends the touch, no click follows)
279 // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold 279 // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold
280 - // too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). 280 + // too long) and fires the user's tap handlers. The touchend also calls preventGhostClick().
281 // - preventGhostClick() removes the allowable region the global touchstart created. 281 // - preventGhostClick() removes the allowable region the global touchstart created.
282 // - The browser generates a click event. 282 // - The browser generates a click event.
283 - // - The global click handler catches the click, and checks whether it was in an allowable region. 283 + // - The global click handlers catches the click, and checks whether it was in an allowable region.
284 // - If preventGhostClick was called, the region will have been removed, the click is busted. 284 // - If preventGhostClick was called, the region will have been removed, the click is busted.
285 // - If the region is still there, the click proceeds normally. Therefore clicks on links and 285 // - If the region is still there, the click proceeds normally. Therefore clicks on links and
286 // other elements without ngTap on them work normally. 286 // other elements without ngTap on them work normally.
@@ -313,7 +313,7 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;, @@ -313,7 +313,7 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;,
313 return false; // No allowable region; bust it. 313 return false; // No allowable region; bust it.
314 } 314 }
315 315
316 - // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick 316 + // Global click handlers that prevents the click if it's in a bustable zone and preventGhostClick
317 // was called recently. 317 // was called recently.
318 function onClick(event) { 318 function onClick(event) {
319 if (Date.now() - lastPreventedTime > PREVENT_DURATION) { 319 if (Date.now() - lastPreventedTime > PREVENT_DURATION) {
@@ -359,7 +359,7 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;, @@ -359,7 +359,7 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;,
359 } 359 }
360 360
361 361
362 - // Global touchstart handler that creates an allowable region for a click event. 362 + // Global touchstart handlers that creates an allowable region for a click event.
363 // This allowable region can be removed by preventGhostClick if we want to bust it. 363 // This allowable region can be removed by preventGhostClick if we want to bust it.
364 function onTouchStart(event) { 364 function onTouchStart(event) {
365 var touches = event.touches && event.touches.length ? event.touches : [event]; 365 var touches = event.touches && event.touches.length ? event.touches : [event];
@@ -466,11 +466,11 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;, @@ -466,11 +466,11 @@ ngTouch.directive(&#39;ngClick&#39;, [&#39;$parse&#39;, &#39;$timeout&#39;, &#39;$rootElement&#39;,
466 // something else nearby. 466 // something else nearby.
467 element.onclick = function(event) { }; 467 element.onclick = function(event) { };
468 468
469 - // Actual click handler. 469 + // Actual click handlers.
470 // There are three different kinds of clicks, only two of which reach this point. 470 // There are three different kinds of clicks, only two of which reach this point.
471 // - On desktop browsers without touch events, their clicks will always come here. 471 // - On desktop browsers without touch events, their clicks will always come here.
472 // - On mobile browsers, the simulated "fast" click will call this. 472 // - On mobile browsers, the simulated "fast" click will call this.
473 - // - But the browser's follow-up slow click will be "busted" before it reaches this handler. 473 + // - But the browser's follow-up slow click will be "busted" before it reaches this handlers.
474 // Therefore it's safe to use this directive on both mobile and desktop. 474 // Therefore it's safe to use this directive on both mobile and desktop.
475 element.on('click', function(event, touchend) { 475 element.on('click', function(event, touchend) {
476 scope.$apply(function() { 476 scope.$apply(function() {
src/main/resources/static/assets/bower_components/angular-ui-router/README.md
@@ -81,7 +81,7 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views. @@ -81,7 +81,7 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views.
81 <div ui-view></div> 81 <div ui-view></div>
82 <!-- We'll also add some navigation: --> 82 <!-- We'll also add some navigation: -->
83 <a ui-sref="state1">State 1</a> 83 <a ui-sref="state1">State 1</a>
84 - <a ui-sref="state2">State 2</a> 84 + <a ui-sref="signalState">State 2</a>
85 </body> 85 </body>
86 ``` 86 ```
87 87
@@ -96,10 +96,10 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views. @@ -96,10 +96,10 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views.
96 <div ui-view></div> 96 <div ui-view></div>
97 ``` 97 ```
98 ```html 98 ```html
99 -<!-- partials/state2.html --> 99 +<!-- partials/signalState.html -->
100 <h1>State 2</h1> 100 <h1>State 2</h1>
101 <hr/> 101 <hr/>
102 -<a ui-sref="state2.list">Show List</a> 102 +<a ui-sref="signalState.list">Show List</a>
103 <div ui-view></div> 103 <div ui-view></div>
104 ``` 104 ```
105 105
@@ -116,7 +116,7 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views. @@ -116,7 +116,7 @@ The majority of UI-Router&#39;s power is in its ability to nest states &amp; views.
116 116
117 > 117 >
118 ```html 118 ```html
119 -<!-- partials/state2.list.html --> 119 +<!-- partials/signalState.list.html -->
120 <h3>List of State 2 Things</h3> 120 <h3>List of State 2 Things</h3>
121 <ul> 121 <ul>
122 <li ng-repeat="thing in things">{{ thing }}</li> 122 <li ng-repeat="thing in things">{{ thing }}</li>
@@ -146,13 +146,13 @@ myApp.config(function($stateProvider, $urlRouterProvider) { @@ -146,13 +146,13 @@ myApp.config(function($stateProvider, $urlRouterProvider) {
146 $scope.items = ["A", "List", "Of", "Items"]; 146 $scope.items = ["A", "List", "Of", "Items"];
147 } 147 }
148 }) 148 })
149 - .state('state2', {  
150 - url: "/state2",  
151 - templateUrl: "partials/state2.html" 149 + .state('signalState', {
  150 + url: "/signalState",
  151 + templateUrl: "partials/signalState.html"
152 }) 152 })
153 - .state('state2.list', { 153 + .state('signalState.list', {
154 url: "/list", 154 url: "/list",
155 - templateUrl: "partials/state2.list.html", 155 + templateUrl: "partials/signalState.list.html",
156 controller: function($scope) { 156 controller: function($scope) {
157 $scope.things = ["A", "Set", "Of", "Things"]; 157 $scope.things = ["A", "Set", "Of", "Things"];
158 } 158 }
src/main/resources/static/assets/bower_components/angular-ui-router/release/angular-ui-router.js
@@ -1843,14 +1843,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -1843,14 +1843,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
1843 * @methodOf ui.router.router.$urlRouterProvider 1843 * @methodOf ui.router.router.$urlRouterProvider
1844 * 1844 *
1845 * @description 1845 * @description
1846 - * Registers a handler for a given url matching. if handle is a string, it is 1846 + * Registers a handlers for a given url matching. if handle is a string, it is
1847 * treated as a redirect, and is interpolated according to the syntax of match 1847 * treated as a redirect, and is interpolated according to the syntax of match
1848 * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). 1848 * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
1849 * 1849 *
1850 - * If the handler is a function, it is injectable. It gets invoked if `$location` 1850 + * If the handlers is a function, it is injectable. It gets invoked if `$location`
1851 * matches. You have the option of inject the match object as `$match`. 1851 * matches. You have the option of inject the match object as `$match`.
1852 * 1852 *
1853 - * The handler can return 1853 + * The handlers can return
1854 * 1854 *
1855 * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` 1855 * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
1856 * will continue trying to find another one that matches. 1856 * will continue trying to find another one that matches.
@@ -1879,7 +1879,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -1879,7 +1879,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
1879 if (isString(what)) what = $urlMatcherFactory.compile(what); 1879 if (isString(what)) what = $urlMatcherFactory.compile(what);
1880 1880
1881 if (!handlerIsString && !isFunction(handler) && !isArray(handler)) 1881 if (!handlerIsString && !isFunction(handler) && !isArray(handler))
1882 - throw new Error("invalid 'handler' in when()"); 1882 + throw new Error("invalid 'handlers' in when()");
1883 1883
1884 var strategies = { 1884 var strategies = {
1885 matcher: function (what, handler) { 1885 matcher: function (what, handler) {
@@ -1928,7 +1928,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -1928,7 +1928,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
1928 * If you wish to customize the behavior of syncing the URL (for example, if you wish to 1928 * If you wish to customize the behavior of syncing the URL (for example, if you wish to
1929 * defer a transition but maintain the current URL), call this method at configuration time. 1929 * defer a transition but maintain the current URL), call this method at configuration time.
1930 * Then, at run time, call `$urlRouter.listen()` after you have configured your own 1930 * Then, at run time, call `$urlRouter.listen()` after you have configured your own
1931 - * `$locationChangeSuccess` event handler. 1931 + * `$locationChangeSuccess` event handlers.
1932 * 1932 *
1933 * @example 1933 * @example
1934 * <pre> 1934 * <pre>
@@ -1947,7 +1947,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -1947,7 +1947,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
1947 * // UserService is an example service for managing user state 1947 * // UserService is an example service for managing user state
1948 * if (UserService.isLoggedIn()) return; 1948 * if (UserService.isLoggedIn()) return;
1949 * 1949 *
1950 - * // Prevent $urlRouter's default handler from firing 1950 + * // Prevent $urlRouter's default handlers from firing
1951 * e.preventDefault(); 1951 * e.preventDefault();
1952 * 1952 *
1953 * UserService.handleLogin().then(function() { 1953 * UserService.handleLogin().then(function() {
@@ -2914,7 +2914,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { @@ -2914,7 +2914,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
2914 return null; 2914 return null;
2915 } 2915 }
2916 2916
2917 - // Allow the handler to return a promise to defer state lookup retry 2917 + // Allow the handlers to return a promise to defer state lookup retry
2918 if (options.$retry) { 2918 if (options.$retry) {
2919 $urlRouter.update(); 2919 $urlRouter.update();
2920 return TransitionFailed; 2920 return TransitionFailed;
src/main/resources/static/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js
@@ -4,4 +4,4 @@ @@ -4,4 +4,4 @@
4 * @link http://angular-ui.github.com/ 4 * @link http://angular-ui.github.com/
5 * @license MIT License, http://www.opensource.org/licenses/MIT 5 * @license MIT License, http://www.opensource.org/licenses/MIT
6 */ 6 */
7 -"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return N(new(N(function(){},{prototype:a})),b)}function e(a){return M(arguments,function(b){b!==a&&M(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return M(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return N({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return M(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return M(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=L(a),d=c?[]:{};return M(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=L(a)?[]:{};return M(a,function(a,d){c[d]=b(a,d)}),c}function p(a,b){var d=1,f=2,i={},j=[],k=i,l=N(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(s[c]!==f){if(r.push(c),s[c]===d)throw r.splice(0,h(r,c)),new Error("Cyclic dependency: "+r.join(" -> "));if(s[c]=d,J(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);M(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return K(a)&&a.then&&a.$$promises}if(!K(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return M(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!H(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;M(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!K(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=N({},d),u=1+q.length/3,v=!1;if(H(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),N(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return H(a.template)?this.fromString(a.template,b):H(a.templateUrl)?this.fromUrl(a.templateUrl,b):H(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return I(a)?a(b):a},this.fromUrl=function(c,d){return I(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new P.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:e=["?(",")?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),j=P.type(h||"string")||d(P.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=N({params:{}},K(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new P.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){N(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/\//g,"%2F"):a}function e(a){return null!=a?a.toString().replace(/%2F/g,"/"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return I(a)||L(a)&&I(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){N(this,a||{})}P=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!H(a)||"string"==typeof a},pattern:/[^/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return H(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return H(a)&&(m=a),m},this.strictMode=function(a){return H(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!H(a))return q;if(a!==!0&&a!==!1&&!J(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,N(f(),b))},this.isMatcher=function(a){if(!K(a))return!1;var b=!0;return M(r.prototype,function(c,d){I(c)&&(b=b&&H(a[d])&&I(a[d]))}),b},this.type=function(a,b,c){if(!H(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(N({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},M(x,function(a,b){u[b]=new s(N({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),M(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,b,d,e){function f(a){var b=K(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function j(b,c,d){if(b.type&&c)throw new Error("Param '"+a+"' has two type configurations.");return c?c:b.type?b.type instanceof s?b.type:new s(b.type):"config"===d?u.any:u.string}function k(){var b={array:"search"===e?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return N(b,c,d).array}function m(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!H(c)||null==c)return q;if(c===!0||J(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function p(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=L(a.replace)?a.replace:[],J(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function r(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(d.$$fn);if(null!==a&&a!==c&&!w.type.is(a))throw new Error("Default value ("+a+") for parameter '"+w.id+"' is not an instance of Type ("+w.type.name+")");return a}function t(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),H(a)?w.type.$normalize(a):r()}function v(){return"{Param:"+a+" "+b+" squash: '"+z+"' optional: "+y+"}"}var w=this;d=f(d),b=j(d,b,e);var x=k();b=x?b.$asArray(x,"search"===e):b,"string"!==b.name||x||"path"!==e||d.value!==c||(d.value="");var y=d.value!==c,z=m(d,y),A=p(d,x,y,z);N(this,{id:a,type:b,location:e,array:x,squash:z,replace:A,isOptional:y,value:t,dynamic:c,config:d,toString:v})},k.prototype={$$new:function(){return d(this,N(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),M(b,function(b){M(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return M(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return M(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function u(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return H(d)?d:!0}function h(d,e,f,g){function h(a,b,c){return"/"===p?a:b?p.slice(0,-1)+a:c?p.slice(1)+a:a}function m(a){function b(a){var b=a(f,d);return b?(J(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){o&&d.url()===o;o=c;var e,g=j.length;for(e=0;g>e;e++)if(b(j[e]))return;k&&b(k)}}function n(){return i=i||e.$on("$locationChangeSuccess",m)}var o,p=g.baseHref(),q=d.url();return l||n(),{sync:function(){m()},listen:function(){return n()},update:function(a){return a?void(q=d.url()):void(d.url()!==q&&(d.url(q),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),o=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled);var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=h(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!I(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(J(a)){var b=a;a=function(){return b}}else if(!I(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=J(b);if(J(a)&&(a=d.compile(a)),!h&&!I(b)&&!L(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),N(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:J(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),N(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=J(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!J(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):J(b.parent)?b.parent:K(b.parent)&&J(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)I(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return J(a)&&!H(b)?C[a]:I(b)&&J(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return K(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return M(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(I(d.controllerProvider)||L(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,N({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=N({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!H(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!H(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,I=[];if(f.reload){if(J(f.reload)||K(f.reload)){if(K(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var L=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!L)throw new Error("No such reload state '"+(J(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==L;)G=I[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=I[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,O(y.params,n),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),p.update(),C;for(var M=e.when(G),P=D;P<z.length;P++,F=z[P])G=I[P]=d(G),M=v(F,c,F===b,M,G,f);var Q=y.transition=M.then(function(){var d,e,g;if(y.transition!==Q)return A;for(d=o.length-1;d>=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d<z.length;d++)e=z[d],e.locals=I[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return r&&(c["#"]=r),y.transition!==Q?A:(y.$current=b,y.current=b.self,y.params=c,O(y.params,n),y.transition=null,f.location&&b.navigable&&p.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,l),p.update(!0),y.current)},function(d){return y.transition!==Q?A:(y.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,l,d),g.defaultPrevented||p.update(),e.reject(d))});return Q},y.is=function(a,b,d){d=N({relative:y.$current},d||{});var e=m(a,d.relative);return H(e)?y.$current!==e?!1:b?j(e.params.$$values(b),n):!0:c},y.includes=function(a,b,d){if(d=N({relative:y.$current},d||{}),J(a)&&r(a)){if(!s(a))return!1;a=y.$current.name}var e=m(a,d.relative);return H(e)?H(y.$current.includes[e.name])?b?j(e.params.$$values(b),n,g(b)):!0:!1:c},y.href=function(a,b,d){d=N({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},d||{});var e=m(a,d.relative);if(!H(e))return null;d.inherit&&(b=i(n,b||{},y.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?p.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},y.get=function(a,b){if(0===arguments.length)return o(g(z),function(a){return z[a].self});var c=m(a,b||y.$current);return c&&c.self?c.self:null},y}function w(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new P.ParamSet(f);return g.$$equals(b,c)}return!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b))?!0:void 0}var x,y,z={},A={},B="abstract",C={parent:function(a){if(H(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):x},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=N({},a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(J(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||x).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new P.ParamSet;return M(a.params||{},function(a,c){b[c]||(b[c]=new P.Param(c,null,a,"config"))}),b},params:function(a){return a.parent&&a.parent.params?N(a.parent.params.$$new(),a.ownParams):new P.ParamSet},views:function(a){var b={};return M(H(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?N({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};x=q({name:"",url:"^",views:null,"abstract":!0}),x.navigable=null,this.decorator=t,this.state=u,this.$get=v,v.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function w(){function a(a,b){return{load:function(c,d){var e,f={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return d=N(f,d),d.view&&(e=b.fromConfig(d.view,d.params,d.locals)),e&&d.notify&&a.$broadcast("$viewContentLoading",d),e}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function x(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function y(a,c,d,e){function f(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(b){return null}}}function g(a,b){var c=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(j)return{enter:function(a,b,c){var d=j.enter(a,null,b,c);d&&d.then&&d.then(c)},leave:function(a,b){var c=j.leave(a,b);c&&c.then&&c.then(b)}};if(i){var d=i&&i(b,a);return{enter:function(a,b,c){d.enter(a,null,b),c()},leave:function(a,b){d.leave(a),b()}}}return c()}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){l&&(l.remove(),l=null),n&&(n.$destroy(),n=null),m&&(r.leave(m,function(){l=null}),l=m,m=null)}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if(g||s!==o){k=c.$new(),o=a.$current.locals[l];var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded"),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),c.$on("$viewContentLoading",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a,c){var d=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,f,g,h){var i=B(g.uiSref,a.current.name),j=null,k=C(f)||a.$current,l="[object SVGAnimatedString]"===Object.prototype.toString.call(f.prop("href"))?"xlink:href":"href",m=null,n="A"===f.prop("tagName").toUpperCase(),o="FORM"===f[0].nodeName,p=o?"action":l,q=!0,r={relative:k,inherit:!0},s=e.$eval(g.uiSrefOpts)||{};b.forEach(d,function(a){a in s&&(r[a]=s[a])});var t=function(c){if(c&&(j=b.copy(c)),q){m=a.href(i.state,j,r);var d=h[1]||h[0];return d&&d.$$addStateInfo(i.state,j),null===m?(q=!1,!1):void g.$set(p,m)}};i.paramExpr&&(e.$watch(i.paramExpr,function(a,b){a!==j&&t(a)},!0),j=b.copy(e.$eval(i.paramExpr))),t(),o||f.bind("click",function(b){var d=b.which||b.button;if(!(d>1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target"))){var e=c(function(){a.go(i.state,j,r)});b.preventDefault();var g=n&&!m?1:0;b.preventDefault=function(){g--<=0&&c.cancel(e)}}})}}}function E(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(b,d,e){function f(){g()?d.addClass(i):d.removeClass(i)}function g(){for(var a=0;a<j.length;a++)if(h(j[a].state,j[a].params))return!0;return!1}function h(b,c){return"undefined"!=typeof e.uiSrefActiveEq?a.is(b.name,c):a.includes(b.name,c)}var i,j=[];i=c(e.uiSrefActiveEq||e.uiSrefActive||"",!1)(b),this.$$addStateInfo=function(b,c){var e=a.get(b,C(d));j.push({state:e||{name:b},params:c}),f()},b.$on("$stateChangeSuccess",f)}]}}function F(a){var b=function(b){return a.is(b)};return b.$stateful=!0,b}function G(a){var b=function(b){return a.includes(b)};return b.$stateful=!0,b}var H=b.isDefined,I=b.isFunction,J=b.isString,K=b.isObject,L=b.isArray,M=b.forEach,N=b.extend,O=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var P;r.prototype.concat=function(a,b){var c={caseInsensitive:P.caseInsensitive(),strict:P.strictMode(),squash:P.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,N(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(e=0;j>e;e++){g=h[e];var l=this.params[g],m=d[e+1];for(f=0;f<l.replace;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),k[g]=l.value(m)}for(;i>e;e++)g=h[e],k[g]=this.params[g].value(b[g]);return k},r.prototype.parameters=function(a){return H(a)?this.params[a]||null:this.$$paramNames},r.prototype.validates=function(a){return this.params.$$validates(a)},r.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;i>f;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1];if(q===!1)null!=r&&(j+=L(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var t=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(t)[1]}else J(q)&&(j+=q+s)}else{if(null==r||p&&q!==!1)continue;L(r)||(r=[r]),r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return L(a)?a:H(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",t),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),u.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",u),v.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",v),w.$inject=[],b.module("ui.router.state").provider("$view",w),b.module("ui.router.state").provider("$uiViewScroll",x),y.$inject=["$state","$injector","$uiViewScroll","$interpolate"],z.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",y),b.module("ui.router.state").directive("uiView",z),D.$inject=["$state","$timeout"],E.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",D).directive("uiSrefActive",E).directive("uiSrefActiveEq",E),F.$inject=["$state"],G.$inject=["$state"],b.module("ui.router.state").filter("isState",F).filter("includedByState",G)}(window,window.angular);  
8 \ No newline at end of file 7 \ No newline at end of file
  8 +"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return N(new(N(function(){},{prototype:a})),b)}function e(a){return M(arguments,function(b){b!==a&&M(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return M(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return N({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return M(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return M(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=L(a),d=c?[]:{};return M(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=L(a)?[]:{};return M(a,function(a,d){c[d]=b(a,d)}),c}function p(a,b){var d=1,f=2,i={},j=[],k=i,l=N(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(s[c]!==f){if(r.push(c),s[c]===d)throw r.splice(0,h(r,c)),new Error("Cyclic dependency: "+r.join(" -> "));if(s[c]=d,J(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);M(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return K(a)&&a.then&&a.$$promises}if(!K(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return M(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!H(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;M(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!K(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=N({},d),u=1+q.length/3,v=!1;if(H(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),N(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return H(a.template)?this.fromString(a.template,b):H(a.templateUrl)?this.fromUrl(a.templateUrl,b):H(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return I(a)?a(b):a},this.fromUrl=function(c,d){return I(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new P.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:e=["?(",")?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),j=P.type(h||"string")||d(P.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=N({params:{}},K(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new P.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){N(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/\//g,"%2F"):a}function e(a){return null!=a?a.toString().replace(/%2F/g,"/"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return I(a)||L(a)&&I(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){N(this,a||{})}P=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!H(a)||"string"==typeof a},pattern:/[^/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return H(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return H(a)&&(m=a),m},this.strictMode=function(a){return H(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!H(a))return q;if(a!==!0&&a!==!1&&!J(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,N(f(),b))},this.isMatcher=function(a){if(!K(a))return!1;var b=!0;return M(r.prototype,function(c,d){I(c)&&(b=b&&H(a[d])&&I(a[d]))}),b},this.type=function(a,b,c){if(!H(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(N({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},M(x,function(a,b){u[b]=new s(N({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),M(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,b,d,e){function f(a){var b=K(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function j(b,c,d){if(b.type&&c)throw new Error("Param '"+a+"' has two type configurations.");return c?c:b.type?b.type instanceof s?b.type:new s(b.type):"config"===d?u.any:u.string}function k(){var b={array:"search"===e?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return N(b,c,d).array}function m(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!H(c)||null==c)return q;if(c===!0||J(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function p(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=L(a.replace)?a.replace:[],J(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function r(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(d.$$fn);if(null!==a&&a!==c&&!w.type.is(a))throw new Error("Default value ("+a+") for parameter '"+w.id+"' is not an instance of Type ("+w.type.name+")");return a}function t(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),H(a)?w.type.$normalize(a):r()}function v(){return"{Param:"+a+" "+b+" squash: '"+z+"' optional: "+y+"}"}var w=this;d=f(d),b=j(d,b,e);var x=k();b=x?b.$asArray(x,"search"===e):b,"string"!==b.name||x||"path"!==e||d.value!==c||(d.value="");var y=d.value!==c,z=m(d,y),A=p(d,x,y,z);N(this,{id:a,type:b,location:e,array:x,squash:z,replace:A,isOptional:y,value:t,dynamic:c,config:d,toString:v})},k.prototype={$$new:function(){return d(this,N(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),M(b,function(b){M(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return M(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return M(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function u(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return H(d)?d:!0}function h(d,e,f,g){function h(a,b,c){return"/"===p?a:b?p.slice(0,-1)+a:c?p.slice(1)+a:a}function m(a){function b(a){var b=a(f,d);return b?(J(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){o&&d.url()===o;o=c;var e,g=j.length;for(e=0;g>e;e++)if(b(j[e]))return;k&&b(k)}}function n(){return i=i||e.$on("$locationChangeSuccess",m)}var o,p=g.baseHref(),q=d.url();return l||n(),{sync:function(){m()},listen:function(){return n()},update:function(a){return a?void(q=d.url()):void(d.url()!==q&&(d.url(q),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),o=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled);var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=h(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!I(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(J(a)){var b=a;a=function(){return b}}else if(!I(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=J(b);if(J(a)&&(a=d.compile(a)),!h&&!I(b)&&!L(b))throw new Error("invalid 'handlers' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),N(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:J(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),N(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=J(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!J(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):J(b.parent)?b.parent:K(b.parent)&&J(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)I(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return J(a)&&!H(b)?C[a]:I(b)&&J(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return K(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return M(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(I(d.controllerProvider)||L(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,N({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=N({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!H(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!H(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,I=[];if(f.reload){if(J(f.reload)||K(f.reload)){if(K(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var L=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!L)throw new Error("No such reload state '"+(J(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==L;)G=I[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=I[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,O(y.params,n),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),p.update(),C;for(var M=e.when(G),P=D;P<z.length;P++,F=z[P])G=I[P]=d(G),M=v(F,c,F===b,M,G,f);var Q=y.transition=M.then(function(){var d,e,g;if(y.transition!==Q)return A;for(d=o.length-1;d>=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d<z.length;d++)e=z[d],e.locals=I[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return r&&(c["#"]=r),y.transition!==Q?A:(y.$current=b,y.current=b.self,y.params=c,O(y.params,n),y.transition=null,f.location&&b.navigable&&p.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,l),p.update(!0),y.current)},function(d){return y.transition!==Q?A:(y.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,l,d),g.defaultPrevented||p.update(),e.reject(d))});return Q},y.is=function(a,b,d){d=N({relative:y.$current},d||{});var e=m(a,d.relative);return H(e)?y.$current!==e?!1:b?j(e.params.$$values(b),n):!0:c},y.includes=function(a,b,d){if(d=N({relative:y.$current},d||{}),J(a)&&r(a)){if(!s(a))return!1;a=y.$current.name}var e=m(a,d.relative);return H(e)?H(y.$current.includes[e.name])?b?j(e.params.$$values(b),n,g(b)):!0:!1:c},y.href=function(a,b,d){d=N({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},d||{});var e=m(a,d.relative);if(!H(e))return null;d.inherit&&(b=i(n,b||{},y.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?p.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},y.get=function(a,b){if(0===arguments.length)return o(g(z),function(a){return z[a].self});var c=m(a,b||y.$current);return c&&c.self?c.self:null},y}function w(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new P.ParamSet(f);return g.$$equals(b,c)}return!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b))?!0:void 0}var x,y,z={},A={},B="abstract",C={parent:function(a){if(H(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):x},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=N({},a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(J(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||x).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new P.ParamSet;return M(a.params||{},function(a,c){b[c]||(b[c]=new P.Param(c,null,a,"config"))}),b},params:function(a){return a.parent&&a.parent.params?N(a.parent.params.$$new(),a.ownParams):new P.ParamSet},views:function(a){var b={};return M(H(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?N({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};x=q({name:"",url:"^",views:null,"abstract":!0}),x.navigable=null,this.decorator=t,this.state=u,this.$get=v,v.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function w(){function a(a,b){return{load:function(c,d){var e,f={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return d=N(f,d),d.view&&(e=b.fromConfig(d.view,d.params,d.locals)),e&&d.notify&&a.$broadcast("$viewContentLoading",d),e}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function x(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function y(a,c,d,e){function f(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(b){return null}}}function g(a,b){var c=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(j)return{enter:function(a,b,c){var d=j.enter(a,null,b,c);d&&d.then&&d.then(c)},leave:function(a,b){var c=j.leave(a,b);c&&c.then&&c.then(b)}};if(i){var d=i&&i(b,a);return{enter:function(a,b,c){d.enter(a,null,b),c()},leave:function(a,b){d.leave(a),b()}}}return c()}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){l&&(l.remove(),l=null),n&&(n.$destroy(),n=null),m&&(r.leave(m,function(){l=null}),l=m,m=null)}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if(g||s!==o){k=c.$new(),o=a.$current.locals[l];var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded"),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),c.$on("$viewContentLoading",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a,c){var d=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,f,g,h){var i=B(g.uiSref,a.current.name),j=null,k=C(f)||a.$current,l="[object SVGAnimatedString]"===Object.prototype.toString.call(f.prop("href"))?"xlink:href":"href",m=null,n="A"===f.prop("tagName").toUpperCase(),o="FORM"===f[0].nodeName,p=o?"action":l,q=!0,r={relative:k,inherit:!0},s=e.$eval(g.uiSrefOpts)||{};b.forEach(d,function(a){a in s&&(r[a]=s[a])});var t=function(c){if(c&&(j=b.copy(c)),q){m=a.href(i.state,j,r);var d=h[1]||h[0];return d&&d.$$addStateInfo(i.state,j),null===m?(q=!1,!1):void g.$set(p,m)}};i.paramExpr&&(e.$watch(i.paramExpr,function(a,b){a!==j&&t(a)},!0),j=b.copy(e.$eval(i.paramExpr))),t(),o||f.bind("click",function(b){var d=b.which||b.button;if(!(d>1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target"))){var e=c(function(){a.go(i.state,j,r)});b.preventDefault();var g=n&&!m?1:0;b.preventDefault=function(){g--<=0&&c.cancel(e)}}})}}}function E(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(b,d,e){function f(){g()?d.addClass(i):d.removeClass(i)}function g(){for(var a=0;a<j.length;a++)if(h(j[a].state,j[a].params))return!0;return!1}function h(b,c){return"undefined"!=typeof e.uiSrefActiveEq?a.is(b.name,c):a.includes(b.name,c)}var i,j=[];i=c(e.uiSrefActiveEq||e.uiSrefActive||"",!1)(b),this.$$addStateInfo=function(b,c){var e=a.get(b,C(d));j.push({state:e||{name:b},params:c}),f()},b.$on("$stateChangeSuccess",f)}]}}function F(a){var b=function(b){return a.is(b)};return b.$stateful=!0,b}function G(a){var b=function(b){return a.includes(b)};return b.$stateful=!0,b}var H=b.isDefined,I=b.isFunction,J=b.isString,K=b.isObject,L=b.isArray,M=b.forEach,N=b.extend,O=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var P;r.prototype.concat=function(a,b){var c={caseInsensitive:P.caseInsensitive(),strict:P.strictMode(),squash:P.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,N(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(e=0;j>e;e++){g=h[e];var l=this.params[g],m=d[e+1];for(f=0;f<l.replace;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),k[g]=l.value(m)}for(;i>e;e++)g=h[e],k[g]=this.params[g].value(b[g]);return k},r.prototype.parameters=function(a){return H(a)?this.params[a]||null:this.$$paramNames},r.prototype.validates=function(a){return this.params.$$validates(a)},r.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;i>f;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1];if(q===!1)null!=r&&(j+=L(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var t=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(t)[1]}else J(q)&&(j+=q+s)}else{if(null==r||p&&q!==!1)continue;L(r)||(r=[r]),r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return L(a)?a:H(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",t),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),u.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",u),v.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",v),w.$inject=[],b.module("ui.router.state").provider("$view",w),b.module("ui.router.state").provider("$uiViewScroll",x),y.$inject=["$state","$injector","$uiViewScroll","$interpolate"],z.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",y),b.module("ui.router.state").directive("uiView",z),D.$inject=["$state","$timeout"],E.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",D).directive("uiSrefActive",E).directive("uiSrefActiveEq",E),F.$inject=["$state"],G.$inject=["$state"],b.module("ui.router.state").filter("isState",F).filter("includedByState",G)}(window,window.angular);
9 \ No newline at end of file 9 \ No newline at end of file
src/main/resources/static/assets/bower_components/angular-ui-router/src/state.js
@@ -765,7 +765,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { @@ -765,7 +765,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) {
765 return null; 765 return null;
766 } 766 }
767 767
768 - // Allow the handler to return a promise to defer state lookup retry 768 + // Allow the handlers to return a promise to defer state lookup retry
769 if (options.$retry) { 769 if (options.$retry) {
770 $urlRouter.update(); 770 $urlRouter.update();
771 return TransitionFailed; 771 return TransitionFailed;
src/main/resources/static/assets/bower_components/angular-ui-router/src/urlRouter.js
@@ -122,14 +122,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -122,14 +122,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
122 * @methodOf ui.router.router.$urlRouterProvider 122 * @methodOf ui.router.router.$urlRouterProvider
123 * 123 *
124 * @description 124 * @description
125 - * Registers a handler for a given url matching. if handle is a string, it is 125 + * Registers a handlers for a given url matching. if handle is a string, it is
126 * treated as a redirect, and is interpolated according to the syntax of match 126 * treated as a redirect, and is interpolated according to the syntax of match
127 * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). 127 * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
128 * 128 *
129 - * If the handler is a function, it is injectable. It gets invoked if `$location` 129 + * If the handlers is a function, it is injectable. It gets invoked if `$location`
130 * matches. You have the option of inject the match object as `$match`. 130 * matches. You have the option of inject the match object as `$match`.
131 * 131 *
132 - * The handler can return 132 + * The handlers can return
133 * 133 *
134 * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` 134 * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
135 * will continue trying to find another one that matches. 135 * will continue trying to find another one that matches.
@@ -158,7 +158,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -158,7 +158,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
158 if (isString(what)) what = $urlMatcherFactory.compile(what); 158 if (isString(what)) what = $urlMatcherFactory.compile(what);
159 159
160 if (!handlerIsString && !isFunction(handler) && !isArray(handler)) 160 if (!handlerIsString && !isFunction(handler) && !isArray(handler))
161 - throw new Error("invalid 'handler' in when()"); 161 + throw new Error("invalid 'handlers' in when()");
162 162
163 var strategies = { 163 var strategies = {
164 matcher: function (what, handler) { 164 matcher: function (what, handler) {
@@ -207,7 +207,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -207,7 +207,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
207 * If you wish to customize the behavior of syncing the URL (for example, if you wish to 207 * If you wish to customize the behavior of syncing the URL (for example, if you wish to
208 * defer a transition but maintain the current URL), call this method at configuration time. 208 * defer a transition but maintain the current URL), call this method at configuration time.
209 * Then, at run time, call `$urlRouter.listen()` after you have configured your own 209 * Then, at run time, call `$urlRouter.listen()` after you have configured your own
210 - * `$locationChangeSuccess` event handler. 210 + * `$locationChangeSuccess` event handlers.
211 * 211 *
212 * @example 212 * @example
213 * <pre> 213 * <pre>
@@ -226,7 +226,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { @@ -226,7 +226,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) {
226 * // UserService is an example service for managing user state 226 * // UserService is an example service for managing user state
227 * if (UserService.isLoggedIn()) return; 227 * if (UserService.isLoggedIn()) return;
228 * 228 *
229 - * // Prevent $urlRouter's default handler from firing 229 + * // Prevent $urlRouter's default handlers from firing
230 * e.preventDefault(); 230 * e.preventDefault();
231 * 231 *
232 * UserService.handleLogin().then(function() { 232 * UserService.handleLogin().then(function() {
src/main/resources/static/assets/bower_components/angular/angular.js
@@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) { @@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) {
3067 // i.e. it will definitely not be in a $apply 3067 // i.e. it will definitely not be in a $apply
3068 win.setTimeout(action); 3068 win.setTimeout(action);
3069 } else { 3069 } else {
3070 - // No need to unbind this handler as load is only ever called once 3070 + // No need to unbind this handlers as load is only ever called once
3071 jqLite(win).on('load', action); 3071 jqLite(win).on('load', action);
3072 } 3072 }
3073 } 3073 }
@@ -3349,7 +3349,7 @@ function createEventHandler(element, events) { @@ -3349,7 +3349,7 @@ function createEventHandler(element, events) {
3349 return event.immediatePropagationStopped === true; 3349 return event.immediatePropagationStopped === true;
3350 }; 3350 };
3351 3351
3352 - // Some events have special handlers that wrap the real handler 3352 + // Some events have special handlers that wrap the real handlers
3353 var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; 3353 var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;
3354 3354
3355 // Copy event handlers in case event handlers array is modified during execution. 3355 // Copy event handlers in case event handlers array is modified during execution.
@@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) { @@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) {
3379 // Read about mouseenter and mouseleave: 3379 // Read about mouseenter and mouseleave:
3380 // http://www.quirksmode.org/js/events_mouse.html#link8 3380 // http://www.quirksmode.org/js/events_mouse.html#link8
3381 var related = event.relatedTarget; 3381 var related = event.relatedTarget;
3382 - // For mousenter/leave call the handler if related is outside the target. 3382 + // For mousenter/leave call the handlers if related is outside the target.
3383 // NB: No relatedTarget if the mouse left/entered the browser window 3383 // NB: No relatedTarget if the mouse left/entered the browser window
3384 if (!related || (related !== target && !jqLiteContains.call(target, related))) { 3384 if (!related || (related !== target && !jqLiteContains.call(target, related))) {
3385 handler.call(target, event); 3385 handler.call(target, event);
@@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) { @@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) {
5992 5992
5993 /** 5993 /**
5994 * @private 5994 * @private
5995 - * Remove popstate and hashchange handler from window. 5995 + * Remove popstate and hashchange handlers from window.
5996 * 5996 *
5997 * NOTE: this api is intended for use only by $rootScope. 5997 * NOTE: this api is intended for use only by $rootScope.
5998 */ 5998 */
@@ -12581,7 +12581,7 @@ function $LocationProvider() { @@ -12581,7 +12581,7 @@ function $LocationProvider() {
12581 defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, 12581 defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
12582 newState, oldState).defaultPrevented; 12582 newState, oldState).defaultPrevented;
12583 12583
12584 - // if the location was changed by a `$locationChangeStart` handler then stop 12584 + // if the location was changed by a `$locationChangeStart` handlers then stop
12585 // processing this location change 12585 // processing this location change
12586 if ($location.absUrl() !== newUrl) return; 12586 if ($location.absUrl() !== newUrl) return;
12587 12587
@@ -12615,7 +12615,7 @@ function $LocationProvider() { @@ -12615,7 +12615,7 @@ function $LocationProvider() {
12615 var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, 12615 var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
12616 $location.$$state, oldState).defaultPrevented; 12616 $location.$$state, oldState).defaultPrevented;
12617 12617
12618 - // if the location was changed by a `$locationChangeStart` handler then stop 12618 + // if the location was changed by a `$locationChangeStart` handlers then stop
12619 // processing this location change 12619 // processing this location change
12620 if ($location.absUrl() !== newUrl) return; 12620 if ($location.absUrl() !== newUrl) return;
12621 12621
@@ -16308,7 +16308,7 @@ function $RootScopeProvider() { @@ -16308,7 +16308,7 @@ function $RootScopeProvider() {
16308 * unrolling of the loop. 16308 * unrolling of the loop.
16309 * 16309 *
16310 * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. 16310 * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
16311 - * Application code can register a `$destroy` event handler that will give it a chance to 16311 + * Application code can register a `$destroy` event handlers that will give it a chance to
16312 * perform any necessary cleanup. 16312 * perform any necessary cleanup.
16313 * 16313 *
16314 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to 16314 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
@@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) { @@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) {
20994 // action is not prevented. see #1238 20994 // action is not prevented. see #1238
20995 // 20995 //
20996 // IE 9 is not affected because it doesn't fire a submit event and try to do a full 20996 // IE 9 is not affected because it doesn't fire a submit event and try to do a full
20997 - // page reload if the form was destroyed by submission of the form via a click handler 20997 + // page reload if the form was destroyed by submission of the form via a click handlers
20998 // on a button in the form. Looks like an IE9 specific bug. 20998 // on a button in the form. Looks like an IE9 specific bug.
20999 var handleFormSubmission = function(event) { 20999 var handleFormSubmission = function(event) {
21000 scope.$apply(function() { 21000 scope.$apply(function() {
@@ -24084,7 +24084,7 @@ forEach( @@ -24084,7 +24084,7 @@ forEach(
24084 compile: function($element, attr) { 24084 compile: function($element, attr) {
24085 // We expose the powerful $event object on the scope that provides access to the Window, 24085 // We expose the powerful $event object on the scope that provides access to the Window,
24086 // etc. that isn't protected by the fast paths in $parse. We explicitly request better 24086 // etc. that isn't protected by the fast paths in $parse. We explicitly request better
24087 - // checks at the cost of speed since event handler expressions are not executed as 24087 + // checks at the cost of speed since event handlers expressions are not executed as
24088 // frequently as regular change detection. 24088 // frequently as regular change detection.
24089 var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true); 24089 var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);
24090 return function ngEventHandler(scope, element) { 24090 return function ngEventHandler(scope, element) {
@@ -25893,7 +25893,7 @@ var NgModelController = [&#39;$scope&#39;, &#39;$exceptionHandler&#39;, &#39;$attrs&#39;, &#39;$element&#39;, &#39;$ @@ -25893,7 +25893,7 @@ var NgModelController = [&#39;$scope&#39;, &#39;$exceptionHandler&#39;, &#39;$attrs&#39;, &#39;$element&#39;, &#39;$
25893 * Update the view value. 25893 * Update the view value.
25894 * 25894 *
25895 * This method should be called when a control wants to change the view value; typically, 25895 * This method should be called when a control wants to change the view value; typically,
25896 - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} 25896 + * this is done from within a DOM event handlers. For example, the {@link ng.directive:input input}
25897 * directive calls it when the value of the input changes and {@link ng.directive:select select} 25897 * directive calls it when the value of the input changes and {@link ng.directive:select select}
25898 * calls it when an option is selected. 25898 * calls it when an option is selected.
25899 * 25899 *
@@ -26909,7 +26909,7 @@ var ngOptionsDirective = [&#39;$compile&#39;, &#39;$parse&#39;, function($compile, $parse) { @@ -26909,7 +26909,7 @@ var ngOptionsDirective = [&#39;$compile&#39;, &#39;$parse&#39;, function($compile, $parse) {
26909 getWatchables: $parse(valuesFn, function(optionValues) { 26909 getWatchables: $parse(valuesFn, function(optionValues) {
26910 // Create a collection of things that we would like to watch (watchedArray) 26910 // Create a collection of things that we would like to watch (watchedArray)
26911 // so that they can all be watched using a single $watchCollection 26911 // so that they can all be watched using a single $watchCollection
26912 - // that only runs the handler once if anything changes 26912 + // that only runs the handlers once if anything changes
26913 var watchedArray = []; 26913 var watchedArray = [];
26914 optionValues = optionValues || []; 26914 optionValues = optionValues || [];
26915 26915
src/main/resources/static/assets/bower_components/handsontable/dist/handsontable.full.js
@@ -30159,7 +30159,7 @@ if (typeof exports !== &quot;undefined&quot;) { @@ -30159,7 +30159,7 @@ if (typeof exports !== &quot;undefined&quot;) {
30159 return typeof elements.length !== "number" ? [ elements ] : elements; 30159 return typeof elements.length !== "number" ? [ elements ] : elements;
30160 }; 30160 };
30161 /** 30161 /**
30162 - * Add a `mouseover` handler function for a clipped element. 30162 + * Add a `mouseover` handlers function for a clipped element.
30163 * 30163 *
30164 * @returns `undefined` 30164 * @returns `undefined`
30165 * @private 30165 * @private
@@ -30199,7 +30199,7 @@ if (typeof exports !== &quot;undefined&quot;) { @@ -30199,7 +30199,7 @@ if (typeof exports !== &quot;undefined&quot;) {
30199 }; 30199 };
30200 }; 30200 };
30201 /** 30201 /**
30202 - * Remove a `mouseover` handler function for a clipped element. 30202 + * Remove a `mouseover` handlers function for a clipped element.
30203 * 30203 *
30204 * @returns `undefined` 30204 * @returns `undefined`
30205 * @private 30205 * @private
@@ -30240,7 +30240,7 @@ if (typeof exports !== &quot;undefined&quot;) { @@ -30240,7 +30240,7 @@ if (typeof exports !== &quot;undefined&quot;) {
30240 return _clientOn.apply(this, _args(arguments)); 30240 return _clientOn.apply(this, _args(arguments));
30241 }; 30241 };
30242 /** 30242 /**
30243 - * Unregister an event handler from the client. 30243 + * Unregister an event handlers from the client.
30244 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. 30244 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
30245 * If no `eventType` is provided, it will unregister all handlers for every event type. 30245 * If no `eventType` is provided, it will unregister all handlers for every event type.
30246 * 30246 *
src/main/resources/static/assets/bower_components/handsontable/dist/zeroclipboard/ZeroClipboard.js
@@ -2353,7 +2353,7 @@ @@ -2353,7 +2353,7 @@
2353 return typeof elements.length !== "number" ? [ elements ] : elements; 2353 return typeof elements.length !== "number" ? [ elements ] : elements;
2354 }; 2354 };
2355 /** 2355 /**
2356 - * Add a `mouseover` handler function for a clipped element. 2356 + * Add a `mouseover` handlers function for a clipped element.
2357 * 2357 *
2358 * @returns `undefined` 2358 * @returns `undefined`
2359 * @private 2359 * @private
@@ -2393,7 +2393,7 @@ @@ -2393,7 +2393,7 @@
2393 }; 2393 };
2394 }; 2394 };
2395 /** 2395 /**
2396 - * Remove a `mouseover` handler function for a clipped element. 2396 + * Remove a `mouseover` handlers function for a clipped element.
2397 * 2397 *
2398 * @returns `undefined` 2398 * @returns `undefined`
2399 * @private 2399 * @private
@@ -2434,7 +2434,7 @@ @@ -2434,7 +2434,7 @@
2434 return _clientOn.apply(this, _args(arguments)); 2434 return _clientOn.apply(this, _args(arguments));
2435 }; 2435 };
2436 /** 2436 /**
2437 - * Unregister an event handler from the client. 2437 + * Unregister an event handlers from the client.
2438 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. 2438 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
2439 * If no `eventType` is provided, it will unregister all handlers for every event type. 2439 * If no `eventType` is provided, it will unregister all handlers for every event type.
2440 * 2440 *
src/main/resources/static/assets/bower_components/zeroclipboard/dist/ZeroClipboard.js
@@ -2488,7 +2488,7 @@ @@ -2488,7 +2488,7 @@
2488 return typeof elements.length !== "number" ? [ elements ] : elements; 2488 return typeof elements.length !== "number" ? [ elements ] : elements;
2489 }; 2489 };
2490 /** 2490 /**
2491 - * Add a `mouseover` handler function for a clipped element. 2491 + * Add a `mouseover` handlers function for a clipped element.
2492 * 2492 *
2493 * @returns `undefined` 2493 * @returns `undefined`
2494 * @private 2494 * @private
@@ -2528,7 +2528,7 @@ @@ -2528,7 +2528,7 @@
2528 }; 2528 };
2529 }; 2529 };
2530 /** 2530 /**
2531 - * Remove a `mouseover` handler function for a clipped element. 2531 + * Remove a `mouseover` handlers function for a clipped element.
2532 * 2532 *
2533 * @returns `undefined` 2533 * @returns `undefined`
2534 * @private 2534 * @private
@@ -2569,7 +2569,7 @@ @@ -2569,7 +2569,7 @@
2569 return _clientOn.apply(this, _args(arguments)); 2569 return _clientOn.apply(this, _args(arguments));
2570 }; 2570 };
2571 /** 2571 /**
2572 - * Unregister an event handler from the client. 2572 + * Unregister an event handlers from the client.
2573 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. 2573 * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`.
2574 * If no `eventType` is provided, it will unregister all handlers for every event type. 2574 * If no `eventType` is provided, it will unregister all handlers for every event type.
2575 * 2575 *
src/main/resources/static/assets/js/angular.js
@@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) { @@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) {
3067 // i.e. it will definitely not be in a $apply 3067 // i.e. it will definitely not be in a $apply
3068 win.setTimeout(action); 3068 win.setTimeout(action);
3069 } else { 3069 } else {
3070 - // No need to unbind this handler as load is only ever called once 3070 + // No need to unbind this handlers as load is only ever called once
3071 jqLite(win).on('load', action); 3071 jqLite(win).on('load', action);
3072 } 3072 }
3073 } 3073 }
@@ -3349,7 +3349,7 @@ function createEventHandler(element, events) { @@ -3349,7 +3349,7 @@ function createEventHandler(element, events) {
3349 return event.immediatePropagationStopped === true; 3349 return event.immediatePropagationStopped === true;
3350 }; 3350 };
3351 3351
3352 - // Some events have special handlers that wrap the real handler 3352 + // Some events have special handlers that wrap the real handlers
3353 var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; 3353 var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;
3354 3354
3355 // Copy event handlers in case event handlers array is modified during execution. 3355 // Copy event handlers in case event handlers array is modified during execution.
@@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) { @@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) {
3379 // Read about mouseenter and mouseleave: 3379 // Read about mouseenter and mouseleave:
3380 // http://www.quirksmode.org/js/events_mouse.html#link8 3380 // http://www.quirksmode.org/js/events_mouse.html#link8
3381 var related = event.relatedTarget; 3381 var related = event.relatedTarget;
3382 - // For mousenter/leave call the handler if related is outside the target. 3382 + // For mousenter/leave call the handlers if related is outside the target.
3383 // NB: No relatedTarget if the mouse left/entered the browser window 3383 // NB: No relatedTarget if the mouse left/entered the browser window
3384 if (!related || (related !== target && !jqLiteContains.call(target, related))) { 3384 if (!related || (related !== target && !jqLiteContains.call(target, related))) {
3385 handler.call(target, event); 3385 handler.call(target, event);
@@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) { @@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) {
5992 5992
5993 /** 5993 /**
5994 * @private 5994 * @private
5995 - * Remove popstate and hashchange handler from window. 5995 + * Remove popstate and hashchange handlers from window.
5996 * 5996 *
5997 * NOTE: this api is intended for use only by $rootScope. 5997 * NOTE: this api is intended for use only by $rootScope.
5998 */ 5998 */
@@ -12581,7 +12581,7 @@ function $LocationProvider() { @@ -12581,7 +12581,7 @@ function $LocationProvider() {
12581 defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, 12581 defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
12582 newState, oldState).defaultPrevented; 12582 newState, oldState).defaultPrevented;
12583 12583
12584 - // if the location was changed by a `$locationChangeStart` handler then stop 12584 + // if the location was changed by a `$locationChangeStart` handlers then stop
12585 // processing this location change 12585 // processing this location change
12586 if ($location.absUrl() !== newUrl) return; 12586 if ($location.absUrl() !== newUrl) return;
12587 12587
@@ -12615,7 +12615,7 @@ function $LocationProvider() { @@ -12615,7 +12615,7 @@ function $LocationProvider() {
12615 var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, 12615 var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
12616 $location.$$state, oldState).defaultPrevented; 12616 $location.$$state, oldState).defaultPrevented;
12617 12617
12618 - // if the location was changed by a `$locationChangeStart` handler then stop 12618 + // if the location was changed by a `$locationChangeStart` handlers then stop
12619 // processing this location change 12619 // processing this location change
12620 if ($location.absUrl() !== newUrl) return; 12620 if ($location.absUrl() !== newUrl) return;
12621 12621
@@ -16308,7 +16308,7 @@ function $RootScopeProvider() { @@ -16308,7 +16308,7 @@ function $RootScopeProvider() {
16308 * unrolling of the loop. 16308 * unrolling of the loop.
16309 * 16309 *
16310 * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. 16310 * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
16311 - * Application code can register a `$destroy` event handler that will give it a chance to 16311 + * Application code can register a `$destroy` event handlers that will give it a chance to
16312 * perform any necessary cleanup. 16312 * perform any necessary cleanup.
16313 * 16313 *
16314 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to 16314 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
@@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) { @@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) {
20994 // action is not prevented. see #1238 20994 // action is not prevented. see #1238
20995 // 20995 //
20996 // IE 9 is not affected because it doesn't fire a submit event and try to do a full 20996 // IE 9 is not affected because it doesn't fire a submit event and try to do a full
20997 - // page reload if the form was destroyed by submission of the form via a click handler 20997 + // page reload if the form was destroyed by submission of the form via a click handlers
20998 // on a button in the form. Looks like an IE9 specific bug. 20998 // on a button in the form. Looks like an IE9 specific bug.
20999 var handleFormSubmission = function(event) { 20999 var handleFormSubmission = function(event) {
21000 scope.$apply(function() { 21000 scope.$apply(function() {
@@ -24084,7 +24084,7 @@ forEach( @@ -24084,7 +24084,7 @@ forEach(
24084 compile: function($element, attr) { 24084 compile: function($element, attr) {
24085 // We expose the powerful $event object on the scope that provides access to the Window, 24085 // We expose the powerful $event object on the scope that provides access to the Window,
24086 // etc. that isn't protected by the fast paths in $parse. We explicitly request better 24086 // etc. that isn't protected by the fast paths in $parse. We explicitly request better
24087 - // checks at the cost of speed since event handler expressions are not executed as 24087 + // checks at the cost of speed since event handlers expressions are not executed as
24088 // frequently as regular change detection. 24088 // frequently as regular change detection.
24089 var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true); 24089 var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);
24090 return function ngEventHandler(scope, element) { 24090 return function ngEventHandler(scope, element) {
@@ -25893,7 +25893,7 @@ var NgModelController = [&#39;$scope&#39;, &#39;$exceptionHandler&#39;, &#39;$attrs&#39;, &#39;$element&#39;, &#39;$ @@ -25893,7 +25893,7 @@ var NgModelController = [&#39;$scope&#39;, &#39;$exceptionHandler&#39;, &#39;$attrs&#39;, &#39;$element&#39;, &#39;$
25893 * Update the view value. 25893 * Update the view value.
25894 * 25894 *
25895 * This method should be called when a control wants to change the view value; typically, 25895 * This method should be called when a control wants to change the view value; typically,
25896 - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} 25896 + * this is done from within a DOM event handlers. For example, the {@link ng.directive:input input}
25897 * directive calls it when the value of the input changes and {@link ng.directive:select select} 25897 * directive calls it when the value of the input changes and {@link ng.directive:select select}
25898 * calls it when an option is selected. 25898 * calls it when an option is selected.
25899 * 25899 *
@@ -26909,7 +26909,7 @@ var ngOptionsDirective = [&#39;$compile&#39;, &#39;$parse&#39;, function($compile, $parse) { @@ -26909,7 +26909,7 @@ var ngOptionsDirective = [&#39;$compile&#39;, &#39;$parse&#39;, function($compile, $parse) {
26909 getWatchables: $parse(valuesFn, function(optionValues) { 26909 getWatchables: $parse(valuesFn, function(optionValues) {
26910 // Create a collection of things that we would like to watch (watchedArray) 26910 // Create a collection of things that we would like to watch (watchedArray)
26911 // so that they can all be watched using a single $watchCollection 26911 // so that they can all be watched using a single $watchCollection
26912 - // that only runs the handler once if anything changes 26912 + // that only runs the handlers once if anything changes
26913 var watchedArray = []; 26913 var watchedArray = [];
26914 optionValues = optionValues || []; 26914 optionValues = optionValues || [];
26915 26915
src/main/resources/static/assets/js/baidu/TextIconOverlay.js
@@ -15,11 +15,11 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -15,11 +15,11 @@ var BMapLib = window.BMapLib = BMapLib || {};
15 15
16 (function () { 16 (function () {
17 17
18 - /**  
19 - * 声明baidu包  
20 - */ 18 + /**
  19 + * 声明baidu包
  20 + */
21 var T, 21 var T,
22 - baidu = T = baidu || {version: "1.3.8"}; 22 + baidu = T = baidu || {version: "1.3.8"};
23 23
24 (function (){ 24 (function (){
25 //提出guid,防止在与老版本Tangram混用时 25 //提出guid,防止在与老版本Tangram混用时
@@ -34,8 +34,8 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -34,8 +34,8 @@ var BMapLib = window.BMapLib = BMapLib || {};
34 * @ignore 34 * @ignore
35 * @namespace baidu.dom 操作dom的方法。 35 * @namespace baidu.dom 操作dom的方法。
36 */ 36 */
37 - baidu.dom = baidu.dom || {};  
38 - 37 + baidu.dom = baidu.dom || {};
  38 +
39 39
40 /** 40 /**
41 * 从文档中获取指定的DOM元素 41 * 从文档中获取指定的DOM元素
@@ -581,7 +581,7 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -581,7 +581,7 @@ var BMapLib = window.BMapLib = BMapLib || {};
581 581
582 /** 582 /**
583 * 注册对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。 583 * 注册对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。
584 - * @grammar obj.addEventListener(type, handler[, key]) 584 + * @grammar obj.addEventListener(type, handlers[, key])
585 * @param {string} type 自定义事件的名称 585 * @param {string} type 自定义事件的名称
586 * @param {Function} handler 自定义事件被触发时应该调用的回调函数 586 * @param {Function} handler 自定义事件被触发时应该调用的回调函数
587 * @param {string} [key] 为事件监听函数指定的名称,可在移除时使用。如果不提供,方法会默认为它生成一个全局唯一的key。 587 * @param {string} [key] 为事件监听函数指定的名称,可在移除时使用。如果不提供,方法会默认为它生成一个全局唯一的key。
@@ -613,7 +613,7 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -613,7 +613,7 @@ var BMapLib = window.BMapLib = BMapLib || {};
613 613
614 /** 614 /**
615 * 移除对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。 615 * 移除对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。
616 - * @grammar obj.removeEventListener(type, handler) 616 + * @grammar obj.removeEventListener(type, handlers)
617 * @param {string} type 事件类型 617 * @param {string} type 事件类型
618 * @param {Function|string} handler 要移除的事件监听函数或者监听函数的key 618 * @param {Function|string} handler 要移除的事件监听函数或者监听函数的key
619 * @remark 如果第二个参数handler没有被绑定到对应的自定义事件中,什么也不做。 619 * @remark 如果第二个参数handler没有被绑定到对应的自定义事件中,什么也不做。
@@ -704,23 +704,23 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -704,23 +704,23 @@ var BMapLib = window.BMapLib = BMapLib || {};
704 baidu.inherits = baidu.lang.inherits; 704 baidu.inherits = baidu.lang.inherits;
705 })(); 705 })();
706 706
707 -  
708 - /** 707 +
  708 + /**
709 709
710 - * 图片的路径 710 + * 图片的路径
711 711
712 * @private 712 * @private
713 - * @type {String} 713 + * @type {String}
714 714
715 */ 715 */
716 var _IMAGE_PATH = 'http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m'; 716 var _IMAGE_PATH = 'http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m';
717 717
718 - /** 718 + /**
719 719
720 - * 图片的后缀名 720 + * 图片的后缀名
721 721
722 * @private 722 * @private
723 - * @type {String} 723 + * @type {String}
724 724
725 */ 725 */
726 var _IMAGE_EXTENSION = 'png'; 726 var _IMAGE_EXTENSION = 'png';
@@ -930,72 +930,72 @@ var BMapLib = window.BMapLib = BMapLib || {}; @@ -930,72 +930,72 @@ var BMapLib = window.BMapLib = BMapLib || {};
930 }; 930 };
931 931
932 932
933 - /** 933 + /**
934 934
935 - * 当鼠标点击该覆盖物时会触发该事件 935 + * 当鼠标点击该覆盖物时会触发该事件
936 936
937 - * @name TextIconOverlay#click 937 + * @name TextIconOverlay#click
938 938
939 - * @event 939 + * @event
940 940
941 - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: 941 + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值:
942 942
943 - * <br />"<b>type</b> : {String} 事件类型 943 + * <br />"<b>type</b> : {String} 事件类型
944 944
945 - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 945 + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标
946 946
947 - * 947 + *
948 948
949 */ 949 */
950 950
951 - /** 951 + /**
952 952
953 - * 当鼠标进入该覆盖物区域时会触发该事件 953 + * 当鼠标进入该覆盖物区域时会触发该事件
954 954
955 - * @name TextIconOverlay#mouseover 955 + * @name TextIconOverlay#mouseover
956 956
957 * @event 957 * @event
958 - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: 958 + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值:
959 959
960 - * <br />"<b>type</b> : {String} 事件类型 960 + * <br />"<b>type</b> : {String} 事件类型
961 961
962 - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 962 + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标
963 963
964 - * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 964 + * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象
965 965
966 - * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 966 + * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象
967 967
968 - * 968 + *
969 969
970 - * @example <b>参考示例:</b><br /> 970 + * @example <b>参考示例:</b><br />
971 971
972 - * myTextIconOverlay.addEventListener("mouseover", function(e) { alert(e.point); }); 972 + * myTextIconOverlay.addEventListener("mouseover", function(e) { alert(e.point); });
973 973
974 */ 974 */
975 975
976 - /** 976 + /**
977 977
978 - * 当鼠标离开该覆盖物区域时会触发该事件 978 + * 当鼠标离开该覆盖物区域时会触发该事件
979 979
980 - * @name TextIconOverlay#mouseout 980 + * @name TextIconOverlay#mouseout
981 981
982 - * @event 982 + * @event
983 983
984 - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: 984 + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值:
985 985
986 - * <br />"<b>type</b> : {String} 事件类型 986 + * <br />"<b>type</b> : {String} 事件类型
987 987
988 - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 988 + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标
989 989
990 - * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 990 + * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象
991 991
992 - * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 992 + * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象
993 993
994 - * 994 + *
995 995
996 - * @example <b>参考示例:</b><br /> 996 + * @example <b>参考示例:</b><br />
997 997
998 - * myTextIconOverlay.addEventListener("mouseout", function(e) { alert(e.point); }); 998 + * myTextIconOverlay.addEventListener("mouseout", function(e) { alert(e.point); });
999 999
1000 */ 1000 */
1001 1001
src/main/resources/static/assets/js/eventproxy.js
@@ -326,7 +326,7 @@ @@ -326,7 +326,7 @@
326 EventProxy.prototype.assign = EventProxy.prototype.all; 326 EventProxy.prototype.assign = EventProxy.prototype.all;
327 327
328 /** 328 /**
329 - * Assign the only one 'error' event handler. 329 + * Assign the only one 'error' event handlers.
330 * @param {Function(err)} callback 330 * @param {Function(err)} callback
331 */ 331 */
332 EventProxy.prototype.fail = function (callback) { 332 EventProxy.prototype.fail = function (callback) {
@@ -334,7 +334,7 @@ @@ -334,7 +334,7 @@
334 334
335 that.once('error', function () { 335 that.once('error', function () {
336 that.unbind(); 336 that.unbind();
337 - // put all arguments to the error handler 337 + // put all arguments to the error handlers
338 // fail(function(err, args1, args2, ...){}) 338 // fail(function(err, args1, args2, ...){})
339 callback.apply(null, arguments); 339 callback.apply(null, arguments);
340 }); 340 });
@@ -444,7 +444,7 @@ @@ -444,7 +444,7 @@
444 that._after[group].index++; 444 that._after[group].index++;
445 return function (err, data) { 445 return function (err, data) {
446 if (err) { 446 if (err) {
447 - // put all arguments to the error handler 447 + // put all arguments to the error handlers
448 return that.emit.apply(that, ['error'].concat(SLICE.call(arguments))); 448 return that.emit.apply(that, ['error'].concat(SLICE.call(arguments)));
449 } 449 }
450 that.emit(group, { 450 that.emit(group, {
@@ -499,7 +499,7 @@ @@ -499,7 +499,7 @@
499 }; 499 };
500 500
501 /** 501 /**
502 - * Success callback wrapper, will handler err for you. 502 + * Success callback wrapper, will handlers err for you.
503 * 503 *
504 * ```js 504 * ```js
505 * fs.readFile('foo.txt', ep.done('content')); 505 * fs.readFile('foo.txt', ep.done('content'));
@@ -535,7 +535,7 @@ @@ -535,7 +535,7 @@
535 var that = this; 535 var that = this;
536 return function (err, data) { 536 return function (err, data) {
537 if (err) { 537 if (err) {
538 - // put all arguments to the error handler 538 + // put all arguments to the error handlers
539 return that.emit.apply(that, ['error'].concat(SLICE.call(arguments))); 539 return that.emit.apply(that, ['error'].concat(SLICE.call(arguments)));
540 } 540 }
541 541
@@ -552,7 +552,7 @@ @@ -552,7 +552,7 @@
552 // only replace the args when it really return a result 552 // only replace the args when it really return a result
553 return that.emit(handler, callback.apply(null, args)); 553 return that.emit(handler, callback.apply(null, args));
554 } else { 554 } else {
555 - // put all arguments to the done handler 555 + // put all arguments to the done handlers
556 //ep.done('some'); 556 //ep.done('some');
557 //ep.on('some', function(args1, args2, ...){}); 557 //ep.on('some', function(args1, args2, ...){});
558 return that.emit.apply(that, [handler].concat(args)); 558 return that.emit.apply(that, [handler].concat(args));
src/main/resources/static/assets/plugins/jquery.pjax.js
@@ -39,7 +39,7 @@ function fnPjax(selector, container, options) { @@ -39,7 +39,7 @@ function fnPjax(selector, container, options) {
39 }) 39 })
40 } 40 }
41 41
42 -// Public: pjax on click handler 42 +// Public: pjax on click handlers
43 // 43 //
44 // Exported as $.pjax.click. 44 // Exported as $.pjax.click.
45 // 45 //
@@ -100,7 +100,7 @@ function handleClick(event, container, options) { @@ -100,7 +100,7 @@ function handleClick(event, container, options) {
100 } 100 }
101 } 101 }
102 102
103 -// Public: pjax on form submit handler 103 +// Public: pjax on form submit handlers
104 // 104 //
105 // Exported as $.pjax.submit 105 // Exported as $.pjax.submit
106 // 106 //
@@ -422,7 +422,7 @@ if (&#39;state&#39; in window.history) { @@ -422,7 +422,7 @@ if (&#39;state&#39; in window.history) {
422 initialPop = false 422 initialPop = false
423 } 423 }
424 424
425 -// popstate handler takes care of the back and forward buttons 425 +// popstate handlers takes care of the back and forward buttons
426 // 426 //
427 // You probably shouldn't use pjax on pages with other pushState 427 // You probably shouldn't use pjax on pages with other pushState
428 // stuff yet. 428 // stuff yet.
src/main/resources/static/metronic_v4.5.4/layout4/scripts/demo.js
@@ -89,7 +89,7 @@ var Demo = function () { @@ -89,7 +89,7 @@ var Demo = function () {
89 } 89 }
90 90
91 if (lastSelectedLayout != layoutOption) { 91 if (lastSelectedLayout != layoutOption) {
92 - //layout changed, run responsive handler: 92 + //layout changed, run responsive handlers:
93 App.runResizeHandlers(); 93 App.runResizeHandlers();
94 } 94 }
95 lastSelectedLayout = layoutOption; 95 lastSelectedLayout = layoutOption;
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.js
@@ -94,7 +94,7 @@ Editableform is linked with one of input types, e.g. &#39;text&#39;, &#39;select&#39; etc. @@ -94,7 +94,7 @@ Editableform is linked with one of input types, e.g. &#39;text&#39;, &#39;select&#39; etc.
94 this.input.autosubmit(); 94 this.input.autosubmit();
95 } 95 }
96 96
97 - //attach 'cancel' handler 97 + //attach 'cancel' handlers
98 this.$form.find('.editable-cancel').click($.proxy(this.cancel, this)); 98 this.$form.find('.editable-cancel').click($.proxy(this.cancel, this));
99 99
100 if(this.input.error) { 100 if(this.input.error) {
@@ -109,7 +109,7 @@ Editableform is linked with one of input types, e.g. &#39;text&#39;, &#39;select&#39; etc. @@ -109,7 +109,7 @@ Editableform is linked with one of input types, e.g. &#39;text&#39;, &#39;select&#39; etc.
109 this.$form.find('.editable-submit').removeAttr('disabled'); 109 this.$form.find('.editable-submit').removeAttr('disabled');
110 var value = (this.value === null || this.value === undefined || this.value === '') ? this.options.defaultValue : this.value; 110 var value = (this.value === null || this.value === undefined || this.value === '') ? this.options.defaultValue : this.value;
111 this.input.value2input(value); 111 this.input.value2input(value);
112 - //attach submit handler 112 + //attach submit handlers
113 this.$form.submit($.proxy(this.submit, this)); 113 this.$form.submit($.proxy(this.submit, this));
114 } 114 }
115 115
@@ -917,7 +917,7 @@ Applied as jQuery method. @@ -917,7 +917,7 @@ Applied as jQuery method.
917 this.destroy(); 917 this.destroy();
918 }, this)); 918 }, this));
919 919
920 - //attach document handler to close containers on click / escape 920 + //attach document handlers to close containers on click / escape
921 if(!$(document).data('editable-handlers-attached')) { 921 if(!$(document).data('editable-handlers-attached')) {
922 //close all on escape 922 //close all on escape
923 $(document).on('keyup.editable', function (e) { 923 $(document).on('keyup.editable', function (e) {
@@ -1509,7 +1509,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. @@ -1509,7 +1509,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
1509 this.$element.addClass('editable-pre-wrapped'); 1509 this.$element.addClass('editable-pre-wrapped');
1510 } 1510 }
1511 1511
1512 - //attach handler activating editable. In disabled mode it just prevent default action (useful for links) 1512 + //attach handlers activating editable. In disabled mode it just prevent default action (useful for links)
1513 if(this.options.toggle !== 'manual') { 1513 if(this.options.toggle !== 'manual') {
1514 this.$element.addClass('editable-click'); 1514 this.$element.addClass('editable-click');
1515 this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){ 1515 this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){
@@ -1518,7 +1518,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. @@ -1518,7 +1518,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
1518 e.preventDefault(); 1518 e.preventDefault();
1519 } 1519 }
1520 1520
1521 - //stop propagation not required because in document click handler it checks event target 1521 + //stop propagation not required because in document click handlers it checks event target
1522 //e.stopPropagation(); 1522 //e.stopPropagation();
1523 1523
1524 if(this.options.toggle === 'mouseenter') { 1524 if(this.options.toggle === 'mouseenter') {
@@ -2103,7 +2103,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. @@ -2103,7 +2103,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
2103 /** 2103 /**
2104 How to toggle editable. Can be <code>click|dblclick|mouseenter|manual</code>. 2104 How to toggle editable. Can be <code>click|dblclick|mouseenter|manual</code>.
2105 When set to <code>manual</code> you should manually call <code>show/hide</code> methods of editable. 2105 When set to <code>manual</code> you should manually call <code>show/hide</code> methods of editable.
2106 - **Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handler of some DOM element, 2106 + **Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handlers of some DOM element,
2107 you need to apply <code>e.stopPropagation()</code> because containers are being closed on any click on document. 2107 you need to apply <code>e.stopPropagation()</code> because containers are being closed on any click on document.
2108 2108
2109 @example 2109 @example
@@ -2402,7 +2402,7 @@ To create your own input you can inherit from this class. @@ -2402,7 +2402,7 @@ To create your own input you can inherit from this class.
2402 }, 2402 },
2403 2403
2404 /** 2404 /**
2405 - attach handler to automatically submit form when value changed (useful when buttons not shown) 2405 + attach handlers to automatically submit form when value changed (useful when buttons not shown)
2406 **/ 2406 **/
2407 autosubmit: function() { 2407 autosubmit: function() {
2408 2408
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/inputs-ext/address/address.js
@@ -144,7 +144,7 @@ $(function(){ @@ -144,7 +144,7 @@ $(function(){
144 }, 144 },
145 145
146 /** 146 /**
147 - Attaches handler to submit form in case of 'showbuttons=false' mode 147 + Attaches handlers to submit form in case of 'showbuttons=false' mode
148 148
149 @method autosubmit() 149 @method autosubmit()
150 **/ 150 **/
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysihtml5-0.3.0.js
@@ -8056,7 +8056,7 @@ wysihtml5.views.View = Base.extend( @@ -8056,7 +8056,7 @@ wysihtml5.views.View = Base.extend(
8056 this.element.innerHTML = this.textarea.getValue(true); 8056 this.element.innerHTML = this.textarea.getValue(true);
8057 this.enable(); 8057 this.enable();
8058 8058
8059 - // Make sure our selection handler is ready 8059 + // Make sure our selection handlers is ready
8060 this.selection = new wysihtml5.Selection(this.parent); 8060 this.selection = new wysihtml5.Selection(this.parent);
8061 8061
8062 // Make sure commands dispatcher is ready 8062 // Make sure commands dispatcher is ready
@@ -8469,7 +8469,7 @@ wysihtml5.views.View = Base.extend( @@ -8469,7 +8469,7 @@ wysihtml5.views.View = Base.extend(
8469 dom.observe(focusBlurElement, "focus", function() { 8469 dom.observe(focusBlurElement, "focus", function() {
8470 that.parent.fire("focus").fire("focus:composer"); 8470 that.parent.fire("focus").fire("focus:composer");
8471 8471
8472 - // Delay storing of state until all focus handler are fired 8472 + // Delay storing of state until all focus handlers are fired
8473 // especially the one which resets the placeholder 8473 // especially the one which resets the placeholder
8474 setTimeout(function() { state = that.getValue(); }, 0); 8474 setTimeout(function() { state = that.getValue(); }, 0);
8475 }); 8475 });
src/main/resources/static/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.js
@@ -536,7 +536,7 @@ $.extend( $.validator, { @@ -536,7 +536,7 @@ $.extend( $.validator, {
536 $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) 536 $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [])
537 .filter( ":visible" ) 537 .filter( ":visible" )
538 .focus() 538 .focus()
539 - // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find 539 + // manually trigger focusin event; without it, focusin handlers isn't called, findLastActive won't have anything to find
540 .trigger( "focusin" ); 540 .trigger( "focusin" );
541 } catch ( e ) { 541 } catch ( e ) {
542 // ignore IE throwing errors when focusing hidden elements 542 // ignore IE throwing errors when focusing hidden elements
src/main/resources/static/metronic_v4.5.4/plugins/jstree/dist/jstree.js
@@ -4945,7 +4945,7 @@ @@ -4945,7 +4945,7 @@
4945 if(this.settings.checkbox.cascade.indexOf('up') !== -1) { 4945 if(this.settings.checkbox.cascade.indexOf('up') !== -1) {
4946 this.element 4946 this.element
4947 .on('delete_node.jstree', $.proxy(function (e, data) { 4947 .on('delete_node.jstree', $.proxy(function (e, data) {
4948 - // apply up (whole handler) 4948 + // apply up (whole handlers)
4949 var p = this.get_node(data.parent), 4949 var p = this.get_node(data.parent),
4950 m = this._model.data, 4950 m = this._model.data,
4951 i, j, c, tmp, t = this.settings.checkbox.tie_selection; 4951 i, j, c, tmp, t = this.settings.checkbox.tie_selection;
@@ -4969,7 +4969,7 @@ @@ -4969,7 +4969,7 @@
4969 } 4969 }
4970 }, this)) 4970 }, this))
4971 .on('move_node.jstree', $.proxy(function (e, data) { 4971 .on('move_node.jstree', $.proxy(function (e, data) {
4972 - // apply up (whole handler) 4972 + // apply up (whole handlers)
4973 var is_multi = data.is_multi, 4973 var is_multi = data.is_multi,
4974 old_par = data.old_parent, 4974 old_par = data.old_parent,
4975 new_par = this.get_node(data.parent), 4975 new_par = this.get_node(data.parent),
src/main/resources/static/metronic_v4.5.4/plugins/select2/js/select2.full.js
@@ -392,7 +392,7 @@ var requirejs, require, define; @@ -392,7 +392,7 @@ var requirejs, require, define;
392 //Support require(['a']) 392 //Support require(['a'])
393 callback = callback || function () {}; 393 callback = callback || function () {};
394 394
395 - //If relName is a function, it is an errback handler, 395 + //If relName is a function, it is an errback handlers,
396 //so remove it. 396 //so remove it.
397 if (typeof relName === 'function') { 397 if (typeof relName === 'function') {
398 relName = forceSync; 398 relName = forceSync;
src/main/resources/static/metronic_v4.5.4/plugins/select2/js/select2.js
@@ -392,7 +392,7 @@ var requirejs, require, define; @@ -392,7 +392,7 @@ var requirejs, require, define;
392 //Support require(['a']) 392 //Support require(['a'])
393 callback = callback || function () {}; 393 callback = callback || function () {};
394 394
395 - //If relName is a function, it is an errback handler, 395 + //If relName is a function, it is an errback handlers,
396 //so remove it. 396 //so remove it.
397 if (typeof relName === 'function') { 397 if (typeof relName === 'function') {
398 relName = forceSync; 398 relName = forceSync;
src/main/resources/static/pages/control/lineConfig/config.html
@@ -108,7 +108,7 @@ butto.line-config-btn{ @@ -108,7 +108,7 @@ butto.line-config-btn{
108 font-size: 85%; 108 font-size: 85%;
109 } 109 }
110 110
111 -butto.line-config-btn:HOVER{ 111 +button.line-config-btn:HOVER{
112 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); 112 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
113 border-color: rgba(0, 0, 0, 0.3); 113 border-color: rgba(0, 0, 0, 0.3);
114 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95); 114 box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12), inset 0 1px 2px rgba(255, 255, 255, 0.95);
@@ -116,7 +116,7 @@ butto.line-config-btn:HOVER{ @@ -116,7 +116,7 @@ butto.line-config-btn:HOVER{
116 } 116 }
117 117
118 118
119 -butto.line-config-btn:active{ 119 +button.line-config-btn:active{
120 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0); 120 background-image: -webkit-linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);
121 border-color: #5b5bec; 121 border-color: #5b5bec;
122 box-shadow: 0 1px 0 rgba(91, 91, 236, 0.32), inset 0 1px 2px rgba(91, 91, 236, 0.32); 122 box-shadow: 0 1px 0 rgba(91, 91, 236, 0.32), inset 0 1px 2px rgba(91, 91, 236, 0.32);
@@ -212,7 +212,11 @@ butto.line-config-btn:active{ @@ -212,7 +212,11 @@ butto.line-config-btn:active{
212 </section> 212 </section>
213 213
214 <section> 214 <section>
215 - <h3>班次进出场时间</h3> 215 + <h3>班次进出场
  216 +{{if conf.outConfig == 2}}
  217 +(“出站既出场” 只影响<a href="/pages/base/lineinformation/list.html?no={{conf.line.id}}" target="_blank" style="color: grey;margin: 0 2px;">线路标准</a>内配置的停车场发出的班次)
  218 +{{/if}}
  219 + </h3>
216 220
217 <div class="settings-row" > 221 <div class="settings-row" >
218 <p > 使用 <a href="javascript:;" data-type="select" id="outTimeType"></a> 时间作为出场班次的实际时间。</p> 222 <p > 使用 <a href="javascript:;" data-type="select" id="outTimeType"></a> 时间作为出场班次的实际时间。</p>
@@ -273,18 +277,19 @@ butto.line-config-btn:active{ @@ -273,18 +277,19 @@ butto.line-config-btn:active{
273 } 277 }
274 278
275 function defaultConfig(lineCode, name){ 279 function defaultConfig(lineCode, name){
276 - layer.confirm('没有找到['+html_encode(name)+']的配置信息,系统将生成默认配置?', {  
277 - btn : [ '我同意' ],  
278 - icon : 3,  
279 - shift: 5,  
280 - closeBtn: 0  
281 - }, function(){  
282 - showLoad('生成中...');  
283 - $.post('/lineConfig/init/' + lineCode, function(rs){  
284 - if(rs == 1)  
285 - showConfDetail();  
286 - });  
287 - }); 280 + $body.html('无配置信息');
  281 +// layer.confirm('没有找到['+html_encode(name)+']的配置信息,系统将生成默认配置?', {
  282 +// btn : [ '我同意' ],
  283 +// icon : 3,
  284 +// shift: 5,
  285 +// closeBtn: 0
  286 +// }, function(){
  287 +// showLoad('生成中...');
  288 +// $.post('/lineConfig/init/' + lineCode, function(rs){
  289 +// if(rs == 1)
  290 +// showConfDetail();
  291 +// });
  292 +// });
288 } 293 }
289 294
290 function showLoad(text){ 295 function showLoad(text){
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/busInterval.html
@@ -31,40 +31,47 @@ @@ -31,40 +31,47 @@
31 <form id="history" class="form-inline" action=""> 31 <form id="history" class="form-inline" action="">
32 <div style="display: inline-block; margin-left: 33px;" id="company1"> 32 <div style="display: inline-block; margin-left: 33px;" id="company1">
33 <span class="item-label" style="width: 80px;">公司: </span> 33 <span class="item-label" style="width: 80px;">公司: </span>
34 - <select class="form-control" name="company" id="company" style="width: 180px;"></select> 34 + <select class="form-control" name="company" id="company" style="width: 140px;"></select>
35 </div> 35 </div>
36 <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> 36 <div style="display: inline-block; margin-left: 24px;" id="subCompany1">
37 <span class="item-label" style="width: 80px;">分公司: </span> 37 <span class="item-label" style="width: 80px;">分公司: </span>
38 - <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> 38 + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
39 </div> 39 </div>
40 - <div style="display: inline-block; margin-left: 24px;"> 40 + <div style="display: inline-block; margin-left: 10px;">
41 <span class="item-label" style="width: 80px;">线路: </span> 41 <span class="item-label" style="width: 80px;">线路: </span>
42 - <select class="form-control" name="line" id="line" style="width: 180px;"></select> 42 + <select class="form-control" name="statu" id="statu" style="width: 140px;">
  43 + <option value="0">多线</option>
  44 + <option value="1">单线</option>
  45 + </select>
  46 + </div>
  47 + <div style="display: inline-block; margin-left: 0px;" id="line1">
  48 + <span class="item-label" style="width: 80px;"> - </span>
  49 + <select class="form-control" name="line" id="line" style="width: 140px;"/>
43 </div> 50 </div>
44 <div style="display: inline-block; margin-left: 10px"> 51 <div style="display: inline-block; margin-left: 10px">
45 <span class="item-label" style="width: 80px;">时刻类型: </span> 52 <span class="item-label" style="width: 80px;">时刻类型: </span>
46 - <select class="form-control" name="model" id="model" style="width: 180px;"> 53 + <select class="form-control" name="model" id="model" style="width: 165px;">
47 <option value="">请选择...</option> 54 <option value="">请选择...</option>
48 </select> 55 </select>
49 </div> 56 </div>
50 <div style="margin-top: 10px"></div> 57 <div style="margin-top: 10px"></div>
51 <div style="display: inline-block;margin-left: 5px;"> 58 <div style="display: inline-block;margin-left: 5px;">
52 <span class="item-label" style="width: 80px;">开始时间: </span> 59 <span class="item-label" style="width: 80px;">开始时间: </span>
53 - <input class="form-control" type="text" id="startDate" style="width: 180px;"/> 60 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
54 </div> 61 </div>
55 <div style="display: inline-block;margin-left: 10px;"> 62 <div style="display: inline-block;margin-left: 10px;">
56 <span class="item-label" style="width: 80px;">结束时间: </span> 63 <span class="item-label" style="width: 80px;">结束时间: </span>
57 - <input class="form-control" type="text" id="endDate" style="width: 180px;"/> 64 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
58 </div> 65 </div>
59 - <div style="display: inline-block;margin-left: 10px;">  
60 - <span class="item-label" style="width: 80px;">时间段: </span>  
61 - <input class="form-control" type="text" id="times1" style="width: 80px;"/>  
62 - </div>  
63 - <div style="display: inline-block;">  
64 - <span class="item-label" style="width: 80px;"> - </span>  
65 - <input class="form-control" type="text" id="times2" style="width: 80px;"/>  
66 - </div>  
67 - <div class="form-group" style="margin-left: 10px"> 66 +<!-- <div style="display: inline-block;margin-left: 10px;"> -->
  67 +<!-- <span class="item-label" style="width: 80px;">时间段: </span> -->
  68 +<!-- <input class="form-control" type="text" id="times1" style="width: 80px;"/> -->
  69 +<!-- </div> -->
  70 +<!-- <div style="display: inline-block;"> -->
  71 +<!-- <span class="item-label" style="width: 80px;"> - </span> -->
  72 +<!-- <input class="form-control" type="text" id="times2" style="width: 80px;"/> -->
  73 +<!-- </div> -->
  74 + <div class="form-group" style="margin-left: 14px">
68 <input class="btn btn-default" type="button" id="query" value="筛选"/> 75 <input class="btn btn-default" type="button" id="query" value="筛选"/>
69 <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> 76 <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
70 </div> 77 </div>
@@ -74,17 +81,7 @@ @@ -74,17 +81,7 @@
74 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 81 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
75 <table class="table table-bordered table-hover table-checkable" id="forms"> 82 <table class="table table-bordered table-hover table-checkable" id="forms">
76 <thead> 83 <thead>
77 - <tr class="hidden">  
78 - <th>日期</th>  
79 - <th>时段</th>  
80 - <th>公司</th>  
81 - <th>分公司</th>  
82 - <th>线路</th>  
83 - <th>起讫站</th>  
84 - <th>计划车距(分钟)</th>  
85 - <th>实际车距(分钟)</th>  
86 - <th>误差值</th>  
87 - </tr> 84 +
88 </thead> 85 </thead>
89 <tbody> 86 <tbody>
90 87
@@ -115,14 +112,14 @@ @@ -115,14 +112,14 @@
115 locale : 'zh-cn' 112 locale : 'zh-cn'
116 }); 113 });
117 114
118 - $("#times1").datetimepicker({  
119 - format : 'HH:mm',  
120 - locale : 'zh-cn'  
121 - });  
122 - $("#times2").datetimepicker({  
123 - format : 'HH:mm',  
124 - locale : 'zh-cn'  
125 - }); 115 +// $("#times1").datetimepicker({
  116 +// format : 'HH:mm',
  117 +// locale : 'zh-cn'
  118 +// });
  119 +// $("#times2").datetimepicker({
  120 +// format : 'HH:mm',
  121 +// locale : 'zh-cn'
  122 +// });
126 123
127 var d = new Date(); 124 var d = new Date();
128 var year = d.getFullYear(); 125 var year = d.getFullYear();
@@ -135,8 +132,8 @@ @@ -135,8 +132,8 @@
135 $("#startDate").val(year + "-" + month + "-" + day); 132 $("#startDate").val(year + "-" + month + "-" + day);
136 $("#endDate").val(year + "-" + month + "-" + day); 133 $("#endDate").val(year + "-" + month + "-" + day);
137 134
138 - $("#times1").val("06:00");  
139 - $("#times2").val("07:00"); 135 +// $("#times1").val("06:00");
  136 +// $("#times2").val("07:00");
140 137
141 var obj = []; 138 var obj = [];
142 $.get('/user/companyData', function(result){ 139 $.get('/user/companyData', function(result){
@@ -170,14 +167,15 @@ @@ -170,14 +167,15 @@
170 167
171 $.get('/basic/lineCode2Name',function(result){ 168 $.get('/basic/lineCode2Name',function(result){
172 var data=[]; 169 var data=[];
173 - data.push({id:" ", text:"全部线路"}); 170 +// data.push({id:" ", text:"全部线路"});
174 for(var code in result){ 171 for(var code in result){
175 data.push({id: code, text: result[code]}); 172 data.push({id: code, text: result[code]});
176 } 173 }
177 console.log(data); 174 console.log(data);
178 initPinYinSelect2('#line',data,''); 175 initPinYinSelect2('#line',data,'');
179 176
180 - line = ""; 177 +// line = "";
  178 + line = data[0].id;
181 updateModel(); 179 updateModel();
182 }) 180 })
183 181
@@ -223,10 +221,11 @@ @@ -223,10 +221,11 @@
223 $("#query").on("click",jsDoQuery); 221 $("#query").on("click",jsDoQuery);
224 222
225 var line = $("#line").val(); 223 var line = $("#line").val();
  224 + var statu = $("#statu").val();
226 var startDate = $("#startDate").val(); 225 var startDate = $("#startDate").val();
227 var endDate = $("#endDate").val(); 226 var endDate = $("#endDate").val();
228 var model = $("#model").val(); 227 var model = $("#model").val();
229 - var times = $("#times1").val() + "-" + $("#times2").val(); 228 +// var times = $("#times1").val() + "-" + $("#times2").val();
230 var company = $("#company").val(); 229 var company = $("#company").val();
231 var subCompany = $("#subCompany").val(); 230 var subCompany = $("#subCompany").val();
232 function jsDoQuery(pagination){ 231 function jsDoQuery(pagination){
@@ -235,23 +234,24 @@ @@ -235,23 +234,24 @@
235 startDate = $("#startDate").val(); 234 startDate = $("#startDate").val();
236 endDate = $("#endDate").val(); 235 endDate = $("#endDate").val();
237 model = $("#model").val(); 236 model = $("#model").val();
238 - times = $("#times1").val() + "-" + $("#times2").val(); 237 +// times = $("#times1").val() + "-" + $("#times2").val();
239 company = $("#company").val(); 238 company = $("#company").val();
240 subCompany = $("#subCompany").val(); 239 subCompany = $("#subCompany").val();
241 params['line'] = line; 240 params['line'] = line;
  241 + params['statu'] = statu;
242 params['startDate'] = startDate; 242 params['startDate'] = startDate;
243 params['endDate'] = endDate; 243 params['endDate'] = endDate;
244 params['model'] = model; 244 params['model'] = model;
245 - params['times'] = times; 245 +// params['times'] = times;
246 params['company'] = company; 246 params['company'] = company;
247 params['subCompany'] = subCompany; 247 params['subCompany'] = subCompany;
248 params['type'] = "query"; 248 params['type'] = "query";
249 - $(".hidden").removeClass("hidden"); 249 +// $(".hidden").removeClass("hidden");
250 $get('/busInterval/interval', params, function(result){ 250 $get('/busInterval/interval', params, function(result){
251 // 把数据填充到模版中 251 // 把数据填充到模版中
252 - var tbodyHtml = template('list_workDaily',{list:result}); 252 + var tbodyHtml = template('list_workDaily',{list:result,statu:statu});
253 // 把渲染好的模版html文本追加到表格中 253 // 把渲染好的模版html文本追加到表格中
254 - $('#forms tbody').html(tbodyHtml); 254 + $('#forms').html(tbodyHtml);
255 _w_table_rowspan("#forms tbody", 1); 255 _w_table_rowspan("#forms tbody", 1);
256 _w_table_rowspan("#forms tbody", 2); 256 _w_table_rowspan("#forms tbody", 2);
257 _w_table_rowspan("#forms tbody", 3); 257 _w_table_rowspan("#forms tbody", 3);
@@ -266,12 +266,25 @@ @@ -266,12 +266,25 @@
266 // window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); 266 // window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
267 // }); 267 // });
268 // }); 268 // });
269 -  
270 - 269 +
  270 +
  271 + $("#lp1").hide();
  272 + $("#line1").hide();
  273 + $("#statu").on("change", function(){
  274 + statu = $("#statu").val();
  275 + if(statu == 0){
  276 + $("#line1").hide();
  277 + $("#lp1").hide();
  278 + }else{
  279 + $("#line1").show();
  280 + $("#lp1").show();
  281 + }
  282 + updateModel();
  283 + });
271 $("#line").on("change", function(){ 284 $("#line").on("change", function(){
272 line = $("#line").val(); 285 line = $("#line").val();
273 - if(line == " ")  
274 - line = ""; 286 +// if(line == " ")
  287 +// line = "";
275 updateModel(); 288 updateModel();
276 }); 289 });
277 $('#startDate').on("blur", function(){ 290 $('#startDate').on("blur", function(){
@@ -292,7 +305,10 @@ @@ -292,7 +305,10 @@
292 flag = 1; 305 flag = 1;
293 var treeData = []; 306 var treeData = [];
294 var params = {}; 307 var params = {};
295 - params['line'] = line; 308 + if(statu == 0)
  309 + params['line'] = "";
  310 + if(statu == 1)
  311 + params['line'] = line;
296 params['startDate'] = startDate; 312 params['startDate'] = startDate;
297 params['endDate'] = endDate; 313 params['endDate'] = endDate;
298 $get('/pcpc/getModel', params, function(result){ 314 $get('/pcpc/getModel', params, function(result){
@@ -335,22 +351,45 @@ @@ -335,22 +351,45 @@
335 351
336 </script> 352 </script>
337 <script type="text/html" id="list_workDaily"> 353 <script type="text/html" id="list_workDaily">
  354 +<thead>
  355 + <tr>
  356 + <th>日期</th>
  357 + <th>公司</th>
  358 + <th>分公司</th>
  359 + <th>线路</th>
  360 + {{if statu == 1}}
  361 + <th>时段</th>
  362 + {{/if}}
  363 + <th>起讫站</th>
  364 + <th>计划车距(分钟)</th>
  365 + <th>实际车距(分钟)</th>
  366 + <th>最大车距(分钟)</th>
  367 + <th>最小车距(分钟)</th>
  368 + <th>误差值</th>
  369 + </tr>
  370 +</thead>
  371 +<tbody>
338 {{each list as obj i}} 372 {{each list as obj i}}
339 <tr> 373 <tr>
340 - <td style='text-align:center;vertical-align:middle;'>{{obj.date}}</td>  
341 - <td style='text-align:center;vertical-align:middle;'>{{obj.times}}</td> 374 + <td style='text-align:center;vertical-align:middle;' width='80px'>{{obj.date}}</td>
342 <td style='text-align:center;vertical-align:middle;'>{{obj.company}}</td> 375 <td style='text-align:center;vertical-align:middle;'>{{obj.company}}</td>
343 <td style='text-align:center;vertical-align:middle;'>{{obj.subCompany}}</td> 376 <td style='text-align:center;vertical-align:middle;'>{{obj.subCompany}}</td>
344 <td style='text-align:center;vertical-align:middle;'>{{obj.line}}</td> 377 <td style='text-align:center;vertical-align:middle;'>{{obj.line}}</td>
  378 + {{if statu == 1}}
  379 + <td style='text-align:center;vertical-align:middle;'>{{obj.times}}</td>
  380 + {{/if}}
345 <td>{{obj.qdz}}</td> 381 <td>{{obj.qdz}}</td>
346 <td>{{obj.jhInterval}}</td> 382 <td>{{obj.jhInterval}}</td>
347 <td>{{obj.sjInterval}}</td> 383 <td>{{obj.sjInterval}}</td>
  384 + <td>{{obj.MaxInterval}}</td>
  385 + <td>{{obj.MinInterval}}</td>
348 <td>{{obj.deviation}}</td> 386 <td>{{obj.deviation}}</td>
349 </tr> 387 </tr>
350 {{/each}} 388 {{/each}}
351 {{if list.length == 0}} 389 {{if list.length == 0}}
352 <tr> 390 <tr>
353 - <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> 391 + <td colspan="11"><h6 class="muted">没有找到相关数据</h6></td>
354 </tr> 392 </tr>
355 {{/if}} 393 {{/if}}
  394 +</tbody>
356 </script> 395 </script>
357 \ No newline at end of file 396 \ No newline at end of file
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -97,6 +97,7 @@ @@ -97,6 +97,7 @@
97 97
98 <script> 98 <script>
99 $(function(){ 99 $(function(){
  100 + $('#export').attr('disabled', "true");
100 101
101 // 关闭左侧栏 102 // 关闭左侧栏
102 if (!$('body').hasClass('page-sidebar-closed')) 103 if (!$('body').hasClass('page-sidebar-closed'))
@@ -186,11 +187,22 @@ @@ -186,11 +187,22 @@
186 // 把渲染好的模版html文本追加到表格中 187 // 把渲染好的模版html文本追加到表格中
187 $('#forms tbody').html(tbodyHtml); 188 $('#forms tbody').html(tbodyHtml);
188 189
  190 + if(result.length == 0)
  191 + $("#export").attr('disabled',"true");
  192 + else
  193 + $("#export").removeAttr("disabled");
189 }); 194 });
190 } 195 }
191 196
192 $("#export").on("click",function(){ 197 $("#export").on("click",function(){
193 - $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){ 198 + var params = {};
  199 + params['company'] = company;
  200 + params['subCompany'] = subCompany;
  201 + params['line'] = line;
  202 + params['line'] = line;
  203 + params['date'] = date;
  204 + params['type'] = "export";
  205 + $get('/pcpc/firstAndLastBus', params, function(result){
194 window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); 206 window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
195 }); 207 });
196 }); 208 });
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
@@ -121,7 +121,7 @@ @@ -121,7 +121,7 @@
121 <th rowspan="2">日期</th> 121 <th rowspan="2">日期</th>
122 <th colspan="4">到达时间</th> 122 <th colspan="4">到达时间</th>
123 <th colspan="4">发车时间</th> 123 <th colspan="4">发车时间</th>
124 - <th colspan="2">误点率</th> 124 + <th rowspan="2">误点分钟</th>
125 <th colspan="5">运送时间</th> 125 <th colspan="5">运送时间</th>
126 <th colspan="5">停站时间</th> 126 <th colspan="5">停站时间</th>
127 </tr> 127 </tr>
@@ -134,8 +134,6 @@ @@ -134,8 +134,6 @@
134 <th>实际</th> 134 <th>实际</th>
135 <th>平均提前</th> 135 <th>平均提前</th>
136 <th>平均延误</th> 136 <th>平均延误</th>
137 - <th>快</th>  
138 - <th>慢</th>  
139 <th>计划</th> 137 <th>计划</th>
140 <th>实际</th> 138 <th>实际</th>
141 <th>最快</th> 139 <th>最快</th>
@@ -419,8 +417,7 @@ @@ -419,8 +417,7 @@
419 <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc1}}</td> 417 <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc1}}</td>
420 <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc2}}</td> 418 <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc2}}</td>
421 {{/if}} 419 {{/if}}
422 - <td>{{obj.kbc}}</td>  
423 - <td>{{obj.mbc}}</td> 420 + <td class="merge">{{obj.wdfz}}</td>
424 <td>{{obj.jhys}}</td> 421 <td>{{obj.jhys}}</td>
425 <td>{{obj.sjys}}</td> 422 <td>{{obj.sjys}}</td>
426 <td>{{obj.yssjMin}}</td> 423 <td>{{obj.yssjMin}}</td>
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -80,6 +80,7 @@ @@ -80,6 +80,7 @@
80 80
81 <script> 81 <script>
82 $(function(){ 82 $(function(){
  83 + $('#export').attr('disabled', "true");
83 84
84 // 关闭左侧栏 85 // 关闭左侧栏
85 if (!$('body').hasClass('page-sidebar-closed')) 86 if (!$('body').hasClass('page-sidebar-closed'))
@@ -168,11 +169,21 @@ @@ -168,11 +169,21 @@
168 // 把渲染好的模版html文本追加到表格中 169 // 把渲染好的模版html文本追加到表格中
169 $('#forms tbody').html(tbodyHtml); 170 $('#forms tbody').html(tbodyHtml);
170 171
  172 + if(result.length == 0)
  173 + $("#export").attr('disabled',"true");
  174 + else
  175 + $("#export").removeAttr("disabled");
171 }); 176 });
172 } 177 }
173 178
174 $("#export").on("click",function(){ 179 $("#export").on("click",function(){
175 - $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){ 180 + var params = {};
  181 + params['company'] = company;
  182 + params['subCompany'] = subCompany;
  183 + params['line'] = line;
  184 + params['date'] = date;
  185 + params['type'] = "export";
  186 + $get('/pcpc/queryPeopleCar', params, function(result){
176 window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD")); 187 window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD"));
177 }); 188 });
178 }); 189 });
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -65,18 +65,21 @@ @@ -65,18 +65,21 @@
65 <table class="table table-bordered table-hover table-checkable" id="forms"> 65 <table class="table table-bordered table-hover table-checkable" id="forms">
66 <thead> 66 <thead>
67 <tr class="hidden"> 67 <tr class="hidden">
68 - <th width="10%">线路</th>  
69 - <th width="10%">起点站名</th>  
70 - <th width="8%">计发时间</th>  
71 - <th width="8%">计划运送时间(分)</th>  
72 - <th width="8%">计划完成次数</th>  
73 - <th width="8%">完成次数</th>  
74 - <th width="8%">最早发车时间</th>  
75 - <th width="8%">最晚发车时间</th>  
76 - <th width="8%">平均发车时间</th>  
77 - <th width="8%">最慢运送时间(分)</th>  
78 - <th width="8%">最快运送时间(分)</th>  
79 - <th width="8%">平均运送时间(分)</th> 68 + <th style="display: none;"></th>
  69 + <th width="8%">公司</th>
  70 + <th width="8%">分公司</th>
  71 + <th width="8%">线路</th>
  72 + <th width="8%">起点站名</th>
  73 + <th width="6%">计发时间</th>
  74 + <th width="6%">计划运送时间(分)</th>
  75 + <th width="6%">计划完成次数</th>
  76 + <th width="6%">完成次数</th>
  77 + <th width="6%">最早发车时间</th>
  78 + <th width="6%">最晚发车时间</th>
  79 + <th width="6%">平均发车时间</th>
  80 + <th width="6%">最慢运送时间(分)</th>
  81 + <th width="6%">最快运送时间(分)</th>
  82 + <th width="6%">平均运送时间(分)</th>
80 </tr> 83 </tr>
81 </thead> 84 </thead>
82 <tbody> 85 <tbody>
@@ -95,6 +98,7 @@ @@ -95,6 +98,7 @@
95 <script> 98 <script>
96 $(function(){ 99 $(function(){
97 var page = 0, initPagination; 100 var page = 0, initPagination;
  101 + $('#export').attr('disabled', "true");
98 102
99 // 关闭左侧栏 103 // 关闭左侧栏
100 if (!$('body').hasClass('page-sidebar-closed')) 104 if (!$('body').hasClass('page-sidebar-closed'))
@@ -200,6 +204,11 @@ @@ -200,6 +204,11 @@
200 // 把渲染好的模版html文本追加到表格中 204 // 把渲染好的模版html文本追加到表格中
201 $('#forms tbody').html(tbodyHtml); 205 $('#forms tbody').html(tbodyHtml);
202 206
  207 + if(result.dataList.length == 0)
  208 + $("#export").attr('disabled',"true");
  209 + else
  210 + $("#export").removeAttr("disabled");
  211 +
203 if(pagination && result.dataList.length > 0){ 212 if(pagination && result.dataList.length > 0){
204 //重新分页 213 //重新分页
205 initPagination = true; 214 initPagination = true;
@@ -213,7 +222,16 @@ @@ -213,7 +222,16 @@
213 } 222 }
214 223
215 $("#export").on("click",function(){ 224 $("#export").on("click",function(){
216 - $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){ 225 + var params = {};
  226 + params['page'] = page;
  227 + params['line'] = line;
  228 + params['startDate'] = startDate;
  229 + params['endDate'] = endDate;
  230 + params['model'] = model;
  231 + params['company'] = company;
  232 + params['subCompany'] = subCompany;
  233 + params['type'] = "export";
  234 + $get('/pcpc/scheduleAnaly', params, function(result){
217 window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); 235 window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
218 }); 236 });
219 }); 237 });
@@ -289,6 +307,9 @@ @@ -289,6 +307,9 @@
289 <script type="text/html" id="list_scheduleAnaly"> 307 <script type="text/html" id="list_scheduleAnaly">
290 {{each list as obj i}} 308 {{each list as obj i}}
291 <tr> 309 <tr>
  310 + <th style="display: none;"></th>
  311 + <td>{{obj.company}}</td>
  312 + <td>{{obj.subCompany}}</td>
292 <td>{{obj.line}}</td> 313 <td>{{obj.line}}</td>
293 <td>{{obj.qdz}}</td> 314 <td>{{obj.qdz}}</td>
294 <td>{{obj.jhfc}}</td> 315 <td>{{obj.jhfc}}</td>
@@ -305,7 +326,7 @@ @@ -305,7 +326,7 @@
305 {{/each}} 326 {{/each}}
306 {{if list.length == 0}} 327 {{if list.length == 0}}
307 <tr> 328 <tr>
308 - <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> 329 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
309 </tr> 330 </tr>
310 {{/if}} 331 {{/if}}
311 </script> 332 </script>
312 \ No newline at end of file 333 \ No newline at end of file
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
@@ -16,6 +16,13 @@ @@ -16,6 +16,13 @@
16 #forms > tbody > tr{ 16 #forms > tbody > tr{
17 background-color: #FFFFFF; 17 background-color: #FFFFFF;
18 } 18 }
  19 + #works > tbody > tr{
  20 + background-color: #FFFFFF;
  21 + }
  22 + tbody > tr > td{
  23 + text-align: center;
  24 + vertical-align: middle;
  25 + }
19 </style> 26 </style>
20 27
21 <div class="page-head"> 28 <div class="page-head">
@@ -37,16 +44,23 @@ @@ -37,16 +44,23 @@
37 <span class="item-label" style="width: 80px;">分公司: </span> 44 <span class="item-label" style="width: 80px;">分公司: </span>
38 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> 45 <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
39 </div> 46 </div>
40 - <div style="display: inline-block; margin-left: 24px;"> 47 + <div style="display: inline-block; margin-left: 10px;">
41 <span class="item-label" style="width: 80px;">线路: </span> 48 <span class="item-label" style="width: 80px;">线路: </span>
42 - <select class="form-control" name="line" id="line" style="width: 140px;"></select>  
43 - </div>  
44 - <div style="display: inline-block; margin-left: 8px;">  
45 - <span class="item-label" style="width: 80px;">方向: </span>  
46 - <select class="form-control" name="upDown" id="upDown" style="width: 140px;">  
47 - <option value="">请先选择线路</option> 49 + <select class="form-control" name="statu" id="statu" style="width: 140px;">
  50 + <option value="0">多线</option>
  51 + <option value="1">单线</option>
48 </select> 52 </select>
49 </div> 53 </div>
  54 + <div style="display: inline-block; margin-left: 0px;" id="line1">
  55 + <span class="item-label" style="width: 80px;"> - </span>
  56 + <select class="form-control" name="line" id="line" style="width: 140px;"/>
  57 + </div>
  58 +<!-- <div style="display: inline-block; margin-left: 8px;"> -->
  59 +<!-- <span class="item-label" style="width: 80px;">方向: </span> -->
  60 +<!-- <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> -->
  61 +<!-- <option value="">请先选择线路</option> -->
  62 +<!-- </select> -->
  63 +<!-- </div> -->
50 <div style="display: inline-block; margin-left: 10px"> 64 <div style="display: inline-block; margin-left: 10px">
51 <span class="item-label" style="width: 80px;">时刻类型: </span> 65 <span class="item-label" style="width: 80px;">时刻类型: </span>
52 <select class="form-control" name="model" id="model" style="width: 165px;"> 66 <select class="form-control" name="model" id="model" style="width: 165px;">
@@ -62,15 +76,11 @@ @@ -62,15 +76,11 @@
62 <span class="item-label" style="width: 80px;">结束时间: </span> 76 <span class="item-label" style="width: 80px;">结束时间: </span>
63 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 77 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
64 </div> 78 </div>
65 - <div style="display: inline-block; margin-left: 10px;">  
66 - <span class="item-label" style="width: 80px;">时间段: </span>  
67 - <input class="form-control" type="text" id="times1" style="width: 60px;"/> 79 + <div style="display: inline-block; margin-left: 10px" id="lp1">
  80 + <span class="item-label" style="width: 80px;">路牌: </span>
  81 + <select class="form-control" name="lp" id="lp" style="width: 140px;"></select>
68 </div> 82 </div>
69 - <div style="display: inline-block;">  
70 - <span class="item-label" style="width: 80px;"> - </span>  
71 - <input class="form-control" type="text" id="times2" style="width: 60px;"/>  
72 - </div>  
73 - <div class="form-group" style="margin-left: 10px"> 83 + <div class="form-group" style="margin-left: 14px">
74 <input class="btn btn-default" type="button" id="query" value="筛选"/> 84 <input class="btn btn-default" type="button" id="query" value="筛选"/>
75 <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> 85 <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
76 </div> 86 </div>
@@ -79,26 +89,20 @@ @@ -79,26 +89,20 @@
79 <div class="portlet-body"> 89 <div class="portlet-body">
80 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 90 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
81 <table class="table table-bordered table-hover table-checkable" id="forms"> 91 <table class="table table-bordered table-hover table-checkable" id="forms">
82 - <thead>  
83 - <tr class="hidden">  
84 - <th>日期</th>  
85 - <th>时段</th>  
86 - <th>公司</th>  
87 - <th>分公司</th>  
88 - <th>线路</th>  
89 - <th>路牌</th>  
90 - <th>起讫站</th>  
91 - <th>行驶方向</th>  
92 - <th>营运时间(小时/分钟)</th>  
93 - <th>营运车速(公里/小时)</th>  
94 - <th>运送时间(小时/分钟)</th>  
95 - <th>运送车速(公里/小时)</th>  
96 - </tr>  
97 - </thead>  
98 - <tbody>  
99 -  
100 - </tbody>  
101 </table> 92 </table>
  93 + <div id="works_hidden" class="hidden">
  94 + <span class="item-label" style="width: 80px;margin-left: 20px;">明细: </span>
  95 + <span class="item-label" style="width: 80px;margin-left: 60px;">日期: </span>
  96 + <span class="item-label" style="width: 80px;" id="date0"></span>
  97 + <span class="item-label" style="width: 80px;margin-left: 60px;">公司: </span>
  98 + <span class="item-label" style="width: 80px;" id="company0"></span>
  99 + <span class="item-label" style="width: 80px;margin-left: 60px;">分公司: </span>
  100 + <span class="item-label" style="width: 80px;" id="subCompany0"></span>
  101 + <span class="item-label" style="width: 80px;margin-left: 60px;">线路: </span>
  102 + <span class="item-label" style="width: 80px;" id="line0"></span>
  103 + <table class="table table-bordered table-hover table-checkable" id="works">
  104 + </table>
  105 + </div>
102 <div style="text-align: right;"> 106 <div style="text-align: right;">
103 <ul id="pagination" class="pagination"></ul> 107 <ul id="pagination" class="pagination"></ul>
104 </div> 108 </div>
@@ -110,7 +114,7 @@ @@ -110,7 +114,7 @@
110 114
111 <script> 115 <script>
112 $(function(){ 116 $(function(){
113 - 117 +
114 // 关闭左侧栏 118 // 关闭左侧栏
115 if (!$('body').hasClass('page-sidebar-closed')) 119 if (!$('body').hasClass('page-sidebar-closed'))
116 $('.menu-toggler.sidebar-toggler').click(); 120 $('.menu-toggler.sidebar-toggler').click();
@@ -123,15 +127,7 @@ @@ -123,15 +127,7 @@
123 format : 'YYYY-MM-DD', 127 format : 'YYYY-MM-DD',
124 locale : 'zh-cn' 128 locale : 'zh-cn'
125 }); 129 });
126 - $("#times1").datetimepicker({  
127 - format : 'HH:mm',  
128 - locale : 'zh-cn'  
129 - });  
130 - $("#times2").datetimepicker({  
131 - format : 'HH:mm',  
132 - locale : 'zh-cn'  
133 - });  
134 - 130 +
135 var d = new Date(); 131 var d = new Date();
136 var year = d.getFullYear(); 132 var year = d.getFullYear();
137 var month = d.getMonth() + 1; 133 var month = d.getMonth() + 1;
@@ -142,10 +138,7 @@ @@ -142,10 +138,7 @@
142 day = "0" + day; 138 day = "0" + day;
143 $("#startDate").val(year + "-" + month + "-" + day); 139 $("#startDate").val(year + "-" + month + "-" + day);
144 $("#endDate").val(year + "-" + month + "-" + day); 140 $("#endDate").val(year + "-" + month + "-" + day);
145 -  
146 - $("#times1").val("06:00");  
147 - $("#times2").val("07:00");  
148 - 141 +
149 var obj = []; 142 var obj = [];
150 $.get('/user/companyData', function(result){ 143 $.get('/user/companyData', function(result){
151 obj = result; 144 obj = result;
@@ -179,71 +172,83 @@ @@ -179,71 +172,83 @@
179 $.get('/basic/lineCode2Name',function(result){ 172 $.get('/basic/lineCode2Name',function(result){
180 var data=[]; 173 var data=[];
181 174
182 - data.push({id: " ", text: "全部线路"});  
183 for(var code in result){ 175 for(var code in result){
184 data.push({id: code, text: result[code]}); 176 data.push({id: code, text: result[code]});
185 } 177 }
186 console.log(data); 178 console.log(data);
187 initPinYinSelect2('#line',data,''); 179 initPinYinSelect2('#line',data,'');
188 180
189 - line = "";  
190 - updateModel(); 181 + line = data[0].id;
191 182
192 - var params = {};  
193 - params['line'] = line;  
194 - $get('/busInterval/getDir', params, function(result){  
195 - dirData = createTreeData(result);  
196 - var options = '<option value="">全部方向</option>';;  
197 - $.each(dirData, function(i, g){  
198 - options += '<option value="'+g.name+'">'+g.name+'</option>';  
199 - });  
200 - $('#upDown').html(options);  
201 - }); 183 + updateModel();
  184 + updateLp("");
202 }) 185 })
203 186
204 $("#query").on("click", function (){ 187 $("#query").on("click", function (){
205 jsDoQuery(); 188 jsDoQuery();
206 }); 189 });
207 - 190 +
  191 + var list = [];
208 var line = $("#line").val(); 192 var line = $("#line").val();
  193 + var statu = $("#statu").val();
209 var startDate = $("#startDate").val(); 194 var startDate = $("#startDate").val();
210 var endDate = $("#endDate").val(); 195 var endDate = $("#endDate").val();
211 var model = $("#model").val(); 196 var model = $("#model").val();
212 - var times = $("#times1").val() + "-" + $("#times2").val();  
213 - var upDown = $("#upDown").val();  
214 var company = $("#company").val(); 197 var company = $("#company").val();
215 var subCompany = $("#subCompany").val(); 198 var subCompany = $("#subCompany").val();
  199 + var lp = $("#lp").val();
216 function jsDoQuery(pagination){ 200 function jsDoQuery(pagination){
217 var params = {}; 201 var params = {};
218 -// line = $("#line").val(); 202 + line = $("#line").val();
219 startDate = $("#startDate").val(); 203 startDate = $("#startDate").val();
220 endDate = $("#endDate").val(); 204 endDate = $("#endDate").val();
221 model = $("#model").val(); 205 model = $("#model").val();
222 - times = $("#times1").val() + "-" + $("#times2").val();  
223 - upDown = $("#upDown").val();  
224 company = $("#company").val(); 206 company = $("#company").val();
225 subCompany = $("#subCompany").val(); 207 subCompany = $("#subCompany").val();
  208 + lp = $("#lp").val();
  209 + params['lp'] = lp;
226 params['line'] = line; 210 params['line'] = line;
  211 + params['statu'] = statu;
227 params['startDate'] = startDate; 212 params['startDate'] = startDate;
228 params['endDate'] = endDate; 213 params['endDate'] = endDate;
229 params['model'] = model; 214 params['model'] = model;
230 - params['times'] = times;  
231 - params['upDown'] = upDown;  
232 params['company'] = company; 215 params['company'] = company;
233 params['subCompany'] = subCompany; 216 params['subCompany'] = subCompany;
234 params['type'] = "query"; 217 params['type'] = "query";
235 - $(".hidden").removeClass("hidden"); 218 +// $(".hidden").removeClass("hidden");
236 $get('/busInterval/timeAndSpeed', params, function(result){ 219 $get('/busInterval/timeAndSpeed', params, function(result){
237 // 把数据填充到模版中 220 // 把数据填充到模版中
238 - var tbodyHtml = template('list_timeAndSpeed',{list:result}); 221 + var tbodyHtml = template('list_timeAndSpeed', {list:result});
239 // 把渲染好的模版html文本追加到表格中 222 // 把渲染好的模版html文本追加到表格中
240 - $('#forms tbody').html(tbodyHtml);  
241 - _w_table_rowspan("#forms tbody", 1);  
242 - _w_table_rowspan("#forms tbody", 2);  
243 - _w_table_rowspan("#forms tbody", 3);  
244 - _w_table_rowspan("#forms tbody", 4);  
245 - _w_table_rowspan("#forms tbody", 5);  
246 - 223 + $('#forms').html(tbodyHtml);
  224 + list = result;
  225 + $("#works_hidden").addClass("hidden");
  226 +
  227 + _w_table_rowspan("#forms", 1);
  228 + _w_table_rowspan("#forms", 2);
  229 + _w_table_rowspan("#forms", 3);
  230 + _w_table_rowspan("#forms", 4);
  231 +
  232 + if(result.statu == 0)
  233 + $("#forms tbody").on("click", "a", function(){
  234 + var key = $(this).parent().prev().html();
  235 + $.each(list.dataList, function(i, g){
  236 + if(g.line == key){
  237 + var tbodyHtml = template('list_workList',{list:g});
  238 + $("#works_hidden").removeClass("hidden");
  239 + $("#date0").html(g.date);
  240 + $("#line0").html(g.line);
  241 + $("#company0").html(g.company);
  242 + $("#subCompany0").html(g.subCompany);
  243 + $("#works").html(tbodyHtml);
  244 +
  245 + _w_table_rowspan("#works", 1);
  246 + _w_table_rowspan("#works", 2);
  247 + _w_table_rowspan("#works", 3);
  248 + _w_table_rowspan("#works", 4);
  249 + }
  250 + });
  251 + });
247 }); 252 });
248 } 253 }
249 254
@@ -254,21 +259,28 @@ @@ -254,21 +259,28 @@
254 // }); 259 // });
255 260
256 261
  262 + $("#lp1").hide();
  263 + $("#line1").hide();
  264 + $("#statu").on("change", function(){
  265 + statu = $("#statu").val();
  266 + if(statu == 0){
  267 + $("#line1").hide();
  268 + $("#lp1").hide();
  269 + }else{
  270 + $("#line1").show();
  271 + $("#lp1").show();
  272 + updateLp("");
  273 + }
  274 + updateModel();
  275 + });
257 $("#line").on("change", function(){ 276 $("#line").on("change", function(){
258 line = $("#line").val(); 277 line = $("#line").val();
259 - if(line == " ")  
260 - line = "";  
261 updateModel(); 278 updateModel();
262 - var params = {};  
263 - params['line'] = line;  
264 - $get('/busInterval/getDir', params, function(result){  
265 - dirData = createTreeData(result);  
266 - var options = '<option value="">全部方向</option>';  
267 - $.each(dirData, function(i, g){  
268 - options += '<option value="'+g.name+'">'+g.name+'</option>';  
269 - });  
270 - $('#upDown').html(options);  
271 - }); 279 + updateLp("");
  280 + });
  281 + $("#model").on("change", function(){
  282 + model = $("#model").val();
  283 + updateLp(model);
272 }); 284 });
273 $('#startDate').on("blur", function(){ 285 $('#startDate').on("blur", function(){
274 startDate = $("#startDate").val(); 286 startDate = $("#startDate").val();
@@ -288,7 +300,10 @@ @@ -288,7 +300,10 @@
288 flag = 1; 300 flag = 1;
289 var treeData = []; 301 var treeData = [];
290 var params = {}; 302 var params = {};
291 - params['line'] = line; 303 + if(statu == 0)
  304 + params['line'] = "";
  305 + if(statu == 1)
  306 + params['line'] = line;
292 params['startDate'] = startDate; 307 params['startDate'] = startDate;
293 params['endDate'] = endDate; 308 params['endDate'] = endDate;
294 $get('/pcpc/getModel', params, function(result){ 309 $get('/pcpc/getModel', params, function(result){
@@ -297,11 +312,26 @@ @@ -297,11 +312,26 @@
297 $.each(treeData, function(i, g){ 312 $.each(treeData, function(i, g){
298 options += '<option value="'+g.id+'">'+g.name+'</option>'; 313 options += '<option value="'+g.id+'">'+g.name+'</option>';
299 }); 314 });
300 - $('#model').html(options)/* .select2() */; 315 + $('#model').html(options);
301 flag = 0; 316 flag = 0;
302 }); 317 });
303 } 318 }
304 319
  320 + function updateLp(ttId){
  321 + var treeData = [];
  322 + var params = {};
  323 + params['line'] = line;
  324 + params['ttId'] = ttId;
  325 + $get('/busInterval/getLp', params, function(result){
  326 + treeData = createTreeData(result);
  327 + var options = '<option value="">全部路牌</option>';
  328 + $.each(treeData, function(i, g){
  329 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  330 + options += '<option value="'+g.name+'">'+g.name+'</option>';
  331 + });
  332 + $('#lp').html(options);
  333 + });
  334 + }
305 335
306 function _w_table_rowspan(_w_table_id, _w_table_colnum){ 336 function _w_table_rowspan(_w_table_id, _w_table_colnum){
307 _w_table_firsttd = ""; 337 _w_table_firsttd = "";
@@ -330,35 +360,118 @@ @@ -330,35 +360,118 @@
330 }); 360 });
331 361
332 </script> 362 </script>
  363 +
333 <script type="text/html" id="list_timeAndSpeed"> 364 <script type="text/html" id="list_timeAndSpeed">
334 - {{each list.dateList as obj i}} 365 +<thead>
  366 + <tr>
  367 + <th width='80px'>日期</th>
  368 + <th style='text-align:center;'>公司</th>
  369 + <th style='text-align:center;'>分公司</th>
  370 + <th style='text-align:center;'>线路</th>
  371 + {{if list.statu == 0}}<th style='text-align:center;'>路牌数</th>{{/if}}
  372 + {{if list.statu == 1}}<th style='text-align:center;'>路牌</th>{{/if}}
  373 + <th>计划营运时间(小时)</th>
  374 + <th>计划营运车速(公里/小时)</th>
  375 + <th>实际营运时间(小时)</th>
  376 + <th>实际营运车速(公里/小时)</th>
  377 + <th>计划运送时间(小时)</th>
  378 + <th>计划运送车速(公里/小时)</th>
  379 + <th>实际运送时间(小时)</th>
  380 + <th>实际运送车速(公里/小时)</th>
  381 + </tr>
  382 +</thead>
  383 +<tbody>
  384 + {{each list.dataList as obj i}}
  385 + <tr>
  386 + <td style='vertical-align:middle;'>{{obj.date}}</td>
  387 + <td style='vertical-align:middle;'>{{obj.company}}</td>
  388 + <td style='vertical-align:middle;'>{{obj.subCompany}}</td>
  389 + <td style='vertical-align:middle;'>{{obj.line}}</td>
  390 + {{if list.statu == 0}}<td><a>{{obj.lp}}</a></td>{{/if}}
  391 + {{if list.statu == 1}}<td>{{obj.lp}}</td>{{/if}}
  392 + <td>{{obj.jhyysj}}</td>
  393 + <td>{{obj.jhyycs}}</td>
  394 + <td>{{obj.sjyysj}}</td>
  395 + <td>{{obj.sjyycs}}</td>
  396 + <td>{{obj.jhyssj}}</td>
  397 + <td>{{obj.jhyscs}}</td>
  398 + <td>{{obj.sjyssj}}</td>
  399 + <td>{{obj.sjyscs}}</td>
  400 + </tr>
  401 + {{/each}}
  402 + {{if list.dataList.length > 1}}
  403 + <tr>
  404 + <td style='vertical-align:middle;' colspan='5'>合计平均值</td>
  405 + <td>{{list.jhyysj}}</td>
  406 + <td>{{list.jhyycs}}</td>
  407 + <td>{{list.sjyysj}}</td>
  408 + <td>{{list.sjyycs}}</td>
  409 + <td>{{list.jhyssj}}</td>
  410 + <td>{{list.jhyscs}}</td>
  411 + <td>{{list.sjyssj}}</td>
  412 + <td>{{list.sjyscs}}</td>
  413 + </tr>
  414 + {{/if}}
  415 + {{if list.dataList.length == 0}}
  416 + <tr>
  417 + <td colspan="13"><h6 class="muted">没有找到相关数据</h6></td>
  418 + </tr>
  419 + {{/if}}
  420 +</tbody>
  421 +</script>
  422 +<script type="text/html" id="list_workList">
  423 +<thead>
  424 + <tr>
  425 + <th width='80px'>日期</th>
  426 + <th style='text-align:center;'>公司</th>
  427 + <th style='text-align:center;'>分公司</th>
  428 + <th style='text-align:center;'>线路</th>
  429 + <th style='text-align:center;'>路牌</th>
  430 + <th>计划营运时间(小时)</th>
  431 + <th>计划营运车速(公里/小时)</th>
  432 + <th>实际营运时间(小时)</th>
  433 + <th>实际营运车速(公里/小时)</th>
  434 + <th>计划运送时间(小时)</th>
  435 + <th>计划运送车速(公里/小时)</th>
  436 + <th>实际运送时间(小时)</th>
  437 + <th>实际运送车速(公里/小时)</th>
  438 + </tr>
  439 +</thead>
  440 +<tbody>
  441 + {{each list.work as obj i}}
335 <tr> 442 <tr>
336 - <td style='text-align:center;vertical-align:middle;'>{{obj.date}}</td>  
337 - <td style='text-align:center;vertical-align:middle;'>{{obj.times}}</td>  
338 - <td style='text-align:center;vertical-align:middle;'>{{obj.company}}</td>  
339 - <td style='text-align:center;vertical-align:middle;'>{{obj.subCompany}}</td>  
340 - <td style='text-align:center;vertical-align:middle;'>{{obj.line}}</td> 443 + <td style='vertical-align:middle;'>{{obj.date}}</td>
  444 + <td style='vertical-align:middle;'>{{obj.company}}</td>
  445 + <td style='vertical-align:middle;'>{{obj.subCompany}}</td>
  446 + <td style='vertical-align:middle;'>{{obj.line}}</td>
341 <td>{{obj.lp}}</td> 447 <td>{{obj.lp}}</td>
342 - <td>{{obj.qdz_zdz}}</td>  
343 - <td>{{obj.zdz}}</td>  
344 - <td>{{obj.yysj}}</td>  
345 - <td>{{obj.yysd}}</td>  
346 - <td>{{obj.yssj}}</td>  
347 - <td>{{obj.yssd}}</td> 448 + <td>{{obj.jhyysj}}</td>
  449 + <td>{{obj.jhyycs}}</td>
  450 + <td>{{obj.sjyysj}}</td>
  451 + <td>{{obj.sjyycs}}</td>
  452 + <td>{{obj.jhyssj}}</td>
  453 + <td>{{obj.jhyscs}}</td>
  454 + <td>{{obj.sjyssj}}</td>
  455 + <td>{{obj.sjyscs}}</td>
348 </tr> 456 </tr>
349 {{/each}} 457 {{/each}}
350 - {{if list.dateList.length != 0}} 458 + {{if list.work.length > 1}}
351 <tr> 459 <tr>
352 - <td colspan="8">汇总平均</td>  
353 - <td>{{list.yysj}}</td>  
354 - <td>{{list.yysd}}</td>  
355 - <td>{{list.yssj}}</td>  
356 - <td>{{list.yssd}}</td> 460 + <td style='vertical-align:middle;' colspan='5'>合计平均值</td>
  461 + <td>{{list.jhyysj}}</td>
  462 + <td>{{list.jhyycs}}</td>
  463 + <td>{{list.sjyysj}}</td>
  464 + <td>{{list.sjyycs}}</td>
  465 + <td>{{list.jhyssj}}</td>
  466 + <td>{{list.jhyscs}}</td>
  467 + <td>{{list.sjyssj}}</td>
  468 + <td>{{list.sjyscs}}</td>
357 </tr> 469 </tr>
358 {{/if}} 470 {{/if}}
359 - {{if list.dateList.length == 0}} 471 + {{if list.work.length == 0}}
360 <tr> 472 <tr>
361 - <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> 473 + <td colspan="13"><h6 class="muted">没有找到相关数据</h6></td>
362 </tr> 474 </tr>
363 {{/if}} 475 {{/if}}
  476 +</tbody>
364 </script> 477 </script>
365 \ No newline at end of file 478 \ No newline at end of file
src/main/resources/static/pages/forms/statement/workDaily.html
@@ -55,11 +55,13 @@ @@ -55,11 +55,13 @@
55 <thead> 55 <thead>
56 <tr class="hidden"> 56 <tr class="hidden">
57 <th width="80px">日期</th> 57 <th width="80px">日期</th>
58 - <th width="100px">线路</th> 58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
59 <th>计划班次</th> 61 <th>计划班次</th>
60 <th>待发调整</th> 62 <th>待发调整</th>
61 - <th>待发调整比率</th>  
62 - <th>出场率</th> 63 + <th width="60px">待发调整比率</th>
  64 + <th width="60px">出场率</th>
63 <th width="46px">上行发快</th> 65 <th width="46px">上行发快</th>
64 <th width="46px">上行到快</th> 66 <th width="46px">上行到快</th>
65 <th width="46px">下行发快</th> 67 <th width="46px">下行发快</th>
@@ -68,9 +70,9 @@ @@ -68,9 +70,9 @@
68 <th width="46px">上行到慢</th> 70 <th width="46px">上行到慢</th>
69 <th width="46px">下行发慢</th> 71 <th width="46px">下行发慢</th>
70 <th width="46px">下行到慢</th> 72 <th width="46px">下行到慢</th>
71 - <th>误点总数(快/慢)</th>  
72 - <th>首末班准点率</th>  
73 - <th>高峰班次执行率(早/晚)</th> 73 + <th width="75px">误点总数(快/慢)</th>
  74 + <th width="100px">首末班准点率</th>
  75 + <th width="100px">高峰班次执行率(早/晚)</th>
74 </tr> 76 </tr>
75 </thead> 77 </thead>
76 <tbody> 78 <tbody>
@@ -88,6 +90,7 @@ @@ -88,6 +90,7 @@
88 90
89 <script> 91 <script>
90 $(function(){ 92 $(function(){
  93 + $('#export').attr('disabled', "true");
91 94
92 // 关闭左侧栏 95 // 关闭左侧栏
93 if (!$('body').hasClass('page-sidebar-closed')) 96 if (!$('body').hasClass('page-sidebar-closed'))
@@ -176,11 +179,21 @@ @@ -176,11 +179,21 @@
176 // 把渲染好的模版html文本追加到表格中 179 // 把渲染好的模版html文本追加到表格中
177 $('#forms tbody').html(tbodyHtml); 180 $('#forms tbody').html(tbodyHtml);
178 181
  182 + if(result.length == 0)
  183 + $("#export").attr('disabled',"true");
  184 + else
  185 + $("#export").removeAttr("disabled");
179 }); 186 });
180 } 187 }
181 188
182 $("#export").on("click",function(){ 189 $("#export").on("click",function(){
183 - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ 190 + var params = {};
  191 + params['line'] = line;
  192 + params['date'] = date;
  193 + params['type'] = "export";
  194 + params['company'] = company;
  195 + params['subCompany'] = subCompany;
  196 + $get('/pcpc/workDaily', params, function(result){
184 window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); 197 window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
185 }); 198 });
186 }); 199 });
@@ -193,6 +206,8 @@ @@ -193,6 +206,8 @@
193 {{each list as obj i}} 206 {{each list as obj i}}
194 <tr> 207 <tr>
195 <td>{{obj.date}}</td> 208 <td>{{obj.date}}</td>
  209 + <td>{{obj.company}}</td>
  210 + <td>{{obj.subCompany}}</td>
196 <td>{{obj.line}}</td> 211 <td>{{obj.line}}</td>
197 <td>{{obj.jhbc}}</td> 212 <td>{{obj.jhbc}}</td>
198 <td>{{obj.dftz}}</td> 213 <td>{{obj.dftz}}</td>
@@ -213,7 +228,7 @@ @@ -213,7 +228,7 @@
213 {{/each}} 228 {{/each}}
214 {{if list.length == 0}} 229 {{if list.length == 0}}
215 <tr> 230 <tr>
216 - <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td> 231 + <td colspan="19"><h6 class="muted">没有找到相关数据</h6></td>
217 </tr> 232 </tr>
218 {{/if}} 233 {{/if}}
219 </script> 234 </script>
220 \ No newline at end of file 235 \ No newline at end of file
src/main/resources/static/pages/mapmonitor/real/js/playBack.js
@@ -269,7 +269,7 @@ var playBack = (function() { @@ -269,7 +269,7 @@ var playBack = (function() {
269 269
270 if(defaultLine){ 270 if(defaultLine){
271 layer.msg('加载线路图层数据...', {icon: 16, time: 0,shade:0.3}); 271 layer.msg('加载线路图层数据...', {icon: 16, time: 0,shade:0.3});
272 - $.get('/realSchedule/findRouteByLine', {lineCode: defaultLine} 272 + $.get('/realMap/findRouteByLine', {lineCode: defaultLine}
273 ,function(route){ 273 ,function(route){
274 lineRoute = route; 274 lineRoute = route;
275 iMap.call('drawLine', {route: lineRoute}); 275 iMap.call('drawLine', {route: lineRoute});
src/main/resources/static/pages/forms/statement/allline.html renamed to src/main/resources/static/pages/mforms/alllines/allline.html
src/main/resources/static/pages/forms/statement/changetochange.html renamed to src/main/resources/static/pages/mforms/changetochanges/changetochange.html
src/main/resources/static/pages/forms/statement/executionrate.html renamed to src/main/resources/static/pages/mforms/executionrates/executionrate.html
src/main/resources/static/pages/forms/statement/linepassengerflow.html renamed to src/main/resources/static/pages/mforms/linepassengerflows/linepassengerflow.html
src/main/resources/static/pages/forms/statement/operationservice.html renamed to src/main/resources/static/pages/mforms/operationservices/operationservice.html
src/main/resources/static/pages/forms/statement/shifday.html renamed to src/main/resources/static/pages/mforms/shifdays/shifday.html
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html renamed to src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
src/main/resources/static/pages/forms/statement/singledata.html renamed to src/main/resources/static/pages/mforms/singledatas/singledata.html
src/main/resources/static/pages/forms/statement/turnoutrate.html renamed to src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
src/main/resources/static/pages/forms/statement/vehicleloading.html renamed to src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
src/main/resources/static/pages/forms/statement/waybillday.html renamed to src/main/resources/static/pages/mforms/waybilldays/waybillday.html
src/main/resources/static/pages/report/message/message.html
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 18
19 <div class="page-head"> 19 <div class="page-head">
20 <div class="page-title"> 20 <div class="page-title">
21 - <h1>行车路单</h1> 21 + <h1>调度消息分析</h1>
22 </div> 22 </div>
23 </div> 23 </div>
24 24
src/main/resources/static/real_control_v2/assets/echarts-3/echarts.js
No preview for this file type
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -257,7 +257,7 @@ span.fcsj-diff { @@ -257,7 +257,7 @@ span.fcsj-diff {
257 } 257 }
258 258
259 .tl-wd{ 259 .tl-wd{
260 - background: #caca4f; 260 + background: #dede57;
261 color: #444; 261 color: #444;
262 } 262 }
263 263
@@ -976,19 +976,19 @@ dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge { @@ -976,19 +976,19 @@ dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge {
976 } 976 }
977 977
978 dd.fcsjActualCell div.last-sch-sunken span._badge{ 978 dd.fcsjActualCell div.last-sch-sunken span._badge{
979 - font-size: 12px;  
980 - border-radius: 0 7px 7px 0; 979 + font-size: 13px;
  980 + border-radius: 0 9px 9px 0;
981 padding-left: 0; 981 padding-left: 0;
982 - width: 79px; 982 + width: 81px;
983 display: inline-block; 983 display: inline-block;
984 - height: 22px;  
985 - line-height: 22px; 984 + height: 23px;
  985 + line-height: 23px;
986 box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12); 986 box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12);
987 vertical-align: top; 987 vertical-align: top;
988 margin-right: 3px; 988 margin-right: 3px;
989 margin-top: 1px; 989 margin-top: 1px;
990 margin-left: -7px; 990 margin-left: -7px;
991 - /*text-indent: 2px;*/ 991 + /* text-indent: 2px; */
992 border-left: 0; 992 border-left: 0;
993 /* transform: scale(.9); */ 993 /* transform: scale(.9); */
994 color: grey; 994 color: grey;
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
@@ -188,6 +188,7 @@ var gb_schedule_table = (function () { @@ -188,6 +188,7 @@ var gb_schedule_table = (function () {
188 188
189 //更新班次 189 //更新班次
190 var updateSchedule = function (schArr) { 190 var updateSchedule = function (schArr) {
  191 +
191 if (!isArray(schArr)) 192 if (!isArray(schArr))
192 schArr = [schArr]; 193 schArr = [schArr];
193 194
@@ -199,12 +200,12 @@ var gb_schedule_table = (function () { @@ -199,12 +200,12 @@ var gb_schedule_table = (function () {
199 tMaps[this.xlBm+'_'+this.clZbh]=1; 200 tMaps[this.xlBm+'_'+this.clZbh]=1;
200 }); 201 });
201 202
202 - //重新标记末班 203 + /* //重新标记末班
203 var ts=[]; 204 var ts=[];
204 for(var k in tMaps){ 205 for(var k in tMaps){
205 ts = k.split('_'); 206 ts = k.split('_');
206 markerLastByNbbm(ts[0], ts[1]); 207 markerLastByNbbm(ts[0], ts[1]);
207 - } 208 + }*/
208 }; 209 };
209 210
210 //update dom 211 //update dom
@@ -216,11 +217,11 @@ var gb_schedule_table = (function () { @@ -216,11 +217,11 @@ var gb_schedule_table = (function () {
216 217
217 //车辆自编号 218 //车辆自编号
218 $(dds[2]).replaceWith(temps['line-schedule-nbbm-temp'](sch)); 219 $(dds[2]).replaceWith(temps['line-schedule-nbbm-temp'](sch));
219 - if (sch.qdzArrDateJH)  
220 - $(dds[3]).text(sch.qdzArrDateJH); 220 + //if (sch.qdzArrDateJH)
  221 + $(dds[3]).text(sch.qdzArrDateJH?sch.qdzArrDateJH:'');
221 222
222 - if (sch.qdzArrDateSJ)  
223 - $(dds[4]).text(sch.qdzArrDateSJ); 223 + //if (sch.qdzArrDateSJ)
  224 + $(dds[4]).text(sch.qdzArrDateSJ?sch.qdzArrDateSJ:'');
224 225
225 //计发时间 226 //计发时间
226 $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch)); 227 $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch));
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
@@ -296,8 +296,9 @@ var gb_svg_chart = (function() { @@ -296,8 +296,9 @@ var gb_svg_chart = (function() {
296 return isDown ? y + 7 : y - 32; 296 return isDown ? y + 7 : y - 32;
297 }); 297 });
298 //merge text 298 //merge text
299 - mergerG.append('text').text(gpsArr.length)  
300 - .attr('x', x - 4) 299 + var len = gpsArr.length;
  300 + mergerG.append('text').text(len)
  301 + .attr('x', x - ((len + '').length * 4))
301 .attr('y', isDown ? y + 24 : y - 14); 302 .attr('y', isDown ? y + 24 : y - 14);
302 } 303 }
303 304
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/before_form.html
@@ -75,12 +75,12 @@ @@ -75,12 +75,12 @@
75 $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq)); 75 $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq));
76 $('[name=sTime]', this).val(m.format(sj)); 76 $('[name=sTime]', this).val(m.format(sj));
77 77
78 - //test 78 +/* //test
79 $('[name=nbbm]', this).val('W9H-003'); 79 $('[name=nbbm]', this).val('W9H-003');
80 $('[name=eDate]', this).val('2016-12-10'); 80 $('[name=eDate]', this).val('2016-12-10');
81 $('[name=eTime]', this).val('09:00'); 81 $('[name=eTime]', this).val('09:00');
82 $('[name=sDate]', this).val('2016-12-10'); 82 $('[name=sDate]', this).val('2016-12-10');
83 - $('[name=sTime]', this).val('07:00'); 83 + $('[name=sTime]', this).val('07:00');*/
84 }); 84 });
85 85
86 var ONE_DAY = 1000 * 60 * 60 * 24; 86 var ONE_DAY = 1000 * 60 * 60 * 24;