Commit 0618c00b9456e275014e040f1e7ad97b5cebb105

Authored by mcy123
2 parents 2d11a531 612f7eea

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

Showing 117 changed files with 6210 additions and 2444 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/oil/YlbController.java
@@ -3,7 +3,9 @@ package com.bsth.controller.oil; @@ -3,7 +3,9 @@ package com.bsth.controller.oil;
3 import java.text.ParseException; 3 import java.text.ParseException;
4 import java.text.SimpleDateFormat; 4 import java.text.SimpleDateFormat;
5 import java.util.ArrayList; 5 import java.util.ArrayList;
  6 +import java.util.Calendar;
6 import java.util.Date; 7 import java.util.Date;
  8 +import java.util.GregorianCalendar;
7 import java.util.HashMap; 9 import java.util.HashMap;
8 import java.util.Iterator; 10 import java.util.Iterator;
9 import java.util.List; 11 import java.util.List;
@@ -107,8 +109,16 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -107,8 +109,16 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
107 try { 109 try {
108 String rq=map.get("rq").toString(); 110 String rq=map.get("rq").toString();
109 if(!(rq=="")){ 111 if(!(rq=="")){
  112 +
110 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 113 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
111 - map.put("rq_eq", sdf.parse(rq)); 114 + Calendar calendar = new GregorianCalendar();
  115 + calendar.setTime(sdf.parse(rq));
  116 + calendar.add(calendar.DATE,1);
  117 + Date date=calendar.getTime();
  118 + map.put("rq_ge", rq);
  119 + map.put("rq_le", sdf.format(date));
  120 + System.out.println(rq);
  121 + System.out.println(sdf.format(date));
112 } 122 }
113 } catch (ParseException e) { 123 } catch (ParseException e) {
114 // TODO Auto-generated catch block 124 // TODO Auto-generated catch block
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
@@ -292,8 +292,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -292,8 +292,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
292 } 292 }
293 293
294 @RequestMapping(value = "/queryUserInfo") 294 @RequestMapping(value = "/queryUserInfo")
295 - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) {  
296 - return scheduleRealInfoService.queryUserInfo(line, date); 295 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
  296 + @RequestParam String date,@RequestParam String state) {
  297 + return scheduleRealInfoService.queryUserInfo(line, date,state);
297 } 298 }
298 299
299 @RequestMapping(value = "/exportWaybill") 300 @RequestMapping(value = "/exportWaybill")
src/main/java/com/bsth/controller/report/ReportController.java
@@ -50,23 +50,28 @@ public class ReportController { @@ -50,23 +50,28 @@ public class ReportController {
50 } 50 }
51 51
52 @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET) 52 @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET)
53 - public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) {  
54 - return service.tbodyTime1(line, date); 53 + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String ttinfo) {
  54 + return service.tbodyTime1(line, ttinfo);
55 } 55 }
56 56
57 @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET) 57 @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET)
58 - public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) {  
59 - return service.tbodyTime2(line, date); 58 + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String ttinfo) {
  59 + return service.tbodyTime2(line, ttinfo);
60 } 60 }
61 61
62 @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET) 62 @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET)
63 - public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) {  
64 - return service.tbodyTime3(line, date); 63 + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String ttinfo) {
  64 + return service.tbodyTime3(line, ttinfo);
65 } 65 }
66 66
67 @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET) 67 @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET)
68 - public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) {  
69 - return service.tbodyTime5(line, date); 68 + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String ttinfo) {
  69 + return service.tbodyTime5(line, ttinfo);
  70 + }
  71 +
  72 + @RequestMapping(value="/getTtinfo", method = RequestMethod.GET)
  73 + public List<Map<String,Object>> getTtinfo(@RequestParam Map<String, Object> map){
  74 + return service.getTtinfo(map);
70 } 75 }
71 76
72 } 77 }
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.arrival.GeoCacheData;
4 import com.bsth.entity.*; 5 import com.bsth.entity.*;
5 import com.bsth.entity.schedule.CarConfigInfo; 6 import com.bsth.entity.schedule.CarConfigInfo;
6 import com.bsth.repository.*; 7 import com.bsth.repository.*;
@@ -57,7 +58,7 @@ public class BasicData implements CommandLineRunner { @@ -57,7 +58,7 @@ public class BasicData implements CommandLineRunner {
57 public static Map<String, String> lineCode2NameMap; 58 public static Map<String, String> lineCode2NameMap;
58 59
59 //线路编码_站点编码 == 0|1 上下行 60 //线路编码_站点编码 == 0|1 上下行
60 - public static Map<String, Integer> lineStationUpDownMap; 61 + //public static Map<String, Integer> lineStationUpDownMap;
61 62
62 //停车场 63 //停车场
63 public static List<String> parkCodeList; 64 public static List<String> parkCodeList;
@@ -86,7 +87,7 @@ public class BasicData implements CommandLineRunner { @@ -86,7 +87,7 @@ public class BasicData implements CommandLineRunner {
86 87
87 @Override 88 @Override
88 public void run(String... arg0) throws Exception { 89 public void run(String... arg0) throws Exception {
89 - Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 1, TimeUnit.HOURS); 90 + Application.mainServices.scheduleWithFixedDelay(dataLoader, 2, 2, TimeUnit.HOURS);
90 } 91 }
91 92
92 93
@@ -117,6 +118,9 @@ public class BasicData implements CommandLineRunner { @@ -117,6 +118,9 @@ public class BasicData implements CommandLineRunner {
117 @Autowired 118 @Autowired
118 BusinessRepository businessRepository; 119 BusinessRepository businessRepository;
119 120
  121 + @Autowired
  122 + GeoCacheData geoCacheData;
  123 +
120 124
121 @Override 125 @Override
122 public void run() { 126 public void run() {
@@ -138,11 +142,13 @@ public class BasicData implements CommandLineRunner { @@ -138,11 +142,13 @@ public class BasicData implements CommandLineRunner {
138 //车辆和线路映射信息 142 //车辆和线路映射信息
139 loadNbbm2LineInfo(); 143 loadNbbm2LineInfo();
140 //站点路由信息 144 //站点路由信息
141 - loadStationRouteInfo(); 145 + //loadStationRouteInfo();
142 //人员信息 146 //人员信息
143 loadPersonnelInfo(); 147 loadPersonnelInfo();
144 //公司信息 148 //公司信息
145 loadBusinessInfo(); 149 loadBusinessInfo();
  150 +
  151 + geoCacheData.loadData();
146 logger.info("加载基础数据成功!,"); 152 logger.info("加载基础数据成功!,");
147 } catch (Exception e) { 153 } catch (Exception e) {
148 logger.error("加载基础数据时出现异常,", e); 154 logger.error("加载基础数据时出现异常,", e);
@@ -151,7 +157,7 @@ public class BasicData implements CommandLineRunner { @@ -151,7 +157,7 @@ public class BasicData implements CommandLineRunner {
151 } 157 }
152 158
153 159
154 - private void loadStationRouteInfo() { 160 +/* private void loadStationRouteInfo() {
155 Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator(); 161 Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator();
156 162
157 Map<String, String> sePointMap = new HashMap<>(); 163 Map<String, String> sePointMap = new HashMap<>();
@@ -172,7 +178,7 @@ public class BasicData implements CommandLineRunner { @@ -172,7 +178,7 @@ public class BasicData implements CommandLineRunner {
172 } 178 }
173 lineStationUpDownMap = map; 179 lineStationUpDownMap = map;
174 lineSEPointMap = sePointMap; 180 lineSEPointMap = sePointMap;
175 - } 181 + }*/
176 182
177 /** 183 /**
178 * loadBusinessInfo 184 * loadBusinessInfo
@@ -280,7 +286,7 @@ public class BasicData implements CommandLineRunner { @@ -280,7 +286,7 @@ public class BasicData implements CommandLineRunner {
280 /** 286 /**
281 * 加载运管处的站点及序号 287 * 加载运管处的站点及序号
282 * 上行从1开始,下行顺序续编 288 * 上行从1开始,下行顺序续编
283 - */ 289 +
284 List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); 290 List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc();
285 if(ygcLines != null && ygcLines.size() > 0){ 291 if(ygcLines != null && ygcLines.size() > 0){
286 int size = ygcLines.size(); 292 int size = ygcLines.size();
@@ -299,7 +305,7 @@ public class BasicData implements CommandLineRunner { @@ -299,7 +305,7 @@ public class BasicData implements CommandLineRunner {
299 key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; 305 key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2];
300 tempStationName2YgcNumber.put(key,num++); 306 tempStationName2YgcNumber.put(key,num++);
301 } 307 }
302 - } 308 + }*/
303 } 309 }
304 310
305 lineId2CodeMap = biMap; 311 lineId2CodeMap = biMap;
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/arrival/AnalyseData.java
1 package com.bsth.data.arrival; 1 package com.bsth.data.arrival;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.Collections;  
5 -import java.util.List;  
6 -import java.util.Set;  
7 -  
8 import org.slf4j.Logger; 3 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 4 import org.slf4j.LoggerFactory;
10 import org.springframework.stereotype.Component; 5 import org.springframework.stereotype.Component;
11 6
12 -import com.bsth.data.BasicData; 7 +import java.util.ArrayList;
  8 +import java.util.Collections;
  9 +import java.util.List;
  10 +import java.util.Set;
13 11
14 /** 12 /**
15 * 13 *
@@ -98,14 +96,15 @@ public class AnalyseData { @@ -98,14 +96,15 @@ public class AnalyseData {
98 } 96 }
99 97
100 private boolean effective(ArrivalEntity arr){ 98 private boolean effective(ArrivalEntity arr){
101 - //停车场 99 + /*//停车场
102 if(BasicData.parkCodeList.contains(arr.getStopNo())){ 100 if(BasicData.parkCodeList.contains(arr.getStopNo())){
103 arr.setTcc(true); 101 arr.setTcc(true);
104 return true; 102 return true;
105 } 103 }
106 - 104 +
107 Integer upDown = BasicData.lineStationUpDownMap.get(arr.getLineCode() + "_" + arr.getStopNo()); 105 Integer upDown = BasicData.lineStationUpDownMap.get(arr.getLineCode() + "_" + arr.getStopNo());
108 -  
109 - return arr.getUpDown() == upDown || BasicData.parkCodeList.contains(arr.getStopNo()); 106 +
  107 + return arr.getUpDown() == upDown || BasicData.parkCodeList.contains(arr.getStopNo());*/
  108 + return false;
110 } 109 }
111 } 110 }
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
@@ -70,7 +70,7 @@ public class ForecastRealServer implements CommandLineRunner { @@ -70,7 +70,7 @@ public class ForecastRealServer implements CommandLineRunner {
70 /* public void forecast(String nbbm){ 70 /* public void forecast(String nbbm){
71 logger.info("预测," + nbbm); 71 logger.info("预测," + nbbm);
72 //当前执行班次 72 //当前执行班次
73 - ScheduleRealInfo sch = dayOfSchedule.execPlamMap().get(nbbm); 73 + ScheduleRealInfo sch = dayOfSchedule.execPlanMap().get(nbbm);
74 if(null == sch) 74 if(null == sch)
75 return; 75 return;
76 76
@@ -86,7 +86,7 @@ public class ForecastRealServer implements CommandLineRunner { @@ -86,7 +86,7 @@ public class ForecastRealServer implements CommandLineRunner {
86 //终点站 86 //终点站
87 String eStation = null; 87 String eStation = null;
88 //当前执行班次 88 //当前执行班次
89 - ScheduleRealInfo sch = dayOfSchedule.execPlamMap().get(nbbm); 89 + ScheduleRealInfo sch = dayOfSchedule.execPlanMap().get(nbbm);
90 if(null != sch) 90 if(null != sch)
91 eStation = sch.getZdzCode(); 91 eStation = sch.getZdzCode();
92 92
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.arrival.entity.StationRoute;
  4 +import com.fasterxml.jackson.annotation.JsonIgnore;
  5 +
3 /** 6 /**
4 * 7 *
5 * @ClassName: GpsRealData 8 * @ClassName: GpsRealData
@@ -58,24 +61,32 @@ public class GpsEntity { @@ -58,24 +61,32 @@ public class GpsEntity {
58 /** 预计到达终点时间 */ 61 /** 预计到达终点时间 */
59 private Float expectStopTime; 62 private Float expectStopTime;
60 63
61 - /** 设备是否在线 */ 64 + /** 设备是否在线
62 private boolean online; 65 private boolean online;
63 - 66 + */
64 /** 当前执行班次ID */ 67 /** 当前执行班次ID */
65 private Long schId; 68 private Long schId;
66 69
67 /** 是否异常数据 */ 70 /** 是否异常数据 */
68 private boolean abnormal; 71 private boolean abnormal;
69 -  
70 - private int valid; 72 +/*
  73 + private int valid;*/
71 74
72 private int version; 75 private int version;
73 76
74 - /** 是否起终点站 */ 77 + /** 是否起终点站
75 private boolean sEPoint; 78 private boolean sEPoint;
  79 + */
  80 +
  81 + /** 0: 站外 1:站内 2:场内 */
  82 + private int instation;
76 83
77 - /** 站内 */  
78 - private boolean instation; 84 + /** 站点信息,站内时有值 */
  85 + @JsonIgnore
  86 + private StationRoute station;
  87 +
  88 + /** 状态 */
  89 + private String signalState;
79 90
80 public Integer getCompanyCode() { 91 public Integer getCompanyCode() {
81 return companyCode; 92 return companyCode;
@@ -181,14 +192,6 @@ public class GpsEntity { @@ -181,14 +192,6 @@ public class GpsEntity {
181 this.stationName = stationName; 192 this.stationName = stationName;
182 } 193 }
183 194
184 - public boolean isOnline() {  
185 - return online;  
186 - }  
187 -  
188 - public void setOnline(boolean online) {  
189 - this.online = online;  
190 - }  
191 -  
192 public long getArrTime() { 195 public long getArrTime() {
193 return arrTime; 196 return arrTime;
194 } 197 }
@@ -221,43 +224,44 @@ public class GpsEntity { @@ -221,43 +224,44 @@ public class GpsEntity {
221 this.schId = schId; 224 this.schId = schId;
222 } 225 }
223 226
224 - public boolean isAbnormal() {  
225 - return abnormal; 227 +
  228 + public int getVersion() {
  229 + return version;
226 } 230 }
227 231
228 - public void setAbnormal(boolean abnormal) {  
229 - this.abnormal = abnormal; 232 + public void setVersion(int version) {
  233 + this.version = version;
230 } 234 }
231 235
232 - public int getValid() {  
233 - return valid; 236 + public StationRoute getStation() {
  237 + return station;
234 } 238 }
235 239
236 - public void setValid(int valid) {  
237 - this.valid = valid; 240 + public void setStation(StationRoute station) {
  241 + this.station = station;
238 } 242 }
239 243
240 - public int getVersion() {  
241 - return version; 244 + public boolean isAbnormal() {
  245 + return abnormal;
242 } 246 }
243 247
244 - public void setVersion(int version) {  
245 - this.version = version; 248 + public void setAbnormal(boolean abnormal) {
  249 + this.abnormal = abnormal;
246 } 250 }
247 251
248 - public boolean issEPoint() {  
249 - return sEPoint; 252 + public String getSignalState() {
  253 + return signalState;
250 } 254 }
251 255
252 - public void setsEPoint(boolean sEPoint) {  
253 - this.sEPoint = sEPoint; 256 + public void setSignalState(String signalState) {
  257 + this.signalState = signalState;
254 } 258 }
255 259
256 - public boolean isInstation() { 260 + public int getInstation() {
257 return instation; 261 return instation;
258 } 262 }
259 263
260 - public void setInstation(boolean instation) { 264 + public void setInstation(int instation) {
261 this.instation = instation; 265 this.instation = instation;
262 } 266 }
263 } 267 }
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject; @@ -5,6 +5,8 @@ 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.arrival.GpsRealAnalyse;
  9 +import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
8 import com.bsth.data.schedule.DayOfSchedule; 10 import com.bsth.data.schedule.DayOfSchedule;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 11 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 import com.bsth.util.ConfigUtil; 12 import com.bsth.util.ConfigUtil;
@@ -27,239 +29,187 @@ import java.util.*; @@ -27,239 +29,187 @@ import java.util.*;
27 import java.util.concurrent.TimeUnit; 29 import java.util.concurrent.TimeUnit;
28 30
29 /** 31 /**
30 - * 32 + * @author PanZhao
31 * @ClassName: GpsRealData 33 * @ClassName: GpsRealData
32 * @Description: TODO(实时GPS数据集合) 34 * @Description: TODO(实时GPS数据集合)
33 - * @author PanZhao  
34 * @date 2016年8月12日 下午2:04:41 35 * @date 2016年8月12日 下午2:04:41
35 - *  
36 */ 36 */
37 @Component 37 @Component
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 - public GpsRealData(){  
62 - gpsMap = new HashMap<>();  
63 - lineCode2Devices = TreeMultimap.create();  
64 - url = ConfigUtil.get("http.gps.real.url");  
65 - }  
66 -  
67 - @Override  
68 - public void run(String... arg0) throws Exception {  
69 - logger.info("gpsDataLoader,20,6");  
70 - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 15, TimeUnit.SECONDS);  
71 - }  
72 -  
73 - public GpsEntity add(GpsEntity gps) {  
74 - String device = gps.getDeviceId();  
75 - GpsEntity old = gpsMap.get(device);  
76 -  
77 - if(!StringUtils.isEmpty(gps.getStopNo())){  
78 - //定时定距数据附带站点编码改变  
79 - if(null == old || !gps.getStopNo().equals(old.getStopNo())){  
80 - gps.setArrTime(gps.getTimestamp());  
81 - //预测到达终点时间  
82 - forecastRealServer.forecast(gps.getNbbm(), gps);  
83 - }  
84 - else{  
85 - gps.setArrTime(old.getArrTime());  
86 - //不预测, 重新计算终点时间  
87 - gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm()));  
88 - }  
89 - }  
90 -  
91 - gpsMap.put(device, gps);  
92 - if(StringUtils.isNotBlank(gps.getLineId()))  
93 - lineCode2Devices.put(gps.getLineId(), device);  
94 - return gps;  
95 - }  
96 -  
97 - /**  
98 - *  
99 - * @Title: get @Description: TODO(设备号获取GPS)  
100 - */  
101 - public GpsEntity get(String deviceId) {  
102 - return gpsMap.get(deviceId);  
103 - }  
104 -  
105 - /**  
106 - *  
107 - * @Title: get @Description: TODO(线路编码获取GPS集合) @throws  
108 - */  
109 - public List<GpsEntity> getByLine(String lineCode) {  
110 - NavigableSet<String> set = lineCode2Devices.get(lineCode);  
111 -  
112 - List<GpsEntity> rs = new ArrayList<>();  
113 - GpsEntity gps;  
114 - ScheduleRealInfo sch;  
115 - for(String device : set){  
116 - gps = gpsMap.get(device);  
117 - //过滤异常GPS数据  
118 - if(gps.isAbnormal())  
119 - continue;  
120 -  
121 - sch = dayOfSchedule.execPlamMap().get(gps.getNbbm());  
122 - if(null != sch)  
123 - gps.setSchId(sch.getId());  
124 - rs.add(gps);  
125 - }  
126 -  
127 - return rs;  
128 - }  
129 -  
130 - public List<GpsEntity> get(List<String> pArray){  
131 - List<GpsEntity> list = new ArrayList<>();  
132 -  
133 - for(String code : pArray)  
134 - list.addAll(getByLine(code));  
135 - return list;  
136 - }  
137 -  
138 - public Set<String> allDevices(){  
139 - return gpsMap.keySet();  
140 - }  
141 -  
142 - public GpsEntity findByDeviceId(String deviceId) {  
143 - return gpsMap.get(deviceId);  
144 - }  
145 -  
146 - public Collection<GpsEntity> all(){  
147 - return gpsMap.values();  
148 - }  
149 -  
150 - public void remove(String device){  
151 - gpsMap.remove(device);  
152 - }  
153 - @Component  
154 - public static class GpsDataLoader extends Thread{  
155 -  
156 - Logger logger = LoggerFactory.getLogger(GpsDataLoader.class);  
157 -  
158 - @Autowired  
159 - GpsRealData gpsRealData;  
160 -  
161 - @Override  
162 - public void run() {  
163 - try{  
164 - load();  
165 - }catch(Exception e){  
166 - logger.error("", e);  
167 - }  
168 - }  
169 -  
170 - public void load() throws Exception {  
171 - List<GpsEntity> list = new ArrayList<>();  
172 - CloseableHttpClient httpClient = null;  
173 - CloseableHttpResponse response = null;  
174 - try {  
175 - httpClient = HttpClients.createDefault();  
176 - HttpGet get = new HttpGet(url);  
177 -  
178 - response = httpClient.execute(get);  
179 -  
180 - HttpEntity entity = response.getEntity();  
181 - if (null != entity) {  
182 - // 返回数据量比较大,建议以流的形式读取  
183 - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent()));  
184 - StringBuffer stringBuffer = new StringBuffer();  
185 - String str = "";  
186 - while ((str = br.readLine()) != null)  
187 - stringBuffer.append(str);  
188 -  
189 - JSONObject jsonObj = JSON.parseObject(stringBuffer.toString());  
190 -  
191 - if (jsonObj != null)  
192 - list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class);  
193 -  
194 - String nbbm;  
195 - for(GpsEntity gps : list){  
196 - //没有设备号  
197 - if(StringUtils.isBlank(gps.getDeviceId()))  
198 - continue;  
199 -  
200 - nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());  
201 - if(StringUtils.isBlank(nbbm))  
202 - gps.setAbnormal(true);//标记为异常数据  
203 - else  
204 - gps.setNbbm(nbbm);  
205 -  
206 - gps.setStationName(BasicData.stationCode2NameMap.get(gps.getStopNo()));  
207 - gpsRealData.add(gps);  
208 -  
209 - //纠正走向  
210 - correctUpdown(gps);  
211 - }  
212 - } else  
213 - logger.error("result is null");  
214 - } catch(Exception e){  
215 - logger.error("", e);  
216 - }  
217 - finally {  
218 - if (null != httpClient)  
219 - httpClient.close();  
220 - if(null != response)  
221 - response.close();  
222 - }  
223 - }  
224 -  
225 - /**  
226 - * 是否是起终点  
227 - * @param gps  
228 - * @return  
229 - */  
230 - public boolean isSEPoint(GpsEntity gps){  
231 - String key = gps.getLineId()+"_"+gps.getUpDown()+"_"  
232 - ,stationCode;  
233 -  
234 - if(BasicData.lineSEPointMap.containsKey(key+"B")){  
235 - stationCode = BasicData.lineSEPointMap.get(key+"B");  
236 - if(gps.getStopNo().equals(stationCode)){  
237 - gps.setsEPoint(true);  
238 - return true;  
239 - }  
240 - }  
241 -  
242 - if(BasicData.lineSEPointMap.containsKey(key+"E")){  
243 - stationCode = BasicData.lineSEPointMap.get(key+"E");  
244 - if(gps.getStopNo().equals(stationCode)){  
245 - gps.setsEPoint(true);  
246 - return true;  
247 - }  
248 - }  
249 - return false;  
250 - }  
251 -  
252 - /**  
253 - * 纠正上下行  
254 - * @param gps  
255 - */  
256 - public void correctUpdown(GpsEntity gps){  
257 - Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo());  
258 - if(updown != null && !updown.equals(gps.getUpDown()))  
259 - gps.setUpDown(updown);  
260 -  
261 - if(isSEPoint(gps))  
262 - return;  
263 - }  
264 - }  
265 -} 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 + }
  215 +}
266 \ No newline at end of file 216 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java deleted 100644 → 0
1 -package com.bsth.data.gpsdata.analyse;  
2 -  
3 -import com.bsth.data.gpsdata.GpsEntity;  
4 -import com.google.common.collect.ArrayListMultimap;  
5 -import com.vividsolutions.jts.geom.Coordinate;  
6 -import com.vividsolutions.jts.geom.GeometryFactory;  
7 -import com.vividsolutions.jts.geom.LineString;  
8 -import org.apache.commons.lang3.StringUtils;  
9 -import org.springframework.beans.factory.annotation.Autowired;  
10 -import org.springframework.jdbc.core.JdbcTemplate;  
11 -import org.springframework.jdbc.core.RowMapper;  
12 -import org.springframework.stereotype.Component;  
13 -  
14 -import java.sql.ResultSet;  
15 -import java.sql.SQLException;  
16 -import java.util.HashMap;  
17 -import java.util.List;  
18 -import java.util.Map;  
19 -  
20 -/**  
21 - * Created by panzhao on 2016/12/23.  
22 - */  
23 -@Component  
24 -public class GeoCacheData {  
25 -  
26 - //每辆车缓存最后50条gps  
27 - private static final int CACHE_SIZE = 50;  
28 - private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>();  
29 -  
30 - //线路路段走向  
31 - private static ArrayListMultimap<String, LineString> sectionCacheMap;  
32 -  
33 - //线路站点路由  
34 - private static ArrayListMultimap<String, StationRoute> stationCacheMap;  
35 -  
36 - @Autowired  
37 - JdbcTemplate jdbcTemplate;  
38 -  
39 - public void loadData(){  
40 - final GeometryFactory geometryFactory = new GeometryFactory();  
41 - //加载站点路由  
42 - 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 from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id";  
43 - List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() {  
44 - @Override  
45 - public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException {  
46 - StationRoute sRoute = new StationRoute();  
47 - sRoute.setCode(rs.getString("STATION_CODE"));  
48 - sRoute.setLineCode(rs.getString("LINE_CODE"));  
49 - sRoute.setDirections(rs.getInt("DIRECTIONS"));  
50 - sRoute.setPoint(geometryFactory.createPoint(new Coordinate(rs.getFloat("G_LONX"), rs.getFloat("G_LATY"))));  
51 - sRoute.setRadius(rs.getFloat("RADIUS"));  
52 -  
53 - String shapesType = rs.getString("SHAPES_TYPE");  
54 - //多边形电子围栏  
55 - if(StringUtils.isNotEmpty(shapesType) && shapesType.equals("d")){  
56 - geometryFactory.createPolygon(parsePolygon(rs.getString("G_POLYGON_GRID")));  
57 - }  
58 - return sRoute;  
59 - }  
60 - });  
61 - //按线路和走向分组  
62 - if(routeList.size() > 0){  
63 - ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();  
64 - for(StationRoute sr : routeList){  
65 - tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);  
66 - }  
67 - stationCacheMap = tempMap;  
68 - }  
69 -  
70 - System.out.println(stationCacheMap);  
71 - }  
72 -  
73 - public Coordinate[] parsePolygon(String polygonStr){  
74 - String[] coords = polygonStr.substring(11, polygonStr.length() - 2).split(",")  
75 - ,temps;  
76 -  
77 - Coordinate[] cds = new Coordinate[coords.length];  
78 - int len = coords.length;  
79 - for(int i = 0; i < len; i++){  
80 - temps = coords[i].split(" ");  
81 - cds[i] = new Coordinate(Float.parseFloat(temps[0]), Float.parseFloat(temps[1]));  
82 - }  
83 - return cds;  
84 - }  
85 -}  
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.vividsolutions.jts.geom.GeometryFactory;  
5 -  
6 -import java.util.concurrent.ExecutorService;  
7 -import java.util.concurrent.Executors;  
8 -  
9 -/**  
10 - * 分析gps状态信息  
11 - * Created by panzhao on 2016/12/23.  
12 - */  
13 -public class GpsAnalyse {  
14 -  
15 - //线程池  
16 - ExecutorService threadPool = Executors.newFixedThreadPool(50);  
17 -  
18 - private static GeometryFactory geometryFactory = new GeometryFactory();  
19 -  
20 - public void start(GpsEntity gps){  
21 - threadPool.execute(new ArrivalMatchThread(gps));  
22 - }  
23 -  
24 - public class ArrivalMatchThread implements Runnable{  
25 -  
26 - private GpsEntity gps;  
27 -  
28 - public ArrivalMatchThread(GpsEntity gps){  
29 - this.gps = gps;  
30 - }  
31 -  
32 - @Override  
33 - public void run() {  
34 - //CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm());  
35 -  
36 - //站内还是站外  
37 - //Point p = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));  
38 -  
39 - /*if(queue == null){  
40 - //首个GPS点  
41 - queue = new CircleQueue<>(CACHE_SIZE);  
42 - queue.add(gps);  
43 - }*/  
44 - }  
45 - }  
46 -}  
src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.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.entity.StationRoute;
  5 +import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
  6 +import com.bsth.data.gpsdata.arrival.utils.StationRouteComp;
  7 +import com.google.common.collect.ArrayListMultimap;
  8 +import com.vividsolutions.jts.geom.Coordinate;
  9 +import com.vividsolutions.jts.geom.GeometryFactory;
  10 +import com.vividsolutions.jts.geom.LineString;
  11 +import com.vividsolutions.jts.geom.Polygon;
  12 +import org.apache.commons.lang3.StringUtils;
  13 +import org.slf4j.Logger;
  14 +import org.slf4j.LoggerFactory;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.jdbc.core.RowMapper;
  18 +import org.springframework.stereotype.Component;
  19 +
  20 +import java.sql.ResultSet;
  21 +import java.sql.SQLException;
  22 +import java.util.*;
  23 +
  24 +/**
  25 + * Created by panzhao on 2016/12/23.
  26 + */
  27 +@Component
  28 +public class GeoCacheData {
  29 +
  30 + static Logger logger = LoggerFactory.getLogger(GeoCacheData.class);
  31 +
  32 + //每辆车缓存最后500条gps
  33 + private static final int CACHE_SIZE = 500;
  34 + private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>();
  35 +
  36 + //线路路段走向
  37 + private static ArrayListMultimap<String, LineString> sectionCacheMap;
  38 +
  39 + //线路站点路由
  40 + private static ArrayListMultimap<String, StationRoute> stationCacheMap;
  41 +
  42 + //线路_上下行_站点编码 ——> 站点
  43 + private static Map<String, StationRoute> routeCodeMap;
  44 +
  45 + //停车场
  46 + public static Map<String, Polygon> tccMap;
  47 +
  48 + @Autowired
  49 + JdbcTemplate jdbcTemplate;
  50 +
  51 + public static CircleQueue<GpsEntity> getGps(String nbbm) {
  52 + return gpsCacheMap.get(nbbm);
  53 + }
  54 +
  55 + public static void putGps(GpsEntity gps) {
  56 + CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm());
  57 + if (queue == null) {
  58 + /*//第一个点从站内开始
  59 + if (gps.getInstation() == 0)
  60 + return;*/
  61 +
  62 + queue = new CircleQueue<>(CACHE_SIZE);
  63 + gpsCacheMap.put(gps.getNbbm(), queue);
  64 + }
  65 + queue.add(gps);
  66 + }
  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 +
  82 + public static List<StationRoute> getStationRoute(String lineCode, int directions) {
  83 + return stationCacheMap.get(lineCode + "_" + directions);
  84 + }
  85 +
  86 + public static StationRoute getStation(String lineCode, int directions, String code) {
  87 + List<StationRoute> list = getStationRoute(lineCode, directions);
  88 +
  89 + for (StationRoute sr : list) {
  90 + if (sr.getCode().equals(code)) {
  91 + return sr;
  92 + }
  93 + }
  94 + return null;
  95 + }
  96 +
  97 + public static Polygon getTccPolygon(String code) {
  98 + return tccMap.get(code);
  99 + }
  100 +
  101 + public void loadData() {
  102 + final GeometryFactory geometryFactory = new GeometryFactory();
  103 + //加载站点路由
  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";
  105 + List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() {
  106 + @Override
  107 + public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException {
  108 + StationRoute sRoute = new StationRoute();
  109 + sRoute.setCode(rs.getString("STATION_CODE"));
  110 + sRoute.setLineCode(rs.getString("LINE_CODE"));
  111 + sRoute.setDirections(rs.getInt("DIRECTIONS"));
  112 + sRoute.setPoint(geometryFactory.createPoint(new Coordinate(rs.getFloat("G_LATY"), rs.getFloat("G_LONX"))));
  113 + sRoute.setRadius(rs.getFloat("RADIUS"));
  114 + sRoute.setRouteSort(rs.getInt("STATION_ROUTE_CODE"));
  115 + sRoute.setMark(rs.getString("STATION_MARK"));
  116 + sRoute.setName(rs.getString("STATION_NAME"));
  117 +
  118 + String shapesType = rs.getString("SHAPES_TYPE");
  119 + //多边形电子围栏
  120 + if (StringUtils.isNotEmpty(shapesType) && shapesType.equals("d")) {
  121 + sRoute.setPolygon(geometryFactory.createPolygon(parsePolygon(rs.getString("G_POLYGON_GRID"))));
  122 + }
  123 + return sRoute;
  124 + }
  125 + });
  126 + //按线路和走向分组
  127 + if (routeList.size() > 0) {
  128 + ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();
  129 + Map<String, StationRoute> codeMap = new HashMap<>(routeList.size());
  130 + for (StationRoute sr : routeList) {
  131 + tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);
  132 + //站点编码 ——> 和路由顺序对照
  133 + codeMap.put(sr.getLineCode() + "_" + sr.getDirections() + "_" + sr.getCode(), sr);
  134 + }
  135 +
  136 + StationRouteComp srCom = new StationRouteComp();
  137 + //连接路由
  138 + Set<String> set = tempMap.keySet();
  139 + for (String key : set) {
  140 + Collections.sort(tempMap.get(key), srCom);
  141 + connectStationRoute(tempMap.get(key));
  142 + }
  143 +
  144 + stationCacheMap = tempMap;
  145 + routeCodeMap = codeMap;
  146 + }
  147 +
  148 + //加载停车场数据
  149 + sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null";
  150 + List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql);
  151 + Map<String, Polygon> tccTempMap = new HashMap<>();
  152 +
  153 + Polygon polygon;
  154 + for (Map<String, Object> tMap : tccList) {
  155 +
  156 + try {
  157 + polygon = geometryFactory.createPolygon(parsePolygon(tMap.get("G_PARK_POINT").toString()));
  158 + tccTempMap.put(tMap.get("PARK_CODE").toString()
  159 + , polygon);
  160 + } catch (Exception e) {
  161 + logger.error("停车场:" + tMap.get("PARK_CODE"), e);
  162 + }
  163 + }
  164 +
  165 + if (tccTempMap.size() > 0)
  166 + tccMap = tccTempMap;
  167 + }
  168 +
  169 + private void connectStationRoute(List<StationRoute> list) {
  170 + int size = list.size();
  171 + StationRoute sr = null;
  172 + for (int i = 0; i < size; i++) {
  173 + sr = list.get(i);
  174 + //上一个
  175 + if (i > 0)
  176 + sr.setPrve(list.get(i - 1));
  177 + //下一个
  178 + if (i < size - 1)
  179 + sr.setNext(list.get(i + 1));
  180 + }
  181 + }
  182 +
  183 + public Coordinate[] parsePolygon(String polygonStr) {
  184 + String[] coords = polygonStr.substring(9, polygonStr.length() - 2).split(","), temps;
  185 +
  186 + Coordinate[] cds = new Coordinate[coords.length];
  187 + int len = coords.length;
  188 + for (int i = 0; i < len; i++) {
  189 + temps = coords[i].split(" ");
  190 + cds[i] = new Coordinate(Float.parseFloat(temps[1]), Float.parseFloat(temps[0]));
  191 + }
  192 + return cds;
  193 + }
  194 +}
0 \ 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;  
2 -  
3 -import com.vividsolutions.jts.geom.Point;  
4 -import com.vividsolutions.jts.geom.Polygon;  
5 -  
6 -/**  
7 - *  
8 - * Created by panzhao on 2016/12/23.  
9 - */  
10 -public class StationRoute {  
11 -  
12 - /** 线路编码 */  
13 - private String lineCode;  
14 -  
15 - /** 上下行 */  
16 - private int directions;  
17 -  
18 - /** 站点编码 */  
19 - private String code;  
20 -  
21 - /** 路由顺序 */  
22 - private int routeSort;  
23 -  
24 - /** 站点位置 */  
25 - private Point point;  
26 -  
27 - /** 圆形半径 */  
28 - private Float radius;  
29 -  
30 - /** 多边形电子围栏 */  
31 - private Polygon polygon;  
32 -  
33 - public String getCode() {  
34 - return code;  
35 - }  
36 -  
37 - public void setCode(String code) {  
38 - this.code = code;  
39 - }  
40 -  
41 - public int getRouteSort() {  
42 - return routeSort;  
43 - }  
44 -  
45 - public void setRouteSort(int routeSort) {  
46 - this.routeSort = routeSort;  
47 - }  
48 -  
49 - public Point getPoint() {  
50 - return point;  
51 - }  
52 -  
53 - public void setPoint(Point point) {  
54 - this.point = point;  
55 - }  
56 -  
57 - public Float getRadius() {  
58 - return radius;  
59 - }  
60 -  
61 - public void setRadius(Float radius) {  
62 - this.radius = radius;  
63 - }  
64 -  
65 - public Polygon getPolygon() {  
66 - return polygon;  
67 - }  
68 -  
69 - public void setPolygon(Polygon polygon) {  
70 - this.polygon = polygon;  
71 - }  
72 -  
73 - public String getLineCode() {  
74 - return lineCode;  
75 - }  
76 -  
77 - public void setLineCode(String lineCode) {  
78 - this.lineCode = lineCode;  
79 - }  
80 -  
81 - public int getDirections() {  
82 - return directions;  
83 - }  
84 -  
85 - public void setDirections(int directions) {  
86 - this.directions = directions;  
87 - }  
88 -} 1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +import com.vividsolutions.jts.geom.Point;
  4 +import com.vividsolutions.jts.geom.Polygon;
  5 +
  6 +/**
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class StationRoute {
  10 +
  11 + /**
  12 + * 线路编码
  13 + */
  14 + private String lineCode;
  15 +
  16 + /**
  17 + * 上下行
  18 + */
  19 + private int directions;
  20 +
  21 + /**
  22 + * 站点编码
  23 + */
  24 + private String code;
  25 +
  26 + /**
  27 + * 路由顺序
  28 + */
  29 + private int routeSort;
  30 +
  31 + /**
  32 + * 站点位置
  33 + */
  34 + private Point point;
  35 +
  36 + /**
  37 + * 圆形半径
  38 + */
  39 + private Float radius;
  40 +
  41 + /**
  42 + * 多边形电子围栏
  43 + */
  44 + private Polygon polygon;
  45 +
  46 + /**
  47 + * 站点标记
  48 + */
  49 + private String mark;
  50 +
  51 + /**
  52 + * 下一站
  53 + */
  54 + private StationRoute next;
  55 +
  56 + /**
  57 + * 上一站
  58 + */
  59 + private StationRoute prve;
  60 +
  61 + private String name;
  62 +
  63 + public String getCode() {
  64 + return code;
  65 + }
  66 +
  67 + public void setCode(String code) {
  68 + this.code = code;
  69 + }
  70 +
  71 + public int getRouteSort() {
  72 + return routeSort;
  73 + }
  74 +
  75 + public void setRouteSort(int routeSort) {
  76 + this.routeSort = routeSort;
  77 + }
  78 +
  79 + public Point getPoint() {
  80 + return point;
  81 + }
  82 +
  83 + public void setPoint(Point point) {
  84 + this.point = point;
  85 + }
  86 +
  87 + public Float getRadius() {
  88 + return radius;
  89 + }
  90 +
  91 + public void setRadius(Float radius) {
  92 + this.radius = radius;
  93 + }
  94 +
  95 + public Polygon getPolygon() {
  96 + return polygon;
  97 + }
  98 +
  99 + public void setPolygon(Polygon polygon) {
  100 + this.polygon = polygon;
  101 + }
  102 +
  103 + public String getLineCode() {
  104 + return lineCode;
  105 + }
  106 +
  107 + public void setLineCode(String lineCode) {
  108 + this.lineCode = lineCode;
  109 + }
  110 +
  111 + public int getDirections() {
  112 + return directions;
  113 + }
  114 +
  115 + public void setDirections(int directions) {
  116 + this.directions = directions;
  117 + }
  118 +
  119 + public StationRoute getNext() {
  120 + return next;
  121 + }
  122 +
  123 + public void setNext(StationRoute next) {
  124 + this.next = next;
  125 + }
  126 +
  127 + public StationRoute getPrve() {
  128 + return prve;
  129 + }
  130 +
  131 + public void setPrve(StationRoute prve) {
  132 + this.prve = prve;
  133 + }
  134 +
  135 + public String getMark() {
  136 + return mark;
  137 + }
  138 +
  139 + public void setMark(String mark) {
  140 + this.mark = mark;
  141 + }
  142 +
  143 + public String getName() {
  144 + return name;
  145 + }
  146 +
  147 + public void setName(String name) {
  148 + this.name = name;
  149 + }
  150 +}
  151 +
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java 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;  
2 -  
3 -import java.util.Arrays;  
4 -  
5 -/**  
6 - * 循环队列  
7 - * Created by panzhao on 2016/12/23.  
8 - */  
9 -public class CircleQueue<T> {  
10 -  
11 - /**  
12 - * (循环队列)数组的容量  
13 - */  
14 - public int capacity;  
15 -  
16 - /**  
17 - * 数组:保存循环队列的元素  
18 - */  
19 - public Object[] elementData;  
20 -  
21 - /**  
22 - * 队头(先进先出)  
23 - */  
24 - public int head = 0;  
25 -  
26 - /**  
27 - * 队尾  
28 - */  
29 - public int tail = 0;  
30 -  
31 - /**  
32 - * 以指定长度的数组来创建循环队列  
33 - *  
34 - * @param initSize  
35 - */  
36 - public CircleQueue(final int initSize) {  
37 - capacity = initSize;  
38 - elementData = new Object[capacity];  
39 - }  
40 -  
41 - /**  
42 - * 获取循环队列的大小(包含元素的个数)  
43 - */  
44 - public int size() {  
45 - if (isEmpty()) {  
46 - return 0;  
47 - } else if (isFull()) {  
48 - return capacity;  
49 - } else {  
50 - return tail + 1;  
51 - }  
52 - }  
53 -  
54 - /**  
55 - * 插入队尾一个元素  
56 - */  
57 - public void add(final T element) {  
58 - if (isEmpty()) {  
59 - elementData[0] = element;  
60 - } else if (isFull()) {  
61 - elementData[head] = element;  
62 - head++;  
63 - tail++;  
64 - head = head == capacity ? 0 : head;  
65 - tail = tail == capacity ? 0 : tail;  
66 - } else {  
67 - elementData[tail + 1] = element;  
68 - tail++;  
69 - }  
70 - }  
71 -  
72 - public boolean isEmpty() {  
73 - return tail == head && tail == 0 && elementData[tail] == null;  
74 - }  
75 -  
76 - public boolean isFull() {  
77 - return head != 0 && head - tail == 1 || head == 0 && tail == capacity - 1;  
78 - }  
79 -  
80 - public void clear() {  
81 - Arrays.fill(elementData, null);  
82 - head = 0;  
83 - tail = 0;  
84 - }  
85 -  
86 - /**  
87 - * @return 取 循环队列里的值(先进的index=0)  
88 - */  
89 - public Object[] getQueue() {  
90 - final Object[] elementDataSort = new Object[capacity];  
91 - final Object[] elementDataCopy = elementData.clone();  
92 - if (isEmpty()) {  
93 - } else if (isFull()) {  
94 - int indexMax = capacity;  
95 - int indexSort = 0;  
96 - for (int i = head; i < indexMax;) {  
97 - elementDataSort[indexSort] = elementDataCopy[i];  
98 - indexSort++;  
99 - i++;  
100 - if (i == capacity) {  
101 - i = 0;  
102 - indexMax = head;  
103 - }  
104 - }  
105 - } else {  
106 - for (int i = 0; i < tail; i++) {  
107 - elementDataSort[i] = elementDataCopy[i];  
108 - }  
109 - }  
110 - return elementDataSort;  
111 - }  
112 -} 1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import java.util.Arrays;
  4 +
  5 +/**
  6 + * 循环队列
  7 + * Created by panzhao on 2016/12/23.
  8 + */
  9 +public class CircleQueue<T> {
  10 +
  11 + /**
  12 + * (循环队列)数组的容量
  13 + */
  14 + public int capacity;
  15 +
  16 + /**
  17 + * 数组:保存循环队列的元素
  18 + */
  19 + public Object[] elementData;
  20 +
  21 + /**
  22 + * 头
  23 + */
  24 + public int head = 0;
  25 +
  26 + /**
  27 + * 尾
  28 + */
  29 + public int tail = 0;
  30 +
  31 + /**
  32 + * 以指定长度的数组来创建循环队列
  33 + *
  34 + * @param initSize
  35 + */
  36 + public CircleQueue(final int initSize) {
  37 + capacity = initSize;
  38 + elementData = new Object[capacity];
  39 + }
  40 +
  41 + /**
  42 + * 获取循环队列的大小
  43 + */
  44 + public int size() {
  45 + if (isEmpty()) {
  46 + return 0;
  47 + } else if (isFull()) {
  48 + return capacity;
  49 + } else {
  50 + return tail + 1;
  51 + }
  52 + }
  53 +
  54 + /**
  55 + * 插入队尾一个元素
  56 + */
  57 + public void add(final T element) {
  58 + if (isEmpty()) {
  59 + elementData[0] = element;
  60 + } else if (isFull()) {
  61 + elementData[head] = element;
  62 + head++;
  63 + tail++;
  64 + head = head == capacity ? 0 : head;
  65 + tail = tail == capacity ? 0 : tail;
  66 + } else {
  67 + elementData[tail + 1] = element;
  68 + tail++;
  69 + }
  70 + }
  71 +
  72 + public boolean isEmpty() {
  73 + return tail == head && tail == 0 && elementData[tail] == null;
  74 + }
  75 +
  76 + public boolean isFull() {
  77 + return head != 0 && head - tail == 1 || head == 0 && tail == capacity - 1;
  78 + }
  79 +
  80 + public void clear() {
  81 + Arrays.fill(elementData, null);
  82 + head = 0;
  83 + tail = 0;
  84 + }
  85 +
  86 + /**
  87 + * @return 取 循环队列里的值(先进的index=0)
  88 + */
  89 + public Object[] getQueue() {
  90 + final Object[] elementDataSort;
  91 + final Object[] elementDataCopy = elementData.clone();
  92 + if (isEmpty()) {
  93 + elementDataSort = new Object[0];
  94 + } else if (isFull()) {
  95 + elementDataSort = new Object[capacity];
  96 + int indexMax = capacity;
  97 + int indexSort = 0;
  98 + for (int i = head; i < indexMax;) {
  99 + elementDataSort[indexSort] = elementDataCopy[i];
  100 + indexSort++;
  101 + i++;
  102 + if (i == capacity) {
  103 + i = 0;
  104 + indexMax = head;
  105 + }
  106 + }
  107 + } else {
  108 + elementDataSort = new Object[tail];
  109 + for (int i = 0; i < tail; i++) {
  110 + elementDataSort[i] = elementDataCopy[i];
  111 + }
  112 + }
  113 + return elementDataSort;
  114 + }
  115 +
  116 + /**
  117 + * 取最后一个值
  118 + * @return
  119 + */
  120 + public T getTail(){
  121 + return elementData[tail] == null?null:(T)elementData[tail];
  122 + }
  123 +}
113 \ No newline at end of file 124 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/arrival/utils/GeoUtils.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  5 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  6 +import com.vividsolutions.jts.geom.Coordinate;
  7 +import com.vividsolutions.jts.geom.GeometryFactory;
  8 +import com.vividsolutions.jts.geom.Point;
  9 +import com.vividsolutions.jts.geom.Polygon;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +import java.util.Set;
  14 +
  15 +/**
  16 + * Created by panzhao on 2016/12/23.
  17 + */
  18 +public class GeoUtils {
  19 +
  20 + private final static double EARTHRADIUS = 6378137;
  21 +
  22 + private static GeometryFactory geometryFactory = new GeometryFactory();
  23 + /**
  24 + * gps是否在路由上的某个站内
  25 + *
  26 + * @param gps
  27 + * @param srs
  28 + * @return
  29 + */
  30 + public static StationRoute gpsInStation(GpsEntity gps, List<StationRoute> srs) {
  31 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  32 + double min = -1, distance, distance2;
  33 + StationRoute stationRoute = null;
  34 +
  35 + for (StationRoute sr : srs) {
  36 + if (sr.getPolygon() == null) {
  37 + //圆形
  38 + distance = getDistance(sr.getPoint(), point);//sr.getPoint().distance(point);
  39 +
  40 + if (distance > sr.getRadius())
  41 + continue;
  42 +
  43 + if (min > distance || min == -1) {
  44 + min = distance;
  45 + stationRoute = sr;
  46 + }
  47 + } else {
  48 + //多边形
  49 + if (sr.getPolygon().contains(point)) {
  50 + stationRoute = sr;
  51 + break;
  52 + }
  53 + }
  54 + }
  55 + return stationRoute;
  56 + }
  57 +
  58 + public static double getDistance(Point p1, Point p2) {
  59 + double lng1 = getLoop(p1.getY(), -180, 180), lat1 = getRange(
  60 + p1.getX(), -74, 74);
  61 + double lng2 = getLoop(p2.getY(), -180, 180), lat2 = getRange(
  62 + p2.getX(), -74, 74);
  63 +
  64 + double x1, x2, y1, y2;
  65 + x1 = degreeToRad(lng1);
  66 + y1 = degreeToRad(lat1);
  67 + x2 = degreeToRad(lng2);
  68 + y2 = degreeToRad(lat2);
  69 + return EARTHRADIUS
  70 + * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1)
  71 + * Math.cos(y2) * Math.cos(x2 - x1)));
  72 + }
  73 +
  74 + private static double getLoop(double v, double a, double b) {
  75 + while (v > b) {
  76 + v -= b - a;
  77 + }
  78 + while (v < a) {
  79 + v += b - a;
  80 + }
  81 + return v;
  82 + }
  83 +
  84 + private static double getRange(double v, double a, double b) {
  85 + v = Math.min(Math.max(v, a), b);
  86 + return v;
  87 + }
  88 +
  89 + private static double degreeToRad(double degree) {
  90 + return Math.PI * degree / 180;
  91 + }
  92 +
  93 +
  94 + /**
  95 + * gps 是否在某个停车场内
  96 + * @param gps
  97 + * @return
  98 + */
  99 + public static String gpsInCarpark(GpsEntity gps){
  100 + Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  101 +
  102 + Map<String, Polygon> carparkMap = GeoCacheData.tccMap;
  103 + Set<String> codes = carparkMap.keySet();
  104 + Polygon polygon;
  105 + for(String code : codes){
  106 + polygon = carparkMap.get(code);
  107 + if(point.within(polygon)){
  108 + return code;
  109 + }
  110 + }
  111 + return null;
  112 + }
  113 +
  114 + /**
  115 + * 是否是有效的连续点
  116 + * @param prevGps
  117 + * @param gps
  118 + * @return
  119 + */
  120 + public static boolean overdue(GpsEntity prevGps, GpsEntity gps) {
  121 + return gps.getTimestamp() - prevGps.getTimestamp() < 120000;
  122 + }
  123 +}
src/main/java/com/bsth/data/gpsdata/arrival/utils/StationRouteComp.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.utils;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  4 +
  5 +import java.util.Comparator;
  6 +
  7 +/**
  8 + * Created by panzhao on 2016/12/24.
  9 + */
  10 +public class StationRouteComp implements Comparator<StationRoute>{
  11 + @Override
  12 + public int compare(StationRoute s1, StationRoute s2) {
  13 + return s1.getRouteSort() - s2.getRouteSort();
  14 + }
  15 +}
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java 0 → 100644
  1 +package com.bsth.data.gpsdata.recovery;
  2 +
  3 +import com.bsth.data.BasicData;
  4 +import com.bsth.data.gpsdata.GpsEntity;
  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;
  8 +import com.bsth.util.db.DBUtils_MS;
  9 +import com.google.common.collect.ArrayListMultimap;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.BeansException;
  13 +import org.springframework.context.ApplicationContext;
  14 +import org.springframework.context.ApplicationContextAware;
  15 +import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.core.RowMapper;
  17 +import org.springframework.stereotype.Component;
  18 +
  19 +import java.sql.ResultSet;
  20 +import java.sql.SQLException;
  21 +import java.util.*;
  22 +import java.util.concurrent.CountDownLatch;
  23 +import java.util.concurrent.ExecutorService;
  24 +import java.util.concurrent.Executors;
  25 +
  26 +/**
  27 + * gps数据恢复
  28 + * Created by panzhao on 2016/12/24.
  29 + */
  30 +@Component
  31 +public class GpsDataRecovery implements ApplicationContextAware{
  32 +
  33 + static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class);
  34 +
  35 + public static boolean run;
  36 +
  37 + static ExecutorService threadPool = Executors.newFixedThreadPool(10);
  38 +
  39 + static OfflineSignalHandle offlineSignalHandle;
  40 + static CorrectSignalHandle correctSignalHandle;
  41 + static StationInsideHandle stationInsideHandle;
  42 + static InOutStationSignalHandle inOutStationSignalHandle;
  43 + static ReverseSignalHandle reverseSignalHandle;
  44 +
  45 + public void recovery() {
  46 + List<GpsEntity> list = loadData();
  47 +
  48 + //按车辆分组数据
  49 + ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create();
  50 + for (GpsEntity gps : list) {
  51 + if(gps.getNbbm() != null)
  52 + listMap.put(gps.getNbbm(), gps);
  53 + }
  54 +
  55 +
  56 + Set<String> keys = listMap.keySet();
  57 +
  58 + CountDownLatch count = new CountDownLatch(keys.size());
  59 + GpsComp comp = new GpsComp();
  60 + for (String nbbm : keys) {
  61 + Collections.sort(listMap.get(nbbm), comp);
  62 + threadPool.execute(new RecoveryThread(listMap.get(nbbm), count));
  63 + }
  64 +
  65 + try {
  66 + count.await();
  67 + run = false;
  68 + logger.info("数据恢复完成....");
  69 + } catch (InterruptedException e) {
  70 + logger.error("", e);
  71 + }
  72 + }
  73 +
  74 + /**
  75 + * 加载当天的gps数据
  76 + *
  77 + * @return
  78 + */
  79 + public List<GpsEntity> loadData() {
  80 + Calendar calendar = Calendar.getInstance();
  81 + int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
  82 +
  83 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear;
  84 + JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
  85 +
  86 + List<GpsEntity> list =
  87 + jdbcTemplate.query(sql, new RowMapper<GpsEntity>() {
  88 + @Override
  89 + public GpsEntity mapRow(ResultSet rs, int rowNum) throws SQLException {
  90 + GpsEntity gps = new GpsEntity();
  91 +
  92 + gps.setDeviceId(rs.getString("DEVICE_ID"));
  93 + gps.setNbbm(BasicData.deviceId2NbbmMap.get(gps.getDeviceId()));
  94 + gps.setSpeed(rs.getFloat("SPEED_GPS"));
  95 + gps.setLat(rs.getFloat("LAT"));
  96 + gps.setLon(rs.getFloat("LON"));
  97 + gps.setLineId(rs.getString("LINE_ID"));
  98 + gps.setTimestamp(rs.getLong("TS"));
  99 + gps.setUpDown(getUpOrDown(rs.getLong("SERVICE_STATE")));
  100 + return gps;
  101 + }
  102 + });
  103 + return list;
  104 + }
  105 +
  106 + /**
  107 + * 王通 2016/6/29 9:23:24 获取车辆线路上下行
  108 + *
  109 + * @return -1无效 0上行 1下行
  110 + */
  111 + public static int getUpOrDown(long serviceState) {
  112 + if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
  113 + || (serviceState & 0x01000000) == 0x01000000 || (serviceState & 0x08000000) == 0x08000000)
  114 + return -1;
  115 + return (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0);
  116 + }
  117 +
  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 + }
  134 +
  135 + public static class RecoveryThread implements Runnable{
  136 + List<GpsEntity> list;
  137 + CountDownLatch count;
  138 +
  139 + RecoveryThread(List<GpsEntity> list, CountDownLatch count){
  140 + this.list = list;
  141 + this.count = count;
  142 + }
  143 + @Override
  144 + public void run() {
  145 + try {
  146 + //循环gps恢复数据
  147 + CircleQueue<GpsEntity> prevs;
  148 +
  149 + for(GpsEntity gps : list){
  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);
  163 + }
  164 + }catch (Exception e){
  165 + logger.error("", e);
  166 + }
  167 + finally {
  168 + count.countDown();
  169 + }
  170 + }
  171 + }
  172 +}
0 \ 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
@@ -3,9 +3,11 @@ package com.bsth.data.schedule; @@ -3,9 +3,11 @@ package com.bsth.data.schedule;
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONArray; 4 import com.alibaba.fastjson.JSONArray;
5 import com.bsth.Application; 5 import com.bsth.Application;
  6 +import com.bsth.data.BasicData;
6 import com.bsth.data.LineConfigData; 7 import com.bsth.data.LineConfigData;
7 import com.bsth.data.directive.FirstScheduleCheckThread; 8 import com.bsth.data.directive.FirstScheduleCheckThread;
8 import com.bsth.data.gpsdata.GpsRealData; 9 import com.bsth.data.gpsdata.GpsRealData;
  10 +import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
9 import com.bsth.data.schedule.thread.ScheduleLateThread; 11 import com.bsth.data.schedule.thread.ScheduleLateThread;
10 import com.bsth.data.schedule.thread.SchedulePstThread; 12 import com.bsth.data.schedule.thread.SchedulePstThread;
11 import com.bsth.data.schedule.thread.ScheduleRefreshThread; 13 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
@@ -35,484 +37,538 @@ import java.util.*; @@ -35,484 +37,538 @@ import java.util.*;
35 import java.util.concurrent.TimeUnit; 37 import java.util.concurrent.TimeUnit;
36 38
37 /** 39 /**
38 - * 40 + * @author PanZhao
39 * @ClassName: DayOfSchedule 41 * @ClassName: DayOfSchedule
40 * @Description: TODO(当日实际排班) 42 * @Description: TODO(当日实际排班)
41 - * @author PanZhao  
42 * @date 2016年8月15日 上午10:16:12 43 * @date 2016年8月15日 上午10:16:12
43 - *  
44 */ 44 */
45 @Component 45 @Component
46 public class DayOfSchedule implements CommandLineRunner { 46 public class DayOfSchedule implements CommandLineRunner {
47 47
48 - Logger logger = LoggerFactory.getLogger(this.getClass());  
49 -  
50 - // 按车辆分组的班次数据  
51 - private static ArrayListMultimap<String, ScheduleRealInfo> nbbmScheduleMap;  
52 -  
53 - // 班次主键映射  
54 - private static Map<Long, ScheduleRealInfo> id2SchedulMap;  
55 -  
56 - // 车辆和排班起终点站对照(包括进出的停车场,区间起终点)  
57 - private static TreeMultimap<String, String> nbbm2SEStationMap;  
58 -  
59 - //车辆 ——> 当前执行班次  
60 - private static Map<String, ScheduleRealInfo> carExecutePlanMap;  
61 -  
62 - // 持久化缓冲区  
63 - public static LinkedList<ScheduleRealInfo> pstBuffer;  
64 -  
65 - // 排序器  
66 - private static ScheduleComparator.FCSJ schFCSJComparator;  
67 -  
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 - public static Map<String, String> currSchDateMap;  
88 -  
89 - static {  
90 - nbbmScheduleMap = ArrayListMultimap.create();  
91 - id2SchedulMap = new HashMap<>();  
92 - pstBuffer = new LinkedList<>();  
93 - schFCSJComparator = new ScheduleComparator.FCSJ();  
94 - currSchDateMap = new HashMap<>();  
95 - nbbm2SEStationMap = TreeMultimap.create();  
96 - carExecutePlanMap = new HashMap<>();  
97 - }  
98 -  
99 - @Autowired  
100 - ScheduleRefreshThread scheduleRefreshThread;  
101 -  
102 - @Autowired  
103 - SchedulePstThread schedulePstThread;  
104 -  
105 - @Autowired  
106 - FirstScheduleCheckThread firstScheduleCheckThread;  
107 -  
108 - @Autowired  
109 - ScheduleLateThread scheduleLateThread;  
110 -  
111 - @Autowired  
112 - SubmitToTrafficManage submitToTrafficManage;  
113 -  
114 - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd")  
115 - ,fmtHHmm = DateTimeFormat.forPattern("HH:mm");  
116 -  
117 - @Override  
118 - public void run(String... arg0) throws Exception {  
119 - //翻班线程  
120 - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);  
121 - //入库  
122 -// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);  
123 - //首班出场指令补发器  
124 -// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS);  
125 - //班次误点扫描  
126 -// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);  
127 -  
128 - //每天凌晨2点20提交数据到运管处  
129 - long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis();  
130 - if(diff < 0)  
131 - diff+=(1000*60*60*24);  
132 -  
133 - logger.info(diff/1000/60 + "分钟之后提交到运管处");  
134 - //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);  
135 - }  
136 -  
137 - public Map<String, String> getCurrSchDate() {  
138 - return currSchDateMap;  
139 - }  
140 -  
141 - /**  
142 - *  
143 - * @Title: calcSchDateB  
144 - * @Description: TODO(计算线路当前应该使用的排班日期)  
145 - */  
146 - public String calcSchDate(String lineCode) {  
147 - LineConfig conf = lineConfigData.get(lineCode);  
148 - long ct = System.currentTimeMillis();  
149 -  
150 - String schDate = fmtyyyyMMdd.print(ct);  
151 - // 小于当天起始运营时间,则取前一天的排班  
152 - if (ct < conf.getCurrStartTime())  
153 - schDate = DateUtils.subtractDay(schDate, 1);  
154 -  
155 - return schDate;  
156 - }  
157 -  
158 - /**  
159 - * @Title: reloadSch  
160 - * @Title: reloadSch  
161 - * @Description: TODO(重新载入排班)  
162 - * @param @param  
163 - * lineCode 线路编码  
164 - * @param @param  
165 - * schDate 班次日期 yyyy-MM-dd  
166 - * @param @param  
167 - * forcePlan 强制从计划调度重新抓取  
168 - */  
169 - public int reloadSch(String lineCode, String schDate, boolean forcePlan) {  
170 - try {  
171 - List<ScheduleRealInfo> list;  
172 -  
173 - if (forcePlan)  
174 - removeRealSch(lineCode, schDate);  
175 - else  
176 - clearRAMData(lineCode);  
177 -  
178 - if (existRealSch(lineCode, schDate))  
179 - list = loadRealSch(lineCode, schDate);// 从实际排班表加载  
180 - else {  
181 - list = loadPlanSch(lineCode, schDate);// 从计划排班表加载  
182 - // 写入数据库  
183 - batchSave(list);  
184 - }  
185 -  
186 - //更新线路和班次日期对照  
187 - currSchDateMap.put(lineCode, schDate);  
188 - //添加到缓存  
189 - putAll(list);  
190 -  
191 - Set<String> cars = searchAllCars(list);  
192 - //计算“起点站应到”时间  
193 - for(String nbbm : cars)  
194 - schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));  
195 -  
196 - //是否是出站即出场  
197 - LineConfig conf = lineConfigData.get(lineCode);  
198 - if(conf.getOutConfig() == 2){  
199 - for(String nbbm : cars)  
200 - schAttrCalculator.connectOutSchedule(nbbmScheduleMap.get(nbbm));  
201 - }  
202 -  
203 - // 页面 翻班通知  
204 - sendUtils.shiftSchedule(lineCode);  
205 - } catch (Exception e) {  
206 - logger.error("", e);  
207 - return -1;  
208 - } 48 + Logger logger = LoggerFactory.getLogger(this.getClass());
209 49
210 - return 0;  
211 - }  
212 -  
213 - /**  
214 - *  
215 - * @Title: searchAllCars  
216 - * @Description: TODO(搜索班次集合中的车辆)  
217 - */  
218 - private Set<String> searchAllCars(List<ScheduleRealInfo> list) {  
219 - Set<String> cars = new HashSet<>();  
220 - for(ScheduleRealInfo sch : list)  
221 - cars.add(sch.getClZbh());  
222 -  
223 - return cars;  
224 - }  
225 -  
226 - private void putAll(List<ScheduleRealInfo> list) {  
227 - for (ScheduleRealInfo sch : list)  
228 - put(sch);  
229 - }  
230 -  
231 - /**  
232 - * @Title: removeRealSch  
233 - * @Description: TODO(清除实际排班,包括数据库和内存数据)  
234 - * @param @param  
235 - * lineCode 线路编码  
236 - * @param @param  
237 - * schDate 班次日期 yyyy-MM-dd  
238 - */  
239 - public void removeRealSch(String lineCode, String schDate) throws Exception {  
240 - try {  
241 - // 清理数据库数据  
242 - schRepository.deleteByLineCodeAndDate(lineCode + "", schDate);  
243 -  
244 - // 清理内存数据  
245 - clearRAMData(lineCode + "");  
246 - } catch (Exception e) {  
247 - logger.error("removeRealSch error, " + lineCode + " -" + schDate, e);  
248 - throw e;  
249 - }  
250 - }  
251 -  
252 - /**  
253 - *  
254 - * @Title: clearRAMData  
255 - * @Description: TODO(清理内存数据)  
256 - */  
257 - public void clearRAMData(String lineCode) {  
258 - int count = 0;  
259 - List<ScheduleRealInfo> remList = new ArrayList<>();  
260 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
261 - for (ScheduleRealInfo sch : schs) {  
262 - if (sch.getXlBm().equals(lineCode))  
263 - remList.add(sch);  
264 - }  
265 -  
266 - for(ScheduleRealInfo sch : remList){  
267 - if(null != sch){  
268 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
269 - id2SchedulMap.remove(sch.getId());  
270 - count ++;  
271 - }  
272 - }  
273 -  
274 - logger.info(lineCode + "排班清理 " + count);  
275 - }  
276 -  
277 - /**  
278 - * @Title: existRealSch  
279 - * @Description: TODO(实际排班是否已存在)  
280 - */  
281 - public boolean existRealSch(String lineCode, String schDate) {  
282 - int count = schRepository.countByLineCodeAndDate(lineCode, schDate);  
283 - return count > 0;  
284 - }  
285 -  
286 - /**  
287 - * @Title: loadRealSch  
288 - * @Description: TODO(从实际排班表加载数据)  
289 - */  
290 - public List<ScheduleRealInfo> loadRealSch(String lineCode, String schDate) {  
291 - return schRepository.findByLineCodeAndDate(lineCode, schDate);  
292 - }  
293 -  
294 - /**  
295 - * @Title: loadPlanSch  
296 - * @Description: TODO(从计划排班表加载数据)  
297 - */  
298 - public List<ScheduleRealInfo> loadPlanSch(String lineCode, String schDate) {  
299 - logger.info("从计划排班表恢复排班,lineCode: " + lineCode + ", schDate: " + schDate);  
300 - List<ScheduleRealInfo> realList = new ArrayList<>();  
301 -  
302 - try {  
303 - Map<String, Object> data = new HashMap<>();  
304 -  
305 - data.put("scheduleDate_eq", fmtyyyyMMdd.parseDateTime(schDate).toDate());  
306 - data.put("xlBm_eq", lineCode);  
307 -  
308 - // 查询计划排班  
309 - List<SchedulePlanInfo> planItr = cleanSchPlanItr(schPlanService.list(data).iterator());  
310 -  
311 - // 转换为实际排班  
312 - realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class);  
313 -  
314 - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");  
315 - String fcsj;  
316 - for (ScheduleRealInfo sch : realList) {  
317 - sch.setScheduleDateStr(fmtyyyyMMdd.print(sch.getScheduleDate().getTime()));  
318 - sch.setRealExecDate(sch.getScheduleDateStr());  
319 -  
320 - if(StringUtils.isEmpty(sch.getFcsj()))  
321 - sch.setFcsj("00:00");  
322 -  
323 - fcsj=sch.getFcsj().trim();  
324 - //处理一下发车时间格式没有:号的问题  
325 - if(fcsj.indexOf(":") == -1 && fcsj.length() >= 4){  
326 - sch.setFcsj(fcsj.substring(0, 2) + ":" + fcsj.substring(2, 4));  
327 - }  
328 -  
329 - try {  
330 - sdf.parse(sch.getFcsj());  
331 - } catch (ParseException e) {  
332 - //发车时间仍然校验不过的,直接写成00:00  
333 - sch.setFcsj("00:00");  
334 - }  
335 - sch.setDfsj(sch.getFcsj());  
336 -  
337 - // 计划终点时间  
338 - if (sch.getBcsj() != null) {  
339 - sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000)));  
340 - sch.setLate(false);  
341 - }  
342 - //计划里程为0,设置NULL  
343 - if(sch.getJhlc() != null && sch.getJhlc() == 0)  
344 - sch.setJhlc(null);  
345 - }  
346 - } catch (Exception e) {  
347 - logger.error("", e);  
348 - }  
349 - return realList;  
350 - }  
351 -  
352 - /**  
353 - * @Title: batchSave  
354 - * @Description: TODO(批量入库)  
355 - */  
356 - private void batchSave(List<ScheduleRealInfo> list) {  
357 - // 查询数据库最大ID  
358 - Long id = schRepository.getMaxId();  
359 - if (null == id)  
360 - id = 0L;  
361 - id++;  
362 -  
363 - SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");  
364 - for (ScheduleRealInfo item : list) {  
365 - item.setSpId(item.getId());// 保留原始的计划ID  
366 - item.setId(id++);// 设置ID  
367 - item.setScheduleDateStr(sdfyyyyMMdd.format(item.getScheduleDate()));  
368 - } 50 + // 按车辆分组的班次数据
  51 + private static ArrayListMultimap<String, ScheduleRealInfo> nbbmScheduleMap;
369 52
370 - // 入库  
371 - new BatchSaveUtils<ScheduleRealInfo>().saveList(list, ScheduleRealInfo.class);  
372 - } 53 + // 班次主键映射
  54 + private static Map<Long, ScheduleRealInfo> id2SchedulMap;
373 55
374 - private List<SchedulePlanInfo> cleanSchPlanItr(Iterator<SchedulePlanInfo> itrab) {  
375 - List<SchedulePlanInfo> list = new ArrayList<>(); 56 + // 车辆和排班起终点站对照(包括进出的停车场,区间起终点)
  57 + private static TreeMultimap<String, String> nbbm2SEStationMap;
376 58
377 - SchedulePlanInfo sp;  
378 - while (itrab.hasNext()) {  
379 - sp = itrab.next();  
380 - sp.setSchedulePlan(null);  
381 - list.add(sp);  
382 - }  
383 - return list;  
384 - }  
385 -  
386 - /**  
387 - *  
388 - * @Title: findByLineCode  
389 - * @Description: TODO(lineCode 获取班次)  
390 - */  
391 - public List<ScheduleRealInfo> findByLineCode(String lineCode) {  
392 - List<ScheduleRealInfo> rs = new ArrayList<>(); 59 + //车辆 ——> 当前执行班次
  60 + private static Map<String, ScheduleRealInfo> carExecutePlanMap;
393 61
394 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
395 - for (ScheduleRealInfo sch : schs) {  
396 - if (sch.getXlBm().equals(lineCode))  
397 - rs.add(sch);  
398 - }  
399 - return rs;  
400 - }  
401 -  
402 - /**  
403 - *  
404 - * @Title: findCarByLineCode  
405 - * @Description: TODO(线路下运营的车辆)  
406 - */  
407 - public Set<String> findCarByLineCode(String lineCode){  
408 - Set<String> rs = new HashSet<>();  
409 -  
410 - Collection<ScheduleRealInfo> schs = nbbmScheduleMap.values();  
411 - for (ScheduleRealInfo sch : schs) {  
412 - if (sch.getXlBm().equals(lineCode))  
413 - rs.add(sch.getClZbh());  
414 - }  
415 -  
416 - return rs;  
417 - }  
418 -  
419 - public List<ScheduleRealInfo> findByNbbm(String nbbm) {  
420 - return nbbmScheduleMap.get(nbbm);  
421 - }  
422 -  
423 - /**  
424 - *  
425 - * @Title: findByLineAndUpDown  
426 - * @Description: TODO(lineCode 和走向获取班次)  
427 - */  
428 - public List<ScheduleRealInfo> findByLineAndUpDown(String lineCode, Integer upDown) {  
429 - List<ScheduleRealInfo> list = findByLineCode(lineCode), rs = new ArrayList<>();  
430 -  
431 - for (ScheduleRealInfo sch : list) {  
432 - if (sch.getXlDir().equals(upDown + ""))  
433 - rs.add(sch);  
434 - }  
435 - return rs;  
436 - } 62 + // 持久化缓冲区
  63 + public static LinkedList<ScheduleRealInfo> pstBuffer;
437 64
438 - public ScheduleRealInfo get(long id) {  
439 - return id2SchedulMap.get(id);  
440 - } 65 + // 排序器
  66 + private static ScheduleComparator.FCSJ schFCSJComparator;
441 67
442 - public Set<String> getSEStationList(String nbbm) {  
443 - return nbbm2SEStationMap.get(nbbm);  
444 - } 68 + @Autowired
  69 + LineConfigData lineConfigData;
445 70
446 - /**  
447 - *  
448 - * @Title: next  
449 - * @Description: TODO(下一个班次)  
450 - */  
451 - public ScheduleRealInfo next(ScheduleRealInfo sch) { 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 + }
452 556
453 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
454 -  
455 - boolean flag = false;  
456 - ScheduleRealInfo next = null;  
457 - for(ScheduleRealInfo temp : list){  
458 - if(temp.getId() == sch.getId()){  
459 - flag = true;  
460 - continue;  
461 - }  
462 - //忽略烂班  
463 - if(temp.isDestroy())  
464 - continue;  
465 -  
466 - if(flag){  
467 - next = temp;  
468 - break;  
469 - }  
470 - }  
471 - return next;  
472 - }  
473 -  
474 - public void put(ScheduleRealInfo sch) {  
475 - schAttrCalculator  
476 - .calcRealDate(sch)  
477 - .calcAllTimeByFcsj(sch);  
478 -  
479 - String nbbm = sch.getClZbh();  
480 - nbbmScheduleMap.put(nbbm, sch);  
481 - nbbm2SEStationMap.put(nbbm, sch.getQdzCode());  
482 - nbbm2SEStationMap.put(nbbm, sch.getZdzCode());  
483 -  
484 - //主键索引  
485 - id2SchedulMap.put(sch.getId(), sch);  
486 - //跨24点的,再save一次  
487 - if(!sch.getRealExecDate().equals(sch.getScheduleDateStr()))  
488 - save(sch);  
489 - }  
490 -  
491 - public void delete(ScheduleRealInfo sch) {  
492 - //ScheduleRealInfo sch = id2SchedulMap.get(id);  
493 - if(!sch.isSflj())  
494 - return;  
495 -  
496 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
497 - id2SchedulMap.remove(sch.getId());  
498 - //return sch;  
499 - }  
500 -  
501 // public void calcQdzTimePlan(String nbbm){ 557 // public void calcQdzTimePlan(String nbbm){
502 // schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm)); 558 // schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm));
503 // } 559 // }
504 -  
505 - public List<ScheduleRealInfo> updateQdzTimePlan(String nbbm){  
506 - return schAttrCalculator.updateQdzTimePlan(nbbmScheduleMap.get(nbbm));  
507 - }  
508 -  
509 - /**  
510 - *  
511 - * @Title: nextAll  
512 - * @Description: TODO(之后的所有班次)  
513 - */ 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 + */
514 /* public List<ScheduleRealInfo> nextAll(ScheduleRealInfo sch) { 570 /* public List<ScheduleRealInfo> nextAll(ScheduleRealInfo sch) {
515 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); 571 + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());
516 // 排序 572 // 排序
517 Collections.sort(list, schFCSJComparator); 573 Collections.sort(list, schFCSJComparator);
518 574
@@ -527,181 +583,229 @@ public class DayOfSchedule implements CommandLineRunner { @@ -527,181 +583,229 @@ public class DayOfSchedule implements CommandLineRunner {
527 return rs; 583 return rs;
528 }*/ 584 }*/
529 585
530 - /**  
531 - *  
532 - * @Title: doneSum  
533 - * @Description: TODO(已完成班次总数)  
534 - */  
535 - public int doneSum(String clZbh) {  
536 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(clZbh);  
537 - int rs = 0;  
538 -  
539 - for(ScheduleRealInfo sch : list){  
540 - if(sch.getStatus() == 2 && !sch.isDestroy())  
541 - rs ++;  
542 - }  
543 - return rs;  
544 - }  
545 -  
546 - /**  
547 - *  
548 - * @Title: prveNotExecNum  
549 - * @Description: TODO(班次之前未执行班次数量)  
550 - */  
551 - public int prveNotExecNum(ScheduleRealInfo sch){  
552 - int n = 0;  
553 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
554 - for(ScheduleRealInfo s : list){  
555 - if(s.getFcsjActual() == null && !s.isDestroy())  
556 - n ++;  
557 -  
558 - if(s.getId().equals(sch.getId()))  
559 - break;  
560 - }  
561 - return n;  
562 - }  
563 -  
564 - /**  
565 - *  
566 - * @Title: validEndTime  
567 - * @Description: TODO(是否是有效的到达时间)  
568 - */  
569 - public boolean validEndTime(ScheduleRealInfo sch, Long ts) {  
570 - if(sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts)  
571 - return false;  
572 -  
573 - return validTime(sch, ts);  
574 - }  
575 -  
576 - /**  
577 - *  
578 - * @Title: validStartTime  
579 - * @Description: TODO(是否是合适的发车时间)  
580 - */  
581 - public boolean validStartTime(ScheduleRealInfo sch, Long ts) {  
582 - if(sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts)  
583 - return false;  
584 -  
585 - return validTime(sch, ts);  
586 - }  
587 -  
588 - public boolean validTime(ScheduleRealInfo sch, Long ts){  
589 - List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh());  
590 - int ci = list.indexOf(sch);  
591 - ScheduleRealInfo prve, next;  
592 - if(ci > 0){  
593 - //之前班次实际时间不能大于该时间  
594 - for(int i = ci - 1; i >= 0; i --){  
595 - prve = list.get(i);  
596 - if(prve.getZdsjActualTime() != null && prve.getZdsjActualTime() > ts )  
597 - return false;  
598 -  
599 - if(prve.getFcsjActualTime() != null && prve.getFcsjActualTime() > ts)  
600 - return false;  
601 - }  
602 - }  
603 -  
604 - if(ci < list.size() - 1){  
605 - //之后班次实际时间不能小于该时间  
606 - for(int i = ci + 1; i < list.size(); i ++){  
607 - next = list.get(i);  
608 - if(next.getFcsjActualTime() != null && next.getFcsjActualTime() < ts)  
609 - return false;  
610 -  
611 - if(next.getZdsjActualTime() != null && next.getZdsjActualTime() < ts)  
612 - return false;  
613 - }  
614 - }  
615 - return true;  
616 - }  
617 -  
618 - public void save(ScheduleRealInfo sch){  
619 - //schRepository.save(sch);  
620 - pstBuffer.add(sch);  
621 - }  
622 -  
623 -  
624 - /**  
625 - *  
626 - * @Title: nextByBcType  
627 - * @Description: TODO(获取下一个指定班次类型的班次)  
628 - */  
629 - public ScheduleRealInfo nextByBcType(String nbbm, String bcType){  
630 - List<ScheduleRealInfo> list = findByBcType(nbbm, bcType);  
631 -  
632 - Collections.sort(list, schFCSJComparator);  
633 - ScheduleRealInfo sch = null;  
634 - for(ScheduleRealInfo temp : list){  
635 - if(temp.getFcsjActual() == null)  
636 - sch = temp;  
637 - }  
638 -  
639 - return sch;  
640 - }  
641 -  
642 - public List<ScheduleRealInfo> findByBcType(String nbbm, String bcType){  
643 - List<ScheduleRealInfo> all = nbbmScheduleMap.get(nbbm)  
644 - ,outList = new ArrayList<>();  
645 -  
646 - for(ScheduleRealInfo sch : all){  
647 - if(sch.getBcType().equals(bcType))  
648 - outList.add(sch);  
649 - }  
650 - return outList;  
651 - }  
652 -  
653 - public Set<String> allCar(){  
654 - return nbbmScheduleMap.keySet();  
655 - }  
656 -  
657 - public Collection<ScheduleRealInfo> findAll(){  
658 - return nbbmScheduleMap.values();  
659 - }  
660 -  
661 - public void addExecPlan(ScheduleRealInfo sch){  
662 - carExecutePlanMap.put(sch.getClZbh(), sch);  
663 - }  
664 -  
665 - public void removeExecPlan(String clzbh){  
666 - carExecutePlanMap.remove(clzbh);  
667 - }  
668 -  
669 - public Map<String, ScheduleRealInfo> execPlamMap(){  
670 - return carExecutePlanMap;  
671 - }  
672 -  
673 - /**  
674 - * @Title: changeCar  
675 - * @Description: TODO(班次换车) 返回有更新的班次  
676 - * @param @param sch  
677 - * @param @param newClZbh 新的车辆自编号  
678 - */  
679 - public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch , String newClZbh){  
680 - List<ScheduleRealInfo> ups = new ArrayList<>();  
681 - String oldClzbh = sch.getClZbh();  
682 - if(oldClzbh.equals(newClZbh))  
683 - return ups;  
684 -  
685 -  
686 - //变更相关映射信息  
687 - nbbmScheduleMap.remove(sch.getClZbh(), sch);  
688 -  
689 - sch.setClZbh(newClZbh);  
690 - nbbmScheduleMap.put(newClZbh, sch);  
691 - nbbm2SEStationMap.put(newClZbh, sch.getQdzCode());  
692 - nbbm2SEStationMap.put(newClZbh, sch.getZdzCode());  
693 -  
694 - //重新计算班次应到时间  
695 - ups.addAll(updateQdzTimePlan(oldClzbh));  
696 - ups.addAll(updateQdzTimePlan(newClZbh));  
697 - return ups;  
698 - }  
699 -  
700 - /**  
701 - *  
702 - * @Title: linkToSchPlan  
703 - * @Description: TODO(车辆关联到班次)  
704 - */ 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 + */
705 /* public void linkToSchPlan(String nbbm) { 809 /* public void linkToSchPlan(String nbbm) {
706 //当前GPS状态 810 //当前GPS状态
707 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); 811 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm));
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
@@ -215,4 +215,30 @@ public class SchAttrCalculator { @@ -215,4 +215,30 @@ public class SchAttrCalculator {
215 if(sch.getZdsjActualTime() == null && sch.getZdsjActual() != null) 215 if(sch.getZdsjActualTime() == null && sch.getZdsjActual() != null)
216 sch.setZdsjActualAll(sch.getZdsjActual()); 216 sch.setZdsjActualAll(sch.getZdsjActual());
217 } 217 }
  218 +
  219 + /**
  220 + * 计算当前要执行的班次
  221 + * @param list
  222 + * @return
  223 + */
  224 + public ScheduleRealInfo calcCurrentExecSch(List<ScheduleRealInfo> list){
  225 + String lineCode = list.get(0).getXlBm();
  226 + LineConfig conf = lineConfigData.get(lineCode);
  227 + int outConfig = -1;
  228 + if(conf != null)
  229 + outConfig = conf.getOutConfig();
  230 +
  231 + for(ScheduleRealInfo sch : list){
  232 + //如果是出站既出场,忽略出场班次
  233 + if(outConfig == 2 && sch.getBcType().equals("out"))
  234 + continue;
  235 +
  236 + //已执行
  237 + if(StringUtils.isNotEmpty(sch.getZdsjActual()))
  238 + continue;
  239 +
  240 + return sch;
  241 + }
  242 + return null;
  243 + }
218 } 244 }
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
1 package com.bsth.data.schedule.thread; 1 package com.bsth.data.schedule.thread;
2 2
3 -import java.util.Collection;  
4 -import java.util.Set;  
5 -  
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 com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
12 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
13 import com.bsth.data.arrival.ArrivalData_GPS; 5 import com.bsth.data.arrival.ArrivalData_GPS;
@@ -15,6 +7,13 @@ import com.bsth.data.directive.DayOfDirectives; @@ -15,6 +7,13 @@ import com.bsth.data.directive.DayOfDirectives;
15 import com.bsth.data.pilot80.PilotReport; 7 import com.bsth.data.pilot80.PilotReport;
16 import com.bsth.data.schedule.DayOfSchedule; 8 import com.bsth.data.schedule.DayOfSchedule;
17 import com.bsth.entity.realcontrol.LineConfig; 9 import com.bsth.entity.realcontrol.LineConfig;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Component;
  14 +
  15 +import java.util.Collection;
  16 +import java.util.Set;
18 17
19 /** 18 /**
20 * 19 *
@@ -57,6 +56,7 @@ public class ScheduleRefreshThread extends Thread{ @@ -57,6 +56,7 @@ public class ScheduleRefreshThread extends Thread{
57 currSchDate = dayOfSchedule.calcSchDate(lineCode); 56 currSchDate = dayOfSchedule.calcSchDate(lineCode);
58 57
59 if(oldSchDate == null || !oldSchDate.equals(currSchDate)){ 58 if(oldSchDate == null || !oldSchDate.equals(currSchDate)){
  59 +
60 logger.info(lineCode + "开始翻班, " + currSchDate); 60 logger.info(lineCode + "开始翻班, " + currSchDate);
61 //清除进出站数据 61 //清除进出站数据
62 arrivalData.clearRAMData(lineCode); 62 arrivalData.clearRAMData(lineCode);
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/realcontrol/ScheduleType.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +/**
  4 + * 班次类型
  5 + * Created by panzhao on 2016/12/23.
  6 + */
  7 +public enum ScheduleType {
  8 +
  9 + normal, //正常班次
  10 + out, //出场
  11 + in, //进场
  12 + region, //区间
  13 + venting,//直放
  14 + major //放站
  15 +}
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/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -24,6 +24,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -24,6 +24,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
24 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") 24 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
25 List<ScheduleRealInfo> queryUserInfo2(String line,String date); 25 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
26 26
  27 + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
  28 + List<ScheduleRealInfo> queryUserInfo3(String line,String date);
  29 +
27 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs") 30 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs")
28 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName); 31 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName);
29 32
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/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/oil/impl/YlbServiceImpl.java
@@ -131,6 +131,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -131,6 +131,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
131 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); 131 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
132 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 132 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
133 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 133 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  134 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
134 t.setRq(dBefore); 135 t.setRq(dBefore);
135 repository.save(t); 136 repository.save(t);
136 result = "success"; 137 result = "success";
@@ -216,6 +217,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -216,6 +217,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
216 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); 217 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
217 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); 218 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
218 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); 219 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
  220 + t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
219 t.setRq(sdf.parse(rq)); 221 t.setRq(sdf.parse(rq));
220 repository.save(t); 222 repository.save(t);
221 newMap.put("status", ResponseCode.SUCCESS); 223 newMap.put("status", ResponseCode.SUCCESS);
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
@@ -59,7 +59,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -59,7 +59,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
59 */ 59 */
60 void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName); 60 void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName);
61 61
62 - List<ScheduleRealInfo> queryUserInfo(String line,String date); 62 + List<ScheduleRealInfo> queryUserInfo(String line,String date,String state);
63 63
64 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date); 64 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName,String date);
65 65
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) {
@@ -459,8 +459,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -459,8 +459,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
459 } 459 }
460 460
461 @Override 461 @Override
462 - public List<ScheduleRealInfo> queryUserInfo(String line, String date) {  
463 - return scheduleRealInfoRepository.queryUserInfo2(line, date); 462 + public List<ScheduleRealInfo> queryUserInfo(String line, String date,String state) {
  463 + if(state.equals("2")){
  464 + return scheduleRealInfoRepository.queryUserInfo2(line, date);
  465 + }else{
  466 + return scheduleRealInfoRepository.queryUserInfo3(line, date);
  467 + }
  468 +
464 } 469 }
465 /** 470 /**
466 * 471 *
@@ -613,13 +618,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -613,13 +618,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
613 618
614 @Override 619 @Override
615 public List<Object[]> historyMessage(String line, String date, String code) { 620 public List<Object[]> historyMessage(String line, String date, String code) {
616 -  
617 - String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from ("  
618 - + " select equipment_code,car_code from bsth_c_cars where id in("  
619 - + " select cl from bsth_c_s_ccinfo where xl in ( "  
620 - + " select id from bsth_c_line where line_code=?1 ))) t"  
621 - + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "  
622 - + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'";  
623 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 621 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
624 long d= 0; 622 long d= 0;
625 long t=0; 623 long t=0;
@@ -680,7 +678,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -680,7 +678,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
680 sch.addRemarks(remarks); 678 sch.addRemarks(remarks);
681 sch.calcStatus(); 679 sch.calcStatus();
682 680
683 - scheduleRealInfoRepository.save(sch); 681 + dayOfSchedule.save(sch);
  682 + //scheduleRealInfoRepository.save(sch);
684 683
685 ts.add(sch); 684 ts.add(sch);
686 685
@@ -883,10 +882,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -883,10 +882,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
883 next.setQdzArrDateSJ(zdsjActual); 882 next.setQdzArrDateSJ(zdsjActual);
884 ts.add(next); 883 ts.add(next);
885 } 884 }
  885 +
  886 + //重新计算车辆执行班次
  887 + dayOfSchedule.reCalcExecPlan(sch.getClZbh());
886 } 888 }
887 } 889 }
888 else { 890 else {
889 - if(sch.getZdsjActual() != null){ 891 + /*if(sch.getZdsjActual() != null){
890 //将对应的到离站数据标记为不可信 892 //将对应的到离站数据标记为不可信
891 List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh()); 893 List<ArrivalEntity> list = ArrivalData_GPS.findByNbbm(sch.getClZbh());
892 for(ArrivalEntity arr : list){ 894 for(ArrivalEntity arr : list){
@@ -898,7 +900,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -898,7 +900,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
898 break; 900 break;
899 } 901 }
900 } 902 }
901 - } 903 + }*/
902 904
903 //清除实达时间 905 //清除实达时间
904 sch.clearZdsjActual(); 906 sch.clearZdsjActual();
@@ -1182,7 +1184,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1182,7 +1184,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1182 while(it.hasNext()){ 1184 while(it.hasNext()){
1183 ChildTaskPlan childTaskPlan = it.next(); 1185 ChildTaskPlan childTaskPlan = it.next();
1184 if(childTaskPlan.getMileageType().equals("empty")){ 1186 if(childTaskPlan.getMileageType().equals("empty")){
1185 - ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); 1187 + if(childTaskPlan.isDestroy()){
  1188 + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1189 + }else{
  1190 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1191 + }
1186 }else{ 1192 }else{
1187 if(childTaskPlan.isDestroy()){ 1193 if(childTaskPlan.isDestroy()){
1188 remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); 1194 remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
@@ -1240,11 +1246,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1240,11 +1246,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1240 @Override 1246 @Override
1241 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh, 1247 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
1242 String lpName,String date,String type) { 1248 String lpName,String date,String type) {
  1249 + List <ScheduleRealInfo> list=null;
1243 if(type.equals("qp")){ 1250 if(type.equals("qp")){
1244 - return scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date); 1251 + list= scheduleRealInfoRepository.queryListWaybill2(jName,clZbh,lpName,date);
1245 }else{ 1252 }else{
1246 - return scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date); 1253 + list= scheduleRealInfoRepository.queryListWaybill(jName,clZbh,lpName,date);
1247 } 1254 }
  1255 + for (int i = 0; i < list.size(); i++) {
  1256 + ScheduleRealInfo s=list.get(i);
  1257 + String remarks="";
  1258 + if(s.getRemarks()!=null){
  1259 + remarks +=s.getRemarks();
  1260 + }
  1261 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  1262 + if(!childTaskPlans.isEmpty()){
  1263 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1264 + while(it.hasNext()){
  1265 + ChildTaskPlan c = it.next();
  1266 + if(c.getRemarks()!=null && c.getRemarks().length()>0){
  1267 + remarks += c.getRemarks();
  1268 + }
  1269 +
  1270 + }
  1271 + }
  1272 + s.setRemarks(remarks);
  1273 + }
  1274 +
  1275 + return list;
1248 } 1276 }
1249 1277
1250 @Override 1278 @Override
@@ -1325,11 +1353,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1325,11 +1353,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1325 }else{ 1353 }else{
1326 ssgl_other += tempJhlc; 1354 ssgl_other += tempJhlc;
1327 } 1355 }
1328 -  
1329 -  
1330 - }else{  
1331 - ssgl += tempJhlc;  
1332 - ssgl_other += tempJhlc;  
1333 } 1356 }
1334 }else{ 1357 }else{
1335 Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1358 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
@@ -1570,6 +1593,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1570,6 +1593,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1570 //根据线路代码获取公司 1593 //根据线路代码获取公司
1571 Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm()); 1594 Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm());
1572 yesterdayDataList.get(i).put("company", li.getCompany()); 1595 yesterdayDataList.get(i).put("company", li.getCompany());
  1596 + yesterdayDataList.get(i).put("bCompany", li.getBrancheCompany());
1573 //计算总公里 1597 //计算总公里
1574 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 1598 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1575 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 1599 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班
src/main/java/com/bsth/service/report/ReportService.java
@@ -19,11 +19,13 @@ public interface ReportService { @@ -19,11 +19,13 @@ public interface ReportService {
19 19
20 List<Object[]> historyMessageCount(String line, String date, String code); 20 List<Object[]> historyMessageCount(String line, String date, String code);
21 21
22 - Map<String, Object> tbodyTime1(String line ,String date); 22 + Map<String, Object> tbodyTime1(String line ,String ttinfo);
23 23
24 - Map<String, Object> tbodyTime2(String line ,String date); 24 + Map<String, Object> tbodyTime2(String line ,String ttinfo);
25 25
26 - List<Map<String, Object>> tbodyTime3(String line ,String date);  
27 - List<Map<String, Object>> tbodyTime5(String line ,String date); 26 + List<Map<String, Object>> tbodyTime3(String line ,String ttinfo);
  27 + List<Map<String, Object>> tbodyTime5(String line ,String ttinfo);
  28 +
  29 + List<Map<String, Object>> getTtinfo(Map<String, Object> map);
28 30
29 } 31 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -257,16 +257,18 @@ public class ReportServiceImpl implements ReportService{ @@ -257,16 +257,18 @@ public class ReportServiceImpl implements ReportService{
257 return list; 257 return list;
258 } 258 }
259 @Override 259 @Override
260 - public Map<String, Object> tbodyTime1(String line, String date) { 260 + public Map<String, Object> tbodyTime1(String line, String ttinfo) {
261 DecimalFormat df = new DecimalFormat("#0.00"); 261 DecimalFormat df = new DecimalFormat("#0.00");
262 // TODO Auto-generated method stub 262 // TODO Auto-generated method stub
263 //查询配车 263 //查询配车
264 - String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info "  
265 - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "  
266 - + " and xl_bm='"+line+"' and bc_type='normal' "  
267 - + " group by cl_zbh "; 264 + String sqlPc=" select count(*) from bsth_c_cars where id in("
  265 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  266 + + " select id from bsth_c_line where line_code='"+line+"' )"
  267 + + " group by equipment_code ) ";
  268 +
268 Map<String, Object> map=new HashMap<String,Object>(); 269 Map<String, Object> map=new HashMap<String,Object>();
269 - List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc, 270 +
  271 + /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
270 new RowMapper<Map<String, Object>>(){ 272 new RowMapper<Map<String, Object>>(){
271 @Override 273 @Override
272 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { 274 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
@@ -274,13 +276,12 @@ public class ReportServiceImpl implements ReportService{ @@ -274,13 +276,12 @@ public class ReportServiceImpl implements ReportService{
274 m.put("zbh", rs.getString("cl_zbh")); 276 m.put("zbh", rs.getString("cl_zbh"));
275 return m; 277 return m;
276 } 278 }
277 - }); 279 + });*/
278 //配车 280 //配车
279 - int pcs=listPc.size();  
280 -  
281 -  
282 - String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info "  
283 - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"; 281 + int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class);
  282 +
  283 + String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail "
  284 + +" where ttinfo ='"+ttinfo+"' ";
284 285
285 //班次 286 //班次
286 int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60; 287 int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
@@ -306,17 +307,10 @@ public class ReportServiceImpl implements ReportService{ @@ -306,17 +307,10 @@ public class ReportServiceImpl implements ReportService{
306 String fcsjs[]=m.get("fcsj").toString().split(":"); 307 String fcsjs[]=m.get("fcsj").toString().split(":");
307 308
308 zlc +=jhlc; 309 zlc +=jhlc;
309 - if(bcType.equals("normal")){  
310 - qcBc ++;  
311 - if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0  
312 - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){  
313 - zqcBc++;  
314 - }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0  
315 - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){  
316 - wqcBc++;  
317 - }  
318 - yylc +=jhlc;  
319 - }else if(bcType.equals("region")){ 310 + if(bcType.equals("in") || bcType.equals("out")){
  311 + kslc+=jhlc;
  312 + }
  313 + else if(bcType.equals("region")){
320 qjBc++; 314 qjBc++;
321 if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 315 if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
322 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ 316 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
@@ -328,7 +322,15 @@ public class ReportServiceImpl implements ReportService{ @@ -328,7 +322,15 @@ public class ReportServiceImpl implements ReportService{
328 322
329 yylc+=jhlc; 323 yylc+=jhlc;
330 }else{ 324 }else{
331 - kslc+=jhlc; 325 + qcBc ++;
  326 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  327 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
  328 + zqcBc++;
  329 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  330 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  331 + wqcBc++;
  332 + }
  333 + yylc +=jhlc;
332 } 334 }
333 } 335 }
334 336
@@ -346,30 +348,91 @@ public class ReportServiceImpl implements ReportService{ @@ -346,30 +348,91 @@ public class ReportServiceImpl implements ReportService{
346 return map; 348 return map;
347 } 349 }
348 @Override 350 @Override
349 - public Map<String, Object> tbodyTime2(String line, String date) { 351 + public Map<String, Object> tbodyTime2(String line, String ttinfo) {
350 DecimalFormat df = new DecimalFormat("#0.00"); 352 DecimalFormat df = new DecimalFormat("#0.00");
351 // TODO Auto-generated method stub 353 // TODO Auto-generated method stub
352 - //查询配车  
353 - String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info "  
354 - +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "  
355 - + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )"; 354 + //最早营运时间 区分夜宵线
  355 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  356 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  357 + String[] minSjs = minfcsj.split(":");
  358 + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
  359 + //查询时间里程
  360 + String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh FROM bsth_c_s_ttinfo_detail "
  361 + + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
  362 + + " union "
  363 + + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh FROM bsth_c_s_ttinfo_detail "
  364 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
  365 +
356 Map<String, Object> map=new HashMap<String,Object>(); 366 Map<String, Object> map=new HashMap<String,Object>();
357 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, 367 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
358 new RowMapper<Map<String, Object>>(){ 368 new RowMapper<Map<String, Object>>(){
359 @Override 369 @Override
360 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { 370 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
361 Map<String, Object> m=new HashMap<String,Object>(); 371 Map<String, Object> m=new HashMap<String,Object>();
362 - m.put("yysj", rs.getInt("yysj"));  
363 - m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl")); 372 + m.put("fcsj", rs.getString("fcsj"));
  373 + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
  374 + m.put("bcType", rs.getString("bc_type"));
  375 + m.put("lp", rs.getString("lp"));
364 return m; 376 return m;
365 } 377 }
366 }); 378 });
367 int yysj=0 ; 379 int yysj=0 ;
368 double yycs=0 ,yygl=0; 380 double yycs=0 ,yygl=0;
369 - if(list.size()>0){  
370 - Map<String, Object> m=list.get(0);  
371 - yysj=Integer.parseInt((m.get("yysj").toString()));  
372 - yygl=Double.parseDouble(m.get("yygl").toString()); 381 + String lp ="0";
  382 + int sj=0;
  383 +
  384 + for(int i=0;i<list.size();i++){
  385 + Map<String, Object> m=list.get(i);
  386 + String time=m.get("fcsj").toString();
  387 + String[] times = time.split(":");
  388 + if(lp.equals(m.get("lp").toString())){
  389 + if(Integer.parseInt(times[0])*60+Integer.parseInt(times[1]) <=minSj){
  390 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  391 + if(m.get("bcType").equals("in")){
  392 + if(sj!=0){
  393 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  394 + }
  395 + sj=0;
  396 + }
  397 + }else{
  398 + yygl += Double.parseDouble(m.get("yygl").toString());
  399 +
  400 + if(sj==0){
  401 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  402 + }else{
  403 + yysj +=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1])-sj;
  404 + sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
  405 + }
  406 + }
  407 + }else{
  408 + if(m.get("bcType").equals("in") || m.get("bcType").equals("out")){
  409 + if(m.get("bcType").equals("in")){
  410 + if(sj!=0){
  411 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  412 + }
  413 + sj=0;
  414 + }
  415 + }else{
  416 + yygl += Double.parseDouble(m.get("yygl").toString());
  417 +
  418 + if(sj==0){
  419 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  420 + }else{
  421 + yysj +=Integer.parseInt(times[0])*60+Integer.parseInt(times[1])-sj;
  422 + sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  423 + }
  424 + }
  425 + }
  426 + }else{
  427 + if( !(m.get("bcType").equals("in") || m.get("bcType").equals("out"))){
  428 + yygl += Double.parseDouble(m.get("yygl").toString());
  429 + sj =Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
  430 + }else{
  431 + sj=0;
  432 + }
  433 + lp=m.get("lp").toString();
  434 +
  435 + }
373 } 436 }
374 if(yysj>0){ 437 if(yysj>0){
375 yycs =yygl/(yysj*1.0/60); 438 yycs =yygl/(yysj*1.0/60);
@@ -767,4 +830,34 @@ public class ReportServiceImpl implements ReportService{ @@ -767,4 +830,34 @@ public class ReportServiceImpl implements ReportService{
767 newList.add(newmap5); 830 newList.add(newmap5);
768 return newList; 831 return newList;
769 } 832 }
  833 + @Override
  834 + public List<Map<String, Object>> getTtinfo(Map<String, Object> map) {
  835 + // TODO Auto-generated method stub
  836 + List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
  837 + String line = map.get("line").toString();
  838 + try {
  839 + String sql = "select tt.id, tt.name from bsth_c_s_ttinfo tt "
  840 + + "left join bsth_c_line cl on cl.id = tt.xl "
  841 + + " where tt.is_cancel = 0 and tt.is_enable_dis_template = 1";
  842 + if(line.length() != 0){
  843 + sql += " and cl.line_code = '"+line+"'";
  844 + }
  845 + sql += " order by tt.create_date desc";
  846 +
  847 + list = jdbcTemplate.query(sql,
  848 + new RowMapper<Map<String, Object>>(){
  849 + @Override
  850 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  851 + Map<String, Object> map = new HashMap<String, Object>();
  852 + map.put("id", rs.getString("id"));
  853 + map.put("name", rs.getString("name"));
  854 + return map;
  855 + }
  856 + });
  857 + }catch (Exception e) {
  858 + // TODO Auto-generated catch block
  859 + e.printStackTrace();
  860 + }
  861 + return list;
  862 + }
770 } 863 }
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,11 +301,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -259,11 +301,15 @@ 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 }
@@ -276,7 +322,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -276,7 +322,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
276 int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0; 322 int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0;
277 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0; 323 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0;
278 for(ScheduleRealInfo schedule : keyMap.get(key)){ 324 for(ScheduleRealInfo schedule : keyMap.get(key)){
279 - schedule.setFcsjAll(schedule.getFcsj()); 325 +// schedule.setFcsjAll(schedule.getFcsj());
280 326
281 //早晚高峰时段执行率 327 //早晚高峰时段执行率
282 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ 328 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
@@ -299,13 +345,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -299,13 +345,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
299 if(schedule.getFcsjActual() != null){ 345 if(schedule.getFcsjActual() != null){
300 if(schedule.getBcType().equals("out")) 346 if(schedule.getBcType().equals("out"))
301 sjcc++; 347 sjcc++;
302 - schedule.setFcsjActualAll(schedule.getFcsjActual());  
303 - if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ 348 +// schedule.setFcsjActualAll(schedule.getFcsjActual());
  349 + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -1){
304 if(schedule.getXlDir().equals("0")) 350 if(schedule.getXlDir().equals("0"))
305 upfk++; 351 upfk++;
306 else if (schedule.getXlDir().equals("1")) 352 else if (schedule.getXlDir().equals("1"))
307 dnfk++; 353 dnfk++;
308 - } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ 354 + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 3){
309 if(schedule.getXlDir().equals("0")) 355 if(schedule.getXlDir().equals("0"))
310 upfm++; 356 upfm++;
311 else if (schedule.getXlDir().equals("1")) 357 else if (schedule.getXlDir().equals("1"))
@@ -314,15 +360,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -314,15 +360,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
314 } 360 }
315 //到站时间快慢 361 //到站时间快慢
316 if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){ 362 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){ 363 +// schedule.setZdsjActualAll(schedule.getZdsjActual());
  364 +// schedule.setDfsjAll(schedule.getDfsj());
  365 +// schedule.calcEndTime();
  366 + schedule.setZdsjT(schedule.getFcsjT() + schedule.getBcsj());
  367 + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -1){
321 if(schedule.getXlDir().equals("0")) 368 if(schedule.getXlDir().equals("0"))
322 updk++; 369 updk++;
323 else if (schedule.getXlDir().equals("1")) 370 else if (schedule.getXlDir().equals("1"))
324 dndk++; 371 dndk++;
325 - } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ 372 + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 3){
326 if(schedule.getXlDir().equals("0")) 373 if(schedule.getXlDir().equals("0"))
327 updm++; 374 updm++;
328 else if (schedule.getXlDir().equals("1")) 375 else if (schedule.getXlDir().equals("1"))
@@ -337,7 +384,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -337,7 +384,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
337 } 384 }
338 } 385 }
339 386
340 - if(schedule.getBcType().equals("normal")){ 387 + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")){
341 String clZbh = schedule.getClZbh(); 388 String clZbh = schedule.getClZbh();
342 if(!listMap.containsKey(clZbh)) 389 if(!listMap.containsKey(clZbh))
343 listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); 390 listMap.put(clZbh, new ArrayList<ScheduleRealInfo>());
@@ -366,12 +413,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -366,12 +413,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
366 // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj()); 413 // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj());
367 jhsb++; 414 jhsb++;
368 if(shouban.getFcsjActual() != null){ 415 if(shouban.getFcsjActual() != null){
369 - if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) 416 + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -1 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 3)
370 sjsb++; 417 sjsb++;
371 } 418 }
372 jhmb++; 419 jhmb++;
373 if(moban.getFcsjActual() != null){ 420 if(moban.getFcsjActual() != null){
374 - if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) 421 + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -1 && moban.getFcsjActualTime() - moban.getFcsjT() <= 3)
375 sjmb++; 422 sjmb++;
376 } 423 }
377 424
@@ -452,7 +499,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -452,7 +499,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
452 if(company.length() != 0){ 499 if(company.length() != 0){
453 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 500 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
454 } 501 }
455 - sql += " and bc_type = 'normal'"; 502 + sql += " and bc_type != 'in' and bc_type != 'out'";
456 503
457 list = jdbcTemplate.query(sql, 504 list = jdbcTemplate.query(sql,
458 new RowMapper<ScheduleRealInfo>(){ 505 new RowMapper<ScheduleRealInfo>(){
@@ -471,13 +518,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -471,13 +518,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
471 schedule.setBcsj(rs.getInt("bcsj")); 518 schedule.setBcsj(rs.getInt("bcsj"));
472 schedule.setQdzName(rs.getString("qdz_name")); 519 schedule.setQdzName(rs.getString("qdz_name"));
473 schedule.setSpId(rs.getLong("sp_id")); 520 schedule.setSpId(rs.getLong("sp_id"));
  521 +
  522 + if(schedule.getFcsj() != null && schedule.getZdsj() != null){
  523 + String[] split1 = schedule.getFcsj().split(":");
  524 + String[] split2 = schedule.getZdsj().split(":");
  525 + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]);
  526 + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]);
  527 + if(zdsj < fcsj){
  528 + zdsj += 1440;
  529 + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60));
  530 + }
  531 + schedule.setFcsjT((long)fcsj);
  532 + schedule.setZdsjT((long)zdsj);
  533 + }
  534 + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){
  535 + String[] split3 = schedule.getFcsjActual().split(":");
  536 + String[] split4 = schedule.getZdsjActual().split(":");
  537 + int fcsjA = Integer.valueOf(split3[0]) * 60 + Integer.valueOf(split3[1]);
  538 + int zdsjA = Integer.valueOf(split4[0]) * 60 + Integer.valueOf(split4[1]);
  539 + if(fcsjA > zdsjA){
  540 + zdsjA += 1440;
  541 + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60));
  542 + }
  543 + schedule.setFcsjActualTime((long)fcsjA);
  544 + schedule.setZdsjActualTime((long)zdsjA);
  545 + }
  546 +
474 return schedule; 547 return schedule;
475 } 548 }
476 }); 549 });
477 550
478 if(model.length() != 0){ 551 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'"; 552 +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
  553 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'";
481 554
482 ttList = jdbcTemplate.query(sql, 555 ttList = jdbcTemplate.query(sql,
483 new RowMapper<Long>(){ 556 new RowMapper<Long>(){
@@ -784,7 +857,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -784,7 +857,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
784 List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); 857 List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
785 858
786 for(ScheduleRealInfo schedule : list){ 859 for(ScheduleRealInfo schedule : list){
787 - if(!schedule.getBcType().equals("normal")) 860 + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
788 continue; 861 continue;
789 String key = schedule.getXlName(); 862 String key = schedule.getXlName();
790 if(!keyMap.containsKey(key)) 863 if(!keyMap.containsKey(key))
src/main/resources/ms-jdbc.properties
@@ -3,13 +3,7 @@ @@ -3,13 +3,7 @@
3 #ms.mysql.username= root 3 #ms.mysql.username= root
4 #ms.mysql.password= 123456 4 #ms.mysql.password= 123456
5 5
6 -#ms.mysql.driver= com.mysql.jdbc.Driver  
7 -#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8  
8 -#ms.mysql.username= root  
9 -#ms.mysql.password= root2jsp  
10 -  
11 -  
12 ms.mysql.driver= com.mysql.jdbc.Driver 6 ms.mysql.driver= com.mysql.jdbc.Driver
13 -ms.mysql.url= jdbc:mysql://192.168.168.117:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false 7 +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
14 ms.mysql.username= root 8 ms.mysql.username= root
15 -ms.mysql.password= root 9 +ms.mysql.password= root2jsp
16 \ No newline at end of file 10 \ No newline at end of file
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/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/correctForm.html
@@ -226,8 +226,8 @@ @@ -226,8 +226,8 @@
226 // 把渲染好的模版html文本追加到表格中 226 // 把渲染好的模版html文本追加到表格中
227 $('#forms .list_correctForm').html(list_correctForm); 227 $('#forms .list_correctForm').html(list_correctForm);
228 228
229 - var list_correctForm_statistics = template('list_correctForm_statistics',temp);  
230 - $('#forms .list_correctForm_statistics').html(list_correctForm_statistics); 229 + /* var list_correctForm_statistics = template('list_correctForm_statistics',temp);
  230 + $('#forms .list_correctForm_statistics').html(list_correctForm_statistics); */
231 }); 231 });
232 }); 232 });
233 }); 233 });
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/scheduleDaily.html
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 </form> 42 </form>
43 </div> 43 </div>
44 <div class="portlet-body"> 44 <div class="portlet-body">
45 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 400px">
46 <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label> 46 <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
47 <table class="table table-bordered table-hover table-checkable" id="forms"> 47 <table class="table table-bordered table-hover table-checkable" id="forms">
48 <thead> 48 <thead>
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>调度工作日报表</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 10px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 10px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block; margin-left: 10px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 10px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  45 + </div>
  46 + <div class="form-group">
  47 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  48 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body" >
  53 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;height: 400px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr >
  57 + <th style="text-align:center;vertical-align:middle;" rowspan="3">路牌</th>
  58 + <th style="text-align:center;vertical-align:middle;"
  59 + rowspan="2" colspan="2">车号</th>
  60 + <th rowspan="3">班别</th>
  61 + <th colspan="3" style="text-align:center;vertical-align:middle;">驾驶员</th>
  62 + <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
  63 + <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
  64 + <th rowspan="3" style="text-align:center;vertical-align:middle;">记录项目</th>
  65 + <th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
  66 + <th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
  67 + <th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
  68 + <th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
  69 + <th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
  70 + <th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
  71 + <th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
  72 + <th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
  73 + <th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
  74 + <th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
  75 + <th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
  76 + <th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
  77 + <th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
  78 +
  79 + </tr>
  80 + <tr>
  81 +
  82 + <th rowspan="2">职号</th>
  83 + <th colspan="2">接班时间</th>
  84 + <th rowspan="2">职号</th>
  85 + <th colspan="2">接班时间</th>
  86 + <th rowspan="2">到达</th>
  87 + <th rowspan="2">早/迟</th>
  88 + <th rowspan="2">开出</th>
  89 + <th rowspan="2">到达</th>
  90 + <th rowspan="2">早/迟</th>
  91 + <th rowspan="2">开出</th>
  92 + <th rowspan="2">到达</th>
  93 + <th rowspan="2">早/迟</th>
  94 + <th rowspan="2">开出</th>
  95 + <th rowspan="2">到达</th>
  96 + <th rowspan="2">早/迟</th>
  97 + <th rowspan="2">开出</th>
  98 + <th rowspan="2">到达</th>
  99 + <th rowspan="2">早/迟</th>
  100 + <th rowspan="2">开出</th>
  101 + <th rowspan="2">到达</th>
  102 + <th rowspan="2">早/迟</th>
  103 + <th rowspan="2">开出</th>
  104 + <th rowspan="2">到达</th>
  105 + <th rowspan="2">早/迟</th>
  106 + <th rowspan="2">开出</th>
  107 + <th rowspan="2">到达</th>
  108 + <th rowspan="2">早/迟</th>
  109 + <th rowspan="2">开出</th>
  110 + <th rowspan="2">到达</th>
  111 + <th rowspan="2">早/迟</th>
  112 + <th rowspan="2">开出</th>
  113 + <th rowspan="2">到达</th>
  114 + <th rowspan="2">早/迟</th>
  115 + <th rowspan="2">开出</th>
  116 + <th rowspan="2">到达</th>
  117 + <th rowspan="2">早/迟</th>
  118 + <th rowspan="2">开出</th>
  119 + <th rowspan="2">到达</th>
  120 + <th rowspan="2">早/迟</th>
  121 + <th rowspan="2">开出</th>
  122 + <th rowspan="2">到达</th>
  123 + <th rowspan="2">早/迟</th>
  124 + <th rowspan="2">开出</th>
  125 + </tr>
  126 + <tr>
  127 + <th>出场</th>
  128 + <th>调换</th>
  129 + <th>1</th>
  130 + <th>2</th>
  131 + <th>1</th>
  132 + <th>2</th>
  133 + </tr>
  134 + </thead>
  135 + <tbody>
  136 + <tr >
  137 + <td></td>
  138 + <td>
  139 + </td>
  140 + <td></td>
  141 + <td></td>
  142 + <td></td>
  143 + <td colspan="46">
  144 + <div>
  145 +
  146 + </div>
  147 + </td>
  148 + </tr>
  149 +
  150 + </tbody>
  151 + </table>
  152 + <div style="text-align: right;">
  153 + <ul id="pagination" class="pagination"></ul>
  154 + </div>
  155 + </div>
  156 + </div>
  157 + </div>
  158 + </div>
  159 +</div>
  160 +
  161 +<script>
  162 + $(function(){
  163 +
  164 + // 关闭左侧栏
  165 + if (!$('body').hasClass('page-sidebar-closed'))
  166 + $('.menu-toggler.sidebar-toggler').click();
  167 +
  168 + $("#date").datetimepicker({
  169 + format : 'YYYY-MM-DD',
  170 + locale : 'zh-cn'
  171 + });
  172 +
  173 + var d = new Date();
  174 + var year = d.getFullYear();
  175 + var month = d.getMonth() + 1;
  176 + var day = d.getDate();
  177 + if(month < 10)
  178 + month = "0" + month;
  179 + if(day < 10)
  180 + day = "0" + day;
  181 + $("#date").val(year + "-" + month + "-" + day);
  182 +
  183 + $.get('/basic/lineCode2Name',function(result){
  184 + var data=[];
  185 +
  186 + data.push({id: " ", text: "全部线路"});
  187 + for(var code in result){
  188 + data.push({id: code, text: result[code]});
  189 + }
  190 + initPinYinSelect2('#line',data,'');
  191 + })
  192 +
  193 + var obj = [];
  194 + $.get('/user/companyData', function(result){
  195 + obj = result;
  196 + var options = '';
  197 + for(var i = 0; i < obj.length; i++){
  198 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  199 + }
  200 + if(obj.length == 1){
  201 + $('#company1').hide();
  202 + if(obj[0].children.length == 1)
  203 + $('#subCompany1').hide();
  204 + }
  205 + $('#company').html(options);
  206 + updateCompany();
  207 + });
  208 + $("#company").on("change",updateCompany);
  209 + function updateCompany(){
  210 + var company = $('#company').val();
  211 + var options = '';
  212 + for(var i = 0; i < obj.length; i++){
  213 + if(obj[i].companyCode == company){
  214 + var children = obj[i].children;
  215 + for(var j = 0; j < children.length; j++){
  216 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  217 + }
  218 + }
  219 + }
  220 + $('#subCompany').html(options);
  221 + }
  222 +
  223 +
  224 + $("#query").on("click",jsDoQuery);
  225 +
  226 + var line = $("#line").val();
  227 + var date = $("#date").val();
  228 + var company = $("#company").val();
  229 + var subCompany = $("#subCompany").val();
  230 + function jsDoQuery(pagination){
  231 + var params = {};
  232 + line = $("#line").val();
  233 + date = $("#date").val();
  234 + company = $("#company").val();
  235 + subCompany = $("#subCompany").val();
  236 + if(line == " ")
  237 + line = "";
  238 + params['line'] = line;
  239 + params['date'] = date;
  240 + params['type'] = "query";
  241 + params['company'] = company;
  242 + params['subCompany'] = subCompany;
  243 + $(".hidden").removeClass("hidden");
  244 + /* $get('/pcpc/workDaily', params, function(result){
  245 + // 把数据填充到模版中
  246 + var tbodyHtml = template('list_workDaily',{list:result});
  247 + // 把渲染好的模版html文本追加到表格中
  248 + $('#forms tbody').html(tbodyHtml);
  249 +
  250 + }); */
  251 + }
  252 +
  253 + $("#export").on("click",function(){
  254 + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
  255 + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  256 + });
  257 + });
  258 +
  259 +
  260 + });
  261 +
  262 +</script>
  263 +<script type="text/html" id="list_workDaily">
  264 + {{each list as obj i}}
  265 + <tr>
  266 + <td>{{obj.date}}</td>
  267 + <td>{{obj.line}}</td>
  268 + <td>{{obj.jhbc}}</td>
  269 + <td>{{obj.dftz}}</td>
  270 + <td>{{obj.dftzl}}</td>
  271 + <td>{{obj.ccl}}</td>
  272 + <td>{{obj.upfk}}</td>
  273 + <td>{{obj.updk}}</td>
  274 + <td>{{obj.dnfk}}</td>
  275 + <td>{{obj.dndk}}</td>
  276 + <td>{{obj.upfm}}</td>
  277 + <td>{{obj.updm}}</td>
  278 + <td>{{obj.dnfm}}</td>
  279 + <td>{{obj.dndm}}</td>
  280 + <td>{{obj.wdzs}}</td>
  281 + <td>{{obj.smbzdl}}</td>
  282 + <td>{{obj.gfbczxl}}</td>
  283 + </tr>
  284 + {{/each}}
  285 + {{if list.length == 0}}
  286 + <tr>
  287 + <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td>
  288 + </tr>
  289 + {{/if}}
  290 +</script>
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/waybill.html
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 var line = $("#line").val(); 152 var line = $("#line").val();
153 date = $("#date").val(); 153 date = $("#date").val();
154 $(".hidden").removeClass("hidden"); 154 $(".hidden").removeClass("hidden");
155 - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){ 155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
156 // 把数据填充到模版中 156 // 把数据填充到模版中
157 var tbodyHtml = template('list_info',{list:result}); 157 var tbodyHtml = template('list_info',{list:result});
158 // 把渲染好的模版html文本追加到表格中 158 // 把渲染好的模版html文本追加到表格中
src/main/resources/static/pages/forms/statement/waybillQp.html
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 var line = $("#line").val(); 152 var line = $("#line").val();
153 date = $("#date").val(); 153 date = $("#date").val();
154 $(".hidden").removeClass("hidden"); 154 $(".hidden").removeClass("hidden");
155 - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){ 155 + $get('/realSchedule/queryUserInfo',{line:line,date:date,state:3},function(result){
156 // 把数据填充到模版中 156 // 把数据填充到模版中
157 var tbodyHtml = template('list_info',{list:result}); 157 var tbodyHtml = template('list_info',{list:result});
158 // 把渲染好的模版html文本追加到表格中 158 // 把渲染好的模版html文本追加到表格中
src/main/resources/static/pages/mapmonitor/real/js/map/platform/baidu.js
@@ -57,37 +57,39 @@ var baiduMap = (function(){ @@ -57,37 +57,39 @@ var baiduMap = (function(){
57 57
58 map.clearOverlays(); 58 map.clearOverlays();
59 linePolyline = []; 59 linePolyline = [];
60 - //从localStorage里读取路由信息  
61 var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5} 60 var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
62 ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5}; 61 ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};
63 62
64 - var upPos = [], downPos = [], tempArray;  
65 var route = opts.route; 63 var route = opts.route;
66 - //上行 64 + var pos,temps, polyline;
67 if(route.up){ 65 if(route.up){
68 - $.each(route.up.split(','), function(){  
69 - tempArray = this.split(' ');  
70 - upPos.push(new BMap.Point(tempArray[0], tempArray[1])); 66 + $.each(route.up_bd, function (i, item) {
  67 + pos = [];
  68 + $.each(item.split(','), function () {
  69 + temps = this.split(' ');
  70 + pos.push(new BMap.Point(temps[0], temps[1]));
  71 + });
  72 + polyline = new BMap.Polyline(pos, upLineOps);
  73 + map.addOverlay(polyline);
  74 +
  75 + linePolyline.push(polyline);
71 }); 76 });
72 77
73 - var upLine = new BMap.Polyline(upPos, upLineOps);  
74 - map.addOverlay(upLine);  
75 -  
76 - linePolyline.push(upLine);  
77 -  
78 - map.panTo(upPos[parseInt(upPos.length / 2)]); 78 + map.panTo(pos[parseInt(pos.length / 2)]);
79 } 79 }
80 - //下行 80 +
81 if(route.down){ 81 if(route.down){
82 - $.each(route.down.split(','), function(){  
83 - tempArray = this.split(' ');  
84 - downPos.push(new BMap.Point(tempArray[0], tempArray[1])); 82 + $.each(route.down_bd, function (i, item) {
  83 + pos = [];
  84 + $.each(item.split(','), function () {
  85 + temps = this.split(' ');
  86 + pos.push(new BMap.Point(temps[0], temps[1]));
  87 + });
  88 + polyline = new BMap.Polyline(pos, downLineOps);
  89 + map.addOverlay(polyline);
  90 +
  91 + linePolyline.push(polyline);
85 }); 92 });
86 -  
87 - var downLine = new BMap.Polyline(downPos, downLineOps);  
88 - map.addOverlay(downLine);  
89 -  
90 - linePolyline.push(downLine);  
91 } 93 }
92 }, 94 },
93 //绘制GPS信号 95 //绘制GPS信号
src/main/resources/static/pages/mapmonitor/real/js/map/platform/gaode.js
@@ -77,11 +77,43 @@ var gaodeMap = (function() { @@ -77,11 +77,43 @@ var gaodeMap = (function() {
77 77
78 map.clearMap(); 78 map.clearMap();
79 79
80 - var upArr = [], downArr = [];  
81 - var upLineOps = {path: upArr, strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}  
82 - ,downLineOps = {path: downArr, strokeColor:"red", strokeWeight:6, strokeOpacity:0.5}; 80 + //var upArr = [], downArr = [];
  81 + var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}
  82 + ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};
83 var route = opts.route; 83 var route = opts.route;
84 - //上行 84 +
  85 + var pos,temps;
  86 + if(route.up){
  87 + $.each(route.up_gcj, function (i, item) {
  88 + pos = [];
  89 + $.each(item.split(','), function () {
  90 + temps = this.split(' ');
  91 + pos.push([temps[0], temps[1]]);
  92 + });
  93 + upLineOps.path=pos;
  94 + var polyline = new AMap.Polyline(upLineOps);
  95 + polyline.setMap(map);
  96 +
  97 + linePolyline.push(polyline);
  98 + });
  99 + map.setCenter(pos[parseInt(pos.length / 2)]);
  100 + }
  101 +
  102 + if(route.down){
  103 + $.each(route.down_gcj, function (i, item) {
  104 + pos = [];
  105 + $.each(item.split(','), function () {
  106 + temps = this.split(' ');
  107 + pos.push([temps[0], temps[1]]);
  108 + });
  109 + downLineOps.path=pos;
  110 + var polyline = new AMap.Polyline(downLineOps);
  111 + polyline.setMap(map);
  112 +
  113 + linePolyline.push(polyline);
  114 + });
  115 + }
  116 + /*//上行
85 if(route.up){ 117 if(route.up){
86 $.each(route.up_gcj.split(','), function(){ 118 $.each(route.up_gcj.split(','), function(){
87 tempArray = this.split(' '); 119 tempArray = this.split(' ');
@@ -104,7 +136,7 @@ var gaodeMap = (function() { @@ -104,7 +136,7 @@ var gaodeMap = (function() {
104 //保存线条引用 136 //保存线条引用
105 linePolyline.push(downLine); 137 linePolyline.push(downLine);
106 downLine.setMap(map); 138 downLine.setMap(map);
107 - } 139 + }*/
108 //实时路况下不显示 140 //实时路况下不显示
109 if(traffVisible) 141 if(traffVisible)
110 hideLinePolyline(); 142 hideLinePolyline();
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/oil/list.html
@@ -330,7 +330,6 @@ @@ -330,7 +330,6 @@
330 $('tr.filter .filter-submit').on('click', function () { 330 $('tr.filter .filter-submit').on('click', function () {
331 var ylbGsdm=$("#ylbListGsdmId").val(); 331 var ylbGsdm=$("#ylbListGsdmId").val();
332 var ylbFgsdm=$("#ylbListFgsdmId").val(); 332 var ylbFgsdm=$("#ylbListFgsdmId").val();
333 - console.log();  
334 if ($("#rq").val() == "" || $("#rq").val() ==null){ 333 if ($("#rq").val() == "" || $("#rq").val() ==null){
335 layer.msg('请选择日期.'); 334 layer.msg('请选择日期.');
336 }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){ 335 }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
src/main/resources/static/pages/oil/list_ph.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>进出场存油量</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  9 + <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li>
  10 + <li><span class="active">进出场存油量</span></li>
  11 +</ul>
  12 +
  13 +<div class="row" id="ll_oil_list">
  14 + <div class="col-md-12">
  15 + <!-- Begin: life time stats -->
  16 + <div class="portlet light portlet-fit portlet-datatable bordered">
  17 + <div class="portlet-title">
  18 + <div class="caption">
  19 + <i class="fa fa-fire-extinguisher"></i> <span
  20 + class="caption-subject font-dark sbold uppercase">进出场存油量表</span>
  21 + </div>
  22 + <div class="actions">
  23 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a>
  24 + <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> -->
  25 + <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i>
  26 + 拆分/保存
  27 + </button>
  28 + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
  29 + <div class="btn-group">
  30 + <a class="btn red btn-outline btn-circle" href="javascript:;"
  31 + data-toggle="dropdown"> <i class="fa fa-share"></i> <span
  32 + class="hidden-xs"> 系统工具 </span> <i class="fa fa-angle-down"></i>
  33 + </a>
  34 + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools">
  35 + <li><a href="javascript:;" data-action="0"
  36 + class="tool-action" id="obtain"> <i class="fa fa-hourglass-half"></i> 获取加/存油信息
  37 + </a></li>
  38 + <li><a href="javascript:;" data-action="1"
  39 + class="tool-action" id="outAndIn"> <i class="fa fa-pencil"></i> 油耗计算(进场=出场)
  40 + </a></li>
  41 + <li><a href="javascript:;" id="checkYl" data-action="3"
  42 + class="tool-action"> <i class="fa fa-gg-circle"></i>
  43 + 核对加注量(有加油无里程)
  44 + </a></li>
  45 + <li class="divider"></li>
  46 + <li><a href="javascript:;" data-action="3"
  47 + class="tool-action" id="export"> <i class="fa fa-file-excel-o"></i>
  48 + 导出Excel
  49 + </a></li>
  50 + </ul>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + <div class="portlet-body">
  55 + <div class="table-container" style="margin-top: 10px">
  56 + <table
  57 + class="table table-striped table-bordered table-hover table-checkable"
  58 + id="datatable_ylb">
  59 + <thead>
  60 + <tr role="row" class="filter">
  61 + <td> 公司:</td>
  62 + <td colspan="2">
  63 +
  64 + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select>
  65 +
  66 + </td>
  67 + <td>
  68 + 分公司:
  69 + </td>
  70 + <td colspan="2">
  71 +
  72 + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select>
  73 + </td>
  74 +
  75 + <td>
  76 + 日期:
  77 + </td>
  78 + <td>
  79 + <input type="text" style="width: 80px" name="rq" id="rq"/>
  80 + </td>
  81 + <td >
  82 + 线路:
  83 + </td>
  84 + <td colspan="3">
  85 + <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
  86 + &nbsp;
  87 + </td>
  88 + <td >
  89 + 内部编码:
  90 + </td>
  91 + <td colspan="3">
  92 + <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
  93 + </td>
  94 + <td colspan="4">
  95 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
  96 + <i class="fa fa-search"></i> 搜索
  97 + </button>
  98 +
  99 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
  100 + <i class="fa fa-times"></i> 重置
  101 + </button>
  102 +
  103 + </td>
  104 + </tr>
  105 + <tr role="row" class="heading">
  106 + <th width="2%">#</th>
  107 + <th width="8%">日期</th>
  108 + <th width="5%">公司</th>
  109 + <th width="8%">线路</th>
  110 + <th width="5%">自编号</th>
  111 + <th width="6%">驾驶员</th>
  112 + <th width="4%">加油量</th>
  113 + <th width="5%">出场公里</th>
  114 + <th width="4%">进场公里</th>
  115 + <th width="4%">出场存油</th>
  116 + <th width="4%">进场存油</th>
  117 + <th width="5%">油耗</th>
  118 + <th width="5%">燃油类型</th>
  119 + <th width="4%">尿素</th>
  120 + <th width="5%">耗损原因</th>
  121 + <th width="5%">耗损油量</th>
  122 + <th width="5%">当日总里程</th>
  123 + <th width="5%">数据类型</th>
  124 + <th width="5%">百公里油耗</th>
  125 + <!-- <th width="5%">操作</th> -->
  126 + </tr>
  127 + </thead>
  128 + <tbody></tbody>
  129 + </table>
  130 + <div style="text-align: right;">
  131 + <ul id="pagination" class="pagination"></ul>
  132 + </div>
  133 + </div>
  134 + </div>
  135 + </div>
  136 + </div>
  137 +</div>
  138 +
  139 +<script id="ylb_list_temp" type="text/html">
  140 + {{each list as obj i}}
  141 + <tr>
  142 + <td style="vertical-align: middle;">
  143 + <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}">
  144 + </td>
  145 +
  146 + <td>
  147 + {{obj.rq}}
  148 + </td>
  149 + <td>
  150 + {{obj.gsname}}
  151 + </td>
  152 + <td>
  153 + {{obj.xlname}}
  154 + </td>
  155 + <td>
  156 + {{obj.nbbm}}
  157 + </td>
  158 + <td>
  159 + {{obj.jsy}}
  160 + </td>
  161 + <td>
  162 + {{obj.jzl}}
  163 + </td>
  164 + <td>
  165 + {{obj.czlc}}
  166 + </td>
  167 + <td>
  168 + {{obj.jzlc}}
  169 + </td>
  170 + <td>
  171 + {{obj.czyl}}
  172 + </td>
  173 + <td>
  174 + <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzyl">
  175 + {{obj.jzyl}}
  176 + </a>
  177 + </td>
  178 + <td>
  179 + {{obj.yh}}
  180 + </td>
  181 + <td>
  182 + {{obj.rylx}}
  183 + </td>
  184 + <td>
  185 + {{obj.ns}}
  186 + </td>
  187 + <td>
  188 + {{obj.shyy}}
  189 + </td>
  190 + <td>
  191 + {{obj.sh}}
  192 + </td>
  193 + <td>
  194 + {{obj.zlc}}
  195 + </td>
  196 + <td>
  197 + {{obj.yhlx}}
  198 + </td>
  199 + <td>
  200 + {{obj.bglyh}}
  201 + </td>
  202 + <td>
  203 + <!--<a class="btn btn-sm blue btn-outline" href="edit.html?no={{obj.id}}" data-pjax><i class="fa fa-edit"></i> 编辑</a>-->
  204 + </td>
  205 + </tr>
  206 + {{/each}}
  207 + {{if list.length == 0}}
  208 + <tr>
  209 + <td colspan=20><h6 class="muted">没有找到相关数据</h6></td>
  210 + </tr>
  211 + {{/if}}
  212 +</script>
  213 +
  214 +<script>
  215 + $(function () {
  216 + //var id = 15;
  217 + //$('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list')
  218 +
  219 + $("#checkYl").on('click', function () {
  220 + console.log("核对加注量");
  221 + if ($("#rq").val() != "") {
  222 + var cells = $('tr.filter')[0].cells
  223 + , params = {}
  224 + , name;
  225 + $.each(cells, function (i, cell) {
  226 + var items = $('input,select', cell);
  227 + for (var j = 0, item; item = items[j++];) {
  228 + name = $(item).attr('name');
  229 + if (name) {
  230 + params[name] = $(item).val();
  231 + }
  232 + }
  233 + });
  234 + $get('/ylb/checkYl', params, function () {
  235 + jsDoQuery(null, true);
  236 + });
  237 + } else {
  238 + layer.msg('请选择日期.');
  239 + }
  240 + })
  241 +
  242 + //进场等于出场
  243 + $("#outAndIn").on('click', function () {
  244 + console.log("进场油量等于出场油量");
  245 + if ($("#rq").val() != "") {
  246 + var cells = $('tr.filter')[0].cells
  247 + , params = {}
  248 + , name;
  249 + $.each(cells, function (i, cell) {
  250 + var items = $('input,select', cell);
  251 + for (var j = 0, item; item = items[j++];) {
  252 + name = $(item).attr('name');
  253 + if (name) {
  254 + params[name] = $(item).val();
  255 + }
  256 + }
  257 + });
  258 + $get('/ylb/outAndIn', params, function () {
  259 + jsDoQuery(null, true);
  260 + });
  261 + } else {
  262 + layer.msg('请选择日期.');
  263 + }
  264 + })
  265 + //拆分
  266 + $("#sortButton").on('click', function () {
  267 + if ($("#rq").val() != "") {
  268 + var id = $('input.icheck:checked').data('id');
  269 +
  270 + if (typeof(id) == 'undefined') {
  271 + layer.msg("请选择一行进行拆分");
  272 + } else {
  273 + //获取输入的进场存油
  274 + var jzyl = $('.in_carpark_jzyl[data-id='+id+']', '#ll_oil_list').html();
  275 + // $("#jzyl" + id).html();
  276 + console.log(jzyl);
  277 + var params = {};
  278 + params['jzyl'] = jzyl;
  279 + params['id'] = id;
  280 + $get('/ylb/sort', params, function () {
  281 + jsDoQuery(null, true);
  282 + });
  283 +
  284 + }
  285 + } else {
  286 + layer.msg('请选择日期.');
  287 + }
  288 + })
  289 + //获取加存信息
  290 + $("#obtain").on('click', function () {
  291 + console.log("获取加存");
  292 + if ($("#rq").val() != "") {
  293 + var cells = $('tr.filter')[0].cells
  294 + , params = {}
  295 + , name;
  296 + $.each(cells, function (i, cell) {
  297 + var items = $('input,select', cell);
  298 + for (var j = 0, item; item = items[j++];) {
  299 + name = $(item).attr('name');
  300 + if (name) {
  301 + params[name] = $(item).val();
  302 + }
  303 + }
  304 + });
  305 + $get('/ylb/obtain', params, function () {
  306 + jsDoQuery(params, true);
  307 + });
  308 + } else {
  309 + layer.msg('请选择日期.');
  310 + }
  311 +
  312 + })
  313 + $("#rq").datetimepicker({
  314 + format: 'YYYY-MM-DD',
  315 + locale: 'zh-cn'
  316 + });
  317 +
  318 + var page = 0, initPagination;
  319 + var icheckOptions = {
  320 + radioClass: 'iradio_square-blue icheck',
  321 + increaseArea: '20%'
  322 + }
  323 +
  324 + //重置
  325 + $('tr.filter .filter-cancel').on('click', function () {
  326 + $('tr.filter input, select').val('').change();
  327 + });
  328 +
  329 + //提交
  330 + $('tr.filter .filter-submit').on('click', function () {
  331 + var ylbGsdm=$("#ylbListGsdmId").val();
  332 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  333 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  334 + layer.msg('请选择日期.');
  335 + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
  336 + layer.msg('请选择公司和分公司.');
  337 + }else {
  338 + var cells = $('tr.filter')[0].cells
  339 + , params = {}
  340 + , name;
  341 + $.each(cells, function (i, cell) {
  342 + var items = $('input,select', cell);
  343 + for (var j = 0, item; item = items[j++];) {
  344 + name = $(item).attr('name');
  345 + if (name) {
  346 + params[name] = $(item).val();
  347 + }
  348 + }
  349 + });
  350 + page = 0;
  351 + jsDoQuery(params, true);
  352 + }
  353 + });
  354 +
  355 +
  356 +// var gsqxdm="";
  357 +
  358 +
  359 + $.get('/user/companyData', function(result){
  360 + obj = result;
  361 + var options="";
  362 +// = '<option value="">请选择</option>';
  363 + for(var i = 0; i < obj.length; i++){
  364 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  365 +// setFgsqx(obj[i].companyCode);
  366 + }
  367 + $('#ylbListGsdmId').html(options);
  368 + updateCompany();
  369 + });
  370 + /* function setFgsqx(gs){
  371 + var company =gs
  372 + var options = '';
  373 + for(var i = 0; i < obj.length; i++){
  374 + if(obj[i].companyCode == company){
  375 + var children = obj[i].children;
  376 + for(var j = 0; j < children.length; j++){
  377 + gsqxdm +=company+""+children[j].code+",";
  378 + }
  379 + }
  380 + }
  381 + } */
  382 + $("#ylbListGsdmId").on("change",updateCompany);
  383 + function updateCompany(){
  384 + var company = $('#ylbListGsdmId').val();
  385 + var options ="";
  386 +// = '<option value="">请选择</option>';
  387 + for(var i = 0; i < obj.length; i++){
  388 + if(obj[i].companyCode == company){
  389 + var children = obj[i].children;
  390 + for(var j = 0; j < children.length; j++){
  391 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  392 + }
  393 + }
  394 + }
  395 + $('#ylbListFgsdmId').html(options);
  396 + }
  397 + /*
  398 + * 获取数据 p: 要提交的参数, pagination: 是否重新分页
  399 + */
  400 + function jsDoQuery(p, pagination) {
  401 + var params = {};
  402 + if (p)
  403 + params = p;
  404 + //更新时间排序
  405 + params['order'] = 'nbbm';
  406 + params['page'] = page;
  407 + params['rq'] = $("#rq").val();
  408 +
  409 + /* var ylbGsdm=$("#ylbListGsdmId").val();
  410 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  411 + if(ylbGsdm==''|| ylbGsdm==null){
  412 + params['concat(ssgsdm,fgsdm)_in']=gsqxdm;
  413 + }else{
  414 + if(ylbFgsdm==''||ylbFgsdm==null){
  415 + var fgsqx1='';
  416 + for(var i = 0; i < obj.length; i++){
  417 + if(obj[i].companyCode == ylbGsdm){
  418 + var children = obj[i].children;
  419 + for(var j = 0; j < children.length; j++){
  420 + fgsqx1 +=children[j].code+",";
  421 + }
  422 + }
  423 + }
  424 + params['fgsdm_in']=fgsqx1;
  425 + }
  426 + } */
  427 + var i = layer.load(2);
  428 + $get('/ylb', params, function (data) {
  429 + $.each(data.content, function (i, obj) {
  430 + obj.rq = moment(obj.rq).format("YYYY-MM-DD");
  431 + });
  432 + var bodyHtm = template('ylb_list_temp', {list: data.content});
  433 +
  434 + $('#datatable_ylb tbody').html(bodyHtm)
  435 + .find('.icheck').iCheck(icheckOptions)
  436 + .on('ifChanged', iCheckChange);
  437 + if (pagination && data.content.length > 0) {
  438 + //重新分页
  439 + initPagination = true;
  440 + showPagination(data);
  441 + }
  442 + layer.close(i);
  443 +
  444 + startOptJzylLink($('#ll_oil_list .in_carpark_jzyl'));
  445 + });
  446 + }
  447 +
  448 + //改变状态
  449 + function startOptJzylLink(es) {
  450 + es.editable({
  451 + type: 'text',
  452 + placement: 'right',
  453 + width: 100,
  454 + display: false,
  455 + validate: function (value) {
  456 + if (!value)
  457 + return '值不能为空!';
  458 + if (isNaN(value))
  459 + return '只能为数字!';
  460 + if (value < 0)
  461 + return '值不能小于0!';
  462 + },
  463 + inputclass: 'form-control input-medium input-edtable-sm'
  464 + })
  465 + .on('save', function (e, params) {
  466 + $(this).text(params.newValue);
  467 + });
  468 + }
  469 +
  470 + function iCheckChange() {
  471 + var tr = $(this).parents('tr');
  472 + if (this.checked)
  473 + tr.addClass('row-active');
  474 + else
  475 + tr.removeClass('row-active');
  476 +
  477 + /* if($('#datatable_resource input.icheck:checked').length == 1)
  478 + $('#removeButton').removeAttr('disabled');
  479 + else
  480 + $('#removeButton').attr('disabled', 'disabled'); */
  481 + }
  482 +
  483 + function showPagination(data) {
  484 + //分页
  485 + $('#pagination').jqPaginator({
  486 + totalPages: data.totalPages,
  487 + visiblePages: 6,
  488 + currentPage: page + 1,
  489 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  490 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  491 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  492 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  493 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  494 + onPageChange: function (num, type) {
  495 + if (initPagination) {
  496 + initPagination = false;
  497 + return;
  498 + }
  499 +
  500 + var cells = $('tr.filter')[0].cells
  501 + , params = {}
  502 + , name;
  503 + $.each(cells, function (i, cell) {
  504 + var items = $('input,select', cell);
  505 + for (var j = 0, item; item = items[j++];) {
  506 + name = $(item).attr('name');
  507 + if (name) {
  508 + params[name] = $(item).val();
  509 + }
  510 + }
  511 + });
  512 + page = num - 1;
  513 + jsDoQuery(params, true);
  514 + }
  515 + });
  516 + }
  517 +
  518 +
  519 + //删除
  520 + $('#removeButton').on('click', function () {
  521 + if ($(this).attr('disabled'))
  522 + return;
  523 +
  524 + var id = $('input.icheck:checked').data('id');
  525 + removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () {
  526 + $('tr.filter .filter-submit').click();
  527 + });
  528 + });
  529 +
  530 + //搜索线路
  531 + $.get('/basic/lineCode2Name',function(result){
  532 + var data=[];
  533 +
  534 + for(var code in result){
  535 + data.push({id: code, text: result[code]});
  536 + }
  537 + console.log(data);
  538 + initPinYinSelect2('#xlbm',data,'');
  539 +
  540 + })
  541 +
  542 + $('#nbbm').select2({
  543 + placeholder: '搜索车辆...',
  544 + ajax: {
  545 + url: '/realSchedule/sreachVehic',
  546 + dataType: 'json',
  547 + delay: 150,
  548 + data: function (params) {
  549 + return {nbbm: params.term};
  550 + },
  551 + processResults: function (data) {
  552 + return {
  553 + results: data
  554 + };
  555 + },
  556 + cache: true
  557 + },
  558 + templateResult: function (repo) {
  559 + if (repo.loading) return repo.text;
  560 + var h = '<span>' + repo.text + '</span>';
  561 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  562 + return h;
  563 + },
  564 + escapeMarkup: function (markup) {
  565 + return markup;
  566 + },
  567 + minimumInputLength: 1,
  568 + templateSelection: function (repo) {
  569 + return repo.text;
  570 + },
  571 + language: {
  572 + noResults: function () {
  573 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  574 + },
  575 + inputTooShort: function (e) {
  576 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  577 + },
  578 + searching: function () {
  579 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  580 + }
  581 + }
  582 + })
  583 +
  584 +
  585 +//导出
  586 +
  587 + $("#export").on("click", function () {
  588 + if ($("#rq").val() != "") {
  589 + var cells = $('tr.filter')[0].cells
  590 + , params = {}
  591 + , name;
  592 + $.each(cells, function (i, cell) {
  593 + var items = $('input,select', cell);
  594 + for (var j = 0, item; item = items[j++];) {
  595 + name = $(item).attr('name');
  596 + if (name) {
  597 + params[name] = $(item).val();
  598 + }
  599 + }
  600 + });
  601 + console.log(params);
  602 + $post('/ylb/listExport', params, function (result) {
  603 + console.log(result);
  604 + window.open("/downloadFile/download?fileName=进出场存油量" + moment($("#rq").val()).format("YYYYMMDD"));
  605 + });
  606 + } else {
  607 + layer.msg('请选择日期.');
  608 + }
  609 + });
  610 +
  611 + });
  612 +</script>
0 \ No newline at end of file 613 \ No newline at end of file
src/main/resources/static/pages/report/timetable/timetable.html
@@ -40,8 +40,8 @@ @@ -40,8 +40,8 @@
40 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
41 </div> 41 </div>
42 <div style="display: inline-block;margin-left: 15px;"> 42 <div style="display: inline-block;margin-left: 15px;">
43 - <span class="item-label" style="width: 80px;">时间: </span>  
44 - <input class="form-control" type="text" id="date" style="width: 180px;"/> 43 + <span class="item-label" style="width: 80px;">时刻表: </span>
  44 + <select class="form-control" name="ttinfo" id="ttinfo" style="width: 180px;"></select>
45 </div> 45 </div>
46 <div class="form-group"> 46 <div class="form-group">
47 <input class="btn btn-default" type="button" id="query" value="查询"/> 47 <input class="btn btn-default" type="button" id="query" value="查询"/>
@@ -196,10 +196,6 @@ @@ -196,10 +196,6 @@
196 if (!$('body').hasClass('page-sidebar-closed')) 196 if (!$('body').hasClass('page-sidebar-closed'))
197 $('.menu-toggler.sidebar-toggler').click(); 197 $('.menu-toggler.sidebar-toggler').click();
198 198
199 - $("#date").datetimepicker({  
200 - format : 'YYYY-MM-DD',  
201 - locale : 'zh-cn'  
202 - });  
203 199
204 var obj = []; 200 var obj = [];
205 $.get('/user/companyData', function(result){ 201 $.get('/user/companyData', function(result){
@@ -246,27 +242,49 @@ @@ -246,27 +242,49 @@
246 242
247 }) 243 })
248 244
  245 +
  246 + var flag = 0;
  247 + function updateTtinfo(){
  248 + if(flag == 1)
  249 + return;
  250 + flag = 1;
  251 + var treeData = [];
  252 + var params = {};
  253 + params['line'] = $("#line").val();
  254 + $get('/report/getTtinfo', params, function(result){
  255 + treeData = createTreeData(result);
  256 + var options = '<option value="">请选择...</option>';
  257 + $.each(treeData, function(i, g){
  258 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  259 + });
  260 + $('#ttinfo').html(options)/* .select2() */;
  261 + flag = 0;
  262 + });
  263 + }
  264 +
  265 + $("#line").on("change", function(){
  266 + updateTtinfo();
  267 + })
  268 +
249 //查询 269 //查询
250 $("#query").on('click',function(){ 270 $("#query").on('click',function(){
251 - console.log($("#gsdmTime").val());  
252 - console.log($("#fgsdmTime").val());  
253 var line = $("#line").val(); 271 var line = $("#line").val();
254 var xlName = $("#select2-line-container").html(); 272 var xlName = $("#select2-line-container").html();
255 - var date = $("#date").val();  
256 - if(date==null|| date==""){  
257 - layer.msg('请选择日期.');  
258 - }else if(line==null || line ==""){ 273 + var ttinfo = $("#ttinfo").val();
  274 + if(line==null || line ==""){
259 layer.msg('请选择线路.'); 275 layer.msg('请选择线路.');
  276 + }else if(ttinfo==null|| ttinfo==""){
  277 + layer.msg('请选择时刻表.');
260 }else{ 278 }else{
261 - $get('/report/tbodyTime1',{line:line,date:date},function(result){ 279 + $get('/report/tbodyTime1',{line:line,ttinfo:ttinfo},function(result){
262 var tbodyTime1 = template('tbodyTime1',{map:result}); 280 var tbodyTime1 = template('tbodyTime1',{map:result});
263 $('#formsTime1 .tbody_time_1').html(tbodyTime1); 281 $('#formsTime1 .tbody_time_1').html(tbodyTime1);
264 }); 282 });
265 - $.get('/report/tbodyTime2',{line:line,date:date},function(result){ 283 + $.get('/report/tbodyTime2',{line:line,ttinfo:ttinfo},function(result){
266 var tbodyTime2 = template('tbodyTime2',{map:result}); 284 var tbodyTime2 = template('tbodyTime2',{map:result});
267 $('#formsTime2 .tbody_time_2').html(tbodyTime2); 285 $('#formsTime2 .tbody_time_2').html(tbodyTime2);
268 - });  
269 - $.get('/report/tbodyTime3',{line:line,date:date},function(result){ 286 + });/*
  287 + $.get('/report/tbodyTime3',{line:line,ttinfo:ttinfo},function(result){
270 288
271 var tbodyTime3 = template('tbodyTime3',{list:result}); 289 var tbodyTime3 = template('tbodyTime3',{list:result});
272 $('#formsTime3 .tbody_time_3').html(tbodyTime3); 290 $('#formsTime3 .tbody_time_3').html(tbodyTime3);
@@ -274,15 +292,17 @@ @@ -274,15 +292,17 @@
274 var divTime2 = window.document.getElementById('formsTime2'); 292 var divTime2 = window.document.getElementById('formsTime2');
275 console.log(divTime3.offsetHeight); 293 console.log(divTime3.offsetHeight);
276 divTime2.style.height=divTime3.offsetHeight+"px"; 294 divTime2.style.height=divTime3.offsetHeight+"px";
277 - });/* 295 + }); */
  296 +
  297 + /*
278 $.get('/report/tbodyTime4',{line:line,date:date},function(result){ 298 $.get('/report/tbodyTime4',{line:line,date:date},function(result){
279 var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); 299 var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
280 $('#forms .scheduleDaily_3').html(scheduleDaily_3); 300 $('#forms .scheduleDaily_3').html(scheduleDaily_3);
281 });*/ 301 });*/
282 - $.get('/report/tbodyTime5',{line:line,date:date},function(result){ 302 + /* $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){
283 var tbodyTime5 = template('tbodyTime5',{list:result}); 303 var tbodyTime5 = template('tbodyTime5',{list:result});
284 $('#formsTime5 .tbody_time_5').html(tbodyTime5); 304 $('#formsTime5 .tbody_time_5').html(tbodyTime5);
285 - }); 305 + }); */
286 } 306 }
287 307
288 308
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/> 26 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/>
27 </td> 27 </td>
28 <td> 28 <td>
29 - <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carCode_like" placeholder="输入车牌号..."/> 29 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carPlate_like" placeholder="输入车牌号..."/>
30 </td> 30 </td>
31 <td> 31 <td>
32 <div> 32 <div>
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
@@ -158,12 +158,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -158,12 +158,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
158 } 158 }
159 ), 159 ),
160 ttInfo: $resource( 160 ttInfo: $resource(
161 - '/tic/:type', 161 + '/tic_ec/:type',
162 {order: "name", direction: 'ASC'}, 162 {order: "name", direction: 'ASC'},
163 { 163 {
164 list: { 164 list: {
165 method: 'GET', 165 method: 'GET',
166 - isArray: true 166 + isArray: true,
  167 + transformResponse: function(rs) {
  168 + var dst = angular.fromJson(rs);
  169 + if (dst.status == 'SUCCESS') {
  170 + return dst.data;
  171 + } else {
  172 + return dst; // 业务错误留给控制器处理
  173 + }
  174 + }
167 } 175 }
168 } 176 }
169 ), 177 ),
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -522,78 +522,86 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -522,78 +522,86 @@ angular.module(&#39;ScheduleApp&#39;).factory(
522 ); 522 );
523 523
524 // 时刻表明细管理service 524 // 时刻表明细管理service
525 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {  
526 - return {  
527 - rest: $resource(  
528 - '/tidc/:id',  
529 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
530 - {  
531 - get: {  
532 - method: 'GET'  
533 - },  
534 - save: {  
535 - method: 'POST'  
536 - }  
537 - }  
538 - ),  
539 - import: $resource(  
540 - '/tidc/importfile',  
541 - {},  
542 - {  
543 - do: {  
544 - method: 'POST',  
545 - headers: {  
546 - 'Content-Type': 'application/x-www-form-urlencoded'  
547 - },  
548 - transformRequest: function(obj) {  
549 - var str = [];  
550 - for (var p in obj) {  
551 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); 525 +angular.module('ScheduleApp').factory(
  526 + 'TimeTableDetailManageService_g',
  527 + [
  528 + '$resource',
  529 + function($resource) {
  530 + return {
  531 + rest: $resource(
  532 + '/tidc/:id',
  533 + {order: 'createDate', direction: 'DESC', id: '@id'},
  534 + {
  535 + get: {
  536 + method: 'GET'
  537 + },
  538 + save: {
  539 + method: 'POST'
552 } 540 }
553 - return str.join("&");  
554 } 541 }
555 - }  
556 - }  
557 - ),  
558 - edit: $resource(  
559 - '/tidc/edit/:xlid/:ttid',  
560 - {},  
561 - {  
562 - list: {  
563 - method: 'GET'  
564 - }  
565 - }  
566 - ),  
567 - bcdetails: $resource(  
568 - '/tidc/bcdetail',  
569 - {},  
570 - {  
571 - list: {  
572 - method: 'GET',  
573 - isArray: true  
574 - }  
575 - }  
576 - ),  
577 - dataTools: $resource(  
578 - '/tidc/:type',  
579 - {},  
580 - {  
581 - dataExport: {  
582 - method: 'GET',  
583 - responseType: "arraybuffer",  
584 - params: {  
585 - type: "dataExportExt"  
586 - },  
587 - transformResponse: function(data, headers){  
588 - return {data : data}; 542 + ),
  543 + import: $resource(
  544 + '/tidc/importfile',
  545 + {},
  546 + {
  547 + do: {
  548 + method: 'POST',
  549 + headers: {
  550 + 'Content-Type': 'application/x-www-form-urlencoded'
  551 + },
  552 + transformRequest: function(obj) {
  553 + var str = [];
  554 + for (var p in obj) {
  555 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  556 + }
  557 + return str.join("&");
  558 + }
  559 + }
589 } 560 }
590 - }  
591 - }  
592 - ) 561 + ),
  562 + edit: $resource(
  563 + '/tidc/edit/:xlid/:ttid',
  564 + {},
  565 + {
  566 + list: {
  567 + method: 'GET'
  568 + }
  569 + }
  570 + ),
  571 + bcdetails: $resource(
  572 + '/tidc/bcdetail',
  573 + {},
  574 + {
  575 + list: {
  576 + method: 'GET',
  577 + isArray: true
  578 + }
  579 + }
  580 + ),
  581 + dataTools: $resource(
  582 + '/tidc/:type',
  583 + {},
  584 + {
  585 + dataExport: {
  586 + method: 'GET',
  587 + responseType: "arraybuffer",
  588 + params: {
  589 + type: "dataExportExt"
  590 + },
  591 + transformResponse: function(data, headers){
  592 + return {data : data};
  593 + }
  594 + }
  595 + }
  596 + )
593 597
594 - // TODO:导入数据  
595 - };  
596 -}]); 598 + // TODO:导入数据
  599 + };
  600 +
  601 + }
  602 +
  603 + ]
  604 +);
597 // 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 605 // 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
598 606
599 // 文件下载服务 607 // 文件下载服务
@@ -754,12 +762,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -754,12 +762,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
754 } 762 }
755 ), 763 ),
756 ttInfo: $resource( 764 ttInfo: $resource(
757 - '/tic/:type', 765 + '/tic_ec/:type',
758 {order: "name", direction: 'ASC'}, 766 {order: "name", direction: 'ASC'},
759 { 767 {
760 list: { 768 list: {
761 method: 'GET', 769 method: 'GET',
762 - isArray: true 770 + isArray: true,
  771 + transformResponse: function(rs) {
  772 + var dst = angular.fromJson(rs);
  773 + if (dst.status == 'SUCCESS') {
  774 + return dst.data;
  775 + } else {
  776 + return dst; // 业务错误留给控制器处理
  777 + }
  778 + }
763 } 779 }
764 } 780 }
765 ), 781 ),
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
@@ -1096,7 +1096,7 @@ ScheduleApp.config([ @@ -1096,7 +1096,7 @@ ScheduleApp.config([
1096 } 1096 }
1097 }) 1097 })
1098 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 1098 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑
1099 - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', 1099 + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag',
1100 views: { 1100 views: {
1101 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} 1101 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'}
1102 }, 1102 },
@@ -1123,7 +1123,7 @@ ScheduleApp.config([ @@ -1123,7 +1123,7 @@ ScheduleApp.config([
1123 name: 'ttInfoDetailManage_edit_module', 1123 name: 'ttInfoDetailManage_edit_module',
1124 insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 1124 insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
1125 files: [ 1125 files: [
1126 - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" 1126 + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js"
1127 ] 1127 ]
1128 }); 1128 });
1129 }] 1129 }]
@@ -1147,6 +1147,25 @@ ScheduleApp.config([ @@ -1147,6 +1147,25 @@ ScheduleApp.config([
1147 }); 1147 });
1148 }] 1148 }]
1149 } 1149 }
  1150 + })
  1151 + .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改
  1152 + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname',
  1153 + views: {
  1154 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'}
  1155 + },
  1156 + resolve: {
  1157 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1158 + return $ocLazyLoad.load({
  1159 + name: 'ttInfoDetailManage_detail_edit_module',
  1160 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1161 + files: [
  1162 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1163 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1164 + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js"
  1165 + ]
  1166 + });
  1167 + }]
  1168 + }
1150 }); 1169 });
1151 1170
1152 } 1171 }
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/edit.html
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 cmaps="{'rerunTtinfo.id' : 'id'}" 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 dcname="rerunTtinfo.id" 70 dcname="rerunTtinfo.id"
71 icname="id" 71 icname="id"
72 - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}"
73 dsparamsextra="{'type':'all'}" 73 dsparamsextra="{'type':'all'}"
74 iterobjname="item" 74 iterobjname="item"
75 iterobjexp="item.name + '-' + item.xl.name" 75 iterobjexp="item.name + '-' + item.xl.name"
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 cmaps="{'rerunTtinfo.id' : 'id'}" 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 dcname="rerunTtinfo.id" 70 dcname="rerunTtinfo.id"
71 icname="id" 71 icname="id"
72 - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false}, atype:'ttInfo' } | json }}" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}"
73 dsparamsextra="{'type':'all'}" 73 dsparamsextra="{'type':'all'}"
74 iterobjname="item" 74 iterobjname="item"
75 iterobjexp="item.name + '-' + item.xl.name" 75 iterobjexp="item.name + '-' + item.xl.name"
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <span ng-bind="info.fcsj"></span> 77 <span ng-bind="info.fcsj"></span>
78 </td> 78 </td>
79 <td> 79 <td>
80 - <abbr title="info.ttInfoName">{{info.ttInfoName}}</abbr> 80 + <abbr title="{{info.ttInfoName}}"><span>{{info.ttInfoName}}</span></abbr>
81 </td> 81 </td>
82 82
83 </tr> 83 </tr>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html 0 → 100644
  1 +<div ng-controller="TimeTableDetailManageFormCtrl_old2 as ctrl">
  2 + <div class="page-head">
  3 + <div class="page-title">
  4 + <h1>修改班次信息</h1>
  5 + </div>
  6 + </div>
  7 +
  8 + <ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a ui-sref="ttInfoManage">时刻表管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a>
  23 + <i class="fa fa-circle"></i>
  24 + </li>
  25 + <li>
  26 + <span class="active">修改班次信息</span>
  27 + </li>
  28 + </ul>
  29 +
  30 + <div class="portlet light bordered">
  31 + <div class="portlet-title">
  32 + <div class="caption">
  33 + <i class="icon-equalizer font-red-sunglo"></i> <span
  34 + class="caption-subject font-red-sunglo bold uppercase" >批量信息修改</span>
  35 + </div>
  36 + </div>
  37 +
  38 + <div class="portlet-body form">
  39 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  40 + <div class="form-body">
  41 +
  42 + <div class="form-group has-success has-feedback">
  43 + <label class="col-md-3 control-label">方向:</label>
  44 + <div class="col-md-7">
  45 + <sa-Radiogroup model="ctrl.TimeTableDetailForSave.xlDir" dicgroup="LineTrend" name="xlDir"></sa-Radiogroup>
  46 + </div>
  47 +
  48 + </div>
  49 + <div class="form-group">
  50 + <label class="col-md-3 control-label">起点站:</label>
  51 + <div class="col-md-7">
  52 + <sa-Select3 model="ctrl.TimeTableDetailForSave"
  53 + name="qdz"
  54 + placeholder="请输拼音..."
  55 + dcvalue="{{ctrl.TimeTableDetailForSave.qdz.id}}"
  56 + dcname="qdz.id"
  57 + icname="stationid"
  58 + icnames="stationname"
  59 + datatype="zd"
  60 + dataassociate="true"
  61 + dataparam="{{ {'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}"
  62 + mlp="true"
  63 + >
  64 + </sa-Select3>
  65 + </div>
  66 + </div>
  67 + <div class="form-group">
  68 + <label class="col-md-3 control-label">终点站:</label>
  69 + <div class="col-md-7">
  70 + <sa-Select3 model="ctrl.TimeTableDetailForSave"
  71 + name="zdz"
  72 + placeholder="请输拼音..."
  73 + dcvalue="{{ctrl.TimeTableDetailForSave.zdz.id}}"
  74 + dcname="zdz.id"
  75 + icname="stationid"
  76 + icnames="stationname"
  77 + datatype="zd"
  78 + dataassociate="true"
  79 + dataparam="{{ {'xlid': ctrl.xlid, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}"
  80 + mlp="true"
  81 + >
  82 + </sa-Select3>
  83 + </div>
  84 + </div>
  85 + <div class="form-group">
  86 + <label class="col-md-3 control-label">停车场:</label>
  87 + <div class="col-md-7">
  88 + <sa-Select3 model="ctrl.TimeTableDetailForSave"
  89 + name="tcc"
  90 + placeholder="请输拼音..."
  91 + dcvalue="{{ctrl.TimeTableDetailForSave.tcc.id}}"
  92 + dcname="tcc.id"
  93 + icname="id"
  94 + icnames="parkName"
  95 + datatype="tcc"
  96 + mlp="true"
  97 + >
  98 + </sa-Select3>
  99 + </div>
  100 + </div>
  101 +
  102 + <div class="form-group has-success has-feedback">
  103 + <label class="col-md-3 control-label">发车时间:</label>
  104 + <div class="col-md-7">
  105 + <input type="text" class="form-control"
  106 + ng-model="ctrl.TimeTableDetailForSave.fcsj"
  107 + />
  108 + </div>
  109 +
  110 + </div>
  111 + <div class="form-group">
  112 + <label class="col-md-3 control-label">计划里程:</label>
  113 + <div class="col-md-7">
  114 + <input type="text" class="form-control"
  115 + ng-model="ctrl.TimeTableDetailForSave.jhlc"
  116 + />
  117 + </div>
  118 +
  119 + </div>
  120 + <div class="form-group">
  121 + <label class="col-md-3 control-label">班次历时:</label>
  122 + <div class="col-md-7">
  123 + <input type="text" class="form-control"
  124 + ng-model="ctrl.TimeTableDetailForSave.bcsj"
  125 + />
  126 + </div>
  127 +
  128 + </div>
  129 +
  130 + </div>
  131 +
  132 + <div class="form-actions">
  133 + <div class="row">
  134 + <div class="col-md-offset-3 col-md-4">
  135 + <button type="submit" class="btn green"
  136 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  137 + <a type="button" class="btn default"
  138 + ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a>
  139 + </div>
  140 + </div>
  141 + </div>
  142 + </form>
  143 +
  144 + </div>
  145 + </div>
  146 +
  147 +
  148 +
  149 +
  150 +</div>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html
@@ -55,9 +55,9 @@ @@ -55,9 +55,9 @@
55 </a> 55 </a>
56 <ul class="dropdown-menu pull-right"> 56 <ul class="dropdown-menu pull-right">
57 <li> 57 <li>
58 - <a href="javascript:" class="tool-action"> 58 + <a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()">
59 <i class="fa fa-file-excel-o"></i> 59 <i class="fa fa-file-excel-o"></i>
60 - 导出excel 60 + 批量修改
61 </a> 61 </a>
62 </li> 62 </li>
63 <li class="divider"></li> 63 <li class="divider"></li>
@@ -79,20 +79,21 @@ @@ -79,20 +79,21 @@
79 <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column"> 79 <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column">
80 <thead> 80 <thead>
81 <tr> 81 <tr>
82 - <th ng-repeat="head in ctrl.detailHeads track by $index"> 82 + <th ng-repeat="head in ctrl.getDetailHeads() track by $index">
83 <span ng-bind="head"></span> 83 <span ng-bind="head"></span>
84 </th> 84 </th>
85 85
86 </tr> 86 </tr>
87 </thead> 87 </thead>
88 <tbody> 88 <tbody>
89 - <tr ng-repeat="info in ctrl.detailInfos"> 89 + <tr ng-repeat="info in ctrl.getDetailInfos()">
90 <td ng-repeat="cell in info track by $index"> 90 <td ng-repeat="cell in info track by $index">
91 91
92 <!--<span ng-bind="cell.fcsj"></span>--> 92 <!--<span ng-bind="cell.fcsj"></span>-->
93 <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span> 93 <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span>
94 94
95 <div ng-if="cell.ttdid" class="btn-group"> 95 <div ng-if="cell.ttdid" class="btn-group">
  96 + <input type="checkbox" ng-model="cell.sel"/>
96 <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown"> 97 <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown">
97 <!-- 上下行图标 --> 98 <!-- 上下行图标 -->
98 <i ng-if="cell.xldir == '0'" class="fa fa-arrow-up" aria-hidden="true"></i> 99 <i ng-if="cell.xldir == '0'" class="fa fa-arrow-up" aria-hidden="true"></i>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit2.html
1 -<h1>测试handsontable</h1> 1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>时刻表管理</h1>
  4 + </div>
  5 +</div>
2 6
3 -<div ng-controller="tt_edit2 as ctrl">  
4 - <hot-table col-headers="ctrl.colHeaders" datarows="ctrl.data">  
5 - <hot-column ng-repeat="column in ctrl.columns" data="{{column.data}}"  
6 - title="column.title" read-only="column.readOnly"></hot-column>  
7 - </hot-table> 7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax>首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="ttInfoManage">时刻表管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">编辑时刻表明细信息</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="row" id="timeTableDetail" ng-controller="TTInfoDetailManageCtrl as ctrl">
  26 + <div class="col-md-12">
  27 + <div class="portlet light bordered">
  28 + <div class="portlet-title">
  29 + <div class="caption font-dark">
  30 + <i class="fa fa-database font-dark"></i>
  31 + <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span>
  32 + </div>
  33 + <div class="actions">
  34 + <i class="fa fa-arrow-up" aria-hidden="true"></i>
  35 + <span style="padding-right: 10px;">上行班次</span>
  36 + <i class="fa fa-arrow-down" aria-hidden="true"></i>
  37 + <span style="padding-right: 10px;">下行班次</span>
  38 + <i class="fa fa-circle-o-notch" aria-hidden="true"></i>
  39 + <span style="padding-right: 10px;">区间班次</span>
  40 + <i class="fa fa-adjust" aria-hidden="true"></i>
  41 + <span style="padding-right: 10px;">分班班次</span>
  42 +
  43 + <div class="btn-group">
  44 + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">
  45 + <i class="fa fa-share"></i>
  46 + <span>数据工具</span>
  47 + <i class="fa fa-angle-down"></i>
  48 + </a>
  49 + <ul class="dropdown-menu pull-right">
  50 + <li>
  51 + <a href="javascript:" class="tool-action">
  52 + <i class="fa fa-file-excel-o"></i>
  53 + 导出excel
  54 + </a>
  55 + </li>
  56 + <li class="divider"></li>
  57 + <li>
  58 + <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()">
  59 + <i class="fa fa-refresh"></i>
  60 + 刷行数据
  61 + </a>
  62 + </li>
  63 + </ul>
  64 + </div>
  65 +
  66 + </div>
  67 + </div>
  68 +
  69 + <div class="portlet-body">
  70 + <!--<div ng-view></div>-->
  71 + <div class="fixDiv">
  72 +
  73 + <hot-table datarows="ctrl.getData()" settings="ctrl.settings">
  74 + <hot-column ng-repeat="column in ctrl.getColHeaders()"
  75 + data="{{column.data}}"
  76 + title="column.title" read-only="column.readOnly"></hot-column>
  77 + </hot-table>
  78 +
  79 + </div>
  80 +
  81 +
  82 + </div>
  83 + </div>
  84 + </div>
8 </div> 85 </div>
9 \ No newline at end of file 86 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js 0 → 100644
  1 +// 保存时刻表明细编辑信息
  2 +angular.module('ScheduleApp').factory(
  3 + '$$TTInfoDetail_edit2_info',
  4 + [
  5 + 'TimeTableDetailManageService_g',
  6 + function(service) {
  7 + var editInfo = {}; // 转换好的内部明细数据
  8 + editInfo.colHeaders = [ // 这个要动态生成的
  9 + {
  10 + data: 'lpName',
  11 + title: '路牌',
  12 + type: 'text',
  13 + readOnly: true
  14 + },
  15 + {
  16 + data: 'fcsj1',
  17 + id: 'detailId1',
  18 + title: '出场',
  19 + type: 'text',
  20 + readOnly: true
  21 + },
  22 + {
  23 + data: 'fcsj2',
  24 + id: 'detailId2',
  25 + title: '和静路安亭老街',
  26 + type: 'text',
  27 + readOnly: true
  28 + },
  29 + {
  30 + data: 'fcsj3',
  31 + id: 'detailId3',
  32 + title: '福泉路天山西路',
  33 + type: 'text',
  34 + readOnly: true
  35 + },
  36 + {
  37 + data: 'fcsj4',
  38 + id: 'detailId4',
  39 + title: '和静路安亭老街',
  40 + type: 'text',
  41 + readOnly: true
  42 + },
  43 + {
  44 + data: 'fcsj5',
  45 + id: 'detailId5',
  46 + title: '福泉路天山西路',
  47 + type: 'text',
  48 + readOnly: true
  49 + },
  50 + {
  51 + data: 'fcsj6',
  52 + id: 'detailId6',
  53 + title: '进场',
  54 + type: 'text',
  55 + readOnly: true
  56 + }
  57 +
  58 +
  59 + ];
  60 + editInfo.items= [
  61 + {
  62 + lpName: '1',
  63 + fcsj1: '0615',
  64 + detailId1: 1,
  65 + fcsj2: '0615',
  66 + detailId2: 1,
  67 + fcsj3: '0615',
  68 + detailId3: 1,
  69 + fcsj4: '0615',
  70 + detailId4: 1,
  71 + fcsj5: '0615',
  72 + detailId5: 1,
  73 + fcsj6: '0615',
  74 + detailId6: 1,
  75 + },
  76 + {
  77 + lpName: '2',
  78 + fcsj1: '0615',
  79 + detailId1: 1,
  80 + fcsj2: '0615',
  81 + detailId2: 1,
  82 + fcsj3: '0615',
  83 + detailId3: 1,
  84 + fcsj4: '0615',
  85 + detailId4: 1,
  86 + fcsj5: '0615',
  87 + detailId5: 1,
  88 + fcsj6: '0615',
  89 + detailId6: 1,
  90 + },
  91 + {
  92 + lpName: '3',
  93 + fcsj1: '0615',
  94 + detailId1: 1,
  95 + fcsj2: '0615',
  96 + detailId2: 1,
  97 + fcsj3: '0615',
  98 + detailId3: 1,
  99 + fcsj4: '0615',
  100 + detailId4: 1,
  101 + fcsj5: '0615',
  102 + detailId5: 1,
  103 + fcsj6: '0615',
  104 + detailId6: 1,
  105 + },
  106 + {
  107 + lpName: '4',
  108 + fcsj1: '0615',
  109 + detailId1: 1,
  110 + fcsj2: '0615',
  111 + detailId2: 1,
  112 + fcsj3: '0615',
  113 + detailId3: 1,
  114 + fcsj4: '0615',
  115 + detailId4: 1,
  116 + fcsj5: '0615',
  117 + detailId5: 1,
  118 + fcsj6: '0615',
  119 + detailId6: 1,
  120 + },
  121 + {
  122 + lpName: '5',
  123 + fcsj1: '0615',
  124 + detailId1: 1,
  125 + fcsj2: '0615',
  126 + detailId2: 1,
  127 + fcsj3: '0615',
  128 + detailId3: 1,
  129 + fcsj4: '0615',
  130 + detailId4: 1,
  131 + fcsj5: '0615',
  132 + detailId5: 1,
  133 + fcsj6: '0615',
  134 + detailId6: 1,
  135 + },
  136 + {
  137 + lpName: '6',
  138 + fcsj1: '0615',
  139 + detailId1: 1,
  140 + fcsj2: '0615',
  141 + detailId2: 1,
  142 + fcsj3: '0615',
  143 + detailId3: 1,
  144 + fcsj4: '0615',
  145 + detailId4: 1,
  146 + fcsj5: '0615',
  147 + detailId5: 1,
  148 + fcsj6: '0615',
  149 + detailId6: 1,
  150 + }
  151 +
  152 + ];
  153 +
  154 +
  155 + //this.columns = [
  156 + // {
  157 + // data: 'id',
  158 + // title: 'ID',
  159 + // readOnly: true
  160 + // },
  161 + // {
  162 + // data: 'price',
  163 + // title: 'Price',
  164 + // readOnly: false
  165 + // }
  166 + //];
  167 +
  168 + // demo data
  169 +
  170 +
  171 + return {
  172 + getEditDetailInfo: function() {
  173 + return editInfo;
  174 + },
  175 + refreshEditDetail: function() {
  176 + // TODO:
  177 +
  178 + return editInfo;
  179 + }
  180 + }
  181 + }
  182 + ]
  183 +);
  184 +
  185 +// edit2.html 页面
  186 +angular.module('ScheduleApp').controller(
  187 + 'TTInfoDetailManageCtrl',
  188 + [
  189 + 'TimeTableDetailManageService_g',
  190 + '$stateParams',
  191 + '$$TTInfoDetail_edit2_info',
  192 + function(service, $stateParams, detailService) {
  193 + var self = this;
  194 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  195 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  196 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  197 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  198 +
  199 + self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  200 +
  201 + self.getColHeaders = function() {
  202 + return detailService.getEditDetailInfo().colHeaders;
  203 + };
  204 + self.getData = function() {
  205 + return detailService.getEditDetailInfo().items;
  206 + };
  207 + self.test = function() {
  208 + alert("test");
  209 + };
  210 +
  211 + var m1 = '<a href="javascript:" class="tool-action" ng-click="ctrl.test()">m1</a>';
  212 +
  213 + self.settings = {
  214 + contextMenu: [
  215 + m1
  216 + ]
  217 + };
  218 +
  219 + // TODO:判定是否刷新数据
  220 + detailService.refreshEditDetail();
  221 +
  222 +
  223 +
  224 + }
  225 + ]
  226 +);
0 \ No newline at end of file 227 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
@@ -30,7 +30,7 @@ ScheduleApp.config([ @@ -30,7 +30,7 @@ ScheduleApp.config([
30 } 30 }
31 }) 31 })
32 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 32 .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑
33 - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', 33 + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname/:rflag',
34 views: { 34 views: {
35 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} 35 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'}
36 }, 36 },
@@ -57,7 +57,7 @@ ScheduleApp.config([ @@ -57,7 +57,7 @@ ScheduleApp.config([
57 name: 'ttInfoDetailManage_edit_module', 57 name: 'ttInfoDetailManage_edit_module',
58 insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 58 insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
59 files: [ 59 files: [
60 - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" 60 + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module2.js"
61 ] 61 ]
62 }); 62 });
63 }] 63 }]
@@ -81,6 +81,25 @@ ScheduleApp.config([ @@ -81,6 +81,25 @@ ScheduleApp.config([
81 }); 81 });
82 }] 82 }]
83 } 83 }
  84 + })
  85 + .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改
  86 + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname',
  87 + views: {
  88 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'}
  89 + },
  90 + resolve: {
  91 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  92 + return $ocLazyLoad.load({
  93 + name: 'ttInfoDetailManage_detail_edit_module',
  94 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  95 + files: [
  96 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  97 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  98 + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js"
  99 + ]
  100 + });
  101 + }]
  102 + }
84 }); 103 });
85 104
86 } 105 }
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
  1 +// 时刻表明晰编辑信息service
  2 +angular.module('ScheduleApp').factory(
  3 + 'TimeTableDetailManageService_old',
  4 + [
  5 + 'TimeTableDetailManageService_g',
  6 + '$state',
  7 + '$q',
  8 + function(service, $state, $q) {
1 9
2 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_old', ['TimeTableDetailManageService_g', function(service) {  
3 -  
4 - return {  
5 - /**  
6 - * 获取明细信息。  
7 - * @param id 车辆id  
8 - * @return 返回一个 promise  
9 - */  
10 - getDetail: function(id) {  
11 - var params = {id: id};  
12 - return service.rest.get(params).$promise;  
13 - },  
14 - /**  
15 - * 保存信息。  
16 - * @param obj 车辆详细信息  
17 - * @return 返回一个 promise  
18 - */  
19 - saveDetail: function(obj) {  
20 - return service.rest.save(obj).$promise;  
21 - },  
22 - /**  
23 - * 获取编辑用的时刻表明细数据。  
24 - * @param ttid 时刻表id  
25 - */  
26 - getEditInfo: function(xlid, ttid) {  
27 - var params = {xlid : xlid, ttid : ttid};  
28 - return service.edit.list(params).$promise;  
29 - }  
30 - };  
31 -  
32 -}]);  
33 -  
34 -angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$uibModal', function(service, $stateParams, $uibModal) {  
35 - var self = this;  
36 - self.xlid = $stateParams.xlid; // 获取传过来的线路id  
37 - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id  
38 - self.xlname = $stateParams.xlname; // 获取传过来的线路名字  
39 - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字  
40 -  
41 - self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";  
42 -  
43 - // 载入待编辑的时刻表明细数据  
44 - service.getEditInfo(self.xlid, self.ttid).then(  
45 - function(result) {  
46 - // TODO;获取数据待展示  
47 - self.detailHeads = result.header;  
48 - self.detailInfos = result.contents;  
49 - },  
50 - function(result) {  
51 - alert("出错啦!"); 10 + // 查询对象类
  11 + var queryClass = service.rest;
  12 +
  13 + // 时刻表信息
  14 + var editInfo = {
  15 + detailHeads: [], // 时刻表头信息
  16 + detailInfos: [] // 时刻表明细信息
  17 + };
  18 +
  19 + return {
  20 + getQueryClass: function() {
  21 + return queryClass;
  22 + },
  23 + getEditInfo: function() {
  24 + return editInfo;
  25 + },
  26 +
  27 + /**
  28 + * 获取编辑用的时刻表明细数据。
  29 + * @param xlid 线路id
  30 + * @param ttid 时刻表id
  31 + */
  32 + refreshEditInfo: function(xlid, ttid) {
  33 + editInfo = {
  34 + detailHeads: [], // 时刻表头信息
  35 + detailInfos: [] // 时刻表明细信息
  36 + };
  37 +
  38 + service.edit.list({xlid: xlid, ttid: ttid}, function(result) {
  39 + editInfo.detailHeads = result.header;
  40 + editInfo.detailInfos = result.contents;
  41 +
  42 + // detailInfos里添加是否选中的flag
  43 + for (var i = 0; i < editInfo.detailInfos.length; i++) {
  44 + for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
  45 + editInfo.detailInfos[i][j].sel = false;
  46 + }
  47 + }
  48 + });
  49 + },
  50 +
  51 + editIsSel: function() { // 是否有被选中的
  52 + var flag = false;
  53 + for (var i = 0; i < editInfo.detailInfos.length; i++) {
  54 + for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
  55 + if (editInfo.detailInfos[i][j].sel == true)
  56 + return true;
  57 + }
  58 + }
  59 + return flag;
  60 + },
  61 +
  62 + editInfos: function(updateObject) { // 批量保存数据
  63 + var deferred = $q.defer();
  64 +
  65 + // 找出所有选中的ttinfodetailids
  66 + var ttinfodetailIds = [];
  67 + for (var i = 0; i < editInfo.detailInfos.length; i++) {
  68 + for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
  69 + if (editInfo.detailInfos[i][j].sel == true)
  70 + ttinfodetailIds.push(editInfo.detailInfos[i][j]);
  71 + }
  72 + }
  73 + // ajax调用
  74 + var success_counts = 0; // 成功数
  75 + var error_counts = 0; // 失败数
  76 + for (var n = 0; n < ttinfodetailIds.length; n++) {
  77 + (function(index) {
  78 + queryClass.get({id: ttinfodetailIds[index].ttdid}, function(value) {
  79 + for (var key in updateObject) {
  80 + if (updateObject[key]) {
  81 + value[key] = updateObject[key];
  82 + }
  83 + }
  84 + value.$save(function() {
  85 + // 赋值(上下行,发车时间,班次类型)
  86 + if (value.fcsj) {
  87 + ttinfodetailIds[index].fcsj = value.fcsj;
  88 + }
  89 + if (value.xlDir) {
  90 + ttinfodetailIds[index].xldir = value.xlDir;
  91 + }
  92 + if (value.bcType) {
  93 + ttinfodetailIds[index].bc_type = value.bcType;
  94 + }
  95 +
  96 + success_counts ++;
  97 + if (success_counts + error_counts == ttinfodetailIds.length) {
  98 + deferred.resolve();
  99 + }
  100 + }, function() {
  101 + error_counts ++;
  102 + if (success_counts + error_counts == ttinfodetailIds.length) {
  103 + deferred.reject();
  104 + }
  105 + });
  106 + }, function() {
  107 + error_counts ++;
  108 + if (success_counts + error_counts == ttinfodetailIds.length) {
  109 + deferred.reject();
  110 + }
  111 + });
  112 + })(n);
  113 + }
  114 +
  115 + return deferred.promise;
  116 + }
  117 +
  118 +
  119 + };
52 } 120 }
53 - );  
54 -  
55 - // 刷新数据  
56 - self.refresh = function() {  
57 - service.getEditInfo(self.xlid, self.ttid).then(  
58 - function(result) {  
59 - // TODO;获取数据待展示  
60 - self.detailHeads = result.header;  
61 - self.detailInfos = result.contents;  
62 - },  
63 - function(result) {  
64 - alert("出错啦!");  
65 - }  
66 - );  
67 - };  
68 -  
69 - /**  
70 - * 反向操作。  
71 - * @param cell 明细信息  
72 - */  
73 - self.changeDirect = function(detailInfo, xldir) {  
74 - service.getDetail(detailInfo.ttdid).then(  
75 - function(result) {  
76 - result.xlDir = xldir;  
77 - service.saveDetail(result).then(  
78 - function(result) { 121 +
  122 + ]
  123 +);
  124 +
  125 +// edit.html 时刻表编辑界面
  126 +angular.module('ScheduleApp').controller(
  127 + 'TimeTableDetailManageCtrl_old',
  128 + [
  129 + 'TimeTableDetailManageService_old',
  130 + '$stateParams',
  131 + '$uibModal',
  132 + '$state',
  133 + function(service, $stateParams, $uibModal, $state) {
  134 + var self = this;
  135 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  136 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  137 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  138 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  139 + self.rflag = $stateParams.rflag; // 刷新标志
  140 +
  141 + self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  142 +
  143 + // 获取时刻表明细数据(内部保存)
  144 + self.getDetailHeads = function() {
  145 + return service.getEditInfo().detailHeads;
  146 + };
  147 + self.getDetailInfos = function() {
  148 + return service.getEditInfo().detailInfos;
  149 + };
  150 +
  151 + // 刷新时刻表数据
  152 + self.refresh = function() {
  153 + service.refreshEditInfo(self.xlid, self.ttid);
  154 + };
  155 +
  156 + // 批量修改
  157 + self.editInfos = function() {
  158 + if (!service.editIsSel()) {
  159 + alert("请选择班次信息");
  160 + return;
  161 + } else {
  162 + $state.go("ttInfoDetailManage_detail_edit2", {
  163 + xlid: self.xlid,
  164 + ttid: self.ttid,
  165 + xlname: self.xlname,
  166 + ttname: self.ttname
  167 + });
  168 + }
  169 +
  170 +
  171 + };
  172 +
  173 + // 查询对象类
  174 + var TTInfoDetail = service.getQueryClass();
  175 +
  176 + /**
  177 + * 反向操作。
  178 + * @param cell 明细信息
  179 + */
  180 + self.changeDirect = function(detailInfo, xldir) {
  181 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  182 + value.xlDir = xldir;
  183 + value.$save(function() {
79 detailInfo.xldir = xldir; 184 detailInfo.xldir = xldir;
80 - },  
81 - function(result) {  
82 - alert("出错啦!");  
83 - }  
84 - );  
85 - },  
86 - function(result) {  
87 - alert("出错啦!");  
88 - }  
89 - );  
90 - };  
91 -  
92 - /**  
93 - * 更新分班。  
94 - * @param detailInfo 明细信息  
95 - * @param flag 分班标识  
96 - */  
97 - self.changeFB = function(detailInfo, flag) {  
98 - service.getDetail(detailInfo.ttdid).then(  
99 - function(result) {  
100 - result.isFB = flag;  
101 - service.saveDetail(result).then(  
102 - function(result) { 185 + });
  186 + });
  187 + };
  188 +
  189 + /**
  190 + * 更新分班。
  191 + * @param detailInfo 明细信息
  192 + * @param flag 分班标识
  193 + */
  194 + self.changeFB = function(detailInfo, flag) {
  195 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  196 + value.isFB = flag;
  197 + value.$save(function() {
103 detailInfo.isfb = flag; 198 detailInfo.isfb = flag;
104 - },  
105 - function(result) {  
106 - alert("出错啦!");  
107 - }  
108 - );  
109 - },  
110 - function(result) {  
111 - alert("出错啦!");  
112 - }  
113 - );  
114 - };  
115 -  
116 - /**  
117 - * 改变便次类型。  
118 - * @param detailInfo 明细信息  
119 - * @param type 班次类型  
120 - */  
121 - self.changeBCType = function(detailInfo, type) {  
122 - service.getDetail(detailInfo.ttdid).then(  
123 - function(result) {  
124 - result.bcType = type;  
125 - service.saveDetail(result).then(  
126 - function(result) { 199 + });
  200 + });
  201 +
  202 + };
  203 +
  204 + /**
  205 + * 改变便次类型。
  206 + * @param detailInfo 明细信息
  207 + * @param type 班次类型
  208 + */
  209 + self.changeBCType = function(detailInfo, type) {
  210 + TTInfoDetail.get({id: detailInfo.ttdid}, function(value) {
  211 + value.bcType = type;
  212 + value.$save(function() {
127 detailInfo.bc_type = type; 213 detailInfo.bc_type = type;
128 - },  
129 - function(result) {  
130 - alert("出错啦!");  
131 - }  
132 - );  
133 - },  
134 - function(result) {  
135 - alert("出错啦!"); 214 + });
  215 + });
  216 +
  217 + };
  218 +
  219 + if (self.rflag) { // 是否刷新
  220 + self.refresh(); // 刷新数据
136 } 221 }
137 - );  
138 - };  
139 222
140 -}]);  
141 223
142 -angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl_old', ['TimeTableDetailManageService_old', '$stateParams', '$state', function(service, $stateParams, $state) {  
143 - var self = this; 224 + }
  225 +
  226 + ]
  227 +);
144 228
145 - // 欲保存的busInfo信息,绑定  
146 - self.TimeTableDetailForSave = {}; 229 +// edit-detail.html 具体班次明细修改页面
  230 +angular.module('ScheduleApp').controller(
  231 + 'TimeTableDetailManageFormCtrl_old',
  232 + [
  233 + 'TimeTableDetailManageService_old',
  234 + '$stateParams',
  235 + '$state',
  236 + function(service, $stateParams, $state) {
  237 + var self = this;
  238 + var TTInfoDetail = service.getQueryClass();
147 239
148 - // 获取传过来的id,有的话就是修改,获取一遍数据  
149 - var id = $stateParams.id; // 时刻明细班次id  
150 - self.xlid = $stateParams.xlid; // 获取传过来的线路id  
151 - self.ttid = $stateParams.ttid; // 获取传过来的时刻表id  
152 - self.xlname = $stateParams.xlname; // 获取传过来的线路名字  
153 - self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 240 + // 欲保存的busInfo信息,绑定
  241 + self.TimeTableDetailForSave = new TTInfoDetail;
154 242
155 - self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; 243 + // 获取传过来的id,有的话就是修改,获取一遍数据
  244 + var id = $stateParams.id; // 时刻明细班次id
  245 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  246 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  247 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  248 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
156 249
157 - if (id) {  
158 - self.TimeTableDetailForSave.id = id;  
159 - service.getDetail(id).then(  
160 - function(result) {  
161 - var key;  
162 - for (key in result) {  
163 - self.TimeTableDetailForSave[key] = result[key];  
164 - } 250 + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
165 251
166 - self.title2 =  
167 - self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +  
168 - "->路牌" + self.TimeTableDetailForSave.lp.lpName +  
169 - "->发车顺序号" + self.TimeTableDetailForSave.fcno +  
170 - "->班次详细信息"; 252 + if (id) {
  253 + TTInfoDetail.get({id: id}, function(value) {
  254 + self.TimeTableDetailForSave = value;
  255 + self.title2 =
  256 + self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +
  257 + "->路牌" + self.TimeTableDetailForSave.lp.lpName +
  258 + "->发车顺序号" + self.TimeTableDetailForSave.fcno +
  259 + "->班次详细信息";
  260 + });
171 261
172 - },  
173 - function(result) {  
174 - alert("出错啦!");  
175 } 262 }
176 - );  
177 - }  
178 -  
179 - // 提交方法  
180 - self.submit = function() {  
181 - console.log(self.TimeTableDetailForSave);  
182 - //if (self.busInfoForSave) {  
183 - // delete $stateParams.id;  
184 - //}  
185 - service.saveDetail(self.TimeTableDetailForSave).then(  
186 - function(result) {  
187 - // TODO:弹出框方式以后改  
188 - if (result.status == 'SUCCESS') {  
189 - //alert("保存成功!"); 263 +
  264 + // 提交方法
  265 + self.submit = function() {
  266 + console.log(self.TimeTableDetailForSave);
  267 + //if (self.busInfoForSave) {
  268 + // delete $stateParams.id;
  269 + //}
  270 +
  271 + if (self.TimeTableDetailForSave.tcc && !self.TimeTableDetailForSave.tcc.id)
  272 + delete self.TimeTableDetailForSave.tcc;
  273 + if (self.TimeTableDetailForSave.qdz && !self.TimeTableDetailForSave.qdz.id)
  274 + delete self.TimeTableDetailForSave.qdz;
  275 + if (self.TimeTableDetailForSave.zdz && !self.TimeTableDetailForSave.zdz.id)
  276 + delete self.TimeTableDetailForSave.zdz;
  277 +
  278 + self.TimeTableDetailForSave.$save(function(value) {
  279 + // 修正内部edit的值
  280 + var detailInfos = service.getEditInfo().detailInfos;
  281 + for (var i = 0; i < detailInfos.length; i ++) {
  282 + for (var j = 0; j < detailInfos[i].length; j++) {
  283 + if (detailInfos[i][j].ttdid == id) {
  284 + // 赋值(上下行,发车时间,班次类型)
  285 + detailInfos[i][j].fcsj = value.fcsj;
  286 + detailInfos[i][j].xldir = value.xlDir;
  287 + detailInfos[i][j].bc_type = value.bcType;
  288 + }
  289 + }
  290 + }
190 $state.go("ttInfoDetailManage_edit", { 291 $state.go("ttInfoDetailManage_edit", {
191 xlid: self.xlid, 292 xlid: self.xlid,
192 ttid: self.ttid, 293 ttid: self.ttid,
193 xlname: self.xlname, 294 xlname: self.xlname,
194 ttname: self.ttname 295 ttname: self.ttname
195 }); 296 });
196 - } else {  
197 - alert("保存异常!");  
198 - }  
199 - },  
200 - function(result) {  
201 - // TODO:弹出框方式以后改  
202 - alert("出错啦!");  
203 - }  
204 - );  
205 - }; 297 + });
206 298
207 -}]); 299 + };
208 300
209 -// 测试edit2功能  
210 -angular.module("ScheduleApp").controller(  
211 - 'tt_edit2',  
212 - [  
213 - function() {  
214 - this.colHeaders = [  
215 - '路牌',  
216 - '出场',  
217 - '和静路安亭老街',  
218 - '福泉路天山西路',  
219 - '和静路安亭老街',  
220 - '福泉路天山西路',  
221 - '和静路安亭老街',  
222 - '福泉路天山西路',  
223 - '和静路安亭老街',  
224 - '福泉路天山西路',  
225 - '和静路安亭老街',  
226 - '福泉路天山西路',  
227 - '和静路安亭老街',  
228 - '福泉路天山西路',  
229 - '和静路安亭老街',  
230 - '进场'  
231 - ];  
232 -  
233 -  
234 -  
235 -  
236 -  
237 -  
238 -  
239 - var items = [  
240 - ['1', '0615', '', '', '0630', '0755', '0935', '1055', '1305', '1425', '1640', '1805', '', '', '1915', '1925']  
241 - ];  
242 -  
243 - this.data = items;  
244 - //this.columns = [  
245 - // {  
246 - // data: 'id',  
247 - // title: 'ID',  
248 - // readOnly: true  
249 - // },  
250 - // {  
251 - // data: 'price',  
252 - // title: 'Price',  
253 - // readOnly: false  
254 - // }  
255 - //];  
256 } 301 }
  302 + ]
  303 +);
257 304
  305 +// edit-detail2.html 具体班次明细修改页面
  306 +angular.module('ScheduleApp').controller(
  307 + 'TimeTableDetailManageFormCtrl_old2',
  308 + [
  309 + 'TimeTableDetailManageService_old',
  310 + '$stateParams',
  311 + '$state',
  312 + function(service, $stateParams, $state) {
  313 + var self = this;
  314 + var TTInfoDetail = service.getQueryClass();
  315 +
  316 + // 欲保存的busInfo信息,绑定
  317 + self.TimeTableDetailForSave = new TTInfoDetail;
  318 + self.TimeTableDetailForSave.tcc = {};
  319 + self.TimeTableDetailForSave.qdz = {};
  320 + self.TimeTableDetailForSave.zdz = {};
  321 +
  322 + // 获取传过来的id,有的话就是修改,获取一遍数据
  323 + self.xlid = $stateParams.xlid; // 获取传过来的线路id
  324 + self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
  325 + self.xlname = $stateParams.xlname; // 获取传过来的线路名字
  326 + self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  327 +
  328 + self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
  329 +
  330 + // 提交方法
  331 + self.submit = function() {
  332 + if (!self.TimeTableDetailForSave.tcc.id)
  333 + delete self.TimeTableDetailForSave.tcc;
  334 + if (!self.TimeTableDetailForSave.qdz.id)
  335 + delete self.TimeTableDetailForSave.qdz;
  336 + if (!self.TimeTableDetailForSave.zdz.id)
  337 + delete self.TimeTableDetailForSave.zdz;
  338 +
  339 + service.editInfos(self.TimeTableDetailForSave).then(function() {
  340 + alert("批量更新成功!");
  341 + $state.go("ttInfoDetailManage_edit", {
  342 + xlid: self.xlid,
  343 + ttid: self.ttid,
  344 + xlname: self.xlname,
  345 + ttname: self.ttname
  346 + });
  347 + }, function() {
  348 + alert("批量更新失败!");
  349 + $state.go("ttInfoDetailManage_edit", {
  350 + xlid: self.xlid,
  351 + ttid: self.ttid,
  352 + xlname: self.xlname,
  353 + ttname: self.ttname
  354 + });
  355 + });
  356 +
  357 + };
  358 +
  359 + }
258 ] 360 ]
259 -);  
260 \ No newline at end of file 361 \ No newline at end of file
  362 +);
  363 +
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
@@ -79,10 +79,10 @@ @@ -79,10 +79,10 @@
79 <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> 79 <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>
80 </td> 80 </td>
81 <td> 81 <td>
82 - <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" 82 + <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})"
83 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> 83 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a>
84 - <a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"  
85 - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a> 84 + <!--<a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"-->
  85 + <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>-->
86 <a ng-click="ctrl.toTtInfoDetailAuto()" 86 <a ng-click="ctrl.toTtInfoDetailAuto()"
87 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a> 87 class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a>
88 <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" 88 <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
@@ -43,75 +43,83 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -43,75 +43,83 @@ angular.module(&#39;ScheduleApp&#39;).factory(
43 ); 43 );
44 44
45 // 时刻表明细管理service 45 // 时刻表明细管理service
46 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {  
47 - return {  
48 - rest: $resource(  
49 - '/tidc/:id',  
50 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
51 - {  
52 - get: {  
53 - method: 'GET'  
54 - },  
55 - save: {  
56 - method: 'POST'  
57 - }  
58 - }  
59 - ),  
60 - import: $resource(  
61 - '/tidc/importfile',  
62 - {},  
63 - {  
64 - do: {  
65 - method: 'POST',  
66 - headers: {  
67 - 'Content-Type': 'application/x-www-form-urlencoded'  
68 - },  
69 - transformRequest: function(obj) {  
70 - var str = [];  
71 - for (var p in obj) {  
72 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); 46 +angular.module('ScheduleApp').factory(
  47 + 'TimeTableDetailManageService_g',
  48 + [
  49 + '$resource',
  50 + function($resource) {
  51 + return {
  52 + rest: $resource(
  53 + '/tidc/:id',
  54 + {order: 'createDate', direction: 'DESC', id: '@id'},
  55 + {
  56 + get: {
  57 + method: 'GET'
  58 + },
  59 + save: {
  60 + method: 'POST'
  61 + }
  62 + }
  63 + ),
  64 + import: $resource(
  65 + '/tidc/importfile',
  66 + {},
  67 + {
  68 + do: {
  69 + method: 'POST',
  70 + headers: {
  71 + 'Content-Type': 'application/x-www-form-urlencoded'
  72 + },
  73 + transformRequest: function(obj) {
  74 + var str = [];
  75 + for (var p in obj) {
  76 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  77 + }
  78 + return str.join("&");
  79 + }
  80 + }
  81 + }
  82 + ),
  83 + edit: $resource(
  84 + '/tidc/edit/:xlid/:ttid',
  85 + {},
  86 + {
  87 + list: {
  88 + method: 'GET'
73 } 89 }
74 - return str.join("&");  
75 } 90 }
76 - }  
77 - }  
78 - ),  
79 - edit: $resource(  
80 - '/tidc/edit/:xlid/:ttid',  
81 - {},  
82 - {  
83 - list: {  
84 - method: 'GET'  
85 - }  
86 - }  
87 - ),  
88 - bcdetails: $resource(  
89 - '/tidc/bcdetail',  
90 - {},  
91 - {  
92 - list: {  
93 - method: 'GET',  
94 - isArray: true  
95 - }  
96 - }  
97 - ),  
98 - dataTools: $resource(  
99 - '/tidc/:type',  
100 - {},  
101 - {  
102 - dataExport: {  
103 - method: 'GET',  
104 - responseType: "arraybuffer",  
105 - params: {  
106 - type: "dataExportExt"  
107 - },  
108 - transformResponse: function(data, headers){  
109 - return {data : data}; 91 + ),
  92 + bcdetails: $resource(
  93 + '/tidc/bcdetail',
  94 + {},
  95 + {
  96 + list: {
  97 + method: 'GET',
  98 + isArray: true
  99 + }
  100 + }
  101 + ),
  102 + dataTools: $resource(
  103 + '/tidc/:type',
  104 + {},
  105 + {
  106 + dataExport: {
  107 + method: 'GET',
  108 + responseType: "arraybuffer",
  109 + params: {
  110 + type: "dataExportExt"
  111 + },
  112 + transformResponse: function(data, headers){
  113 + return {data : data};
  114 + }
  115 + }
110 } 116 }
111 - }  
112 - }  
113 - ) 117 + )
114 118
115 - // TODO:导入数据  
116 - };  
117 -}]);  
118 \ No newline at end of file 119 \ No newline at end of file
  120 + // TODO:导入数据
  121 + };
  122 +
  123 + }
  124 +
  125 + ]
  126 +);
119 \ No newline at end of file 127 \ No newline at end of file
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
@@ -965,22 +965,32 @@ dd.fcsjActualCell div.last-sch-sunken{ @@ -965,22 +965,32 @@ dd.fcsjActualCell div.last-sch-sunken{
965 /*border-top: 1px solid #eeeeee;*/ 965 /*border-top: 1px solid #eeeeee;*/
966 } 966 }
967 967
  968 +dd.fcsjActualCell.tl-yzx div.last-sch-sunken {
  969 + background: #c1ddf0;
  970 + border-top: 1px solid #c1d3df;
  971 +}
  972 +
  973 +dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge {
  974 + background: rgb(255, 255, 255);
  975 + color: black;
  976 +}
  977 +
968 dd.fcsjActualCell div.last-sch-sunken span._badge{ 978 dd.fcsjActualCell div.last-sch-sunken span._badge{
969 - font-size: 12px;  
970 - border-radius: 0 7px 7px 0; 979 + font-size: 13px;
  980 + border-radius: 0 9px 9px 0;
971 padding-left: 0; 981 padding-left: 0;
972 - width: 29px; 982 + width: 81px;
973 display: inline-block; 983 display: inline-block;
974 - height: 18px;  
975 - line-height: 18px; 984 + height: 23px;
  985 + line-height: 23px;
976 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);
977 vertical-align: top; 987 vertical-align: top;
978 margin-right: 3px; 988 margin-right: 3px;
979 - margin-top: 3px; 989 + margin-top: 1px;
980 margin-left: -7px; 990 margin-left: -7px;
981 - text-indent: 2px; 991 + /* text-indent: 2px; */
982 border-left: 0; 992 border-left: 0;
983 - transform: scale(.9); 993 + /* transform: scale(.9); */
984 color: grey; 994 color: grey;
985 } 995 }
986 996
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 167
168 <script id="last-sch-sunken-temp" type="text/html"> 168 <script id="last-sch-sunken-temp" type="text/html">
169 <div class="last-sch-sunken"> 169 <div class="last-sch-sunken">
170 - <span class="_badge">终点</span>{{zdsj}}/{{zdsjActual}} 170 + <span class="_badge">{{zdsj}}/{{zdsjActual}}</span>
171 </div> 171 </div>
172 </script> 172 </script>
173 </div> 173 </div>
src/main/resources/static/real_control_v2/js/data/data_gps.js
@@ -30,7 +30,7 @@ var gb_data_gps = (function() { @@ -30,7 +30,7 @@ var gb_data_gps = (function() {
30 }, 30 },
31 error: function (xr, t) { 31 error: function (xr, t) {
32 notify_err('刷新GPS失败,稍后重试' + t); 32 notify_err('刷新GPS失败,稍后重试' + t);
33 - cb(); 33 + //cb();
34 } 34 }
35 }); 35 });
36 }; 36 };
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;
src/main/resources/static/real_control_v2/mapmonitor/js/gps_tree.js
@@ -43,7 +43,7 @@ var gb_map_gps_tree = (function () { @@ -43,7 +43,7 @@ var gb_map_gps_tree = (function () {
43 'keep_selected_style': false, 43 'keep_selected_style': false,
44 'whole_node': false, 44 'whole_node': false,
45 'tie_selection': false 45 'tie_selection': false
46 - }, 46 + }/*,
47 'contextmenu': { 47 'contextmenu': {
48 'items': { 48 'items': {
49 '轨迹回放': { 49 '轨迹回放': {
@@ -59,12 +59,12 @@ var gb_map_gps_tree = (function () { @@ -59,12 +59,12 @@ var gb_map_gps_tree = (function () {
59 } 59 }
60 } 60 }
61 } 61 }
62 - }, 62 + }*/,
63 //local storage里的key 63 //local storage里的key
64 'state': { 64 'state': {
65 'key': 'jstree_map_devices' 65 'key': 'jstree_map_devices'
66 }, 66 },
67 - 'plugins': ['checkbox', 'contextmenu', 'state'] 67 + 'plugins': ['checkbox'/*, 'contextmenu'*/, 'state']
68 }); 68 });
69 }; 69 };
70 70