Commit a77679115bc972d68d09618ced5b17bca48d8937
1 parent
6ed3aa69
催发调整
Showing
1 changed file
with
11 additions
and
6 deletions
src/main/java/com/bsth/data/zndd/OutEntrance.java
| ... | ... | @@ -109,21 +109,26 @@ public class OutEntrance { |
| 109 | 109 | rtn.put("message",s+"车辆预计还有"+dzList.get(0).get("sj")+"抵达,请耐心等待"); |
| 110 | 110 | }else { |
| 111 | 111 | //筛选方向 |
| 112 | - List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode()); | |
| 112 | + List<ScheduleRealInfo> rs = dayOfSchedule.findByLineAndUpDown(ssLogger.getLineCode(),Integer.parseInt(ssLogger.getDir())); | |
| 113 | 113 | if(rs.size()>0){ |
| 114 | 114 | //排序 |
| 115 | 115 | Collections.sort(rs,new ScheduleComparator.FCSJ()); |
| 116 | - SimpleDateFormat sdf= new SimpleDateFormat("HH:ss"); | |
| 117 | - String sjtext = ""; | |
| 116 | + SimpleDateFormat sdf= new SimpleDateFormat("HH:mm"); | |
| 117 | + String sjtext = null; | |
| 118 | 118 | LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm")); |
| 119 | 119 | for (ScheduleRealInfo sr:rs) { |
| 120 | 120 | LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm")); |
| 121 | - //判断上下行 | |
| 122 | - if(t1.isAfter(t2)){ | |
| 121 | + //最近的运营班次 | |
| 122 | + if(t2.isAfter(t1) && (sr.getBcType().equals("normal")||sr.getBcType().equals("region"))){ | |
| 123 | 123 | sjtext = sr.getFcsj(); |
| 124 | + break; | |
| 124 | 125 | } |
| 125 | 126 | } |
| 126 | - rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待"); | |
| 127 | + if(sjtext!=null){ | |
| 128 | + rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待"); | |
| 129 | + }else { | |
| 130 | + rtn.put("message","当日运营已结束"); | |
| 131 | + } | |
| 127 | 132 | }else { |
| 128 | 133 | rtn.put("message","当日运营已结束"); |
| 129 | 134 | } | ... | ... |