Commit a6e109d4e6d93f660fc0a2ad89af499fbb58fb02
1 parent
52f30026
update...
Showing
4 changed files
with
12 additions
and
17 deletions
src/main/java/com/bsth/data/forecast/ArrivalDataLoader.java
| ... | ... | @@ -3,7 +3,6 @@ package com.bsth.data.forecast; |
| 3 | 3 | import com.bsth.data.BasicData; |
| 4 | 4 | import com.bsth.data.LineConfigData; |
| 5 | 5 | import com.bsth.data.forecast.entity.ArrivalEntity; |
| 6 | -import com.bsth.entity.realcontrol.LineConfig; | |
| 7 | 6 | import com.bsth.util.db.DBUtils_MS; |
| 8 | 7 | import org.slf4j.Logger; |
| 9 | 8 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -16,7 +15,6 @@ import java.sql.ResultSet; |
| 16 | 15 | import java.sql.SQLException; |
| 17 | 16 | import java.util.ArrayList; |
| 18 | 17 | import java.util.Calendar; |
| 19 | -import java.util.Collection; | |
| 20 | 18 | import java.util.List; |
| 21 | 19 | |
| 22 | 20 | /** |
| ... | ... | @@ -43,7 +41,7 @@ public class ArrivalDataLoader { |
| 43 | 41 | * |
| 44 | 42 | * @Title: load |
| 45 | 43 | * @Description: TODO(根据上次加载时间,查询之后的增量数据) |
| 46 | - */ | |
| 44 | + | |
| 47 | 45 | public List<ArrivalEntity> load(){ |
| 48 | 46 | List<ArrivalEntity> list = null; |
| 49 | 47 | |
| ... | ... | @@ -79,13 +77,13 @@ public class ArrivalDataLoader { |
| 79 | 77 | } |
| 80 | 78 | } |
| 81 | 79 | return list; |
| 82 | - } | |
| 80 | + }*/ | |
| 83 | 81 | |
| 84 | 82 | /** |
| 85 | 83 | * |
| 86 | 84 | * @Title: recovery |
| 87 | 85 | * @Description: TODO(从数据库恢复数据,按照线路的开始运营时间恢复) |
| 88 | - */ | |
| 86 | + | |
| 89 | 87 | public List<ArrivalEntity> recovery(){ |
| 90 | 88 | Collection<LineConfig> confs = lineConfigData.getAll(); |
| 91 | 89 | long t = System.currentTimeMillis() |
| ... | ... | @@ -105,7 +103,7 @@ public class ArrivalDataLoader { |
| 105 | 103 | |
| 106 | 104 | prveLoadTime = t; |
| 107 | 105 | return all; |
| 108 | - } | |
| 106 | + }*/ | |
| 109 | 107 | |
| 110 | 108 | /** |
| 111 | 109 | * | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -14,7 +14,6 @@ import com.bsth.entity.schedule.SchedulePlanInfo; |
| 14 | 14 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 15 | 15 | import com.bsth.service.schedule.SchedulePlanInfoService; |
| 16 | 16 | import com.bsth.util.BatchSaveUtils; |
| 17 | -import com.bsth.util.DateUtils; | |
| 18 | 17 | import com.bsth.websocket.handler.SendUtils; |
| 19 | 18 | import com.google.common.base.Predicate; |
| 20 | 19 | import com.google.common.collect.ArrayListMultimap; |
| ... | ... | @@ -136,14 +135,15 @@ public class DayOfSchedule { |
| 136 | 135 | * @Description: TODO(计算线路当前应该使用的排班日期) |
| 137 | 136 | */ |
| 138 | 137 | public String calcSchDate(String lineCode) { |
| 138 | + Long t = System.currentTimeMillis(); | |
| 139 | 139 | LineConfig conf = lineConfigData.get(lineCode); |
| 140 | - long ct = System.currentTimeMillis(); | |
| 141 | 140 | |
| 142 | - String schDate = fmtyyyyMMdd.print(ct); | |
| 143 | 141 | // 小于当天起始运营时间,则取前一天的排班 |
| 144 | - if (ct < conf.getCurrStartTime()) | |
| 145 | - schDate = DateUtils.subtractDay(schDate, 1); | |
| 142 | + String ct = fmtHHmm.print(t); | |
| 143 | + if(ct.compareTo(conf.getStartOpt()) < 0) | |
| 144 | + t -= 1000 * 60 * 60 * 24; | |
| 146 | 145 | |
| 146 | + String schDate = fmtyyyyMMdd.print(t); | |
| 147 | 147 | return schDate; |
| 148 | 148 | } |
| 149 | 149 | ... | ... |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| ... | ... | @@ -50,7 +50,7 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 50 | 50 | public static void putLate(ScheduleRealInfo sch){ |
| 51 | 51 | try { |
| 52 | 52 | //出场班次不需要 |
| 53 | - if(/*sch.getBcType().equals("in") || */sch.getBcType().equals("out")) | |
| 53 | + if(sch.getBcType().equals("out")) | |
| 54 | 54 | return; |
| 55 | 55 | //线路配置 |
| 56 | 56 | LineConfig config = lineConfigData.get(sch.getXlBm()); | ... | ... |
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
| ... | ... | @@ -3,9 +3,6 @@ package com.bsth.entity.realcontrol; |
| 3 | 3 | import com.bsth.entity.Line; |
| 4 | 4 | |
| 5 | 5 | import javax.persistence.*; |
| 6 | -import java.text.ParseException; | |
| 7 | -import java.text.SimpleDateFormat; | |
| 8 | -import java.util.Date; | |
| 9 | 6 | import java.util.HashSet; |
| 10 | 7 | import java.util.Set; |
| 11 | 8 | |
| ... | ... | @@ -156,7 +153,7 @@ public class LineConfig { |
| 156 | 153 | this.schDirectiveTemp = schDirectiveTemp; |
| 157 | 154 | } |
| 158 | 155 | |
| 159 | - public long getCurrStartTime() { | |
| 156 | +/* public long getCurrStartTime() { | |
| 160 | 157 | Date d = null; |
| 161 | 158 | try { |
| 162 | 159 | SimpleDateFormat sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm") |
| ... | ... | @@ -166,7 +163,7 @@ public class LineConfig { |
| 166 | 163 | e.printStackTrace(); |
| 167 | 164 | } |
| 168 | 165 | return d.getTime(); |
| 169 | - } | |
| 166 | + }*/ | |
| 170 | 167 | |
| 171 | 168 | public D80ReplyTemp findByCode(short code){ |
| 172 | 169 | for(D80ReplyTemp temp : d80Temps){ | ... | ... |