Commit 87c2836146339c14ee862078e330822c7829c0ef

Authored by ljq
1 parent 3eb5c3a9

自动调度全部上线更新

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, 25, TimeUnit.SECONDS); 148 + sexec.scheduleWithFixedDelay(znddThread, 60, 25, 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, 25, TimeUnit.SECONDS); 196 + sexec.scheduleWithFixedDelay(znddThread, 60, 25, 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, 25, TimeUnit.SECONDS); 241 + sexec.scheduleWithFixedDelay(znddThread, 60, 25, TimeUnit.SECONDS);
242 GpsDataLoaderThread.setFlag(-1); 242 GpsDataLoaderThread.setFlag(-1);
243 //dayOfSchedule.dataRecovery(); 243 //dayOfSchedule.dataRecovery();
244 /** 线调业务 */ 244 /** 线调业务 */
@@ -260,7 +260,7 @@ public class XDApplication implements CommandLineRunner { @@ -260,7 +260,7 @@ public class XDApplication implements CommandLineRunner {
260 WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 260 WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
261 261
262 /** 线调为其他程序提供的数据 --写入数据库 */ 262 /** 线调为其他程序提供的数据 --写入数据库 */
263 - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) 263 + //sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
264 //线路首末班数据(网关用,班次更新时写入) 264 //线路首末班数据(网关用,班次更新时写入)
265 //com.bsth.data.schedule.f_a_l.FirstAndLastHandler 265 //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
266 sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) 266 sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
src/main/java/com/bsth/data/kl/KlData.java
@@ -6,9 +6,10 @@ import org.slf4j.Logger; @@ -6,9 +6,10 @@ import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 6 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.beans.factory.annotation.Value; 8 import org.springframework.beans.factory.annotation.Value;
9 -import org.springframework.scheduling.annotation.Scheduled;  
10 import org.springframework.stereotype.Component; 9 import org.springframework.stereotype.Component;
11 -import java.util.*; 10 +
  11 +import java.util.HashMap;
  12 +import java.util.Map;
12 13
13 /** 14 /**
14 * @author ym 15 * @author ym
@@ -30,7 +31,7 @@ public class KlData { @@ -30,7 +31,7 @@ public class KlData {
30 @Value("${passengerFlow.url}") 31 @Value("${passengerFlow.url}")
31 private String url; 32 private String url;
32 33
33 - @Scheduled(cron = "0/10 * * * * ?") 34 + /* @Scheduled(cron = "0/10 * * * * ?")
34 public void loadKl() { 35 public void loadKl() {
35 Map<String,Kl> map= new HashMap<>(); 36 Map<String,Kl> map= new HashMap<>();
36 List<Kl> list = klService.loadKl(); 37 List<Kl> list = klService.loadKl();
@@ -40,7 +41,7 @@ public class KlData { @@ -40,7 +41,7 @@ public class KlData {
40 map.put(kl.getDeviceId(),kl); 41 map.put(kl.getDeviceId(),kl);
41 } 42 }
42 KlData =map; 43 KlData =map;
43 - } 44 + }*/
44 45
45 public static Kl getKl(String deviceId){ 46 public static Kl getKl(String deviceId){
46 //return KlData.get( KlData.keySet().toArray()[0]); 47 //return KlData.get( KlData.keySet().toArray()[0]);
src/main/java/com/bsth/data/zndd/AutomaticSch.java
@@ -8,16 +8,23 @@ import com.bsth.data.adjg.domain.LargeGap; @@ -8,16 +8,23 @@ import com.bsth.data.adjg.domain.LargeGap;
8 import com.bsth.data.directive.DayOfDirectives; 8 import com.bsth.data.directive.DayOfDirectives;
9 import com.bsth.data.gpsdata_v2.GpsRealData; 9 import com.bsth.data.gpsdata_v2.GpsRealData;
10 import com.bsth.data.gpsdata_v2.entity.GpsEntity; 10 import com.bsth.data.gpsdata_v2.entity.GpsEntity;
  11 +import com.bsth.data.gpsdata_v2.rfid.RfidHttpLoader;
  12 +import com.bsth.data.gpsdata_v2.rfid.entity.RfidInfo;
11 import com.bsth.data.schedule.DayOfSchedule; 13 import com.bsth.data.schedule.DayOfSchedule;
12 import com.bsth.data.schedule.ScheduleComparator; 14 import com.bsth.data.schedule.ScheduleComparator;
  15 +import com.bsth.data.schedule.edit_logs.entity.SchEditInfo;
  16 +import com.bsth.data.schedule.edit_logs.service.SchEditInfoService;
13 import com.bsth.data.schedule.late_adjust.LateAdjustHandle; 17 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
14 import com.bsth.entity.directive.D60; 18 import com.bsth.entity.directive.D60;
15 import com.bsth.entity.realcontrol.ScheduleRealInfo; 19 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  20 +import com.bsth.entity.zndd.StationPeopleLogger;
16 import com.bsth.entity.zndd.ZnddYuAn; 21 import com.bsth.entity.zndd.ZnddYuAn;
17 import com.bsth.repository.StationRouteRepository; 22 import com.bsth.repository.StationRouteRepository;
18 import com.bsth.service.directive.DirectiveService; 23 import com.bsth.service.directive.DirectiveService;
19 import com.bsth.service.realcontrol.ScheduleRealInfoService; 24 import com.bsth.service.realcontrol.ScheduleRealInfoService;
  25 +import com.bsth.service.zndd.ZnddLoggerService;
20 import com.bsth.service.zndd.ZnddYuAnService; 26 import com.bsth.service.zndd.ZnddYuAnService;
  27 +import com.bsth.util.DateUtils;
21 import com.bsth.util.HttpClientUtils; 28 import com.bsth.util.HttpClientUtils;
22 import com.google.gson.Gson; 29 import com.google.gson.Gson;
23 import org.apache.commons.lang3.StringUtils; 30 import org.apache.commons.lang3.StringUtils;
@@ -60,17 +67,24 @@ public class AutomaticSch { @@ -60,17 +67,24 @@ public class AutomaticSch {
60 @Autowired 67 @Autowired
61 ZnddYuAnService znddYuAnService; 68 ZnddYuAnService znddYuAnService;
62 69
  70 + @Autowired
  71 + ZnddLoggerService znddLoggerService;
  72 + @Autowired
  73 + SchEditInfoService schEditInfoService;
  74 +
  75 +
63 private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm"); 76 private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
  77 + private static SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
64 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); 78 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
65 79
66 private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.DFSJ2(); 80 private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.DFSJ2();
67 private Map<String,Long> drivreMap =new HashMap<>(); //自动重发map 81 private Map<String,Long> drivreMap =new HashMap<>(); //自动重发map
68 82
69 - String urldkl = "http://10.10.200.202:5580/monitor/api/getMonitorInfoByDay?key=1&solt=1111&t=1&dayStr=2024-12-04"; //大间隔接口 83 + String urldkl = "http://10.10.200.202:5580/monitor/api/getMonitorInfoByDay?key=1&solt=1111&t=1&dayStr="; //大间隔接口
70 84
71 //http://10.10.200.201:8083/wxk-prod-api/service-api/lggj/schedule/drByInfo 维修接口 85 //http://10.10.200.201:8083/wxk-prod-api/service-api/lggj/schedule/drByInfo 维修接口
72 String urldkls = "http://10.10.200.140:13089/bsth_passengerflow/klbus/currentInsideNum.do"; //满载接口 86 String urldkls = "http://10.10.200.140:13089/bsth_passengerflow/klbus/currentInsideNum.do"; //满载接口
73 - private Map<String,Long> SFMAP = new HashMap<>(); 87 + private Map<Long,Long> SFMAP = new HashMap<>();
74 88
75 //满载 89 //满载
76 public void mz(){ 90 public void mz(){
@@ -90,7 +104,7 @@ public class AutomaticSch { @@ -90,7 +104,7 @@ public class AutomaticSch {
90 //大间隔的情况 104 //大间隔的情况
91 public void dfTz(int k ){ 105 public void dfTz(int k ){
92 try{ 106 try{
93 - StringBuilder sb = HttpClientUtils.get(urldkl /*+ sdfMonth.format(new Date())*/); 107 + StringBuilder sb = HttpClientUtils.get(urldkl + sdfMonth.format(new Date()));
94 if (sb == null) 108 if (sb == null)
95 return; 109 return;
96 JSONObject obj = JSON.parseObject(sb.toString()); 110 JSONObject obj = JSON.parseObject(sb.toString());
@@ -103,20 +117,35 @@ public class AutomaticSch { @@ -103,20 +117,35 @@ public class AutomaticSch {
103 }else { 117 }else {
104 continue; 118 continue;
105 } 119 }
106 - if (k == 0 ){  
107 - if(lg.getlGType() == 0){  
108 - ts(ConvertDJK(lg,sch,"FCJG"));  
109 - String chartStr = JSON.toJSONString(sch);  
110 - logger.info("发车大间隔--"+chartStr); 120 + Long t0 = new Date().getTime() - (1000 * 60 * 2);
  121 + Long t1 = t0 - (1000 * 60 * 2);
  122 + Long t2 = t0 + (1000 * 60 * 2);
  123 + //判断当前间隔是否出现过并且在当前时间段内 大于2分钟 小于1分钟的时间之内
  124 + //if ( lg.getTsTime() > t1 && lg.getTsTime() < t2 && SFMAP.get(lg.getId()) == null ) {
  125 + if (k == 0) {
  126 + if (lg.getlGType() == 0) {
  127 + ts(ConvertDJK(lg, sch, "FCJG"));
  128 + SFMAP.put(lg.getId(), lg.getTsTime());
  129 + String chartStr = JSON.toJSONString(sch);
  130 + logger.info("发车大间隔--" + chartStr);
  131 + }
  132 + } else {
  133 + if (lg.getlGType() != 0) {
  134 + ts(ConvertDJK(lg, sch, "DJG"));
  135 + SFMAP.put(lg.getId(), lg.getTsTime());
  136 + String chartStr = JSON.toJSONString(sch);
  137 + logger.info("行车大间隔--" + chartStr);
  138 + }
111 } 139 }
112 - }else {  
113 - if(lg.getlGType() != 0){  
114 - ts(ConvertDJK(lg,sch,"DJG"));  
115 - String chartStr = JSON.toJSONString(sch);  
116 - logger.info("行车大间隔--"+chartStr); 140 + // }
  141 + //大于10000条的时候开始清理map
  142 + if (SFMAP.size() > 10000){
  143 + for (Map.Entry<Long, Long> m : SFMAP.entrySet()){
  144 + if(m.getValue() < DateUtils.getTimestamp()){
  145 + SFMAP.remove(m.getKey());
  146 + }
117 } 147 }
118 } 148 }
119 -  
120 } 149 }
121 150
122 }catch (Exception e){ 151 }catch (Exception e){
@@ -154,7 +183,21 @@ public class AutomaticSch { @@ -154,7 +183,21 @@ public class AutomaticSch {
154 //1。一直没收到gps 183 //1。一直没收到gps
155 //2.gps长时间离线的情况下 184 //2.gps长时间离线的情况下
156 //3.人为调整过的都跳过 185 //3.人为调整过的都跳过
157 - if (gps == null || gps.getTimestamp() + (1000 * 60 * 3) < time || (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))) { 186 + if (gps == null || gps.getTimestamp() + (1000 * 60 * 5) < time || (gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline"))) {
  187 + String sfsj = null;
  188 + //rfid 判断
  189 + List<RfidInfo> list = RfidHttpLoader.load();
  190 + for (RfidInfo ri : list) {
  191 + //最新的rfid是出站状态
  192 + if (ri.getNbbm().equals(sr.getClZbh())){
  193 + sfsj = sdfHHmm.format(ri.getInoutStation().getTimestamp());
  194 + }
  195 + if (ri.getNbbm().equals(sr.getClZbh()) && ri.getInoutStation().getInout() == 0) {
  196 + sfsj = sdfHHmm.format(ri.getInoutStation().getTimestamp());
  197 + }
  198 +
  199 + }
  200 + sr.setFcsjActual(sfsj);
158 ts(addStationPeople(sr, "SFTZ_1", 0L)); 201 ts(addStationPeople(sr, "SFTZ_1", 0L));
159 Gson gson = new Gson(); 202 Gson gson = new Gson();
160 String chartStr = gson.toJsonTree(sr).toString(); 203 String chartStr = gson.toJsonTree(sr).toString();
@@ -190,8 +233,7 @@ public class AutomaticSch { @@ -190,8 +233,7 @@ public class AutomaticSch {
190 for (ScheduleRealInfo t : oldSchDateList){ 233 for (ScheduleRealInfo t : oldSchDateList){
191 // 发车误点 234 // 发车误点
192 if (t.getDfsj() != null && t.getFcsjActual() != null 235 if (t.getDfsj() != null && t.getFcsjActual() != null
193 - && (t.getBcType().equals("normal") || t.getBcType().equals("region"))  
194 - && (StringUtils.isEmpty(t.getRemarks()) || t.getRemarks().equals("_智能调度-异常实发"))) { 236 + && (t.getBcType().equals("normal") || t.getBcType().equals("region"))) {
195 237
196 long sjc = t.getFcsjActualTime() - t.getDfsjT(); 238 long sjc = t.getFcsjActualTime() - t.getDfsjT();
197 long time = System.currentTimeMillis();//当前时间 239 long time = System.currentTimeMillis();//当前时间
@@ -201,6 +243,16 @@ public class AutomaticSch { @@ -201,6 +243,16 @@ public class AutomaticSch {
201 if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) { 243 if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
202 continue; 244 continue;
203 } else { 245 } else {
  246 + //备注不为null时,查询是否有调度操作记录
  247 + List<SchEditInfo> seiList = new ArrayList<>();
  248 + if (!StringUtils.isEmpty(t.getRemarks())){
  249 + Map msp = new HashMap();
  250 + msp.put("schId_eq",t.getId());
  251 + seiList = (List<SchEditInfo>) schEditInfoService.list(msp);
  252 + //有操作记录的跳过
  253 + if (seiList.size() > 0)
  254 + continue;
  255 + }
204 //异常实发 256 //异常实发
205 ts(addStationPeople(t, "YCSF", 0l)); 257 ts(addStationPeople(t, "YCSF", 0l));
206 Gson gson = new Gson(); 258 Gson gson = new Gson();
@@ -252,8 +304,7 @@ public class AutomaticSch { @@ -252,8 +304,7 @@ public class AutomaticSch {
252 String lineCode; 304 String lineCode;
253 for (Map.Entry<String, String> ts : lineMap.entrySet()) { 305 for (Map.Entry<String, String> ts : lineMap.entrySet()) {
254 lineCode = ts.getKey(); 306 lineCode = ts.getKey();
255 - if(isLines(lineCode)) {  
256 - 307 + /* if(isLines(lineCode)) {*/
257 oldSchDateList = dayOfSchedule.findByLineCode(lineCode); 308 oldSchDateList = dayOfSchedule.findByLineCode(lineCode);
258 for (ScheduleRealInfo t : oldSchDateList) { 309 for (ScheduleRealInfo t : oldSchDateList) {
259 //指令重发 310 //指令重发
@@ -276,7 +327,7 @@ public class AutomaticSch { @@ -276,7 +327,7 @@ public class AutomaticSch {
276 //下发时间未超过5分钟返回 327 //下发时间未超过5分钟返回
277 } 328 }
278 } 329 }
279 - } 330 + /*}*/
280 } 331 }
281 } 332 }
282 }catch (Exception e){ 333 }catch (Exception e){
@@ -298,8 +349,8 @@ public class AutomaticSch { @@ -298,8 +349,8 @@ public class AutomaticSch {
298 if(sch.getDfsjT() > t) 349 if(sch.getDfsjT() > t)
299 break; 350 break;
300 351
301 - /*if(sch.isLate()) //演示使用 不跳过  
302 - continue;*/ 352 + if(sch.isLate()) //演示使用 不跳过
  353 + continue;
303 354
304 if(sch.getStatus() == 0 355 if(sch.getStatus() == 0
305 && StringUtils.isEmpty(sch.getFcsjActual())){ 356 && StringUtils.isEmpty(sch.getFcsjActual())){
@@ -333,29 +384,20 @@ public class AutomaticSch { @@ -333,29 +384,20 @@ public class AutomaticSch {
333 384
334 385
335 public void ts(Map m) throws ParseException { 386 public void ts(Map m) throws ParseException {
336 - //记录存一下 --超过当前时间的是否推送?  
337 - String st = m.get("lineCode")+"_"+m.get("type")+"_"+m.get("rqStr");  
338 - Long sj = sdf.parse(m.get("rqStr").toString() +" "+ m.get("rq")).getTime();  
339 - Long dsj = new Date().getTime();  
340 - List<Long> list = new ArrayList();  
341 - //111_DJG_2024-06-24  
342 - if (ZnddThread.ZNDDTYPEMAP.get(st) != null ) {  
343 - list = ZnddThread.ZNDDTYPEMAP.get(st);  
344 - int i = 0;  
345 -  
346 - for (Long s : list){ //推送过的同样情况1小时内 &&//超过当前时间的不推送&& sj < dsj  
347 - if (Math.abs(s - sj) > (60 * 60 * 1000)){  
348 - i ++ ;  
349 - }  
350 - }  
351 - outEntrance.Znddjk(m);//测试推送  
352 - }else {  
353 - list.add(sj);  
354 - ZnddThread.ZNDDTYPEMAP.put(st,list);//存记录  
355 - outEntrance.Znddjk(m);//推送  
356 - }  
357 -  
358 387
  388 + //储存日志
  389 + StationPeopleLogger splogger = new StationPeopleLogger();
  390 + splogger.setType(m.get("type").toString());
  391 + splogger.setLineName(m.get("lineName").toString());
  392 + splogger.setLineCode(m.get("lineCode").toString());
  393 + splogger.setRq(sdf.format(new Date()));
  394 + splogger.setRqStr(m.get("rqStr").toString());
  395 + splogger.setXlDir(m.get("xlDir").toString());
  396 + splogger.setFcsj(m.get("fcsj").toString());
  397 + splogger.setClZbh(m.get("clzbh").toString());
  398 + znddLoggerService.save(splogger);
  399 +
  400 + outEntrance.Znddjk(m);//推送
359 } 401 }
360 402
361 403
src/main/java/com/bsth/data/zndd/OutEntrance.java
@@ -6,10 +6,12 @@ import com.bsth.common.ResponseCode; @@ -6,10 +6,12 @@ import com.bsth.common.ResponseCode;
6 import com.bsth.data.BasicData; 6 import com.bsth.data.BasicData;
7 import com.bsth.data.schedule.DayOfSchedule; 7 import com.bsth.data.schedule.DayOfSchedule;
8 import com.bsth.data.schedule.ScheduleComparator; 8 import com.bsth.data.schedule.ScheduleComparator;
  9 +import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
9 import com.bsth.entity.DKLInfo; 10 import com.bsth.entity.DKLInfo;
10 import com.bsth.entity.realcontrol.ScheduleRealInfo; 11 import com.bsth.entity.realcontrol.ScheduleRealInfo;
11 -import com.bsth.entity.zndd.StationPeopleLogger;  
12 import com.bsth.entity.zndd.StationSignsLogger; 12 import com.bsth.entity.zndd.StationSignsLogger;
  13 +import com.bsth.entity.zndd.znddStatus;
  14 +import com.bsth.repository.zndd.ZnddStatusRepository;
13 import com.bsth.service.DKLInfoService; 15 import com.bsth.service.DKLInfoService;
14 import com.bsth.util.HttpClientUtils; 16 import com.bsth.util.HttpClientUtils;
15 import com.bsth.util.SignUtils; 17 import com.bsth.util.SignUtils;
@@ -75,6 +77,12 @@ public class OutEntrance { @@ -75,6 +77,12 @@ public class OutEntrance {
75 @Autowired 77 @Autowired
76 JdbcTemplate jdbcTemplate; 78 JdbcTemplate jdbcTemplate;
77 79
  80 + @Autowired
  81 + ZnddStatusRepository znddStatusRepository;
  82 +
  83 + @Autowired
  84 + BasicData basicData;
  85 +
78 //调度屏小程序接口。 86 //调度屏小程序接口。
79 @RequestMapping(value = "/OutCar", method = RequestMethod.POST) 87 @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
80 public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) { 88 public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) {
@@ -114,6 +122,31 @@ public class OutEntrance { @@ -114,6 +122,31 @@ public class OutEntrance {
114 } 122 }
115 rtn.put("message",s+"亲爱的乘客,我们的调度员已接收到通知,车辆预计还有"+dzList.get(0).get("sj")+"抵达,请稍等片刻"); 123 rtn.put("message",s+"亲爱的乘客,我们的调度员已接收到通知,车辆预计还有"+dzList.get(0).get("sj")+"抵达,请稍等片刻");
116 }else { 124 }else {
  125 + //第一个班次
  126 + //所有应发未到的班次
  127 + Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch();
  128 + for (ScheduleRealInfo schc : all) {
  129 + Long schId = (Long) dzList.get(0).get("schId");
  130 + ScheduleRealInfo sch = null;
  131 + if (schId != null)
  132 + sch = dayOfSchedule.get(schId);
  133 +
  134 + ScheduleRealInfo prev = dayOfSchedule.prev(sch);
  135 + List<Map> dzLists = carMonitor.carMonitor(prev.getXlBm(), prev.getXlDir(), prev.getZdzCode()); //信息发布接口
  136 + for (Map mst : dzLists) {
  137 + //匹配到当前车辆
  138 + if (basicData.nbbmCompanyPlateMap.get(prev.getClZbh()) != null && mst.get("terminal").equals(basicData.nbbmCompanyPlateMap.get(prev.getClZbh()).replaceAll("-", ""))) {
  139 + if (sch.getXlBm().equals(schc.getXlBm())) {
  140 + rtn.put("message", "非常抱歉,车辆因路上交通拥堵,预计还需要" + m.get("sj").toString() + "抵达,请稍等片刻");
  141 + rtn.put("status", ResponseCode.SUCCESS);
  142 + return rtn;
  143 + }
  144 + }
  145 + }
  146 + }
  147 +
  148 +
  149 +
117 //筛选方向 150 //筛选方向
118 List<ScheduleRealInfo> rs = dayOfSchedule.findByLineAndUpDown(ssLogger.getLineCode(),Integer.parseInt(ssLogger.getDir())); 151 List<ScheduleRealInfo> rs = dayOfSchedule.findByLineAndUpDown(ssLogger.getLineCode(),Integer.parseInt(ssLogger.getDir()));
119 if(rs.size()>0){ 152 if(rs.size()>0){
@@ -159,6 +192,23 @@ public class OutEntrance { @@ -159,6 +192,23 @@ public class OutEntrance {
159 rtn.put("status", "验证失败"); 192 rtn.put("status", "验证失败");
160 return rtn; 193 return rtn;
161 } 194 }
  195 + //大客流开关
  196 + List<znddStatus> znddStatusList = (List<znddStatus>) znddStatusRepository.findAll();
  197 + Boolean isType = false;
  198 + String excuteStatus = null;
  199 + for (znddStatus zs : znddStatusList) {
  200 + if (zs.getType().equals("dkl")) {
  201 + isType = true;
  202 + excuteStatus = zs.getExcuteStatus();
  203 + }
  204 + }
  205 +
  206 + if (!isType){
  207 + logger.info("大客流接口未开启--------------");
  208 + rtn.put("status",ResponseCode.SUCCESS);
  209 + return rtn;
  210 + }
  211 +
162 String num=jsonObject.getString("num"); 212 String num=jsonObject.getString("num");
163 int count=automaticSch.getPenum("DKL","0"); 213 int count=automaticSch.getPenum("DKL","0");
164 if(Integer.parseInt(num)<count){ 214 if(Integer.parseInt(num)<count){
@@ -198,6 +248,7 @@ public class OutEntrance { @@ -198,6 +248,7 @@ public class OutEntrance {
198 m.put("lineName",lineName); 248 m.put("lineName",lineName);
199 m.put("num",num); 249 m.put("num",num);
200 m.put("xlDir",dir); 250 m.put("xlDir",dir);
  251 + m.put("excuteStatus",excuteStatus);
201 List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(lineCode,Integer.parseInt(dir)); 252 List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(lineCode,Integer.parseInt(dir));
202 List<ScheduleRealInfo> sl=new ArrayList<>(); 253 List<ScheduleRealInfo> sl=new ArrayList<>();
203 for (ScheduleRealInfo scheduleRealInfo : srList) {//筛选出运营班次 254 for (ScheduleRealInfo scheduleRealInfo : srList) {//筛选出运营班次
@@ -273,33 +324,6 @@ public class OutEntrance { @@ -273,33 +324,6 @@ public class OutEntrance {
273 } 324 }
274 325
275 326
276 - //智能调度接口-大客流  
277 - @RequestMapping(value="/dkl",method = RequestMethod.POST)  
278 - public Map ddkl(@RequestParam Map m) {  
279 - Map rtn = new HashMap<>();  
280 -  
281 - try {  
282 - ObjectMapper mapper = new ObjectMapper();  
283 - //map转换实体类  
284 - StationPeopleLogger ssLogger = mapper.convertValue(m, StationPeopleLogger.class);  
285 -  
286 - ssLogger.setType("大客流");  
287 -  
288 - //保存记录  
289 - //znddLoggerService.save(ssLogger);  
290 - //线调页面推送  
291 - //sendUtils.sendzndd(ssLogger);  
292 -  
293 - rtn.put("status",ResponseCode.SUCCESS);  
294 - } catch (Exception e) {  
295 - rtn.put("status", ResponseCode.ERROR);  
296 - logger.error("大客流推送异常----",e);  
297 - }  
298 - return rtn;  
299 - }  
300 -  
301 -  
302 -  
303 327
304 /** 328 /**
305 * 保存base64图片 329 * 保存base64图片
src/main/java/com/bsth/data/zndd/carMonitor.java
@@ -81,6 +81,7 @@ public class carMonitor { @@ -81,6 +81,7 @@ public class carMonitor {
81 map.put("lat",responseEle.elementTextTrim("lat")); 81 map.put("lat",responseEle.elementTextTrim("lat"));
82 map.put("nbbm",responseEle.elementTextTrim("insidecode")); 82 map.put("nbbm",responseEle.elementTextTrim("insidecode"));
83 map.put("road",responseEle.elementTextTrim("road")); 83 map.put("road",responseEle.elementTextTrim("road"));
  84 + map.put("schId",responseEle.elementTextTrim("schId"));
84 list.add(map); 85 list.add(map);
85 } 86 }
86 } 87 }
src/main/java/com/bsth/entity/zndd/StationPeopleLogger.java
@@ -7,7 +7,7 @@ import javax.persistence.*; @@ -7,7 +7,7 @@ import javax.persistence.*;
7 import java.io.Serializable; 7 import java.io.Serializable;
8 8
9 @Entity 9 @Entity
10 -@Table(name = "bsth_c_t_station_people_logger") //智能调度记录查询 10 +@Table(name = "bsth_c_t_station_people_logger") //智能调度记录检测
11 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) 11 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
12 public class StationPeopleLogger implements Serializable { 12 public class StationPeopleLogger implements Serializable {
13 // ID 13 // ID
@@ -19,8 +19,10 @@ public class StationPeopleLogger implements Serializable { @@ -19,8 +19,10 @@ public class StationPeopleLogger implements Serializable {
19 //线路名称 19 //线路名称
20 private String lineName; 20 private String lineName;
21 //站点code 21 //站点code
  22 + @Transient
22 private String station; 23 private String station;
23 //站点名称 24 //站点名称
  25 + @Transient
24 private String stationName; 26 private String stationName;
25 //日期 27 //日期
26 private String rqStr; 28 private String rqStr;
@@ -31,8 +33,19 @@ public class StationPeopleLogger implements Serializable { @@ -31,8 +33,19 @@ public class StationPeopleLogger implements Serializable {
31 //上下行 33 //上下行
32 private String xlDir; 34 private String xlDir;
33 //人数 or 差距时间 or 站点差数 根据类型判断 35 //人数 or 差距时间 or 站点差数 根据类型判断
34 - private Long numType;  
35 - 36 + private String fcsj;
  37 +
  38 + private String clZbh;
  39 +
  40 +
  41 +
  42 + public String getClZbh() {
  43 + return clZbh;
  44 + }
  45 +
  46 + public void setClZbh(String clZbh) {
  47 + this.clZbh = clZbh;
  48 + }
36 49
37 public void setId(Long id) { 50 public void setId(Long id) {
38 this.id = id; 51 this.id = id;
@@ -90,8 +103,12 @@ public class StationPeopleLogger implements Serializable { @@ -90,8 +103,12 @@ public class StationPeopleLogger implements Serializable {
90 this.rq = rq; 103 this.rq = rq;
91 } 104 }
92 105
93 - public Long getNumType() {  
94 - return numType; 106 + public String getFcsj() {
  107 + return fcsj;
  108 + }
  109 +
  110 + public void setFcsj(String fcsj) {
  111 + this.fcsj = fcsj;
95 } 112 }
96 113
97 public String getStation() { 114 public String getStation() {
@@ -110,8 +127,5 @@ public class StationPeopleLogger implements Serializable { @@ -110,8 +127,5 @@ public class StationPeopleLogger implements Serializable {
110 this.stationName = stationName; 127 this.stationName = stationName;
111 } 128 }
112 129
113 - public void setNumType(Long numType) {  
114 - this.numType = numType;  
115 - }  
116 130
117 } 131 }
src/main/java/com/bsth/repository/zndd/ZnddLoggerRepository.java 0 → 100644
  1 +package com.bsth.repository.zndd;
  2 +
  3 +import com.bsth.entity.zndd.StationPeopleLogger;
  4 +import com.bsth.repository.BaseRepository;
  5 +
  6 +public interface ZnddLoggerRepository extends BaseRepository<StationPeopleLogger, Integer> {
  7 +}
src/main/java/com/bsth/service/zndd/ZnddLoggerService.java 0 → 100644
  1 +package com.bsth.service.zndd;
  2 +
  3 +import com.bsth.entity.zndd.StationPeopleLogger;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +public interface ZnddLoggerService extends BaseService<StationPeopleLogger, Integer> {
  7 +}
src/main/java/com/bsth/service/zndd/impl/LoggerZnddServiceImpl.java
@@ -135,7 +135,7 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt; @@ -135,7 +135,7 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
135 int ms = mis[i]; 135 int ms = mis[i];
136 //未发车时 才可改变 136 //未发车时 才可改变
137 if (info.getFcsjActual() == null || info.getFcsjActual().equals("")){ 137 if (info.getFcsjActual() == null || info.getFcsjActual().equals("")){
138 - String dfsj = sdfMonth.format(sdf.parse(info.getScheduleDateStr()+ " " + info.getDfsj()).getTime() + (ms * 60 * 1000)); //延后几分钟 138 + String dfsj = sdfMonth.format(sdf.parse(info.getScheduleDateStr()+ " " + info.getDfsj()).getTime() - (ms * 60 * 1000)); //延后几分钟
139 cl.setSchId(info.getId()); 139 cl.setSchId(info.getId());
140 cl.setOld_dfsj(info.getDfsj()); 140 cl.setOld_dfsj(info.getDfsj());
141 cl.setNew_dfsj(dfsj); 141 cl.setNew_dfsj(dfsj);
src/main/java/com/bsth/service/zndd/impl/ZnddLoggerServiceImpl.java 0 → 100644
  1 +package com.bsth.service.zndd.impl;
  2 +
  3 +import com.bsth.entity.zndd.StationPeopleLogger;
  4 +import com.bsth.service.impl.BaseServiceImpl;
  5 +import com.bsth.service.zndd.ZnddLoggerService;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +@Service
  9 +public class ZnddLoggerServiceImpl extends BaseServiceImpl<StationPeopleLogger, Integer> implements ZnddLoggerService {
  10 +}
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_two_way_znddType.html
@@ -263,7 +263,7 @@ @@ -263,7 +263,7 @@
263 </script> 263 </script>
264 264
265 <script> 265 <script>
266 - (function () { 266 + var addTwoWayZnddType = (function () {
267 var wrap = '#schedule-addsch-modal .toAndFroCont', sch, f1, f2, submitFun, stationRoutes; 267 var wrap = '#schedule-addsch-modal .toAndFroCont', sch, f1, f2, submitFun, stationRoutes;
268 268
269 $(wrap).on('init', function (e, data) { 269 $(wrap).on('init', function (e, data) {
@@ -311,7 +311,7 @@ @@ -311,7 +311,7 @@
311 $f('zdsj',f1).on('input', synchroFormData); 311 $f('zdsj',f1).on('input', synchroFormData);
312 312
313 //表单校验提交相关 313 //表单校验提交相关
314 - var dataArray; 314 +
315 var fs = $('.add-sch-form', wrap); 315 var fs = $('.add-sch-form', wrap);
316 fs.on('success.form.fv', function (e) { 316 fs.on('success.form.fv', function (e) {
317 e.preventDefault(); 317 e.preventDefault();
@@ -352,6 +352,7 @@ @@ -352,6 +352,7 @@
352 })(); 352 })();
353 } 353 }
354 }); 354 });
  355 +
355 //提交 356 //提交
356 $('[type=submit]', wrap).on('click', function () { 357 $('[type=submit]', wrap).on('click', function () {
357 $(this).addClass('disabled').attr('disabled', 'disabled'); 358 $(this).addClass('disabled').attr('disabled', 'disabled');
@@ -360,6 +361,57 @@ @@ -360,6 +361,57 @@
360 fs.formValidation('validate'); 361 fs.formValidation('validate');
361 }); 362 });
362 }); 363 });
  364 + var dataArray;
  365 +
  366 + var submit = function () {
  367 + debugger
  368 + $(this).addClass('disabled').attr('disabled', 'disabled');
  369 + dataArray = [];
  370 + var fs = $('.add-sch-form', wrap);
  371 + fs.data('valid', false);
  372 + fs.formValidation('validate');
  373 +
  374 +
  375 + fs.on('success.form.fv', function (e) {
  376 + e.preventDefault();
  377 + dataArray.push($(this).serializeJSON());
  378 + $(this).data('valid', true);
  379 + if (allValidSuccess()) {
  380 + //开始post
  381 + var i = 0;
  382 + var inArr = [];
  383 + var upArr = [];
  384 + (function () {
  385 + var f = arguments.callee;
  386 + if (i >= dataArray.length) {
  387 + //前端数据更新
  388 + var last = inArr.pop();
  389 + gb_schedule_table.insertSchedule(last, upArr);
  390 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: last});
  391 +
  392 + try {
  393 + if(last.bcType=='in' || last.bcType=='out')
  394 + gb_data_basic.reload_stat_park_data();
  395 + }catch (e){
  396 + console.log(e);}
  397 + UIkit.modal('#schedule-addsch-modal').hide();
  398 + //更新路牌公里统计面板
  399 + gb_schedule_table.showLpMileageTipBySch(last);
  400 + return;
  401 + }
  402 + submitFun(dataArray[i], function (rs) {
  403 + inArr.push(rs.t);
  404 + upArr = upArr.concat(rs.ts);
  405 + upArr.push(rs.t);
  406 + i++;
  407 + f();
  408 + }, function () {
  409 + $('[type=submit]', wrap).removeClass('disabled').removeAttr('disabled');
  410 + });
  411 + })();
  412 + }
  413 + });
  414 + }
363 415
364 function $f(name, f) { 416 function $f(name, f) {
365 return $('[name=' + name + ']', f); 417 return $('[name=' + name + ']', f);
@@ -422,5 +474,9 @@ @@ -422,5 +474,9 @@
422 return routes[i].stationCode; 474 return routes[i].stationCode;
423 } 475 }
424 } 476 }
  477 +
  478 + return {
  479 + submit : submit
  480 + }
425 })(); 481 })();
426 </script> 482 </script>
427 \ No newline at end of file 483 \ No newline at end of file
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
1 var gb_dataZndd = (function (){ 1 var gb_dataZndd = (function (){
2 2
3 - var max = 1; 3 + var max = 3;
4 var $pop =$('.multi_plat_msg_pop_zndd'); 4 var $pop =$('.multi_plat_msg_pop_zndd');
5 5
6 var codes = { 6 var codes = {
@@ -18,15 +18,17 @@ var gb_dataZndd = (function (){ @@ -18,15 +18,17 @@ var gb_dataZndd = (function (){
18 var dataMap = new Map(); 18 var dataMap = new Map();
19 var leftTime = 1000 * 10;//剩余的毫秒数 19 var leftTime = 1000 * 10;//剩余的毫秒数
20 var sop = function (data) { 20 var sop = function (data) {
21 -  
22 //时间格式化 21 //时间格式化
23 data.types = codes[data.type]; 22 data.types = codes[data.type];
24 23
25 -  
26 - if (data.type == 'SFTZ_1' && sf_tz(data.lineCode) == false){ 24 + /* if (data.type == 'SFTZ_1' && sf_tz(data.lineCode) == false){
27 return 25 return
28 } 26 }
  27 +*/
29 28
  29 + if ((data.type == 'WD' || data.type == 'MZ' || data.type == 'FCJG' || data.type == 'DJG') && ycsf_sx(data.lineCode) == false){
  30 + return
  31 + }
30 32
31 33
32 var stm = moment(new Date()); 34 var stm = moment(new Date());
@@ -94,7 +96,7 @@ var gb_dataZndd = (function (){ @@ -94,7 +96,7 @@ var gb_dataZndd = (function (){
94 } 96 }
95 97
96 98
97 - //1078路,1135路,南临专线,临港4路,浦东111路,浦东74路,临港13路,申港3路,浦东29路,新芦专线 99 + //芦潮港1路 新临专线,临港10路, 浦东107路, 浦东91路,1078路,1135路,南临专线,临港4路,浦东111路,浦东74路,临港13路,申港3路,浦东29路,新芦专线
98 function ycsf_sx(line){ 100 function ycsf_sx(line){
99 var t =['12101','200828','230308','220826','201012','10636','60033','88814','88818','180926','191221','210821','230311','230329','803111']; 101 var t =['12101','200828','230308','220826','201012','10636','60033','88814','88818','180926','191221','210821','230311','230329','803111'];
100 102
@@ -105,16 +107,7 @@ var gb_dataZndd = (function (){ @@ -105,16 +107,7 @@ var gb_dataZndd = (function (){
105 return false; 107 return false;
106 } 108 }
107 109
108 - //1078路,1135路,南临专线,临港4路,浦东111路,浦东74路,临港13路,申港3路,浦东29路,新芦专线  
109 - function sf_tz(line){  
110 - var t =['80301'];  
111 110
112 - for (var lines in t){  
113 - if(line == t[lines])  
114 - return true;  
115 - }  
116 - return false;  
117 - }  
118 //发车信息微调 111 //发车信息微调
119 $pop.on('click', '.fcxxwts', function () { 112 $pop.on('click', '.fcxxwts', function () {
120 if (close) close = false 113 if (close) close = false
@@ -161,9 +154,9 @@ var gb_dataZndd = (function (){ @@ -161,9 +154,9 @@ var gb_dataZndd = (function (){
161 alt_confirm(content, function () { 154 alt_confirm(content, function () {
162 gb_common.$post('/realSchedule/realOutAdjust_zndd', { 155 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
163 id: that.data('id'), 156 id: that.data('id'),
164 - remarks:'自动调度实发未发-车辆掉线',  
165 - fcsjActual:that.data('fcsj')  
166 - 157 + remarks:that.data('fcsjactual') != null ? '实发未发-车辆掉线-rfid' : '实发未发-车辆掉线' ,
  158 + fcsjActual: that.data('fcsjactual') != null ? that.data('fcsjactual') : that.data('fcsj'),
  159 +
167 }, function (rs) { 160 }, function (rs) {
168 if(rs.length != 0) { 161 if(rs.length != 0) {
169 gb_schedule_table.updateSchedule(rs.ts); 162 gb_schedule_table.updateSchedule(rs.ts);
@@ -360,8 +353,8 @@ var gb_dataZndd = (function (){ @@ -360,8 +353,8 @@ var gb_dataZndd = (function (){
360 353
361 gb_common.$post('/realSchedule/realOutAdjust_zndd', { 354 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
362 id: sch.sch.id, 355 id: sch.sch.id,
363 - remarks:'自动调度实发未发-车辆掉线',  
364 - fcsjActual: sch.sch.dfsj, 356 + remarks:sch.sch.fcsjActual != null? '实发未发-车辆掉线-rfid' : '实发未发-车辆掉线' ,
  357 + fcsjActual: sch.sch.fcsjActual != null ? sch.sch.fcsjActual : sch.sch.dfsj,
365 }, function (rs) { 358 }, function (rs) {
366 gb_schedule_table.updateSchedule(rs.ts); 359 gb_schedule_table.updateSchedule(rs.ts);
367 notify_succ('实发未发操作成功!'); 360 notify_succ('实发未发操作成功!');
@@ -377,10 +370,14 @@ var gb_dataZndd = (function (){ @@ -377,10 +370,14 @@ var gb_dataZndd = (function (){
377 } 370 }
378 });*/ 371 });*/
379 } else if (type == "KLYJ"){ 372 } else if (type == "KLYJ"){
380 - if(!$('#schedule-addsch-modal').hasClass('uk-open')){  
381 - open_modal("/real_control_v2/zndd/type/dkl.html", {  
382 - data: data  
383 - }, {center: true, bgclose: false, modal: true}); 373 + if (data.excuteStatus == 0){
  374 + if(!$('#schedule-addsch-modal').hasClass('uk-open')){
  375 + let ljtype = $('#ljtype').val();
  376 + data.ljtype = ljtype;
  377 + open_modal("/real_control_v2/zndd/type/dkl.html", {
  378 + data: data
  379 + }, {center: true, bgclose: false, modal: true});
  380 + }
384 } 381 }
385 } 382 }
386 } 383 }
src/main/resources/static/real_control_v2/main.html
@@ -289,7 +289,7 @@ @@ -289,7 +289,7 @@
289 <script id="zndd_plat_msg_template_config" type="text/html"> 289 <script id="zndd_plat_msg_template_config" type="text/html">
290 <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}" 290 <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}"
291 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:''}}" 291 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:''}}"
292 - data-rq="{{rq}}" data-ids="{{ids}}" data-uuid="{{uuid}}"> 292 + data-rq="{{rq}}" data-ids="{{ids}}" data-uuid="{{uuid}}" data-fcsjactual="{{fcsjActual}}">
293 <div id ={{uuid}} class="timer"></div> 293 <div id ={{uuid}} class="timer"></div>
294 <div class="msg-popup warning-color"> 294 <div class="msg-popup warning-color">
295 <div class="msg-times" style="cursor: pointer;">×</div> 295 <div class="msg-times" style="cursor: pointer;">×</div>
@@ -313,7 +313,7 @@ @@ -313,7 +313,7 @@
313 <div class="centerSpace msg-title"> 313 <div class="centerSpace msg-title">
314 <div></div> 314 <div></div>
315 <div class="msg-date-infos" style="display:{{type == 'SFTZ_1'?'':'none'}}" > 315 <div class="msg-date-infos" style="display:{{type == 'SFTZ_1'?'':'none'}}" >
316 - <button class="uk-button uk-button-primary sfTzbc" data-fcsj="{{fcsj}}" data-clzbh="{{clzbh}}" data-id="{{id}}">补入发车时间</button> 316 + <button class="uk-button uk-button-primary sfTzbc" data-fcsj="{{fcsj}}" data-fcsjactual="{{fcsjActual}}" data-clzbh="{{clzbh}}" data-id="{{id}}">补入发车时间</button>
317 </div> 317 </div>
318 </div> 318 </div>
319 </div> 319 </div>
src/main/resources/static/real_control_v2/zndd/type/dkl.html
@@ -2,7 +2,9 @@ @@ -2,7 +2,9 @@
2 <div class="uk-modal-dialog" style="width: 1400px;"> 2 <div class="uk-modal-dialog" style="width: 1400px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
5 - <h2>新增临加班次<i class="uk-icon-question-circle uk-icon-hover"></i></h2></div> 5 + <h2 style="width: 40%;float: left;">新增临加班次<i class="uk-icon-question-circle uk-icon-hover"></i></h2>
  6 + <span style="color: red;font-weight: 700;"><div id ="xztimes" class="timer">------</div></span>
  7 + </div>
6 <div class="uk-grid uk-width-1-6" style="float: left"> 8 <div class="uk-grid uk-width-1-6" style="float: left">
7 <div class="uk-width-5-5 sjzlist"> 9 <div class="uk-width-5-5 sjzlist">
8 10
@@ -44,6 +46,10 @@ @@ -44,6 +46,10 @@
44 </div> 46 </div>
45 47
46 <script> 48 <script>
  49 +
  50 +
  51 + var timemm = 1000 * 30 ; //定时器 自动执行
  52 +
47 (function () { 53 (function () {
48 var modal = '#schedule-addsch-modal', 54 var modal = '#schedule-addsch-modal',
49 sch, stationRoutes, parks, information, carsArray, st_park_data,conf; 55 sch, stationRoutes, parks, information, carsArray, st_park_data,conf;
@@ -76,9 +82,8 @@ @@ -76,9 +82,8 @@
76 framework: 'uikit', 82 framework: 'uikit',
77 locale: 'zh_CN' 83 locale: 'zh_CN'
78 }); 84 });
79 - $("#form-s-t").val("大客流情况"); 85 + $("#form-s-t").val("站点遭遇大客流");
80 f.on('success.form.fv', function(e) { 86 f.on('success.form.fv', function(e) {
81 - debugger  
82 e.preventDefault(); 87 e.preventDefault();
83 $('[type=submit]', f).attr('disabled', 'disabled'); 88 $('[type=submit]', f).attr('disabled', 'disabled');
84 var data = $(this).serializeJSON(); 89 var data = $(this).serializeJSON();
@@ -97,6 +102,10 @@ @@ -97,6 +102,10 @@
97 }); 102 });
98 }); 103 });
99 } 104 }
  105 + //定时器启动开关判定条件0开 1关
  106 + if (sch.excuteStatus == 0 && sch.ljtype == "lin1"){
  107 + var sntts = setInterval(function(){leftTimer();},1000); //开始倒计时
  108 + }
100 109
101 110
102 $("#destroySelect").on('change',function(){ 111 $("#destroySelect").on('change',function(){
@@ -175,7 +184,9 @@ @@ -175,7 +184,9 @@
175 document.getElementById("nbbms").innerHTML=s; 184 document.getElementById("nbbms").innerHTML=s;
176 }); 185 });
177 186
178 - }); 187 +
  188 +
  189 +
179 190
180 //init-autoCom 191 //init-autoCom
181 $(modal).on('init-autoCom', '.add-sch-form', function () { 192 $(modal).on('init-autoCom', '.add-sch-form', function () {
@@ -403,7 +414,6 @@ @@ -403,7 +414,6 @@
403 }); 414 });
404 } 415 }
405 416
406 - //debugger  
407 array.sort(function (a, b) { 417 array.sort(function (a, b) {
408 if(a.code==information.carPark) 418 if(a.code==information.carPark)
409 return -1; 419 return -1;
@@ -466,6 +476,8 @@ @@ -466,6 +476,8 @@
466 open_modal(folder + '/yanshi.html', { 476 open_modal(folder + '/yanshi.html', {
467 }, {center: true, bgclose: false, modal: true});*/ 477 }, {center: true, bgclose: false, modal: true});*/
468 }, err); 478 }, err);
  479 + //手动提交的时候清除一下,防止二次提交
  480 + clearInterval(sntts);
469 } 481 }
470 482
471 function enableYjtkForm() { 483 function enableYjtkForm() {
@@ -523,8 +535,34 @@ @@ -523,8 +535,34 @@
523 }); 535 });
524 }); 536 });
525 537
  538 + //定时器
  539 + function leftTimer(){
  540 + getTimerstring(timemm ? timemm -= 1000 : 0);
  541 + if (!timemm){
  542 + addTwoWayZnddType.submit();
  543 + clearInterval(sntts);
  544 + $("#xztimes").html("已自动执行");
  545 + }
  546 + }
  547 + //倒计时时间
  548 + function getTimerstring(leftTime){
  549 + var days = checkTime(parseInt(leftTime / 1000 / 60 / 60 / 24 , 10)); //计算剩余的天数
  550 + var hours = checkTime(parseInt(leftTime / 1000 / 60 / 60 % 24 , 10)); //计算剩余的小时
  551 + var minutes = checkTime(parseInt(leftTime / 1000 / 60 % 60, 10));//计算剩余的分钟
  552 + var seconds = checkTime(parseInt(leftTime / 1000 % 60, 10));//计算剩余的秒数
  553 + $("#xztimes").html(seconds+"秒后将自动执行");
  554 + }
  555 +
  556 + });
  557 + function checkTime(i){ //将0-9的数字前面加上0,例1变为01
526 558
  559 + if(i<10)
  560 + {
  561 + i = "0" + i;
  562 + }
  563 + return i;
527 564
  565 + }
528 566
529 })(); 567 })();
530 </script> 568 </script>
src/main/resources/static/real_control_v2/zndd/type/sftz_1.html
@@ -251,7 +251,7 @@ @@ -251,7 +251,7 @@
251 <div class="uk-form-row"> 251 <div class="uk-form-row">
252 <label class="uk-form-label">实发时间</label> 252 <label class="uk-form-label">实发时间</label>
253 <div class="uk-form-controls"> 253 <div class="uk-form-controls">
254 - <input type="time" value="{{sch.sch.fcsj}}" name="fcsjActual"> 254 + <input type="time" value="{{sch.sch.fcsjActual != null ? sch.sch.fcsjActual : sch.sch.dfsj}}" name="fcsjActual">
255 </div> 255 </div>
256 </div> 256 </div>
257 </div> 257 </div>