Commit 0f02d937d64bfbfc40a58b6576cc46b73d4dd6e7
Merge branch 'minhang' into pudong
Showing
55 changed files
with
1483 additions
and
376 deletions
src/main/java/com/bsth/Application.java
| ... | ... | @@ -17,7 +17,7 @@ import java.util.concurrent.ScheduledExecutorService; |
| 17 | 17 | @SpringBootApplication |
| 18 | 18 | public class Application extends SpringBootServletInitializer { |
| 19 | 19 | |
| 20 | - public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(15); | |
| 20 | + public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(16); | |
| 21 | 21 | |
| 22 | 22 | @Override |
| 23 | 23 | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { | ... | ... |
src/main/java/com/bsth/XDApplication.java
| ... | ... | @@ -4,10 +4,14 @@ import com.bsth.data.BasicData; |
| 4 | 4 | import com.bsth.data.ThreadMonotor; |
| 5 | 5 | import com.bsth.data.car_out_info.UpdateDBThread; |
| 6 | 6 | import com.bsth.data.directive.DirectivesPstThread; |
| 7 | +import com.bsth.data.forecast.SampleTimeDataLoader; | |
| 7 | 8 | import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; |
| 8 | 9 | import com.bsth.data.gpsdata.thread.OfflineMonitorThread; |
| 10 | +import com.bsth.data.msg_queue.DirectivePushQueue; | |
| 11 | +import com.bsth.data.msg_queue.WebSocketPushQueue; | |
| 9 | 12 | import com.bsth.data.schedule.edit_logs.SeiPstThread; |
| 10 | 13 | import com.bsth.data.schedule.late_adjust.ScheduleLateThread; |
| 14 | +import com.bsth.data.schedule.signal.SchSiginUpdateDBThread; | |
| 11 | 15 | import com.bsth.data.schedule.thread.CalcOilThread; |
| 12 | 16 | import com.bsth.data.schedule.thread.SchedulePstThread; |
| 13 | 17 | import com.bsth.data.schedule.thread.ScheduleRefreshThread; |
| ... | ... | @@ -56,6 +60,9 @@ public class XDApplication implements CommandLineRunner { |
| 56 | 60 | ThreadMonotor threadMonotor; |
| 57 | 61 | @Autowired |
| 58 | 62 | SeiPstThread seiPstThread; |
| 63 | + @Autowired | |
| 64 | + SampleTimeDataLoader sampleTimeDataLoader; | |
| 65 | + SchSiginUpdateDBThread schSiginUpdateDBThread; | |
| 59 | 66 | |
| 60 | 67 | private static long timeDiff; |
| 61 | 68 | private static long timeDiffTraffic; |
| ... | ... | @@ -116,30 +123,31 @@ public class XDApplication implements CommandLineRunner { |
| 116 | 123 | public void prodInit(){ |
| 117 | 124 | log.info("prodInit..."); |
| 118 | 125 | ScheduledExecutorService sexec = Application.mainServices; |
| 119 | - //发车信息 | |
| 120 | - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS); | |
| 121 | - //抓取GPS数据 | |
| 122 | - sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); | |
| 123 | - //GPS设备掉离线 | |
| 124 | - sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); | |
| 125 | - //班次更新线程 | |
| 126 | - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | |
| 127 | - //班次延迟入库线程 | |
| 128 | - sexec.scheduleWithFixedDelay(schedulePstThread, 60, 10, TimeUnit.SECONDS); | |
| 129 | - //班次修正日志入库 | |
| 130 | - sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS); | |
| 131 | - //检查班次误点 | |
| 132 | - sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS); | |
| 133 | - //调度指令延迟入库 | |
| 134 | - sexec.scheduleWithFixedDelay(directivesPstThread, 180, 100, TimeUnit.SECONDS); | |
| 126 | + | |
| 127 | + /** 线调业务 */ | |
| 128 | + sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);//抓取GPS数据 | |
| 129 | + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 | |
| 130 | + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);//班次更新线程 | |
| 131 | + sexec.scheduleWithFixedDelay(schedulePstThread, 60, 10, TimeUnit.SECONDS);//班次延迟入库线程 | |
| 132 | + sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);//班次修正日志入库 | |
| 133 | + sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);//检查班次误点 | |
| 134 | + sexec.scheduleWithFixedDelay(directivesPstThread, 180, 100, TimeUnit.SECONDS);//调度指令延迟入库 | |
| 135 | + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | |
| 136 | + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 12, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | |
| 137 | + sexec.scheduleWithFixedDelay(basicDataLoader, 2, 2, TimeUnit.HOURS);//基础数据更新 | |
| 138 | + DirectivePushQueue.start();//消息队列 -指令,系统下发的 | |
| 139 | + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | |
| 140 | + | |
| 141 | + /** 线调为其他程序提供的数据 --写入数据库 */ | |
| 142 | + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);//发车信息(发车屏、信息发布) | |
| 143 | + //线路首末班数据(网关用,班次更新时写入) | |
| 144 | + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler | |
| 145 | + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 60, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号) | |
| 135 | 146 | |
| 136 | 147 | //运管处静态数据提交 |
| 137 | 148 | log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处"); |
| 138 | 149 | sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 139 | 150 | //计算油、公里加注 |
| 140 | 151 | sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); |
| 141 | - | |
| 142 | - //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | |
| 143 | - sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS); | |
| 144 | 152 | } |
| 145 | 153 | } | ... | ... |
src/main/java/com/bsth/controller/excep/NowOutboundController.java
| 1 | 1 | package com.bsth.controller.excep; |
| 2 | 2 | |
| 3 | +import java.text.ParseException; | |
| 3 | 4 | import java.util.HashMap; |
| 5 | +import java.util.List; | |
| 4 | 6 | import java.util.Map; |
| 5 | 7 | |
| 6 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -10,7 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 10 | 12 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 13 | |
| 12 | 14 | import com.bsth.controller.BaseController; |
| 15 | +import com.bsth.data.BasicData; | |
| 13 | 16 | import com.bsth.entity.excep.Outbound; |
| 17 | +import com.bsth.entity.excep.Speeding; | |
| 14 | 18 | import com.bsth.entity.sys.SysUser; |
| 15 | 19 | import com.bsth.service.excep.NowOutboundService; |
| 16 | 20 | import com.bsth.util.PageObject; |
| ... | ... | @@ -44,5 +48,11 @@ public class NowOutboundController extends BaseController<SysUser, Integer>{ |
| 44 | 48 | return modelMap; |
| 45 | 49 | } |
| 46 | 50 | |
| 51 | + @RequestMapping(value = "/findPosition", method = RequestMethod.GET) | |
| 52 | + public List<Outbound> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException { | |
| 53 | + String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle); | |
| 54 | + List<Outbound> listOutbound = nowOutboundService.findPosition(deviceid,startdate,enddate); | |
| 55 | + return listOutbound; | |
| 56 | + } | |
| 47 | 57 | |
| 48 | 58 | } | ... | ... |
src/main/java/com/bsth/controller/oil/CwjyController.java
| ... | ... | @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 13 | 13 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 14 | |
| 15 | 15 | import com.bsth.controller.BaseController; |
| 16 | +import com.bsth.data.BasicData; | |
| 17 | +import com.bsth.entity.Line; | |
| 16 | 18 | import com.bsth.entity.oil.Cwjy; |
| 17 | 19 | import com.bsth.entity.oil.Ylxxb; |
| 18 | 20 | import com.bsth.entity.sys.SysUser; |
| ... | ... | @@ -30,12 +32,15 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ |
| 30 | 32 | SysUser sysUser = SecurityUtils.getCurrentUser(); |
| 31 | 33 | t.setCreateDate(new Date()); |
| 32 | 34 | t.setXgr(sysUser.getUserName()); |
| 35 | + t.setNbbm(t.getNbbm().trim().toUpperCase()); | |
| 36 | + Line line=BasicData.nbbm2LineMap.get(t.getNbbm()); | |
| 37 | + t.setLine(line == null?"" : line.getLineCode()); | |
| 33 | 38 | return service.save(t); |
| 34 | 39 | } |
| 35 | 40 | |
| 36 | 41 | @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) |
| 37 | 42 | public int checkNbbm(Cwjy t){ |
| 38 | - return service.checkNbbm(t.getNbbm().trim()); | |
| 43 | + return service.checkNbbm(t); | |
| 39 | 44 | } |
| 40 | 45 | |
| 41 | 46 | @RequestMapping(value = "/queryList",method = RequestMethod.GET) | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| 1 | 1 | package com.bsth.data; |
| 2 | 2 | |
| 3 | -import com.bsth.Application; | |
| 4 | 3 | import com.bsth.data.gpsdata.arrival.GeoCacheData; |
| 5 | 4 | import com.bsth.data.pinyin.PersionPinYinBuffer; |
| 6 | 5 | import com.bsth.entity.*; |
| ... | ... | @@ -13,12 +12,10 @@ import org.apache.commons.lang3.StringUtils; |
| 13 | 12 | import org.slf4j.Logger; |
| 14 | 13 | import org.slf4j.LoggerFactory; |
| 15 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | -import org.springframework.boot.CommandLineRunner; | |
| 17 | 15 | import org.springframework.jdbc.core.JdbcTemplate; |
| 18 | 16 | import org.springframework.stereotype.Component; |
| 19 | 17 | |
| 20 | 18 | import java.util.*; |
| 21 | -import java.util.concurrent.TimeUnit; | |
| 22 | 19 | |
| 23 | 20 | /** |
| 24 | 21 | * @author PanZhao |
| ... | ... | @@ -27,7 +24,7 @@ import java.util.concurrent.TimeUnit; |
| 27 | 24 | * @date 2016年8月10日 下午3:27:45 |
| 28 | 25 | */ |
| 29 | 26 | @Component |
| 30 | -public class BasicData implements CommandLineRunner { | |
| 27 | +public class BasicData { | |
| 31 | 28 | |
| 32 | 29 | //公司代码和公司名对照(K: 公司编码,V:公司名) |
| 33 | 30 | public static Map<String, String> businessCodeNameMap; |
| ... | ... | @@ -80,14 +77,6 @@ public class BasicData implements CommandLineRunner { |
| 80 | 77 | |
| 81 | 78 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| 82 | 79 | |
| 83 | - @Autowired | |
| 84 | - BasicDataLoader dataLoader; | |
| 85 | - | |
| 86 | - @Override | |
| 87 | - public void run(String... arg0) throws Exception { | |
| 88 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 2, 2, TimeUnit.HOURS); | |
| 89 | - } | |
| 90 | - | |
| 91 | 80 | public static String getStationNameByCode(String code, String prefix){ |
| 92 | 81 | String name = stationCode2NameMap.get(code); |
| 93 | 82 | return name != null? name: stationCode2NameMap.get(prefix + code); | ... | ... |
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
| 1 | 1 | package com.bsth.data.forecast; |
| 2 | 2 | |
| 3 | -import com.bsth.Application; | |
| 4 | 3 | import com.bsth.data.forecast.entity.ForecastResult; |
| 5 | 4 | import com.bsth.data.forecast.entity.ForecastResult.ForecastResultItem; |
| 6 | 5 | import com.bsth.data.forecast.entity.SimpleRoute; |
| ... | ... | @@ -13,7 +12,6 @@ import com.google.common.collect.ArrayListMultimap; |
| 13 | 12 | import org.slf4j.Logger; |
| 14 | 13 | import org.slf4j.LoggerFactory; |
| 15 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | -import org.springframework.boot.CommandLineRunner; | |
| 17 | 15 | import org.springframework.stereotype.Component; |
| 18 | 16 | |
| 19 | 17 | import java.text.DecimalFormat; |
| ... | ... | @@ -21,7 +19,6 @@ import java.util.ArrayList; |
| 21 | 19 | import java.util.HashMap; |
| 22 | 20 | import java.util.List; |
| 23 | 21 | import java.util.Map; |
| 24 | -import java.util.concurrent.TimeUnit; | |
| 25 | 22 | |
| 26 | 23 | /** |
| 27 | 24 | * |
| ... | ... | @@ -32,10 +29,7 @@ import java.util.concurrent.TimeUnit; |
| 32 | 29 | * |
| 33 | 30 | */ |
| 34 | 31 | @Component |
| 35 | -public class ForecastRealServer implements CommandLineRunner { | |
| 36 | - | |
| 37 | - @Autowired | |
| 38 | - SampleTimeDataLoader dataLoader; | |
| 32 | +public class ForecastRealServer { | |
| 39 | 33 | |
| 40 | 34 | @Autowired |
| 41 | 35 | DayOfSchedule dayOfSchedule; |
| ... | ... | @@ -57,12 +51,6 @@ public class ForecastRealServer implements CommandLineRunner { |
| 57 | 51 | forecastMap = new HashMap<>(); |
| 58 | 52 | } |
| 59 | 53 | |
| 60 | - @Override | |
| 61 | - public void run(String... arg0) throws Exception { | |
| 62 | - //2小时更新一次站点间耗时数据 | |
| 63 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); | |
| 64 | - } | |
| 65 | - | |
| 66 | 54 | /** |
| 67 | 55 | * |
| 68 | 56 | * @Title: forecast | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| ... | ... | @@ -163,6 +163,7 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 163 | 163 | |
| 164 | 164 | //实发时间 |
| 165 | 165 | sch.setFcsjActualAll(rsT); |
| 166 | + sch.setSiginCompate(1); | |
| 166 | 167 | //通知客户端 |
| 167 | 168 | sendUtils.sendFcsj(sch); |
| 168 | 169 | //持久化 |
| ... | ... | @@ -316,7 +317,7 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 316 | 317 | long rsT = lineConfigData.applyIn(sch, gps.getTimestamp()); |
| 317 | 318 | |
| 318 | 319 | sch.setZdsjActualAll(rsT); |
| 319 | - | |
| 320 | + sch.setSiginCompate(2); | |
| 320 | 321 | //通知误点停靠程序,有车辆到站 |
| 321 | 322 | LateAdjustHandle.carArrive(gps); |
| 322 | 323 | ... | ... |
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java
| ... | ... | @@ -5,7 +5,6 @@ import com.bsth.service.directive.DirectiveService; |
| 5 | 5 | import org.slf4j.Logger; |
| 6 | 6 | import org.slf4j.LoggerFactory; |
| 7 | 7 | import org.springframework.beans.BeansException; |
| 8 | -import org.springframework.boot.CommandLineRunner; | |
| 9 | 8 | import org.springframework.context.ApplicationContext; |
| 10 | 9 | import org.springframework.context.ApplicationContextAware; |
| 11 | 10 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -17,7 +16,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; |
| 17 | 16 | * Created by panzhao on 2017/5/11. |
| 18 | 17 | */ |
| 19 | 18 | @Component |
| 20 | -public class DirectivePushQueue implements CommandLineRunner, ApplicationContextAware { | |
| 19 | +public class DirectivePushQueue implements ApplicationContextAware { | |
| 21 | 20 | |
| 22 | 21 | static ConcurrentLinkedQueue<QueueData_Directive> linkedList; |
| 23 | 22 | static DataPushThread thread; |
| ... | ... | @@ -80,10 +79,10 @@ public class DirectivePushQueue implements CommandLineRunner, ApplicationContext |
| 80 | 79 | return linkedList.size(); |
| 81 | 80 | } |
| 82 | 81 | |
| 83 | - @Override | |
| 82 | +/* @Override | |
| 84 | 83 | public void run(String... strings) throws Exception { |
| 85 | 84 | start(); |
| 86 | - } | |
| 85 | + }*/ | |
| 87 | 86 | |
| 88 | 87 | @Override |
| 89 | 88 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | ... | ... |
src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java
| ... | ... | @@ -3,7 +3,6 @@ package com.bsth.data.msg_queue; |
| 3 | 3 | import com.bsth.common.Constants; |
| 4 | 4 | import org.slf4j.Logger; |
| 5 | 5 | import org.slf4j.LoggerFactory; |
| 6 | -import org.springframework.boot.CommandLineRunner; | |
| 7 | 6 | import org.springframework.stereotype.Component; |
| 8 | 7 | import org.springframework.web.socket.TextMessage; |
| 9 | 8 | import org.springframework.web.socket.WebSocketSession; |
| ... | ... | @@ -15,7 +14,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; |
| 15 | 14 | * Created by panzhao on 2017/5/11. |
| 16 | 15 | */ |
| 17 | 16 | @Component |
| 18 | -public class WebSocketPushQueue implements CommandLineRunner { | |
| 17 | +public class WebSocketPushQueue { | |
| 19 | 18 | |
| 20 | 19 | static ConcurrentLinkedQueue<QueueData> linkedList; |
| 21 | 20 | static DataPushThread thread; |
| ... | ... | @@ -54,10 +53,6 @@ public class WebSocketPushQueue implements CommandLineRunner { |
| 54 | 53 | return linkedList.size(); |
| 55 | 54 | } |
| 56 | 55 | |
| 57 | - @Override | |
| 58 | - public void run(String... strings) throws Exception { | |
| 59 | - start(); | |
| 60 | - } | |
| 61 | 56 | |
| 62 | 57 | public static class DataPushThread extends Thread { |
| 63 | 58 | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -729,7 +729,7 @@ public class DayOfSchedule { |
| 729 | 729 | /** |
| 730 | 730 | * @Title: prveNotExecNum |
| 731 | 731 | * @Description: TODO(班次之前未执行班次数量) |
| 732 | - */ | |
| 732 | + | |
| 733 | 733 | public int prveNotExecNum(ScheduleRealInfo sch) { |
| 734 | 734 | int n = 0; |
| 735 | 735 | List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); |
| ... | ... | @@ -741,29 +741,29 @@ public class DayOfSchedule { |
| 741 | 741 | break; |
| 742 | 742 | } |
| 743 | 743 | return n; |
| 744 | - } | |
| 744 | + }*/ | |
| 745 | 745 | |
| 746 | 746 | /** |
| 747 | 747 | * @Title: validEndTime |
| 748 | 748 | * @Description: TODO(是否是有效的到达时间) |
| 749 | - */ | |
| 749 | + | |
| 750 | 750 | public boolean validEndTime(ScheduleRealInfo sch, Long ts) { |
| 751 | 751 | if (sch.getFcsjActualTime() != null && sch.getFcsjActualTime() > ts) |
| 752 | 752 | return false; |
| 753 | 753 | |
| 754 | 754 | return validTime(sch, ts); |
| 755 | - } | |
| 755 | + }*/ | |
| 756 | 756 | |
| 757 | 757 | /** |
| 758 | 758 | * @Title: validStartTime |
| 759 | 759 | * @Description: TODO(是否是合适的发车时间) |
| 760 | - */ | |
| 760 | + | |
| 761 | 761 | public boolean validStartTime(ScheduleRealInfo sch, Long ts) { |
| 762 | 762 | if (sch.getZdsjActualTime() != null && sch.getZdsjActualTime() < ts) |
| 763 | 763 | return false; |
| 764 | 764 | |
| 765 | 765 | return validTime(sch, ts); |
| 766 | - } | |
| 766 | + }*/ | |
| 767 | 767 | |
| 768 | 768 | public boolean validTime(ScheduleRealInfo sch, Long ts) { |
| 769 | 769 | List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); |
| ... | ... | @@ -875,9 +875,9 @@ public class DayOfSchedule { |
| 875 | 875 | return outList; |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | - public Set<String> allCar() { | |
| 878 | +/* public Set<String> allCar() { | |
| 879 | 879 | return nbbmScheduleMap.keySet(); |
| 880 | - } | |
| 880 | + }*/ | |
| 881 | 881 | |
| 882 | 882 | public Collection<ScheduleRealInfo> findAll() { |
| 883 | 883 | return nbbmScheduleMap.values(); |
| ... | ... | @@ -939,12 +939,12 @@ public class DayOfSchedule { |
| 939 | 939 | return ups; |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | - public void removeNbbm2SchMapp(ScheduleRealInfo sch, String nbbm) { | |
| 943 | - nbbmScheduleMap.remove(nbbm, sch); | |
| 942 | + public void removeNbbm2SchMapp(ScheduleRealInfo sch) { | |
| 943 | + nbbmScheduleMap.remove(sch.getClZbh(), sch); | |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | - public void addNbbm2SchMapp(ScheduleRealInfo sch, String nbbm) { | |
| 947 | - nbbmScheduleMap.put(nbbm, sch); | |
| 946 | + public void addNbbm2SchMapp(ScheduleRealInfo sch) { | |
| 947 | + nbbmScheduleMap.put(sch.getClZbh(), sch); | |
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | public void reCalcExecPlan(String nbbm) { | ... | ... |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| ... | ... | @@ -101,6 +101,7 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 101 | 101 | lateSchMap.remove(sch.getClZbh()); |
| 102 | 102 | sch.setLate2(false); |
| 103 | 103 | sch.setLateMinute(0); |
| 104 | + sch.setDfAuto(false); | |
| 104 | 105 | } |
| 105 | 106 | }catch (Exception e){ |
| 106 | 107 | logger.error("", e); | ... | ... |
src/main/java/com/bsth/data/schedule/signal/SchSiginUpdateDBThread.java
0 → 100644
| 1 | +package com.bsth.data.schedule.signal; | |
| 2 | + | |
| 3 | +import org.slf4j.Logger; | |
| 4 | +import org.slf4j.LoggerFactory; | |
| 5 | +import org.springframework.stereotype.Component; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/8/14. | |
| 9 | + */ | |
| 10 | +@Component | |
| 11 | +public class SchSiginUpdateDBThread extends Thread{ | |
| 12 | + | |
| 13 | + SignalComplateHandler signalComplateHandler; | |
| 14 | + | |
| 15 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + public void run() { | |
| 19 | + try{ | |
| 20 | + signalComplateHandler.handler(); | |
| 21 | + }catch (Exception e){ | |
| 22 | + logger.error("", e); | |
| 23 | + } | |
| 24 | + } | |
| 25 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/signal/SignalComplateHandler.java
0 → 100644
| 1 | +package com.bsth.data.schedule.signal; | |
| 2 | + | |
| 3 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 4 | +import com.bsth.data.schedule.signal.entity.SchSiginCompate; | |
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 6 | +import com.bsth.util.db.DBUtils_MS; | |
| 7 | +import org.apache.commons.lang3.StringUtils; | |
| 8 | +import org.slf4j.Logger; | |
| 9 | +import org.slf4j.LoggerFactory; | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | |
| 12 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 13 | +import org.springframework.jdbc.datasource.DataSourceTransactionManager; | |
| 14 | +import org.springframework.stereotype.Component; | |
| 15 | +import org.springframework.transaction.TransactionDefinition; | |
| 16 | +import org.springframework.transaction.TransactionStatus; | |
| 17 | +import org.springframework.transaction.support.DefaultTransactionDefinition; | |
| 18 | + | |
| 19 | +import java.sql.PreparedStatement; | |
| 20 | +import java.sql.SQLException; | |
| 21 | +import java.util.ArrayList; | |
| 22 | +import java.util.Collection; | |
| 23 | +import java.util.Date; | |
| 24 | +import java.util.List; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * 班次信号补全(写入数据库,网关以补发的形式提交运管处) | |
| 28 | + * Created by panzhao on 2017/8/13. | |
| 29 | + */ | |
| 30 | +@Component | |
| 31 | +public class SignalComplateHandler { | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + DayOfSchedule dayOfSchedule; | |
| 35 | + | |
| 36 | + Logger log = LoggerFactory.getLogger(this.getClass()); | |
| 37 | + | |
| 38 | + public void handler(){ | |
| 39 | + Collection<ScheduleRealInfo> all = dayOfSchedule.findAll(); | |
| 40 | + List<SchSiginCompate> list = new ArrayList<>(); | |
| 41 | + | |
| 42 | + SchSiginCompate siginCompate; | |
| 43 | + Date d = new Date(); | |
| 44 | + long et = System.currentTimeMillis() - (1000 * 60 * 60 * 2), | |
| 45 | + st = et - (1000 * 60 * 60 * 2); | |
| 46 | + for(ScheduleRealInfo sch : all){ | |
| 47 | + if(sch.getDfsjT() > et || sch.getDfsjT() < st) | |
| 48 | + continue; | |
| 49 | + | |
| 50 | + //能自动完成的 | |
| 51 | + if(sch.getSiginCompate() >= 2) | |
| 52 | + continue; | |
| 53 | + | |
| 54 | + //烂班 | |
| 55 | + if(sch.isDestroy()) | |
| 56 | + continue; | |
| 57 | + | |
| 58 | + //空驶任务 | |
| 59 | + if(dayOfSchedule.emptyService(sch)) | |
| 60 | + continue; | |
| 61 | + | |
| 62 | + siginCompate = new SchSiginCompate(sch); | |
| 63 | + if(siginCompate == null || StringUtils.isEmpty(siginCompate.getDeciveId())) | |
| 64 | + continue; | |
| 65 | + | |
| 66 | + //标记已经补发 | |
| 67 | + sch.setSiginCompate(3); | |
| 68 | + //标记入库 | |
| 69 | + dayOfSchedule.save(sch); | |
| 70 | + siginCompate.setCreateDate(d); | |
| 71 | + list.add(siginCompate); | |
| 72 | + } | |
| 73 | + | |
| 74 | + put(list); | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void put(final List<SchSiginCompate> list){ | |
| 78 | + if(null == list || list.size() == 0) | |
| 79 | + return; | |
| 80 | + | |
| 81 | + JdbcTemplate jdbcTemp = new JdbcTemplate(DBUtils_MS.getDataSource()); | |
| 82 | + //编程式事务 | |
| 83 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemp.getDataSource()); | |
| 84 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 85 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 86 | + TransactionStatus status = tran.getTransaction(def); | |
| 87 | + | |
| 88 | + try{ | |
| 89 | + jdbcTemp.batchUpdate("insert into bsth_t_sigin_complate(id, rq, line_code, decive_id, up_down, s_code, e_code, st, et, create_date, status) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", new BatchPreparedStatementSetter() { | |
| 90 | + @Override | |
| 91 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 92 | + SchSiginCompate sc = list.get(i); | |
| 93 | + ps.setLong(1, sc.getId()); | |
| 94 | + ps.setString(2, sc.getRq()); | |
| 95 | + ps.setString(3, sc.getLineCode()); | |
| 96 | + ps.setString(4, sc.getDeciveId()); | |
| 97 | + ps.setInt(5, sc.getUpDown()); | |
| 98 | + ps.setString(6, sc.getsCode()); | |
| 99 | + ps.setString(7, sc.geteCode()); | |
| 100 | + ps.setLong(8, sc.getSt()); | |
| 101 | + ps.setLong(9, sc.getEt()); | |
| 102 | + ps.setDate(10, new java.sql.Date(sc.getCreateDate().getTime())); | |
| 103 | + ps.setInt(11, sc.getStatus()); | |
| 104 | + } | |
| 105 | + | |
| 106 | + @Override | |
| 107 | + public int getBatchSize() { | |
| 108 | + return list.size(); | |
| 109 | + } | |
| 110 | + }); | |
| 111 | + | |
| 112 | + tran.commit(status); | |
| 113 | + log.info("补信号班次入库," + list.size()); | |
| 114 | + }catch (Exception e){ | |
| 115 | + log.error("", e); | |
| 116 | + tran.rollback(status); | |
| 117 | + } | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 121 | +} | ... | ... |
src/main/java/com/bsth/data/schedule/signal/entity/SchSiginCompate.java
0 → 100644
| 1 | +package com.bsth.data.schedule.signal.entity; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 5 | + | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 班次信号补偿 | |
| 10 | + * Created by panzhao on 2017/8/13. | |
| 11 | + */ | |
| 12 | +public class SchSiginCompate { | |
| 13 | + | |
| 14 | + /** 实际班次ID */ | |
| 15 | + private long id; | |
| 16 | + | |
| 17 | + /** 班次日期 */ | |
| 18 | + private String rq; | |
| 19 | + | |
| 20 | + /** 线路编码 */ | |
| 21 | + private String lineCode; | |
| 22 | + | |
| 23 | + /** 设备号 */ | |
| 24 | + private String deciveId; | |
| 25 | + | |
| 26 | + /** 上下行 */ | |
| 27 | + private int upDown; | |
| 28 | + | |
| 29 | + /** 起始站编码 */ | |
| 30 | + private String sCode; | |
| 31 | + | |
| 32 | + /** 终点站编码 */ | |
| 33 | + private String eCode; | |
| 34 | + | |
| 35 | + /** 开始时间戳 */ | |
| 36 | + private long st; | |
| 37 | + | |
| 38 | + /** 结束时间戳 */ | |
| 39 | + private long et; | |
| 40 | + | |
| 41 | + /** 入库时间 */ | |
| 42 | + private Date createDate; | |
| 43 | + | |
| 44 | + private int status = 0; | |
| 45 | + | |
| 46 | + public SchSiginCompate(ScheduleRealInfo sch) { | |
| 47 | + this.id = sch.getId(); | |
| 48 | + this.rq = sch.getScheduleDateStr(); | |
| 49 | + this.lineCode = sch.getXlBm(); | |
| 50 | + this.upDown = Integer.parseInt(sch.getXlDir()); | |
| 51 | + this.deciveId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); | |
| 52 | + this.sCode = sch.getQdzCode(); | |
| 53 | + this.eCode = sch.getZdzCode(); | |
| 54 | + this.st = sch.getDfsjT(); | |
| 55 | + this.et = sch.getZdsjT(); | |
| 56 | + | |
| 57 | + if(sch.getFcsjActualTime() != null) | |
| 58 | + this.st = sch.getFcsjActualTime(); | |
| 59 | + if(sch.getZdsjActualTime() != null) | |
| 60 | + this.et = sch.getZdsjActualTime(); | |
| 61 | + } | |
| 62 | + | |
| 63 | + public long getId() { | |
| 64 | + return id; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setId(long id) { | |
| 68 | + this.id = id; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getRq() { | |
| 72 | + return rq; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setRq(String rq) { | |
| 76 | + this.rq = rq; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getLineCode() { | |
| 80 | + return lineCode; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setLineCode(String lineCode) { | |
| 84 | + this.lineCode = lineCode; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getDeciveId() { | |
| 88 | + return deciveId; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setDeciveId(String deciveId) { | |
| 92 | + this.deciveId = deciveId; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public int getUpDown() { | |
| 96 | + return upDown; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setUpDown(int upDown) { | |
| 100 | + this.upDown = upDown; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getsCode() { | |
| 104 | + return sCode; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setsCode(String sCode) { | |
| 108 | + this.sCode = sCode; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String geteCode() { | |
| 112 | + return eCode; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void seteCode(String eCode) { | |
| 116 | + this.eCode = eCode; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public long getSt() { | |
| 120 | + return st; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setSt(long st) { | |
| 124 | + this.st = st; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public long getEt() { | |
| 128 | + return et; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setEt(long et) { | |
| 132 | + this.et = et; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public Date getCreateDate() { | |
| 136 | + return createDate; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setCreateDate(Date createDate) { | |
| 140 | + this.createDate = createDate; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public int getStatus() { | |
| 144 | + return status; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setStatus(int status) { | |
| 148 | + this.status = status; | |
| 149 | + } | |
| 150 | +} | ... | ... |
src/main/java/com/bsth/entity/excep/Outbound.java
| ... | ... | @@ -34,9 +34,6 @@ public class Outbound { |
| 34 | 34 | */ |
| 35 | 35 | private String lineName; |
| 36 | 36 | |
| 37 | - | |
| 38 | - | |
| 39 | - | |
| 40 | 37 | /** |
| 41 | 38 | * 上下行(0 上行 , 1 下行 , -1 无效) |
| 42 | 39 | */ |
| ... | ... | @@ -57,18 +54,66 @@ public class Outbound { |
| 57 | 54 | */ |
| 58 | 55 | private String location; |
| 59 | 56 | |
| 57 | + /** | |
| 58 | + * 超速结束时经度 | |
| 59 | + */ | |
| 60 | + private Float endlon; | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 超速结束时纬度 | |
| 64 | + */ | |
| 65 | + private Float endlat; | |
| 60 | 66 | |
| 61 | 67 | /** |
| 62 | 68 | * 时间戳 |
| 63 | 69 | */ |
| 64 | 70 | private Long timestamp; |
| 65 | 71 | |
| 72 | + public Float getEndlon() { | |
| 73 | + return endlon; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setEndlon(Float endlon) { | |
| 77 | + this.endlon = endlon; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public Float getEndlat() { | |
| 81 | + return endlat; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setEndlat(Float endlat) { | |
| 85 | + this.endlat = endlat; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public Long getEndtimestamp() { | |
| 89 | + return endtimestamp; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setEndtimestamp(Long endtimestamp) { | |
| 93 | + this.endtimestamp = endtimestamp; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public String getEndtimestampDate() { | |
| 97 | + return endtimestampDate; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public void setEndtimestampDate(String endtimestampDate) { | |
| 101 | + this.endtimestampDate = endtimestampDate; | |
| 102 | + } | |
| 103 | + | |
| 66 | 104 | /** |
| 67 | 105 | * 时间戳转换的时间 |
| 68 | 106 | */ |
| 69 | 107 | private String timestampDate; |
| 70 | 108 | |
| 71 | 109 | |
| 110 | + //结束时间,单位:秒/s | |
| 111 | + @Transient | |
| 112 | + private Long endtimestamp; | |
| 113 | + | |
| 114 | + @Transient | |
| 115 | + private String endtimestampDate; | |
| 116 | + | |
| 72 | 117 | /** |
| 73 | 118 | * 时间 |
| 74 | 119 | */ | ... | ... |
src/main/java/com/bsth/entity/oil/Cwjy.java
| ... | ... | @@ -26,6 +26,11 @@ public class Cwjy { |
| 26 | 26 | private String xgr; |
| 27 | 27 | |
| 28 | 28 | private Date createDate; |
| 29 | + | |
| 30 | + private String line; | |
| 31 | + | |
| 32 | + @Transient | |
| 33 | + private String linename; | |
| 29 | 34 | |
| 30 | 35 | @Transient |
| 31 | 36 | private String gsname; |
| ... | ... | @@ -95,6 +100,24 @@ public class Cwjy { |
| 95 | 100 | public void setFgsname(String fgsname) { |
| 96 | 101 | this.fgsname = fgsname; |
| 97 | 102 | } |
| 103 | + | |
| 104 | + public String getLine() { | |
| 105 | + return line; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void setLine(String line) { | |
| 109 | + this.line = line; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public String getLinename() { | |
| 113 | + return BasicData.lineCode2NameMap.get(this.line); | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setLinename(String linename) { | |
| 117 | + this.linename = linename; | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 98 | 121 | |
| 99 | 122 | |
| 100 | 123 | } | ... | ... |
src/main/java/com/bsth/entity/oil/Ylxxb.java
| ... | ... | @@ -44,7 +44,8 @@ public class Ylxxb { |
| 44 | 44 | private String gsname; |
| 45 | 45 | @Transient |
| 46 | 46 | private String fgsname; |
| 47 | - | |
| 47 | + @Transient | |
| 48 | + private String linename; | |
| 48 | 49 | @Transient |
| 49 | 50 | private Double zjzl; |
| 50 | 51 | |
| ... | ... | @@ -193,6 +194,12 @@ public class Ylxxb { |
| 193 | 194 | public void setZjzl(Double zjzl) { |
| 194 | 195 | this.zjzl = zjzl; |
| 195 | 196 | } |
| 197 | + public String getLinename() { | |
| 198 | + return linename; | |
| 199 | + } | |
| 200 | + public void setLinename(String linename) { | |
| 201 | + this.linename = linename; | |
| 202 | + } | |
| 196 | 203 | |
| 197 | 204 | |
| 198 | 205 | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -214,6 +214,9 @@ public class ScheduleRealInfo { |
| 214 | 214 | @JsonIgnore |
| 215 | 215 | private int saveFailCount=0; |
| 216 | 216 | |
| 217 | + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ | |
| 218 | + private int siginCompate; | |
| 219 | + | |
| 217 | 220 | public boolean isDfAuto() { |
| 218 | 221 | return dfAuto; |
| 219 | 222 | } |
| ... | ... | @@ -303,10 +306,10 @@ public class ScheduleRealInfo { |
| 303 | 306 | String old = this.getRemarks(); |
| 304 | 307 | if(StringUtils.isBlank(old)) |
| 305 | 308 | old = ""; |
| 306 | - | |
| 309 | + | |
| 307 | 310 | old += remark + ";"; |
| 308 | 311 | this.setRemarks(old); |
| 309 | - | |
| 312 | + | |
| 310 | 313 | } |
| 311 | 314 | |
| 312 | 315 | public Long getId() { |
| ... | ... | @@ -622,12 +625,12 @@ public class ScheduleRealInfo { |
| 622 | 625 | this.dfsjT = dfsjT; |
| 623 | 626 | this.dfsj = fmtHHmm.print(this.dfsjT); |
| 624 | 627 | } |
| 625 | - | |
| 628 | + | |
| 626 | 629 | public void setDfsjAll(String dfsj) { |
| 627 | 630 | this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj); |
| 628 | 631 | this.dfsj = dfsj; |
| 629 | 632 | } |
| 630 | - | |
| 633 | + | |
| 631 | 634 | public void calcEndTime(){ |
| 632 | 635 | //计划终点时间 |
| 633 | 636 | if(this.getBcsj() != null){ |
| ... | ... | @@ -665,33 +668,33 @@ public class ScheduleRealInfo { |
| 665 | 668 | public void setSflj(boolean sflj) { |
| 666 | 669 | this.sflj = sflj; |
| 667 | 670 | } |
| 668 | - | |
| 671 | + | |
| 669 | 672 | /** |
| 670 | - * | |
| 671 | - * @Title: setFcsjAll | |
| 672 | - * @Description: TODO(设置计划发车时间) | |
| 673 | + * | |
| 674 | + * @Title: setFcsjAll | |
| 675 | + * @Description: TODO(设置计划发车时间) | |
| 673 | 676 | * @throws |
| 674 | 677 | */ |
| 675 | 678 | public void setFcsjAll(String fcsj){ |
| 676 | 679 | this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj); |
| 677 | 680 | this.fcsj = fcsj; |
| 678 | 681 | } |
| 679 | - | |
| 682 | + | |
| 680 | 683 | /** |
| 681 | - * | |
| 682 | - * @Title: setFcsjAll | |
| 683 | - * @Description: TODO(设置计划发车时间) | |
| 684 | + * | |
| 685 | + * @Title: setFcsjAll | |
| 686 | + * @Description: TODO(设置计划发车时间) | |
| 684 | 687 | * @throws |
| 685 | 688 | */ |
| 686 | 689 | public void setFcsjAll(Long fcsjT){ |
| 687 | 690 | this.fcsjT = fcsjT; |
| 688 | 691 | this.fcsj = fmtHHmm.print(fcsjT); |
| 689 | 692 | } |
| 690 | - | |
| 693 | + | |
| 691 | 694 | /** |
| 692 | - * | |
| 693 | - * @Title: setFcsjActualAll | |
| 694 | - * @Description: TODO(设置实际发车时间 字符串) | |
| 695 | + * | |
| 696 | + * @Title: setFcsjActualAll | |
| 697 | + * @Description: TODO(设置实际发车时间 字符串) | |
| 695 | 698 | * @throws |
| 696 | 699 | */ |
| 697 | 700 | public void setFcsjActualAll(String fcsjActual){ |
| ... | ... | @@ -699,11 +702,11 @@ public class ScheduleRealInfo { |
| 699 | 702 | this.fcsjActual = fcsjActual; |
| 700 | 703 | calcStatus(); |
| 701 | 704 | } |
| 702 | - | |
| 705 | + | |
| 703 | 706 | /** |
| 704 | - * | |
| 705 | - * @Title: setFcsjActualAll | |
| 706 | - * @Description: TODO(设置实际发车时间 时间戳) | |
| 707 | + * | |
| 708 | + * @Title: setFcsjActualAll | |
| 709 | + * @Description: TODO(设置实际发车时间 时间戳) | |
| 707 | 710 | * @throws |
| 708 | 711 | */ |
| 709 | 712 | public void setFcsjActualAll(Long t){ |
| ... | ... | @@ -713,25 +716,25 @@ public class ScheduleRealInfo { |
| 713 | 716 | //更新班次状态 |
| 714 | 717 | calcStatus(); |
| 715 | 718 | } |
| 716 | - | |
| 719 | + | |
| 717 | 720 | /** |
| 718 | - * | |
| 719 | - * @Title: setFcsjActualAll | |
| 720 | - * @Description: TODO(设置实际终点时间) | |
| 721 | + * | |
| 722 | + * @Title: setFcsjActualAll | |
| 723 | + * @Description: TODO(设置实际终点时间) | |
| 721 | 724 | * @throws |
| 722 | 725 | */ |
| 723 | 726 | public void setZdsjActualAll(Long t){ |
| 724 | 727 | this.zdsjActualTime = t; |
| 725 | 728 | this.zdsjActual = fmtHHmm.print(t); |
| 726 | - | |
| 729 | + | |
| 727 | 730 | //更新班次状态 |
| 728 | 731 | calcStatus(); |
| 729 | 732 | } |
| 730 | - | |
| 733 | + | |
| 731 | 734 | /** |
| 732 | - * | |
| 733 | - * @Title: setFcsjActualAll | |
| 734 | - * @Description: TODO(设置实际终点时间) | |
| 735 | + * | |
| 736 | + * @Title: setFcsjActualAll | |
| 737 | + * @Description: TODO(设置实际终点时间) | |
| 735 | 738 | * @throws |
| 736 | 739 | */ |
| 737 | 740 | public void setZdsjActualAll(String zdsjActual){ |
| ... | ... | @@ -740,7 +743,7 @@ public class ScheduleRealInfo { |
| 740 | 743 | |
| 741 | 744 | calcStatus(); |
| 742 | 745 | } |
| 743 | - | |
| 746 | + | |
| 744 | 747 | public Long getSpId() { |
| 745 | 748 | return spId; |
| 746 | 749 | } |
| ... | ... | @@ -760,11 +763,11 @@ public class ScheduleRealInfo { |
| 760 | 763 | public void calcStatus() { |
| 761 | 764 | if(this.status == -1) |
| 762 | 765 | return; |
| 763 | - | |
| 766 | + | |
| 764 | 767 | this.status = 0; |
| 765 | 768 | if(StringUtils.isNotBlank(this.fcsjActual)){ |
| 766 | 769 | this.status = 1; |
| 767 | - | |
| 770 | + | |
| 768 | 771 | //进出场班次并且没有计划里程的 |
| 769 | 772 | if((this.bcType.equals("out") || this.bcType.equals("in")) |
| 770 | 773 | && this.jhlc == null){ |
| ... | ... | @@ -774,7 +777,7 @@ public class ScheduleRealInfo { |
| 774 | 777 | if(StringUtils.isNotBlank(this.zdsjActual)) |
| 775 | 778 | this.status = 2; |
| 776 | 779 | } |
| 777 | - | |
| 780 | + | |
| 778 | 781 | public void destroy(){ |
| 779 | 782 | this.jhlc = 0.0; |
| 780 | 783 | if(this.isSflj()) |
| ... | ... | @@ -782,11 +785,11 @@ public class ScheduleRealInfo { |
| 782 | 785 | this.status = -1; |
| 783 | 786 | this.clearFcsjActual(); |
| 784 | 787 | } |
| 785 | - | |
| 788 | + | |
| 786 | 789 | public boolean isDestroy(){ |
| 787 | 790 | return this.status == -1; |
| 788 | 791 | } |
| 789 | - | |
| 792 | + | |
| 790 | 793 | /* public boolean isNotDestroy(){ |
| 791 | 794 | return this.status != -1; |
| 792 | 795 | }*/ |
| ... | ... | @@ -806,18 +809,18 @@ public class ScheduleRealInfo { |
| 806 | 809 | public void setScheduleDateStr(String scheduleDateStr) { |
| 807 | 810 | this.scheduleDateStr = scheduleDateStr; |
| 808 | 811 | } |
| 809 | - | |
| 812 | + | |
| 810 | 813 | public void clearFcsjActual(){ |
| 811 | 814 | this.setFcsjActual(null); |
| 812 | 815 | this.setFcsjActualTime(null); |
| 813 | 816 | this.calcStatus(); |
| 814 | 817 | } |
| 815 | - | |
| 818 | + | |
| 816 | 819 | //清除实际终点时间 |
| 817 | 820 | public void clearZdsjActual(){ |
| 818 | 821 | this.setZdsjActual(null); |
| 819 | 822 | this.setZdsjActualTime(null); |
| 820 | - | |
| 823 | + | |
| 821 | 824 | calcStatus(); |
| 822 | 825 | } |
| 823 | 826 | |
| ... | ... | @@ -922,4 +925,12 @@ public class ScheduleRealInfo { |
| 922 | 925 | public void setSaveFailCount(int saveFailCount) { |
| 923 | 926 | this.saveFailCount = saveFailCount; |
| 924 | 927 | } |
| 928 | + | |
| 929 | + public int getSiginCompate() { | |
| 930 | + return siginCompate; | |
| 931 | + } | |
| 932 | + | |
| 933 | + public void setSiginCompate(int siginCompate) { | |
| 934 | + this.siginCompate = siginCompate; | |
| 935 | + } | |
| 925 | 936 | } | ... | ... |
src/main/java/com/bsth/repository/oil/CwjyRepository.java
| ... | ... | @@ -30,5 +30,8 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ |
| 30 | 30 | @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3%",nativeQuery=true) |
| 31 | 31 | List<Cwjy> selectAll(String nbbm,String gsdm,String fgsdm); |
| 32 | 32 | |
| 33 | + @Query(value="select * from bsth_c_cwjy where nbbm like %?1% and gsdm like %?2% and fgsdm like %?3% and line =?4",nativeQuery=true) | |
| 34 | + List<Cwjy> selectAll_s(String nbbm,String gsdm,String fgsdm,String line); | |
| 35 | + | |
| 33 | 36 | |
| 34 | 37 | } | ... | ... |
src/main/java/com/bsth/service/excep/NowOutboundService.java
| 1 | 1 | package com.bsth.service.excep; |
| 2 | 2 | |
| 3 | +import java.util.List; | |
| 3 | 4 | import java.util.Map; |
| 4 | 5 | |
| 5 | 6 | import com.bsth.entity.excep.Outbound; |
| ... | ... | @@ -8,4 +9,6 @@ import com.bsth.util.PageObject; |
| 8 | 9 | public interface NowOutboundService { |
| 9 | 10 | PageObject <Outbound> Pagequery(Map<String, Object> map) ; |
| 10 | 11 | Map<String, Object> getReport( Map<String, Object> map); |
| 12 | + List<Outbound> findPosition(String deviceid, String startdate, | |
| 13 | + String enddate); | |
| 11 | 14 | } | ... | ... |
src/main/java/com/bsth/service/excep/impl/NowOutboundServiceImpl.java
| ... | ... | @@ -14,16 +14,16 @@ import java.util.Map; |
| 14 | 14 | |
| 15 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | 16 | import org.springframework.jdbc.core.JdbcTemplate; |
| 17 | -import org.springframework.jdbc.core.RowMapper; | |
| 18 | 17 | import org.springframework.stereotype.Service; |
| 19 | 18 | |
| 20 | 19 | import com.bsth.data.BasicData; |
| 21 | 20 | import com.bsth.entity.excep.Outbound; |
| 22 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 23 | 21 | import com.bsth.service.excep.NowOutboundService; |
| 24 | 22 | import com.bsth.util.EchartConver; |
| 25 | 23 | import com.bsth.util.PageHelper; |
| 26 | 24 | import com.bsth.util.PageObject; |
| 25 | +import com.bsth.util.TransGPS; | |
| 26 | +import com.bsth.util.TransGPS.Location; | |
| 27 | 27 | import com.bsth.util.db.DBUtils_MS; |
| 28 | 28 | import com.github.abel533.echarts.Option; |
| 29 | 29 | import com.google.gson.Gson; |
| ... | ... | @@ -37,7 +37,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 37 | 37 | ResultSet rs = null; |
| 38 | 38 | int page=Integer.parseInt(map.get("page").toString()); |
| 39 | 39 | List<Outbound> list=new ArrayList<Outbound>(); |
| 40 | - String sql="select * from bsth_c_outbound where 1=1 "; | |
| 40 | + String sql="select * from bsth_c_outbound_handle where 1=1 "; | |
| 41 | 41 | Object line=map.get("line"); |
| 42 | 42 | Object nbbm=map.get("nbbm"); |
| 43 | 43 | Object updown=map.get("updown"); |
| ... | ... | @@ -61,7 +61,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 61 | 61 | try { |
| 62 | 62 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 63 | 63 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| 64 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 64 | + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2; | |
| 65 | 65 | } catch (ParseException e) { |
| 66 | 66 | // TODO Auto-generated catch block |
| 67 | 67 | e.printStackTrace(); |
| ... | ... | @@ -69,8 +69,10 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | } |
| 72 | - // sql +=" order by id limit ?,?"; | |
| 73 | - sql +=" order by timestamp limit ?,?"; | |
| 72 | + | |
| 73 | + sql +=" and endtimestamp - starttimestamp >10000 ";//越界超过30秒的才显示,有待探讨。 | |
| 74 | + | |
| 75 | + sql +=" order by starttimestamp limit ?,?"; | |
| 74 | 76 | |
| 75 | 77 | try { |
| 76 | 78 | conn = DBUtils_MS.getConnection(); |
| ... | ... | @@ -90,22 +92,29 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 90 | 92 | } |
| 91 | 93 | |
| 92 | 94 | static List<Outbound> resultSet2Set(ResultSet rs) throws SQLException{ |
| 93 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | |
| 95 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 94 | 96 | List<Outbound> list=new ArrayList<Outbound>(); |
| 95 | 97 | Outbound outbound; |
| 98 | + Location location; | |
| 96 | 99 | while(rs.next()){ |
| 97 | 100 | outbound=new Outbound(); |
| 98 | - // outbound.setId(Integer.valueOf(rs.getObject("id").toString())); | |
| 101 | + outbound.setId(Integer.valueOf(rs.getObject("id").toString())); | |
| 99 | 102 | outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); |
| 100 | 103 | outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); |
| 101 | - outbound.setLon(Float.valueOf(rs.getObject("lon").toString())); | |
| 102 | - outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); | |
| 104 | + //将gps的经纬度转成百度的经纬度 | |
| 105 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("startLon"), rs.getFloat("startLat")))); | |
| 106 | + outbound.setLon((float)location.getLng()); | |
| 107 | + outbound.setLat((float)location.getLat()); | |
| 108 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(rs.getFloat("endLon"), rs.getFloat("endLat")))); | |
| 109 | + outbound.setEndlon((float)location.getLng()); | |
| 110 | + outbound.setEndlat((float)location.getLat()); | |
| 111 | + outbound.setTimestamp((Long.valueOf(rs.getObject("startTimestamp").toString()))); | |
| 112 | + outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | |
| 113 | + outbound.setEndtimestamp((Long.valueOf(rs.getObject("endTimestamp").toString()))); | |
| 114 | + outbound.setEndtimestampDate(sdf.format(new Date(outbound.getEndtimestamp()))); | |
| 103 | 115 | //run 时注解 |
| 104 | 116 | outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); |
| 105 | - outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); | |
| 106 | - outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | |
| 107 | 117 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); |
| 108 | -// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); | |
| 109 | 118 | list.add(outbound); |
| 110 | 119 | } |
| 111 | 120 | return list; |
| ... | ... | @@ -114,7 +123,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 114 | 123 | @Override |
| 115 | 124 | public PageObject<Outbound> Pagequery(Map<String, Object> map) { |
| 116 | 125 | // TODO Auto-generated method stub PageObject<Outbound> Pagequery |
| 117 | - String sql="select count(*) record from bsth_c_outbound where 1=1 "; | |
| 126 | + String sql="select count(*) record from bsth_c_outbound_handle where 1=1 "; | |
| 118 | 127 | Object line=map.get("line"); |
| 119 | 128 | Object nbbm=map.get("nbbm"); |
| 120 | 129 | Object updown=map.get("updown"); |
| ... | ... | @@ -139,7 +148,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 139 | 148 | try { |
| 140 | 149 | Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); |
| 141 | 150 | Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); |
| 142 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 151 | + sql += " and starttimestamp >="+t1 +" and endtimestamp <="+t2; | |
| 143 | 152 | } catch (ParseException e) { |
| 144 | 153 | // TODO Auto-generated catch block |
| 145 | 154 | e.printStackTrace(); |
| ... | ... | @@ -147,6 +156,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 147 | 156 | } |
| 148 | 157 | |
| 149 | 158 | } |
| 159 | + | |
| 160 | + sql +=" and endtimestamp - starttimestamp >10000 ";//yue越界超过10秒的才显示,有待探讨。 | |
| 161 | + | |
| 150 | 162 | Connection conn = null; |
| 151 | 163 | PreparedStatement ps = null; |
| 152 | 164 | ResultSet rs = null; |
| ... | ... | @@ -165,10 +177,9 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 165 | 177 | }finally { |
| 166 | 178 | DBUtils_MS.close(rs, ps, conn); |
| 167 | 179 | } |
| 168 | - | |
| 169 | 180 | PageHelper pageHelper = new PageHelper(totalData, map); |
| 170 | 181 | List<Outbound> list=findAll(pageHelper.getMap()); |
| 171 | - for (int i = 0; i < list.size(); i++) { | |
| 182 | +/* for (int i = 0; i < list.size(); i++) { | |
| 172 | 183 | String nbbm2=list.get(i).getVehicle() ; |
| 173 | 184 | Long d1=list.get(i).getTimestamp(); |
| 174 | 185 | Date datess = new Date(d1); |
| ... | ... | @@ -194,7 +205,7 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 194 | 205 | |
| 195 | 206 | } |
| 196 | 207 | |
| 197 | - } | |
| 208 | + }*/ | |
| 198 | 209 | PageObject<Outbound> pageObject = pageHelper.getPageObject(); |
| 199 | 210 | pageObject.setDataList(list); |
| 200 | 211 | return pageObject; |
| ... | ... | @@ -319,4 +330,45 @@ public class NowOutboundServiceImpl implements NowOutboundService{ |
| 319 | 330 | |
| 320 | 331 | return dataList; |
| 321 | 332 | } |
| 333 | + | |
| 334 | + @Override | |
| 335 | + public List<Outbound> findPosition(String deviceid, String startdate, | |
| 336 | + String enddate){ | |
| 337 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 338 | + String sql = "select vehicle,line,up_down,lon,lat,timestamp from bsth_c_outbound where vehicle = ? and timestamp >= ? and timestamp <= ? order by timestamp "; | |
| 339 | + Connection conn = null; | |
| 340 | + PreparedStatement ps = null; | |
| 341 | + ResultSet rs = null; | |
| 342 | + List<Outbound> listResult = new ArrayList<Outbound>(); | |
| 343 | + Outbound outbound = null; | |
| 344 | + try { | |
| 345 | + conn = DBUtils_MS.getConnection(); | |
| 346 | + ps = conn.prepareStatement(sql); | |
| 347 | + long startTime = sdf.parse(startdate).getTime(); | |
| 348 | + long endTime = sdf.parse(enddate).getTime(); | |
| 349 | + ps.setString(1, deviceid); | |
| 350 | + ps.setLong(2,startTime); | |
| 351 | + ps.setLong(3,endTime); | |
| 352 | + rs = ps.executeQuery(); | |
| 353 | + Location location; | |
| 354 | + while (rs.next()) { | |
| 355 | + outbound = new Outbound(); | |
| 356 | + outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); | |
| 357 | + location = TransGPS.LocationMake(rs.getFloat("lon"), rs.getFloat("lat")); | |
| 358 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | |
| 359 | + outbound.setLon((float)location.getLng()); | |
| 360 | + outbound.setLat((float)location.getLat()); | |
| 361 | + outbound.setTimestamp(rs.getLong("timestamp")); | |
| 362 | + // 上下行 | |
| 363 | + listResult.add(outbound); | |
| 364 | + } | |
| 365 | + } catch (Exception e) { | |
| 366 | + e.printStackTrace(); | |
| 367 | + } finally { | |
| 368 | + DBUtils_MS.close(rs, ps, conn); | |
| 369 | + } | |
| 370 | + return listResult; | |
| 371 | + | |
| 372 | + } | |
| 373 | + | |
| 322 | 374 | } | ... | ... |
src/main/java/com/bsth/service/excep/impl/NowSpeedingServiceImpl.java
| ... | ... | @@ -39,7 +39,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { |
| 39 | 39 | ResultSet rs = null; |
| 40 | 40 | int page=Integer.parseInt(map.get("page").toString()); |
| 41 | 41 | List<Speeding> list=new ArrayList<Speeding>(); |
| 42 | - String sql="select * from bsth_c_speedingmh where 1=1 "; | |
| 42 | + String sql="select * from bsth_c_speeding_handle where 1=1 "; | |
| 43 | 43 | Object line=map.get("line"); |
| 44 | 44 | Object updown=map.get("updown"); |
| 45 | 45 | Object startDate=map.get("startDate"); |
| ... | ... | @@ -128,7 +128,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { |
| 128 | 128 | |
| 129 | 129 | @Override |
| 130 | 130 | public PageObject<Speeding> Pagequery(Map<String, Object> map) { |
| 131 | - String sql="select count(*) record from bsth_c_speedingmh where 1=1 "; | |
| 131 | + String sql="select count(*) record from bsth_c_speeding_handle where 1=1 "; | |
| 132 | 132 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 133 | 133 | Object line=map.get("line"); |
| 134 | 134 | Object updown=map.get("updown"); | ... | ... |
src/main/java/com/bsth/service/oil/CwjyService.java
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
| ... | ... | @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; |
| 24 | 24 | import com.alibaba.fastjson.JSONArray; |
| 25 | 25 | import com.alibaba.fastjson.JSONObject; |
| 26 | 26 | import com.bsth.common.ResponseCode; |
| 27 | +import com.bsth.data.BasicData; | |
| 27 | 28 | import com.bsth.entity.oil.Cwjy; |
| 28 | 29 | import com.bsth.entity.oil.Cyl; |
| 29 | 30 | import com.bsth.entity.oil.Ylb; |
| ... | ... | @@ -281,6 +282,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 281 | 282 | String gsdm=map.get("gsdm_like").toString(); |
| 282 | 283 | |
| 283 | 284 | String fgsdm=map.get("fgsdm_like").toString(); |
| 285 | + String line =map.get("line_like").toString().trim(); | |
| 284 | 286 | /*String sql="SELECT a.gsdm as gsdm,a.fgsdm as fgsdm,a.nbbm as nbbm," |
| 285 | 287 | + "b.jyggh as jyggh,b.jzl as jzl ,b.stationid as stationid,b.jsy as jsy," |
| 286 | 288 | + "b.nylx as nylx,b.yj as yj,b.bz as bz,b.id as id ,c.jsy as ldgh FROM bsth_c_cwjy a "+ |
| ... | ... | @@ -318,7 +320,13 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 318 | 320 | return t; |
| 319 | 321 | } |
| 320 | 322 | }); |
| 321 | - List<Cwjy> cwList=repository.selectAll(nbbm, gsdm, fgsdm); | |
| 323 | + List<Cwjy> cwList=null; | |
| 324 | + if(line.equals("")){ | |
| 325 | + cwList = repository.selectAll(nbbm, gsdm, fgsdm); | |
| 326 | + }else{ | |
| 327 | + cwList = repository.selectAll_s(nbbm, gsdm, fgsdm, line); | |
| 328 | + } | |
| 329 | + | |
| 322 | 330 | String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " |
| 323 | 331 | + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND " |
| 324 | 332 | + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; |
| ... | ... | @@ -338,9 +346,6 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 338 | 346 | Ylxxb y=null; |
| 339 | 347 | for (int i = 0; i < cwList.size(); i++) { |
| 340 | 348 | Cwjy cwjy=cwList.get(i); |
| 341 | - if(cwjy.getNbbm().equals("W7B-092")){ | |
| 342 | - System.out.println(); | |
| 343 | - } | |
| 344 | 349 | y=new Ylxxb(); |
| 345 | 350 | y.setNylx(0); |
| 346 | 351 | y.setId(0); |
| ... | ... | @@ -348,6 +353,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 348 | 353 | y.setGsdm(cwjy.getGsdm()); |
| 349 | 354 | y.setFgsdm(cwjy.getFgsdm()); |
| 350 | 355 | y.setNbbm(cwjy.getNbbm()); |
| 356 | + y.setLinename(cwjy.getLinename()); | |
| 351 | 357 | for (int j = 0; j < yList.size(); j++) { |
| 352 | 358 | Ylxxb ylxxb=yList.get(j); |
| 353 | 359 | if(y.getNbbm().equals(ylxxb.getNbbm())){ |
| ... | ... | @@ -379,9 +385,10 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw |
| 379 | 385 | } |
| 380 | 386 | |
| 381 | 387 | @Override |
| 382 | - public int checkNbbm(String nbbm) { | |
| 388 | + public int checkNbbm(Cwjy t) { | |
| 383 | 389 | // TODO Auto-generated method stub |
| 384 | - String sql="select count(*) from bsth_c_cwjy where nbbm ='"+nbbm+"'"; | |
| 390 | + String sql="select count(*) from bsth_c_cwjy where nbbm ='"+t.getNbbm()+"'" | |
| 391 | + + " and gsdm ='"+t.getFgsdm()+"' and fgsdm ='"+t.getFgsdm()+"'"; | |
| 385 | 392 | int cs=jdbcTemplate.queryForObject(sql, Integer.class); |
| 386 | 393 | |
| 387 | 394 | return cs; | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| ... | ... | @@ -384,6 +384,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS |
| 384 | 384 | for (int i = 0; i < ylxxList.size(); i++) { |
| 385 | 385 | Ylxxb ylxxb = ylxxList.get(i); |
| 386 | 386 | if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) |
| 387 | + && map.get("jGh").toString().equals(ylxxb.getJsy()) | |
| 387 | 388 | && ylxxb.getJylx()==1) { |
| 388 | 389 | if(ylxxb.getJzl()>0){ |
| 389 | 390 | fage2=true; | ... | ... |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| ... | ... | @@ -176,6 +176,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements |
| 176 | 176 | String jsy =jsonObject.getString("jsy"); |
| 177 | 177 | Ylxxb ylxxb=repository.findOne(id); |
| 178 | 178 | ylxxb.setJsy(jsy); |
| 179 | + ylxxb.setJylx(1); | |
| 179 | 180 | repository.save(ylxxb); |
| 180 | 181 | } |
| 181 | 182 | newMap.put("status", ResponseCode.SUCCESS); | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2737,7 +2737,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2737 | 2737 | if (a == 2) { |
| 2738 | 2738 | x = b + 1; |
| 2739 | 2739 | y = x * 2; |
| 2740 | - } else if (b == 1) { | |
| 2740 | + } else if (a == 1) { | |
| 2741 | 2741 | x = b + 1; |
| 2742 | 2742 | y = x * 2 - 1; |
| 2743 | 2743 | } else { |
| ... | ... | @@ -3011,10 +3011,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3011 | 3011 | if (sch == null) |
| 3012 | 3012 | continue; |
| 3013 | 3013 | |
| 3014 | - if (cpc.getClZbh() != null && !carExist(sch.getGsBm(), cpc.getClZbh())) { | |
| 3015 | - rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | |
| 3016 | - rs.put("status", ResponseCode.ERROR); | |
| 3017 | - return rs; | |
| 3014 | + if (cpc.getClZbh() != null) { | |
| 3015 | + if(!carExist(sch.getGsBm(), cpc.getClZbh())) { | |
| 3016 | + rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | |
| 3017 | + rs.put("status", ResponseCode.ERROR); | |
| 3018 | + return rs; | |
| 3019 | + } | |
| 3020 | + else if(!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))){ | |
| 3021 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆"); | |
| 3022 | + rs.put("status", ResponseCode.ERROR); | |
| 3023 | + return rs; | |
| 3024 | + } | |
| 3018 | 3025 | } |
| 3019 | 3026 | |
| 3020 | 3027 | if (StringUtils.isNotEmpty(cpc.getJsy())) { |
| ... | ... | @@ -4068,7 +4075,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4068 | 4075 | if((zdsj_-zdsjActual_)>0){ |
| 4069 | 4076 | zdsjk =String.valueOf(zdsj_-zdsjActual_); |
| 4070 | 4077 | }else{ |
| 4071 | - zdsjm =String.valueOf(zdsj_-zdsjActual_); | |
| 4078 | + zdsjm =String.valueOf(zdsjActual_-zdsj_); | |
| 4072 | 4079 | } |
| 4073 | 4080 | } |
| 4074 | 4081 | tempMap.put("zdsjk" + x, zdsjk); |
| ... | ... | @@ -4095,7 +4102,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4095 | 4102 | if((zdsj_-fcsjActural_)>0){ |
| 4096 | 4103 | fcsjk =String.valueOf(zdsj_-fcsjActural_); |
| 4097 | 4104 | }else{ |
| 4098 | - fcsjm =String.valueOf(zdsj_-fcsjActural_); | |
| 4105 | + fcsjm =String.valueOf(fcsjActural_-zdsj_); | |
| 4099 | 4106 | } |
| 4100 | 4107 | } |
| 4101 | 4108 | tempMap.put("fcsjk" + x, fcsjk); |
| ... | ... | @@ -4439,9 +4446,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4439 | 4446 | try { |
| 4440 | 4447 | List<String> leftList = Splitter.on(",").splitToList(leftIdx); |
| 4441 | 4448 | List<String> rightList = Splitter.on(",").splitToList(rightIdx); |
| 4442 | - | |
| 4443 | - //有班次变更的车辆 | |
| 4444 | - Set<String> cars = new HashSet<>(); | |
| 4449 | + Set<String> lpSet = new HashSet<>(); | |
| 4445 | 4450 | |
| 4446 | 4451 | List<ScheduleRealInfo> largeList, smallList; |
| 4447 | 4452 | if (leftList.size() > rightList.size()) { |
| ... | ... | @@ -4462,7 +4467,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4462 | 4467 | //不对称时多出来的 |
| 4463 | 4468 | lpChangeByLeft(leftSch, largeList.get(i - 1), type); |
| 4464 | 4469 | ts.add(leftSch); |
| 4465 | - cars.add(leftSch.getClZbh()); | |
| 4470 | + lpSet.add(leftSch.getXlBm() + "_" + leftSch.getLpName()); | |
| 4466 | 4471 | continue; |
| 4467 | 4472 | } |
| 4468 | 4473 | |
| ... | ... | @@ -4470,13 +4475,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4470 | 4475 | lpChange(leftSch, rightSch, type); |
| 4471 | 4476 | ts.add(leftSch); |
| 4472 | 4477 | |
| 4473 | - cars.add(leftSch.getClZbh()); | |
| 4474 | - cars.add(rightSch.getClZbh()); | |
| 4478 | + lpSet.add(leftSch.getXlBm() + "_" + leftSch.getLpName()); | |
| 4479 | + lpSet.add(rightSch.getXlBm() + "_" + rightSch.getLpName()); | |
| 4475 | 4480 | } |
| 4476 | 4481 | |
| 4477 | - //重新计算起点应到时间 | |
| 4478 | - for(String nbbm : cars){ | |
| 4479 | - ts.addAll(dayOfSchedule.updateQdzTimePlan(nbbm)); | |
| 4482 | + //重新计算路牌的起点应到时间 | |
| 4483 | + for(String lpName : lpSet){ | |
| 4484 | + ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName)); | |
| 4480 | 4485 | } |
| 4481 | 4486 | |
| 4482 | 4487 | for (ScheduleRealInfo sch : ts) { |
| ... | ... | @@ -4504,6 +4509,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4504 | 4509 | |
| 4505 | 4510 | @Override |
| 4506 | 4511 | public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { |
| 4512 | + //释放班次映射 | |
| 4513 | + if(type > 0) { | |
| 4514 | + dayOfSchedule.removeNbbm2SchMapp(leftSch); | |
| 4515 | + dayOfSchedule.removeNbbm2SchMapp(rightSch); | |
| 4516 | + } | |
| 4517 | + | |
| 4518 | + //对调数据 | |
| 4507 | 4519 | LpData leftData = new LpData(leftSch); |
| 4508 | 4520 | LpData rightData = new LpData(rightSch); |
| 4509 | 4521 | |
| ... | ... | @@ -4511,12 +4523,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4511 | 4523 | rightData.appendTo(leftSch, type); |
| 4512 | 4524 | |
| 4513 | 4525 | if(type > 0){ |
| 4514 | - //更新车辆和班次映射信息 | |
| 4515 | - dayOfSchedule.removeNbbm2SchMapp(leftSch, leftData.getNbbm()); | |
| 4516 | - dayOfSchedule.removeNbbm2SchMapp(rightSch, rightData.getNbbm()); | |
| 4517 | - | |
| 4518 | - dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm()); | |
| 4519 | - dayOfSchedule.addNbbm2SchMapp(rightSch, leftData.getNbbm()); | |
| 4526 | + //重新映射 | |
| 4527 | + dayOfSchedule.addNbbm2SchMapp(leftSch); | |
| 4528 | + dayOfSchedule.addNbbm2SchMapp(rightSch); | |
| 4520 | 4529 | } |
| 4521 | 4530 | } |
| 4522 | 4531 | |
| ... | ... | @@ -4527,14 +4536,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 4527 | 4536 | * @param type |
| 4528 | 4537 | */ |
| 4529 | 4538 | public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { |
| 4530 | - LpData rightData = new LpData(rightSch); | |
| 4539 | + //释放班次映射 | |
| 4540 | + if(type > 0) | |
| 4541 | + dayOfSchedule.removeNbbm2SchMapp(leftSch); | |
| 4531 | 4542 | |
| 4543 | + LpData rightData = new LpData(rightSch); | |
| 4532 | 4544 | rightData.appendTo(leftSch, type); |
| 4533 | 4545 | |
| 4534 | - if(type > 0){ | |
| 4535 | - //更新车辆和班次映射信息 | |
| 4536 | - dayOfSchedule.addNbbm2SchMapp(leftSch, rightData.getNbbm()); | |
| 4537 | - } | |
| 4546 | + //重新映射 | |
| 4547 | + if(type > 0) | |
| 4548 | + dayOfSchedule.addNbbm2SchMapp(leftSch); | |
| 4549 | + | |
| 4538 | 4550 | } |
| 4539 | 4551 | |
| 4540 | 4552 | @Override | ... | ... |
src/main/resources/static/pages/base/interval/edit.html
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | <div class="col-md-12" style="margin-top:10px"> |
| 50 | 50 | <label class="control-label col-md-5"> 间隔等级 :</label> |
| 51 | 51 | <div class="col-md-4"> |
| 52 | - <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级"> | |
| 52 | + <input type="text" class="form-control" name="level" id="levelInput" placeholder="间隔等级" readonly> | |
| 53 | 53 | </div> |
| 54 | 54 | </div> |
| 55 | 55 | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-add-form.js
| ... | ... | @@ -30,21 +30,18 @@ $(function(){ |
| 30 | 30 | focusInvalid : true, |
| 31 | 31 | // 需要验证的表单元素 |
| 32 | 32 | rules : { |
| 33 | - // 公司名称编码 | |
| 34 | 33 | 'level' : { |
| 35 | 34 | // 必填项 |
| 36 | 35 | required : true, |
| 37 | 36 | // 最大长度 |
| 38 | 37 | maxlength: 10 |
| 39 | 38 | }, |
| 40 | - // 公司名称 | |
| 41 | 39 | 'peak' : { |
| 42 | 40 | // 必填项 |
| 43 | 41 | required : true, |
| 44 | 42 | // 最大长度 |
| 45 | 43 | maxlength: 10 |
| 46 | 44 | }, |
| 47 | - // 公司名称 | |
| 48 | 45 | 'trough' : { |
| 49 | 46 | // 必填项 |
| 50 | 47 | required : true, | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-edit-form.js
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | var intervalId = $.url().param('no'); |
| 13 | 13 | // 如果参数ID不为空 |
| 14 | 14 | if(intervalId) { |
| 15 | - // 获取线路Id元素并设值 | |
| 15 | + // 获取间隔信息Id元素并设值 | |
| 16 | 16 | $('#intervalId').val(intervalId); |
| 17 | 17 | /** 根据ID查询详细信息 */ |
| 18 | 18 | $get('/interval/' + intervalId ,null, function(result){ |
| ... | ... | @@ -50,21 +50,18 @@ |
| 50 | 50 | focusInvalid : true, |
| 51 | 51 | // 需要验证的表单元素 |
| 52 | 52 | rules : { |
| 53 | - // 公司名称编码 | |
| 54 | 53 | 'level' : { |
| 55 | 54 | // 必填项 |
| 56 | 55 | required : true, |
| 57 | 56 | // 最大长度 |
| 58 | 57 | maxlength: 10 |
| 59 | 58 | }, |
| 60 | - // 公司名称 | |
| 61 | 59 | 'peak' : { |
| 62 | 60 | // 必填项 |
| 63 | 61 | required : true, |
| 64 | 62 | // 最大长度 |
| 65 | 63 | maxlength: 10 |
| 66 | 64 | }, |
| 67 | - // 公司名称 | |
| 68 | 65 | 'trough' : { |
| 69 | 66 | // 必填项 |
| 70 | 67 | required : true, | ... | ... |
src/main/resources/static/pages/base/interval/js/interval-list-table.js
| ... | ... | @@ -114,6 +114,25 @@ |
| 114 | 114 | // 把数据填充到模版中 |
| 115 | 115 | var tbodyHtml = template('interval_list_temp',{list:result.content}); |
| 116 | 116 | $('#datatable_interval tbody').html(tbodyHtml); |
| 117 | + /** | |
| 118 | + * 绑定删除事件。 | |
| 119 | + */ | |
| 120 | + $(".delete").click(function(){ | |
| 121 | + var intervalId = $(this).data('id'); | |
| 122 | + layer.confirm('是否要删除间隔信息?', { | |
| 123 | + btn: ['确定','取消'] //按钮 | |
| 124 | + }, function(){ | |
| 125 | + $.ajax({ | |
| 126 | + url: '/interval/' + intervalId, | |
| 127 | + type: 'DELETE', | |
| 128 | + success: function(result) { | |
| 129 | + window.location.href = 'list.html'; | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + }, function(){ | |
| 133 | + }); | |
| 134 | + }); | |
| 135 | + | |
| 117 | 136 | // 是重新分页且返回数据长度大于0 |
| 118 | 137 | if(isPon && result.content.length > 0){ |
| 119 | 138 | // 重新分页 |
| ... | ... | @@ -154,4 +173,5 @@ |
| 154 | 173 | } |
| 155 | 174 | }); |
| 156 | 175 | } |
| 176 | + | |
| 157 | 177 | })(); |
| 158 | 178 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/interval/list.html
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | <span class="caption-subject font-dark sbold uppercase">间隔信息</span> |
| 26 | 26 | </div> |
| 27 | 27 | <div class="actions"> |
| 28 | - <div class="btn-group btn-group-devided" data-toggle="buttons"> | |
| 28 | + <div class="btn-group btn-group-devided" data-toggle="buttons" style="display:none"> | |
| 29 | 29 | <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加间隔信息</a> |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| ... | ... | @@ -36,7 +36,6 @@ |
| 36 | 36 | <thead> |
| 37 | 37 | <tr role="row" class="heading"> |
| 38 | 38 | <th >序号</th> |
| 39 | - <th >间隔ID</th> | |
| 40 | 39 | <th >间隔等级</th> |
| 41 | 40 | <th >高峰间隔时间</th> |
| 42 | 41 | <th >低谷间隔时间</th> |
| ... | ... | @@ -47,7 +46,6 @@ |
| 47 | 46 | <td></td> |
| 48 | 47 | <td></td> |
| 49 | 48 | <td></td> |
| 50 | - <td></td> | |
| 51 | 49 | <td> |
| 52 | 50 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 53 | 51 | <i class="fa fa-search"></i> 搜索 |
| ... | ... | @@ -76,9 +74,6 @@ |
| 76 | 74 | {{(list.page*10)+(i+1)}} |
| 77 | 75 | </td> |
| 78 | 76 | <td> |
| 79 | - {{obj.id}} | |
| 80 | - </td> | |
| 81 | - <td> | |
| 82 | 77 | {{obj.level}} |
| 83 | 78 | </td> |
| 84 | 79 | <td> |
| ... | ... | @@ -89,7 +84,7 @@ |
| 89 | 84 | </td> |
| 90 | 85 | <td> |
| 91 | 86 | <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a> |
| 92 | - <a class="btn btn-danger btn-sm" onclick="del({{obj.id}})"> 删除</a> | |
| 87 | + <a class="btn btn-danger btn-sm delete" data-id={{obj.id}}> 删除</a> | |
| 93 | 88 | </td> |
| 94 | 89 | </tr> |
| 95 | 90 | {{/each}} |
| ... | ... | @@ -99,22 +94,4 @@ |
| 99 | 94 | </tr> |
| 100 | 95 | {{/if}} |
| 101 | 96 | </script> |
| 102 | -<!-- <script src="/pages/base/line/js/tipso.js"></script> --> | |
| 103 | -<!-- 线路信息片段JS模块 --> | |
| 104 | -<script src="/pages/base/interval/js/interval-list-table.js"></script> | |
| 105 | -<script> | |
| 106 | - function del(intervalId){ | |
| 107 | - layer.confirm('确定要删除间隔信息吗?', { | |
| 108 | - btn: ['确定','取消'] //按钮 | |
| 109 | - }, function(){ | |
| 110 | - $.ajax({ | |
| 111 | - url: '/interval/' + intervalId, | |
| 112 | - type: 'DELETE', | |
| 113 | - success: function(result) { | |
| 114 | - window.location.href = 'list.html'; | |
| 115 | - } | |
| 116 | - }); | |
| 117 | - }, function(){ | |
| 118 | - }); | |
| 119 | - } | |
| 120 | -</script> | |
| 121 | 97 | \ No newline at end of file |
| 98 | +<script src="/pages/base/interval/js/interval-list-table.js"></script> | |
| 122 | 99 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/excep/js/line-list-function.js
| ... | ... | @@ -48,7 +48,7 @@ var PublicFunctions = function () { |
| 48 | 48 | linePanlThree : function(lineId,data,direction) { |
| 49 | 49 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| 50 | 50 | $get('/stationroute/getStationRouteCenterPoints',{lineId:lineId,direction:direction},function(resultdata) { |
| 51 | - SpeedingMap.clearMarkAndOverlays(); | |
| 51 | + BasicMap.clearMarkAndOverlays(); | |
| 52 | 52 | var polyline_center; |
| 53 | 53 | // 如果站点路由数据不为空 |
| 54 | 54 | if(resultdata.length>0) { |
| ... | ... | @@ -66,7 +66,7 @@ var PublicFunctions = function () { |
| 66 | 66 | // 设置中心点 |
| 67 | 67 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); |
| 68 | 68 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 69 | - SpeedingMap.drawingUpStationPoint(point_center,stationName,s+1); | |
| 69 | + BasicMap.drawingUpStationPoint(point_center,stationName,s+1); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | } |
| ... | ... | @@ -91,7 +91,7 @@ var PublicFunctions = function () { |
| 91 | 91 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); |
| 92 | 92 | } |
| 93 | 93 | /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ |
| 94 | - SpeedingMap.drawingUpline01(polylineArray,polyline_center,data[d]); | |
| 94 | + BasicMap.drawingUpline01(polylineArray,polyline_center,data[d]); | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | }); | ... | ... |
src/main/resources/static/pages/excep/js/map.js
0 → 100644
| 1 | +/** | |
| 2 | + * 百度地图 | |
| 3 | + * | |
| 4 | + * - - - - - -》init:地图初始化 | |
| 5 | + * | |
| 6 | + * - - - - - -》getDistanceAndDuration:获取距离与时间 | |
| 7 | + * | |
| 8 | + * - - - - - -》drawingUpline:在地图上画出上行线路走向 | |
| 9 | + * | |
| 10 | + * - - - - - -》stationsPointsToLibraryPoint:根据站点坐标匹配库中的公交站点(手动规划) | |
| 11 | + */ | |
| 12 | + | |
| 13 | +var BasicMap = function () { | |
| 14 | + | |
| 15 | + /** BasicMap 全局变量定义 mapBValue:地图对象;polyUpline:走向折线;sectionList:截取过的路段 ;pointIndex:计算路段被切的次数; | |
| 16 | + * firstPoint:截取路段的第一个点;iseditStatus:路段是否在编辑状态;isCutSection : 获取路段是否在截取状态*/ | |
| 17 | + var mapBValue = '', polyUpline='', sectionList = [], pointIndex = 0, iseditStatus = false, firstPoint = {}, isCutSection = false; | |
| 18 | + | |
| 19 | + var Bmap = { | |
| 20 | + | |
| 21 | + init : function() { | |
| 22 | + | |
| 23 | + // 设置中心点, | |
| 24 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 25 | + | |
| 26 | + // 百度API Key | |
| 27 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 28 | + | |
| 29 | + // 初始化百度地图 | |
| 30 | + mapBValue = new BMap.Map("BasicMap"); | |
| 31 | + | |
| 32 | + //中心点和缩放级别 | |
| 33 | + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat),15); | |
| 34 | + | |
| 35 | + //启用地图拖拽事件,默认启用(可不写) | |
| 36 | + mapBValue.enableDragging(); | |
| 37 | + | |
| 38 | + //启用地图滚轮放大缩小 | |
| 39 | + mapBValue.enableScrollWheelZoom(); | |
| 40 | + | |
| 41 | + //禁用鼠标双击放大 | |
| 42 | + mapBValue.disableDoubleClickZoom(); | |
| 43 | + | |
| 44 | + //启用键盘上下左右键移动地图 | |
| 45 | + mapBValue.enableKeyboard(); | |
| 46 | + | |
| 47 | + return mapBValue; | |
| 48 | + }, | |
| 49 | + /** 获取第一个切路段的点 @return Point*/ | |
| 50 | + getFirstPoint : function() { | |
| 51 | + return firstPoint; | |
| 52 | + }, | |
| 53 | + /** 获取地图对象 @return 地图对象map */ | |
| 54 | + getmapBValue : function() { | |
| 55 | + | |
| 56 | + return mapBValue; | |
| 57 | + | |
| 58 | + }, | |
| 59 | + | |
| 60 | + getPolyUpline : function() { | |
| 61 | + | |
| 62 | + return polyUpline; | |
| 63 | + }, | |
| 64 | + | |
| 65 | + /** 获取截取过的路段 @return 路段对象List */ | |
| 66 | + getSectionList : function() { | |
| 67 | + | |
| 68 | + return sectionList; | |
| 69 | + | |
| 70 | + }, | |
| 71 | + setSectionList : function(list) { | |
| 72 | + | |
| 73 | + sectionList = list; | |
| 74 | + }, | |
| 75 | + initCutSectionPoint : function() { | |
| 76 | + sectionList = []; | |
| 77 | + var tbodyHtml = template('section_list',{list : sectionList}); | |
| 78 | + $('#section_table tbody').html(tbodyHtml); | |
| 79 | + }, | |
| 80 | + /** 获取切路段的点下标 @return int*/ | |
| 81 | + setPointIndex : function(index) { | |
| 82 | + pointIndex = index; | |
| 83 | + }, | |
| 84 | + getPointIndex : function() { | |
| 85 | + | |
| 86 | + return pointIndex; | |
| 87 | + | |
| 88 | + }, | |
| 89 | + /** 获取路段是否在编辑状态 @return boolean*/ | |
| 90 | + getIsEditStatus : function() { | |
| 91 | + return iseditStatus; | |
| 92 | + }, | |
| 93 | + setIsEditStatus : function(v) { | |
| 94 | + iseditStatus = v ; | |
| 95 | + }, | |
| 96 | + | |
| 97 | + /** 获取路段是否在截取状态 @return boolean*/ | |
| 98 | + getIsCutSection : function() { | |
| 99 | + return isCutSection; | |
| 100 | + }, | |
| 101 | + setIsCutSection : function(v) { | |
| 102 | + isCutSection = v ; | |
| 103 | + }, | |
| 104 | + | |
| 105 | + /** 获取距离与时间 @param <points:坐标点集合> */ | |
| 106 | + getDistanceAndDuration : function(points,callback){ | |
| 107 | + | |
| 108 | + // 获取长度 | |
| 109 | + var len = points.length; | |
| 110 | + (function(){ | |
| 111 | + | |
| 112 | + if (!arguments.callee.count) { | |
| 113 | + | |
| 114 | + arguments.callee.count = 0; | |
| 115 | + | |
| 116 | + } | |
| 117 | + | |
| 118 | + arguments.callee.count++; | |
| 119 | + | |
| 120 | + var index = parseInt(arguments.callee.count) - 1; | |
| 121 | + | |
| 122 | + if (index >= len-1) { | |
| 123 | + | |
| 124 | + callback && callback(points); | |
| 125 | + | |
| 126 | + return; | |
| 127 | + } | |
| 128 | + | |
| 129 | + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | |
| 130 | + var f = arguments.callee; | |
| 131 | + // 起点坐标 <坐标格式:40.056878,116.30815> | |
| 132 | + var origin = points[index].potion.lat + ',' + points[index].potion.lng; | |
| 133 | + | |
| 134 | + // 终点坐标 <坐标格式:40.056878,116.30815> | |
| 135 | + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng; | |
| 136 | + var region = '上海'; | |
| 137 | + | |
| 138 | + var origin_region = '上海'; | |
| 139 | + | |
| 140 | + var destination_region = '上海'; | |
| 141 | + | |
| 142 | + var output = 'json'; | |
| 143 | + | |
| 144 | + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | |
| 145 | + | |
| 146 | + /** | |
| 147 | + * origin:起点名称或经纬度; | |
| 148 | + * | |
| 149 | + * destination:终点名称或经纬度; | |
| 150 | + * | |
| 151 | + * origin_region:起始点所在城市,驾车导航时必填。 | |
| 152 | + * | |
| 153 | + * destination_region:终点所在城市,驾车导航时必填。 | |
| 154 | + * | |
| 155 | + * output :表示输出类型,可设置为xml或json,默认为xml。 | |
| 156 | + * | |
| 157 | + **/ | |
| 158 | + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My}; | |
| 159 | + | |
| 160 | + /** @description :未认证开发者默认配额为:2000次/天。 */ | |
| 161 | + $.ajax({ | |
| 162 | + | |
| 163 | + // 百度地图根据坐标获取两点之间的时间与距离 | |
| 164 | + url: 'http://api.map.baidu.com/direction/v1?mode=transit', | |
| 165 | + | |
| 166 | + data: paramsB, | |
| 167 | + | |
| 168 | + dataType: 'jsonp', | |
| 169 | + | |
| 170 | + success: function(r){ | |
| 171 | + | |
| 172 | + if(r) { | |
| 173 | + | |
| 174 | + if(r.message=='ok') { | |
| 175 | + | |
| 176 | + if(r.result.taxi==null) { | |
| 177 | + | |
| 178 | + // 获取距离(单位:米) | |
| 179 | + points[index+1].distance = 0; | |
| 180 | + | |
| 181 | + // 获取时间(单位:秒) | |
| 182 | + points[index+1].duration = 0; | |
| 183 | + | |
| 184 | + }else { | |
| 185 | + | |
| 186 | + // 获取距离(单位:米) | |
| 187 | + points[index+1].distance = r.result.taxi.distance; | |
| 188 | + | |
| 189 | + // 获取时间(单位:秒) | |
| 190 | + points[index+1].duration = r.result.taxi.duration; | |
| 191 | + | |
| 192 | + } | |
| 193 | + | |
| 194 | + | |
| 195 | + } | |
| 196 | + | |
| 197 | + } | |
| 198 | + | |
| 199 | + f(); | |
| 200 | + } | |
| 201 | + }); | |
| 202 | + | |
| 203 | + })(); | |
| 204 | + | |
| 205 | + }, | |
| 206 | + // 在地图上画出上行线路走向 | |
| 207 | + drawingUpline01 : function (polylineArray,polyline_center,data) { | |
| 208 | + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | |
| 209 | + // 创建线路走向 | |
| 210 | + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | |
| 211 | + polyUpline01.data = data; | |
| 212 | + // 把折线添加到地图上 | |
| 213 | + mapBValue.addOverlay(polyUpline01); | |
| 214 | + var sectionPoint = []; | |
| 215 | + // 线路单击事件 | |
| 216 | + polyUpline01.addEventListener('click',function(e) { | |
| 217 | + if(BasicMap.getIsEditStatus()) { | |
| 218 | + layer.msg('请先保存正在编辑的路段信息...'); | |
| 219 | + return false; | |
| 220 | + } | |
| 221 | + if(BasicMap.getIsCutSection()) { | |
| 222 | + layer.msg('请先撤销所有切路段的点...'); | |
| 223 | + return false; | |
| 224 | + } | |
| 225 | + polyUpline01.enableEditing(); | |
| 226 | + BasicMap.setIsEditStatus(true); | |
| 227 | + }); | |
| 228 | + | |
| 229 | + // 添加路段双击事件 | |
| 230 | + polyUpline01.addEventListener("dblclick",function(e){ | |
| 231 | + if(BasicMap.getIsCutSection()) { | |
| 232 | + layer.msg('请先撤销所有切路段的点...'); | |
| 233 | + return false; | |
| 234 | + } | |
| 235 | + BasicMap.setIsEditStatus(false); | |
| 236 | + // 关闭 | |
| 237 | + layer.closeAll(); | |
| 238 | + polyUpline01.disableEditing(); | |
| 239 | + EditSectionObj.setEitdSection(polyUpline01.data); | |
| 240 | + // 获取折线坐标集合 | |
| 241 | + var editPloyLineArray = polyUpline01.getPath(); | |
| 242 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | |
| 243 | + sectionList = []; | |
| 244 | + var tbodyHtml = template('section_list',{list : sectionList}); | |
| 245 | + // 截取路段 | |
| 246 | + $('#section_table tbody').html(tbodyHtml); | |
| 247 | + // 加载修改路段弹出层mobal页面 | |
| 248 | + $.get('editsection.html', function(m){ | |
| 249 | + $(pjaxContainer).append(m); | |
| 250 | + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [BasicMap,GetAjaxData,EditSectionObj,PublicFunctions]); | |
| 251 | + }); | |
| 252 | + }); | |
| 253 | + | |
| 254 | + // 路段右击事件 | |
| 255 | + var editSection = function(e,ee,marker){ | |
| 256 | + if(BasicMap.getIsEditStatus()) { | |
| 257 | + layer.msg('请先保存正在编辑的路段信息...'); | |
| 258 | + return false; | |
| 259 | + } | |
| 260 | + var lng = e.lng; | |
| 261 | + var lat = e.lat; | |
| 262 | + var sectionName = null; | |
| 263 | + var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点 | |
| 264 | + marker.isFlag = true; | |
| 265 | + if(pointIndex == 0) { | |
| 266 | + sectionPoint[pointIndex] = {lng:lng , lat:lat}; | |
| 267 | + layer.msg('进入切路段状态,请选择本路段的终点!'); | |
| 268 | + mapBValue.addOverlay(marker);// 添加覆盖物 | |
| 269 | + firstPoint = {lng:lng, lat:lat}; | |
| 270 | + pointIndex++; | |
| 271 | + EditSectionObj.setEitdSection(polyUpline01.data); | |
| 272 | + // 获取折线坐标集合 | |
| 273 | + var editPloyLineArray = polyUpline01.getPath(); | |
| 274 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | |
| 275 | + } else if (pointIndex > 0) { | |
| 276 | + layer.prompt({title: '请输入路段名!'}, function(sectionName, index){ | |
| 277 | + pointList = []; | |
| 278 | + sectionPoint[pointIndex] = {lng:lng , lat:lat}; | |
| 279 | + pointList[0] = sectionPoint[pointIndex-1]; | |
| 280 | + pointList[1] = sectionPoint[pointIndex]; | |
| 281 | + sectionList.push({name:sectionName, section:pointList}); | |
| 282 | + layer.close(index); | |
| 283 | + layer.msg('路段截取成功,请选择下一个路段的终点'); | |
| 284 | + mapBValue.addOverlay(marker);// 添加覆盖物 | |
| 285 | + var tbodyHtml = template('section_list',{list : sectionList}); | |
| 286 | + // 截取路段 | |
| 287 | + $('#section_table tbody').html(tbodyHtml); | |
| 288 | + pointIndex++; | |
| 289 | + }); | |
| 290 | + } | |
| 291 | + BasicMap.setIsCutSection(true); | |
| 292 | + } | |
| 293 | + var markerMenu=new BMap.ContextMenu(); | |
| 294 | + markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01))); | |
| 295 | + polyUpline01.addContextMenu(markerMenu); | |
| 296 | + | |
| 297 | + | |
| 298 | + var PanOptions_ ={noAnimation :true}; | |
| 299 | + mapBValue.reset(); | |
| 300 | + mapBValue.panTo(polyline_center,PanOptions_); | |
| 301 | + mapBValue.panBy(500,-510,PanOptions_); | |
| 302 | + mapBValue.setZoom(14); | |
| 303 | + }, | |
| 304 | + // 删除点刷新cutSectionTable | |
| 305 | + refreshCutSectionTable : function() { | |
| 306 | + var tbodyHtml = template('section_list',{list : sectionList}); | |
| 307 | + $('#section_table tbody').html(tbodyHtml); | |
| 308 | + }, | |
| 309 | + // 删除点刷新覆盖物 | |
| 310 | + deleteCutSectionPoint : function(point) { | |
| 311 | + var lng = point.lng; | |
| 312 | + var lat = point.lat; | |
| 313 | + var allOverlay = mapBValue.getOverlays(); | |
| 314 | + // 删除最后一个点 | |
| 315 | + for (var i = 0; i < allOverlay.length -1; i++){ | |
| 316 | + if(allOverlay[i].isFlag) { | |
| 317 | + if(allOverlay[i].point.lng == lng && allOverlay[i].point.lat == lat){ | |
| 318 | + mapBValue.removeOverlay(allOverlay[i]); | |
| 319 | + break; | |
| 320 | + } | |
| 321 | + } | |
| 322 | + } | |
| 323 | + }, | |
| 324 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | |
| 325 | + drawingUpStationPoint : function(point_center,stationName,s) { | |
| 326 | + | |
| 327 | + // 自定义标注物图片 | |
| 328 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10)); | |
| 329 | + | |
| 330 | + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">' | |
| 331 | + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">' | |
| 332 | + + '</div>' | |
| 333 | + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>'; | |
| 334 | + | |
| 335 | + | |
| 336 | + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{ | |
| 337 | + "anchor" : new BMap.Size(-10,8), | |
| 338 | + "enableDragging" : true}); | |
| 339 | + | |
| 340 | + | |
| 341 | + myRichMarker1.disableDragging(); | |
| 342 | + mapBValue.addOverlay(myRichMarker1); | |
| 343 | + | |
| 344 | + | |
| 345 | + // 创建标注物 | |
| 346 | + marker = new BMap.Marker(point_center,{icon : icon_target}); | |
| 347 | + | |
| 348 | + // 允许覆盖物在map.clearOverlays方法中被清除。 | |
| 349 | + marker.enableMassClear(); | |
| 350 | + | |
| 351 | + mapBValue.addOverlay(marker); | |
| 352 | + }, | |
| 353 | + | |
| 354 | + // 根据站点坐标匹配库中的公交站点(手动规划) | |
| 355 | + stationsPointsToLibraryPoint : function(arra,callback) { | |
| 356 | + // 获取长度 | |
| 357 | + var len = arra.length; | |
| 358 | + var station = {}; | |
| 359 | + var stationList = []; | |
| 360 | + (function(){ | |
| 361 | + if (!arguments.callee.count) { | |
| 362 | + arguments.callee.count = 0; | |
| 363 | + } | |
| 364 | + arguments.callee.count++; | |
| 365 | + var index = parseInt(arguments.callee.count) - 1; | |
| 366 | + if (index >= len) { | |
| 367 | + callback && callback(stationList); | |
| 368 | + return ; | |
| 369 | + } | |
| 370 | + var f = arguments.callee; | |
| 371 | + station = arra[index]; | |
| 372 | + if(arra[index].name!=''){ | |
| 373 | + | |
| 374 | + $.get('/station/matchStation',station,function(resultStation) { | |
| 375 | + stationList.push({name:resultStation.name ,wgs:arra[index].wgs,potion:{lng:resultStation.potion_lng, lat:resultStation.potion_lat}, isHave:resultStation.isHave , id:resultStation.id}); | |
| 376 | + f(); | |
| 377 | + }); | |
| 378 | + }else { | |
| 379 | + f(); | |
| 380 | + } | |
| 381 | + })() | |
| 382 | + }, | |
| 383 | + clearMarkAndOverlays : function() { | |
| 384 | + | |
| 385 | + // 清楚地图覆盖物 | |
| 386 | + mapBValue.clearOverlays(); | |
| 387 | + | |
| 388 | + mapBValue.removeOverlay(); | |
| 389 | + | |
| 390 | + } | |
| 391 | + | |
| 392 | + } | |
| 393 | + | |
| 394 | + return Bmap; | |
| 395 | + | |
| 396 | +}(); | |
| 0 | 397 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/excep/mhspeedingList.html
| ... | ... | @@ -128,7 +128,7 @@ |
| 128 | 128 | data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" |
| 129 | 129 | data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" |
| 130 | 130 | data-endlat="{{obj.endlat}}" data-lineid="{{obj.lineId}}" data-updown="{{obj.upDown}}"> |
| 131 | - 查看轨迹 | |
| 131 | + 轨迹回放 | |
| 132 | 132 | </a> |
| 133 | 133 | </td> |
| 134 | 134 | <td> |
| ... | ... | @@ -270,7 +270,6 @@ $(function(){ |
| 270 | 270 | index++; |
| 271 | 271 | }); |
| 272 | 272 | })(); |
| 273 | - console.log(listResult); | |
| 274 | 273 | }); |
| 275 | 274 | } |
| 276 | 275 | ... | ... |
src/main/resources/static/pages/excep/outBoundMap.html deleted
100644 → 0
| 1 | -<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> | |
| 2 | -<div class="portlet-body"> | |
| 3 | - <!-- 地图 --> | |
| 4 | - <div id="bmap_basic" class="bmaps"></div> | |
| 5 | -</div> | |
| 6 | -<!-- load事件 --> | |
| 7 | -<script src="/pages/excep/js/outboundmap-load.js"></script> | |
| 8 | -<!-- 线路类 --> | |
| 9 | -<script src="/pages/excep/js/outboundline.js"></script> | |
| 10 | -<!-- 绘图类 --> | |
| 11 | -<script src="/pages/base/stationroute/js/drawingManager.js"></script> | |
| 12 | -<!-- 地图类 --> | |
| 13 | -<script src="/pages/excep/js/outbound-map.js"></script> | |
| 14 | -<!-- 函数与方法 --> | |
| 15 | -<script src="/pages/excep/js/outboundmap-function.js"></script> | |
| 16 | -<!-- ajax请求类 --> | |
| 17 | -<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> | |
| 18 | - |
src/main/resources/static/pages/excep/outboundMap.html
0 → 100644
| 1 | +<style> | |
| 2 | + .play_back-layer .layui-layer-title{ | |
| 3 | + height: 36px; | |
| 4 | + border-bottom: none; | |
| 5 | + } | |
| 6 | +</style> | |
| 7 | + | |
| 8 | +<div id="titleMap"> | |
| 9 | +<button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button> | |
| 10 | +</div> | |
| 11 | +<div id="BasicMap"> | |
| 12 | +</div> | |
| 13 | +<style type="text/css"> | |
| 14 | + | |
| 15 | +#BasicMap{ | |
| 16 | + width: 100%; | |
| 17 | + border: 2px solid #fdfdfd; | |
| 18 | + height: calc(100% - 30px); | |
| 19 | + overflow: hidden; | |
| 20 | +} | |
| 21 | +</style> | |
| 22 | +<script type="text/javascript" src="/pages/excep/js/map.js"></script> | |
| 23 | +<script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script> | |
| 24 | + | |
| 25 | +<script type="text/javascript"> | |
| 26 | +$(function(){ | |
| 27 | + var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间 | |
| 28 | + localStorage.clear();//清楚前端缓存 | |
| 29 | + var vehicle = dataArr[0]; | |
| 30 | + var startdate = dataArr[1]; | |
| 31 | + var enddate = dataArr[2]; | |
| 32 | + var lon = dataArr[3];//起点经度 | |
| 33 | + var lat = dataArr[4];//起点纬度 | |
| 34 | + var endLon = dataArr[5];//终点经度 | |
| 35 | + var endLat = dataArr[6];//终点纬度 | |
| 36 | + var lineid = dataArr[7]; | |
| 37 | + var directionData = dataArr[8]; | |
| 38 | + var pointObj;//坐标和速度组成的对象 | |
| 39 | + var Points = [];//坐标和速度对象的集合 | |
| 40 | + var coordinateArr = [];//坐标点数组 | |
| 41 | + $.ajax({ | |
| 42 | + type: "GET", | |
| 43 | + async:false, | |
| 44 | + url: '/nowbound/findPosition', | |
| 45 | + data: {vehicle:vehicle,startdate:startdate,enddate:enddate}, | |
| 46 | + success: function(data){ | |
| 47 | + $.each(data,function(i,item){ | |
| 48 | + if(item.lon>1 && item.lat>1){ | |
| 49 | + pointObj = new Object(); | |
| 50 | + pointObj.coordinate = new BMap.Point(item.lon,item.lat); | |
| 51 | + pointObj.vehicle = item.vehicle; | |
| 52 | + Points.push(pointObj); | |
| 53 | + } | |
| 54 | + }); | |
| 55 | + } | |
| 56 | + }); | |
| 57 | + setTimeout(function(){ | |
| 58 | + var map = BasicMap.init();//创建地图 | |
| 59 | + $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) { | |
| 60 | + // 在地图上画出线路走向 | |
| 61 | + PublicFunctions.linePanlThree(lineid,data,directionData); | |
| 62 | + }); | |
| 63 | + var myP1 = new BMap.Point(lon,lat); //起点 | |
| 64 | + var myP2 = new BMap.Point(endLon,endLat); //终点 | |
| 65 | + for(i in Points){ | |
| 66 | + coordinateArr.push(Points[i].coordinate); | |
| 67 | + } | |
| 68 | + var polyline = new BMap.Polyline(coordinateArr, {strokeColor:"red", strokeWeight:5, strokeOpacity:0.5});//创建折线 | |
| 69 | + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片 | |
| 70 | + imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。 | |
| 71 | + }); | |
| 72 | + | |
| 73 | + var carMk; | |
| 74 | + $(document).on('click', '#run', function() { | |
| 75 | + map.centerAndZoom(new BMap.Point(lon,lat),16);//地图中心点坐标 */ | |
| 76 | + if(typeof(carMk)!="undefined"){ | |
| 77 | + map.removeOverlay(carMk);//清空上一次的轨迹 | |
| 78 | + } | |
| 79 | + carMk = new BMap.Marker(coordinateArr[0],{icon:myIcon}); | |
| 80 | + map.addOverlay(polyline);//增加折线 | |
| 81 | + var paths = coordinateArr.length;//获得有几个点 | |
| 82 | + map.addOverlay(carMk); | |
| 83 | + i=0; | |
| 84 | + setTimeout(function(){ | |
| 85 | + resetMkPoint(0); | |
| 86 | + },500); | |
| 87 | + function resetMkPoint(i){ | |
| 88 | + carMk.setPosition(coordinateArr[i]); | |
| 89 | + if(i < paths-1){ | |
| 90 | + setTimeout(function(){ | |
| 91 | + i++; | |
| 92 | + resetMkPoint(i); | |
| 93 | + },500); | |
| 94 | + } | |
| 95 | + }; | |
| 96 | + | |
| 97 | + }); | |
| 98 | + }, 500); | |
| 99 | + }); | |
| 100 | +</script> | |
| 101 | + | |
| 102 | + | ... | ... |
src/main/resources/static/pages/excep/pdboundList.html
| ... | ... | @@ -56,26 +56,21 @@ |
| 56 | 56 | <th width="3%">#</th> |
| 57 | 57 | <th width="15%">线路</th> |
| 58 | 58 | <th width="13%">车辆自编号</th> |
| 59 | - <th width="100">车辆坐标</th> | |
| 60 | - <th width="11%">路牌名</th> | |
| 61 | 59 | <th width="10%">上下行</th> |
| 62 | - <th width="18%">时间</th> | |
| 60 | + <th width="10%">越界位置</th> | |
| 61 | + <th width="18%">越界开始时间</th> | |
| 62 | + <th width="100">查看轨迹</th> | |
| 63 | 63 | <th width="18%">操作</th> |
| 64 | 64 | </tr> |
| 65 | 65 | <tr role="row" class="filter"> |
| 66 | 66 | <td></td> |
| 67 | 67 | <td> |
| 68 | -<!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> | |
| 69 | 68 | <select class="form-control" name="line" id="line" style="width: 150px;"></select> |
| 70 | 69 | </td> |
| 71 | 70 | <td> |
| 72 | -<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> --> | |
| 73 | 71 | <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> |
| 74 | 72 | </td> |
| 75 | 73 | <td> |
| 76 | - </td> | |
| 77 | - <td></td> | |
| 78 | - <td> | |
| 79 | 74 | <select class="form-control form-filter " name="updown"> |
| 80 | 75 | <option value="">请选择...</option> |
| 81 | 76 | <option value="0">上行</option> |
| ... | ... | @@ -84,8 +79,11 @@ |
| 84 | 79 | </select> |
| 85 | 80 | </td> |
| 86 | 81 | <td> |
| 82 | + </td> | |
| 83 | + <td> | |
| 87 | 84 | <input class="form-control" type="date" name="date" /> |
| 88 | 85 | </td> |
| 86 | + <td></td> | |
| 89 | 87 | <td> |
| 90 | 88 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 91 | 89 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -119,15 +117,6 @@ |
| 119 | 117 | {{obj.vehicle}} |
| 120 | 118 | </td> |
| 121 | 119 | <td> |
| 122 | - <a href="/pages/excep/outBoundMap.html?no={{obj.line}},{{obj.upDown}},{{obj.lon}},{{obj.lat}}" | |
| 123 | - class="btn default blue-stripe btn-sm" data-pjax> | |
| 124 | - 查看车辆位置 | |
| 125 | - </a> | |
| 126 | - </td> | |
| 127 | - <td> | |
| 128 | - {{obj.lpname}} | |
| 129 | - </td> | |
| 130 | - <td> | |
| 131 | 120 | {{if obj.upDown==0}} |
| 132 | 121 | 上行 |
| 133 | 122 | {{else if obj.upDown==1}} |
| ... | ... | @@ -137,9 +126,20 @@ |
| 137 | 126 | {{/if}} |
| 138 | 127 | </td> |
| 139 | 128 | <td> |
| 129 | + {{obj.address}} | |
| 130 | + </td> | |
| 131 | + <td> | |
| 140 | 132 | {{obj.timestampDate}} |
| 141 | 133 | </td> |
| 142 | 134 | <td> |
| 135 | + <a class="btn default blue-stripe btn-sm lookTrajectory" data-vehicle ="{{obj.vehicle}}" | |
| 136 | + data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}" | |
| 137 | + data-lon="{{obj.lon}}" data-lat="{{obj.lat}}" data-endlon="{{obj.endlon}}" | |
| 138 | + data-endlat="{{obj.endlat}}" data-lineid="{{obj.line}}" data-updown="{{obj.upDown}}"> | |
| 139 | + 轨迹回放 | |
| 140 | + </a> | |
| 141 | + </td> | |
| 142 | + <td> | |
| 143 | 143 | |
| 144 | 144 | </td> |
| 145 | 145 | </tr> |
| ... | ... | @@ -170,7 +170,6 @@ $(function(){ |
| 170 | 170 | jsDoQuery(parameter,true); |
| 171 | 171 | //重置 |
| 172 | 172 | $('tr.filter .filter-cancel').on('click', function(){ |
| 173 | - debugger; | |
| 174 | 173 | $('tr.filter input, select').val('').change(); |
| 175 | 174 | jsDoQuery(null, true); |
| 176 | 175 | }); |
| ... | ... | @@ -205,19 +204,55 @@ $(function(){ |
| 205 | 204 | params['page'] = page; |
| 206 | 205 | var i = layer.load(2); |
| 207 | 206 | $get('/nowbound/pagequery' ,params, function(data){ |
| 208 | -// $.each(data.content, function(i, obj) { | |
| 209 | -// obj.lastLoginDate = moment(obj.lastLoginDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 210 | -// }); | |
| 211 | - var bodyHtm = template('bound_list_temp', {list: data.dataList}); | |
| 212 | - $('#datatable_bound tbody').html(bodyHtm) | |
| 213 | - .find('.icheck').iCheck(icheckOptions) | |
| 214 | - .on('ifChanged', iCheckChange); | |
| 215 | - if(pagination && data.dataList.length > 0){ | |
| 216 | - //重新分页 | |
| 217 | - initPagination = true; | |
| 218 | - showPagination(data); | |
| 219 | - } | |
| 220 | - layer.close(i); | |
| 207 | + var listResult = data.dataList; | |
| 208 | + var index=0; | |
| 209 | + (function(){ | |
| 210 | + var f = arguments.callee; | |
| 211 | + if(index >= listResult.length){ | |
| 212 | + var bodyHtm = template('bound_list_temp', {list:listResult}); | |
| 213 | + $('#datatable_bound tbody').html(bodyHtm).find('.icheck').iCheck(icheckOptions).on('ifChanged', iCheckChange); | |
| 214 | + if(pagination && data.dataList.length > 0){ | |
| 215 | + //重新分页 | |
| 216 | + initPagination = true; | |
| 217 | + showPagination(data); | |
| 218 | + } | |
| 219 | + layer.close(i); | |
| 220 | + $(".lookTrajectory").click(function(){ | |
| 221 | + var vehicle = $(this).data('vehicle'); | |
| 222 | + var startDate = $(this).data('startdate'); | |
| 223 | + var endDate = $(this).data('enddate'); | |
| 224 | + var lon = $(this).data('lon'); | |
| 225 | + var lat = $(this).data('lat'); | |
| 226 | + var endLon = $(this).data('endlon'); | |
| 227 | + var endLat = $(this).data('endlat'); | |
| 228 | + var lineid = $(this).data('lineid'); | |
| 229 | + var upDown = $(this).data('updown'); | |
| 230 | + var storage = window.localStorage; | |
| 231 | + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat+","+lineid+","+upDown); | |
| 232 | + $.get('/pages/excep/outboundMap.html?',function (result) { | |
| 233 | + layer.open({ | |
| 234 | + type: 1, | |
| 235 | + title:'<i class="uk-icon-play-circle"></i>轨迹回放', | |
| 236 | + shadeClose: true, | |
| 237 | + shade: true, | |
| 238 | + scrollbar: false, | |
| 239 | + maxmin: false, //开启最大化最小化按钮 | |
| 240 | + area: ['100%', '100%'], | |
| 241 | + content:result,//内容 | |
| 242 | + }); | |
| 243 | + }); | |
| 244 | + }) | |
| 245 | + return; | |
| 246 | + } | |
| 247 | + var result = listResult[index]; | |
| 248 | + new BMap.Geocoder().getLocation(new BMap.Point(result.lon,result.lat), function(rs){ | |
| 249 | + var addComp = rs.addressComponents; | |
| 250 | + result.address = addComp.district+addComp.street+addComp.streetNumber; | |
| 251 | + f(); | |
| 252 | + index++; | |
| 253 | + }); | |
| 254 | + })(); | |
| 255 | + | |
| 221 | 256 | }); |
| 222 | 257 | } |
| 223 | 258 | |
| ... | ... | @@ -345,7 +380,6 @@ $('#nbbm').select2({ |
| 345 | 380 | |
| 346 | 381 | //改变状态 |
| 347 | 382 | function changeEnabled(id,enabled){ |
| 348 | - debugger | |
| 349 | 383 | $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ |
| 350 | 384 | jsDoQuery(null, true); |
| 351 | 385 | }) | ... | ... |
src/main/resources/static/pages/excep/speedingCount.html
src/main/resources/static/pages/excep/speedingList.html
src/main/resources/static/pages/excep/speedingMap.html
| ... | ... | @@ -8,23 +8,24 @@ |
| 8 | 8 | <div id="titleMap"> |
| 9 | 9 | <button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button> |
| 10 | 10 | </div> |
| 11 | -<div id="speedingMap"> | |
| 11 | +<div id="BasicMap"> | |
| 12 | 12 | </div> |
| 13 | 13 | <style type="text/css"> |
| 14 | 14 | |
| 15 | -#speedingMap{ | |
| 15 | +#BasicMap{ | |
| 16 | 16 | width: 100%; |
| 17 | 17 | border: 2px solid #fdfdfd; |
| 18 | 18 | height: calc(100% - 30px); |
| 19 | 19 | overflow: hidden; |
| 20 | 20 | } |
| 21 | 21 | </style> |
| 22 | -<script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script> | |
| 22 | +<script type="text/javascript" src="/pages/excep/js/map.js"></script> | |
| 23 | 23 | <script type="text/javascript" src="/pages/excep/js/line-list-function.js"></script> |
| 24 | 24 | |
| 25 | 25 | <script type="text/javascript"> |
| 26 | 26 | $(function(){ |
| 27 | 27 | var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间 |
| 28 | + localStorage.clear();//清楚前端缓存 | |
| 28 | 29 | var vehicle = dataArr[0]; |
| 29 | 30 | var startdate = dataArr[1]; |
| 30 | 31 | var enddate = dataArr[2]; |
| ... | ... | @@ -55,16 +56,14 @@ $(function(){ |
| 55 | 56 | } |
| 56 | 57 | }); |
| 57 | 58 | setTimeout(function(){ |
| 58 | - var map = SpeedingMap.init();//创建地图 | |
| 59 | + var map = BasicMap.init();//创建地图 | |
| 60 | + debugger; | |
| 59 | 61 | $get('/sectionroute/findSection',{'line.id_eq' : lineid , 'directions_eq' :directionData},function(data) { |
| 60 | 62 | // 在地图上画出线路走向 |
| 61 | 63 | PublicFunctions.linePanlThree(lineid,data,directionData); |
| 62 | 64 | }); |
| 63 | 65 | var myP1 = new BMap.Point(lon,lat); //起点 |
| 64 | 66 | var myP2 = new BMap.Point(endLon,endLat); //终点 |
| 65 | -/* var centerLon = (parseFloat(lon)+parseFloat(endLon))/2; | |
| 66 | - var centerLat = (parseFloat(lat)+parseFloat(endLat))/2; | |
| 67 | - map.centerAndZoom(new BMap.Point(centerLon,centerLat),18);//地图中心点坐标 */ | |
| 68 | 67 | for(i in Points){ |
| 69 | 68 | coordinateArr.push(Points[i].coordinate); |
| 70 | 69 | } | ... | ... |
src/main/resources/static/pages/oil/jyglList.html
| ... | ... | @@ -58,15 +58,15 @@ |
| 58 | 58 | <tr role="row" class="heading"> |
| 59 | 59 | <th width="2%">#</th> |
| 60 | 60 | <th width="10%">日期</th> |
| 61 | - <th width="10%">公司</th> | |
| 62 | - <th width="10%">分公司</th> | |
| 61 | + <th width="8%">公司</th> | |
| 62 | + <th width="8%">分公司</th> | |
| 63 | + <th width="8%">线路</th> | |
| 63 | 64 | <th width="8%">车辆</th> |
| 64 | 65 | <th width="14%">驾驶员</th> |
| 65 | 66 | <th width="5%">加注量</th> |
| 66 | 67 | <th width="4%">加油站</th> |
| 67 | 68 | <th width="3%">加油类型</th> |
| 68 | 69 | <th width="5%">加油工工号</th> |
| 69 | - <th width="3%">油价</th> | |
| 70 | 70 | <th width="4%">路单工号</th> |
| 71 | 71 | <th width="4%">备注</th> |
| 72 | 72 | <th width="10%">操作</th> |
| ... | ... | @@ -83,6 +83,9 @@ |
| 83 | 83 | <select class="form-control" name="fgsdm_like" id="jyglListFgsdmId" ></select> |
| 84 | 84 | </td> |
| 85 | 85 | <td> |
| 86 | + <select class="form-control" name="line_like" id="line" style="width: 120px;"></select> | |
| 87 | + </td> | |
| 88 | + <td> | |
| 86 | 89 | <input type="text" class="form-control form-filter input-sm" name="nbbh" id="nbbh"> |
| 87 | 90 | </td> |
| 88 | 91 | <td></td> |
| ... | ... | @@ -92,7 +95,6 @@ |
| 92 | 95 | <td></td> |
| 93 | 96 | <td></td> |
| 94 | 97 | <td></td> |
| 95 | - <td></td> | |
| 96 | 98 | <td> |
| 97 | 99 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 98 | 100 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -124,6 +126,7 @@ |
| 124 | 126 | <td> |
| 125 | 127 | {{obj.fgsname}} |
| 126 | 128 | </td> |
| 129 | + <td>{{obj.linename}}</td> | |
| 127 | 130 | <td> |
| 128 | 131 | {{obj.nbbm}} |
| 129 | 132 | </td> |
| ... | ... | @@ -153,7 +156,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep |
| 153 | 156 | <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jyggh" |
| 154 | 157 | type="text" value="{{obj.jyggh}}" style=" width:45px" /> |
| 155 | 158 | </td> |
| 156 | - <td></td> | |
| 159 | + | |
| 157 | 160 | <td>{{obj.ldgh}}</td> |
| 158 | 161 | <td> |
| 159 | 162 | <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_bz" |
| ... | ... | @@ -234,6 +237,27 @@ $(function(){ |
| 234 | 237 | }); |
| 235 | 238 | |
| 236 | 239 | |
| 240 | + | |
| 241 | + $.get('/report/lineList',function(xlList){ | |
| 242 | + var data = []; | |
| 243 | + data.push({id: " ", text: "全部线路"}); | |
| 244 | + $.get('/user/companyData', function(result){ | |
| 245 | + for(var i = 0; i < result.length; i++){ | |
| 246 | + var companyCode = result[i].companyCode; | |
| 247 | + var children = result[i].children; | |
| 248 | + for(var j = 0; j < children.length; j++){ | |
| 249 | + var code = children[j].code; | |
| 250 | + for(var k=0;k < xlList.length;k++ ){ | |
| 251 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | |
| 252 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | |
| 253 | + } | |
| 254 | + } | |
| 255 | + } | |
| 256 | + } | |
| 257 | + initPinYinSelect2('#line',data,''); | |
| 258 | + | |
| 259 | + }); | |
| 260 | + }); | |
| 237 | 261 | // var gsqx=""; |
| 238 | 262 | // var fgsqx=""; |
| 239 | 263 | ... | ... |
src/main/resources/static/pages/oil/jyszAdd.html
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | <label class="col-md-3 control-label">内部编码</label> |
| 34 | 34 | <div class="col-md-9"> |
| 35 | 35 | <!-- <select class="form-control input-medium " name="nbbm" id="nbbm" ></select> --> |
| 36 | - <input type="text" class="form-control input-medium" name="nbbm" > | |
| 36 | + <input type="text" class="form-control" name="nbbm" style="width: 180px"> | |
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | 39 | </div> |
| ... | ... | @@ -87,6 +87,8 @@ $(function(){ |
| 87 | 87 | $('#fgsdm').html(options); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + | |
| 91 | + | |
| 90 | 92 | //提交 |
| 91 | 93 | $('#addJyszModuleButton').on('click', function() { |
| 92 | 94 | form.submit(); |
| ... | ... | @@ -98,7 +100,7 @@ $(function(){ |
| 98 | 100 | focusInvalid : false, |
| 99 | 101 | rules : { |
| 100 | 102 | nbbm : { |
| 101 | - minlength : 2, | |
| 103 | + minlength : 4, | |
| 102 | 104 | required : true, |
| 103 | 105 | maxlength : 10 |
| 104 | 106 | } |
| ... | ... | @@ -125,7 +127,7 @@ $(function(){ |
| 125 | 127 | error.hide(); |
| 126 | 128 | $get('/cwjy/checkNbbm',params,function(result){ |
| 127 | 129 | if(result>0){ |
| 128 | - layer.msg('该车辆已经添加.'); | |
| 130 | + layer.msg('分公司该车辆已经添加.'); | |
| 129 | 131 | }else{ |
| 130 | 132 | $post('/cwjy', params, function(result){ |
| 131 | 133 | layer.msg('新增加油设置成功.'); | ... | ... |
src/main/resources/static/pages/oil/jyszList.html
| ... | ... | @@ -21,8 +21,9 @@ |
| 21 | 21 | </div> |
| 22 | 22 | <div class="actions"> |
| 23 | 23 | <!-- <a class="btn btn-circle blue" href="jyszAdd.html" data-pjax><i class="fa fa-plus"></i> 添加</a> --> |
| 24 | - <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-trash"></i> 添加</button> | |
| 25 | -<!-- <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> --> | |
| 24 | + <button type="button" class="btn btn-circle blue" id="addJysz"><i class="fa fa-plus"></i> 添加</button> | |
| 25 | +<!-- | |
| 26 | + <button type="button" class="btn btn-circle blue" onclick="refreshJsTree()"><i class="fa fa-trash"></i>刷新</button> --> | |
| 26 | 27 | |
| 27 | 28 | <!-- <div class="btn-group"> |
| 28 | 29 | <a class="btn red btn-outline btn-circle" href="javascript:;" |
| ... | ... | @@ -60,8 +61,9 @@ |
| 60 | 61 | <th width="15%">公司</th> |
| 61 | 62 | <th width="13%">分公司</th> |
| 62 | 63 | <th width="10%">车辆</th> |
| 64 | + <th width="10%">线路</th> | |
| 63 | 65 | <th width="10%">修改人</th> |
| 64 | - <th width="20%">日期</th> | |
| 66 | + <th width="10%">日期</th> | |
| 65 | 67 | <th width="19%">操作</th> |
| 66 | 68 | </tr> |
| 67 | 69 | <tr role="row" class="filter"> |
| ... | ... | @@ -77,6 +79,8 @@ |
| 77 | 79 | </td> |
| 78 | 80 | <td> |
| 79 | 81 | </td> |
| 82 | + <td> | |
| 83 | + </td> | |
| 80 | 84 | <td></td> |
| 81 | 85 | <td> |
| 82 | 86 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| ... | ... | @@ -107,6 +111,7 @@ |
| 107 | 111 | <td>{{obj.gsname}}</td> |
| 108 | 112 | <td>{{obj.fgsname}}</td> |
| 109 | 113 | <td>{{obj.nbbm}}</td> |
| 114 | + <td>{{obj.linename}}</td> | |
| 110 | 115 | <td>{{obj.xgr}}</td> |
| 111 | 116 | <td>{{obj.createDate}}</td> |
| 112 | 117 | <td> |
| ... | ... | @@ -236,6 +241,7 @@ $(function(){ |
| 236 | 241 | $.each(data.content, function(i, obj) { |
| 237 | 242 | obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); |
| 238 | 243 | }); |
| 244 | + console.log(data.content); | |
| 239 | 245 | var bodyHtm = template('jysz_list_temp', {list: data.content}); |
| 240 | 246 | |
| 241 | 247 | $('#datatable_jysz tbody').html(bodyHtm) |
| ... | ... | @@ -288,7 +294,7 @@ $(function(){ |
| 288 | 294 | for(var j = 0, item; item = items[j++];){ |
| 289 | 295 | name = $(item).attr('name'); |
| 290 | 296 | if(name){ |
| 291 | - params[name] = $(item).val(); | |
| 297 | + params[name] = $(item).val().replace(/(^\s*)|(\s*$)/g, ""); | |
| 292 | 298 | } |
| 293 | 299 | } |
| 294 | 300 | }); |
| ... | ... | @@ -315,7 +321,6 @@ $(function(){ |
| 315 | 321 | $.get('jyszAdd.html', function(m){$(pjaxContainer).append(m);}); |
| 316 | 322 | }); |
| 317 | 323 | |
| 318 | - | |
| 319 | 324 | }); |
| 320 | 325 | |
| 321 | 326 | ... | ... |
src/main/resources/static/pages/permission/authorize_all/user_auth.html
| ... | ... | @@ -141,7 +141,8 @@ |
| 141 | 141 | '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)', |
| 142 | 142 | '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)', |
| 143 | 143 | '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_6': '南汇公司(航头枢纽站)', |
| 144 | - '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)' | |
| 144 | + '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)', | |
| 145 | + '77_78': '闵行公司', '99_100': '青浦公交' | |
| 145 | 146 | }; |
| 146 | 147 | |
| 147 | 148 | var defauleConfig; | ... | ... |
src/main/resources/static/pages/summary/work_hours/list.html
| ... | ... | @@ -263,8 +263,8 @@ |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | //日期选择器 |
| 266 | - $('[name=rq_eq]', f).val('2017-07-31'); | |
| 267 | - flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-07-31', minDate: '2017-07-01'}); | |
| 266 | + $('[name=rq_eq]', f).val('2017-08-03'); | |
| 267 | + flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-08-03', minDate: '2017-07-01'}); | |
| 268 | 268 | |
| 269 | 269 | var comps; |
| 270 | 270 | //构建公司级联下拉框 | ... | ... |
src/main/resources/static/real_control_v2/css/ct_table.css
src/main/resources/static/real_control_v2/css/line_schedule.css
| ... | ... | @@ -771,27 +771,30 @@ input.i-cbox[type=checkbox]{ |
| 771 | 771 | |
| 772 | 772 | |
| 773 | 773 | .sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) { |
| 774 | - width: 30%; | |
| 774 | + width: 25%; | |
| 775 | 775 | } |
| 776 | 776 | .sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) { |
| 777 | - width: 25%; | |
| 777 | + width: 18%; | |
| 778 | 778 | } |
| 779 | 779 | .sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) { |
| 780 | - width: 25%; | |
| 780 | + width: 21%; | |
| 781 | 781 | } |
| 782 | 782 | .sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) { |
| 783 | - width: 20%; | |
| 783 | + width: 21%; | |
| 784 | +} | |
| 785 | +.sch-tzrc-table dl dt:nth-of-type(5), .sch-tzrc-table dl dd:nth-of-type(5) { | |
| 786 | + width: 15%; | |
| 784 | 787 | } |
| 785 | 788 | |
| 786 | 789 | .ct-form-modal .uk-autocomplete{ |
| 787 | 790 | width: 100%; |
| 788 | 791 | } |
| 789 | 792 | |
| 790 | -.sch-tzrc-table.ct_table dl.active, | |
| 793 | +/*.sch-tzrc-table.ct_table dl.active, | |
| 791 | 794 | .sch-tzrc-table.ct_table>.ct_table_body dl.active:hover, |
| 792 | 795 | .sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{ |
| 793 | 796 | background: #e6e6e6; |
| 794 | -} | |
| 797 | +}*/ | |
| 795 | 798 | |
| 796 | 799 | .search_sch_panel{ |
| 797 | 800 | float: right; | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -1597,3 +1597,62 @@ ul.left_tabs_lg li{ |
| 1597 | 1597 | text-decoration: underline; |
| 1598 | 1598 | font-size: 13px; |
| 1599 | 1599 | } |
| 1600 | + | |
| 1601 | +#schedule-tzrc-modal input[type=checkbox]{ | |
| 1602 | + margin-right: 9px; | |
| 1603 | +} | |
| 1604 | + | |
| 1605 | +#schedule-tzrc-modal span.ct_zt_yzx{ | |
| 1606 | + color: #2196F3; | |
| 1607 | + font-size: 12px; | |
| 1608 | +} | |
| 1609 | + | |
| 1610 | +#schedule-tzrc-modal span.ct_zt_lb{ | |
| 1611 | + color: red; | |
| 1612 | + font-size: 12px; | |
| 1613 | +} | |
| 1614 | + | |
| 1615 | +#schedule-tzrc-modal span.ct_zt_zzzx{ | |
| 1616 | + font-size: 12px; | |
| 1617 | + color: #38ad3c; | |
| 1618 | +} | |
| 1619 | + | |
| 1620 | +#schedule-tzrc-modal .tzrc_form{ | |
| 1621 | + padding: 20px; | |
| 1622 | + border: 1px solid #f0eded; | |
| 1623 | + box-shadow: 0px -3px 15px rgba(0,0,0,0.08); | |
| 1624 | + background: #f9f9f9; | |
| 1625 | +} | |
| 1626 | + | |
| 1627 | +.uk-panel.ct_search_panel{ | |
| 1628 | + padding: 15px; | |
| 1629 | + border: 1px solid #f0eded; | |
| 1630 | + box-shadow: 0px 3px 15px rgba(0,0,0,0.08); | |
| 1631 | + background: #f9f9f9; | |
| 1632 | +} | |
| 1633 | + | |
| 1634 | +.sch-tzrc-table.ct_table dl.active, | |
| 1635 | +.sch-tzrc-table.ct_table>.ct_table_body dl.active:hover{ | |
| 1636 | + background: #5bd460; | |
| 1637 | + color: white; | |
| 1638 | +} | |
| 1639 | + | |
| 1640 | +#schedule-tzrc-modal dl.active span.ct_zt_yzx{ | |
| 1641 | + color: #545252; | |
| 1642 | +} | |
| 1643 | + | |
| 1644 | +#schedule-tzrc-modal dl.active span.ct_zt_lb{ | |
| 1645 | + color: #d64949; | |
| 1646 | +} | |
| 1647 | + | |
| 1648 | +#schedule-tzrc-modal dl.active span.ct_zt_zzzx{ | |
| 1649 | + color: white; | |
| 1650 | +} | |
| 1651 | + | |
| 1652 | +#schedule-tzrc-modal dl.active input[type=checkbox]{ | |
| 1653 | + border: 0; | |
| 1654 | +} | |
| 1655 | + | |
| 1656 | +#schedule-tzrc-modal dl.active input[type=checkbox]:before{ | |
| 1657 | + color: #ffffff; | |
| 1658 | +} | |
| 1600 | 1659 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html
| ... | ... | @@ -100,7 +100,7 @@ |
| 100 | 100 | else if (sch.status == 2) { |
| 101 | 101 | $f('destroy', f).parents('label').remove(); |
| 102 | 102 | $f('endDate', f).val(sch.zdsjActual); |
| 103 | - $('input,select', f).attr('disabled', 'disabled'); | |
| 103 | + //$('input,select', f).attr('disabled', 'disabled'); | |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html
| ... | ... | @@ -85,10 +85,13 @@ |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | 87 | |
| 88 | - function addTaskForm() { | |
| 88 | + function addTaskForm(upDownInput) { | |
| 89 | 89 | var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); |
| 90 | 90 | var f = $(htmlStr); |
| 91 | 91 | $('.forms', wrap).append(f); |
| 92 | + | |
| 93 | + if(upDownInput) | |
| 94 | + f.append(upDownInput); | |
| 92 | 95 | //字典转换 |
| 93 | 96 | dictionaryUtils.transformDom($('.nt-dictionary', f)); |
| 94 | 97 | |
| ... | ... | @@ -110,8 +113,8 @@ |
| 110 | 113 | function disabled_form(f) { |
| 111 | 114 | //$('input,select',f).attr('disabled', 'disabled'); |
| 112 | 115 | $f('type2', f).attr('disabled', 'disabled'); |
| 113 | - $f('startStation', f).attr('disabled', 'disabled'); | |
| 114 | - $f('endStation', f).attr('disabled', 'disabled'); | |
| 116 | + //$f('startStation', f).attr('disabled', 'disabled'); | |
| 117 | + //$f('endStation', f).attr('disabled', 'disabled'); | |
| 115 | 118 | $f('mileageType', f).attr('disabled', 'disabled'); |
| 116 | 119 | $f('destroy', f).attr('disabled', 'disabled'); |
| 117 | 120 | return f; |
| ... | ... | @@ -138,10 +141,12 @@ |
| 138 | 141 | |
| 139 | 142 | //烂班1 |
| 140 | 143 | df1 = destroyForm(disabled_form(addTaskForm())); |
| 144 | + | |
| 145 | + var u_d_input = '<input name="upDown" type="hidden" value="'+nextSch.xlDir+'">'; | |
| 141 | 146 | //烂班2 |
| 142 | - df2 = destroyForm(disabled_form(addTaskForm())); | |
| 147 | + df2 = destroyForm(disabled_form(addTaskForm(u_d_input))); | |
| 143 | 148 | //营运2 |
| 144 | - f2 = disabled_form(addTaskForm()); | |
| 149 | + f2 = disabled_form(addTaskForm(u_d_input)); | |
| 145 | 150 | $('.domains', f2).empty(); |
| 146 | 151 | |
| 147 | 152 | |
| ... | ... | @@ -149,16 +154,19 @@ |
| 149 | 154 | $f('endStation', f1).val(eCode).trigger('change'); |
| 150 | 155 | //烂班1起点 |
| 151 | 156 | $f('startStation', df1).val(eCode).trigger('change'); |
| 157 | + | |
| 158 | + //nextSch | |
| 159 | + var d_code = searchParallelStation($('#turnStationSelect>option:selected', topf).text()); | |
| 152 | 160 | //烂班2 |
| 153 | - $f('startStation', df2).val(sch.zdzCode); | |
| 154 | - $f('endStation', df2).val(eCode); | |
| 155 | - $f('mileage', df2).val($f('mileage', df1).val()).trigger('input'); | |
| 161 | + $f('startStation', df2).val(nextSch.qdzCode); | |
| 162 | + $f('endStation', df2).val(d_code).trigger('change'); | |
| 163 | + //$f('mileage', df2).val($f('mileage', df1).val()).trigger('input'); | |
| 156 | 164 | $('[sch_id_inp]', df2).val(nextSch.id); |
| 157 | 165 | //营运2 |
| 158 | - $f('startStation', f2).val(eCode); | |
| 159 | - $f('endStation', f2).val(sch.qdzCode); | |
| 160 | - $f('startDate',f2).val($f('endDate',f1).val()); | |
| 161 | - $f('mileage', f2).val($f('mileage', f1).val()).trigger('input'); | |
| 166 | + $f('startStation', f2).val(d_code).trigger('change'); | |
| 167 | + $f('endStation', f2).val(nextSch.zdzCode); | |
| 168 | + //$f('startDate',f2).val($f('endDate',f1).val()); | |
| 169 | + //$f('mileage', f2).val($f('mileage', f1).val()).trigger('input'); | |
| 162 | 170 | $('[sch_id_inp]', f2).val(nextSch.id); |
| 163 | 171 | |
| 164 | 172 | //set css |
| ... | ... | @@ -285,6 +293,18 @@ |
| 285 | 293 | }); |
| 286 | 294 | return flag; |
| 287 | 295 | } |
| 296 | + | |
| 297 | + | |
| 298 | + //返回另一个走向对应的站点 | |
| 299 | + function searchParallelStation(stationName) { | |
| 300 | + var routes = stationRoutes[nextSch.xlDir] | |
| 301 | + , len = routes.length; | |
| 302 | + | |
| 303 | + for (var i = 0; i < len; i++) { | |
| 304 | + if (routes[i].stationName == stationName) | |
| 305 | + return routes[i].stationCode; | |
| 306 | + } | |
| 307 | + } | |
| 288 | 308 | })(); |
| 289 | 309 | </script> |
| 290 | 310 | </div> |
| 291 | 311 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | <div class="uk-form-row"> |
| 60 | 60 | <label class="uk-form-label">起点 </label> |
| 61 | 61 | <div class="uk-form-controls"> |
| 62 | - <select name="startStation" ></select> | |
| 62 | + <select name="startStation" required></select> | |
| 63 | 63 | </div> |
| 64 | 64 | </div> |
| 65 | 65 | </div> |
| ... | ... | @@ -67,7 +67,7 @@ |
| 67 | 67 | <div class="uk-form-row"> |
| 68 | 68 | <label class="uk-form-label">终点</label> |
| 69 | 69 | <div class="uk-form-controls"> |
| 70 | - <select name="endStation" ></select> | |
| 70 | + <select name="endStation" required></select> | |
| 71 | 71 | </div> |
| 72 | 72 | </div> |
| 73 | 73 | </div> |
| ... | ... | @@ -300,8 +300,10 @@ |
| 300 | 300 | */ |
| 301 | 301 | function reCalcInputs_type() { |
| 302 | 302 | var f = $(this).parents('.sub_task_form_v2'); |
| 303 | - | |
| 304 | - var routes = stationRoutes[sch.xlDir] | |
| 303 | + var upDown = sch.xlDir; | |
| 304 | + if($('[name=upDown]', f).length>0) | |
| 305 | + upDown = $('[name=upDown]', f).val(); | |
| 306 | + var routes = stationRoutes[upDown] | |
| 305 | 307 | , lastCode = routes[routes.length - 1].stationCode |
| 306 | 308 | , opts = '', park_opts = ''; |
| 307 | 309 | //station options |
| ... | ... | @@ -374,7 +376,9 @@ |
| 374 | 376 | upDown = inout_updown(zdzCode, sch); |
| 375 | 377 | break; |
| 376 | 378 | default: |
| 377 | - upDown = sch.xlDir | |
| 379 | + upDown = sch.xlDir; | |
| 380 | + if($('[name=upDown]',f).length>0) | |
| 381 | + upDown = $('[name=upDown]',f).val(); | |
| 378 | 382 | } |
| 379 | 383 | |
| 380 | 384 | //从站到场里获取数据 |
| ... | ... | @@ -572,22 +576,25 @@ |
| 572 | 576 | if(!st_park_data) |
| 573 | 577 | return; |
| 574 | 578 | var stp; |
| 575 | - var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; | |
| 579 | + try{ | |
| 580 | + var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; | |
| 576 | 581 | |
| 577 | - var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | |
| 578 | - zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | |
| 579 | - type2 = $f('type2', f).val(); | |
| 582 | + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | |
| 583 | + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | |
| 584 | + type2 = $f('type2', f).val(); | |
| 580 | 585 | |
| 581 | - if(type2!=2 && type2!=3) | |
| 582 | - return; | |
| 586 | + if(type2!=2 && type2!=3) | |
| 587 | + return; | |
| 583 | 588 | |
| 584 | - $.each(st_park_data, function () { | |
| 585 | - if((type2==2 && this.stationName==qdzName && this.parkName==zdzName) | |
| 586 | - || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){ | |
| 587 | - stp = this; | |
| 588 | - return false; | |
| 589 | - } | |
| 590 | - }); | |
| 589 | + $.each(st_park_data, function () { | |
| 590 | + if((type2==2 && this.stationName==qdzName && this.parkName==zdzName) | |
| 591 | + || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){ | |
| 592 | + stp = this; | |
| 593 | + return false; | |
| 594 | + } | |
| 595 | + }); | |
| 596 | + }catch (e){ | |
| 597 | + console.log(e);} | |
| 591 | 598 | |
| 592 | 599 | return stp; |
| 593 | 600 | } | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | 4 | <div class="uk-modal-header"> |
| 5 | 5 | <h2>调整人车</h2></div> |
| 6 | - <div class="uk-panel uk-panel-box uk-panel-box-primary"> | |
| 6 | + <div class="uk-panel ct_search_panel"> | |
| 7 | 7 | <form class="uk-form uk-form-horizontal search-form"> |
| 8 | 8 | <div class="uk-grid"> |
| 9 | 9 | <div class="uk-width-1-3"> |
| ... | ... | @@ -26,21 +26,23 @@ |
| 26 | 26 | </form> |
| 27 | 27 | </div> |
| 28 | 28 | |
| 29 | - <div class="ct_table_wrap ct_table_no_border tzrc-table-wrap" style="height: 300px;"> | |
| 30 | - <div class="ct_table sch-tzrc-table"> | |
| 31 | - <div class="ct_table_head"> | |
| 32 | - <dl> | |
| 33 | - <dt><input type="checkbox" id="globalCheckBox" class="i-cbox" style="margin-top: 0px;">时间</dt> | |
| 34 | - <dt>车辆</dt> | |
| 35 | - <dt>驾驶员</dt> | |
| 36 | - <dt>售票员</dt> | |
| 37 | - </dl> | |
| 29 | + <form class="uk-form"> | |
| 30 | + <div class="ct_table_wrap ct_table_no_border tzrc-table-wrap" style="height: 340px;"> | |
| 31 | + <div class="ct_table sch-tzrc-table"> | |
| 32 | + <div class="ct_table_head"> | |
| 33 | + <dl> | |
| 34 | + <dt><input type="checkbox" id="globalCheckBox" class="i-cbox" >时间</dt> | |
| 35 | + <dt>车辆</dt> | |
| 36 | + <dt>驾驶员</dt> | |
| 37 | + <dt>售票员</dt> | |
| 38 | + <dt>状态</dt> | |
| 39 | + </dl> | |
| 40 | + </div> | |
| 41 | + <div class="ct_table_body"></div> | |
| 38 | 42 | </div> |
| 39 | - <div class="ct_table_body"></div> | |
| 40 | 43 | </div> |
| 41 | - </div> | |
| 42 | - | |
| 43 | - <form class="uk-form uk-form-horizontal tzrc_form" style="padding-top: 20px;border-top: 1px solid whitesmoke;"> | |
| 44 | + </form> | |
| 45 | + <form class="uk-form uk-form-horizontal tzrc_form"> | |
| 44 | 46 | <div class="uk-grid"> |
| 45 | 47 | <div class="uk-width-1-2"> |
| 46 | 48 | <div class="uk-form-row"> |
| ... | ... | @@ -77,7 +79,7 @@ |
| 77 | 79 | </div> |
| 78 | 80 | <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> |
| 79 | 81 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 80 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存 | |
| 82 | + <button type="submit" class="uk-button uk-button-primary" ><i class="uk-icon-check"></i> 保存 | |
| 81 | 83 | </button> |
| 82 | 84 | </div> |
| 83 | 85 | </form> |
| ... | ... | @@ -85,31 +87,38 @@ |
| 85 | 87 | |
| 86 | 88 | <script id="schedule-tzrc-table-temp" type="text/html"> |
| 87 | 89 | {{each list as sch i}} |
| 88 | - <dl data-id="{{sch.id}}"> | |
| 90 | + <dl data-id="{{sch.id}}" {{if sch.status==0}}class="no_exec_sch_row"{{/if}}> | |
| 89 | 91 | <dd> |
| 90 | - <label> | |
| 91 | - <input type="checkbox" value=1 name="schCBox" class="i-cbox" style="margin-top: 0px;"> | |
| 92 | - {{sch.dfsj}} | |
| 93 | - {{if sch.bcType == "out"}} | |
| 94 | - <span class="uk-badge uk-badge-success">出场</span> | |
| 95 | - {{else if sch.bcType == "in"}} | |
| 96 | - <span class="uk-badge uk-badge-warning">进场</span> | |
| 97 | - {{else if sch.bcType == "venting"}} | |
| 98 | - <span class="uk-badge uk-badge-danger">直放</span> | |
| 99 | - {{else if sch.bcType == "major"}} | |
| 100 | - <span class="uk-badge uk-badge-danger">放站</span> | |
| 101 | - {{/if}} | |
| 102 | - {{if sch.sflj}} | |
| 103 | - <span class="uk-badge uk-badge-danger">临加</span> | |
| 104 | - {{/if}} | |
| 105 | - {{if sch.cTasks.length > 0}} | |
| 106 | - <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | |
| 107 | - {{/if}} | |
| 108 | - </label> | |
| 92 | + <input type="checkbox" value=1 name="schCBox" class="i-cbox" > | |
| 93 | + {{sch.dfsj}} | |
| 94 | + {{if sch.bcType == "out"}} | |
| 95 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 96 | + {{else if sch.bcType == "in"}} | |
| 97 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 98 | + {{else if sch.bcType == "venting"}} | |
| 99 | + <span class="uk-badge uk-badge-danger">直放</span> | |
| 100 | + {{else if sch.bcType == "major"}} | |
| 101 | + <span class="uk-badge uk-badge-danger">放站</span> | |
| 102 | + {{/if}} | |
| 103 | + {{if sch.sflj}} | |
| 104 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 105 | + {{/if}} | |
| 106 | + {{if sch.cTasks.length > 0}} | |
| 107 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | |
| 108 | + {{/if}} | |
| 109 | 109 | </dd> |
| 110 | 110 | <dd>{{sch.clZbh}}</dd> |
| 111 | 111 | <dd>{{sch.jGh}}/{{sch.jName}}</dd> |
| 112 | 112 | <dd>{{sch.sGh}}/{{sch.sName}}</dd> |
| 113 | + <dd> | |
| 114 | + {{if sch.status==2}} | |
| 115 | + <span class="ct_zt_yzx">已执行</span> | |
| 116 | + {{else if sch.status==1}} | |
| 117 | + <span class="ct_zt_zzzx">正在执行</span> | |
| 118 | + {{else if sch.status==-1}} | |
| 119 | + <span class="ct_zt_lb">烂班</span> | |
| 120 | + {{/if}} | |
| 121 | + </dd> | |
| 113 | 122 | </dl> |
| 114 | 123 | {{/each}} |
| 115 | 124 | </script> |
| ... | ... | @@ -151,17 +160,21 @@ |
| 151 | 160 | $('.tzrc-table-wrap', modal).perfectScrollbar('update'); |
| 152 | 161 | }); |
| 153 | 162 | |
| 154 | - $(modal).on('click', '.sch-tzrc-table .ct_table_body dl input[type=checkbox]', function () { | |
| 155 | - if ($(this).attr('disabled')) return; | |
| 156 | - var dl = $(this).parents('dl'); | |
| 157 | - if (this.checked) { | |
| 158 | - dl.addClass('active'); | |
| 163 | + $(modal).on('click', '.sch-tzrc-table .ct_table_body dl', function () { | |
| 164 | + var cbox = $('input[type=checkbox]',this)[0]; | |
| 165 | + //var active = $(); | |
| 166 | + if(!$(this).hasClass('active')){ | |
| 167 | + $(this).addClass('active'); | |
| 168 | + cbox.checked = true; | |
| 159 | 169 | var lineCode = $('[name=lineSelect]', modal).val(); |
| 160 | - var sch = gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')]; | |
| 170 | + var sch = gb_schedule_table.findScheduleByLine(lineCode)[$(this).data('id')]; | |
| 161 | 171 | |
| 162 | 172 | writeSch2Form(sch); |
| 163 | - } else | |
| 164 | - dl.removeClass('active'); | |
| 173 | + } | |
| 174 | + else{ | |
| 175 | + $(this).removeClass('active'); | |
| 176 | + cbox.checked = false; | |
| 177 | + } | |
| 165 | 178 | }); |
| 166 | 179 | |
| 167 | 180 | //默认选中项 |
| ... | ... | @@ -191,18 +204,16 @@ |
| 191 | 204 | //}); |
| 192 | 205 | |
| 193 | 206 | //submit |
| 194 | - var f = $('form.tzrc_form', modal).formValidation({ | |
| 195 | - framework: 'uikit', | |
| 196 | - locale: 'zh_CN' | |
| 197 | - }); | |
| 198 | - f.on('success.form.fv', function (e) { | |
| 199 | - e.preventDefault(); | |
| 200 | - var param = $(this).serializeJSON(); | |
| 201 | - var data = []; | |
| 207 | + var f = $('form.tzrc_form', modal); | |
| 208 | + f.on('submit', function (e) { | |
| 209 | + e.stopPropagation(); | |
| 210 | + | |
| 202 | 211 | var checkeds = $('.sch-tzrc-table .ct_table_body input[type=checkbox]:checked', modal); |
| 203 | 212 | if (checkeds.length == 0) |
| 204 | 213 | return notify_err('请选中要调整的班次'); |
| 205 | 214 | |
| 215 | + var param = $(this).serializeJSON(); | |
| 216 | + var data = []; | |
| 206 | 217 | var schId; |
| 207 | 218 | $.each(checkeds, function () { |
| 208 | 219 | schId = $(this).parents('dl').data('id'); |
| ... | ... | @@ -213,6 +224,7 @@ |
| 213 | 224 | clZbh: param.clZbh |
| 214 | 225 | }); |
| 215 | 226 | }); |
| 227 | + | |
| 216 | 228 | gb_common.$post('/realSchedule/multi_tzrc', { |
| 217 | 229 | cpcsJson: JSON.stringify(data) |
| 218 | 230 | }, function (rs) { |
| ... | ... | @@ -222,6 +234,7 @@ |
| 222 | 234 | notify_succ('调整人车成功'); |
| 223 | 235 | } |
| 224 | 236 | }); |
| 237 | + return false; | |
| 225 | 238 | }); |
| 226 | 239 | }); |
| 227 | 240 | |
| ... | ... | @@ -235,11 +248,28 @@ |
| 235 | 248 | |
| 236 | 249 | //全选 |
| 237 | 250 | $('#globalCheckBox', modal).on('click', function () { |
| 251 | + clearCheckAll(); | |
| 238 | 252 | var status = this.checked; |
| 239 | - $('input[name=schCBox]', modal).each(function () { | |
| 240 | - this.checked = status; | |
| 241 | - }); | |
| 253 | + if(status){ | |
| 254 | + var id; | |
| 255 | + $('.no_exec_sch_row', modal).each(function () { | |
| 256 | + $(this).addClass('active'); | |
| 257 | + $('input[type=checkbox]',this)[0].checked = true; | |
| 258 | + id = $(this).data('id'); | |
| 259 | + }); | |
| 260 | + | |
| 261 | + var lineCode = $('[name=lineSelect]', modal).val(); | |
| 262 | + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 263 | + writeSch2Form(sch); | |
| 264 | + } | |
| 242 | 265 | }); |
| 266 | + | |
| 267 | + function clearCheckAll() { | |
| 268 | + $('.sch-tzrc-table .ct_table_body>dl', modal).each(function () { | |
| 269 | + $(this).removeClass('active'); | |
| 270 | + $('input[type=checkbox]',this)[0].checked = false; | |
| 271 | + }); | |
| 272 | + } | |
| 243 | 273 | })(); |
| 244 | 274 | </script> |
| 245 | 275 | </div> | ... | ... |
src/main/resources/static/real_control_v2/js/common.js
| ... | ... | @@ -112,7 +112,7 @@ var gb_common = (function () { |
| 112 | 112 | }); |
| 113 | 113 | }; |
| 114 | 114 | |
| 115 | - var errorHead = '<span style="color:red;">服务器出现异常:</span>'; | |
| 115 | + var errorHead = '<span style="color:red;">异常:</span>'; | |
| 116 | 116 | |
| 117 | 117 | function successHandle(json, handle) { |
| 118 | 118 | var status = json.status; | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
| ... | ... | @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { |
| 169 | 169 | function showUpdateDescription() { |
| 170 | 170 | //更新说明 |
| 171 | 171 | var updateDescription = { |
| 172 | - date: '2017-07-26', | |
| 173 | - text: '<h5>1、修复一个临时性的小问题,这个问题导致26号上午,起点站和第2站缓冲区重叠的几条线路发不出去!</h5>' | |
| 172 | + date: '2017-08-13', | |
| 173 | + text: '<h5>1、修复了 “子任务-区间调头” 当上下行里程不等时,站间距公里提示错误的问题!</h5>' | |
| 174 | 174 | }; |
| 175 | 175 | |
| 176 | 176 | var storage = window.localStorage | ... | ... |