Commit 3cad70dde9a07d50d82951a6e45f9aa4bf6315fd

Authored by 廖磊
2 parents c92c2f66 08fe766e

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing 37 changed files with 1575 additions and 276 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -24,10 +24,10 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
24 24  
25 25 /*@Autowired
26 26 GetSchedulePlanThread getSchedulePlanThread;*/
27   -
  27 +
28 28 @Autowired
29 29 ScheduleRealInfoService scheduleRealInfoService;
30   -
  30 +
31 31 @Autowired
32 32 DayOfSchedule dayOfSchedule;
33 33  
... ... @@ -42,29 +42,29 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
42 42 }
43 43  
44 44 /**
45   - *
  45 + *
46 46 * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id
47 47 * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws
48 48 */
49 49 @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
50 50 public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,
51   - @RequestParam String dfsj,String bcType) {
  51 + @RequestParam String dfsj,String bcType) {
52 52 return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType);
53 53 }
54 54  
55 55 /**
56   - *
  56 + *
57 57 * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔
58 58 */
59 59 @RequestMapping(value = "/destroy", method = RequestMethod.POST)
60 60 public Map<String, Object> destroy(@RequestParam String idsStr
61 61 /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,
62   - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {
  62 + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {
63 63 return scheduleRealInfoService.destroy(idsStr/*, spaceAdjust*/, remarks, adjustExps/*, spaceNum*/);
64 64 }
65 65  
66 66 /**
67   - *
  67 + *
68 68 * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws
69 69 */
70 70 @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)
... ... @@ -73,7 +73,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
73 73 }
74 74  
75 75 /**
76   - *
  76 + *
77 77 * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param
78 78 * lineId @throws
79 79 */
... ... @@ -83,7 +83,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
83 83 }
84 84  
85 85 /**
86   - *
  86 + *
87 87 * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param
88 88 * lineId @throws
89 89 */
... ... @@ -93,7 +93,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
93 93 }
94 94  
95 95 /**
96   - *
  96 + *
97 97 * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param
98 98 * lineId @throws
99 99 */
... ... @@ -103,7 +103,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
103 103 }
104 104  
105 105 /**
106   - *
  106 + *
107 107 * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws
108 108 */
109 109 @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)
... ... @@ -111,9 +111,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
111 111 return scheduleRealInfoService.sreachVehic(nbbm);
112 112 }
113 113 /**
114   - *
115   - * @Title: realOutAdjust
116   - * @Description: TODO(实发调整)
  114 + *
  115 + * @Title: realOutAdjust
  116 + * @Description: TODO(实发调整)
117 117 * @param @param id 班次ID
118 118 * @param @param fcsjActual 实际发车时间 HH:mm
119 119 * @param @param remarks 备注
... ... @@ -121,14 +121,14 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
121 121 */
122 122 @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
123 123 public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual,
124   - @RequestParam String remarks) {
  124 + @RequestParam String remarks) {
125 125 return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks);
126 126 }
127   -
  127 +
128 128 /**
129   - *
130   - * @Title: revokeDestroy
131   - * @Description: TODO(撤销烂班)
  129 + *
  130 + * @Title: revokeDestroy
  131 + * @Description: TODO(撤销烂班)
132 132 * @param @param id
133 133 * @throws
134 134 */
... ... @@ -136,11 +136,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
136 136 public Map<String, Object> revokeDestroy(@RequestParam Long id){
137 137 return scheduleRealInfoService.revokeDestroy(id);
138 138 }
139   -
  139 +
140 140 /**
141   - *
142   - * @Title: revokeRealOutgo
143   - * @Description: TODO(撤销实发)
  141 + *
  142 + * @Title: revokeRealOutgo
  143 + * @Description: TODO(撤销实发)
144 144 * @param @param id
145 145 * @throws
146 146 */
... ... @@ -160,9 +160,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
160 160 }
161 161  
162 162 /**
163   - *
164   - * @Title: spaceAdjust
165   - * @Description: TODO(间隔调整)
  163 + *
  164 + * @Title: spaceAdjust
  165 + * @Description: TODO(间隔调整)
166 166 * @param @param ids 要调整的班次数组ID
167 167 * @param @param space 间隔
168 168 * @throws
... ... @@ -171,11 +171,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
171 171 public Map<String, Object> spaceAdjust(Long[] ids, Integer space){
172 172 return scheduleRealInfoService.spaceAdjust(ids, space);
173 173 }
174   -
  174 +
175 175 /**
176   - *
177   - * @Title: schInfoFineTune
178   - * @Description: TODO(发车信息微调)
  176 + *
  177 + * @Title: schInfoFineTune
  178 + * @Description: TODO(发车信息微调)
179 179 * @param @param map
180 180 * @throws
181 181 */
... ... @@ -183,11 +183,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
183 183 public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){
184 184 return scheduleRealInfoService.schInfoFineTune(map);
185 185 }
186   -
  186 +
187 187 /**
188   - *
189   - * @Title: outgoAdjustAll
190   - * @Description: TODO(批量待发调整)
  188 + *
  189 + * @Title: outgoAdjustAll
  190 + * @Description: TODO(批量待发调整)
191 191 * @param @param list
192 192 * @throws
193 193 */
... ... @@ -197,11 +197,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
197 197 params = StringEscapeUtils.unescapeHtml4(params);
198 198 return scheduleRealInfoService.outgoAdjustAll(params);
199 199 }
200   -
  200 +
201 201 /**
202   - *
203   - * @Title: findByLineAndUpDown
204   - * @Description: TODO(根据线路和走向获取班次)
  202 + *
  203 + * @Title: findByLineAndUpDown
  204 + * @Description: TODO(根据线路和走向获取班次)
205 205 * @param @param line
206 206 * @param @param upDown
207 207 */
... ... @@ -209,11 +209,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
209 209 public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){
210 210 return dayOfSchedule.findByLineAndUpDown(line, upDown);
211 211 }
212   -
  212 +
213 213 /**
214   - *
215   - * @Title: findRouteByLine
216   - * @Description: TODO(获取线路的站点,路段路由)
  214 + *
  215 + * @Title: findRouteByLine
  216 + * @Description: TODO(获取线路的站点,路段路由)
217 217 * @param @param lineCode
218 218 * @throws
219 219 */
... ... @@ -221,11 +221,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
221 221 public Map<String, Object> findRouteByLine(@RequestParam String lineCode){
222 222 return scheduleRealInfoService.findRouteByLine(lineCode);
223 223 }
224   -
  224 +
225 225 /**
226   - *
227   - * @Title: removeChildTask
228   - * @Description: TODO(删除子任务)
  226 + *
  227 + * @Title: removeChildTask
  228 + * @Description: TODO(删除子任务)
229 229 * @param @param taskId 子任务ID
230 230 * @throws
231 231 */
... ... @@ -235,9 +235,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
235 235 }
236 236  
237 237 /**
238   - *
239   - * @Title: findByLineCode
240   - * @Description: TODO(根据线路获取班次信息)
  238 + *
  239 + * @Title: findByLineCode
  240 + * @Description: TODO(根据线路获取班次信息)
241 241 * @param @param lineCode
242 242 */
243 243 @RequestMapping(value = "/lineCode/{lineCode}")
... ... @@ -247,29 +247,29 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
247 247  
248 248 @RequestMapping(value = "/queryUserInfo")
249 249 public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
250   - @RequestParam String date,@RequestParam String state) {
  250 + @RequestParam String date,@RequestParam String state) {
251 251 return scheduleRealInfoService.queryUserInfo(line, date,state);
252 252 }
253   -
  253 +
254 254 @RequestMapping(value = "/queryUserInfoPx")
255 255 public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,
256   - @RequestParam String date,@RequestParam String state,@RequestParam String type) {
  256 + @RequestParam String date,@RequestParam String state,@RequestParam String type) {
257 257 return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);
258 258 }
259 259  
260 260 @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)
261 261 public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
262   - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
  262 + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
263 263 return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line);
264 264 }
265   -
  265 +
266 266 @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)
267 267 public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh
268 268 ,@RequestParam String date,@RequestParam String line) {
269 269 return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);
270 270 }
271 271  
272   -
  272 +
273 273 @RequestMapping(value = "/dailyInfo")
274 274 public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) {
275 275 return scheduleRealInfoService.dailyInfo(line, date, type);
... ... @@ -277,41 +277,41 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
277 277  
278 278 @RequestMapping(value = "/historyMessage")
279 279 public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date,
280   - @RequestParam String code, @RequestParam String type) {
  280 + @RequestParam String code, @RequestParam String type) {
281 281 return scheduleRealInfoService.historyMessage(line, date, code, type);
282 282 }
283   -
  283 +
284 284 @RequestMapping(value="/findLine")
285 285 public List<Map<String,String>> findLine(@RequestParam String line){
286 286 return scheduleRealInfoService.findLine(line);
287 287 }
288   -
  288 +
289 289 @RequestMapping(value="/findKMBC",method = RequestMethod.GET)
290 290 public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
291 291 ,@RequestParam String date,@RequestParam String line){
292 292 return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line);
293 293 }
294   -
  294 +
295 295 @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)
296 296 public Map<String,Object> findKMBCQp(@RequestParam String clZbh
297 297 ,@RequestParam String date,@RequestParam String line){
298 298 return scheduleRealInfoService.findKMBCQp(clZbh,date,line);
299 299 }
300   -
  300 +
301 301 @RequestMapping(value="/findLpName")
302 302 public List<Map<String,String>> findLpName(@RequestParam String lpName){
303 303 return scheduleRealInfoService.findLpName(lpName);
304 304 }
305   -
  305 +
306 306 @RequestMapping(value = "/account")
307 307 public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date,
308   - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {
  308 + @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {
309 309 return scheduleRealInfoService.account(line, date, code, xlName, type);
310 310 }
311   -
  311 +
312 312 @RequestMapping(value = "/correctForm")
313 313 public List<ScheduleRealInfo> correctForm(@RequestParam String line, @RequestParam String startDate,
314   - @RequestParam String endDate, @RequestParam String lpName, @RequestParam String code, @RequestParam String type) {
  314 + @RequestParam String endDate, @RequestParam String lpName, @RequestParam String code, @RequestParam String type) {
315 315 return scheduleRealInfoService.correctForm(line, startDate, endDate, lpName, code, type);
316 316 }
317 317 /**
... ... @@ -327,19 +327,19 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
327 327 ,@RequestParam String date,@RequestParam String line){
328 328 return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line);
329 329 }
330   -
  330 +
331 331 @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)
332 332 public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,
333   - @RequestParam String date,@RequestParam String line){
  333 + @RequestParam String date,@RequestParam String line){
334 334 return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);
335 335 }
336   -
  336 +
337 337 @RequestMapping(value="/statisticsDaily")
338 338 public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date,
339   - @RequestParam String xlName, @RequestParam String type){
  339 + @RequestParam String xlName, @RequestParam String type){
340 340 return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);
341 341 }
342   -
  342 +
343 343 @RequestMapping(value="/statisticsDailyTj")
344 344 public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){
345 345 String gsdm="";
... ... @@ -372,41 +372,41 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
372 372 }
373 373 return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type);
374 374 }
375   -
  375 +
376 376 @RequestMapping(value="/MapById",method = RequestMethod.GET)
377 377 public Map<String, Object> MapById(@RequestParam("id") Long id){
378 378 return scheduleRealInfoService.MapById(id);
379 379 }
380   -
  380 +
381 381 /**
382   - * @Title: scheduleDaily
383   - * @Description: TODO(调度日报表)
  382 + * @Title: scheduleDaily
  383 + * @Description: TODO(调度日报表)
384 384 * @param line 线路
385 385 * @param date 时间
386   - * @return
  386 + * @return
387 387 */
388 388 @RequestMapping(value="/scheduleDaily")
389 389 public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){
390 390 return scheduleRealInfoService.scheduleDaily(line,date);
391 391 }
392   -
  392 +
393 393 @RequestMapping(value="/realScheduleList")
394 394 public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){
395 395 return scheduleRealInfoService.realScheduleList(line,date);
396 396 }
397   -
  397 +
398 398 @RequestMapping(value="/realScheduleListQp")
399 399 public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){
400 400 return scheduleRealInfoService.realScheduleListQp(line,date);
401 401 }
402   -
  402 +
403 403 @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
404 404 public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
405 405 cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
406 406 List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);
407 407 return scheduleRealInfoService.multi_tzrc(cpcs);
408 408 }
409   -
  409 +
410 410 @RequestMapping(value="/multi_dftz", method=RequestMethod.POST)
411 411 public Map<String, Object> multi_dftz(@RequestParam String dcsJson){
412 412 dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson);
... ... @@ -436,7 +436,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
436 436 List<String> rs = new ArrayList<>();
437 437  
438 438 long t = new Date().getTime() - ONE_DAY - (1000 * 60 * 60 * 2);
439   - for(int i = 0; i < 5; i ++){
  439 + for(int i = 0; i < 10; i ++){
440 440 rs.add(fmtyyyyMMdd.print(t));
441 441 t -= ONE_DAY;
442 442 }
... ... @@ -467,7 +467,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
467 467 public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){
468 468 return scheduleRealInfoService.scheduleDailyExport(map);
469 469 }
470   -
  470 +
471 471 @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)
472 472 public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){
473 473 return scheduleRealInfoService.exportWaybillMore(map);
... ...
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
  3 +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
3 4 import com.bsth.data.schedule.DayOfSchedule;
4 5 import com.bsth.entity.realcontrol.ScheduleRealInfo;
5 6 import org.slf4j.Logger;
... ... @@ -49,4 +50,9 @@ public class anomalyCheckController {
49 50 dayOfSchedule.replaceByNbbm(nbbm, map.values());
50 51 }
51 52 }
  53 +
  54 + @RequestMapping(value = "/shutdownThreadPool")
  55 + public void shutdownThreadPool(){
  56 + GpsRealAnalyse.shutdown();
  57 + }
52 58 }
... ...
src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
... ... @@ -33,6 +33,11 @@ public class PeopleCarPlanController {
33 33 public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){
34 34 return peopleCarPlanService.scheduleAnaly(map);
35 35 }
  36 +
  37 + @RequestMapping(value="/scheduleAnaly_sum", method = RequestMethod.GET)
  38 + public Map<String, Object> scheduleAnaly_sum(@RequestParam Map<String, Object> map){
  39 + return peopleCarPlanService.scheduleAnaly_sum(map);
  40 + }
36 41  
37 42 @RequestMapping(value="/getModel", method = RequestMethod.GET)
38 43 public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){
... ... @@ -44,6 +49,11 @@ public class PeopleCarPlanController {
44 49 return peopleCarPlanService.firstAndLastBus(map);
45 50 }
46 51  
  52 + @RequestMapping(value="/firstAndLastBus_sum", method = RequestMethod.GET)
  53 + public List<Map<String,Object>> firstAndLastBus_sum(@RequestParam Map<String, Object> map){
  54 + return peopleCarPlanService.firstAndLastBus_sum(map);
  55 + }
  56 +
47 57 @RequestMapping(value="/commandState", method = RequestMethod.GET)
48 58 public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){
49 59 return peopleCarPlanService.commandState(map);
... ...
src/main/java/com/bsth/controller/schedule/core/SchedulePlanInfoController.java
... ... @@ -39,6 +39,23 @@ public class SchedulePlanInfoController extends BController&lt;SchedulePlanInfo, Lo
39 39 return resultMap;
40 40 }
41 41  
  42 + @RequestMapping(value = "/lastestsd/{xlid}", method = RequestMethod.GET)
  43 + public Map<String, Object> findLastestPlanDate(
  44 + @PathVariable(value = "xlid") Integer xlid) {
  45 + Map<String, Object> resultMap = new HashMap<>();
  46 + try {
  47 + resultMap.put("status", ResponseCode.SUCCESS);
  48 + resultMap.put("data", schedulePlanInfoService.findLastestPlanDate(xlid));
  49 +
  50 + } catch (Exception exp) {
  51 + exp.printStackTrace();
  52 + resultMap.put("status", ResponseCode.ERROR);
  53 + resultMap.put("msg", exp.getLocalizedMessage());
  54 + }
  55 +
  56 + return resultMap;
  57 + }
  58 +
42 59  
43 60 // ------------------------ 老版本 ----------------------//
44 61 @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -46,9 +46,6 @@ public class BasicData implements CommandLineRunner {
46 46 //站点编码和名称对照,包括停车场 (K: lineCode_updown_stationCode ,V:站点名称)
47 47 public static Map<String, String> stationCode2NameMap;
48 48  
49   - //线路起终点对照(线路编码_上下行_起终点) 1024_0_B (1024上行起点)
50   - //public static Map<String, String> lineSEPointMap;
51   -
52 49 //车辆和线路对照
53 50 public static Map<String, Line> nbbm2LineMap;
54 51  
... ...
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
1 1 package com.bsth.data.car_out_info;
2 2  
  3 +import com.bsth.Application;
3 4 import com.bsth.data.BasicData;
4 5 import com.bsth.data.schedule.DayOfSchedule;
5 6 import com.bsth.data.schedule.ScheduleComparator;
... ... @@ -12,13 +13,18 @@ import org.springframework.beans.factory.annotation.Autowired;
12 13 import org.springframework.boot.CommandLineRunner;
13 14 import org.springframework.jdbc.core.BatchPreparedStatementSetter;
14 15 import org.springframework.jdbc.core.JdbcTemplate;
  16 +import org.springframework.jdbc.datasource.DataSourceTransactionManager;
15 17 import org.springframework.stereotype.Component;
16 18 import org.springframework.stereotype.Service;
  19 +import org.springframework.transaction.TransactionDefinition;
  20 +import org.springframework.transaction.TransactionStatus;
17 21 import org.springframework.transaction.annotation.Transactional;
  22 +import org.springframework.transaction.support.DefaultTransactionDefinition;
18 23  
19 24 import java.sql.PreparedStatement;
20 25 import java.sql.SQLException;
21 26 import java.util.*;
  27 +import java.util.concurrent.TimeUnit;
22 28  
23 29 /**
24 30 * 发车信息表处理程序
... ... @@ -60,7 +66,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
60 66 Set<String> ks = lpScheduleMap.keySet();
61 67 String prefix = lineCode + "_";
62 68 for (String k : ks) {
63   - if (k.indexOf(prefix) != -1) {
  69 + if (k.startsWith(prefix)) {
64 70 list.addAll(lpScheduleMap.get(k));
65 71 }
66 72 }
... ... @@ -90,36 +96,48 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
90 96 downArray = nexts(downs);
91 97  
92 98 final List<ScheduleRealInfo> pstArray = mergeArray(upArray, downArray);
93   - //删除
94   - jdbcTemplate.update("delete from bsth_t_clfcxxb where line_code=?", lineCode);
95   - //重新写入
96   - jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn)" +
97   - " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
98   - @Override
99   - public void setValues(PreparedStatement ps, int i) throws SQLException {
100   - ScheduleRealInfo sch = pstArray.get(i);
101   - ps.setString(1, sch.getScheduleDateStr());
102   - ps.setString(2, sch.getXlBm());
103   - ps.setString(3, sch.getXlName());
104   - ps.setString(4, /*sch.getLpName()*/"0");
105   - ps.setInt(5, sch.getFcno()==null?-1:sch.getFcno());
106   - ps.setString(6, sch.getDfsj().replace(":", ""));
107   - ps.setString(7, sch.getClZbh().replace("-", ""));
108   - ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh()));
109   - ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType());
110   - ps.setString(10, sch.getZdzName());
111   - ps.setInt(11, Integer.parseInt(sch.getXlDir()));
112   - ps.setString(12, sch.getjGh());
113   - ps.setString(13, sch.getjName());
114   - ps.setString(14, sch.getRemarks());
115   - ps.setInt(15, sch.getFcpSn());
116   - }
  99 + //编程式事务
  100 + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource());
  101 + DefaultTransactionDefinition def = new DefaultTransactionDefinition();
  102 + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  103 + TransactionStatus status = tran.getTransaction(def);
  104 +
  105 + try{
  106 + //删除
  107 + jdbcTemplate.update("delete from bsth_t_clfcxxb where line_code=?", lineCode);
  108 + //重新写入
  109 + jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn)" +
  110 + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
  111 + @Override
  112 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  113 + ScheduleRealInfo sch = pstArray.get(i);
  114 + ps.setString(1, sch.getScheduleDateStr());
  115 + ps.setString(2, sch.getXlBm());
  116 + ps.setString(3, sch.getXlName());
  117 + ps.setString(4, /*sch.getLpName()*/"0");
  118 + ps.setInt(5, sch.getFcno()==null?-1:sch.getFcno());
  119 + ps.setString(6, sch.getDfsj().replace(":", ""));
  120 + ps.setString(7, sch.getClZbh().replace("-", ""));
  121 + ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh()));
  122 + ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType());
  123 + ps.setString(10, sch.getZdzName());
  124 + ps.setInt(11, Integer.parseInt(sch.getXlDir()));
  125 + ps.setString(12, sch.getjGh());
  126 + ps.setString(13, sch.getjName());
  127 + ps.setString(14, sch.getRemarks());
  128 + ps.setInt(15, sch.getFcpSn());
  129 + }
117 130  
118   - @Override
119   - public int getBatchSize() {
120   - return pstArray.size();
121   - }
122   - });
  131 + @Override
  132 + public int getBatchSize() {
  133 + return pstArray.size();
  134 + }
  135 + });
  136 +
  137 + tran.commit(status);
  138 + }catch (Exception e){
  139 + tran.rollback(status);
  140 + }
123 141 }
124 142  
125 143 private List<ScheduleRealInfo> mergeArray(ScheduleRealInfo[] upArray, ScheduleRealInfo[] downArray) {
... ... @@ -190,7 +208,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
190 208 bcTypeMap.put("venting", "直放");
191 209 bcTypeMap.put("major", "放站");
192 210 bcTypeMap.put("ldks", "两点间空驶");
193   - //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS);
  211 + Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS);
194 212 }
195 213  
196 214 @Component
... ...
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
1 1 package com.bsth.data.directive;
2 2  
3   -import java.io.IOException;
4   -
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.bsth.util.ConfigUtil;
5 5 import org.apache.http.client.config.RequestConfig;
6 6 import org.apache.http.client.methods.CloseableHttpResponse;
7 7 import org.apache.http.client.methods.HttpPost;
... ... @@ -12,8 +12,7 @@ import org.apache.http.util.EntityUtils;
12 12 import org.slf4j.Logger;
13 13 import org.slf4j.LoggerFactory;
14 14  
15   -import com.alibaba.fastjson.JSONObject;
16   -import com.bsth.util.ConfigUtil;
  15 +import java.io.IOException;
17 16  
18 17 /**
19 18 *
... ... @@ -42,7 +41,7 @@ public class GatewayHttpUtils {
42 41  
43 42 //超时时间
44 43 RequestConfig requestConfig = RequestConfig.custom()
45   - .setConnectTimeout(3000).setConnectionRequestTimeout(1000)
  44 + .setConnectTimeout(3000).setConnectionRequestTimeout(1000)
46 45 .setSocketTimeout(3000).build();
47 46  
48 47 HttpPost post = new HttpPost(url);
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -4,6 +4,7 @@ import com.bsth.data.BasicData;
4 4 import com.bsth.data.forecast.ForecastRealServer;
5 5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
6 6 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
  7 +import com.bsth.data.gpsdata.thread.ThreadPollMonitor;
7 8 import com.bsth.data.schedule.DayOfSchedule;
8 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
9 10 import com.google.common.collect.TreeMultimap;
... ... @@ -46,6 +47,9 @@ public class GpsRealData implements CommandLineRunner {
46 47 @Autowired
47 48 ForecastRealServer forecastRealServer;
48 49  
  50 + @Autowired
  51 + ThreadPollMonitor threadPollMonitor;
  52 +
49 53 /**
50 54 * 构造函数
51 55 */
... ... @@ -61,6 +65,10 @@ public class GpsRealData implements CommandLineRunner {
61 65 //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 2, TimeUnit.SECONDS);
62 66 //定时扫描掉离线
63 67 //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
  68 +
  69 + //扫描GPS线程池状态
  70 + //Application.mainServices.scheduleWithFixedDelay(threadPollMonitor, 60, 20, TimeUnit.SECONDS);
  71 +
64 72 }
65 73  
66 74  
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
... ... @@ -26,7 +26,7 @@ import java.util.concurrent.Executors;
26 26 @Component
27 27 public class GpsRealAnalyse {
28 28  
29   - Logger logger = LoggerFactory.getLogger(this.getClass());
  29 + static Logger logger = LoggerFactory.getLogger(GpsRealAnalyse.class);
30 30  
31 31 @Autowired
32 32 OfflineSignalHandle offlineSignalHandle;
... ... @@ -46,40 +46,54 @@ public class GpsRealAnalyse {
46 46  
47 47 static ExecutorService threadPool = Executors.newFixedThreadPool(100);
48 48  
  49 + public static long st;
  50 + public static CountDownLatch count;
  51 +
49 52 public void analyse(List<GpsEntity> list) {
50   - //如果正在恢复数据
51   - if (GpsDataRecovery.run)
52   - return;
53   -
54   - long t = System.currentTimeMillis();
55   - logger.info("analyse gps size: " + list.size());
56   - //按线路分组gps
57   - ArrayListMultimap multimap = ArrayListMultimap.create();
58   - for(GpsEntity gps : list){
59   - multimap.put(gps.getLineId(), gps);
60   - }
  53 + try {
  54 + st = System.currentTimeMillis();
  55 + //如果正在恢复数据
  56 + if (GpsDataRecovery.run)
  57 + return;
  58 +
  59 + //按线路分组gps
  60 + ArrayListMultimap multimap = ArrayListMultimap.create();
  61 + for (GpsEntity gps : list) {
  62 + multimap.put(gps.getLineId(), gps);
  63 + }
61 64  
62   - Set<String> ks = multimap.keySet();
63   - CountDownLatch count = new CountDownLatch(ks.size());
  65 + Set<String> ks = multimap.keySet();
  66 + logger.info("analyse gps size: " + list.size() + ", ks: " + ks.size());
  67 + count = new CountDownLatch(ks.size());
64 68  
65   - for(String lineCode : ks){
66   - threadPool.execute(new SignalHandleThread(multimap.get(lineCode), count));
67   - }
  69 + for (String lineCode : ks) {
  70 + threadPool.execute(new SignalHandleThread(multimap.get(lineCode), count));
  71 + }
68 72  
69   - try {
70 73 //等待子线程结束
71 74 count.await();
72 75  
73 76 //加入实时gps对照
74   - for(GpsEntity gps: list)
  77 + for (GpsEntity gps : list)
75 78 gpsRealData.put(gps);
76 79  
77   - logger.info("time , " + (System.currentTimeMillis() - t));
78   - } catch (InterruptedException e) {
  80 + logger.info("time , " + (System.currentTimeMillis() - st));
  81 + } catch (Exception e) {
79 82 logger.error("", e);
80 83 }
81 84 }
82 85  
  86 + public static void shutdown() {
  87 + logger.warn("GpsRealAnalyse shutdown!!");
  88 + threadPool.shutdownNow();
  89 + long len = count.getCount();
  90 + for (int i = 0; i < len; i++) {
  91 + count.countDown();
  92 + }
  93 +
  94 + threadPool = Executors.newFixedThreadPool(100);
  95 + }
  96 +
83 97 static GpsComp comp = new GpsComp();
84 98  
85 99 public class SignalHandleThread implements Runnable {
... ... @@ -97,7 +111,7 @@ public class GpsRealAnalyse {
97 111  
98 112 try {
99 113 Collections.sort(list, comp);
100   - for(GpsEntity gps : list){
  114 + for (GpsEntity gps : list) {
101 115 //是否有任务
102 116 boolean task;
103 117 CircleQueue<GpsEntity> prevs = GeoCacheData.getGps(gps.getNbbm());
... ... @@ -110,7 +124,7 @@ public class GpsRealAnalyse {
110 124 //异常判定(越界/超速)
111 125 abnormalStateHandle.handle(gps, prevs);
112 126  
113   - if(!task)
  127 + if (!task)
114 128 return; //无任务的,到这里就结束
115 129  
116 130 //反向处理
... ... @@ -122,7 +136,7 @@ public class GpsRealAnalyse {
122 136 } catch (Exception e) {
123 137 logger.error("", e);
124 138 } finally {
125   - if(count != null)
  139 + if (count != null)
126 140 count.countDown();
127 141 }
128 142 }
... ...
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
... ... @@ -101,9 +101,9 @@ public class GpsDataLoaderThread extends Thread {
101 101  
102 102 old = gpsRealData.get(gps.getDeviceId());
103 103 if (old != null &&
104   - old.getTimestamp() == gps.getTimestamp() &&
105   - old.getLat() == gps.getLat() &&
106   - old.getLon() == gps.getLon())
  104 + old.getTimestamp().equals(gps.getTimestamp()) &&
  105 + old.getLat().equals(gps.getLat()) &&
  106 + old.getLon().equals(gps.getLon()))
107 107 continue;
108 108  
109 109 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
... ...
src/main/java/com/bsth/data/gpsdata/thread/ThreadPollMonitor.java 0 → 100644
  1 +package com.bsth.data.gpsdata.thread;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +/**
  7 + * 线程池监听
  8 + * Created by panzhao on 2017/5/10.
  9 + */
  10 +@Component
  11 +public class ThreadPollMonitor extends Thread{
  12 +
  13 + @Override
  14 + public void run() {
  15 + long t = System.currentTimeMillis();
  16 +
  17 + if(t - GpsRealAnalyse.st > 3000 * 10){
  18 + GpsRealAnalyse.shutdown();
  19 + }
  20 + }
  21 +}
... ...
src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -74,7 +74,7 @@ public class PilotReport {
74 74 switch (d80.getData().getRequestCode()) {
75 75 case 0xA3:
76 76 //出场请求
77   - ScheduleRealInfo outSch = dayOfSchedule.nextByBcType(nbbm, "out");
  77 + ScheduleRealInfo outSch = dayOfSchedule.searchNearByBcType(nbbm, "out");
78 78 //如果有对应出场班次
79 79 if(outSch != null){
80 80 //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -833,6 +833,29 @@ public class DayOfSchedule implements CommandLineRunner {
833 833 return sch;
834 834 }
835 835  
  836 + /**
  837 + * 搜索离当前时间最近的一个指定类型的班次
  838 + * @param nbbm
  839 + * @param bcType
  840 + * @return
  841 + */
  842 + public ScheduleRealInfo searchNearByBcType(String nbbm, String bcType){
  843 + List<ScheduleRealInfo> list = findByBcType(nbbm, bcType);
  844 + Collections.sort(list, schFCSJComparator);
  845 +
  846 + long t = System.currentTimeMillis();
  847 + int distance=-1;
  848 +
  849 + ScheduleRealInfo sch = null;
  850 + for(ScheduleRealInfo temp : list){
  851 +
  852 + if(Math.abs(temp.getDfsjT() - t) < distance || distance == -1){
  853 + sch = temp;
  854 + }
  855 + }
  856 + return sch;
  857 + }
  858 +
836 859 public List<ScheduleRealInfo> findByBcType(String nbbm, String bcType) {
837 860 List<ScheduleRealInfo> all = nbbmScheduleMap.get(nbbm), outList = new ArrayList<>();
838 861  
... ...
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
1 1 package com.bsth.data.schedule;
2 2  
3   -import java.util.Comparator;
4   -
5 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
6 4  
  5 +import java.util.Comparator;
  6 +
7 7 /**
8 8 *
9 9 * @ClassName: ScheduleComparator
... ... @@ -25,7 +25,7 @@ public class ScheduleComparator {
25 25  
26 26 @Override
27 27 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
28   - return (int) (s1.getDfsjT() - s2.getDfsjT());
  28 + return (int) (s1.getFcsjT() - s2.getFcsjT());
29 29 }
30 30 }
31 31 }
... ...
src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
... ... @@ -81,8 +81,8 @@ public class SchedulePlanRuleResult {
81 81 "(xl_id,xl_name,rule_id,cc_id,cc_zbh," +
82 82 "gids,gnames,gidindex,ecids,ecdbbms,ecindex," +
83 83 "ttinfo_id,ttinfo_name,schedule_date," +
84   - "sysuser_id,sysuser_name,create_date) " +
85   - "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  84 + "sysuser_id,sysuser_name,create_date, qyrq) " +
  85 + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
86 86  
87 87 return sql;
88 88 }
... ... @@ -105,6 +105,8 @@ public class SchedulePlanRuleResult {
105 105 ps.setString(15, this.getSysuserId());
106 106 ps.setString(16, this.getSysuserName());
107 107 ps.setTimestamp(17, new java.sql.Timestamp(this.getCreateDate().getTime()));
  108 + ps.setDate(18, new java.sql.Date(this.getQyrq().getTime()));
  109 +
108 110  
109 111 }
110 112  
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -247,6 +247,9 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
247 247 @Override
248 248 List<StationRoute> findAll(Specification<StationRoute> spec, Sort sort);
249 249  
  250 + @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
  251 + @Override
  252 + List<StationRoute> findAll();
250 253  
251 254 @Query("select new map(sr.station.id as stationid, sr.stationName as stationname) from StationRoute sr where sr.line.id=?1 and sr.directions=?2")
252 255 List<Map<String, Object>> findStations(Integer xlid, Integer xldir);
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -79,6 +79,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
79 79 @Override
80 80 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
81 81 ScheduleRealInfo schedule = new ScheduleRealInfo();
  82 + schedule.setId(rs.getLong("id"));
82 83 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
83 84 schedule.setRealExecDate(rs.getString("real_exec_date"));
84 85 schedule.setXlBm(rs.getString("xl_bm"));
... ... @@ -98,6 +99,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
98 99 schedule.setZdzName(rs.getString("zdz_name"));
99 100 schedule.setXlDir(rs.getString("xl_dir"));
100 101 schedule.setStatus(rs.getInt("status"));
  102 + schedule.setAdjustExps(rs.getString("adjust_exps"));
  103 + schedule.setJhlcOrig(rs.getDouble("jhlc_orig"));
101 104 schedule.setRemarks(rs.getString("remarks"));
102 105 schedule.setGsName(rs.getString("gs_name"));
103 106 schedule.setFgsName(rs.getString("fgs_name"));
... ... @@ -1557,47 +1560,52 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1557 1560 companyName = schedule.getGsName();
1558 1561 if(schedule.getFgsName() != null && subCompanyName.length() == 0)
1559 1562 subCompanyName = schedule.getFgsName();
  1563 + double lc = 0d;
  1564 + if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){
  1565 + lc = schedule.getJhlcOrig();
  1566 + } else {
  1567 + lc = schedule.getJhlc();
  1568 + }
  1569 +
1560 1570 jhbc++;
1561   - if(schedule.getJhlc() != null)
1562   - jhlc += schedule.getJhlc();
  1571 + jhlc += lc;
1563 1572 if(schedule.getStatus() == 2){
1564 1573 sjbc++;
1565   - if(schedule.getJhlc() != null)
1566   - sjlc += schedule.getJhlc();
  1574 + sjlc += lc;
1567 1575 } else if(schedule.getStatus() == -1){
1568   - if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("路阻") != -1){
  1576 + if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
1569 1577 lzbc++;
1570   - lzlc += schedule.getJhlc();
1571   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("吊慢") != -1){
  1578 + lzlc += lc;
  1579 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
1572 1580 dmbc++;
1573   - dmlc += schedule.getJhlc();
1574   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("故障") != -1){
  1581 + dmlc += lc;
  1582 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
1575 1583 gzbc++;
1576   - gzlc += schedule.getJhlc();
1577   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("纠纷") != -1){
  1584 + gzlc += lc;
  1585 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
1578 1586 jfbc++;
1579   - jflc += schedule.getJhlc();
1580   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("肇事") != -1){
  1587 + jflc += lc;
  1588 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
1581 1589 zsbc++;
1582   - zslc += schedule.getJhlc();
1583   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺人") != -1){
  1590 + zslc += lc;
  1591 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
1584 1592 qrbc++;
1585   - qrlc += schedule.getJhlc();
1586   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺车") != -1){
  1593 + qrlc += lc;
  1594 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
1587 1595 qcbc++;
1588   - qclc += schedule.getJhlc();
1589   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("客稀") != -1){
  1596 + qclc += lc;
  1597 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
1590 1598 kxbc++;
1591   - kxlc += schedule.getJhlc();
1592   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("气候") != -1){
  1599 + kxlc += lc;
  1600 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1593 1601 qhbc++;
1594   - qhlc += schedule.getJhlc();
1595   - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("外援") != -1){
  1602 + qhlc += lc;
  1603 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
1596 1604 wybc++;
1597   - wylc += schedule.getJhlc();
  1605 + wylc += lc;
1598 1606 } else {
1599 1607 qtbc++;
1600   - qtlc += schedule.getJhlc();
  1608 + qtlc += lc;
1601 1609 }
1602 1610 }
1603 1611 }
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
... ... @@ -11,9 +11,13 @@ public interface PeopleCarPlanService {
11 11  
12 12 Map<String, Object> scheduleAnaly(Map<String, Object> map);
13 13  
  14 + Map<String, Object> scheduleAnaly_sum(Map<String, Object> map);
  15 +
14 16 List<Map<String, Object>> getModel(Map<String, Object> map);
15 17  
16 18 List<Map<String, Object>> firstAndLastBus(Map<String, Object> map);
17 19  
  20 + List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map);
  21 +
18 22 List<Map<String, Object>> commandState(Map<String, Object> map);
19 23 }
... ...
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
... ... @@ -17,6 +17,13 @@ import java.util.List;
17 17 public interface SchedulePlanInfoService extends BService<SchedulePlanInfo, Long> {
18 18  
19 19 /**
  20 + * 查找最近的排班的日期。
  21 + * @param xlId 线路Id
  22 + * @return
  23 + */
  24 + List<Date> findLastestPlanDate(Integer xlId);
  25 +
  26 + /**
20 27 * 查找排班计划汇总数据。
21 28 * @param xlId 线路Id
22 29 * @param scheduleDate 排班时间
... ...
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
1   -package com.bsth.service.schedule;
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.entity.schedule.SchedulePlanInfo;
  5 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  6 +import com.bsth.util.ReportUtils;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.jdbc.core.JdbcTemplate;
  9 +import org.springframework.jdbc.core.RowMapper;
  10 +import org.springframework.stereotype.Service;
2 11  
3 12 import java.math.BigDecimal;
4   -import java.net.URLEncoder;
5 13 import java.sql.ResultSet;
6 14 import java.sql.SQLException;
7 15 import java.text.DecimalFormat;
  16 +import java.text.NumberFormat;
8 17 import java.text.ParseException;
9 18 import java.text.SimpleDateFormat;
10   -import java.util.ArrayList;
11   -import java.util.Collections;
12   -import java.util.Date;
13   -import java.util.HashMap;
14   -import java.util.HashSet;
15   -import java.util.Iterator;
16   -import java.util.List;
17   -import java.util.Map;
18   -import java.util.Set;
  19 +import java.util.*;
  20 +
19 21  
20   -import org.drools.compiler.lang.DRL5Expressions.type_return;
21 22 import org.springframework.beans.factory.annotation.Autowired;
22 23 import org.springframework.jdbc.core.JdbcTemplate;
23 24 import org.springframework.jdbc.core.RowMapper;
... ... @@ -26,6 +27,7 @@ import org.springframework.stereotype.Service;
26 27 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 28 import com.bsth.entity.schedule.SchedulePlanInfo;
28 29 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  30 +import com.bsth.service.schedule.PeopleCarPlanService;
29 31 import com.bsth.util.ReportUtils;
30 32  
31 33 @Service
... ... @@ -759,6 +761,254 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
759 761  
760 762 return modelMap;
761 763 }
  764 +
  765 +// @Override
  766 + public Map<String, Object> scheduleAnaly_sum(Map<String, Object> map) {
  767 + DecimalFormat df = new DecimalFormat("00");
  768 + NumberFormat nf = NumberFormat.getNumberInstance();
  769 + nf.setMaximumFractionDigits(2);
  770 +// List<TTInfoDetail> ttList = new ArrayList<TTInfoDetail>();
  771 + List<Long> ttList = new ArrayList<Long>();
  772 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  773 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  774 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  775 + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  776 + Map<String, Object> modelMap = new HashMap<String, Object>();
  777 +
  778 + String company = "";
  779 + if(map.get("company")!=null)
  780 + company=map.get("company").toString();
  781 + String subCompany = "";
  782 + if(map.get("subCompany")!=null)
  783 + subCompany=map.get("subCompany").toString();
  784 + String page = map.get("page").toString();
  785 + String line = map.get("line").toString();
  786 + String startDate = map.get("startDate").toString();
  787 + String endDate = map.get("endDate").toString();
  788 + String nbbm = map.get("nbbm").toString();
  789 + String type = map.get("type").toString();
  790 +
  791 + if(startDate.length() == 0){
  792 + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  793 + }
  794 + if(endDate.length() == 0){
  795 + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  796 + }
  797 + try {
  798 +
  799 + 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+"'";
  800 + if(line.length() != 0){
  801 + sql += " and xl_bm = '"+line+"'";
  802 + }
  803 + if(nbbm.length() != 0){
  804 + sql += " and cl_zbh like '%"+nbbm+"%'";
  805 + }
  806 +// if(company.length() != 0){
  807 + sql += " and gs_bm like '%"+company+"%' and fgs_bm like '%"+subCompany+"%'";
  808 +// }
  809 + sql += " and bc_type != 'in' and bc_type != 'out'";
  810 +
  811 + list = jdbcTemplate.query(sql,
  812 + new RowMapper<ScheduleRealInfo>(){
  813 + @Override
  814 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  815 + ScheduleRealInfo schedule = new ScheduleRealInfo();
  816 + schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  817 + schedule.setRealExecDate(rs.getString("real_exec_date"));
  818 + schedule.setXlName(rs.getString("xl_name"));
  819 + schedule.setBcType(rs.getString("bc_type"));
  820 + schedule.setGsName(rs.getString("gs_name"));
  821 + schedule.setFgsName(rs.getString("fgs_name"));
  822 + schedule.setXlDir(rs.getString("xl_dir"));
  823 + schedule.setBcs(rs.getInt("bcs"));
  824 + schedule.setFcno(rs.getInt("fcno"));
  825 + schedule.setFcsj(rs.getString("fcsj"));
  826 + schedule.setFcsjActual(rs.getString("fcsj_actual"));
  827 + schedule.setZdsj(rs.getString("zdsj"));
  828 + schedule.setZdsjActual(rs.getString("zdsj_actual"));
  829 + schedule.setBcsj(rs.getInt("bcsj"));
  830 + schedule.setQdzName(rs.getString("qdz_name"));
  831 + schedule.setSpId(rs.getLong("sp_id"));
  832 +
  833 + if(schedule.getFcsj() != null && schedule.getZdsj() != null){
  834 + String[] split1 = schedule.getFcsj().split(":");
  835 + String[] split2 = schedule.getZdsj().split(":");
  836 + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]);
  837 + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]);
  838 + if(zdsj < fcsj){
  839 + zdsj += 1440;
  840 + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60));
  841 + }
  842 + schedule.setFcsjT((long)fcsj);
  843 + schedule.setZdsjT((long)zdsj);
  844 + }
  845 + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){
  846 + String[] split3 = schedule.getFcsjActual().split(":");
  847 + String[] split4 = schedule.getZdsjActual().split(":");
  848 + int fcsjA = Integer.valueOf(split3[0]) * 60 + Integer.valueOf(split3[1]);
  849 + int zdsjA = Integer.valueOf(split4[0]) * 60 + Integer.valueOf(split4[1]);
  850 + if(fcsjA > zdsjA){
  851 + zdsjA += 1440;
  852 + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60));
  853 + }
  854 + schedule.setFcsjActualTime((long)fcsjA);
  855 + schedule.setZdsjActualTime((long)zdsjA);
  856 + }
  857 +
  858 + return schedule;
  859 + }
  860 + });
  861 +
  862 + } catch (Exception e) {
  863 + // TODO Auto-generated catch block
  864 + e.printStackTrace();
  865 + }
  866 +
  867 + {
  868 + Map<String, Object> m0 = new HashMap<String, Object>();
  869 + m0.put("time", "首~6:30");
  870 + m0.put("upbc", "0");m0.put("dnbc", "0");
  871 + m0.put("upys", "--");m0.put("dnys", "--");
  872 + m0.put("pjys", "--");
  873 + tempList.add(m0);
  874 + Map<String, Object> m1 = new HashMap<String, Object>();
  875 + m1.put("time", "6:31~8:30");
  876 + m1.put("upbc", "0");m1.put("dnbc", "0");
  877 + m1.put("upys", "--");m1.put("dnys", "--");
  878 + m1.put("pjys", "--");
  879 + tempList.add(m1);
  880 + Map<String, Object> m2 = new HashMap<String, Object>();
  881 + m2.put("time", "8:31~11:00");
  882 + m2.put("upbc", "0");m2.put("dnbc", "0");
  883 + m2.put("upys", "--");m2.put("dnys", "--");
  884 + m2.put("pjys", "--");
  885 + tempList.add(m2);
  886 + Map<String, Object> m3 = new HashMap<String, Object>();
  887 + m3.put("time", "11:01~13:30");
  888 + m3.put("upbc", "0");m3.put("dnbc", "0");
  889 + m3.put("upys", "--");m3.put("dnys", "--");
  890 + m3.put("pjys", "--");
  891 + tempList.add(m3);
  892 + Map<String, Object> m4 = new HashMap<String, Object>();
  893 + m4.put("time", "13:31~16:00");
  894 + m4.put("upbc", "0");m4.put("dnbc", "0");
  895 + m4.put("upys", "--");m4.put("dnys", "--");
  896 + m4.put("pjys", "--");
  897 + tempList.add(m4);
  898 + Map<String, Object> m5 = new HashMap<String, Object>();
  899 + m5.put("time", "16:01~18:00");
  900 + m5.put("upbc", "0");m5.put("dnbc", "0");
  901 + m5.put("upys", "--");m5.put("dnys", "--");
  902 + m5.put("pjys", "--");
  903 + tempList.add(m5);
  904 + Map<String, Object> m6 = new HashMap<String, Object>();
  905 + m6.put("time", "18:01~20:30");
  906 + m6.put("upbc", "0");m6.put("dnbc", "0");
  907 + m6.put("upys", "--");m6.put("dnys", "--");
  908 + m6.put("pjys", "--");
  909 + tempList.add(m6);
  910 + Map<String, Object> m7 = new HashMap<String, Object>();
  911 + m7.put("time", "20:31~末");
  912 + m7.put("upbc", "0");m7.put("dnbc", "0");
  913 + m7.put("upys", "--");m7.put("dnys", "--");
  914 + m7.put("pjys", "--");
  915 + tempList.add(m7);
  916 + }
  917 +
  918 + //按时间段分组
  919 + for(ScheduleRealInfo schedule : list){
  920 + if(schedule.getFcsjActualTime()!=null && schedule.getZdsjActualTime()!=null){
  921 + Long fcsjA = schedule.getFcsjActualTime();
  922 + if(fcsjA <= 6*60+30){
  923 + if(!keyMap.containsKey("首~6:30"))
  924 + keyMap.put("首~6:30", new ArrayList<ScheduleRealInfo>());
  925 + keyMap.get("首~6:30").add(schedule);
  926 + }
  927 + if(fcsjA > 6*60+30 && fcsjA <= 8*60+30){
  928 + if(!keyMap.containsKey("6:31~8:30"))
  929 + keyMap.put("6:31~8:30", new ArrayList<ScheduleRealInfo>());
  930 + keyMap.get("6:31~8:30").add(schedule);
  931 + }
  932 + if(fcsjA > 8*60+30 && fcsjA <= 11*60){
  933 + if(!keyMap.containsKey("8:31~11:00"))
  934 + keyMap.put("8:31~11:00", new ArrayList<ScheduleRealInfo>());
  935 + keyMap.get("8:31~11:00").add(schedule);
  936 + }
  937 + if(fcsjA > 11*60 && fcsjA <= 13*60+30){
  938 + if(!keyMap.containsKey("11:01~13:30"))
  939 + keyMap.put("11:01~13:30", new ArrayList<ScheduleRealInfo>());
  940 + keyMap.get("11:01~13:30").add(schedule);
  941 + }
  942 + if(fcsjA > 13*60+30 && fcsjA <= 16*60){
  943 + if(!keyMap.containsKey("13:31~16:00"))
  944 + keyMap.put("13:31~16:00", new ArrayList<ScheduleRealInfo>());
  945 + keyMap.get("13:31~16:00").add(schedule);
  946 + }
  947 + if(fcsjA > 16*60 && fcsjA <= 18*60){
  948 + if(!keyMap.containsKey("16:01~18:00"))
  949 + keyMap.put("16:01~18:00", new ArrayList<ScheduleRealInfo>());
  950 + keyMap.get("16:01~18:00").add(schedule);
  951 + }
  952 + if(fcsjA > 18*60 && fcsjA <= 20*60+30){
  953 + if(!keyMap.containsKey("18:01~20:30"))
  954 + keyMap.put("18:01~20:30", new ArrayList<ScheduleRealInfo>());
  955 + keyMap.get("18:01~20:30").add(schedule);
  956 + }
  957 + if(fcsjA > 20*60+30){
  958 + if(!keyMap.containsKey("20:31~末"))
  959 + keyMap.put("20:31~末", new ArrayList<ScheduleRealInfo>());
  960 + keyMap.get("20:31~末").add(schedule);
  961 + }
  962 + }
  963 + }
  964 +
  965 + for(String key : keyMap.keySet()){
  966 + Map<String, Object> m = null;
  967 + for(Map<String, Object> map2 : tempList){
  968 + if(map2.get("time").toString().equals(key)){
  969 + m = map2;
  970 + }
  971 + }
  972 + int upbc = 0, dnbc = 0;
  973 + long upys = 0, dnys = 0;
  974 + for(ScheduleRealInfo schedule : keyMap.get(key)){
  975 + if(schedule.getXlDir().equals("0")){
  976 + upbc++;
  977 + upys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime();
  978 + }else if(schedule.getXlDir().equals("1")){
  979 + dnbc++;
  980 + dnys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime();
  981 + }
  982 + }
  983 + m.put("upbc", upbc);
  984 + m.put("dnbc", dnbc);
  985 + m.put("upys", nf.format((float)upys / upbc));
  986 + m.put("dnys", nf.format((float)dnys / dnbc));
  987 + m.put("pjys", nf.format((float) (upys + dnys) / (upbc + dnbc)));
  988 + }
  989 +
  990 + modelMap.put("dataList", tempList);
  991 +
  992 + //导出
  993 + if(type.equals("export")){
  994 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  995 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  996 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  997 + Map<String,Object> m = new HashMap<String, Object>();
  998 + ReportUtils ee = new ReportUtils();
  999 + try {
  1000 + listI.add(tempList.iterator());
  1001 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  1002 + ee.excelReplace(listI, new Object[] { m }, path+"mould/scheduleAnaly_sum.xls",
  1003 + path+"export/时刻表分析(汇总)" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  1004 + } catch (Exception e) {
  1005 + // TODO: handle exception
  1006 + e.printStackTrace();
  1007 + }
  1008 + }
  1009 +
  1010 + return modelMap;
  1011 + }
762 1012  
763 1013 @Override
764 1014 public List<Map<String, Object>> getModel(Map<String, Object> map) {
... ... @@ -893,6 +1143,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
893 1143 for(ScheduleRealInfo schedule : list){
894 1144 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
895 1145 continue;
  1146 + if(schedule.getStatus() == -1){
  1147 + continue;
  1148 + }
896 1149 String key = schedule.getXlName();
897 1150 if(key == null || key.trim().length() == 0)
898 1151 continue;
... ... @@ -908,6 +1161,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
908 1161 List<Long> longList1 = new ArrayList<Long>();
909 1162 String companyName = "", subCompanyName = "";
910 1163 for(ScheduleRealInfo schedule : keyMap.get(key)){
  1164 + if(schedule.getFcsjActual() == null || schedule.getFcsjActual().trim().length() == 0){
  1165 + continue;
  1166 + }
911 1167 if(schedule.getGsName() != null && companyName.length() == 0)
912 1168 companyName = schedule.getGsName();
913 1169 if(schedule.getFgsName() != null && subCompanyName.length() == 0)
... ... @@ -923,76 +1179,101 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
923 1179 longList1.add(min);
924 1180 }
925 1181 }
926   - Collections.sort(longList0);
927   - Collections.sort(longList1);
928   - ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
929   - ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
930   - ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
931   - ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
932   - tempMap.put("date", date);
933   - tempMap.put("company", companyName);
934   - tempMap.put("subCompany", subCompanyName);
935   - tempMap.put("line", key);
936   - tempMap.put("qdzFirst0", shouban0.getQdzName());
937   - tempMap.put("jhfcFirst0", shouban0.getFcsj());
938   - tempMap.put("qdzLast0", moban0.getQdzName());
939   - tempMap.put("jhfcLast0", moban0.getFcsj());
940   - tempMap.put("qdzFirst1", shouban1.getQdzName());
941   - tempMap.put("jhfcFirst1", shouban1.getFcsj());
942   - tempMap.put("qdzLast1", moban1.getQdzName());
943   - tempMap.put("jhfcLast1", moban1.getFcsj());
944   - if(shouban0.getFcsjActual() != null){
945   - String[] split = shouban0.getFcsjActual().split(":");
946   - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
947   - long delay = shouban0.getFcsjT() - min;
948   - tempMap.put("sjfcFirst0", shouban0.getFcsjActual());
949   - if(delay > 0)
950   - tempMap.put("delayFirst0", "+" + delay);
951   - else
952   - tempMap.put("delayFirst0", delay);
953   - } else {
  1182 +
  1183 + if(longList0.size() != 0){
  1184 + Collections.sort(longList0);
  1185 + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
  1186 + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
  1187 + tempMap.put("qdzFirst0", shouban0.getQdzName());
  1188 + tempMap.put("jhfcFirst0", shouban0.getFcsj());
  1189 + tempMap.put("qdzLast0", moban0.getQdzName());
  1190 + tempMap.put("jhfcLast0", moban0.getFcsj());
  1191 + if(shouban0.getFcsjActual() != null){
  1192 + String[] split = shouban0.getFcsjActual().split(":");
  1193 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1194 + long delay = shouban0.getFcsjT() - min;
  1195 + tempMap.put("sjfcFirst0", shouban0.getFcsjActual());
  1196 + if(delay > 0)
  1197 + tempMap.put("delayFirst0", "+" + delay);
  1198 + else
  1199 + tempMap.put("delayFirst0", delay);
  1200 + } else {
  1201 + tempMap.put("sjfcFirst0", "/");
  1202 + tempMap.put("delayFirst0", "/");
  1203 + }
  1204 + if(moban0.getFcsjActual() != null){
  1205 + String[] split = moban0.getFcsjActual().split(":");
  1206 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1207 + long delay = moban0.getFcsjT() - min;
  1208 + tempMap.put("sjfcLast0", moban0.getFcsjActual());
  1209 + if(delay > 0)
  1210 + tempMap.put("delayLast0", "+" + delay);
  1211 + else
  1212 + tempMap.put("delayLast0", delay);
  1213 + } else {
  1214 + tempMap.put("sjfcLast0", "/");
  1215 + tempMap.put("delayLast0", "/");
  1216 + }
  1217 + }else{
  1218 + tempMap.put("qdzFirst0", "--");
  1219 + tempMap.put("jhfcFirst0", "/");
  1220 + tempMap.put("qdzLast0", "--");
  1221 + tempMap.put("jhfcLast0", "/");
954 1222 tempMap.put("sjfcFirst0", "/");
955 1223 tempMap.put("delayFirst0", "/");
956   - }
957   - if(moban0.getFcsjActual() != null){
958   - String[] split = moban0.getFcsjActual().split(":");
959   - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
960   - long delay = moban0.getFcsjT() - min;
961   - tempMap.put("sjfcLast0", moban0.getFcsjActual());
962   - if(delay > 0)
963   - tempMap.put("delayLast0", "+" + delay);
964   - else
965   - tempMap.put("delayLast0", delay);
966   - } else {
967 1224 tempMap.put("sjfcLast0", "/");
968 1225 tempMap.put("delayLast0", "/");
969 1226 }
970   - if(shouban1.getFcsjActual() != null){
971   - String[] split = shouban1.getFcsjActual().split(":");
972   - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
973   - long delay = shouban1.getFcsjT() - min;
974   - tempMap.put("sjfcFirst1", shouban1.getFcsjActual());
975   - if(delay > 0)
976   - tempMap.put("delayFirst1", "+" + delay);
977   - else
978   - tempMap.put("delayFirst1", delay);
979   - } else {
  1227 +
  1228 + if(longList1.size() != 0){
  1229 + Collections.sort(longList1);
  1230 + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
  1231 + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
  1232 + tempMap.put("qdzFirst1", shouban1.getQdzName());
  1233 + tempMap.put("jhfcFirst1", shouban1.getFcsj());
  1234 + tempMap.put("qdzLast1", moban1.getQdzName());
  1235 + tempMap.put("jhfcLast1", moban1.getFcsj());
  1236 + if(shouban1.getFcsjActual() != null){
  1237 + String[] split = shouban1.getFcsjActual().split(":");
  1238 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1239 + long delay = shouban1.getFcsjT() - min;
  1240 + tempMap.put("sjfcFirst1", shouban1.getFcsjActual());
  1241 + if(delay > 0)
  1242 + tempMap.put("delayFirst1", "+" + delay);
  1243 + else
  1244 + tempMap.put("delayFirst1", delay);
  1245 + } else {
  1246 + tempMap.put("sjfcFirst1", "/");
  1247 + tempMap.put("delayFirst1", "/");
  1248 + }
  1249 + if(moban1.getFcsjActual() != null){
  1250 + String[] split = moban1.getFcsjActual().split(":");
  1251 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1252 + long delay = moban1.getFcsjT() - min;
  1253 + tempMap.put("sjfcLast1", moban1.getFcsjActual());
  1254 + if(delay > 0)
  1255 + tempMap.put("delayLast1", "+" + delay);
  1256 + else
  1257 + tempMap.put("delayLast1", delay);
  1258 + } else {
  1259 + tempMap.put("sjfcLast1", "/");
  1260 + tempMap.put("delayLast1", "/");
  1261 + }
  1262 + }else{
  1263 + tempMap.put("qdzFirst1", "--");
  1264 + tempMap.put("jhfcFirst1", "/");
  1265 + tempMap.put("qdzLast1", "--");
  1266 + tempMap.put("jhfcLast1", "/");
980 1267 tempMap.put("sjfcFirst1", "/");
981 1268 tempMap.put("delayFirst1", "/");
982   - }
983   - if(moban1.getFcsjActual() != null){
984   - String[] split = moban1.getFcsjActual().split(":");
985   - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
986   - long delay = moban1.getFcsjT() - min;
987   - tempMap.put("sjfcLast1", moban1.getFcsjActual());
988   - if(delay > 0)
989   - tempMap.put("delayLast1", "+" + delay);
990   - else
991   - tempMap.put("delayLast1", delay);
992   - } else {
993 1269 tempMap.put("sjfcLast1", "/");
994 1270 tempMap.put("delayLast1", "/");
995 1271 }
  1272 +
  1273 + tempMap.put("date", date);
  1274 + tempMap.put("company", companyName);
  1275 + tempMap.put("subCompany", subCompanyName);
  1276 + tempMap.put("line", key);
996 1277 resList.add(tempMap);
997 1278 }
998 1279  
... ... @@ -1016,6 +1297,147 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1016 1297 return resList;
1017 1298 }
1018 1299  
  1300 +// @Override
  1301 + public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) {
  1302 + NumberFormat nf = NumberFormat.getNumberInstance();
  1303 + nf.setMinimumFractionDigits(2);
  1304 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  1305 + Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
  1306 +
  1307 + String company = map.get("company").toString();
  1308 + String subCompany = map.get("subCompany").toString();
  1309 + String line = map.get("line").toString();
  1310 + String date = map.get("date").toString();
  1311 + String type = map.get("type").toString();
  1312 +
  1313 + if(date.length() == 0)
  1314 + date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
  1315 +
  1316 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date);
  1317 +
  1318 + for(ScheduleRealInfo schedule : list){
  1319 + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
  1320 + continue;
  1321 + if(schedule.getStatus() == -1){
  1322 + continue;
  1323 + }
  1324 + String key = schedule.getXlName();
  1325 + if(key == null || key.trim().length() == 0)
  1326 + continue;
  1327 + if(!keyMap.containsKey(key))
  1328 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  1329 + keyMap.get(key).add(schedule);
  1330 + }
  1331 + for(String key : keyMap.keySet()){
  1332 + Map<String, Object> tempMap = new HashMap<String, Object>();
  1333 + Map<Long, ScheduleRealInfo> temp0 = new HashMap<Long, ScheduleRealInfo>();
  1334 + List<Long> longList0 = new ArrayList<Long>();
  1335 + Map<Long, ScheduleRealInfo> temp1 = new HashMap<Long, ScheduleRealInfo>();
  1336 + List<Long> longList1 = new ArrayList<Long>();
  1337 + String companyName = "", subCompanyName = "";
  1338 + for(ScheduleRealInfo schedule : keyMap.get(key)){
  1339 + if(schedule.getFcsjActual() == null || schedule.getFcsjActual().trim().length() == 0){
  1340 + continue;
  1341 + }
  1342 + if(schedule.getGsName() != null && companyName.length() == 0)
  1343 + companyName = schedule.getGsName();
  1344 + if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  1345 + subCompanyName = schedule.getFgsName();
  1346 + String[] split = schedule.getFcsj().split(":");
  1347 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1348 + schedule.setFcsjT(min);
  1349 + if(schedule.getXlDir().equals("0")){
  1350 + temp0.put(min, schedule);
  1351 + longList0.add(min);
  1352 + } else {
  1353 + temp1.put(min, schedule);
  1354 + longList1.add(min);
  1355 + }
  1356 + }
  1357 +
  1358 + int jhbc = 0;
  1359 + int sjbc = 0;
  1360 +
  1361 + if(longList0.size() != 0){
  1362 + Collections.sort(longList0);
  1363 + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
  1364 + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
  1365 + if(shouban0.getFcsjActual() != null){
  1366 + jhbc++;
  1367 + String[] split = shouban0.getFcsjActual().split(":");
  1368 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1369 + long delay = shouban0.getFcsjT() - min;
  1370 + if(delay >= -3 && delay <= 1){
  1371 + sjbc++;
  1372 + }
  1373 + }
  1374 +
  1375 + if(moban0.getFcsjActual() != null){
  1376 + jhbc++;
  1377 + String[] split = moban0.getFcsjActual().split(":");
  1378 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1379 + long delay = moban0.getFcsjT() - min;
  1380 + if(delay >= -3 && delay <= 1){
  1381 + sjbc++;
  1382 + }
  1383 + }
  1384 + }
  1385 +
  1386 + if(longList1.size() != 0){
  1387 + Collections.sort(longList1);
  1388 + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
  1389 + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
  1390 + if(shouban1.getFcsjActual() != null){
  1391 + jhbc++;
  1392 + String[] split = shouban1.getFcsjActual().split(":");
  1393 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1394 + long delay = shouban1.getFcsjT() - min;
  1395 + if(delay >= -3 && delay <= 1){
  1396 + sjbc++;
  1397 + }
  1398 + }
  1399 + if(moban1.getFcsjActual() != null){
  1400 + jhbc++;
  1401 + String[] split = moban1.getFcsjActual().split(":");
  1402 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1403 + long delay = moban1.getFcsjT() - min;
  1404 + if(delay >= -3 && delay <= 1){
  1405 + sjbc++;
  1406 + }
  1407 + }
  1408 + }
  1409 +
  1410 + tempMap.put("jhbc", jhbc);
  1411 + tempMap.put("sjbc", sjbc);
  1412 + tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%");
  1413 + tempMap.put("date", date);
  1414 + tempMap.put("company", companyName);
  1415 + tempMap.put("subCompany", subCompanyName);
  1416 + tempMap.put("line", key);
  1417 + resList.add(tempMap);
  1418 + System.out.println(tempMap);
  1419 + }
  1420 +
  1421 + if(type.equals("export")){
  1422 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  1423 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  1424 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1425 + Map<String,Object> m = new HashMap<String, Object>();
  1426 + ReportUtils ee = new ReportUtils();
  1427 + try {
  1428 + listI.add(resList.iterator());
  1429 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  1430 + ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus.xls",
  1431 + path+"export/线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  1432 + } catch (Exception e) {
  1433 + // TODO: handle exception
  1434 + e.printStackTrace();
  1435 + }
  1436 + }
  1437 +
  1438 + return resList;
  1439 + }
  1440 +
1019 1441 @Override
1020 1442 public List<Map<String, Object>> commandState(Map<String, Object> map) {
1021 1443 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
... ...
src/main/java/com/bsth/service/schedule/impl/SchedulePlanInfoServiceImpl.java
... ... @@ -5,6 +5,7 @@ import com.bsth.repository.schedule.SchedulePlanInfoRepository;
5 5 import com.bsth.service.schedule.SchedulePlanInfoService;
6 6 import org.springframework.beans.factory.annotation.Autowired;
7 7 import org.springframework.jdbc.core.JdbcTemplate;
  8 +import org.springframework.jdbc.core.RowCallbackHandler;
8 9 import org.springframework.jdbc.core.RowMapper;
9 10 import org.springframework.stereotype.Service;
10 11 import org.springframework.transaction.annotation.Transactional;
... ... @@ -25,6 +26,26 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl&lt;SchedulePlanInfo,
25 26 private JdbcTemplate jdbcTemplate;
26 27  
27 28 @Override
  29 + public List<Date> findLastestPlanDate(Integer xlId) {
  30 + String sql = "select max(schedule_date) as sd from bsth_c_s_sp_info " +
  31 + "where xl = ?";
  32 +
  33 + final List<Date> ld = new ArrayList<>();
  34 +
  35 + jdbcTemplate.query(sql, new Object[]{xlId}, new RowCallbackHandler() {
  36 + @Override
  37 + public void processRow(ResultSet rs) throws SQLException {
  38 + if (rs != null && rs.getDate("sd") != null) {
  39 + ld.add(new Date(rs.getDate("sd").getTime()));
  40 + }
  41 + }
  42 + });
  43 +
  44 + return ld;
  45 +
  46 + }
  47 +
  48 + @Override
28 49 public List<SchedulePlanGroupInfo> findSchedulePlanGroupInfo(Integer xlId, Date scheduleDate) {
29 50 String sql = SchedulePlanGroupInfo.generateSelectSql();
30 51 List<SchedulePlanGroupInfo> schedulePlanGroupInfos = jdbcTemplate.query(sql, new Object[]{xlId, scheduleDate}, new RowMapper<SchedulePlanGroupInfo>() {
... ...
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
... ... @@ -28,6 +28,9 @@ import org.slf4j.Logger;
28 28 import org.slf4j.LoggerFactory;
29 29 import org.springframework.beans.factory.annotation.Autowired;
30 30 import org.springframework.stereotype.Service;
  31 +import org.springframework.transaction.annotation.Isolation;
  32 +import org.springframework.transaction.annotation.Propagation;
  33 +import org.springframework.transaction.annotation.Transactional;
31 34  
32 35 import java.util.*;
33 36  
... ... @@ -318,6 +321,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
318 321  
319 322 }
320 323  
  324 + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
321 325 public SchedulePlan save(SchedulePlan schedulePlan) {
322 326 // pre、如果排班的数据之前已经有了,删除之前的数据
323 327 Date startpre = new Date();
... ...
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
... ... @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONObject;
4 4 import com.bsth.common.Constants;
5 5 import com.bsth.data.BasicData;
6 6 import com.google.common.base.Splitter;
7   -import com.google.common.collect.ArrayListMultimap;
8 7 import org.slf4j.Logger;
9 8 import org.slf4j.LoggerFactory;
10 9 import org.springframework.context.annotation.Scope;
... ... @@ -12,6 +11,7 @@ import org.springframework.stereotype.Component;
12 11 import org.springframework.web.socket.*;
13 12  
14 13 import java.util.*;
  14 +import java.util.concurrent.ConcurrentHashMap;
15 15  
16 16 /**
17 17 * @author PanZhao
... ... @@ -22,12 +22,14 @@ public class RealControlSocketHandler implements WebSocketHandler {
22 22  
23 23 Logger logger = LoggerFactory.getLogger(this.getClass());
24 24  
25   - private static final ArrayList<WebSocketSession> users;
26   - private static final ArrayListMultimap<String, WebSocketSession> listenMap;
  25 + private static ArrayList<WebSocketSession> users;
  26 + //private static final ArrayListMultimap<String, WebSocketSession> listenMap;
  27 + private static ConcurrentHashMap<String, List<WebSocketSession>> listenMap;
27 28  
28 29 static {
29 30 users = new ArrayList<WebSocketSession>();
30   - listenMap = ArrayListMultimap.create();
  31 + //listenMap = ArrayListMultimap.create();
  32 + listenMap = new ConcurrentHashMap();
31 33 }
32 34  
33 35 @Override
... ... @@ -35,19 +37,31 @@ public class RealControlSocketHandler implements WebSocketHandler {
35 37 throws Exception {
36 38 users.remove(session);
37 39 //清理监听
38   - Set<String> keys = listenMap.keySet();
39   - Map<String, WebSocketSession> remMap = new HashMap<>();
40   - for(String k : keys){
41   - if(listenMap.get(k).contains(session))
42   - remMap.put(k, session);
43   - }
  40 + //Set<String> keys = listenMap.keySet();
  41 + //Map<String, WebSocketSession> remMap = new HashMap<>();
  42 +
  43 + int vsCount=0;
  44 + Collection<List<WebSocketSession>> vs = listenMap.values();
  45 + for(List<WebSocketSession> list : vs){
  46 + list.remove(session);
44 47  
45   - Set<String> remSet = remMap.keySet();
  48 + vsCount += list.size();
  49 + }
  50 + /*List<WebSocketSession> vs;
  51 + for(String k : keys){
  52 + //vs = listenMap.get(k);
  53 + //vs.remove(session);
  54 + listenMap.get(k).remove()
  55 + *//*if(listenMap.get(k).contains(session))
  56 + remMap.put(k, session);*//*
  57 + }*/
  58 +
  59 + /*Set<String> remSet = remMap.keySet();
46 60 for(String k : remSet){
47 61 listenMap.remove(k, remMap.get(k));
48 62 logger.info("web socket close, remove listen K: "+ k);
49   - }
50   - logger.info("listen values size: " + listenMap.values().size() + " -CloseStatus:" + arg1);
  63 + }*/
  64 + logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1);
51 65 }
52 66  
53 67 @Override
... ... @@ -65,8 +79,12 @@ public class RealControlSocketHandler implements WebSocketHandler {
65 79 //注册线路监听
66 80 List<String> idx = Splitter.on(",").splitToList(jsonObj.getString("idx"));
67 81 for(String lineCode : idx){
68   - if(BasicData.lineCode2NameMap.containsKey(lineCode))
69   - listenMap.put(lineCode, session);
  82 + if(BasicData.lineCode2NameMap.containsKey(lineCode)){
  83 + if(!listenMap.containsKey(lineCode)){
  84 + listenMap.put(lineCode, new ArrayList<WebSocketSession>());
  85 + }
  86 + listenMap.get(lineCode).add(session);
  87 + }
70 88 }
71 89 break;
72 90  
... ... @@ -97,12 +115,11 @@ public class RealControlSocketHandler implements WebSocketHandler {
97 115 public void sendMessageToLine(String lineCode, String msg) {
98 116  
99 117 TextMessage message = new TextMessage(msg.getBytes());
  118 + List<WebSocketSession> list = listenMap.get(lineCode);
  119 + if(list == null || list.size() == 0)
  120 + return;
100 121  
101   - Iterator<WebSocketSession> iterator = listenMap.get(lineCode).iterator();
102   -
103   - WebSocketSession user;
104   - while(iterator.hasNext()){
105   - user = iterator.next();
  122 + for(WebSocketSession user : list){
106 123 try {
107 124 if (user.isOpen()) {
108 125 user.sendMessage(message);
... ...
src/main/resources/rules/shiftloop_fb_2.drl
... ... @@ -148,7 +148,8 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
148 148 $self: schedulePlan
149 149 )
150 150 eval($self.getIsHistoryPlanFirst() == true) // 是否使用历史排班标识
151   - $sprr: SchedulePlanRuleResult($qyrq: qyrq) from scheduleRuleService.findLastByXl($xlId, $fromDate.toDate())
  151 + $sprr: SchedulePlanRuleResult() from scheduleRuleService.findLastByXl($xlId, $fromDate.toDate())
  152 + eval($sprr.getQyrq() != null)
152 153  
153 154 then
154 155 // 创建班序历史结果数据
... ... @@ -159,7 +160,7 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
159 160  
160 161 // 规则Md5编码
161 162 String md5 = Md5Util.getMd5(
162   - String.valueOf($qyrq.getTime()) + "_" +
  163 + String.valueOf($sprr.getQyrq().getTime()) + "_" +
163 164 $sprr.getGids() + "_" + $sprr.getEcids()
164 165 );
165 166  
... ... @@ -325,6 +326,7 @@ rule &quot;Calcu_loop2_1_&quot; // 路牌在时刻表中存在,就翻
325 326 schedulePlanRuleResult.setScheduleDate($csd2.toDate());
326 327 schedulePlanRuleResult.setTtinfoId($ttinfoId);
327 328 schedulePlanRuleResult.setTtinfoName($ttinfoName);
  329 + schedulePlanRuleResult.setQyrq($sri.getQyrq().toDate());
328 330  
329 331 scheduleResult.getSchedulePlanRuleResults().add(schedulePlanRuleResult);
330 332  
... ...
src/main/resources/rules/validplan.drl 0 → 100644
  1 +// TODO:
0 2 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/mould/scheduleAnaly_sum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
... ... @@ -64,6 +64,7 @@
64 64 <th colspan="4">下行末发</th>
65 65 </tr>
66 66 <tr class="hidden">
  67 + <th style="display: none;"></th>
67 68 <th>站点</th>
68 69 <th>计发</th>
69 70 <th>实发</th>
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.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: 160px;"></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: 160px;"/>
  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: 906px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr class="hidden">
  57 + <th>日期</th>
  58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
  61 + <th>计划首末班次数</th>
  62 + <th>实际准点首末班次数</th>
  63 + <th>首末班准点率</th>
  64 + </tr>
  65 + </thead>
  66 + <tbody>
  67 +
  68 + </tbody>
  69 + </table>
  70 + <div style="text-align: right;">
  71 + <ul id="pagination" class="pagination"></ul>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + </div>
  76 + </div>
  77 +</div>
  78 +
  79 +<script>
  80 + $(function(){
  81 + $('#export').attr('disabled', "true");
  82 +
  83 + // 关闭左侧栏
  84 + if (!$('body').hasClass('page-sidebar-closed'))
  85 + $('.menu-toggler.sidebar-toggler').click();
  86 +
  87 + $("#date").datetimepicker({
  88 + format : 'YYYY-MM-DD',
  89 + locale : 'zh-cn'
  90 + });
  91 +
  92 + var d = new Date();
  93 + var year = d.getFullYear();
  94 + var month = d.getMonth() + 1;
  95 + var day = d.getDate();
  96 + if(month < 10)
  97 + month = "0" + month;
  98 + if(day < 10)
  99 + day = "0" + day;
  100 + $("#date").val(year + "-" + month + "-" + day);
  101 +
  102 + var fage=false;
  103 + var xlList;
  104 + var obj = [];
  105 +
  106 + $.get('/report/lineList',function(result){
  107 + xlList=result;
  108 + $.get('/user/companyData', function(result){
  109 + obj = result;
  110 + var options = '';
  111 + for(var i = 0; i < obj.length; i++){
  112 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  113 + }
  114 +
  115 + if(obj.length ==0){
  116 + $("#company1").css('display','none');
  117 + }else if(obj.length ==1){
  118 + $("#company1").css('display','none');
  119 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  120 + $('#subCompany1').css('display','none');
  121 + }
  122 + $('#company').html(options);
  123 + updateCompany();
  124 + });
  125 + })
  126 + $("#company").on("change",updateCompany);
  127 + function updateCompany(){
  128 + var company = $('#company').val();
  129 + var options = '';
  130 + for(var i = 0; i < obj.length; i++){
  131 + if(obj[i].companyCode == company){
  132 + var children = obj[i].children;
  133 + for(var j = 0; j < children.length; j++){
  134 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  135 + }
  136 + }
  137 + }
  138 + $('#subCompany').html(options);
  139 + initXl();
  140 + }
  141 +
  142 + $("#subCompany").on("change",initXl);
  143 + function initXl(){
  144 + var data=[];
  145 + if(fage){
  146 + $("#line").select2("destroy").html('');
  147 + }
  148 + var fgs=$('#subCompany').val();
  149 + var gs=$('#company').val();
  150 + data.push({id: " ", text: "全部线路"});
  151 + for(var i=0;i<xlList.length;i++){
  152 + if(gs!=""){
  153 + if(fgs!=""){
  154 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  155 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  156 + }
  157 + }else{
  158 + if(xlList[i]["gsbm"]==gs){
  159 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  160 + }
  161 + }
  162 + }
  163 + }
  164 + initPinYinSelect2('#line',data,'');
  165 + fage=true;
  166 + }
  167 +
  168 +
  169 + $("#query").on("click",jsDoQuery);
  170 +
  171 + var company = $("#company").val();
  172 + var subCompany = $("#subCompany").val();
  173 + var line = $("#line").val();
  174 + var date = $("#date").val();
  175 + function jsDoQuery(pagination){
  176 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  177 + layer.msg("请选择时间!");
  178 + return;
  179 + }
  180 + var params = {};
  181 + company = $("#company").val();
  182 + subCompany = $("#subCompany").val();
  183 + line = $("#line").val();
  184 + date = $("#date").val();
  185 + if(line == " ")
  186 + line = "";
  187 + params['company'] = company;
  188 + params['subCompany'] = subCompany;
  189 + params['line'] = line;
  190 + params['line'] = line;
  191 + params['date'] = date;
  192 + params['type'] = "query";
  193 + $(".hidden").removeClass("hidden");
  194 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  195 + // 把数据填充到模版中
  196 + var tbodyHtml = template('list_firstAndLastBus',{list:result});
  197 + // 把渲染好的模版html文本追加到表格中
  198 + $('#forms tbody').html(tbodyHtml);
  199 +
  200 + if(result.length == 0)
  201 + $("#export").attr('disabled',"true");
  202 + else
  203 + $("#export").removeAttr("disabled");
  204 + });
  205 + }
  206 +
  207 + $("#export").on("click",function(){
  208 + var params = {};
  209 + params['company'] = company;
  210 + params['subCompany'] = subCompany;
  211 + params['line'] = line;
  212 + params['line'] = line;
  213 + params['date'] = date;
  214 + params['type'] = "export";
  215 + $get('/pcpc/firstAndLastBus', params, function(result){
  216 + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
  217 + });
  218 + });
  219 +
  220 +
  221 + });
  222 +
  223 +</script>
  224 +<script type="text/html" id="list_firstAndLastBus">
  225 + {{each list as obj i}}
  226 + <tr>
  227 + <td>{{obj.date}}</td>
  228 + <td>{{obj.company}}</td>
  229 + <td>{{obj.subCompany}}</td>
  230 + <td>{{obj.line}}</td>
  231 + <td>{{obj.jhbc}}</td>
  232 + <td>{{obj.sjbc}}</td>
  233 + <td>{{obj.zdl}}</td>
  234 + </tr>
  235 + {{/each}}
  236 + {{if list.length == 0}}
  237 + <tr>
  238 + <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td>
  239 + </tr>
  240 + {{/if}}
  241 +</script>
0 242 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.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: 38px;" 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: 24px;" 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: 15px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="margin-top: 10px"></div>
  43 + <div style="display: inline-block;margin-left: 10px;">
  44 + <span class="item-label" style="width: 80px;">开始时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
  46 + </div>
  47 + <div style="display: inline-block;margin-left: 10px;">
  48 + <span class="item-label" style="width: 80px;">结束时间: </span>
  49 + <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 15px;">
  52 + <span class="item-label" style="width: 80px;">车辆: </span>
  53 + <select class="form-control" id="nbbm" style="width: 160px;"></select>
  54 + </div>
  55 +<!-- <div style="display: inline-block;margin-left: 10px;"> -->
  56 +<!-- <span class="item-label" style="width: 80px;">模板类型: </span> -->
  57 +<!-- <select class="form-control" name="model" id="model" style="width: 160px;"> -->
  58 +<!-- <option value="">请选择...</option> -->
  59 +<!-- </select> -->
  60 +<!-- </div> -->
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body">
  68 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  69 + <table class="table table-bordered table-hover table-checkable" id="forms">
  70 + <thead>
  71 + <tr class="hidden">
  72 + <th style="display: none;"></th>
  73 + <th>时间段</th>
  74 + <th>上行班次</th>
  75 + <th>下行班次</th>
  76 + <th>上行平均运送</th>
  77 + <th>下行平均运送</th>
  78 + <th>平均运送</th>
  79 + </tr>
  80 + </thead>
  81 + <tbody>
  82 +
  83 + </tbody>
  84 + </table>
  85 + <div style="text-align: right;">
  86 + <ul id="pagination" class="pagination"></ul>
  87 + </div>
  88 + </div>
  89 + </div>
  90 + </div>
  91 + </div>
  92 +</div>
  93 +
  94 +<script>
  95 + $(function(){
  96 + var page = 0, initPagination;
  97 + $('#export').attr('disabled', "true");
  98 +
  99 + // 关闭左侧栏
  100 + if (!$('body').hasClass('page-sidebar-closed'))
  101 + $('.menu-toggler.sidebar-toggler').click();
  102 +
  103 + $("#startDate").datetimepicker({
  104 + format : 'YYYY-MM-DD',
  105 + locale : 'zh-cn'
  106 + });
  107 +
  108 + $("#endDate").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 +
  113 + var d = new Date();
  114 + var year = d.getFullYear();
  115 + var month = d.getMonth() + 1;
  116 + var day = d.getDate();
  117 + if(month < 10)
  118 + month = "0" + month;
  119 + if(day < 10)
  120 + day = "0" + day;
  121 + $("#startDate").val(year + "-" + month + "-" + day);
  122 + $("#endDate").val(year + "-" + month + "-" + day);
  123 +
  124 + var fage=false;
  125 + var xlList;
  126 + var obj = [];
  127 +
  128 + $.get('/report/lineList',function(result){
  129 + xlList=result;
  130 + $.get('/user/companyData', function(result){
  131 + obj = result;
  132 + var options = '';
  133 + for(var i = 0; i < obj.length; i++){
  134 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  135 + }
  136 +
  137 + if(obj.length ==0){
  138 + $("#company1").css('display','none');
  139 + }else if(obj.length ==1){
  140 + $("#company1").css('display','none');
  141 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  142 + $('#subCompany1').css('display','none');
  143 + }
  144 + $('#company').html(options);
  145 + updateCompany();
  146 + });
  147 + })
  148 + $("#company").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#company').val();
  151 + var options = '';
  152 + for(var i = 0; i < obj.length; i++){
  153 + if(obj[i].companyCode == company){
  154 + var children = obj[i].children;
  155 + for(var j = 0; j < children.length; j++){
  156 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  157 + }
  158 + }
  159 + }
  160 + $('#subCompany').html(options);
  161 + initXl();
  162 + }
  163 +
  164 + $("#subCompany").on("change",initXl);
  165 + function initXl(){
  166 + var data=[];
  167 + if(fage){
  168 + $("#line").select2("destroy").html('');
  169 + }
  170 + var fgs=$('#subCompany').val();
  171 + var gs=$('#company').val();
  172 + for(var i=0;i<xlList.length;i++){
  173 + if(gs!=""){
  174 + if(fgs!=""){
  175 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  176 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  177 + }
  178 + }else{
  179 + if(xlList[i]["gsbm"]==gs){
  180 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  181 + }
  182 + }
  183 + }
  184 + }
  185 + initPinYinSelect2('#line',data,'');
  186 + line = data[0].id;
  187 + updateModel();
  188 + initCl();
  189 +
  190 + fage=true;
  191 + }
  192 +
  193 +
  194 + $("#query").on("click", function(){
  195 + page = 0;
  196 + jsDoQuery(true);
  197 + });
  198 +
  199 + var line = $("#line").val();
  200 + var startDate = $("#startDate").val();
  201 + var endDate = $("#endDate").val();
  202 + var model = $("#model").val();
  203 + var nbbm = "";
  204 + var company = $("#company").val();
  205 + var subCompany = $("#subCompany").val();
  206 + function jsDoQuery(pagination){
  207 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  208 + layer.msg("请选择时间范围!");
  209 + return;
  210 + }
  211 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  212 + layer.msg("请选择时间范围!");
  213 + return;
  214 + }
  215 + var params = {};
  216 +// line = $("#line").val();
  217 + startDate = $("#startDate").val();
  218 + endDate = $("#endDate").val();
  219 +// model = $("#model").val();
  220 + nbbm = $("#nbbm").val()!=null?$("#nbbm").val():"";
  221 + company = $("#company").val();
  222 + subCompany = $("#subCompany").val();
  223 + params['page'] = page;
  224 + params['line'] = line;
  225 + params['startDate'] = startDate;
  226 + params['endDate'] = endDate;
  227 +// params['model'] = model;
  228 + params['company'] = company;
  229 + params['subCompany'] = subCompany;
  230 + params['nbbm'] = nbbm;
  231 + params['type'] = "query";
  232 + $(".hidden").removeClass("hidden");
  233 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  234 + // 把数据填充到模版中
  235 + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});
  236 + // 把渲染好的模版html文本追加到表格中
  237 + $('#forms tbody').html(tbodyHtml);
  238 +
  239 + if(result.dataList.length == 0)
  240 + $("#export").attr('disabled',"true");
  241 + else
  242 + $("#export").removeAttr("disabled");
  243 +
  244 + });
  245 + }
  246 +
  247 + $("#export").on("click",function(){
  248 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  249 + layer.msg("请选择时间范围!");
  250 + return;
  251 + }
  252 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  253 + layer.msg("请选择时间范围!");
  254 + return;
  255 + }
  256 + var params = {};
  257 + params['page'] = page;
  258 + params['line'] = line;
  259 + params['startDate'] = startDate;
  260 + params['endDate'] = endDate;
  261 +// params['model'] = model;
  262 + params['company'] = company;
  263 + params['subCompany'] = subCompany;
  264 + params['nbbm'] = nbbm;
  265 + params['type'] = "export";
  266 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  267 + window.open("/downloadFile/download?fileName=时刻表分析(汇总)"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  268 + });
  269 + });
  270 +
  271 +
  272 + $("#line").on("change", function(){
  273 + line = $("#line").val();
  274 + if(line == " ")
  275 + line = "";
  276 + updateModel();
  277 + });
  278 + $('#startDate').on("blur", function(){
  279 + startDate = $("#startDate").val();
  280 + endDate = $("#endDate").val();
  281 + updateModel();
  282 + });
  283 + $('#endDate').on("blur", function(){
  284 + startDate = $("#startDate").val();
  285 + endDate = $("#endDate").val();
  286 + updateModel();
  287 + });
  288 +
  289 + var flag = 0;
  290 + function updateModel(){
  291 + if(flag == 1)
  292 + return;
  293 + flag = 1;
  294 + var treeData = [];
  295 + var params = {};
  296 + params['line'] = line;
  297 + params['startDate'] = startDate;
  298 + params['endDate'] = endDate;
  299 + $get('/pcpc/getModel', params, function(result){
  300 + treeData = createTreeData(result);
  301 + var options = '<option value="">请选择...</option>';
  302 + var size = 0;
  303 + $.each(treeData, function(i, g){
  304 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  305 + size++;
  306 + });
  307 + $('#model').html(options)/* .select2() */;
  308 + flag = 0;
  309 + });
  310 + }
  311 +
  312 + function initCl(){
  313 + $('#nbbm').select2({
  314 + placeholder: '搜索车辆...',
  315 + ajax: {
  316 + url: '/report/carList',
  317 + dataType: 'json',
  318 + delay: 150,
  319 + data: function(params){
  320 + return{nbbm: params.term,
  321 + gsbm:$('#gsdm').val(),
  322 + fgsbm:$('#fgsdm').val(),
  323 + xlbm:$('#line').val()};
  324 + },
  325 + processResults: function (data) {
  326 + return {
  327 + results: data
  328 + };
  329 + },
  330 + cache: true
  331 + },
  332 + templateResult: function(repo){
  333 + if (repo.loading) return repo.text;
  334 + var h = '<span>'+repo.text+'</span>';
  335 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  336 + return h;
  337 + },
  338 + escapeMarkup: function (markup) { return markup; },
  339 + minimumInputLength: 1,
  340 + templateSelection: function(repo){
  341 + return repo.text;
  342 + },
  343 + language: {
  344 + noResults: function(){
  345 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  346 + },
  347 + inputTooShort : function(e) {
  348 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  349 + },
  350 + searching : function() {
  351 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  352 + }
  353 + }
  354 + });
  355 + };
  356 +
  357 +
  358 + });
  359 +
  360 +</script>
  361 +<script type="text/html" id="list_scheduleAnaly">
  362 + {{each list as obj i}}
  363 + <tr>
  364 + <th style="display: none;"></th>
  365 + <td>{{obj.time}}</td>
  366 + <td>{{obj.upbc}}</td>
  367 + <td>{{obj.dnbc}}</td>
  368 + <td>{{obj.upys}}</td>
  369 + <td>{{obj.dnys}}</td>
  370 + <td>{{obj.pjys}}</td>
  371 + </tr>
  372 + {{/each}}
  373 + {{if list.length == 0}}
  374 + <tr>
  375 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  376 + </tr>
  377 + {{/if}}
  378 +</script>
0 379 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -548,6 +548,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
548 548 }
549 549 }
550 550 }
  551 + ),
  552 + latestsd: $resource(
  553 + '/spic/lastestsd/:xlid',
  554 + {},
  555 + {
  556 + list: {
  557 + method: 'GET',
  558 + isArray: true,
  559 + transformResponse: function(rs) {
  560 + var dst = angular.fromJson(rs);
  561 + if (dst.status == 'SUCCESS') {
  562 + return dst.data;
  563 + } else {
  564 + return dst; // 业务错误留给控制器处理
  565 + }
  566 + }
  567 + }
  568 + }
551 569 )
552 570  
553 571  
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
1 1 <!-- ui-route employeeInfoManage.list -->
2 2 <div ng-controller="SchedulePlanReportExtManageListCtrl as ctrl">
  3 +
  4 + <div class="portlet">
  5 + <div class="portlet-title">
  6 + <div class="caption caption-subject font-red-sunglo bold uppercase">
  7 + 最近排班至
  8 + <span ng-bind="ctrl.lsd | date: 'yyyy年MM月dd日'">
  9 + </span>
  10 + </div>
  11 + </div>
  12 + </div>
  13 +
3 14 <div class="fixDiv">
4 15 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"
5 16 style="width: 1800px; min-height: 500px;">
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
... ... @@ -46,6 +46,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(
46 46 },
47 47  
48 48 /**
  49 + * 查询线路最近排班日期。
  50 + * @param xlid
  51 + */
  52 + getLastestsd: function() {
  53 + var params = currentSearchCondition; // 查询条件
  54 + return service.latestsd.list(params).$promise;
  55 + },
  56 +
  57 + /**
49 58 * 批量保存排班明细。
50 59 * @param rs
51 60 */
... ... @@ -168,6 +177,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
168 177 return service.resetSearchCondition();
169 178 };
170 179  
  180 + self.lsd;
  181 +
171 182 // 监控条件变化,触发查询
172 183 $scope.$watch(
173 184 function() {
... ... @@ -175,6 +186,22 @@ angular.module(&#39;ScheduleApp&#39;).controller(
175 186 },
176 187 function(newValue, oldValue) {
177 188 if (newValue) {
  189 + if (newValue.xlid) {
  190 + service.getLastestsd().then(
  191 + function(result) {
  192 + if (result.length > 0) {
  193 + self.lsd = new Date();
  194 + self.lsd.setTime(result[0]);
  195 + } else {
  196 + self.lsd = "暂无排班";
  197 + }
  198 +
  199 + },
  200 + function() {
  201 + }
  202 + );
  203 + }
  204 +
178 205 if (newValue.xlid && newValue.sdate) {
179 206 self.pageChanaged();
180 207 }
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
... ... @@ -126,6 +126,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
126 126 }
127 127 }
128 128 }
  129 + ),
  130 + latestsd: $resource(
  131 + '/spic/lastestsd/:xlid',
  132 + {},
  133 + {
  134 + list: {
  135 + method: 'GET',
  136 + isArray: true,
  137 + transformResponse: function(rs) {
  138 + var dst = angular.fromJson(rs);
  139 + if (dst.status == 'SUCCESS') {
  140 + return dst.data;
  141 + } else {
  142 + return dst; // 业务错误留给控制器处理
  143 + }
  144 + }
  145 + }
  146 + }
129 147 )
130 148  
131 149  
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
... ... @@ -705,7 +705,7 @@
705 705 data.jName = data.jsy.split('/')[1];
706 706 delete data.jsy;
707 707 //拆分售票员工号和姓名
708   - if (data.sGh != null) {
  708 + if (data.spy != '') {
709 709 data.sGh = data.spy.split('/')[0];
710 710 data.sName = data.spy.split('/')[1];
711 711 delete data.spy;
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch/h_add_temp_sch.html
... ... @@ -707,7 +707,7 @@
707 707 data.jName = data.jsy.split('/')[1];
708 708 delete data.jsy;
709 709 //拆分售票员工号和姓名
710   - if (data.sGh != null) {
  710 + if (data.spy != null) {
711 711 data.sGh = data.spy.split('/')[0];
712 712 data.sName = data.spy.split('/')[1];
713 713 delete data.spy;
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 169 function showUpdateDescription() {
170 170 //更新说明
171 171 var updateDescription = {
172   - date: '2017-05-07',
173   - text: '<h5>修复了一个问题,该问题导致在某些特定情况下,报出的发车时间比实际的要晚1~3分钟。</h5>'
  172 + date: '2017-05-09',
  173 + text: '<h5>恢复到了最新功能版本,并修复了临加时没有保存售票员的问题。</h5>'
174 174 };
175 175  
176 176 var storage = window.localStorage
... ...
src/test/resources/testdata/problem.properties
... ... @@ -14,7 +14,7 @@
14 14 14=路牌编号自动生成
15 15 15=时刻表导入的时候表头后面不需要加数字
16 16 ##16=时间框中文
17   -17=人员工号前公司编码自动加
  17 +##17=人员工号前公司编码自动加
18 18 18=排班计划明细可以修改(修改到每个班次)
19 19 19=线路运营概览
20 20 20=排班规则备注
... ... @@ -31,3 +31,4 @@
31 31 ##30=时刻表公里数 三位数
32 32  
33 33 31=规则修改,路牌范围,人员范围可以拖动
  34 +32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入
... ...