Commit a8225e1d440a0e8cc550c73c6dc2be0eb90df7e9

Authored by 娄高锋
2 parents ccab97ee 0c0cb40a

Merge branch 'lggj' of http://61.169.120.202:8888/panzhaov5/bsth_control into lggj

Showing 28 changed files with 1276 additions and 217 deletions
src/main/java/com/bsth/XDApplication.java
... ... @@ -145,7 +145,7 @@ public class XDApplication implements CommandLineRunner {
145 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 151 sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
... ... @@ -193,7 +193,7 @@ public class XDApplication implements CommandLineRunner {
193 193 //安全驾驶
194 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 197 GpsDataLoaderThread.setFlag(-1);
198 198 /** 线调业务 */
199 199 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
... ... @@ -238,7 +238,7 @@ public class XDApplication implements CommandLineRunner {
238 238 //安全驾驶
239 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 242 GpsDataLoaderThread.setFlag(-1);
243 243 //dayOfSchedule.dataRecovery();
244 244 /** 线调业务 */
... ... @@ -260,7 +260,7 @@ public class XDApplication implements CommandLineRunner {
260 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 265 //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
266 266 sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
... ...
src/main/java/com/bsth/controller/lg_travel/RegionLineCarConterller.java 0 → 100644
  1 +package com.bsth.controller.lg_travel;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.lg_travel.RegionLineCar;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +/**
  9 + * 区域
  10 + */
  11 +
  12 +@RestController
  13 +@RequestMapping("regionLineCar")
  14 +public class RegionLineCarConterller extends BaseController<RegionLineCar, Long> {
  15 +
  16 +
  17 +}
... ...
src/main/java/com/bsth/controller/zndd/LoggerZnddController.java
... ... @@ -54,4 +54,15 @@ public class LoggerZnddController extends BaseController&lt;LoggerZndd, Integer&gt; {
54 54 public Map<String, Object> schTZSF(String line,String date,String endDate,String changType,String type){
55 55 return loggerZnddService.schTZSF(line,date,endDate,changType,type);
56 56 }
  57 +
  58 + /**
  59 + * 获取当前方向下的下一个班次
  60 + * @param id
  61 + * @return
  62 + */
  63 + @RequestMapping(value = "nextSch/{id}", method = RequestMethod.GET)
  64 + public ScheduleRealInfo nextSch(@PathVariable("id") Long id){
  65 + return loggerZnddService.nextSch(id);
  66 +
  67 + }
57 68 }
... ...
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
... ... @@ -117,8 +117,8 @@ public class CarOutInfoHandler {
117 117 //删除
118 118 jdbcTemplate.update("delete from bsth_t_clfcxxb");
119 119 //重新写入
120   - jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn)" +
121   - " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
  120 + jdbcTemplate.batchUpdate("insert into bsth_t_clfcxxb(rq, line_code, line_name, lp_name, lp_sn, dfsj, nbbm, cph, bc_type, end_station_name, updown, jGh, jName, remarks, sn, sch)" +
  121 + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() {
122 122 @Override
123 123 public void setValues(PreparedStatement ps, int i) throws SQLException {
124 124 ScheduleRealInfo sch = pstList.get(i);
... ... @@ -137,6 +137,7 @@ public class CarOutInfoHandler {
137 137 ps.setString(13, sch.getjName());
138 138 ps.setString(14, sch.getRemarks());
139 139 ps.setInt(15, sch.getFcpSn());
  140 + ps.setLong(16, sch.getId());
140 141 }
141 142  
142 143 @Override
... ...
src/main/java/com/bsth/data/kl/KlData.java
... ... @@ -6,9 +6,10 @@ import org.slf4j.Logger;
6 6 import org.slf4j.LoggerFactory;
7 7 import org.springframework.beans.factory.annotation.Autowired;
8 8 import org.springframework.beans.factory.annotation.Value;
9   -import org.springframework.scheduling.annotation.Scheduled;
10 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 15 * @author ym
... ... @@ -30,7 +31,7 @@ public class KlData {
30 31 @Value("${passengerFlow.url}")
31 32 private String url;
32 33  
33   - @Scheduled(cron = "0/10 * * * * ?")
  34 + /* @Scheduled(cron = "0/10 * * * * ?")
34 35 public void loadKl() {
35 36 Map<String,Kl> map= new HashMap<>();
36 37 List<Kl> list = klService.loadKl();
... ... @@ -40,7 +41,7 @@ public class KlData {
40 41 map.put(kl.getDeviceId(),kl);
41 42 }
42 43 KlData =map;
43   - }
  44 + }*/
44 45  
45 46 public static Kl getKl(String deviceId){
46 47 //return KlData.get( KlData.keySet().toArray()[0]);
... ...
src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -129,21 +129,21 @@ public class PilotReport {
129 129 public void yjbj(String nbbm,D80 d80){
130 130 try {
131 131 ScheduleRealInfo sch = null;
132   - if (d80.getSchId() == null){
133   - logger.info(nbbm+"-----车辆没有班次");
134   - return;
135   - }
  132 +
136 133 if (d80.getData().getStopNo() != null && !d80.getData().getStopNo().equals("")){
137 134 d80.setStationName(BasicData.stationCode2NameMap.get(d80.getData().getStopNo()));
138 135 }
139   -
140   - sch = dayOfSchedule.get(d80.getSchId());
141   - Long nextschid = dayOfSchedule.nextByLp(sch).getId();
142   - d80.setNextschId(nextschid);
  136 + if (d80.getSchId() != null){
  137 + sch = dayOfSchedule.get(d80.getSchId());
  138 + Long nextschid = dayOfSchedule.nextByLp(sch).getId();
  139 + d80.setNextschId(nextschid);
  140 + }
143 141 String url = systemParamService.getValue("url.yjbj")+"dataDockingApi/accident/saveAccident?";
144 142 url = url + "accidentTime=" + new Date().getTime() + "&nbbm=" + nbbm +"&requestCode=" +d80.getData().getRequestCode()
145   - +"&lineName=" +sch.getXlName()+"&jsy=" +sch.getjGh()+"&jsName=" +sch.getjName()+"&lon=" +d80.getData().getLon()+"&lat="+d80.getData().getLat();
146   -
  143 + +"&lon=" +d80.getData().getLon()+"&lat="+d80.getData().getLat();
  144 + if (sch != null){
  145 + url = url + "&lineName=" +sch.getXlName()+"&jsy=" +sch.getjGh()+"&jsName=" +sch.getjName();
  146 + }
147 147 logger.info("url===="+url);
148 148 StringBuilder sb = HttpClientUtils.get(url);
149 149  
... ...
src/main/java/com/bsth/data/zndd/AutomaticSch.java
... ... @@ -8,16 +8,23 @@ import com.bsth.data.adjg.domain.LargeGap;
8 8 import com.bsth.data.directive.DayOfDirectives;
9 9 import com.bsth.data.gpsdata_v2.GpsRealData;
10 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 13 import com.bsth.data.schedule.DayOfSchedule;
12 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 17 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
14 18 import com.bsth.entity.directive.D60;
15 19 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  20 +import com.bsth.entity.zndd.StationPeopleLogger;
16 21 import com.bsth.entity.zndd.ZnddYuAn;
17 22 import com.bsth.repository.StationRouteRepository;
18 23 import com.bsth.service.directive.DirectiveService;
19 24 import com.bsth.service.realcontrol.ScheduleRealInfoService;
  25 +import com.bsth.service.zndd.ZnddLoggerService;
20 26 import com.bsth.service.zndd.ZnddYuAnService;
  27 +import com.bsth.util.DateUtils;
21 28 import com.bsth.util.HttpClientUtils;
22 29 import com.google.gson.Gson;
23 30 import org.apache.commons.lang3.StringUtils;
... ... @@ -60,17 +67,24 @@ public class AutomaticSch {
60 67 @Autowired
61 68 ZnddYuAnService znddYuAnService;
62 69  
  70 + @Autowired
  71 + ZnddLoggerService znddLoggerService;
  72 + @Autowired
  73 + SchEditInfoService schEditInfoService;
  74 +
  75 +
63 76 private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
  77 + private static SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd");
64 78 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
65 79  
66 80 private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.DFSJ2();
67 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 85 //http://10.10.200.201:8083/wxk-prod-api/service-api/lggj/schedule/drByInfo 维修接口
72 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 90 public void mz(){
... ... @@ -90,7 +104,7 @@ public class AutomaticSch {
90 104 //大间隔的情况
91 105 public void dfTz(int k ){
92 106 try{
93   - StringBuilder sb = HttpClientUtils.get(urldkl /*+ sdfMonth.format(new Date())*/);
  107 + StringBuilder sb = HttpClientUtils.get(urldkl + sdfMonth.format(new Date()));
94 108 if (sb == null)
95 109 return;
96 110 JSONObject obj = JSON.parseObject(sb.toString());
... ... @@ -103,20 +117,35 @@ public class AutomaticSch {
103 117 }else {
104 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 (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 151 }catch (Exception e){
... ... @@ -154,7 +183,22 @@ public class AutomaticSch {
154 183 //1。一直没收到gps
155 184 //2.gps长时间离线的情况下
156 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 + if (ri.getRecogTime() != null && ri.getRecogTime().getTime() > System.currentTimeMillis() - 300000) {
  192 + //最新的rfid是出站状态
  193 + if (ri.getNbbm().equals(sr.getClZbh())){
  194 + sfsj = sdfHHmm.format(ri.getInoutStation().getTimestamp());
  195 + }
  196 + if (ri.getNbbm().equals(sr.getClZbh()) && ri.getInoutStation().getInout() == 0) {
  197 + sfsj = sdfHHmm.format(ri.getInoutStation().getTimestamp());
  198 + }
  199 + }
  200 + }
  201 + sr.setFcsjActual(sfsj);
158 202 ts(addStationPeople(sr, "SFTZ_1", 0L));
159 203 Gson gson = new Gson();
160 204 String chartStr = gson.toJsonTree(sr).toString();
... ... @@ -190,8 +234,7 @@ public class AutomaticSch {
190 234 for (ScheduleRealInfo t : oldSchDateList){
191 235 // 发车误点
192 236 if (t.getDfsj() != null && t.getFcsjActual() != null
193   - && (t.getBcType().equals("normal") || t.getBcType().equals("region"))
194   - && (StringUtils.isEmpty(t.getRemarks()) || t.getRemarks().equals("_智能调度-异常实发"))) {
  237 + && (t.getBcType().equals("normal") || t.getBcType().equals("region"))) {
195 238  
196 239 long sjc = t.getFcsjActualTime() - t.getDfsjT();
197 240 long time = System.currentTimeMillis();//当前时间
... ... @@ -201,6 +244,16 @@ public class AutomaticSch {
201 244 if (sjc >= -1 * 60 * 1000 && sjc <= 3 * 60 * 1000) {
202 245 continue;
203 246 } else {
  247 + //备注不为null时,查询是否有调度操作记录
  248 + List<SchEditInfo> seiList = new ArrayList<>();
  249 + if (!StringUtils.isEmpty(t.getRemarks())){
  250 + Map msp = new HashMap();
  251 + msp.put("schId_eq",t.getId());
  252 + seiList = (List<SchEditInfo>) schEditInfoService.list(msp);
  253 + //有操作记录的跳过
  254 + if (seiList.size() > 0)
  255 + continue;
  256 + }
204 257 //异常实发
205 258 ts(addStationPeople(t, "YCSF", 0l));
206 259 Gson gson = new Gson();
... ... @@ -252,8 +305,7 @@ public class AutomaticSch {
252 305 String lineCode;
253 306 for (Map.Entry<String, String> ts : lineMap.entrySet()) {
254 307 lineCode = ts.getKey();
255   - if(isLines(lineCode)) {
256   -
  308 + /* if(isLines(lineCode)) {*/
257 309 oldSchDateList = dayOfSchedule.findByLineCode(lineCode);
258 310 for (ScheduleRealInfo t : oldSchDateList) {
259 311 //指令重发
... ... @@ -276,7 +328,7 @@ public class AutomaticSch {
276 328 //下发时间未超过5分钟返回
277 329 }
278 330 }
279   - }
  331 + /*}*/
280 332 }
281 333 }
282 334 }catch (Exception e){
... ... @@ -298,8 +350,8 @@ public class AutomaticSch {
298 350 if(sch.getDfsjT() > t)
299 351 break;
300 352  
301   - /*if(sch.isLate()) //演示使用 不跳过
302   - continue;*/
  353 + if(sch.isLate()) //演示使用 不跳过
  354 + continue;
303 355  
304 356 if(sch.getStatus() == 0
305 357 && StringUtils.isEmpty(sch.getFcsjActual())){
... ... @@ -333,29 +385,20 @@ public class AutomaticSch {
333 385  
334 386  
335 387 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 388  
  389 + //储存日志
  390 + StationPeopleLogger splogger = new StationPeopleLogger();
  391 + splogger.setType(m.get("type").toString());
  392 + splogger.setLineName(m.get("lineName").toString());
  393 + splogger.setLineCode(m.get("lineCode").toString());
  394 + splogger.setRq(sdf.format(new Date()));
  395 + splogger.setRqStr(m.get("rqStr").toString());
  396 + splogger.setXlDir(m.get("xlDir").toString());
  397 + splogger.setFcsj(m.get("fcsj").toString());
  398 + splogger.setClZbh(m.get("clzbh").toString());
  399 + znddLoggerService.save(splogger);
  400 +
  401 + outEntrance.Znddjk(m);//推送
359 402 }
360 403  
361 404  
... ...
src/main/java/com/bsth/data/zndd/OutEntrance.java
... ... @@ -6,10 +6,12 @@ import com.bsth.common.ResponseCode;
6 6 import com.bsth.data.BasicData;
7 7 import com.bsth.data.schedule.DayOfSchedule;
8 8 import com.bsth.data.schedule.ScheduleComparator;
  9 +import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
9 10 import com.bsth.entity.DKLInfo;
10 11 import com.bsth.entity.realcontrol.ScheduleRealInfo;
11   -import com.bsth.entity.zndd.StationPeopleLogger;
12 12 import com.bsth.entity.zndd.StationSignsLogger;
  13 +import com.bsth.entity.zndd.znddStatus;
  14 +import com.bsth.repository.zndd.ZnddStatusRepository;
13 15 import com.bsth.service.DKLInfoService;
14 16 import com.bsth.util.HttpClientUtils;
15 17 import com.bsth.util.SignUtils;
... ... @@ -75,6 +77,12 @@ public class OutEntrance {
75 77 @Autowired
76 78 JdbcTemplate jdbcTemplate;
77 79  
  80 + @Autowired
  81 + ZnddStatusRepository znddStatusRepository;
  82 +
  83 + @Autowired
  84 + BasicData basicData;
  85 +
78 86 //调度屏小程序接口。
79 87 @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
80 88 public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) {
... ... @@ -112,8 +120,33 @@ public class OutEntrance {
112 120 if(!"畅通".equals(trafficStatus)){
113 121 s=road+trafficStatus+",";
114 122 }
115   - rtn.put("message",s+"车辆预计还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
  123 + rtn.put("message",s+"亲爱的乘客,我们的调度员已接收到通知,车辆预计还有"+dzList.get(0).get("sj")+"抵达,请稍等片刻");
116 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 151 List<ScheduleRealInfo> rs = dayOfSchedule.findByLineAndUpDown(ssLogger.getLineCode(),Integer.parseInt(ssLogger.getDir()));
119 152 if(rs.size()>0){
... ... @@ -131,7 +164,7 @@ public class OutEntrance {
131 164 }
132 165 }
133 166 if(sjtext!=null){
134   - rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待");
  167 + rtn.put("message","亲爱的乘客,我们的调度员已接收到通知,车辆将按照计划,在"+sjtext+"准时发车,请稍等片刻");
135 168 }else {
136 169 rtn.put("message","当日运营已结束");
137 170 }
... ... @@ -159,6 +192,23 @@ public class OutEntrance {
159 192 rtn.put("status", "验证失败");
160 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 212 String num=jsonObject.getString("num");
163 213 int count=automaticSch.getPenum("DKL","0");
164 214 if(Integer.parseInt(num)<count){
... ... @@ -198,6 +248,7 @@ public class OutEntrance {
198 248 m.put("lineName",lineName);
199 249 m.put("num",num);
200 250 m.put("xlDir",dir);
  251 + m.put("excuteStatus",excuteStatus);
201 252 List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(lineCode,Integer.parseInt(dir));
202 253 List<ScheduleRealInfo> sl=new ArrayList<>();
203 254 for (ScheduleRealInfo scheduleRealInfo : srList) {//筛选出运营班次
... ... @@ -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 329 * 保存base64图片
... ...
src/main/java/com/bsth/data/zndd/carMonitor.java
... ... @@ -81,6 +81,7 @@ public class carMonitor {
81 81 map.put("lat",responseEle.elementTextTrim("lat"));
82 82 map.put("nbbm",responseEle.elementTextTrim("insidecode"));
83 83 map.put("road",responseEle.elementTextTrim("road"));
  84 + map.put("schId",responseEle.elementTextTrim("schId"));
84 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 import java.io.Serializable;
8 8  
9 9 @Entity
10   -@Table(name = "bsth_c_t_station_people_logger") //智能调度记录查询
  10 +@Table(name = "bsth_c_t_station_people_logger") //智能调度记录检测
11 11 @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
12 12 public class StationPeopleLogger implements Serializable {
13 13 // ID
... ... @@ -19,8 +19,10 @@ public class StationPeopleLogger implements Serializable {
19 19 //线路名称
20 20 private String lineName;
21 21 //站点code
  22 + @Transient
22 23 private String station;
23 24 //站点名称
  25 + @Transient
24 26 private String stationName;
25 27 //日期
26 28 private String rqStr;
... ... @@ -31,8 +33,19 @@ public class StationPeopleLogger implements Serializable {
31 33 //上下行
32 34 private String xlDir;
33 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 50 public void setId(Long id) {
38 51 this.id = id;
... ... @@ -90,8 +103,12 @@ public class StationPeopleLogger implements Serializable {
90 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 114 public String getStation() {
... ... @@ -110,8 +127,5 @@ public class StationPeopleLogger implements Serializable {
110 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/entity/zndd/znddStatus.java
... ... @@ -23,6 +23,16 @@ public class znddStatus {
23 23  
24 24 private String name;
25 25  
  26 + //大客流是否自动执行班次 0开 1关 null关
  27 + private String excuteStatus;
  28 +
  29 + public String getExcuteStatus() {
  30 + return excuteStatus;
  31 + }
  32 +
  33 + public void setExcuteStatus(String excuteStatus) {
  34 + this.excuteStatus = excuteStatus;
  35 + }
26 36  
27 37 public String getType() {
28 38 return type;
... ...
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/impl/StationRouteServiceImpl.java
... ... @@ -710,6 +710,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
710 710 String sleepStr = "";
711 711 // 方向
712 712 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
  713 + if (directions == 1) {
  714 + stationName = stationName.replaceAll("\\(起点站\\)", "").replaceAll("\\(终点站\\)", "").replaceAll("(起点站)", "").replaceAll("(终点站)", "");
  715 + }
713 716 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
714 717 List<Object[]> sobje = sectionRouteRepository.sectionRouteVector(lineId,directions);
715 718 if(sobje.size()==1) {
... ... @@ -799,6 +802,9 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
799 802 String sleepStr = "";
800 803 // 方向
801 804 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
  805 + if (directions == 1) {
  806 + stationName = stationName.replaceAll("\\(起点站\\)", "").replaceAll("\\(终点站\\)", "").replaceAll("(起点站)", "").replaceAll("(终点站)", "");
  807 + }
802 808 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
803 809 List<Object[]> sobje = sectionRouteRepository.sectionRouteVector(lineId,directions);
804 810 if(sobje.size()==1) {
... ...
src/main/java/com/bsth/service/zndd/LoggerZnddService.java
... ... @@ -23,4 +23,6 @@ public interface LoggerZnddService extends BaseService&lt;LoggerZndd, Integer&gt; {
23 23 String LineUserAll(@RequestParam Integer userId);
24 24  
25 25 Map<String, Object> schTZSF(String line,String date,String endDate,String changType,String type);
  26 +
  27 + ScheduleRealInfo nextSch(Long id);
26 28 }
... ...
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
1 1 package com.bsth.service.zndd.impl;
2 2  
3 3 import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.JSONObject;
5 4 import com.bsth.common.ResponseCode;
6 5 import com.bsth.controller.realcontrol.dto.DfsjChange;
7 6 import com.bsth.data.schedule.DayOfSchedule;
... ... @@ -136,7 +135,7 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
136 135 int ms = mis[i];
137 136 //未发车时 才可改变
138 137 if (info.getFcsjActual() == null || info.getFcsjActual().equals("")){
139   - 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)); //延后几分钟
140 139 cl.setSchId(info.getId());
141 140 cl.setOld_dfsj(info.getDfsj());
142 141 cl.setNew_dfsj(dfsj);
... ... @@ -170,43 +169,78 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
170 169 lines.add(map.get("xlbm").toString());
171 170 }
172 171 }
173   - List<String> nbbms=new ArrayList<>();
174   - List<String> jghs=new ArrayList<>();
175   - List<String> jNames=new ArrayList<>();
  172 + List<Map<String,String>> schs=new ArrayList<>();
  173 + LocalTime localTime=LocalTime.now().plusHours(1);
  174 + LocalTime now=LocalTime.now();
  175 + DateTimeFormatter dtf=DateTimeFormatter.ofPattern("HH:mm");
176 176 for (String lineCode : lines) {
177 177 Set<String> set = dayOfSchedule.findCarByLineCode(lineCode);
178   - LocalTime localTime=LocalTime.now().plusHours(1);
179   - DateTimeFormatter dtf=DateTimeFormatter.ofPattern("HH:mm");
180 178 for (String nbbm : set) {
181 179 ScheduleRealInfo s=dayOfSchedule.executeCurr(nbbm);//当前执行班次
182 180 if(s==null){//当日班次执行完毕
183 181 List<ScheduleRealInfo> list=dayOfSchedule.findByNbbm(nbbm);
184 182 if(list.size()>0){
185   - ScheduleRealInfo s2=list.get(list.size()-1);//最后一个班次
186   - nbbms.add(s2.getClZbh());
187   - jghs.add(s2.getjGh());
188   - jNames.add(s2.getjName());
  183 + ScheduleRealInfo s2=list.get(list.size()-1);//最后一个班次\
  184 + if(s2.getZdsjActual()!=null && LocalTime.parse(s2.getZdsjActual(),dtf).isBefore(now)){
  185 + Map<String,String> schMap = new HashMap<>();
  186 + schMap.put("nbbm",s2.getClZbh());
  187 + schMap.put("jgh",s2.getjGh());
  188 + schMap.put("jName",s2.getjName());
  189 + schMap.put("zdsjActual",s2.getZdsjActual());
  190 + System.out.println(s2.getClZbh()+s2.getZdsjActual()+lineCode);
  191 + schs.add(schMap);
  192 + }
189 193 }
190 194 }else {//1小时内是否有待执行班次
191 195 LocalTime fcsj=LocalTime.parse(s.getFcsj(),dtf);
192 196 if(fcsj.isAfter(localTime)){
193   - nbbms.add(s.getClZbh());
194   - jghs.add(s.getjGh());
195   - jNames.add(s.getjName());
  197 + //查询上一个班次
  198 + ScheduleRealInfo s2=dayOfSchedule.prev(s);
  199 + if(s.getZdsjActual()!=null && LocalTime.parse(s2.getZdsjActual(),dtf).isBefore(now)){
  200 + Map<String,String> schMap = new HashMap<>();
  201 + schMap.put("nbbm",s2.getClZbh());
  202 + schMap.put("jgh",s2.getjGh());
  203 + schMap.put("jName",s2.getjName());
  204 + schMap.put("zdsjActual",s2.getZdsjActual());
  205 + System.out.println(s2.getClZbh()+s2.getZdsjActual()+lineCode);
  206 + schs.add(schMap);
  207 + }
196 208 }
197 209 }
198 210 }
199 211 }
  212 + Collections.sort(schs, new Comparator<Map<String, String>>(){
  213 + public int compare(Map<String, String> o1, Map<String, String> o2) {
  214 + String zdsjActual1 = o1.get("zdsjActual");
  215 + String zdsjActual2 = o2.get("zdsjActual");
  216 + return zdsjActual2.compareTo(zdsjActual1);
  217 + }
  218 +
  219 + });
200 220 StringBuffer sb=new StringBuffer();
201 221 String kscl="";
202   - if(nbbms.size()>0){
203   - sch.setClZbh(nbbms.get(0));
204   - sch.setjGh(jghs.get(0));
205   - sch.setjName(jNames.get(0));
206   - int size =nbbms.size()>10?9:nbbms.size();
  222 + List<Map<String, String>> schs2 = new ArrayList<>();
  223 +
  224 + // 创建用于去重的 Set<Map>
  225 + Set<Map<String, String>> set = new HashSet<>();
  226 + // 遍历原始的 List<Map>
  227 + for (Map<String, String> map : schs) {
  228 + // 创建一个新的 Map 用于存储合并去重后的结果
  229 + Map<String, String> newMap = new HashMap<>(map);
  230 + // 如果新的 Map 成功添加到 Set 中,说明是一个新的 Map,将其添加到结果 List<Map> 中
  231 + if (set.add(newMap)) {
  232 + schs2.add(newMap);
  233 + }
  234 + }
  235 + if(schs2.size()>0){
  236 + sch.setClZbh(schs2.get(0).get("nbbm"));
  237 + sch.setjGh(schs2.get(0).get("jgh"));
  238 + sch.setjName(schs2.get(0).get("jName"));
  239 + int size =schs2.size()>8?8:schs2.size();
207 240 for (int i = 0; i < size; i++) {
208   - sb.append(nbbms.get(i)+"/");
209   - sb.append(jNames.get(i)+",");
  241 + sb.append(schs2.get(i).get("nbbm")+"/");
  242 + sb.append(schs2.get(i).get("jName")+"/");
  243 + sb.append(schs2.get(i).get("zdsjActual")+",");
210 244 }
211 245 kscl=sb.toString().substring(0,sb.length()-1);
212 246 }
... ... @@ -304,4 +338,9 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
304 338 }
305 339 return rs;
306 340 }
  341 +
  342 +
  343 + public ScheduleRealInfo nextSch(Long id){
  344 + return dayOfSchedule.next(dayOfSchedule.get(id));
  345 + }
307 346 }
... ...
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/application-prod.properties
... ... @@ -40,4 +40,7 @@ sso.http.url.auth= http://10.10.200.142:9112/prod-api/system/utilitySystem/check
40 40 dc.imgurl= /home/control/klimg
41 41 dc.profile= profile
42 42  
  43 +baidu.ak=AYiBOs3f9qBQFhdKFsaboX6CfObmKwRP
  44 +passengerFlow.url = http://192.168.168.32:9999/images/
  45 +
43 46 electricity.importFile.path= /home/control/elecImportFile
... ...
src/main/resources/static/pages/permission/user/edit.html
... ... @@ -113,7 +113,7 @@
113 113 $("#agencies").attr('value',obj.agencies);
114 114 $("#jobCode").attr('value',obj.jobCode);
115 115 $("#realName").attr('value',obj.realName);
116   - $("#lastPwdDate").attr('value',obj.lastPwdDate);
  116 + $("#lastPwdDate").attr('value',moment(obj.lastPwdDate).format('YYYY-MM-DD'));
117 117 $("#pwdValidPeriod").attr('value',obj.pwdValidPeriod);
118 118 /*$get('/role/all',null,function(result){
119 119 $.each(result,function(i,r){
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -2265,7 +2265,7 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] {
2265 2265 }
2266 2266 .warning-color {
2267 2267 border: 1px solid #e79a00;
2268   - background-color: #7ecbe4;
  2268 + background-color: #0b3b5e;
2269 2269 font-size: 18px;
2270 2270 }
2271 2271  
... ... @@ -2313,7 +2313,7 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] {
2313 2313 }
2314 2314  
2315 2315 .multi_plat_config .timer{
2316   - background-color: #0575c3ba;
  2316 + background-color: #115281;
2317 2317 font-size: 15px;
2318 2318 color: white;
2319 2319 text-align: center;
... ... @@ -2329,4 +2329,14 @@ g.gps-wrap rect.twinkle[updown=&quot;1&quot;] {
2329 2329 left: 40%;
2330 2330 top: 20%;
2331 2331 background: rgba(255, 255, 255, 0.5);
  2332 +}
  2333 +.dkl_msg_text{
  2334 + margin-top: 6px;
  2335 + border: 1px solid #b5afb1;
  2336 +}
  2337 +.zndd_text_input_color{
  2338 + border-color: #8ec73b!important;
  2339 + background: #fafff2!important;
  2340 + color: #659f13!important;
  2341 +
2332 2342 }
2333 2343 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_normal_znddType.html 0 → 100644
  1 +<!-- 临加班次form -->
  2 +<script id="add_normal_sch-form-temp" type="text/html">
  3 + <form class="uk-form uk-form-horizontal add-sch-form">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-2">
  6 + <div class="uk-form-row">
  7 + <label class="uk-form-label">班次类型</label>
  8 + <div class="uk-form-controls">
  9 + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}"
  10 + data-group=ScheduleType></select>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + <div class="uk-width-1-2">
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label">上下行</label>
  17 + <div class="uk-form-controls">
  18 + <select name="xlDir">
  19 + <option value="0">上行</option>
  20 + <option value="1">下行</option>
  21 + </select>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + </div>
  26 + <div class="uk-grid">
  27 + <div class="uk-width-1-2">
  28 + <div class="uk-form-row">
  29 + <label class="uk-form-label">起点站</label>
  30 + <div class="uk-form-controls">
  31 + <select name="qdzCode">
  32 + </select>
  33 + </div>
  34 + </div>
  35 + </div>
  36 + <div class="uk-width-1-2">
  37 + <div class="uk-form-row">
  38 + <label class="uk-form-label">终点站</label>
  39 + <div class="uk-form-controls">
  40 + <select name="zdzCode">
  41 + </select>
  42 + </div>
  43 + </div>
  44 + </div>
  45 + </div>
  46 + <div class="uk-grid">
  47 + <div class="uk-width-1-2">
  48 + <div class="uk-form-row">
  49 + <label class="uk-form-label">开始时间</label>
  50 + <div class="uk-form-controls">
  51 + <input type="time" class="zndd_text_input_color" value="{{zdsjActual==null?zdsj:zdsjActual}}" name="fcsj" required>
  52 + </div>
  53 + </div>
  54 + </div>
  55 + <div class="uk-width-1-2">
  56 + <div class="uk-form-row">
  57 + <label class="uk-form-label">结束时间</label>
  58 + <div class="uk-form-controls">
  59 + <input type="time" class="zndd_text_input_color" name="zdsj" required>
  60 + </div>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + <div class="uk-grid">
  65 + <div class="uk-width-1-2">
  66 + <div class="uk-form-row">
  67 + <label class="uk-form-label">车辆</label>
  68 + <div class="uk-form-controls">
  69 + <div class="uk-autocomplete uk-form car-autocom">
  70 + <input type="text" class="zndd_text_input_color" value="{{clZbh}}" name="clZbh" required>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + <div class="uk-width-1-2">
  76 + <div class="uk-form-row">
  77 + <label class="uk-form-label">里程</label>
  78 + <div class="uk-form-controls">
  79 + <input type="text" class="zndd_text_input_color" name="jhlc" value="{{jhlc}}" max=400 data-fv-lessthan-inclusive="false"
  80 + required>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 + <div class="uk-grid">
  86 + <div class="uk-width-1-2">
  87 + <div class="uk-form-row">
  88 + <label class="uk-form-label">驾驶员</label>
  89 + <div class="uk-form-controls">
  90 + <div class="uk-autocomplete uk-form jsy-autocom">
  91 + <input type="text" class="zndd_text_input_color" value="{{jGh}}/{{jName}}" name="jsy" required>
  92 + </div>
  93 + </div>
  94 + </div>
  95 + </div>
  96 + <div class="uk-width-1-2">
  97 + <div class="uk-form-row">
  98 + <label class="uk-form-label">售票员</label>
  99 + <div class="uk-form-controls">
  100 + <div class="uk-autocomplete uk-form spy-autocom">
  101 + <input type="text" name="spy" value="{{sGh}}/{{sName}}">
  102 + </div>
  103 + </div>
  104 + </div>
  105 + </div>
  106 + </div>
  107 + <div class="uk-grid">
  108 + <div class="uk-width-1-2">
  109 + <div class="uk-form-row">
  110 + <label class="uk-form-label">路牌</label>
  111 + <div class="uk-form-controls">
  112 + <input type="text" value="{{lpName}}" name="lpName" required>
  113 + </div>
  114 + </div>
  115 + </div>
  116 + </div>
  117 + <div class="uk-grid">
  118 + <div class="uk-width-1-1">
  119 + <div class="uk-form-row">
  120 + <label class="uk-form-label">备注</label>
  121 + <div class="uk-form-controls">
  122 + <div class="uk-autocomplete uk-form remarks-autocom">
  123 + <input type="text" name="remarks">
  124 + </div>
  125 + </div>
  126 + </div>
  127 + </div>
  128 + </div>
  129 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  130 + <button type="button" class="uk-button uk-modal-close">取消</button>
  131 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存
  132 + </button>
  133 + </div>
  134 + </form>
  135 +</script>
  136 +<script>
  137 + (function () {
  138 + var wrap = '#schedule-addsch-modal .normalCont', sch, nf, submitFun;
  139 +
  140 + $(wrap).on('init', function (e, data) {
  141 + e.stopPropagation();
  142 + sch = data.sch;
  143 + submitFun = data.submitFun;
  144 +
  145 + nf = addForm();
  146 + //提交
  147 + nf.on('success.form.fv', function (e) {
  148 + e.preventDefault();
  149 +
  150 + disabled_submit_btn(nf);
  151 + var data = nf.serializeJSON();
  152 + submitFun(data, function (rs) {
  153 + //前端数据更新
  154 + gb_schedule_table.insertSchedule(rs.t, rs.ts);
  155 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t});
  156 + try {
  157 + if(rs.t.bcType=='in' || rs.t.bcType=='out')
  158 + gb_data_basic.reload_stat_park_data();
  159 + }catch (e){
  160 + console.log(e);}
  161 + UIkit.modal('#schedule-addsch-modal').hide();
  162 + //更新路牌公里统计面板
  163 + gb_schedule_table.showLpMileageTipBySch(rs.t);
  164 + }, function () {
  165 + enable_submit_btn(nf);
  166 + });
  167 + });
  168 + });
  169 +
  170 + function addForm() {
  171 + var htmlStr = template('add_normal_sch-form-temp', sch);
  172 + var f = $(htmlStr);
  173 + $(wrap).append(f);
  174 + //字典转换
  175 + dictionaryUtils.transformDom($('.nt-dictionary', f));
  176 + //validation
  177 + f.formValidation({framework: 'uikit', locale: 'zh_CN'});
  178 + //autocomp
  179 + f.trigger('init-autoCom');
  180 +
  181 + $f('bcType', f).trigger('change');
  182 + return f;
  183 + }
  184 +
  185 + function $f(name, f) {
  186 + return $('[name=' + name + ']', f);
  187 + }
  188 + })();
  189 +</script>
0 190 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch_v2/add_two_way_znddType.html 0 → 100644
  1 +<!-- 线路上往返临加班次 -->
  2 +<script id="add_toAndFro_sch-form-temp" type="text/html">
  3 + <form class="uk-form uk-form-horizontal add-sch-form one_form">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-2">
  6 + <div class="uk-form-row">
  7 + <label class="uk-form-label">班次类型</label>
  8 + <div class="uk-form-controls">
  9 + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}"
  10 + data-group=ScheduleType></select>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + <div class="uk-width-1-2">
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label">上下行</label>
  17 + <div class="uk-form-controls">
  18 + <select name="xlDir">
  19 + <option value="0">上行</option>
  20 + <option value="1">下行</option>
  21 + </select>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + </div>
  26 + <div class="uk-grid">
  27 + <div class="uk-width-1-2">
  28 + <div class="uk-form-row">
  29 + <label class="uk-form-label">起点站</label>
  30 + <div class="uk-form-controls">
  31 + <select name="qdzCode" >
  32 + </select>
  33 + </div>
  34 + </div>
  35 + </div>
  36 + <div class="uk-width-1-2">
  37 + <div class="uk-form-row">
  38 + <label class="uk-form-label">终点站</label>
  39 + <div class="uk-form-controls">
  40 + <select name="zdzCode" >
  41 + </select>
  42 + </div>
  43 + </div>
  44 + </div>
  45 + </div>
  46 + <div class="uk-grid">
  47 + <div class="uk-width-1-2">
  48 + <div class="uk-form-row">
  49 + <label class="uk-form-label">开始时间</label>
  50 + <div class="uk-form-controls">
  51 + <input type="time" class="zndd_text_input_color" value="{{zdsj}}" name="fcsj" required>
  52 + </div>
  53 + </div>
  54 + </div>
  55 + <div class="uk-width-1-2">
  56 + <div class="uk-form-row">
  57 + <label class="uk-form-label">结束时间</label>
  58 + <div class="uk-form-controls">
  59 + <input type="time" class="zndd_text_input_color" name="zdsj" required>
  60 + </div>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + <div class="uk-grid">
  65 + <div class="uk-width-1-2">
  66 + <div class="uk-form-row">
  67 + <label class="uk-form-label">车辆</label>
  68 + <div class="uk-form-controls">
  69 + <div class="uk-autocomplete uk-form car-autocom">
  70 + <input type="text" class="zndd_text_input_color" value="{{clZbh}}" name="clZbh" required>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + <div class="uk-width-1-2">
  76 + <div class="uk-form-row">
  77 + <label class="uk-form-label">里程</label>
  78 + <div class="uk-form-controls">
  79 + <input type="text" name="jhlc" class="zndd_text_input_color" value="{{jhlc}}" max=400 data-fv-lessthan-inclusive="false"
  80 + required>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 + <div class="uk-grid">
  86 + <div class="uk-width-1-2">
  87 + <div class="uk-form-row">
  88 + <label class="uk-form-label">驾驶员</label>
  89 + <div class="uk-form-controls">
  90 + <div class="uk-autocomplete uk-form jsy-autocom">
  91 + <input type="text" class="zndd_text_input_color" value="{{jGh}}/{{jName}}" name="jsy" required>
  92 + </div>
  93 + </div>
  94 + </div>
  95 + </div>
  96 + <div class="uk-width-1-2">
  97 + <div class="uk-form-row">
  98 + <label class="uk-form-label">售票员</label>
  99 + <div class="uk-form-controls">
  100 + <div class="uk-autocomplete uk-form spy-autocom">
  101 + <input type="text" name="spy" value="{{sGh}}/{{sName}}">
  102 + </div>
  103 + </div>
  104 + </div>
  105 + </div>
  106 + </div>
  107 + <div class="uk-grid">
  108 + <div class="uk-width-1-2">
  109 + <div class="uk-form-row">
  110 + <label class="uk-form-label">路牌</label>
  111 + <div class="uk-form-controls">
  112 + <input type="text" value="{{lpName}}" name="lpName" required>
  113 + </div>
  114 + </div>
  115 + </div>
  116 + </div>
  117 + <div class="uk-grid">
  118 + <div class="uk-width-1-1">
  119 + <div class="uk-form-row">
  120 + <label class="uk-form-label">备注</label>
  121 + <div class="uk-form-controls">
  122 + <div class="uk-autocomplete uk-form remarks-autocom">
  123 + <input type="text" name="remarks">
  124 + </div>
  125 + </div>
  126 + </div>
  127 + </div>
  128 + </div>
  129 + </form>
  130 + <hr style="margin-top: 35px;">
  131 + <form class="uk-form uk-form-horizontal add-sch-form two_form">
  132 + <div class="uk-grid">
  133 + <div class="uk-width-1-2">
  134 + <div class="uk-form-row">
  135 + <label class="uk-form-label">班次类型</label>
  136 + <div class="uk-form-controls">
  137 + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}"
  138 + data-group=ScheduleType></select>
  139 + </div>
  140 + </div>
  141 + </div>
  142 + <div class="uk-width-1-2">
  143 + <div class="uk-form-row">
  144 + <label class="uk-form-label">上下行</label>
  145 + <div class="uk-form-controls">
  146 + <select name="xlDir">
  147 + <option value="0">上行</option>
  148 + <option value="1">下行</option>
  149 + </select>
  150 + </div>
  151 + </div>
  152 + </div>
  153 + </div>
  154 + <div class="uk-grid">
  155 + <div class="uk-width-1-2">
  156 + <div class="uk-form-row">
  157 + <label class="uk-form-label">起点站</label>
  158 + <div class="uk-form-controls">
  159 + <select name="qdzCode" >
  160 + </select>
  161 + </div>
  162 + </div>
  163 + </div>
  164 + <div class="uk-width-1-2">
  165 + <div class="uk-form-row">
  166 + <label class="uk-form-label">终点站</label>
  167 + <div class="uk-form-controls">
  168 + <select name="zdzCode" >
  169 + </select>
  170 + </div>
  171 + </div>
  172 + </div>
  173 + </div>
  174 + <div class="uk-grid">
  175 + <div class="uk-width-1-2">
  176 + <div class="uk-form-row">
  177 + <label class="uk-form-label">开始时间</label>
  178 + <div class="uk-form-controls">
  179 + <input type="time" class="zndd_text_input_color" value="{{zdsj}}" name="fcsj" required>
  180 + </div>
  181 + </div>
  182 + </div>
  183 + <div class="uk-width-1-2">
  184 + <div class="uk-form-row">
  185 + <label class="uk-form-label">结束时间</label>
  186 + <div class="uk-form-controls">
  187 + <input type="time"class="zndd_text_input_color" name="zdsj" required>
  188 + </div>
  189 + </div>
  190 + </div>
  191 + </div>
  192 + <div class="uk-grid">
  193 + <div class="uk-width-1-2">
  194 + <div class="uk-form-row">
  195 + <label class="uk-form-label">车辆</label>
  196 + <div class="uk-form-controls">
  197 + <div class="uk-autocomplete uk-form car-autocom">
  198 + <input type="text" class="zndd_text_input_color" value="{{clZbh}}" name="clZbh" required>
  199 + </div>
  200 + </div>
  201 + </div>
  202 + </div>
  203 + <div class="uk-width-1-2">
  204 + <div class="uk-form-row">
  205 + <label class="uk-form-label">里程</label>
  206 + <div class="uk-form-controls">
  207 + <input type="text" class="zndd_text_input_color" name="jhlc" value="{{jhlc}}" max=400 data-fv-lessthan-inclusive="false"
  208 + required>
  209 + </div>
  210 + </div>
  211 + </div>
  212 + </div>
  213 + <div class="uk-grid">
  214 + <div class="uk-width-1-2">
  215 + <div class="uk-form-row">
  216 + <label class="uk-form-label">驾驶员</label>
  217 + <div class="uk-form-controls">
  218 + <div class="uk-autocomplete uk-form jsy-autocom">
  219 + <input type="text" class="zndd_text_input_color" value="{{jGh}}/{{jName}}" name="jsy" required>
  220 + </div>
  221 + </div>
  222 + </div>
  223 + </div>
  224 + <div class="uk-width-1-2">
  225 + <div class="uk-form-row">
  226 + <label class="uk-form-label">售票员</label>
  227 + <div class="uk-form-controls">
  228 + <div class="uk-autocomplete uk-form spy-autocom">
  229 + <input type="text" name="spy" value="{{sGh}}/{{sName}}">
  230 + </div>
  231 + </div>
  232 + </div>
  233 + </div>
  234 + </div>
  235 + <div class="uk-grid">
  236 + <div class="uk-width-1-2">
  237 + <div class="uk-form-row">
  238 + <label class="uk-form-label">路牌</label>
  239 + <div class="uk-form-controls">
  240 + <input type="text" value="{{lpName}}" name="lpName" required>
  241 + </div>
  242 + </div>
  243 + </div>
  244 + </div>
  245 + <div class="uk-grid">
  246 + <div class="uk-width-1-1">
  247 + <div class="uk-form-row">
  248 + <label class="uk-form-label">备注</label>
  249 + <div class="uk-form-controls">
  250 + <div class="uk-autocomplete uk-form remarks-autocom">
  251 + <input type="text" name="remarks">
  252 + </div>
  253 + </div>
  254 + </div>
  255 + </div>
  256 + </div>
  257 + </form>
  258 +
  259 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  260 + <button type="button" class="uk-button uk-modal-close">取消</button>
  261 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  262 + </div>
  263 +</script>
  264 +
  265 +<script>
  266 + var addTwoWayZnddType = (function () {
  267 + var wrap = '#schedule-addsch-modal .toAndFroCont', sch, f1, f2, submitFun, stationRoutes;
  268 +
  269 + $(wrap).on('init', function (e, data) {
  270 + e.stopPropagation();
  271 + sch = data.sch;
  272 + submitFun = data.submitFun;
  273 + stationRoutes = data.stationRoutes;
  274 +
  275 + var htmlStr = template('add_toAndFro_sch-form-temp', sch);
  276 + $(wrap).append(htmlStr);
  277 + //字典转换
  278 + dictionaryUtils.transformDom($('.nt-dictionary', wrap));
  279 + //validation
  280 + $('.add-sch-form', wrap).formValidation({framework: 'uikit', locale: 'zh_CN'}).trigger('init-autoCom');
  281 + $('.add-sch-form [name=bcType]', wrap).trigger('change');
  282 +
  283 + f1 = $('.add-sch-form.one_form', wrap);
  284 + f2 = $('.add-sch-form.two_form', wrap);
  285 +
  286 + //默认1备注同步到2
  287 + $f('remarks', f1).on('input', function () {
  288 + $f('remarks', f2).val($(this).val());
  289 + });
  290 + //默认1备注同步到2
  291 + $('.remarks-autocom', f1).on('selectitem.uk.autocomplete', function (e, data, acobject) {
  292 + $f('remarks', f2).val(data.value);
  293 + });
  294 +
  295 + //人车级联
  296 + $f('clZbh',f1).on('input change', function () {
  297 + $f('clZbh', f2).val($(this).val());
  298 + });
  299 + $f('jsy',f1).on('input change', function () {
  300 + $f('jsy', f2).val($(this).val());
  301 + });
  302 + $f('spy',f1).on('input change', function () {
  303 + $f('spy', f2).val($(this).val());
  304 + });
  305 + $f('lpName',f1).on('input change', function () {
  306 + $f('lpName', f2).val($(this).val());
  307 + });
  308 + //表单同步
  309 + $(f1).on('ct_callback', synchroFormData).trigger('ct_callback');
  310 + //修改1结束时间
  311 + $f('zdsj',f1).on('input', synchroFormData);
  312 +
  313 + //表单校验提交相关
  314 +
  315 + var fs = $('.add-sch-form', wrap);
  316 + fs.on('success.form.fv', function (e) {
  317 + e.preventDefault();
  318 + dataArray.push($(this).serializeJSON());
  319 + $(this).data('valid', true);
  320 + if (allValidSuccess()) {
  321 + //开始post
  322 + var i = 0;
  323 + var inArr = [];
  324 + var upArr = [];
  325 + (function () {
  326 + var f = arguments.callee;
  327 + if (i >= dataArray.length) {
  328 + //前端数据更新
  329 + var last = inArr.pop();
  330 + gb_schedule_table.insertSchedule(last, upArr);
  331 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: last});
  332 +
  333 + try {
  334 + if(last.bcType=='in' || last.bcType=='out')
  335 + gb_data_basic.reload_stat_park_data();
  336 + }catch (e){
  337 + console.log(e);}
  338 + UIkit.modal('#schedule-addsch-modal').hide();
  339 + //更新路牌公里统计面板
  340 + gb_schedule_table.showLpMileageTipBySch(last);
  341 + return;
  342 + }
  343 + submitFun(dataArray[i], function (rs) {
  344 + inArr.push(rs.t);
  345 + upArr = upArr.concat(rs.ts);
  346 + upArr.push(rs.t);
  347 + i++;
  348 + f();
  349 + }, function () {
  350 + $('[type=submit]', wrap).removeClass('disabled').removeAttr('disabled');
  351 + });
  352 + })();
  353 + }
  354 + });
  355 +
  356 + //提交
  357 + $('[type=submit]', wrap).on('click', function () {
  358 + $(this).addClass('disabled').attr('disabled', 'disabled');
  359 + dataArray = [];
  360 + fs.data('valid', false);
  361 + fs.formValidation('validate');
  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 + }
  415 +
  416 + function $f(name, f) {
  417 + return $('[name=' + name + ']', f);
  418 + }
  419 +
  420 + function allValidSuccess() {
  421 + var flag = true;
  422 + $('form.add-sch-form:visible', wrap).each(function (i, f) {
  423 + if (!$(f).data('valid')) {
  424 + flag = false;
  425 + return false;
  426 + }
  427 + });
  428 + return flag;
  429 + }
  430 +
  431 + /**
  432 + * 同步2个表单的数据
  433 + */
  434 + var bcTypes = {'normal': 'normal', 'region': 'region', 'out': 'in', 'in': 'out'};
  435 + var synchroFormData = function () {
  436 + //同步班次类型
  437 + var type = $f('bcType', f1).val();
  438 + if (bcTypes[type])
  439 + $f('bcType', f2).val(bcTypes[type]).trigger('change');
  440 + var updown = $f('xlDir', f1).val();
  441 +
  442 + //1 结束时间 = 2 开始时间
  443 + $f('fcsj', f2).val($f('zdsj', f1).val());
  444 + if (type != 'out' && type != 'in') {
  445 + //走向
  446 + $f('xlDir', f2).val(updown == 0 ? 1 : 0).trigger('change');
  447 +
  448 + //第一个表单终点 = 第二个起点
  449 + var oneZdName = $('[name=zdzCode] option:selected', f1).text();
  450 + $f('qdzCode', f2).val(searchParallelStation(oneZdName, updown == 0 ? 1 : 0));
  451 + //第一个表单起点 = 第二个终点
  452 + var oneQdName = $('[name=qdzCode] option:selected', f1).text();
  453 + $f('zdzCode', f2).val(searchParallelStation(oneQdName, updown == 0 ? 1 : 0)).trigger('change');
  454 + }
  455 + else {
  456 + //进出场走向相同
  457 + $f('xlDir', f2).val(updown).trigger('change');
  458 + //第一个表单终点 = 第二个起点
  459 + $f('qdzCode', f2).val($f('zdzCode', f1).val());
  460 + //第一个表单起点 = 第二个终点
  461 + $f('zdzCode', f2).val($f('qdzCode', f1).val()).trigger('change');
  462 + }
  463 +
  464 + };
  465 +
  466 +
  467 + //返回另一个走向对应的站点
  468 + function searchParallelStation(stationName, updown) {
  469 + var routes = stationRoutes[updown]
  470 + , len = routes.length;
  471 +
  472 + for (var i = 0; i < len; i++) {
  473 + if (routes[i].stationName == stationName)
  474 + return routes[i].stationCode;
  475 + }
  476 + }
  477 +
  478 + return {
  479 + submit : submit
  480 + }
  481 + })();
  482 +</script>
0 483 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -27,7 +27,7 @@ var gb_schedule_context_menu = (function () {
27 27 $.get(folder + '/temp_sch/add_normal.html', function (dom) {
28 28 add_sch_doms.normal_dom=dom;
29 29 });
30   -
  30 + //AI语音使用
31 31 $.get(folder + '/temp_sch/add_normal_recoder.html', function (dom) {
32 32 add_sch_doms.normal_recoder_dom=dom;
33 33 });
... ... @@ -48,6 +48,17 @@ var gb_schedule_context_menu = (function () {
48 48 });
49 49  
50 50  
  51 +
  52 + //智能调度使用
  53 + $.get(folder + '/temp_sch_v2/add_normal_znddType.html', function (dom) {
  54 + add_sch_doms_v2.normal_znddType_dom=dom;
  55 + });
  56 + $.get(folder + '/temp_sch_v2/add_two_way_znddType.html', function (dom) {
  57 + add_sch_doms_v2.two_znddType_dom=dom;
  58 + });
  59 +
  60 +
  61 +
51 62 var callbackHandler = {
52 63 get_st_doms: function () {
53 64 return st_doms;
... ...
src/main/resources/static/real_control_v2/js/stationcf/klyj.js
... ... @@ -28,10 +28,12 @@ var gb_klyj = (function () {
28 28 $wrap.append(htmlStr);
29 29 };
30 30  
31   -
  31 + //临加班次
32 32 $wrap.on('click', '.ljbc', function () {
33 33 var that = $(this);
34 34 var data = dataMap.get(that.data('uuid'));
  35 + var ljtype = $('#ljtype').val();
  36 + data.ljtype = ljtype;
35 37 open_modal("/real_control_v2/zndd/type/dkl.html", {
36 38 data: data
37 39 }, {center: true, bgclose: false, modal: true});
... ... @@ -44,6 +46,25 @@ var gb_klyj = (function () {
44 46 /*if (close) close = false*/
45 47 });
46 48  
  49 + $wrap.on('change', '#ljtype', function () {
  50 + var fn = $('#ljtype').val();
  51 + if (fn == "lin1"){
  52 + $(".lin1").css({ display: ''});
  53 + $(".lin2").css({display: 'none'});
  54 + $(".lin3").css({display: 'none'});
  55 + }else if((fn == "lin2")) {
  56 + $(".lin1").css({ display: 'none'});
  57 + $(".lin2").css({display: ''});
  58 + $(".lin3").css({display: 'none'});
  59 + }else {
  60 + $(".lin1").css({ display: 'none'});
  61 + $(".lin2").css({display: 'none'});
  62 + $(".lin3").css({display: ''});
  63 + }
  64 +
  65 + });
  66 +
  67 +
47 68 $wrap.on('click', '.images', function () {
48 69 var image = $(this).data('image');
49 70 var imgHtml = "<img src='" + image + "' style='width: " + 600 + "px;height:" + 300 + "px'/>";
... ...
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
1 1 var gb_dataZndd = (function (){
2 2  
3   - var max = 1;
  3 + var max = 3;
4 4 var $pop =$('.multi_plat_msg_pop_zndd');
5 5  
6 6 var codes = {
... ... @@ -18,15 +18,17 @@ var gb_dataZndd = (function (){
18 18 var dataMap = new Map();
19 19 var leftTime = 1000 * 10;//剩余的毫秒数
20 20 var sop = function (data) {
21   -
22 21 //时间格式化
23 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 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 34 var stm = moment(new Date());
... ... @@ -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 100 function ycsf_sx(line){
99 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 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 112 $pop.on('click', '.fcxxwts', function () {
120 113 if (close) close = false
... ... @@ -161,9 +154,9 @@ var gb_dataZndd = (function (){
161 154 alt_confirm(content, function () {
162 155 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
163 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 160 }, function (rs) {
168 161 if(rs.length != 0) {
169 162 gb_schedule_table.updateSchedule(rs.ts);
... ... @@ -360,8 +353,8 @@ var gb_dataZndd = (function (){
360 353  
361 354 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
362 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 358 }, function (rs) {
366 359 gb_schedule_table.updateSchedule(rs.ts);
367 360 notify_succ('实发未发操作成功!');
... ... @@ -377,10 +370,14 @@ var gb_dataZndd = (function (){
377 370 }
378 371 });*/
379 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 + var 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 289 <script id="zndd_plat_msg_template_config" type="text/html">
290 290 <div class="multi_plat_config" data-linecode="{{lineCode}}" data-station="{{station}}" data-stationname="{{stationName}}" data-numtype="{{numType}}"
291 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 293 <div id ={{uuid}} class="timer"></div>
294 294 <div class="msg-popup warning-color">
295 295 <div class="msg-times" style="cursor: pointer;">×</div>
... ... @@ -313,7 +313,7 @@
313 313 <div class="centerSpace msg-title">
314 314 <div></div>
315 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 317 </div>
318 318 </div>
319 319 </div>
... ... @@ -379,6 +379,31 @@
379 379 <div class="popup-msg-content">
380 380 <span>站点人数&nbsp;{{num}} &nbsp;&nbsp;预警时间&nbsp;{{timeStr}}</span>
381 381 </div>
  382 + <div class="">
  383 + <select class="form-control uk-margin-small-top" id ="ljtype" style="width: 180px;" >
  384 + <option value="lin1">方案1:临加正常班次</option>
  385 + <option value="lin2">方案2:临加区间班次</option>
  386 + <option value="lin3">方案3:调整发车时间</option>
  387 + </select>
  388 + </div>
  389 + <div class="dkl_msg_text lin1">
  390 + <span>
  391 + 添加一辆起点站到终点站的正常班次。<br>
  392 + 较适于始发站<br>
  393 + </span>
  394 + </div>
  395 + <div class="dkl_msg_text lin2" style="display: none">
  396 + <span>
  397 + 车辆到当前站点,从当前站点开始营运。<br>
  398 + 适用于中途站<br>
  399 + </span>
  400 + </div>
  401 + <div class="dkl_msg_text lin3" style="display: none">
  402 + <span>
  403 + 提前发车下一班车<br>
  404 + 适用于起点站<br>
  405 + </span>
  406 + </div>
382 407 <div class="popup-msg-contents" >
383 408 <button class="uk-button uk-button-primary images" data-image="{{image}}" value="{{dir}}">查看图片</button>
384 409 <button class="uk-button uk-button-primary ljbc" data-uuid="{{uuid}}" data-linecode="{{sch.xlBm}}" data-id="{{sch.id}}">临加班次</button>
... ...
src/main/resources/static/real_control_v2/zndd/type/dkl.html
... ... @@ -2,7 +2,9 @@
2 2 <div class="uk-modal-dialog" style="width: 1400px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 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 8 <div class="uk-grid uk-width-1-6" style="float: left">
7 9 <div class="uk-width-5-5 sjzlist">
8 10  
... ... @@ -35,13 +37,19 @@
35 37 </div>
36 38  
37 39 <div class="uk-grid uk-width-3-6 lj_2" style="display: none; padding-left: 100px">
38   - <div class="uk-width-1-1" id ="tempsdsf"></div>
  40 + <form class="uk-form uk-form-horizontal add-sch-form one_form" id ="tempsdsf">
  41 +
39 42  
  43 + </form>
40 44 </div>
41 45  
42 46 </div>
43 47  
44 48 <script>
  49 +
  50 +
  51 + var timemm = 1000 * 30 ; //定时器 自动执行
  52 +
45 53 (function () {
46 54 var modal = '#schedule-addsch-modal',
47 55 sch, stationRoutes, parks, information, carsArray, st_park_data,conf;
... ... @@ -59,21 +67,45 @@
59 67 var formHtmls = template('sjZ-divs-temp', sch);
60 68 $('.sjzlist', modal).html(formHtmls);
61 69  
  70 + if (sch.ljtype == "lin3"){
  71 + $(".lj_1").css({
  72 + display: 'none'
  73 + });
  74 + $(".lj_2").css({
  75 + display: ''
  76 + });
62 77  
63   -
64   - //参数改变
65   - $('form[name=yjtkForm] input', modal).on('blur', function () {
66   - var field = $(this).attr('name');
67   - var val = $(this).val();
68   - if (conf[field] != val) {
69   - var data = $('form[name=yjtkForm]', modal).serializeJSON();
70   - data.lineCode = conf.line.lineCode;
71   - gb_common.$post('/lineConfig/yjtkSet', data, function (rs) {
72   - conf = rs.conf;
73   - notify_succ('调整随到随发参数');
  78 + $.get('/logZndd/nextSch/'+sch.sch.id, function (datan) {
  79 + var formHtmls = template('sch_config_form-temp1', datan);
  80 + $('#tempsdsf', modal).html(formHtmls);
  81 + var f = $('#tempsdsf', modal).formValidation({
  82 + framework: 'uikit',
  83 + locale: 'zh_CN'
74 84 });
75   - }
76   - });
  85 + $("#form-s-t").val("站点遭遇大客流");
  86 + f.on('success.form.fv', function(e) {
  87 + e.preventDefault();
  88 + $('[type=submit]', f).attr('disabled', 'disabled');
  89 + var data = $(this).serializeJSON();
  90 + if(data.dfsj==sch.dfsj && data.remarks=='' && data.bcType == sch.bcType){
  91 + return;
  92 + }
  93 + gb_common.$post('/realSchedule/outgoAdjust', data, function(rs){
  94 +
  95 + //更新班次信息
  96 + gb_schedule_table.updateSchedule(rs.ts);
  97 + notify_succ('操作成功!');
  98 + UIkit.modal(modal).hide();
  99 + //重新计算应发未发
  100 + gb_schedule_table.calc_yfwf_num(sch.xlBm);
  101 + });
  102 + });
  103 + });
  104 + }
  105 + //定时器启动开关判定条件0开 1关
  106 + if (sch.excuteStatus == 0 && sch.ljtype == "lin1"){
  107 + var sntts = setInterval(function(){leftTimer();},1000); //开始倒计时
  108 + }
77 109  
78 110  
79 111 $("#destroySelect").on('change',function(){
... ... @@ -92,8 +124,8 @@
92 124 $(".lj_2").css({
93 125 display: ''
94 126 });
95   - $.get('/lineConfig/getByLineCode', {lineCode: sch.lineCode}, function (datan) {
96   - var formHtmls = template('buffer_config_form-temp1', datan);
  127 + $.get('/nextSch/'+sch.sch.id, null, function (datan) {
  128 + var formHtmls = template('sch_config_form-temp1', datan);
97 129 conf = datan;
98 130 $('#tempsdsf', modal).html(formHtmls);
99 131 $('[name=enableYjtk]', modal).on('change', function () {
... ... @@ -127,11 +159,11 @@
127 159 //to and fro
128 160 res.zdsjActual = moment(new Date().getTime() +(1000 * 60 *5)).format("HH:mm");
129 161 res.zdsj = moment(new Date().getTime() + (1000 * 60 * 5)).format("HH:mm");
130   - $('.toAndFroCont', modal).html(st_doms.two_way_dom)
  162 + $('.toAndFroCont', modal).html(st_doms.two_znddType_dom)
131 163 .trigger('init', {sch: res, submitFun: submit_temp_schedule_form, stationRoutes: stationRoutes});
132 164  
133 165 //normal
134   - $('.normalCont', modal).html(st_doms.normal_dom)
  166 + $('.normalCont', modal).html(st_doms.normal_znddType_dom)
135 167 .trigger('init', {sch: res, submitFun: submit_temp_schedule_form});
136 168 var kxcl=res.kxcl;
137 169 var arr=kxcl.split(',');
... ... @@ -143,7 +175,7 @@
143 175 }
144 176 s+=arr[i]+",";
145 177 j++;
146   - if(j==4||i==arr.length-1){
  178 + if(j==3||i==arr.length-1){
147 179 s=s.substring(0,s.length-1);
148 180 s+='</h3></label>';
149 181 j=1;
... ... @@ -152,7 +184,9 @@
152 184 document.getElementById("nbbms").innerHTML=s;
153 185 });
154 186  
155   - });
  187 +
  188 +
  189 +
156 190  
157 191 //init-autoCom
158 192 $(modal).on('init-autoCom', '.add-sch-form', function () {
... ... @@ -380,7 +414,6 @@
380 414 });
381 415 }
382 416  
383   - //debugger
384 417 array.sort(function (a, b) {
385 418 if(a.code==information.carPark)
386 419 return -1;
... ... @@ -443,6 +476,8 @@
443 476 open_modal(folder + '/yanshi.html', {
444 477 }, {center: true, bgclose: false, modal: true});*/
445 478 }, err);
  479 + //手动提交的时候清除一下,防止二次提交
  480 + clearInterval(sntts);
446 481 }
447 482  
448 483 function enableYjtkForm() {
... ... @@ -477,8 +512,6 @@
477 512 }
478 513  
479 514 $(modal).on('mouseenter', '.uk-icon-question-circle', function() {
480   -
481   - debugger
482 515 $(this).qtip({
483 516 show: {
484 517 ready: true,
... ... @@ -502,6 +535,35 @@
502 535 });
503 536 });
504 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
  558 +
  559 + if(i<10)
  560 + {
  561 + i = "0" + i;
  562 + }
  563 + return i;
  564 +
  565 + }
  566 +
505 567 })();
506 568 </script>
507 569 </div>
... ... @@ -568,7 +630,7 @@
568 630 <div class="uk-grid">
569 631 <div class="uk-width-4-2">
570 632 <div class="uk-form-row">
571   - <label class="uk-form-labels" ><h3>空闲车辆/人员</h3></label>
  633 + <label class="uk-form-labels" ><h3>空闲车辆/人员/班次结束时间</h3></label>
572 634 <div id="nbbms">
573 635 </div>
574 636 </div>
... ... @@ -578,45 +640,111 @@
578 640 </script>
579 641  
580 642  
581   -<script id="buffer_config_form-temp1" type="text/html">
582   - <div id="emergency_stop_panel">
583   - <h3 class="btn_title_lines1">
584   - <a class="uk-link-reset" >调整随到随发 </a>
585   - </h3>
586   - <div>
587   - <form class="uk-form" name="yjtkForm">
588   - <table>
589   - <tr>
590   - <td colspan="2">
591   - 是否启用
592   - <select class="z-depth-input" name="enableYjtk">
593   - <option value="0" >禁用</option>
594   - <option value="1" {{if enableYjtk}}selected{{/if}}>启用</option>
595   - </select>
596   - </td>
597   - </tr>
598   - <tr>
599   - <td colspan="2">
600   - 时间
601   - <input type="time" value="{{yjtkStart}}" name="yjtkStart" {{if !enableYjtk}}disabled{{/if}}>至
602   - <input type="time" value="{{yjtkEnd}}" name="yjtkEnd" {{if !enableYjtk}}disabled{{/if}}>
603   - </td>
604   - </tr>
605   - <tr>
606   - <td>
607   - 上行停靠时间
608   - <input type="number" value="{{upStopMinute}}" name="upStopMinute" {{if !enableYjtk}}disabled{{/if}}>分钟
609   - </td>
610   - </tr>
611   - <tr>
612   - <td>
613   - 下行停靠时间
614   - <input type="number" value="{{downStopMinute}}" name="downStopMinute" {{if !enableYjtk}}disabled{{/if}}>分钟
615   - </td>
616   - </tr>
617   - </table>
618   - </form>
  643 +<script id="sch_config_form-temp1" type="text/html">
  644 +
  645 + <input type="hidden" name="id" value="{{id}}"/>
  646 + <input type="hidden" name="opType" value="1"/>
  647 + <div class="uk-grid">
  648 + <div class="uk-width-1-2">
  649 + <div class="uk-form-row">
  650 + <label class="uk-form-label">从</label>
  651 + <div class="uk-form-controls">
  652 + <input type="text" value="{{qdzName}}" name="fcsj" disabled>
  653 + </div>
  654 + </div>
  655 + </div>
  656 + <div class="uk-width-1-2">
  657 + <div class="uk-form-row">
  658 + <label class="uk-form-label">到</label>
  659 + <div class="uk-form-controls">
  660 + <input type="text" value="{{zdzName}}" name="fcsj" disabled>
  661 + </div>
  662 + </div>
  663 + </div>
619 664 </div>
  665 +
  666 +
  667 + <div class="uk-grid">
  668 + <div class="uk-width-1-1">
  669 + <div class="uk-form-row">
  670 + <label class="uk-form-label" for="form-s-t">备注<small class="font-danger">(不超过50个字符)</small></label>
  671 + <div class="uk-form-controls">
  672 + <textarea class="zndd_text_input_color" id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="50" style="width: 100%">{{remarks}}</textarea>
  673 + </div>
  674 + </div>
  675 + </div>
  676 +
  677 + </div>
  678 +
  679 + <div class="uk-grid">
  680 + <div class="uk-width-1-2">
  681 + <div class="uk-form-row">
  682 + <label class="uk-form-label">车辆</label>
  683 + <div class="uk-form-controls">
  684 + <div class="uk-autocomplete uk-form car-autocom">
  685 + <input type="text" value="{{clZbh}}" disabled>
  686 + </div>
  687 + </div>
  688 + </div>
  689 + </div>
  690 + <div class="uk-width-1-2">
  691 + <div class="uk-form-row">
  692 + <label class="uk-form-label">路&nbsp;牌</label>
  693 + <div class="uk-form-controls">
  694 + <input type="text" value="{{lpName}}" disabled>
  695 + </div>
  696 + </div>
  697 + </div>
  698 + </div>
  699 + <div class="uk-grid">
  700 + <div class="uk-width-1-2">
  701 + <div class="uk-form-row">
  702 + <label class="uk-form-label">计发时刻:</label>
  703 + <div class="uk-form-controls">
  704 + <div class="uk-autocomplete uk-form jsy-autocom">
  705 + <input type="time" value="{{fcsj}}" disabled>
  706 + </div>
  707 + </div>
  708 + </div>
  709 + </div>
  710 + <div class="uk-width-1-2">
  711 + <div class="uk-form-row">
  712 + <label class="uk-form-label">预发时刻</label>
  713 + <div class="uk-form-controls">
  714 + <div class="uk-autocomplete uk-form spy-autocom">
  715 + <input type="time" class="zndd_text_input_color" name="dfsj" value="{{dfsj}}" required autofocus>
  716 + </div>
  717 + </div>
  718 + </div>
  719 + </div>
  720 + </div>
  721 + <div class="uk-grid">
  722 + <div class="uk-width-1-2">
  723 + <div class="uk-form-row">
  724 + <label class="uk-form-label">驾驶员:</label>
  725 + <div class="uk-form-controls">
  726 + <div class="uk-autocomplete uk-form jsy-autocom">
  727 + <input class="form-control" value="{{jName}}" disabled></input>
  728 + </div>
  729 + </div>
  730 + </div>
  731 + </div>
  732 + <div class="uk-width-1-2">
  733 + <div class="uk-form-row">
  734 + <label class="uk-form-label">售票员</label>
  735 + <div class="uk-form-controls">
  736 + <div class="uk-autocomplete uk-form spy-autocom">
  737 + <input class="form-control" value="{{sName}}" disabled></input>
  738 + </div>
  739 + </div>
  740 + </div>
  741 + </div>
  742 + </div>
  743 + <hr style="margin-top: 35px;">
  744 +
  745 + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
  746 + <button type="button" class="uk-button uk-modal-close">取消</button>
  747 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
620 748 </div>
621 749 </script>
622 750 <script id="home-icoe-img" type="text/html">
... ...
src/main/resources/static/real_control_v2/zndd/type/sftz_1.html
... ... @@ -251,7 +251,7 @@
251 251 <div class="uk-form-row">
252 252 <label class="uk-form-label">实发时间</label>
253 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 255 </div>
256 256 </div>
257 257 </div>
... ...