Commit 8da869d58283ddfe04f744e39426cf5e684f4e9c
1 parent
ed74b389
智能调度优化,指令下发,登录跳转,gps线路=0
Showing
12 changed files
with
190 additions
and
62 deletions
src/main/java/com/bsth/XDApplication.java
| @@ -145,7 +145,7 @@ public class XDApplication implements CommandLineRunner { | @@ -145,7 +145,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 145 | //dayOfSchedule.dataRecovery(); | 145 | //dayOfSchedule.dataRecovery(); |
| 146 | 146 | ||
| 147 | //智能调度 | 147 | //智能调度 |
| 148 | - sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS); | 148 | + sexec.scheduleWithFixedDelay(znddThread, 15, 30, TimeUnit.SECONDS); |
| 149 | 149 | ||
| 150 | //安全驾驶 | 150 | //安全驾驶 |
| 151 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); | 151 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); |
| @@ -193,7 +193,7 @@ public class XDApplication implements CommandLineRunner { | @@ -193,7 +193,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 193 | //安全驾驶 | 193 | //安全驾驶 |
| 194 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); | 194 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); |
| 195 | //智能调度 | 195 | //智能调度 |
| 196 | - sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS); | 196 | + sexec.scheduleWithFixedDelay(znddThread, 15, 30, TimeUnit.SECONDS); |
| 197 | GpsDataLoaderThread.setFlag(-1); | 197 | GpsDataLoaderThread.setFlag(-1); |
| 198 | /** 线调业务 */ | 198 | /** 线调业务 */ |
| 199 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 | 199 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 |
| @@ -238,7 +238,7 @@ public class XDApplication implements CommandLineRunner { | @@ -238,7 +238,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 238 | //安全驾驶 | 238 | //安全驾驶 |
| 239 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); | 239 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); |
| 240 | //智能调度 | 240 | //智能调度 |
| 241 | - sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS); | 241 | + sexec.scheduleWithFixedDelay(znddThread, 15, 30, TimeUnit.SECONDS); |
| 242 | GpsDataLoaderThread.setFlag(-1); | 242 | GpsDataLoaderThread.setFlag(-1); |
| 243 | //dayOfSchedule.dataRecovery(); | 243 | //dayOfSchedule.dataRecovery(); |
| 244 | /** 线调业务 */ | 244 | /** 线调业务 */ |
| @@ -284,7 +284,7 @@ public class XDApplication implements CommandLineRunner { | @@ -284,7 +284,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 284 | //安全驾驶 | 284 | //安全驾驶 |
| 285 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); | 285 | sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS); |
| 286 | //智能调度 | 286 | //智能调度 |
| 287 | - sexec.scheduleWithFixedDelay(znddThread, 15, 60, TimeUnit.SECONDS); | 287 | + sexec.scheduleWithFixedDelay(znddThread, 15, 30, TimeUnit.SECONDS); |
| 288 | 288 | ||
| 289 | GpsDataLoaderThread.setFlag(-1); | 289 | GpsDataLoaderThread.setFlag(-1); |
| 290 | /** 线调业务 */ | 290 | /** 线调业务 */ |
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
| @@ -54,6 +54,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -54,6 +54,23 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 54 | linkedList.add(qd6002); | 54 | linkedList.add(qd6002); |
| 55 | lastSend60TimeMap.put(sch.getClZbh(), System.currentTimeMillis()); | 55 | lastSend60TimeMap.put(sch.getClZbh(), System.currentTimeMillis()); |
| 56 | } | 56 | } |
| 57 | + //单独出厂请求设计 | ||
| 58 | + public static void put60_002(ScheduleRealInfo sch, int finish, String sender, String txtPrefix){ | ||
| 59 | + if(null == sch) | ||
| 60 | + return; | ||
| 61 | + QueueData_Directive qd6002 = new QueueData_Directive(); | ||
| 62 | + qd6002.setSch(sch); | ||
| 63 | + qd6002.setFinish(finish); | ||
| 64 | + qd6002.setSender(sender); | ||
| 65 | + qd6002.setCode("60_002"); | ||
| 66 | + qd6002.setTxtPrefix(txtPrefix); | ||
| 67 | + | ||
| 68 | + linkedList.add(qd6002); | ||
| 69 | + lastSend60TimeMap.put(sch.getClZbh(), System.currentTimeMillis()); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + | ||
| 73 | + | ||
| 57 | 74 | ||
| 58 | public static void put6003(String nbbm, int state, int upDown, String sender){ | 75 | public static void put6003(String nbbm, int state, int upDown, String sender){ |
| 59 | long t = System.currentTimeMillis(); | 76 | long t = System.currentTimeMillis(); |
| @@ -131,6 +148,10 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -131,6 +148,10 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 131 | directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix()); | 148 | directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix()); |
| 132 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); | 149 | log.info("directive 60_02 sch id: " + qd.getSch().getId()); |
| 133 | } | 150 | } |
| 151 | + else if(code.equals("60_002")){ //出场请求只写出场 | ||
| 152 | + directiveService.send60Dispatchcc(qd.getSch(), qd.getFinish(), qd.getSender(), qd.getTxtPrefix()); | ||
| 153 | + log.info("directive出场 60_002 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode()); | ||
| 154 | + } | ||
| 134 | else if(code.equals("60_03")){ | 155 | else if(code.equals("60_03")){ |
| 135 | directiveService.send60Operation(qd.getNbbm(), qd.getState(), qd.getUpDown(), qd.getSender()); | 156 | directiveService.send60Operation(qd.getNbbm(), qd.getState(), qd.getUpDown(), qd.getSender()); |
| 136 | log.info("directive 60_03 nbbm: " + qd.getNbbm()); | 157 | log.info("directive 60_03 nbbm: " + qd.getNbbm()); |
| @@ -138,7 +159,8 @@ public class DirectivePushQueue implements ApplicationContextAware { | @@ -138,7 +159,8 @@ public class DirectivePushQueue implements ApplicationContextAware { | ||
| 138 | else if(code.equals("64")){ | 159 | else if(code.equals("64")){ |
| 139 | directiveService.lineChange(qd.getNbbm(), qd.getLineCode(), qd.getSender()); | 160 | directiveService.lineChange(qd.getNbbm(), qd.getLineCode(), qd.getSender()); |
| 140 | log.info("directive 64 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode()); | 161 | log.info("directive 64 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode()); |
| 141 | - } | 162 | + } |
| 163 | + | ||
| 142 | 164 | ||
| 143 | } else{ | 165 | } else{ |
| 144 | Thread.sleep(500); | 166 | Thread.sleep(500); |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -93,7 +93,7 @@ public class PilotReport { | @@ -93,7 +93,7 @@ public class PilotReport { | ||
| 93 | if (outSch.getJhlc() == null) | 93 | if (outSch.getJhlc() == null) |
| 94 | outSch = dayOfSchedule.next(outSch); | 94 | outSch = dayOfSchedule.next(outSch); |
| 95 | //下发调度指令 | 95 | //下发调度指令 |
| 96 | - //DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;"); | 96 | + DirectivePushQueue.put60_002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;"); |
| 97 | } | 97 | } |
| 98 | break; | 98 | break; |
| 99 | } | 99 | } |
src/main/java/com/bsth/data/zndd/AutomaticSch.java
| @@ -10,12 +10,14 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; | @@ -10,12 +10,14 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity; | ||
| 10 | import com.bsth.data.schedule.DayOfSchedule; | 10 | import com.bsth.data.schedule.DayOfSchedule; |
| 11 | import com.bsth.data.schedule.ScheduleComparator; | 11 | import com.bsth.data.schedule.ScheduleComparator; |
| 12 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | 12 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; |
| 13 | +import com.bsth.entity.StationRoute; | ||
| 13 | import com.bsth.entity.directive.D60; | 14 | import com.bsth.entity.directive.D60; |
| 14 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 15 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | import com.bsth.repository.StationRouteRepository; | 16 | import com.bsth.repository.StationRouteRepository; |
| 16 | import com.bsth.service.directive.DirectiveService; | 17 | import com.bsth.service.directive.DirectiveService; |
| 17 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 18 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 18 | import com.bsth.util.HttpClientUtils; | 19 | import com.bsth.util.HttpClientUtils; |
| 20 | +import com.google.gson.Gson; | ||
| 19 | import org.apache.commons.lang3.StringUtils; | 21 | import org.apache.commons.lang3.StringUtils; |
| 20 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| 21 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
| @@ -130,31 +132,33 @@ public class AutomaticSch { | @@ -130,31 +132,33 @@ public class AutomaticSch { | ||
| 130 | //1.离线 2.实发时间为空 3.已过待发时间还没发车的 | 132 | //1.离线 2.实发时间为空 3.已过待发时间还没发车的 |
| 131 | long time = System.currentTimeMillis();//实际时间+2分钟 | 133 | long time = System.currentTimeMillis();//实际时间+2分钟 |
| 132 | //超过待发时间 实发时间还是null的 | 134 | //超过待发时间 实发时间还是null的 |
| 133 | - if (sr.getFcsjT() + (1000*3) > time) { | 135 | + if (sr.getFcsjT()+ (1000 * 60 * 3) < time && sr.getFcsjT()+ (1000 * 60 * 7) > time) { |
| 134 | 136 | ||
| 135 | //起点站实际到达时间为null的情况下 | 137 | //起点站实际到达时间为null的情况下 |
| 136 | - if (StringUtils.isEmpty(sr.getQdzArrDatesj())) { | 138 | + /* if (StringUtils.isEmpty(sr.getQdzArrDatesj())) { |
| 137 | ScheduleRealInfo prev = dayOfSchedule.prev(sr); | 139 | ScheduleRealInfo prev = dayOfSchedule.prev(sr); |
| 138 | //上一个班次没有实际终点到达时间 | 140 | //上一个班次没有实际终点到达时间 |
| 139 | if (prev != null && StringUtils.isEmpty(prev.getZdsjActual())) { | 141 | if (prev != null && StringUtils.isEmpty(prev.getZdsjActual())) { |
| 140 | continue; | 142 | continue; |
| 141 | } | 143 | } |
| 142 | - } | 144 | + }*/ |
| 143 | //第一种 设备离线的情况下改出站 | 145 | //第一种 设备离线的情况下改出站 |
| 144 | Integer staus = 0; //状态 | 146 | Integer staus = 0; //状态 |
| 145 | - if (StringUtils.isEmpty(sr.getFcsjActual()) && sr.getBcType().equals("normal") && StringUtils.isEmpty(sr.getRemarks())) { | 147 | + if (StringUtils.isEmpty(sr.getFcsjActual()) |
| 148 | + && (sr.getBcType().equals("normal") || sr.getBcType().equals("region")) | ||
| 149 | + && (StringUtils.isEmpty(sr.getRemarks()) || sr.getRemarks().equals("_智能调度-异常实发"))) { | ||
| 146 | 150 | ||
| 147 | GpsEntity gps = gpsRealData.getByNbbm(sr.getClZbh()); | 151 | GpsEntity gps = gpsRealData.getByNbbm(sr.getClZbh()); |
| 148 | //当前设备离线的情况 | 152 | //当前设备离线的情况 |
| 149 | //1。一直没收到gps | 153 | //1。一直没收到gps |
| 150 | //2.gps长时间离线的情况下 | 154 | //2.gps长时间离线的情况下 |
| 151 | //3.人为调整过的都跳过 | 155 | //3.人为调整过的都跳过 |
| 152 | - if (gps == null || (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))){ | 156 | + if (gps == null || gps.getTimestamp() + (1000 * 60 * 3) < time || (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))){ |
| 153 | ts(addStationPeople(sr, "SFTZ_1", 0L)); | 157 | ts(addStationPeople(sr, "SFTZ_1", 0L)); |
| 154 | - break; | 158 | + Gson gson = new Gson(); |
| 159 | + String chartStr = gson.toJsonTree(sr).toString(); | ||
| 160 | + logger.info("实发调整--"+chartStr); | ||
| 155 | } | 161 | } |
| 156 | - /* if (staus == 0) | ||
| 157 | - ts(addStationPeople(sr, "SFTZ_2", 0L));//第二种 设备未离线 出站时间内未出站 */ | ||
| 158 | } | 162 | } |
| 159 | } | 163 | } |
| 160 | } | 164 | } |
| @@ -171,54 +175,67 @@ public class AutomaticSch { | @@ -171,54 +175,67 @@ public class AutomaticSch { | ||
| 171 | //查询所有班次 | 175 | //查询所有班次 |
| 172 | //remark 人工干预过的的不检测 | 176 | //remark 人工干预过的的不检测 |
| 173 | try { | 177 | try { |
| 178 | + | ||
| 179 | + stationRouteRepository.findAll(); | ||
| 180 | + | ||
| 181 | + Iterator<StationRoute> iterator = stationRouteRepository.findAll().iterator(); | ||
| 182 | +// Map<String, String> stationCode2Name = new HashMap<>(); | ||
| 183 | +// StationRoute sroute; | ||
| 184 | +// while (iterator.hasNext()) { | ||
| 185 | +// sroute = iterator.next(); | ||
| 186 | +// stationCode2Name.put(sroute.getLineCode() + "_" + sroute.getDirections() + "_" + sroute.getStationCode(), sroute.getStationMark()); | ||
| 187 | +// } | ||
| 188 | +// | ||
| 174 | Map<String, String> lineMap = BasicData.lineCode2NameMap; | 189 | Map<String, String> lineMap = BasicData.lineCode2NameMap; |
| 175 | List<ScheduleRealInfo> oldSchDateList; | 190 | List<ScheduleRealInfo> oldSchDateList; |
| 176 | String lineCode; | 191 | String lineCode; |
| 177 | for (Map.Entry<String, String> ts : lineMap.entrySet()){ | 192 | for (Map.Entry<String, String> ts : lineMap.entrySet()){ |
| 178 | lineCode =ts.getKey(); | 193 | lineCode =ts.getKey(); |
| 179 | oldSchDateList = dayOfSchedule.findByLineCode(lineCode); | 194 | oldSchDateList = dayOfSchedule.findByLineCode(lineCode); |
| 195 | + | ||
| 196 | + Map m = new HashMap(); | ||
| 180 | //排序 | 197 | //排序 |
| 181 | Collections.sort(oldSchDateList, new ScheduleComparator.FCSJ()); | 198 | Collections.sort(oldSchDateList, new ScheduleComparator.FCSJ()); |
| 182 | for (ScheduleRealInfo t : oldSchDateList){ | 199 | for (ScheduleRealInfo t : oldSchDateList){ |
| 183 | // 发车误点 | 200 | // 发车误点 |
| 184 | - if (t.getFcsj() != null && t.getFcsjActual() != null && t.getBcType().equals("normal") && StringUtils.isEmpty(t.getRemarks())){ | ||
| 185 | - Long sst = ((t.getFcsjActualTime() - t.getFcsjT()) / 1000 / 60); | ||
| 186 | - Long fcsj = t.getFcsjT() / 1000 ; | ||
| 187 | - Long sfsj = t.getFcsjActualTime() / 1000; | ||
| 188 | - //获取车辆状态 gps没有的情况下,或者车辆状态异常的情况 | ||
| 189 | - //判定gps发送时间和现在时间作对比 | ||
| 190 | - GpsEntity gps = gpsRealData.getByNbbm(t.getClZbh()); | ||
| 191 | - /* if (gps)*/ | ||
| 192 | - //1.gps一直掉后一直没上线 | ||
| 193 | - //2.车辆gps判断还在场站内 | ||
| 194 | - //3.车辆信号离线的 | ||
| 195 | - if (gps == null || gps.getInstation() == 2 || | ||
| 196 | - (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))){ | ||
| 197 | - //实发快一慢三 | ||
| 198 | - /* if (sst <= 3 && sst >= -1){*/ | ||
| 199 | - if(fcsj.equals(sfsj)) | ||
| 200 | - continue; | ||
| 201 | - //快1 | ||
| 202 | - if(sfsj < fcsj && fcsj - sfsj <= 60 * 1) | ||
| 203 | - continue; | ||
| 204 | - //慢3 | ||
| 205 | - if(fcsj < sfsj && sfsj - fcsj <= 60 *3) | ||
| 206 | - continue; | ||
| 207 | - | ||
| 208 | - | 201 | + if (t.getDfsj() != null && t.getFcsjActual() != null |
| 202 | + && (t.getBcType().equals("normal") || t.getBcType().equals("region")) | ||
| 203 | + && (StringUtils.isEmpty(t.getRemarks()) || t.getRemarks().equals("_智能调度-异常实发"))) { | ||
| 204 | + | ||
| 205 | + long sjc = t.getFcsjActualTime() - t.getDfsjT(); | ||
| 206 | + long time = System.currentTimeMillis();//当前时间 | ||
| 207 | + | ||
| 208 | + if (t.getDfsjT() > time) { | ||
| 209 | + //快1慢3 | ||
| 210 | + if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) { | ||
| 211 | + continue; | ||
| 212 | + } else { | ||
| 209 | //异常实发 | 213 | //异常实发 |
| 210 | - ts(addStationPeople(t,"YCSF",sst)); | 214 | + ts(addStationPeople(t, "YCSF", 0l)); |
| 215 | + Gson gson = new Gson(); | ||
| 216 | + String chartStr = gson.toJsonTree(t).toString(); | ||
| 217 | + logger.info("实发撤销--" + chartStr); | ||
| 211 | } | 218 | } |
| 212 | - /*}*/ | ||
| 213 | - | 219 | + } |
| 220 | + | ||
| 221 | + /* //待发时间要大于当前时间 | ||
| 222 | + //车辆还在站内 | ||
| 223 | + String mark = null; | ||
| 224 | + if (gps != null){ | ||
| 225 | + mark = stationCode2Name.get(gps.getLineId()+"_"+gps.getUpDown()+"_"+gps.getStopNo()); | ||
| 226 | + } | ||
| 227 | + if (t.getFcsjT() > time && ((gps!= null && gps.getInstation() == 2) | ||
| 228 | + || gps == null || | ||
| 229 | + (gps!= null && mark!=null && mark.equals("B") && gps.getInstation() == 1) || | ||
| 230 | + (gps!= null && mark!=null && mark.equals("E") && gps.getInstation() == 1))) { | ||
| 231 | + | ||
| 232 | + }*/ | ||
| 214 | } | 233 | } |
| 215 | } | 234 | } |
| 216 | } | 235 | } |
| 217 | }catch (Exception e){ | 236 | }catch (Exception e){ |
| 218 | logger.error("实发撤销推送接口出错-----------",e); | 237 | logger.error("实发撤销推送接口出错-----------",e); |
| 219 | } | 238 | } |
| 220 | - | ||
| 221 | - | ||
| 222 | } | 239 | } |
| 223 | 240 | ||
| 224 | //发车信息微调检测 -- 车辆掉线后实发检测,重新计算时间发车时间 | 241 | //发车信息微调检测 -- 车辆掉线后实发检测,重新计算时间发车时间 |
| @@ -248,8 +265,8 @@ public class AutomaticSch { | @@ -248,8 +265,8 @@ public class AutomaticSch { | ||
| 248 | String lineCode; | 265 | String lineCode; |
| 249 | for (Map.Entry<String, String> ts : lineMap.entrySet()) { | 266 | for (Map.Entry<String, String> ts : lineMap.entrySet()) { |
| 250 | lineCode = ts.getKey(); | 267 | lineCode = ts.getKey(); |
| 251 | - if (!lineCode.equals("12101")) | ||
| 252 | - return; | 268 | + /* if (!lineCode.equals("12101")) |
| 269 | + return;*/ | ||
| 253 | 270 | ||
| 254 | oldSchDateList = dayOfSchedule.findByLineCode(lineCode); | 271 | oldSchDateList = dayOfSchedule.findByLineCode(lineCode); |
| 255 | for (ScheduleRealInfo t : oldSchDateList){ | 272 | for (ScheduleRealInfo t : oldSchDateList){ |
| @@ -310,8 +327,12 @@ public class AutomaticSch { | @@ -310,8 +327,12 @@ public class AutomaticSch { | ||
| 310 | LateAdjustHandle.putLate(sch); | 327 | LateAdjustHandle.putLate(sch); |
| 311 | List<Map> dzList = carMonitor.carMonitor(prev.getXlBm(), prev.getXlDir(), prev.getZdzCode()); //信息发布接口 | 328 | List<Map> dzList = carMonitor.carMonitor(prev.getXlBm(), prev.getXlDir(), prev.getZdzCode()); //信息发布接口 |
| 312 | for (Map m : dzList){ | 329 | for (Map m : dzList){ |
| 313 | - if (m.get("terminal").equals(basicData.nbbmCompanyPlateMap.get(prev.getClZbh()).replaceAll("-",""))){ | ||
| 314 | - return addStationPeople(sch, "WD", 0L); | 330 | + if (basicData.nbbmCompanyPlateMap.get(prev.getClZbh()) != null && m.get("terminal").equals(basicData.nbbmCompanyPlateMap.get(prev.getClZbh()).replaceAll("-",""))){ |
| 331 | + sch.setRemark(m.get("sj").toString()); | ||
| 332 | + Gson gson = new Gson(); | ||
| 333 | + String chartStr = gson.toJsonTree(sch).toString(); | ||
| 334 | + logger.info("误点--"+chartStr); | ||
| 335 | + ts(addStationPeople(sch, "WD", 0L)); | ||
| 315 | } | 336 | } |
| 316 | } | 337 | } |
| 317 | } | 338 | } |
src/main/java/com/bsth/service/directive/DirectiveService.java
| @@ -33,7 +33,10 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | @@ -33,7 +33,10 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | ||
| 33 | * @throws | 33 | * @throws |
| 34 | */ | 34 | */ |
| 35 | int send60Dispatch(ScheduleRealInfo sch, int finish, String sender,String txtPrefix); | 35 | int send60Dispatch(ScheduleRealInfo sch, int finish, String sender,String txtPrefix); |
| 36 | - | 36 | + |
| 37 | + | ||
| 38 | + int send60Dispatchcc(ScheduleRealInfo sch, int finish, String sender,String txtPrefix); | ||
| 39 | + | ||
| 37 | /** | 40 | /** |
| 38 | * | 41 | * |
| 39 | * @Title: send60Dispatch | 42 | * @Title: send60Dispatch |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -179,6 +179,72 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -179,6 +179,72 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 179 | return code; | 179 | return code; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | + //出场请求 | ||
| 183 | + @Override | ||
| 184 | + public int send60Dispatchcc(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) { | ||
| 185 | + D60 d60 = null; | ||
| 186 | + try { | ||
| 187 | + if (sch.isDestroy()) { | ||
| 188 | + logger.warn("烂班不允许发送调度指令...."); | ||
| 189 | + return -1; | ||
| 190 | + } | ||
| 191 | + //待发应到时间 | ||
| 192 | + String dfsj = fmtHHmm.print(sch.getDfsjT() + (sch.getBcsj() * 60 * 1000)); | ||
| 193 | + String text = "出场请求,由" + sch.getQdzName() + "发往" + sch.getZdzName() + ";请出场"; | ||
| 194 | + | ||
| 195 | + //下发0x02指令 调度指令(闹钟有效) | ||
| 196 | + long t = System.currentTimeMillis() + 1000 * 30, | ||
| 197 | + alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT(); | ||
| 198 | + | ||
| 199 | + if(StringUtils.isNotEmpty(txtPrefix)){ | ||
| 200 | + text = txtPrefix + text; | ||
| 201 | + } | ||
| 202 | + text = StringEscapeUtils.unescapeHtml4(text); | ||
| 203 | + int state = 0;//营运状态 | ||
| 204 | + if(dayOfSchedule.emptyService(sch)) | ||
| 205 | + state = 1; | ||
| 206 | + d60 = new DirectiveCreator().createD60_02(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) | ||
| 207 | + , state, new Date(alarmTime)); | ||
| 208 | + | ||
| 209 | + d60.setLineCode(sch.getXlBm()); | ||
| 210 | + } catch (Exception e) { | ||
| 211 | + logger.error("生成调度指令时出现异常", e); | ||
| 212 | + return -1; | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + if (null == d60) | ||
| 216 | + return -1; | ||
| 217 | + | ||
| 218 | + d60.setSender(sender); | ||
| 219 | + | ||
| 220 | + JSONObject jObj = JSON.parseObject(JSON.toJSONString(d60)); | ||
| 221 | + | ||
| 222 | + //进场或者出场班次时,附加lock 标识 | ||
| 223 | + if (null != sch.getBcType() | ||
| 224 | + && (sch.getBcType().equals("out") || sch.getBcType().equals("in"))) { | ||
| 225 | + | ||
| 226 | + jObj.put("lock", 1); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + // 发送指令 | ||
| 230 | + int code = GatewayHttpUtils.postJson(jObj.toJSONString()); | ||
| 231 | + | ||
| 232 | + d60.setDispatch(true); | ||
| 233 | + d60.setSch(sch); | ||
| 234 | + d60.setHttpCode(code); | ||
| 235 | + | ||
| 236 | + if (code == 0) { | ||
| 237 | + sch.setDirectiveState(60); | ||
| 238 | + // 通知页面 | ||
| 239 | + sendD60ToPage(sch); | ||
| 240 | + } else { | ||
| 241 | + d60.setErrorText("网关通讯失败, code: " + code); | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + dayOfDirectives.put60(d60); | ||
| 245 | + return code; | ||
| 246 | + } | ||
| 247 | + | ||
| 182 | 248 | ||
| 183 | public int send60DispatchZndd(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) { | 249 | public int send60DispatchZndd(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) { |
| 184 | D60 d60 = null; | 250 | D60 d60 = null; |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -296,6 +296,9 @@ public class GpsServiceImpl implements GpsService { | @@ -296,6 +296,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 296 | 296 | ||
| 297 | Map<String, Integer> lineCode2IdMap = BasicData.lineId2CodeMap.inverse(); | 297 | Map<String, Integer> lineCode2IdMap = BasicData.lineId2CodeMap.inverse(); |
| 298 | for(Map<String, Object> rs : dataList) { | 298 | for(Map<String, Object> rs : dataList) { |
| 299 | + if(rs.get("LINE_ID").toString().equals("0")) | ||
| 300 | + continue; | ||
| 301 | + | ||
| 299 | Object lineCode = rs.get("LINE_ID"); | 302 | Object lineCode = rs.get("LINE_ID"); |
| 300 | // 线路ID发生变化时补全线路切换信息 并新加入一个 | 303 | // 线路ID发生变化时补全线路切换信息 并新加入一个 |
| 301 | if (oldLineId != (Integer)lineCode) { | 304 | if (oldLineId != (Integer)lineCode) { |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1627,7 +1627,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1627,7 +1627,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1627 | rs.put("ts", ts); | 1627 | rs.put("ts", ts); |
| 1628 | 1628 | ||
| 1629 | LoggerZndd lz = new LoggerZndd(); | 1629 | LoggerZndd lz = new LoggerZndd(); |
| 1630 | - String text = sch.getFcsj()+"的班次进行了实发调整"; | 1630 | + String text = sch.getXlName()+"_"+sch.getFcsj()+"的班次进行了实发调整"; |
| 1631 | lz.setText(text); | 1631 | lz.setText(text); |
| 1632 | lz.setCreateBy(SecurityUtils.getCurrentUser().getId()); | 1632 | lz.setCreateBy(SecurityUtils.getCurrentUser().getId()); |
| 1633 | lz.setCreateDate(new Date()); | 1633 | lz.setCreateDate(new Date()); |
| @@ -1728,7 +1728,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1728,7 +1728,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1728 | dayOfSchedule.save(sch); | 1728 | dayOfSchedule.save(sch); |
| 1729 | 1729 | ||
| 1730 | LoggerZndd lz = new LoggerZndd(); | 1730 | LoggerZndd lz = new LoggerZndd(); |
| 1731 | - String text = sch.getFcsj()+"的班次进行了实发撤销调整"; | 1731 | + String text = sch.getXlName()+"_"+sch.getFcsj()+"的班次进行了实发撤销调整"; |
| 1732 | lz.setText(text); | 1732 | lz.setText(text); |
| 1733 | lz.setCreateBy(SecurityUtils.getCurrentUser().getId()); | 1733 | lz.setCreateBy(SecurityUtils.getCurrentUser().getId()); |
| 1734 | lz.setCreateDate(new Date()); | 1734 | lz.setCreateDate(new Date()); |
src/main/resources/static/login.html
| @@ -234,6 +234,9 @@ | @@ -234,6 +234,9 @@ | ||
| 234 | <script src="/login_assets/js/jquery.min.js"></script> | 234 | <script src="/login_assets/js/jquery.min.js"></script> |
| 235 | <script src="/login_assets/js/jsencrypt.min.js"></script> | 235 | <script src="/login_assets/js/jsencrypt.min.js"></script> |
| 236 | <script> | 236 | <script> |
| 237 | + if (window.location.href.indexOf('58.34.47.74') > -1) { | ||
| 238 | + window.location.href = window.location.href.replace('58.34.47.74', '10.10.150.103'); | ||
| 239 | + } | ||
| 237 | window.onload=function(){ | 240 | window.onload=function(){ |
| 238 | var body=document.getElementsByTagName("body")[0]; | 241 | var body=document.getElementsByTagName("body")[0]; |
| 239 | if(typeof body.style.WebkitAnimation=="undefined") | 242 | if(typeof body.style.WebkitAnimation=="undefined") |
src/main/resources/static/real_control_v2/css/main.css
| @@ -2185,7 +2185,6 @@ g.gps-wrap rect.twinkle[updown="1"] { | @@ -2185,7 +2185,6 @@ g.gps-wrap rect.twinkle[updown="1"] { | ||
| 2185 | cursor: pointer; | 2185 | cursor: pointer; |
| 2186 | border-radius: 5px; | 2186 | border-radius: 5px; |
| 2187 | color: white; | 2187 | color: white; |
| 2188 | - opacity: 0.9; | ||
| 2189 | padding: 10px; | 2188 | padding: 10px; |
| 2190 | box-shadow: 0 0.125rem 0.8rem rgba(0, 0, 0, 0.1) !important; | 2189 | box-shadow: 0 0.125rem 0.8rem rgba(0, 0, 0, 0.1) !important; |
| 2191 | } | 2190 | } |
| @@ -2193,7 +2192,6 @@ g.gps-wrap rect.twinkle[updown="1"] { | @@ -2193,7 +2192,6 @@ g.gps-wrap rect.twinkle[updown="1"] { | ||
| 2193 | border: 1px solid #e79a00; | 2192 | border: 1px solid #e79a00; |
| 2194 | background-color: #7ecbe4; | 2193 | background-color: #7ecbe4; |
| 2195 | font-size: 18px; | 2194 | font-size: 18px; |
| 2196 | - opacity: 0.9; | ||
| 2197 | } | 2195 | } |
| 2198 | 2196 | ||
| 2199 | .msg-times { | 2197 | .msg-times { |
| @@ -2222,10 +2220,20 @@ g.gps-wrap rect.twinkle[updown="1"] { | @@ -2222,10 +2220,20 @@ g.gps-wrap rect.twinkle[updown="1"] { | ||
| 2222 | .msg-date-info { | 2220 | .msg-date-info { |
| 2223 | padding-right: 20px; | 2221 | padding-right: 20px; |
| 2224 | } | 2222 | } |
| 2223 | +.msg-date-info { | ||
| 2224 | + padding-top: 10px; | ||
| 2225 | + padding-right: 20px; | ||
| 2226 | +} | ||
| 2225 | .colsebc{ | 2227 | .colsebc{ |
| 2226 | line-height: 20px; | 2228 | line-height: 20px; |
| 2227 | font-size: 1px; | 2229 | font-size: 1px; |
| 2228 | } | 2230 | } |
| 2231 | +.popup-msg-content{ | ||
| 2232 | + border-bottom: 1px solid black; | ||
| 2233 | + padding-bottom: 5px; | ||
| 2234 | + padding-top: 10px; | ||
| 2235 | +} | ||
| 2236 | + | ||
| 2229 | .popup-msg-contents{ | 2237 | .popup-msg-contents{ |
| 2230 | 2238 | ||
| 2231 | text-align: right ; | 2239 | text-align: right ; |
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
| @@ -16,7 +16,7 @@ var gb_dataZndd = (function (){ | @@ -16,7 +16,7 @@ var gb_dataZndd = (function (){ | ||
| 16 | 16 | ||
| 17 | var timelist = [],interval; | 17 | var timelist = [],interval; |
| 18 | var dataMap = new Map(); | 18 | var dataMap = new Map(); |
| 19 | - var leftTime = 1000 * 40;//剩余的毫秒数 | 19 | + var leftTime = 1000 * 10;//剩余的毫秒数 |
| 20 | var timeType = false | 20 | var timeType = false |
| 21 | var sop = function (data) { | 21 | var sop = function (data) { |
| 22 | /*//调度智能开关 | 22 | /*//调度智能开关 |
| @@ -120,7 +120,7 @@ var gb_dataZndd = (function (){ | @@ -120,7 +120,7 @@ var gb_dataZndd = (function (){ | ||
| 120 | gb_schedule_table.updateSchedule(rs.ts); | 120 | gb_schedule_table.updateSchedule(rs.ts); |
| 121 | notify_succ('实发未发操作成功!'); | 121 | notify_succ('实发未发操作成功!'); |
| 122 | //calc 应发未发 | 122 | //calc 应发未发 |
| 123 | - that.parent().parent().remove(); | 123 | + that.parent().parent().parent().remove(); |
| 124 | }); | 124 | }); |
| 125 | }, '确认调整实发'); | 125 | }, '确认调整实发'); |
| 126 | }); | 126 | }); |
| @@ -154,7 +154,7 @@ var gb_dataZndd = (function (){ | @@ -154,7 +154,7 @@ var gb_dataZndd = (function (){ | ||
| 154 | return 'ycsf.html'; | 154 | return 'ycsf.html'; |
| 155 | break; | 155 | break; |
| 156 | case 'WD': | 156 | case 'WD': |
| 157 | - return 'wd.html'; | 157 | + //return 'wd.html'; |
| 158 | break; | 158 | break; |
| 159 | case 'DJG': | 159 | case 'DJG': |
| 160 | return 'djg1.html'; | 160 | return 'djg1.html'; |
| @@ -295,7 +295,7 @@ var gb_dataZndd = (function (){ | @@ -295,7 +295,7 @@ var gb_dataZndd = (function (){ | ||
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | if (type == "WD"){ | 297 | if (type == "WD"){ |
| 298 | - var minute = 6; | 298 | + /* var minute = 6; |
| 299 | gb_common.$post_arr('/realSchedule/lateAdjust', {idx: sch.sch.id, minute: minute}, function (rs) { | 299 | gb_common.$post_arr('/realSchedule/lateAdjust', {idx: sch.sch.id, minute: minute}, function (rs) { |
| 300 | console.log('误点调整rs', rs); | 300 | console.log('误点调整rs', rs); |
| 301 | if(rs.ts){ | 301 | if(rs.ts){ |
| @@ -303,7 +303,7 @@ var gb_dataZndd = (function (){ | @@ -303,7 +303,7 @@ var gb_dataZndd = (function (){ | ||
| 303 | notify_succ('成功设置误点停靠时间'); | 303 | notify_succ('成功设置误点停靠时间'); |
| 304 | UIkit.modal(modal).hide(); | 304 | UIkit.modal(modal).hide(); |
| 305 | } | 305 | } |
| 306 | - }); | 306 | + });*/ |
| 307 | } | 307 | } |
| 308 | } | 308 | } |
| 309 | function checkTime(i){ //将0-9的数字前面加上0,例1变为01 | 309 | function checkTime(i){ //将0-9的数字前面加上0,例1变为01 |
src/main/resources/static/real_control_v2/main.html
| @@ -268,7 +268,7 @@ | @@ -268,7 +268,7 @@ | ||
| 268 | </script> | 268 | </script> |
| 269 | <!-- #### 智能调度 start ### --> | 269 | <!-- #### 智能调度 start ### --> |
| 270 | <script id="zndd_plat_msg_template_config" type="text/html"> | 270 | <script id="zndd_plat_msg_template_config" type="text/html"> |
| 271 | - <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}" | 271 | + <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}" |
| 272 | data-xlname="{{lineName}}" data-type="{{type}}" data-xldir="{{xlDir}}" data-rqstr="{{rqStr}}" data-types ="{{types}}" data-regionstopid="{{lg != null?lg.regionStopid:''}}" data-lgtype ="{{lg != null?lg.lGType:''}}" | 272 | data-xlname="{{lineName}}" data-type="{{type}}" data-xldir="{{xlDir}}" data-rqstr="{{rqStr}}" data-types ="{{types}}" data-regionstopid="{{lg != null?lg.regionStopid:''}}" data-lgtype ="{{lg != null?lg.lGType:''}}" |
| 273 | data-rq="{{rq}}" data-ids="{{ids}}" data-uuid="{{uuid}}"> | 273 | data-rq="{{rq}}" data-ids="{{ids}}" data-uuid="{{uuid}}"> |
| 274 | <div id ={{uuid}} class="timer"></div> | 274 | <div id ={{uuid}} class="timer"></div> |
| @@ -281,14 +281,16 @@ | @@ -281,14 +281,16 @@ | ||
| 281 | <div class="popup-msg-content"> | 281 | <div class="popup-msg-content"> |
| 282 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 282 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
| 283 | <span>{{lineName}} {{xlDir ==0 ?'上行':'下行'}} {{clzbh}} {{fcsj}} 出现 {{types}}</span> | 283 | <span>{{lineName}} {{xlDir ==0 ?'上行':'下行'}} {{clzbh}} {{fcsj}} 出现 {{types}}</span> |
| 284 | + <span style="display:{{type == 'WD'?'':'none'}}"> 。{{sch.remark}}后车辆到站 </span> | ||
| 284 | </div> | 285 | </div> |
| 286 | + <br> | ||
| 285 | <div class="popup-msg-contents" style="display:{{type == 'YCSF'?'':'none'}}"> | 287 | <div class="popup-msg-contents" style="display:{{type == 'YCSF'?'':'none'}}"> |
| 286 | - <button class="btn btn-default colsebc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">取消实发</button> | 288 | + <button class="uk-button uk-button-primary colsebc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">取消实发</button> |
| 287 | </div> | 289 | </div> |
| 288 | <div class="centerSpace msg-title"> | 290 | <div class="centerSpace msg-title"> |
| 289 | <div></div> | 291 | <div></div> |
| 290 | - <div class="msg-date-info" style="display:{{type == 'SFTZ_1'?'':'none'}}" > | ||
| 291 | - <button class="btn btn-default sfTzbc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">补入发车时间</button> | 292 | + <div class="msg-date-infos" style="display:{{type == 'SFTZ_1'?'':'none'}}" > |
| 293 | + <button class="uk-button uk-button-primary sfTzbc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">补入发车时间</button> | ||
| 292 | </div> | 294 | </div> |
| 293 | </div> | 295 | </div> |
| 294 | </div> | 296 | </div> |