Commit 5e7056814d173a1c7c2344f108c5d34a639f92fb
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control
into pudong
Showing
11 changed files
with
26 additions
and
27 deletions
src/main/java/com/bsth/XDApplication.java
| ... | ... | @@ -131,14 +131,14 @@ public class XDApplication implements CommandLineRunner { |
| 131 | 131 | ScheduledExecutorService sexec = Application.mainServices; |
| 132 | 132 | |
| 133 | 133 | /** 线调业务 */ |
| 134 | - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);//班次更新线程 | |
| 134 | + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 | |
| 135 | 135 | sexec.scheduleWithFixedDelay(scheduleLateThread, 70, 30, TimeUnit.SECONDS);//检查班次误点 |
| 136 | 136 | sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 |
| 137 | 137 | |
| 138 | 138 | sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 |
| 139 | 139 | sexec.scheduleWithFixedDelay(schedulePstThread, 120, 10, TimeUnit.SECONDS);//班次延迟入库线程 |
| 140 | 140 | sexec.scheduleWithFixedDelay(seiPstThread, 160, 60, TimeUnit.SECONDS);//班次修正日志入库 |
| 141 | - sexec.scheduleWithFixedDelay(directivesPstThread, 180, 100, TimeUnit.SECONDS);//调度指令延迟入库 | |
| 141 | + sexec.scheduleWithFixedDelay(directivesPstThread, 180, 120, TimeUnit.SECONDS);//调度指令延迟入库 | |
| 142 | 142 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 143 | 143 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 144 | 144 | sexec.scheduleWithFixedDelay(basicDataLoader, 2, 2, TimeUnit.HOURS);//基础数据更新 | ... | ... |
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/gpsdata/arrival/GpsRealAnalyse.java
| ... | ... | @@ -41,7 +41,7 @@ public class GpsRealAnalyse { |
| 41 | 41 | @Autowired |
| 42 | 42 | GpsRealData gpsRealData; |
| 43 | 43 | |
| 44 | - final static int POOL_SIZE = 30; | |
| 44 | + final static int POOL_SIZE = 25; | |
| 45 | 45 | static ExecutorService threadPool = Executors.newFixedThreadPool(POOL_SIZE + 1); |
| 46 | 46 | |
| 47 | 47 | public static long st; | ... | ... |
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/auto_exec/RealScheduleAutoExecHandler.java
| ... | ... | @@ -4,6 +4,7 @@ import com.bsth.data.gpsdata.status_manager.GpsStatusManager; |
| 4 | 4 | import com.bsth.data.schedule.DayOfSchedule; |
| 5 | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 6 | 6 | import com.bsth.websocket.handler.SendUtils; |
| 7 | +import org.apache.commons.lang3.StringUtils; | |
| 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 9 | import org.springframework.stereotype.Component; |
| 9 | 10 | |
| ... | ... | @@ -29,20 +30,21 @@ public class RealScheduleAutoExecHandler { |
| 29 | 30 | boolean flag = false; |
| 30 | 31 | long t = System.currentTimeMillis(); |
| 31 | 32 | |
| 32 | - if (sch.getDfsjT() < t) { | |
| 33 | + if (StringUtils.isEmpty(sch.getFcsjActual()) && sch.getDfsjT() < t) { | |
| 33 | 34 | sch.setFcsjActualAll(sch.getDfsjT()); |
| 34 | 35 | flag = true; |
| 35 | 36 | } |
| 36 | 37 | |
| 37 | - if (sch.getZdsjT() < t) { | |
| 38 | + if (StringUtils.isEmpty(sch.getZdsjActual()) && sch.getZdsjT() < t) { | |
| 38 | 39 | sch.setZdsjActualAll(sch.getZdsjT()); |
| 39 | 40 | |
| 40 | 41 | //准备执行下一个班次 |
| 41 | 42 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 42 | 43 | if (next != null) { |
| 44 | + dayOfSchedule.addExecPlan(next); | |
| 43 | 45 | //套跑 -下发线路切换指令 |
| 44 | 46 | if(!next.getXlBm().equals(sch.getXlBm())){ |
| 45 | - gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); | |
| 47 | + gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "auto@系统"); | |
| 46 | 48 | } |
| 47 | 49 | } |
| 48 | 50 | |
| ... | ... | @@ -60,6 +62,7 @@ public class RealScheduleAutoExecHandler { |
| 60 | 62 | } |
| 61 | 63 | |
| 62 | 64 | if (flag) { |
| 65 | + dayOfSchedule.save(sch); | |
| 63 | 66 | sendUtils.refreshSch(sch); |
| 64 | 67 | } |
| 65 | 68 | } | ... | ... |
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){ | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -285,7 +285,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 285 | 285 | //取消应发未到标记,不再自动调整待发 |
| 286 | 286 | //if(schedule.isLate2()){ |
| 287 | 287 | // schedule.setLate2(false); |
| 288 | - LateAdjustHandle.remove(schedule); | |
| 288 | + //LateAdjustHandle.remove(schedule); | |
| 289 | 289 | //} |
| 290 | 290 | |
| 291 | 291 | try { | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | var data = form.serializeJSON(); |
| 113 | 113 | data.page = page; |
| 114 | 114 | data.size = pageSize; |
| 115 | - if(data.lineCode){ | |
| 115 | + if(data.lineCode && !data.nbbms){ | |
| 116 | 116 | //有选择线路,重新设置车辆字符串 |
| 117 | 117 | var nbbmArray=data.nbbms=gb_schedule_table.findNbbmByLineCode(data.lineCode); |
| 118 | 118 | if(nbbmArray.length>0){ | ... | ... |
src/main/resources/static/real_control_v2/js/forms/form_embed.js
| ... | ... | @@ -44,7 +44,7 @@ var gb_embed_form_hanlde = (function () { |
| 44 | 44 | //包裹页面 |
| 45 | 45 | var wrapUrl = '/real_control_v2/js/forms/wrap.html?origin=real_control_iframe'; |
| 46 | 46 | |
| 47 | - layer.open({ | |
| 47 | + var index = layer.open({ | |
| 48 | 48 | type: 2, |
| 49 | 49 | title: title, |
| 50 | 50 | shadeClose: true, |
| ... | ... | @@ -61,6 +61,7 @@ var gb_embed_form_hanlde = (function () { |
| 61 | 61 | |
| 62 | 62 | } |
| 63 | 63 | }); |
| 64 | + layer.full(index); | |
| 64 | 65 | }; |
| 65 | 66 | |
| 66 | 67 | ... | ... |
src/main/resources/static/real_control_v2/js/main.js