CalcIntervalServiceImpl.java
20.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
package com.bsth.service.calc.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;
import com.bsth.data.BasicData;
import com.bsth.entity.Line;
import com.bsth.entity.calc.CalcInterval;
import com.bsth.entity.realcontrol.ScheduleRealInfo;
import com.bsth.entity.sheet.CalcSheet;
import com.bsth.entity.sheet.Sheet;
import com.bsth.repository.LineRepository;
import com.bsth.repository.calc.CalcIntervalRepository;
import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
import com.bsth.service.calc.CalcIntervalService;
import com.bsth.service.impl.BaseServiceImpl;
import com.bsth.util.ComparableReal;
import com.bsth.util.ReportUtils;
@Service
public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Integer> implements CalcIntervalService {
private static long zgf1 = 6 * 60 + 31,
zgf2 = 8 * 60 + 30,
wgf1 = 16 * 60 + 1,
wgf2 = 18 * 60;
@Autowired
CalcIntervalRepository calcIntervalRepository;
@Autowired
ScheduleRealInfoRepository scheduleRealInfoRepository;
@Autowired
LineRepository lineRepository;
@Autowired
JdbcTemplate jdbcTemplate;
@Override
public List<Map<String, Object>> countList(Map<String, Object> map) {
// TODO Auto-generated method stub
final DecimalFormat df = new DecimalFormat("0.00");
List<Map<String, Object>> list=new ArrayList<>();
String level=map.get("levelType").toString();
String line=map.get("line").toString().trim();
String gs=map.get("gs").toString().trim();
String fgs=map.get("fgs").toString().trim();
String sDate=map.get("date").toString();
String eDate=map.get("endDate").toString();
//D级线路显示发车准点率
if(level.equals("D")){
String sql1=" select xl_bm,gsbm,fgsbm,xl_name from bsth_c_calc_interval where date >='"+sDate+"' and date <= '"+eDate+"' and `level`='D'";
if(line.equals("")){
if(fgs.equals("")){
sql1 +=" and gsbm = '"+gs+"'";
}else{
sql1 +=" and gsbm = '"+gs+"' and fgsbm = '"+fgs+"'";
}
}else{
sql1 +=" and xl_bm ='"+line+"'";
}
sql1+=" group by xl_bm,gsbm,fgsbm,xl_name";
String sql2="select gsdm,fgsdm,xl,xl_name,max(id) as id,sum(jhszfcs) as jhszfcs,"
+ " sum(sjszfczds) as sjszfczds,sum(sjszddzds) as sjszddzds from bsth_c_calc_sheet where date >= '"+sDate+"' and date <= '"+eDate+"'";
if(line.trim().equals("")){
if(fgs.equals("")){
sql2 +=" and gsdm = '"+gs+"'";
}else{
sql2 +=" and gsdm = '"+gs+"' and fgsdm = '"+fgs+"'";
}
}else{
sql2 +=" and xl ='"+line+"'";
}
sql2 +=" group by gsdm,fgsdm,xl,xl_name";
String sql="select b.* from ("+sql1+") a left join ("+sql2+") b"
+ " on a.xl_bm=b.xl and a.gsbm=b.gsdm and a.fgsbm=b.fgsdm and a.xl_name=b.xl_name";
list=jdbcTemplate.query(sql,
new RowMapper<Map<String,Object>>(){
@Override
public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
Map<String, Object> m=new HashMap<String,Object>();
m.put("gs", BasicData.businessCodeNameMap.get(rs.getString("gsdm")));
m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsdm")+"_"+rs.getString("gsdm")));
m.put("xlBm", rs.getString("xl"));
m.put("line", rs.getString("xl_name"));
m.put("xlName", rs.getString("xl_name"));//与另一个导出通用
m.put("id", rs.getInt("id"));
m.put("bcs", rs.getString("jhszfcs"));
m.put("zdbcs", rs.getString("sjszfczds"));
m.put("ddzdbcs", rs.getString("sjszddzds"));
int jhfc=rs.getInt("jhszfcs");
int zdfc=rs.getInt("sjszfczds");
int zddd=rs.getInt("sjszddzds");
if(jhfc>0){
double zdl=(zdfc*1.0)/(jhfc*1.0)*100;
m.put("zdlv", df.format(zdl)+"%");
zdl=(zddd*1.0)/(jhfc*1.0)*100;
m.put("ddzdlv", df.format(zdl)+"%");
}else{
m.put("zdlv", "0.0%");
m.put("ddzdlv", "0.0%");
}
return m;
}
});
}else{
String sql="select gsbm,fgsbm,xl_bm,xl_name,SUM(bcs) as bcs,MAX(id) as id,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,"
+ "SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime "
+ "from bsth_c_calc_interval where date>= '"+sDate+"' and date<='"+eDate+"' and level <> 'D' and djg_all >0 ";
if(line.equals("")){
if(fgs.equals("")){
sql +=" and gsbm = '"+gs+"'";
}else{
sql +=" and gsbm = '"+gs+"' and fgsbm = '"+fgs+"'";
}
}else{
sql +=" and xl_bm ='"+line+"'";
}
sql += " group by xl_bm,gsbm,fgsbm,xl_name";
list=jdbcTemplate.query(sql,
new RowMapper<Map<String,Object>>(){
@Override
public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
Map<String, Object> m=new HashMap<String,Object>();
m.put("gs", BasicData.businessCodeNameMap.get(rs.getString("gsbm")));
m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsbm")+"_"+rs.getString("gsbm")));
m.put("xlBm", rs.getString("xl_bm"));
m.put("xlName", rs.getString("xl_name"));
m.put("bcs", rs.getInt("bcs"));
m.put("id", rs.getInt("id"));
int djgAll=rs.getInt("djgAll");
int bcs=rs.getInt("bcs");
//全日发生率 (大间隔次数/全日班次数)
if(bcs>0){
double fsl=(djgAll*1.0)/(bcs*1.0)*100;
m.put("fsl", df.format(fsl)+"%");
}else{
m.put("fsl", "0.0%");
}
m.put("djgAll", rs.getString("djgAll"));
m.put("djgGf", rs.getString("djgGf"));
m.put("djgZgf", rs.getString("djgZgf"));
m.put("djgWgf", rs.getString("djgWgf"));
m.put("djgDg", rs.getString("djgDg"));
m.put("djgTime", rs.getString("djgTime"));
return m;
}
});
}
if(map.get("type").equals("export")){
String lineName="";
if(line.equals("")){
if(fgs.equals("")){
lineName=list.get(0).get("gs").toString();
}else{
lineName=list.get(0).get("fgs").toString();
}
}else{
lineName=list.get(0).get("xlName").toString();
}
List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
Map<String, Object> m = new HashMap<String, Object>();
ReportUtils ee = new ReportUtils();
try {
String dateTime = "";
if(sDate.equals(eDate)){
dateTime = sDate.replaceAll("-", "");
} else {
dateTime = sDate.replaceAll("-", "")+"-"+
eDate.replaceAll("-", "");
}
listI.add(list.iterator());
String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
String xls="";
String xlsName="";
if(level.equals("D")){
m.put("date", sDate);
m.put("endDate", eDate);
xls="calcSheetList.xls";
xlsName="发车到站准点率.xls";
}else{
m.put("sDate", sDate);
m.put("eDate", eDate);
xls="calcIntervalCount.xls";
xlsName="大间隔汇总表.xls";
}
ee.excelReplace(listI, new Object[]{m}, path + "mould/" + ""+xls,
path + "export/"+dateTime+"-"+lineName+"-"+xlsName);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
return list;
}
@Override
public List<Map<String, Object>> listInterval(Map<String, Object> map) {
// TODO Auto-generated method stub
final DecimalFormat df = new DecimalFormat("0.00");
String line=map.get("line").toString();
String date=map.get("date").toString();
String endDate=map.get("endDate").toString();
List<CalcInterval> listAll=calcIntervalRepository.selectByDateAndLine(line, date, endDate, "");
List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
for (int i = 0; i < listAll.size(); i++) {
CalcInterval t=listAll.get(i);
if(!t.getLevel().equals("D") && t.getDjgAll()>0){
Map<String, Object> m=new HashMap<>();
m.put("gs", t.getGsname());
m.put("fgs", t.getFgsname());
m.put("date", t.getDate());
m.put("xl", t.getXlName());
m.put("xlBm", t.getXlBm());
m.put("level", t.getLevel());
m.put("djgAll", t.getDjgAll());
m.put("djgGf", t.getDjgGf());
m.put("djgZgf", t.getDjgZgf());
m.put("djgWgf", t.getDjgWgf());
m.put("djgDg", t.getDjgDg());
int djgAll=t.getDjgAll();
int bcs=t.getBcs();
//全日发生率 (大间隔次数/全日班次数)
if(bcs>0){
double fsl=(djgAll*1.0)/(bcs*1.0)*100;
m.put("fsl", df.format(fsl)+"%");
}else{
m.put("fsl", "0.0%");
}
m.put("bcs", t.getBcs());
m.put("djgTime", t.getDjgTime());
tempList.add(m);
}
}
if(map.get("type").equals("export")){
List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
Map<String, Object> m = new HashMap<String, Object>();
m.put("date", date);
m.put("endDate", endDate);
ReportUtils ee = new ReportUtils();
try {
listI.add(tempList.iterator());
String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "calcIntervalList1.xls",
path + "export/大间距汇总表"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
return tempList;
}
@Override
public List<Map<String, Object>> interval(Map<String, Object> map) {
// TODO Auto-generated method stub
List<Map<String, Object>> list=new ArrayList<>();
String line=map.get("line").toString();
String date=map.get("date").toString();
List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleDaily(line, date);
List<CalcInterval> listInterval=calcIntervalRepository.selectByDateAndLine(line, date, "");
String level=listInterval.get(0).getLevel();
if(listReal.size()>0){
Line t=lineRepository.findByLineCode(line);
long minFcsj = minFcsjs(t.getId());
list=calcIntervalList(listReal, minFcsj,level,t);
}
if(map.get("type").toString().equals("export")){
List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
Map<String, Object> m = new HashMap<String, Object>();
m.put("date", date);
ReportUtils ee = new ReportUtils();
try {
listI.add(list.iterator());
String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "interval.xls",
path + "export/"+date+"大间隔详细.xls");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
return list;
}
private List<Map<String, Object>> calcIntervalList(List<ScheduleRealInfo> lists,long minFcsj,String level,Line line) {
List<ScheduleRealInfo> listjh0 = new ArrayList<ScheduleRealInfo>();
List<ScheduleRealInfo> listjh1 = new ArrayList<ScheduleRealInfo>();
List<ScheduleRealInfo> listsj0 = new ArrayList<ScheduleRealInfo>();
List<ScheduleRealInfo> listsj1 = new ArrayList<ScheduleRealInfo>();
List<Map<String, Object>> list=new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
SimpleDateFormat sdf_ = new SimpleDateFormat("yyyy-MM-dd");
String xlName=lists.get(0).getXlName();
String scheduleDate=lists.get(0).getScheduleDateStr();
for (int j = 0; j < lists.size(); j++) {
ScheduleRealInfo s = lists.get(j);
boolean fage=false;
if(s.getBcType().equals("normal")){
fage=true;
}
if(s.getBcType().equals("region")){
if(s.getXlDir().equals("0")){
if(s.getQdzName().equals(line.getStartStationName()));
fage=true;
}else{
if(s.getQdzName().equals(line.getEndStationName()));
fage=true;
}
}
if (fage) {
String[] fcsj = s.getFcsj().split(":");
Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
Long fcsjT = 0L;
if (fcsjL < minFcsj) {
Calendar calendar = new GregorianCalendar();
calendar.setTime(s.getScheduleDate());
calendar.add(calendar.DATE, 1);
Date date = calendar.getTime();
try {
fcsjT = sdf.parse(sdf_.format(date) + " " + s.getFcsj()).getTime();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
try {
fcsjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Long fcsjAcual = 0L;
if (StringUtils.isEmpty(s.getFcsjActual())) {
s.setFcsjActualTime(0L);
s.setFcsjT(fcsjT);
} else {
try {
fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
s.setFcsjActualTime(fcsjAcual);
s.setFcsjT(fcsjT);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (s.isSflj()) {
if(StringUtils.isNotEmpty(s.getFcsjActual())){
if (s.getXlDir().equals("0")) {
listsj0.add(s);
} else {
listsj1.add(s);
}
}
} else {
if (s.getXlDir().equals("0")) {
if(StringUtils.isNotEmpty(s.getFcsjActual())){
listsj0.add(s);
}
listjh0.add(s);
} else {
if(StringUtils.isNotEmpty(s.getFcsjActual())){
listsj1.add(s);
}
listjh1.add(s);
}
}
}
}
/*
* 所有班次信息按上下行计划实际班次分组和根据计划实际发车时间排序
*/
Collections.sort(listjh0, new ComparableJhfc());
Collections.sort(listjh1, new ComparableJhfc());
Collections.sort(listsj0, new ComparableAcual());
Collections.sort(listsj1, new ComparableAcual());
long max_time=0;
String jhfc="";
String sjfc="";
if(listsj0.size()>2){
//首班与首二班,末班与末二班中间的间隔不参与到统计
int p_time=0;
boolean p_fage=false; //判断两个班次是否为高峰班次,只有前后两个班次都是高峰班次,班次大间隔标准才用高峰标准
long p_actual_time=0;
String p_type="";
for (int j = 1; j < listsj0.size()-1; j++) {
boolean isAdd=false; //判断是否需要往map里面添加值
ScheduleRealInfo s =listsj0.get(j);
Map<String, Object> mm=new HashMap<>();
String[] fcsj = s.getFcsjActual().split(":");
int time = Integer.parseInt(fcsj[0]) * 60 + Integer.parseInt(fcsj[1]);
boolean fage=false;
String type="";
if (time >= zgf1 && time <= zgf2) {
fage=true;
type="zgf";
} else if (time >= wgf1 && time <= wgf2) {
fage=true;
type="wgf";
} else {
fage=false;
}
long sub_time=(s.getFcsjActualTime()-p_actual_time)/1000/60;
if(p_time>0){
if(sub_time>max_time){
max_time=sub_time;
}
if(fage&&p_fage){
//高峰间隔统计
if("zgf".equals(type) && type.equals(p_type)){
if(level.equals("A")){
if(sub_time >15)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >20)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >25)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
}
}else if("wgf".equals(type) && type.equals(p_type)){
if(level.equals("A")){
if(sub_time >15)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >20)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >25)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
}
}
}else{
//平谷间隔统计
if(level.equals("A")){
if(sub_time >29)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >29)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >40)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
max_time=0;
}
}
}
if(isAdd){
mm.put("xlName", xlName);
mm.put("level", level);
mm.put("jhfc1", jhfc);
mm.put("sjfc1", sjfc);
mm.put("jhfc2", s.getFcsj());
mm.put("sjfc2", s.getFcsjActual());
mm.put("subTime", sub_time);
mm.put("date", scheduleDate);
mm.put("station", s.getQdzName());
list.add(mm);
}
p_fage=fage;
p_type=type;
p_time =time;
p_actual_time=s.getFcsjActualTime();
jhfc=s.getFcsj();
sjfc=s.getFcsjActual();
}
}
jhfc="";
sjfc="";
if(listsj1.size()>2){
//首班与首二班,末班与末二班中间的间隔不参与到统计
int p_time=0;
boolean p_fage=false; //判断两个班次是否为高峰班次,只有前后两个班次都是高峰班次,班次大间隔标准才用高峰标准
long p_actual_time=0;
String p_type="";
for (int j = 1; j < listsj1.size()-1; j++) {
boolean isAdd=false; //判断是否需要往map里面添加值
ScheduleRealInfo s =listsj1.get(j);
Map<String, Object> mm=new HashMap<>();
String[] fcsj = s.getFcsjActual().split(":");
int time = Integer.parseInt(fcsj[0]) * 60 + Integer.parseInt(fcsj[1]);
boolean fage=false;
String type="";
if (time >= zgf1 && time <= zgf2) {
fage=true;
type="zgf";
} else if (time >= wgf1 && time <= wgf2) {
fage=true;
type="wgf";
} else {
fage=false;
}
long sub_time=(s.getFcsjActualTime()-p_actual_time)/1000/60;
if(p_time>0){
if(sub_time>max_time){
max_time=sub_time;
}
if(fage&&p_fage){
//高峰间隔统计
if("zgf".equals(type) && type.equals(p_type)){
if(level.equals("A")){
if(sub_time >15)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >20)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >25)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
}
}else if("wgf".equals(type) && type.equals(p_type)){
if(level.equals("A")){
if(sub_time >15)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >20)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >25)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
}
}
}else{
//平谷间隔统计
if(level.equals("A")){
if(sub_time >29)
isAdd=true;
}else if(level.equals("B")){
if(sub_time >29)
isAdd=true;
}else if(level.equals("C")){
if(sub_time >40)
isAdd=true;
}else {
//D类不计算大间隔时间,通过发车准点率
max_time=0;
}
}
}
if(isAdd){
mm.put("xlName", xlName);
mm.put("level", level);
mm.put("jhfc1", jhfc);
mm.put("sjfc1", sjfc);
mm.put("jhfc2", s.getFcsj());
mm.put("sjfc2", s.getFcsjActual());
mm.put("subTime", sub_time);
mm.put("date", scheduleDate);
mm.put("station", s.getQdzName());
list.add(mm);
}
p_fage=fage;
p_type=type;
p_time =time;
p_actual_time=s.getFcsjActualTime();
jhfc=s.getFcsj();
sjfc=s.getFcsjActual();
}
}
return list;
}
private Long minFcsjs(int id){
String minfcsj="02:00";
String sqlMinYysj="select ifnull(max(start_opt),'02:00') as start_opt from bsth_c_line_config where "
+ " id = ("
+ "select max(id) from bsth_c_line_config where line ='"+id +"'"
+ ")";
minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
String[] minSjs = minfcsj.split(":");
//车辆最早发车时间 用了过滤超第二天0点的数据
Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
return minSj;
}
}
class ComparableJhfc implements Comparator<ScheduleRealInfo>{
@Override
public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
// TODO Auto-generated method stub
return o1.getFcsjT().compareTo(o2.getFcsjT());
}
}
class ComparableAcual implements Comparator<ScheduleRealInfo>{
@Override
public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
// TODO Auto-generated method stub
return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime());
}
}