Commit 28aa3c68adc45901d64095584fbeeb305cbde440

Authored by 王通
1 parent 6c8e4046

1.线调页面加入RFID状态指示灯

src/main/java/com/bsth/XDApplication.java
1 -package com.bsth;  
2 -  
3 -import com.bsth.data.BasicData;  
4 -import com.bsth.data.LineVersionsData;  
5 -import com.bsth.data.ThreadMonotor;  
6 -import com.bsth.data.car_out_info.UpdateDBThread;  
7 -import com.bsth.data.directive.DirectivesPstThread;  
8 -import com.bsth.data.forecast.SampleTimeDataLoader;  
9 -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;  
10 -import com.bsth.data.gpsdata_v2.thread.OfflineMonitorThread;  
11 -import com.bsth.data.msg_queue.DirectivePushQueue;  
12 -import com.bsth.data.msg_queue.WebSocketPushQueue;  
13 -import com.bsth.data.safe_driv.SafeDrivDataLoadThread;  
14 -import com.bsth.data.schedule.DayOfSchedule;  
15 -import com.bsth.data.schedule.auto_exec.AutoExecScanThread;  
16 -import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;  
17 -import com.bsth.data.schedule.edit_logs.SeiPstThread;  
18 -import com.bsth.data.schedule.late_adjust.ScheduleLateThread;  
19 -import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;  
20 -import com.bsth.data.schedule.thread.CalcOilThread;  
21 -import com.bsth.data.schedule.thread.SchedulePstThread;  
22 -import com.bsth.data.schedule.thread.ScheduleRefreshThread;  
23 -import com.bsth.data.schedule.thread.SubmitToTrafficManage;  
24 -import com.bsth.util.DateUtils;  
25 -import com.bsth.util.Tools;  
26 -import org.slf4j.Logger;  
27 -import org.slf4j.LoggerFactory;  
28 -import org.springframework.beans.factory.annotation.Autowired;  
29 -import org.springframework.boot.CommandLineRunner;  
30 -import org.springframework.stereotype.Component;  
31 -  
32 -import java.util.concurrent.ScheduledExecutorService;  
33 -import java.util.concurrent.TimeUnit;  
34 -  
35 -/**  
36 - * 线调大部分服务都在这里启动  
37 - * Created by panzhao on 2017/5/14.  
38 - */  
39 -@Component  
40 -public class XDApplication implements CommandLineRunner {  
41 -  
42 - Logger log = LoggerFactory.getLogger(this.getClass());  
43 -  
44 - @Autowired  
45 - BasicData.BasicDataLoader basicDataLoader;  
46 - @Autowired  
47 - UpdateDBThread fcxxUpdateThread;  
48 - @Autowired  
49 - ScheduleRefreshThread scheduleRefreshThread;  
50 - @Autowired  
51 - SchedulePstThread schedulePstThread;  
52 - @Autowired  
53 - ScheduleLateThread scheduleLateThread;  
54 - @Autowired  
55 - SubmitToTrafficManage submitToTrafficManage;  
56 - @Autowired  
57 - CalcOilThread calcOilThread;  
58 - @Autowired  
59 - DirectivesPstThread directivesPstThread;  
60 - @Autowired  
61 - ThreadMonotor threadMonotor;  
62 - @Autowired  
63 - SeiPstThread seiPstThread;  
64 - @Autowired  
65 - SampleTimeDataLoader sampleTimeDataLoader;  
66 - @Autowired  
67 - SchSiginUpdateDBThread schSiginUpdateDBThread;  
68 - @Autowired  
69 - AutoExecScanThread autoExecScanThread;  
70 -  
71 - @Autowired  
72 - GpsDataLoaderThread gpsDataLoader;  
73 -  
74 - @Autowired  
75 - OfflineMonitorThread offlineMonitorThread;  
76 -  
77 - @Autowired  
78 - LineVersionsData lineVersionsData;  
79 -  
80 - /*@Autowired  
81 - FixedEnableVerionsThread fixedEnableVerionsThread;*/  
82 -  
83 - @Autowired  
84 - SafeDrivDataLoadThread safeDrivDataLoadThread;  
85 -  
86 - @Autowired  
87 - FixedCheckStationCodeThread fixedCheckStationCodeThread;  
88 -  
89 - private static long timeDiff;  
90 - private static long timeDiffTraffic;  
91 -  
92 - static {  
93 - // 早上2:20  
94 - timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();  
95 - if (timeDiff < 0)  
96 - timeDiff += (1000 * 60 * 60 * 24);  
97 - // 早上07:00  
98 - timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis();  
99 - if (timeDiffTraffic < 0)  
100 - timeDiffTraffic += (1000 * 60 * 60 * 24);  
101 - }  
102 -  
103 - @Override  
104 - public void run(String... strings) throws Exception {  
105 - try {  
106 - Tools tools = new Tools("application.properties");  
107 - String environment = tools.getValue("spring.profiles.active");  
108 - //预先加载基础的对照数据  
109 - basicDataLoader.loadAllData();  
110 - switch (environment){  
111 - case "dev":  
112 - devInit();  
113 - break;  
114 - case "prod":  
115 - prodInit();  
116 - break;  
117 - }  
118 - }catch (Exception e){  
119 - log.error("线调后台启动出现异常!!", e);  
120 - System.exit(1);  
121 - }  
122 - }  
123 -  
124 - @Autowired  
125 - DayOfSchedule dayOfSchedule;  
126 - public void devInit(){  
127 - log.info("devInit...");  
128 - ScheduledExecutorService sexec = Application.mainServices;  
129 - //抓取GPS数据  
130 - gpsDataLoader.setFlag(-1);  
131 - //dayOfSchedule.dataRecovery();  
132 - //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS);  
133 - //实际排班更新线程  
134 - //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);  
135 - //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点  
136 - //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行  
137 - //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的  
138 -  
139 - //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 50, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码  
140 - //实际排班延迟入库线程  
141 - //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);  
142 - //班次修正日志延迟入库  
143 - //sexec.scheduleWithFixedDelay(seiPstThread, 60, 30, TimeUnit.SECONDS);  
144 - //调度指令延迟入库  
145 - //sexec.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);  
146 - //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)  
147 - //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);  
148 -  
149 - //安全驾驶  
150 - //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 40, 30, TimeUnit.SECONDS);  
151 -  
152 - //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 20, 60 * 2 , TimeUnit.SECONDS);  
153 - }  
154 -  
155 - public void prodInit(){  
156 - log.info("prodInit...");  
157 - ScheduledExecutorService sexec = Application.mainServices;  
158 - //安全驾驶  
159 - sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);  
160 -  
161 - /** 线调业务 */  
162 - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程  
163 - sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点  
164 - sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据  
165 - sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码  
166 -  
167 - sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线  
168 - sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程  
169 - sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库  
170 - sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库  
171 - sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)  
172 - sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据  
173 - sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新  
174 - sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行  
175 - DirectivePushQueue.start();//消息队列 -指令,系统下发的  
176 - WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的  
177 -  
178 - /** 线调为其他程序提供的数据 --写入数据库 */  
179 - sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)  
180 - //线路首末班数据(网关用,班次更新时写入)  
181 - //com.bsth.data.schedule.f_a_l.FirstAndLastHandler  
182 - sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)  
183 -  
184 - //运管处静态数据提交  
185 - log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");  
186 - sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);  
187 - //计算油、公里加注  
188 - sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);  
189 -  
190 - //线路版本更新  
191 - sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);  
192 -  
193 - //线路版本更新  
194 - //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);  
195 - }  
196 -} 1 +package com.bsth;
  2 +
  3 +import com.bsth.data.BasicData;
  4 +import com.bsth.data.LineVersionsData;
  5 +import com.bsth.data.ThreadMonotor;
  6 +import com.bsth.data.car_out_info.UpdateDBThread;
  7 +import com.bsth.data.directive.DirectivesPstThread;
  8 +import com.bsth.data.forecast.SampleTimeDataLoader;
  9 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  10 +import com.bsth.data.gpsdata_v2.thread.OfflineMonitorThread;
  11 +import com.bsth.data.gpsdata_v2.thread.RfidDataLoaderThread;
  12 +import com.bsth.data.msg_queue.DirectivePushQueue;
  13 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  14 +import com.bsth.data.safe_driv.SafeDrivDataLoadThread;
  15 +import com.bsth.data.schedule.DayOfSchedule;
  16 +import com.bsth.data.schedule.auto_exec.AutoExecScanThread;
  17 +import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;
  18 +import com.bsth.data.schedule.edit_logs.SeiPstThread;
  19 +import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
  20 +import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
  21 +import com.bsth.data.schedule.thread.CalcOilThread;
  22 +import com.bsth.data.schedule.thread.SchedulePstThread;
  23 +import com.bsth.data.schedule.thread.ScheduleRefreshThread;
  24 +import com.bsth.data.schedule.thread.SubmitToTrafficManage;
  25 +import com.bsth.util.DateUtils;
  26 +import com.bsth.util.Tools;
  27 +import org.slf4j.Logger;
  28 +import org.slf4j.LoggerFactory;
  29 +import org.springframework.beans.factory.annotation.Autowired;
  30 +import org.springframework.boot.CommandLineRunner;
  31 +import org.springframework.stereotype.Component;
  32 +
  33 +import java.util.concurrent.ScheduledExecutorService;
  34 +import java.util.concurrent.TimeUnit;
  35 +
  36 +/**
  37 + * 线调大部分服务都在这里启动
  38 + * Created by panzhao on 2017/5/14.
  39 + */
  40 +@Component
  41 +public class XDApplication implements CommandLineRunner {
  42 +
  43 + Logger log = LoggerFactory.getLogger(this.getClass());
  44 +
  45 + @Autowired
  46 + BasicData.BasicDataLoader basicDataLoader;
  47 + @Autowired
  48 + UpdateDBThread fcxxUpdateThread;
  49 + @Autowired
  50 + ScheduleRefreshThread scheduleRefreshThread;
  51 + @Autowired
  52 + SchedulePstThread schedulePstThread;
  53 + @Autowired
  54 + ScheduleLateThread scheduleLateThread;
  55 + @Autowired
  56 + SubmitToTrafficManage submitToTrafficManage;
  57 + @Autowired
  58 + CalcOilThread calcOilThread;
  59 + @Autowired
  60 + DirectivesPstThread directivesPstThread;
  61 + @Autowired
  62 + ThreadMonotor threadMonotor;
  63 + @Autowired
  64 + SeiPstThread seiPstThread;
  65 + @Autowired
  66 + SampleTimeDataLoader sampleTimeDataLoader;
  67 + @Autowired
  68 + SchSiginUpdateDBThread schSiginUpdateDBThread;
  69 + @Autowired
  70 + AutoExecScanThread autoExecScanThread;
  71 +
  72 + @Autowired
  73 + GpsDataLoaderThread gpsDataLoader;
  74 +
  75 + @Autowired
  76 + RfidDataLoaderThread rfidDataLoader;
  77 +
  78 + @Autowired
  79 + OfflineMonitorThread offlineMonitorThread;
  80 +
  81 + @Autowired
  82 + LineVersionsData lineVersionsData;
  83 +
  84 + /*@Autowired
  85 + FixedEnableVerionsThread fixedEnableVerionsThread;*/
  86 +
  87 + @Autowired
  88 + SafeDrivDataLoadThread safeDrivDataLoadThread;
  89 +
  90 + @Autowired
  91 + FixedCheckStationCodeThread fixedCheckStationCodeThread;
  92 +
  93 + private static long timeDiff;
  94 + private static long timeDiffTraffic;
  95 +
  96 + static {
  97 + // 早上2:20
  98 + timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
  99 + if (timeDiff < 0)
  100 + timeDiff += (1000 * 60 * 60 * 24);
  101 + // 早上07:00
  102 + timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis();
  103 + if (timeDiffTraffic < 0)
  104 + timeDiffTraffic += (1000 * 60 * 60 * 24);
  105 + }
  106 +
  107 + @Override
  108 + public void run(String... strings) throws Exception {
  109 + try {
  110 + Tools tools = new Tools("application.properties");
  111 + String environment = tools.getValue("spring.profiles.active");
  112 + //预先加载基础的对照数据
  113 + basicDataLoader.loadAllData();
  114 + switch (environment){
  115 + case "dev":
  116 + devInit();
  117 + break;
  118 + case "prod":
  119 + prodInit();
  120 + break;
  121 + }
  122 + }catch (Exception e){
  123 + log.error("线调后台启动出现异常!!", e);
  124 + System.exit(1);
  125 + }
  126 + }
  127 +
  128 + @Autowired
  129 + DayOfSchedule dayOfSchedule;
  130 + public void devInit(){
  131 + log.info("devInit...");
  132 + ScheduledExecutorService sexec = Application.mainServices;
  133 + //抓取GPS数据
  134 + gpsDataLoader.setFlag(-1);
  135 + //dayOfSchedule.dataRecovery();
  136 + //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS);
  137 + //实际排班更新线程
  138 + //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
  139 + //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点
  140 + //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行
  141 + //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  142 +
  143 + //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 50, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
  144 + //实际排班延迟入库线程
  145 + //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
  146 + //班次修正日志延迟入库
  147 + //sexec.scheduleWithFixedDelay(seiPstThread, 60, 30, TimeUnit.SECONDS);
  148 + //调度指令延迟入库
  149 + //sexec.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
  150 + //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  151 + //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);
  152 +
  153 + //安全驾驶
  154 + //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 40, 30, TimeUnit.SECONDS);
  155 +
  156 + //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 20, 60 * 2 , TimeUnit.SECONDS);
  157 + }
  158 +
  159 + public void prodInit(){
  160 + log.info("prodInit...");
  161 + ScheduledExecutorService sexec = Application.mainServices;
  162 + //安全驾驶
  163 + sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  164 +
  165 + /** 线调业务 */
  166 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  167 + sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
  168 + sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
  169 + sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  170 + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
  171 +
  172 + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  173 + sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
  174 + sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
  175 + sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
  176 + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  177 + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
  178 + sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
  179 + sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
  180 + DirectivePushQueue.start();//消息队列 -指令,系统下发的
  181 + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  182 +
  183 + /** 线调为其他程序提供的数据 --写入数据库 */
  184 + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
  185 + //线路首末班数据(网关用,班次更新时写入)
  186 + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
  187 + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
  188 +
  189 + //运管处静态数据提交
  190 + log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
  191 + //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  192 + //计算油、公里加注
  193 + sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  194 +
  195 + //线路版本更新
  196 + sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
  197 +
  198 + //线路版本更新
  199 + //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
  200 + }
  201 +}
src/main/java/com/bsth/data/gpsdata_v2/rfid/RfidHttpLoader.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.rfid;
  2 +
  3 +import com.bsth.data.gpsdata_v2.rfid.entity.RfidInfo;
  4 +import com.bsth.util.ConfigUtil;
  5 +import com.fasterxml.jackson.databind.ObjectMapper;
  6 +import org.apache.tomcat.util.http.fileupload.IOUtils;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +
  10 +import java.io.ByteArrayOutputStream;
  11 +import java.io.IOException;
  12 +import java.io.InputStream;
  13 +import java.io.OutputStream;
  14 +import java.net.HttpURLConnection;
  15 +import java.net.URL;
  16 +import java.util.ArrayList;
  17 +import java.util.List;
  18 +
  19 +/**
  20 + * @author hill
  21 + * @date
  22 + */
  23 +public class RfidHttpLoader {
  24 +
  25 + private final static Logger log = LoggerFactory.getLogger(RfidHttpLoader.class);
  26 +
  27 + private static String RFID_URL = ConfigUtil.get("http.rfid.url");
  28 +
  29 + public static List<RfidInfo> load() {
  30 + List<RfidInfo> result = new ArrayList<>();
  31 +
  32 + InputStream in = null;
  33 + OutputStream out = null;
  34 + HttpURLConnection con = null;
  35 + long start = System.currentTimeMillis();
  36 + try {
  37 + con = (HttpURLConnection)new URL(RFID_URL).openConnection();
  38 + con.setRequestMethod("GET");
  39 + con.setRequestProperty("keep-alive", "true");
  40 + con.setRequestProperty("accept", "application/json");
  41 + con.setRequestProperty("content-type", "application/json");
  42 + con.setDoInput(true);
  43 + con.setDoOutput(true);
  44 + con.setReadTimeout(5000);
  45 + con.setConnectTimeout(5000);
  46 +
  47 + in = con.getInputStream();
  48 + ByteArrayOutputStream bout = new ByteArrayOutputStream();
  49 + IOUtils.copy(in, bout); bout.close();
  50 + if (con.getResponseCode() == 200) {
  51 + ObjectMapper mapper = new ObjectMapper();
  52 + List<RfidInfo> list = mapper.readValue(bout.toByteArray(), mapper.getTypeFactory().constructParametrizedType(List.class, List.class, RfidInfo.class));
  53 + if (list != null) {
  54 + result.addAll(list);
  55 + }
  56 + } else {
  57 + log.info(new String(bout.toByteArray()));
  58 + }
  59 + } catch (Exception e) {
  60 + log.error("处理异常", e);
  61 + } finally {
  62 + con.disconnect();
  63 + try {
  64 + if (in != null) {
  65 + in.close();
  66 + }
  67 + if (out != null) {
  68 + out.close();
  69 + }
  70 + } catch (IOException e) {
  71 + // TODO Auto-generated catch block
  72 + e.printStackTrace();
  73 + }
  74 + }
  75 +
  76 + return result;
  77 + }
  78 +}
src/main/java/com/bsth/data/gpsdata_v2/rfid/entity/EmployeeCard.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.rfid.entity;
  2 +
  3 +/**
  4 + * @author hill
  5 + * @date
  6 + */
  7 +public class EmployeeCard {
  8 +
  9 + private String licenseUid;
  10 +
  11 + private String licenseNo;
  12 +
  13 + private int counter;
  14 +
  15 + public String getLicenseUid() {
  16 + return licenseUid;
  17 + }
  18 +
  19 + public void setLicenseUid(String licenseUid) {
  20 + this.licenseUid = licenseUid;
  21 + }
  22 +
  23 + public String getLicenseNo() {
  24 + return licenseNo;
  25 + }
  26 +
  27 + public void setLicenseNo(String licenseNo) {
  28 + this.licenseNo = licenseNo;
  29 + }
  30 +
  31 + public int getCounter() {
  32 + return counter;
  33 + }
  34 +
  35 + public void setCounter(int counter) {
  36 + this.counter = counter;
  37 + }
  38 +}
src/main/java/com/bsth/data/gpsdata_v2/rfid/entity/InoutStation.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.rfid.entity;
  2 +
  3 +/**
  4 + * @author hill
  5 + * @date
  6 + */
  7 +public class InoutStation {
  8 +
  9 + private String nbbm;
  10 +
  11 + //进出站 1进 0出
  12 + private int inout;
  13 +
  14 + private long timestamp;
  15 +
  16 + public String getNbbm() {
  17 + return nbbm;
  18 + }
  19 +
  20 + public void setNbbm(String nbbm) {
  21 + this.nbbm = nbbm;
  22 + }
  23 +
  24 + public int getInout() {
  25 + return inout;
  26 + }
  27 +
  28 + public void setInout(int inout) {
  29 + this.inout = inout;
  30 + }
  31 +
  32 + public long getTimestamp() {
  33 + return timestamp;
  34 + }
  35 +
  36 + public void setTimestamp(long timestamp) {
  37 + this.timestamp = timestamp;
  38 + }
  39 +}
src/main/java/com/bsth/data/gpsdata_v2/rfid/entity/RfidInfo.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.rfid.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +
  5 +import java.util.Date;
  6 +
  7 +@JsonIgnoreProperties(ignoreUnknown = true)
  8 +public class RfidInfo {
  9 +
  10 + // 车卡(副证 UID)
  11 + private String labelid;
  12 + // 标签状态
  13 + private int labelstate;
  14 + // 插卡状态
  15 + private int addIn;
  16 + // 车辆内部编码
  17 + private String nbbm;
  18 + // 时标时间
  19 + private Date recogTime;
  20 + // 线路编码
  21 + private String xlbm;
  22 + // 线路名称
  23 + private String xlmc;
  24 + // 员工工号
  25 + private String yggh;
  26 + // 站点编号(基站编号)
  27 + private String stationCode;
  28 + // 站点名称(基站名称)
  29 + private String stationName;
  30 + // 人卡信息
  31 + private EmployeeCard employeeCard;
  32 + // 进出信息
  33 + private InoutStation inoutStation;
  34 +
  35 + public String getLabelid() {
  36 + return labelid;
  37 + }
  38 +
  39 + public void setLabelid(String labelid) {
  40 + this.labelid = labelid;
  41 + }
  42 +
  43 + public int getLabelstate() {
  44 + return labelstate;
  45 + }
  46 +
  47 + public void setLabelstate(int labelstate) {
  48 + this.labelstate = labelstate;
  49 + }
  50 +
  51 + public int getAddIn() {
  52 + return addIn;
  53 + }
  54 +
  55 + public void setAddIn(int addIn) {
  56 + this.addIn = addIn;
  57 + }
  58 +
  59 + public String getNbbm() {
  60 + return nbbm;
  61 + }
  62 +
  63 + public void setNbbm(String nbbm) {
  64 + this.nbbm = nbbm;
  65 + }
  66 +
  67 + public Date getRecogTime() {
  68 + return recogTime;
  69 + }
  70 +
  71 + public void setRecogTime(Date recogTime) {
  72 + this.recogTime = recogTime;
  73 + }
  74 +
  75 + public String getXlbm() {
  76 + return xlbm;
  77 + }
  78 +
  79 + public void setXlbm(String xlbm) {
  80 + this.xlbm = xlbm;
  81 + }
  82 +
  83 + public String getXlmc() {
  84 + return xlmc;
  85 + }
  86 +
  87 + public void setXlmc(String xlmc) {
  88 + this.xlmc = xlmc;
  89 + }
  90 +
  91 + public String getYggh() {
  92 + return yggh;
  93 + }
  94 +
  95 + public void setYggh(String yggh) {
  96 + this.yggh = yggh;
  97 + }
  98 +
  99 + public String getStationCode() {
  100 + return stationCode;
  101 + }
  102 +
  103 + public void setStationCode(String stationCode) {
  104 + this.stationCode = stationCode;
  105 + }
  106 +
  107 + public String getStationName() {
  108 + return stationName;
  109 + }
  110 +
  111 + public void setStationName(String stationName) {
  112 + this.stationName = stationName;
  113 + }
  114 +
  115 + public EmployeeCard getEmployeeCard() {
  116 + return employeeCard;
  117 + }
  118 +
  119 + public void setEmployeeCard(EmployeeCard employeeCard) {
  120 + this.employeeCard = employeeCard;
  121 + }
  122 +
  123 + public InoutStation getInoutStation() {
  124 + return inoutStation;
  125 + }
  126 +
  127 + public void setInoutStation(InoutStation inoutStation) {
  128 + this.inoutStation = inoutStation;
  129 + }
  130 +}
src/main/java/com/bsth/data/gpsdata_v2/rfid/handle/RfidDataHandler.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.rfid.handle;
  2 +
  3 +import com.bsth.data.gpsdata_v2.rfid.entity.RfidInfo;
  4 +import com.bsth.data.gpsdata_v2.rfid.entity.RfidInoutStation;
  5 +import com.bsth.data.gpsdata_v2.status_manager.GpsStatusManager;
  6 +import com.bsth.data.msg_queue.DirectivePushQueue;
  7 +import com.bsth.data.schedule.DayOfSchedule;
  8 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import com.bsth.websocket.handler.SendUtils;
  10 +import org.apache.commons.lang3.StringUtils;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.stereotype.Component;
  15 +
  16 +import java.util.Iterator;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +import java.util.concurrent.ConcurrentHashMap;
  20 +
  21 +/**
  22 + * RFID信号处理
  23 + * Created by panzhao on 2017/11/22.
  24 + */
  25 +@Component
  26 +public class RfidDataHandler {
  27 +
  28 + @Autowired
  29 + private SendUtils sendUtils;
  30 +
  31 + @Autowired
  32 + private DayOfSchedule dayOfSchedule;
  33 +
  34 + private final static Logger logger = LoggerFactory.getLogger(RfidDataHandler.class);
  35 +
  36 + private Map<String, RfidInfo> nbbm2rfid = new ConcurrentHashMap<>();
  37 +
  38 + /**
  39 + *
  40 + * @param list
  41 + */
  42 + public void handle(List<RfidInfo> list){
  43 + for (RfidInfo ri : list) {
  44 + RfidInfo rfidInfo = nbbm2rfid.get(ri.getNbbm());
  45 + if (rfidInfo == null || rfidInfo.getRecogTime().getTime() != ri.getRecogTime().getTime()) {
  46 + nbbm2rfid.put(ri.getNbbm(), ri);
  47 + ScheduleRealInfo scheduleRealInfo = dayOfSchedule.executeCurr(ri.getNbbm());
  48 + if (scheduleRealInfo == null) {
  49 + continue;
  50 + }
  51 + int state = 0;
  52 + if (ri.getLabelid() != null) {
  53 + state |= 1;
  54 + }
  55 + if (ri.getEmployeeCard() != null) {
  56 + state |= 2;
  57 + }
  58 + if (scheduleRealInfo.getRfidState() != state) {
  59 + scheduleRealInfo.setRfidState(state);
  60 + sendUtils.sendRfid(scheduleRealInfo);
  61 + }
  62 + }
  63 + }
  64 +
  65 + checkValid();
  66 + }
  67 +
  68 + /**
  69 + * 检查rfid状态是否有效,超过5分钟的rfid信号标记为无效
  70 + */
  71 + private void checkValid() {
  72 + Iterator<Map.Entry<String, RfidInfo>> iterator = nbbm2rfid.entrySet().iterator();
  73 + for (;iterator.hasNext();) {
  74 + Map.Entry<String, RfidInfo> entry = iterator.next();
  75 + RfidInfo ri = entry.getValue();
  76 + if (ri.getRecogTime() != null && ri.getRecogTime().getTime() < System.currentTimeMillis() - 300000) {
  77 + ScheduleRealInfo scheduleRealInfo = dayOfSchedule.executeCurr(ri.getNbbm());
  78 + if (scheduleRealInfo == null) {
  79 + continue;
  80 + }
  81 + if (scheduleRealInfo.getRfidState() != 0) {
  82 + scheduleRealInfo.setRfidState(0);
  83 + sendUtils.sendRfid(scheduleRealInfo);
  84 + }
  85 + }
  86 + }
  87 + }
  88 +}
0 \ No newline at end of file 89 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata_v2/thread/RfidDataLoaderThread.java 0 → 100644
  1 +package com.bsth.data.gpsdata_v2.thread;
  2 +
  3 +import com.bsth.data.gpsdata_v2.DataHandleProcess;
  4 +import com.bsth.data.gpsdata_v2.rfid.RfidHttpLoader;
  5 +import com.bsth.data.gpsdata_v2.rfid.entity.RfidInfo;
  6 +import com.bsth.data.gpsdata_v2.rfid.handle.RfidDataHandler;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import java.util.List;
  13 +
  14 +@Component
  15 +public class RfidDataLoaderThread extends Thread {
  16 +
  17 + private final static Logger logger = LoggerFactory.getLogger(RfidDataLoaderThread.class);
  18 +
  19 + @Autowired
  20 + RfidDataHandler handleProcess;
  21 +
  22 + @Override
  23 + public void run() {
  24 + try {
  25 + List<RfidInfo> list = RfidHttpLoader.load();
  26 +
  27 + if (null != list && list.size() > 0) {
  28 + handleProcess.handle(list);
  29 + }
  30 + } catch (Exception e) {
  31 + logger.error("", e);
  32 + }
  33 + }
  34 +}
0 \ No newline at end of file 35 \ No newline at end of file
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
1 -package com.bsth.entity.realcontrol;  
2 -  
3 -import com.bsth.entity.sys.SysUser;  
4 -import com.fasterxml.jackson.annotation.JsonIgnore;  
5 -import org.apache.commons.lang3.StringUtils;  
6 -import org.joda.time.format.DateTimeFormat;  
7 -import org.joda.time.format.DateTimeFormatter;  
8 -  
9 -import javax.persistence.*;  
10 -import java.util.Date;  
11 -import java.util.HashSet;  
12 -import java.util.Set;  
13 -  
14 -/**  
15 - * 实际排班计划明细。  
16 - */  
17 -@Entity  
18 -@Table(name = "bsth_c_s_sp_info_real")  
19 -@NamedEntityGraphs({  
20 - @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = {  
21 - @NamedAttributeNode("cTasks")  
22 - })  
23 -})  
24 -public class ScheduleRealInfo {  
25 - /** 主键Id */  
26 - @Id  
27 - private Long id;  
28 -  
29 - /** 计划ID */  
30 - private Long spId;  
31 -  
32 - /** 排班计划日期 --no webSocket */  
33 - private Date scheduleDate;  
34 - /** 排班日期字符串 YYYY-MM-DD */  
35 - private String scheduleDateStr;  
36 -  
37 - /** 真实执行时间 yyyy-MM-dd */  
38 - private String realExecDate;  
39 -  
40 - /** 线路名称 */  
41 - private String xlName;  
42 - /** 线路编码 */  
43 - private String xlBm;  
44 -  
45 - /** 路牌名称 */  
46 - private String lpName;  
47 -  
48 - /** 车辆自编号 */  
49 - private String clZbh;  
50 -  
51 - /** 驾驶员工号 */  
52 - private String jGh;  
53 - /** 驾驶员名字 */  
54 - private String jName;  
55 - /** 售票员工号 */  
56 - private String sGh;  
57 - /** 售票员名字 */  
58 - private String sName;  
59 -  
60 - /** 线路方向 */  
61 - private String xlDir;  
62 - /** 起点站code*/  
63 - private String qdzCode;  
64 - /** 起点站名字 */  
65 - private String qdzName;  
66 -  
67 - /** 终点站code*/  
68 - private String zdzCode;  
69 - /** 终点站名字 */  
70 - private String zdzName;  
71 -  
72 - /** 计划发车时间(格式 HH:mm) */  
73 - private String fcsj;  
74 - /** 计划发车时间戳*/  
75 - @Transient  
76 - private Long fcsjT;  
77 -  
78 - /** 计划终点时间(格式 HH:mm) */  
79 - private String zdsj;  
80 - /** 计划终点时间戳*/  
81 - @Transient  
82 - private Long zdsjT;  
83 -  
84 - /** 发车顺序号 --no webSocket*/  
85 - private Integer fcno;  
86 - /** 对应班次数 --no webSocket*/  
87 - private Integer bcs;  
88 - /** 计划里程 */  
89 - private Double jhlc;  
90 -  
91 - /** 原始计划里程 (原计调的数据) */  
92 - private Double jhlcOrig;  
93 -  
94 - /** 实际里程 --no webSocket*/  
95 - @Transient  
96 - @JsonIgnore  
97 - private Double realMileage;  
98 -  
99 - /** 实际里程 --no webSocket */  
100 - @Transient  
101 - private String sjlc;  
102 - /** 班次历时 */  
103 - private Integer bcsj;  
104 -  
105 - /**  
106 - * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶  
107 - */  
108 - private String bcType;  
109 -  
110 - //放站班次 站点名称  
111 - private String majorStationName;  
112 -  
113 - /** 创建人 */  
114 - @JsonIgnore  
115 - @ManyToOne(fetch = FetchType.LAZY)  
116 - private SysUser createBy;  
117 - /** 修改人 */  
118 - @JsonIgnore  
119 - @ManyToOne(fetch = FetchType.LAZY)  
120 - private SysUser updateBy;  
121 - /** 创建日期 */  
122 - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")  
123 - private Date createDate;  
124 - /** 修改日期 */  
125 - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")  
126 - private Date updateDate;  
127 -  
128 - /** 实际发车时间*/  
129 - private String fcsjActual;  
130 - /** 实际发车时间戳*/  
131 - @Transient  
132 - private Long fcsjActualTime;  
133 - /**实际终点时间 */  
134 - private String zdsjActual;  
135 - /** 实际终点时间戳*/  
136 - @Transient  
137 - private Long zdsjActualTime;  
138 -  
139 - /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */  
140 - private int status;  
141 -  
142 - private String adjustExps;  
143 -  
144 - /** 是否是临加班次 */  
145 - private boolean sflj;  
146 -  
147 - /** 是否误点 (应发未发)*/  
148 - @Transient  
149 - private boolean late;  
150 -  
151 - /** 是否误点 (应发未到) */  
152 - @Transient  
153 - private boolean late2;  
154 - /** 误点停靠时间 */  
155 - @Transient  
156 - private float lateMinute;  
157 -  
158 - /** 备注*/  
159 - private String remarks;  
160 -  
161 - /** 原计划排班备注 --no webSocket */  
162 - @Transient  
163 - private String remark;  
164 -  
165 - /**待发时间(格式 HH:mm) */  
166 - private String dfsj;  
167 -  
168 - /**待发时间戳 */  
169 - @Transient  
170 - private Long dfsjT;  
171 -  
172 - /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */  
173 - private Integer directiveState = -1;  
174 -  
175 - /** 起点站计划到达时间 */  
176 - @Transient  
177 - private String qdzArrDatejh;  
178 -  
179 - /** 起点站实际到达时间 */  
180 - @Transient  
181 - private String qdzArrDatesj;  
182 -  
183 - /** 子任务 */  
184 - @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")  
185 - private Set<ChildTaskPlan> cTasks = new HashSet<>();  
186 -  
187 - /** 关联的公司名称 */  
188 - private String gsName;  
189 - /** 关联的公司编码 */  
190 - private String gsBm;  
191 - /** 关联的分公司名称 */  
192 - private String fgsName;  
193 - /** 关联的分公司编码 */  
194 - private String fgsBm;  
195 - /** 出场顺序号 */  
196 - private Integer ccno;  
197 -  
198 - //待发调试(是否自动调整)  
199 - private boolean dfAuto;  
200 - //是否有GPS信号  
201 - private boolean online;  
202 -  
203 - /** 是否有补发GPS信号 */  
204 - private boolean reissue;  
205 -  
206 - /** 发车屏 发车顺序号,不持久化,会动态变化 --no webSocket*/  
207 - @Transient  
208 - private int fcpSn;  
209 -  
210 - /** 标记班次已被删除 */  
211 - @Transient  
212 - @JsonIgnore  
213 - private boolean deleted;  
214 -  
215 - @Transient  
216 - @JsonIgnore  
217 - private int saveFailCount=0;  
218 -  
219 - /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/  
220 - private int siginCompate;  
221 -  
222 - /**  
223 - * 漂移状态  
224 - * 1: 发车漂移  
225 - * 2:到站漂移  
226 - * 3:中途漂移  
227 - */  
228 - private Integer driftStatus = 0;  
229 -  
230 - /**  
231 - * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成  
232 - */  
233 - private boolean ccService;  
234 - private Integer lpChange;  
235 -  
236 - public Integer getLpChange() {  
237 - return lpChange;  
238 - }  
239 -  
240 - public void setLpChange(Integer lpChange) {  
241 - this.lpChange = lpChange;  
242 - }  
243 -  
244 - public boolean isDfAuto() {  
245 - return dfAuto;  
246 - }  
247 -  
248 - public void setDfAuto(boolean dfAuto) {  
249 - this.dfAuto = dfAuto;  
250 - }  
251 -  
252 - public boolean isOnline() {  
253 - return online;  
254 - }  
255 -  
256 - public void setOnline(boolean online) {  
257 - this.online = online;  
258 - }  
259 -  
260 - public String getQdzArrDatejh() {  
261 - return qdzArrDatejh;  
262 - }  
263 -  
264 - public void setQdzArrDatejh(String qdzArrDatejh) {  
265 - this.qdzArrDatejh = qdzArrDatejh;  
266 - }  
267 -  
268 - public String getQdzArrDatesj() {  
269 - return qdzArrDatesj;  
270 - }  
271 -  
272 - public void setQdzArrDatesj(String qdzArrDatesj) {  
273 - this.qdzArrDatesj = qdzArrDatesj;  
274 - }  
275 -  
276 - public void setcTasks(Set<ChildTaskPlan> cTasks) {  
277 - this.cTasks = cTasks;  
278 - }  
279 -  
280 - public String getGsName() {  
281 - return gsName;  
282 - }  
283 -  
284 - public void setGsName(String gsName) {  
285 - this.gsName = gsName;  
286 - }  
287 -  
288 - public String getGsBm() {  
289 - return gsBm;  
290 - }  
291 -  
292 - public void setGsBm(String gsBm) {  
293 - this.gsBm = gsBm;  
294 - }  
295 -  
296 - public String getFgsName() {  
297 - return fgsName;  
298 - }  
299 -  
300 - public void setFgsName(String fgsName) {  
301 - this.fgsName = fgsName;  
302 - }  
303 -  
304 - public String getFgsBm() {  
305 - return fgsBm;  
306 - }  
307 -  
308 - public void setFgsBm(String fgsBm) {  
309 - this.fgsBm = fgsBm;  
310 - }  
311 -  
312 - public Integer getCcno() {  
313 - return ccno;  
314 - }  
315 -  
316 - public void setCcno(Integer ccno) {  
317 - this.ccno = ccno;  
318 - }  
319 -  
320 -  
321 - /** ----------------  
322 - @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)  
323 - private RealTimeModel sjfcModel;  
324 - @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)  
325 - private RealTimeModel sjddModel;  
326 - */  
327 - public void addRemarks(String remark){  
328 - if(StringUtils.isBlank(remark))  
329 - return;  
330 - String old = this.getRemarks();  
331 - if(StringUtils.isBlank(old))  
332 - old = "";  
333 -  
334 - old += remark + ";";  
335 - this.setRemarks(old);  
336 -  
337 - }  
338 -  
339 - public Long getId() {  
340 - return id;  
341 - }  
342 -  
343 - public void setId(Long id) {  
344 - this.id = id;  
345 - }  
346 -  
347 - public Date getScheduleDate() {  
348 - return scheduleDate;  
349 - }  
350 -  
351 - public void setScheduleDate(Date scheduleDate) {  
352 - this.scheduleDate = scheduleDate;  
353 - }  
354 -  
355 - public String getXlName() {  
356 - return xlName;  
357 - }  
358 -  
359 - public void setXlName(String xlName) {  
360 - this.xlName = xlName;  
361 - }  
362 -  
363 - public String getXlBm() {  
364 - return xlBm;  
365 - }  
366 -  
367 - public void setXlBm(String xlBm) {  
368 - this.xlBm = xlBm;  
369 - }  
370 -  
371 - public String getLpName() {  
372 - return lpName;  
373 - }  
374 -  
375 - public void setLpName(String lpName) {  
376 - this.lpName = lpName;  
377 - }  
378 -  
379 - public String getClZbh() {  
380 - return clZbh;  
381 - }  
382 -  
383 - public void setClZbh(String clZbh) {  
384 - this.clZbh = clZbh;  
385 - }  
386 -  
387 - public String getjGh() {  
388 - return jGh;  
389 - }  
390 -  
391 - public void setjGh(String jGh) {  
392 - this.jGh = jGh;  
393 - }  
394 -  
395 - public String getjName() {  
396 - return jName;  
397 - }  
398 -  
399 - public void setjName(String jName) {  
400 - this.jName = jName;  
401 - }  
402 -  
403 - public String getsGh() {  
404 - if(sGh == null)  
405 - return "";  
406 - return sGh;  
407 - }  
408 -  
409 - public void setsGh(String sGh) {  
410 - this.sGh = sGh;  
411 - }  
412 -  
413 - public String getsName() {  
414 - if(sGh == null)  
415 - return "";  
416 - return sName;  
417 - }  
418 -  
419 - public void setsName(String sName) {  
420 - this.sName = sName;  
421 - }  
422 -  
423 - public String getXlDir() {  
424 - return xlDir;  
425 - }  
426 -  
427 - public void setXlDir(String xlDir) {  
428 - this.xlDir = xlDir;  
429 - }  
430 -  
431 - public String getQdzCode() {  
432 - return qdzCode;  
433 - }  
434 -  
435 - public void setQdzCode(String qdzCode) {  
436 - this.qdzCode = qdzCode;  
437 - }  
438 -  
439 - public String getQdzName() {  
440 - return qdzName;  
441 - }  
442 -  
443 - public void setQdzName(String qdzName) {  
444 - this.qdzName = qdzName;  
445 - }  
446 -  
447 - public String getZdzCode() {  
448 - return zdzCode;  
449 - }  
450 -  
451 - public void setZdzCode(String zdzCode) {  
452 - this.zdzCode = zdzCode;  
453 - }  
454 -  
455 - public String getZdzName() {  
456 - return zdzName;  
457 - }  
458 -  
459 - public void setZdzName(String zdzName) {  
460 - this.zdzName = zdzName;  
461 - }  
462 -  
463 - public String getFcsj() {  
464 - return fcsj;  
465 - }  
466 -  
467 - public void setFcsj(String fcsj) {  
468 - this.fcsj = fcsj;  
469 - }  
470 -  
471 - public Long getFcsjT() {  
472 - return fcsjT;  
473 - }  
474 -  
475 - public void setFcsjT(Long fcsjT) {  
476 - this.fcsjT = fcsjT;  
477 - }  
478 -  
479 - public String getZdsj() {  
480 - return zdsj;  
481 - }  
482 -  
483 - public void setZdsj(String zdsj) {  
484 - this.zdsj = zdsj;  
485 - }  
486 -  
487 - public Long getZdsjT() {  
488 - return zdsjT;  
489 - }  
490 -  
491 - public void setZdsjT(Long zdsjT) {  
492 - this.zdsjT = zdsjT;  
493 - }  
494 -  
495 - public Integer getFcno() {  
496 - return fcno;  
497 - }  
498 -  
499 - public void setFcno(Integer fcno) {  
500 - this.fcno = fcno;  
501 - }  
502 -  
503 - public Integer getBcs() {  
504 - return bcs;  
505 - }  
506 -  
507 - public void setBcs(Integer bcs) {  
508 - this.bcs = bcs;  
509 - }  
510 -  
511 - public Double getJhlc() {  
512 - return jhlc;  
513 - }  
514 -  
515 - public void setJhlc(Double jhlc) {  
516 - this.jhlc = jhlc;  
517 - //临加班次 计划公里 和 实际计划公里一样  
518 - if(this.isSflj())  
519 - this.setJhlcOrig(this.getJhlc());  
520 - }  
521 -  
522 - public String getSjlc() {  
523 - return sjlc;  
524 - }  
525 -  
526 - public void setSjlc(String sjlc) {  
527 - this.sjlc = sjlc;  
528 - }  
529 -  
530 - public Integer getBcsj() {  
531 - return bcsj;  
532 - }  
533 -  
534 - public void setBcsj(Integer bcsj) {  
535 - this.bcsj = bcsj;  
536 - }  
537 -  
538 - public String getBcType() {  
539 - return bcType;  
540 - }  
541 -  
542 - public void setBcType(String bcType) {  
543 - this.bcType = bcType;  
544 - }  
545 -  
546 - public SysUser getCreateBy() {  
547 - return createBy;  
548 - }  
549 -  
550 - public void setCreateBy(SysUser createBy) {  
551 - this.createBy = createBy;  
552 - }  
553 -  
554 - public SysUser getUpdateBy() {  
555 - return updateBy;  
556 - }  
557 -  
558 - public void setUpdateBy(SysUser updateBy) {  
559 - this.updateBy = updateBy;  
560 - }  
561 -  
562 - public Date getCreateDate() {  
563 - return createDate;  
564 - }  
565 -  
566 - public void setCreateDate(Date createDate) {  
567 - this.createDate = createDate;  
568 - }  
569 -  
570 - public Date getUpdateDate() {  
571 - return updateDate;  
572 - }  
573 -  
574 - public void setUpdateDate(Date updateDate) {  
575 - this.updateDate = updateDate;  
576 - }  
577 -  
578 - public String getFcsjActual() {  
579 - return fcsjActual;  
580 - }  
581 -  
582 - public void setFcsjActual(String fcsjActual) {  
583 - this.fcsjActual = fcsjActual;  
584 - }  
585 -  
586 - public Long getFcsjActualTime() {  
587 - return fcsjActualTime;  
588 - }  
589 -  
590 - public void setFcsjActualTime(Long fcsjActualTime) {  
591 - this.fcsjActualTime = fcsjActualTime;  
592 - }  
593 -  
594 - public String getZdsjActual() {  
595 - return zdsjActual;  
596 - }  
597 -  
598 - public void setZdsjActual(String zdsjActual) {  
599 - this.zdsjActual = zdsjActual;  
600 - }  
601 -  
602 - public Long getZdsjActualTime() {  
603 - return zdsjActualTime;  
604 - }  
605 -  
606 - public void setZdsjActualTime(Long zdsjActualTime) {  
607 - this.zdsjActualTime = zdsjActualTime;  
608 - }  
609 -  
610 - public int getStatus() {  
611 - return status;  
612 - }  
613 -  
614 - public void setStatus(int status) {  
615 - this.status = status;  
616 - }  
617 -  
618 - public String getRemarks() {  
619 - return remarks;  
620 - }  
621 -  
622 - public void setRemarks(String remarks) {  
623 - this.remarks = remarks;  
624 - }  
625 -  
626 - public String getDfsj() {  
627 - return dfsj;  
628 - }  
629 -  
630 - public void setDfsj(String dfsj) {  
631 - this.dfsj = dfsj;  
632 - }  
633 -  
634 - public Long getDfsjT() {  
635 - return dfsjT;  
636 - }  
637 -  
638 - public void setDfsjT(Long dfsjT) {  
639 - this.dfsjT = dfsjT;  
640 - }  
641 -  
642 -  
643 - @Transient  
644 - private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");  
645 - @Transient  
646 - private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");  
647 -  
648 - public void setDfsjAll(Long dfsjT) {  
649 - this.dfsjT = dfsjT;  
650 - this.dfsj = fmtHHmm.print(this.dfsjT);  
651 - }  
652 -  
653 - public void setDfsjAll(String dfsj) {  
654 - this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj);  
655 - this.dfsj = dfsj;  
656 - }  
657 -  
658 - public void calcEndTime(){  
659 - //计划终点时间  
660 - if(this.getBcsj() != null){  
661 - //this.setZdsjT(this.getDfsjT() + (this.getBcsj() * 60 * 1000));  
662 - this.setZdsjT(this.getFcsjT() + (this.getBcsj() * 60 * 1000));//计划终点时间不变  
663 - this.setZdsj(fmtHHmm.print(this.zdsjT));  
664 - }  
665 - }  
666 -  
667 - public Integer getDirectiveState() {  
668 - return directiveState;  
669 - }  
670 -  
671 - public void setDirectiveState(Integer directiveState) {  
672 - this.directiveState = directiveState;  
673 - }  
674 -  
675 - @Override  
676 - public boolean equals(Object obj) {  
677 - try{  
678 - return this.id.equals(((ScheduleRealInfo)obj).getId());  
679 - }catch(Exception e){  
680 - return false;  
681 - }  
682 - }  
683 -  
684 - @Override  
685 - public int hashCode() {  
686 - return ("schedule_" + this.id).hashCode();  
687 - }  
688 -  
689 - public boolean isSflj() {  
690 - return sflj;  
691 - }  
692 -  
693 - public void setSflj(boolean sflj) {  
694 - this.sflj = sflj;  
695 - }  
696 -  
697 - /**  
698 - *  
699 - * @Title: setFcsjAll  
700 - * @Description: TODO(设置计划发车时间)  
701 - * @throws  
702 - */  
703 - public void setFcsjAll(String fcsj){  
704 - this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj);  
705 - this.fcsj = fcsj;  
706 - }  
707 -  
708 - /**  
709 - *  
710 - * @Title: setFcsjAll  
711 - * @Description: TODO(设置计划发车时间)  
712 - * @throws  
713 - */  
714 - public void setFcsjAll(Long fcsjT){  
715 - this.fcsjT = fcsjT;  
716 - this.fcsj = fmtHHmm.print(fcsjT);  
717 - }  
718 -  
719 - /**  
720 - *  
721 - * @Title: setFcsjActualAll  
722 - * @Description: TODO(设置实际发车时间 字符串)  
723 - * @throws  
724 - */  
725 - public void setFcsjActualAll(String fcsjActual){  
726 - this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual);  
727 - this.fcsjActual = fcsjActual;  
728 - calcStatus();  
729 - }  
730 -  
731 - /**  
732 - *  
733 - * @Title: setFcsjActualAll  
734 - * @Description: TODO(设置实际发车时间 时间戳)  
735 - * @throws  
736 - */  
737 - public void setFcsjActualAll(Long t){  
738 -  
739 - this.fcsjActualTime = t;  
740 - if(null == t)  
741 - this.fcsjActual = null;  
742 - else  
743 - this.fcsjActual = fmtHHmm.print(t);  
744 -  
745 - //更新班次状态  
746 - calcStatus();  
747 - }  
748 -  
749 - /**  
750 - *  
751 - * @Title: setFcsjActualAll  
752 - * @Description: TODO(设置实际终点时间)  
753 - * @throws  
754 - */  
755 - public void setZdsjActualAll(Long t){  
756 - this.zdsjActualTime = t;  
757 -  
758 - if(null == t)  
759 - this.zdsjActual = null;  
760 - else  
761 - this.zdsjActual = fmtHHmm.print(t);  
762 -  
763 - //更新班次状态  
764 - calcStatus();  
765 - }  
766 -  
767 - /**  
768 - *  
769 - * @Title: setFcsjActualAll  
770 - * @Description: TODO(设置实际终点时间)  
771 - * @throws  
772 - */  
773 - public void setZdsjActualAll(String zdsjActual){  
774 - this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual);  
775 - this.zdsjActual = zdsjActual;  
776 -  
777 - calcStatus();  
778 - }  
779 -  
780 - public Long getSpId() {  
781 - return spId;  
782 - }  
783 -  
784 - public void setSpId(Long spId) {  
785 - this.spId = spId;  
786 - }  
787 -  
788 - public String getRealExecDate() {  
789 - return realExecDate;  
790 - }  
791 -  
792 - public void setRealExecDate(String realExecDate) {  
793 - this.realExecDate = realExecDate;  
794 - }  
795 -  
796 - public void calcStatus() {  
797 - if(this.status == -1)  
798 - return;  
799 -  
800 - this.status = 0;  
801 - if(StringUtils.isNotBlank(this.fcsjActual)){  
802 - this.status = 1;  
803 -  
804 - //进出场班次并且没有计划里程的  
805 - if((this.bcType.equals("out") || this.bcType.equals("in"))  
806 - && this.jhlc == null){  
807 - this.status = 2;  
808 - }  
809 - }  
810 - if(StringUtils.isNotBlank(this.zdsjActual))  
811 - this.status = 2;  
812 - }  
813 -  
814 - public void destroy(){  
815 - this.jhlc = 0.0;  
816 - if(this.isSflj())  
817 - this.jhlcOrig = 0.0;  
818 - this.status = -1;  
819 - this.clearFcsjActual();  
820 - }  
821 -  
822 - public boolean isDestroy(){  
823 - return this.status == -1;  
824 - }  
825 -  
826 -/* public boolean isNotDestroy(){  
827 - return this.status != -1;  
828 - }*/  
829 -  
830 - public Set<ChildTaskPlan> getcTasks() {  
831 - return cTasks;  
832 - }  
833 -  
834 -/* public void setcTasks(Set<ChildTaskPlan> cTasks) {  
835 - this.cTasks = cTasks;  
836 - }*/  
837 -  
838 - public String getScheduleDateStr() {  
839 - return scheduleDateStr;  
840 - }  
841 -  
842 - public void setScheduleDateStr(String scheduleDateStr) {  
843 - this.scheduleDateStr = scheduleDateStr;  
844 - }  
845 -  
846 - public void clearFcsjActual(){  
847 - this.setFcsjActual(null);  
848 - this.setFcsjActualTime(null);  
849 - this.calcStatus();  
850 - }  
851 -  
852 - //清除实际终点时间  
853 - public void clearZdsjActual(){  
854 - this.setZdsjActual(null);  
855 - this.setZdsjActualTime(null);  
856 -  
857 - calcStatus();  
858 - }  
859 -  
860 - public boolean isLate() {  
861 - return late;  
862 - }  
863 -  
864 - public void setLate(boolean late) {  
865 - this.late = late;  
866 - }  
867 -  
868 - public String getAdjustExps() {  
869 - return adjustExps;  
870 - }  
871 -  
872 - public void setAdjustExps(String adjustExps) {  
873 - this.adjustExps = adjustExps;  
874 - }  
875 -  
876 - public boolean isReissue() {  
877 - return reissue;  
878 - }  
879 -  
880 - public void setReissue(boolean reissue) {  
881 - this.reissue = reissue;  
882 - }  
883 -  
884 - public Double getRealMileage() {  
885 - return realMileage;  
886 - }  
887 -  
888 - public void setRealMileage(Double realMileage) {  
889 - this.realMileage = realMileage;  
890 - }  
891 -  
892 - public Double getJhlcOrig() {  
893 - return jhlcOrig;  
894 - }  
895 -  
896 - public void setJhlcOrig(Double jhlcOrig) {  
897 - this.jhlcOrig = jhlcOrig;  
898 - }  
899 -  
900 - public void reCalcLate() {  
901 - if(this.getStatus() == 0  
902 - && this.getFcsjActual() == null  
903 - && this.dfsjT < System.currentTimeMillis()){  
904 - this.setLate(true);  
905 - }  
906 - else  
907 - this.setLate(false);  
908 - }  
909 -  
910 - public String getRemark() {  
911 - return remark;  
912 - }  
913 -  
914 - public void setRemark(String remark) {  
915 - this.remark = remark;  
916 - }  
917 -  
918 - public float getLateMinute() {  
919 - return lateMinute;  
920 - }  
921 -  
922 - public void setLateMinute(float lateMinute) {  
923 - this.lateMinute = lateMinute;  
924 - }  
925 -  
926 - public boolean isLate2() {  
927 - return late2;  
928 - }  
929 -  
930 - public void setLate2(boolean late2) {  
931 - this.late2 = late2;  
932 - }  
933 -  
934 - public int getFcpSn() {  
935 - return fcpSn;  
936 - }  
937 -  
938 - public void setFcpSn(int fcpSn) {  
939 - this.fcpSn = fcpSn;  
940 - }  
941 -  
942 - public boolean _isInout(){  
943 - return this.getBcType().equals("out") || this.getBcType().equals("in");  
944 - }  
945 -  
946 - public boolean isDeleted() {  
947 - return deleted;  
948 - }  
949 -  
950 - public void setDeleted(boolean deleted) {  
951 - this.deleted = deleted;  
952 - }  
953 -  
954 - public int getSaveFailCount() {  
955 - return saveFailCount;  
956 - }  
957 -  
958 - public void setSaveFailCount(int saveFailCount) {  
959 - this.saveFailCount = saveFailCount;  
960 - }  
961 -  
962 - public int getSiginCompate() {  
963 - return siginCompate;  
964 - }  
965 -  
966 - public void setSiginCompate(int siginCompate) {  
967 - this.siginCompate = siginCompate;  
968 - }  
969 -  
970 - public Integer getDriftStatus() {  
971 - return driftStatus;  
972 - }  
973 -  
974 - public void setDriftStatus(Integer driftStatus) {  
975 - this.driftStatus = driftStatus;  
976 - }  
977 -  
978 - public boolean isCcService() {  
979 - return ccService;  
980 - }  
981 -  
982 - public void setCcService(boolean ccService) {  
983 - this.ccService = ccService;  
984 - }  
985 -  
986 - public String getMajorStationName() {  
987 - return majorStationName;  
988 - }  
989 -  
990 - public void setMajorStationName(String majorStationName) {  
991 - this.majorStationName = majorStationName;  
992 - }  
993 -} 1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnore;
  5 +import org.apache.commons.lang3.StringUtils;
  6 +import org.joda.time.format.DateTimeFormat;
  7 +import org.joda.time.format.DateTimeFormatter;
  8 +
  9 +import javax.persistence.*;
  10 +import java.util.Date;
  11 +import java.util.HashSet;
  12 +import java.util.Set;
  13 +
  14 +/**
  15 + * 实际排班计划明细。
  16 + */
  17 +@Entity
  18 +@Table(name = "bsth_c_s_sp_info_real")
  19 +@NamedEntityGraphs({
  20 + @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = {
  21 + @NamedAttributeNode("cTasks")
  22 + })
  23 +})
  24 +public class ScheduleRealInfo {
  25 + /** 主键Id */
  26 + @Id
  27 + private Long id;
  28 +
  29 + /** 计划ID */
  30 + private Long spId;
  31 +
  32 + /** 排班计划日期 --no webSocket */
  33 + private Date scheduleDate;
  34 + /** 排班日期字符串 YYYY-MM-DD */
  35 + private String scheduleDateStr;
  36 +
  37 + /** 真实执行时间 yyyy-MM-dd */
  38 + private String realExecDate;
  39 +
  40 + /** 线路名称 */
  41 + private String xlName;
  42 + /** 线路编码 */
  43 + private String xlBm;
  44 +
  45 + /** 路牌名称 */
  46 + private String lpName;
  47 +
  48 + /** 车辆自编号 */
  49 + private String clZbh;
  50 +
  51 + /** 驾驶员工号 */
  52 + private String jGh;
  53 + /** 驾驶员名字 */
  54 + private String jName;
  55 + /** 售票员工号 */
  56 + private String sGh;
  57 + /** 售票员名字 */
  58 + private String sName;
  59 +
  60 + /** 线路方向 */
  61 + private String xlDir;
  62 + /** 起点站code*/
  63 + private String qdzCode;
  64 + /** 起点站名字 */
  65 + private String qdzName;
  66 +
  67 + /** 终点站code*/
  68 + private String zdzCode;
  69 + /** 终点站名字 */
  70 + private String zdzName;
  71 +
  72 + /** 计划发车时间(格式 HH:mm) */
  73 + private String fcsj;
  74 + /** 计划发车时间戳*/
  75 + @Transient
  76 + private Long fcsjT;
  77 +
  78 + /** 计划终点时间(格式 HH:mm) */
  79 + private String zdsj;
  80 + /** 计划终点时间戳*/
  81 + @Transient
  82 + private Long zdsjT;
  83 +
  84 + /** 发车顺序号 --no webSocket*/
  85 + private Integer fcno;
  86 + /** 对应班次数 --no webSocket*/
  87 + private Integer bcs;
  88 + /** 计划里程 */
  89 + private Double jhlc;
  90 +
  91 + /** 原始计划里程 (原计调的数据) */
  92 + private Double jhlcOrig;
  93 +
  94 + /** 实际里程 --no webSocket*/
  95 + @Transient
  96 + @JsonIgnore
  97 + private Double realMileage;
  98 +
  99 + /** 实际里程 --no webSocket */
  100 + @Transient
  101 + private String sjlc;
  102 + /** 班次历时 */
  103 + private Integer bcsj;
  104 +
  105 + /**
  106 + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
  107 + */
  108 + private String bcType;
  109 +
  110 + //放站班次 站点名称
  111 + private String majorStationName;
  112 +
  113 + /** 创建人 */
  114 + @JsonIgnore
  115 + @ManyToOne(fetch = FetchType.LAZY)
  116 + private SysUser createBy;
  117 + /** 修改人 */
  118 + @JsonIgnore
  119 + @ManyToOne(fetch = FetchType.LAZY)
  120 + private SysUser updateBy;
  121 + /** 创建日期 */
  122 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  123 + private Date createDate;
  124 + /** 修改日期 */
  125 + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  126 + private Date updateDate;
  127 +
  128 + /** 实际发车时间*/
  129 + private String fcsjActual;
  130 + /** 实际发车时间戳*/
  131 + @Transient
  132 + private Long fcsjActualTime;
  133 + /**实际终点时间 */
  134 + private String zdsjActual;
  135 + /** 实际终点时间戳*/
  136 + @Transient
  137 + private Long zdsjActualTime;
  138 +
  139 + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
  140 + private int status;
  141 +
  142 + private String adjustExps;
  143 +
  144 + /** 是否是临加班次 */
  145 + private boolean sflj;
  146 +
  147 + /** 是否误点 (应发未发)*/
  148 + @Transient
  149 + private boolean late;
  150 +
  151 + /** 是否误点 (应发未到) */
  152 + @Transient
  153 + private boolean late2;
  154 + /** 误点停靠时间 */
  155 + @Transient
  156 + private float lateMinute;
  157 +
  158 + /** 备注*/
  159 + private String remarks;
  160 +
  161 + /** 原计划排班备注 --no webSocket */
  162 + @Transient
  163 + private String remark;
  164 +
  165 + /**待发时间(格式 HH:mm) */
  166 + private String dfsj;
  167 +
  168 + /**待发时间戳 */
  169 + @Transient
  170 + private Long dfsjT;
  171 +
  172 + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
  173 + private Integer directiveState = -1;
  174 +
  175 + /** 起点站计划到达时间 */
  176 + @Transient
  177 + private String qdzArrDatejh;
  178 +
  179 + /** 起点站实际到达时间 */
  180 + @Transient
  181 + private String qdzArrDatesj;
  182 +
  183 + /** 子任务 */
  184 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
  185 + private Set<ChildTaskPlan> cTasks = new HashSet<>();
  186 +
  187 + /** 关联的公司名称 */
  188 + private String gsName;
  189 + /** 关联的公司编码 */
  190 + private String gsBm;
  191 + /** 关联的分公司名称 */
  192 + private String fgsName;
  193 + /** 关联的分公司编码 */
  194 + private String fgsBm;
  195 + /** 出场顺序号 */
  196 + private Integer ccno;
  197 +
  198 + //待发调试(是否自动调整)
  199 + private boolean dfAuto;
  200 + //是否有GPS信号
  201 + private boolean online;
  202 +
  203 + /** 是否有补发GPS信号 */
  204 + private boolean reissue;
  205 +
  206 + /** 发车屏 发车顺序号,不持久化,会动态变化 --no webSocket*/
  207 + @Transient
  208 + private int fcpSn;
  209 +
  210 + /** 标记班次已被删除 */
  211 + @Transient
  212 + @JsonIgnore
  213 + private boolean deleted;
  214 +
  215 + @Transient
  216 + @JsonIgnore
  217 + private int saveFailCount=0;
  218 +
  219 + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/
  220 + private int siginCompate;
  221 +
  222 + /**
  223 + * 漂移状态
  224 + * 1: 发车漂移
  225 + * 2:到站漂移
  226 + * 3:中途漂移
  227 + */
  228 + private Integer driftStatus = 0;
  229 +
  230 + /**
  231 + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
  232 + */
  233 + private boolean ccService;
  234 + private Integer lpChange;
  235 +
  236 + /**
  237 + * rfid状态
  238 + */
  239 + private int rfidState;
  240 +
  241 + public Integer getLpChange() {
  242 + return lpChange;
  243 + }
  244 +
  245 + public void setLpChange(Integer lpChange) {
  246 + this.lpChange = lpChange;
  247 + }
  248 +
  249 + public boolean isDfAuto() {
  250 + return dfAuto;
  251 + }
  252 +
  253 + public void setDfAuto(boolean dfAuto) {
  254 + this.dfAuto = dfAuto;
  255 + }
  256 +
  257 + public boolean isOnline() {
  258 + return online;
  259 + }
  260 +
  261 + public void setOnline(boolean online) {
  262 + this.online = online;
  263 + }
  264 +
  265 + public String getQdzArrDatejh() {
  266 + return qdzArrDatejh;
  267 + }
  268 +
  269 + public void setQdzArrDatejh(String qdzArrDatejh) {
  270 + this.qdzArrDatejh = qdzArrDatejh;
  271 + }
  272 +
  273 + public String getQdzArrDatesj() {
  274 + return qdzArrDatesj;
  275 + }
  276 +
  277 + public void setQdzArrDatesj(String qdzArrDatesj) {
  278 + this.qdzArrDatesj = qdzArrDatesj;
  279 + }
  280 +
  281 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  282 + this.cTasks = cTasks;
  283 + }
  284 +
  285 + public String getGsName() {
  286 + return gsName;
  287 + }
  288 +
  289 + public void setGsName(String gsName) {
  290 + this.gsName = gsName;
  291 + }
  292 +
  293 + public String getGsBm() {
  294 + return gsBm;
  295 + }
  296 +
  297 + public void setGsBm(String gsBm) {
  298 + this.gsBm = gsBm;
  299 + }
  300 +
  301 + public String getFgsName() {
  302 + return fgsName;
  303 + }
  304 +
  305 + public void setFgsName(String fgsName) {
  306 + this.fgsName = fgsName;
  307 + }
  308 +
  309 + public String getFgsBm() {
  310 + return fgsBm;
  311 + }
  312 +
  313 + public void setFgsBm(String fgsBm) {
  314 + this.fgsBm = fgsBm;
  315 + }
  316 +
  317 + public Integer getCcno() {
  318 + return ccno;
  319 + }
  320 +
  321 + public void setCcno(Integer ccno) {
  322 + this.ccno = ccno;
  323 + }
  324 +
  325 +
  326 + /** ----------------
  327 + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  328 + private RealTimeModel sjfcModel;
  329 + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  330 + private RealTimeModel sjddModel;
  331 + */
  332 + public void addRemarks(String remark){
  333 + if(StringUtils.isBlank(remark))
  334 + return;
  335 + String old = this.getRemarks();
  336 + if(StringUtils.isBlank(old))
  337 + old = "";
  338 +
  339 + old += remark + ";";
  340 + this.setRemarks(old);
  341 +
  342 + }
  343 +
  344 + public Long getId() {
  345 + return id;
  346 + }
  347 +
  348 + public void setId(Long id) {
  349 + this.id = id;
  350 + }
  351 +
  352 + public Date getScheduleDate() {
  353 + return scheduleDate;
  354 + }
  355 +
  356 + public void setScheduleDate(Date scheduleDate) {
  357 + this.scheduleDate = scheduleDate;
  358 + }
  359 +
  360 + public String getXlName() {
  361 + return xlName;
  362 + }
  363 +
  364 + public void setXlName(String xlName) {
  365 + this.xlName = xlName;
  366 + }
  367 +
  368 + public String getXlBm() {
  369 + return xlBm;
  370 + }
  371 +
  372 + public void setXlBm(String xlBm) {
  373 + this.xlBm = xlBm;
  374 + }
  375 +
  376 + public String getLpName() {
  377 + return lpName;
  378 + }
  379 +
  380 + public void setLpName(String lpName) {
  381 + this.lpName = lpName;
  382 + }
  383 +
  384 + public String getClZbh() {
  385 + return clZbh;
  386 + }
  387 +
  388 + public void setClZbh(String clZbh) {
  389 + this.clZbh = clZbh;
  390 + }
  391 +
  392 + public String getjGh() {
  393 + return jGh;
  394 + }
  395 +
  396 + public void setjGh(String jGh) {
  397 + this.jGh = jGh;
  398 + }
  399 +
  400 + public String getjName() {
  401 + return jName;
  402 + }
  403 +
  404 + public void setjName(String jName) {
  405 + this.jName = jName;
  406 + }
  407 +
  408 + public String getsGh() {
  409 + if(sGh == null)
  410 + return "";
  411 + return sGh;
  412 + }
  413 +
  414 + public void setsGh(String sGh) {
  415 + this.sGh = sGh;
  416 + }
  417 +
  418 + public String getsName() {
  419 + if(sGh == null)
  420 + return "";
  421 + return sName;
  422 + }
  423 +
  424 + public void setsName(String sName) {
  425 + this.sName = sName;
  426 + }
  427 +
  428 + public String getXlDir() {
  429 + return xlDir;
  430 + }
  431 +
  432 + public void setXlDir(String xlDir) {
  433 + this.xlDir = xlDir;
  434 + }
  435 +
  436 + public String getQdzCode() {
  437 + return qdzCode;
  438 + }
  439 +
  440 + public void setQdzCode(String qdzCode) {
  441 + this.qdzCode = qdzCode;
  442 + }
  443 +
  444 + public String getQdzName() {
  445 + return qdzName;
  446 + }
  447 +
  448 + public void setQdzName(String qdzName) {
  449 + this.qdzName = qdzName;
  450 + }
  451 +
  452 + public String getZdzCode() {
  453 + return zdzCode;
  454 + }
  455 +
  456 + public void setZdzCode(String zdzCode) {
  457 + this.zdzCode = zdzCode;
  458 + }
  459 +
  460 + public String getZdzName() {
  461 + return zdzName;
  462 + }
  463 +
  464 + public void setZdzName(String zdzName) {
  465 + this.zdzName = zdzName;
  466 + }
  467 +
  468 + public String getFcsj() {
  469 + return fcsj;
  470 + }
  471 +
  472 + public void setFcsj(String fcsj) {
  473 + this.fcsj = fcsj;
  474 + }
  475 +
  476 + public Long getFcsjT() {
  477 + return fcsjT;
  478 + }
  479 +
  480 + public void setFcsjT(Long fcsjT) {
  481 + this.fcsjT = fcsjT;
  482 + }
  483 +
  484 + public String getZdsj() {
  485 + return zdsj;
  486 + }
  487 +
  488 + public void setZdsj(String zdsj) {
  489 + this.zdsj = zdsj;
  490 + }
  491 +
  492 + public Long getZdsjT() {
  493 + return zdsjT;
  494 + }
  495 +
  496 + public void setZdsjT(Long zdsjT) {
  497 + this.zdsjT = zdsjT;
  498 + }
  499 +
  500 + public Integer getFcno() {
  501 + return fcno;
  502 + }
  503 +
  504 + public void setFcno(Integer fcno) {
  505 + this.fcno = fcno;
  506 + }
  507 +
  508 + public Integer getBcs() {
  509 + return bcs;
  510 + }
  511 +
  512 + public void setBcs(Integer bcs) {
  513 + this.bcs = bcs;
  514 + }
  515 +
  516 + public Double getJhlc() {
  517 + return jhlc;
  518 + }
  519 +
  520 + public void setJhlc(Double jhlc) {
  521 + this.jhlc = jhlc;
  522 + //临加班次 计划公里 和 实际计划公里一样
  523 + if(this.isSflj())
  524 + this.setJhlcOrig(this.getJhlc());
  525 + }
  526 +
  527 + public String getSjlc() {
  528 + return sjlc;
  529 + }
  530 +
  531 + public void setSjlc(String sjlc) {
  532 + this.sjlc = sjlc;
  533 + }
  534 +
  535 + public Integer getBcsj() {
  536 + return bcsj;
  537 + }
  538 +
  539 + public void setBcsj(Integer bcsj) {
  540 + this.bcsj = bcsj;
  541 + }
  542 +
  543 + public String getBcType() {
  544 + return bcType;
  545 + }
  546 +
  547 + public void setBcType(String bcType) {
  548 + this.bcType = bcType;
  549 + }
  550 +
  551 + public SysUser getCreateBy() {
  552 + return createBy;
  553 + }
  554 +
  555 + public void setCreateBy(SysUser createBy) {
  556 + this.createBy = createBy;
  557 + }
  558 +
  559 + public SysUser getUpdateBy() {
  560 + return updateBy;
  561 + }
  562 +
  563 + public void setUpdateBy(SysUser updateBy) {
  564 + this.updateBy = updateBy;
  565 + }
  566 +
  567 + public Date getCreateDate() {
  568 + return createDate;
  569 + }
  570 +
  571 + public void setCreateDate(Date createDate) {
  572 + this.createDate = createDate;
  573 + }
  574 +
  575 + public Date getUpdateDate() {
  576 + return updateDate;
  577 + }
  578 +
  579 + public void setUpdateDate(Date updateDate) {
  580 + this.updateDate = updateDate;
  581 + }
  582 +
  583 + public String getFcsjActual() {
  584 + return fcsjActual;
  585 + }
  586 +
  587 + public void setFcsjActual(String fcsjActual) {
  588 + this.fcsjActual = fcsjActual;
  589 + }
  590 +
  591 + public Long getFcsjActualTime() {
  592 + return fcsjActualTime;
  593 + }
  594 +
  595 + public void setFcsjActualTime(Long fcsjActualTime) {
  596 + this.fcsjActualTime = fcsjActualTime;
  597 + }
  598 +
  599 + public String getZdsjActual() {
  600 + return zdsjActual;
  601 + }
  602 +
  603 + public void setZdsjActual(String zdsjActual) {
  604 + this.zdsjActual = zdsjActual;
  605 + }
  606 +
  607 + public Long getZdsjActualTime() {
  608 + return zdsjActualTime;
  609 + }
  610 +
  611 + public void setZdsjActualTime(Long zdsjActualTime) {
  612 + this.zdsjActualTime = zdsjActualTime;
  613 + }
  614 +
  615 + public int getStatus() {
  616 + return status;
  617 + }
  618 +
  619 + public void setStatus(int status) {
  620 + this.status = status;
  621 + }
  622 +
  623 + public String getRemarks() {
  624 + return remarks;
  625 + }
  626 +
  627 + public void setRemarks(String remarks) {
  628 + this.remarks = remarks;
  629 + }
  630 +
  631 + public String getDfsj() {
  632 + return dfsj;
  633 + }
  634 +
  635 + public void setDfsj(String dfsj) {
  636 + this.dfsj = dfsj;
  637 + }
  638 +
  639 + public Long getDfsjT() {
  640 + return dfsjT;
  641 + }
  642 +
  643 + public void setDfsjT(Long dfsjT) {
  644 + this.dfsjT = dfsjT;
  645 + }
  646 +
  647 +
  648 + @Transient
  649 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  650 + @Transient
  651 + private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
  652 +
  653 + public void setDfsjAll(Long dfsjT) {
  654 + this.dfsjT = dfsjT;
  655 + this.dfsj = fmtHHmm.print(this.dfsjT);
  656 + }
  657 +
  658 + public void setDfsjAll(String dfsj) {
  659 + this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj);
  660 + this.dfsj = dfsj;
  661 + }
  662 +
  663 + public void calcEndTime(){
  664 + //计划终点时间
  665 + if(this.getBcsj() != null){
  666 + //this.setZdsjT(this.getDfsjT() + (this.getBcsj() * 60 * 1000));
  667 + this.setZdsjT(this.getFcsjT() + (this.getBcsj() * 60 * 1000));//计划终点时间不变
  668 + this.setZdsj(fmtHHmm.print(this.zdsjT));
  669 + }
  670 + }
  671 +
  672 + public Integer getDirectiveState() {
  673 + return directiveState;
  674 + }
  675 +
  676 + public void setDirectiveState(Integer directiveState) {
  677 + this.directiveState = directiveState;
  678 + }
  679 +
  680 + @Override
  681 + public boolean equals(Object obj) {
  682 + try{
  683 + return this.id.equals(((ScheduleRealInfo)obj).getId());
  684 + }catch(Exception e){
  685 + return false;
  686 + }
  687 + }
  688 +
  689 + @Override
  690 + public int hashCode() {
  691 + return ("schedule_" + this.id).hashCode();
  692 + }
  693 +
  694 + public boolean isSflj() {
  695 + return sflj;
  696 + }
  697 +
  698 + public void setSflj(boolean sflj) {
  699 + this.sflj = sflj;
  700 + }
  701 +
  702 + /**
  703 + *
  704 + * @Title: setFcsjAll
  705 + * @Description: TODO(设置计划发车时间)
  706 + * @throws
  707 + */
  708 + public void setFcsjAll(String fcsj){
  709 + this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj);
  710 + this.fcsj = fcsj;
  711 + }
  712 +
  713 + /**
  714 + *
  715 + * @Title: setFcsjAll
  716 + * @Description: TODO(设置计划发车时间)
  717 + * @throws
  718 + */
  719 + public void setFcsjAll(Long fcsjT){
  720 + this.fcsjT = fcsjT;
  721 + this.fcsj = fmtHHmm.print(fcsjT);
  722 + }
  723 +
  724 + /**
  725 + *
  726 + * @Title: setFcsjActualAll
  727 + * @Description: TODO(设置实际发车时间 字符串)
  728 + * @throws
  729 + */
  730 + public void setFcsjActualAll(String fcsjActual){
  731 + this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual);
  732 + this.fcsjActual = fcsjActual;
  733 + calcStatus();
  734 + }
  735 +
  736 + /**
  737 + *
  738 + * @Title: setFcsjActualAll
  739 + * @Description: TODO(设置实际发车时间 时间戳)
  740 + * @throws
  741 + */
  742 + public void setFcsjActualAll(Long t){
  743 +
  744 + this.fcsjActualTime = t;
  745 + if(null == t)
  746 + this.fcsjActual = null;
  747 + else
  748 + this.fcsjActual = fmtHHmm.print(t);
  749 +
  750 + //更新班次状态
  751 + calcStatus();
  752 + }
  753 +
  754 + /**
  755 + *
  756 + * @Title: setFcsjActualAll
  757 + * @Description: TODO(设置实际终点时间)
  758 + * @throws
  759 + */
  760 + public void setZdsjActualAll(Long t){
  761 + this.zdsjActualTime = t;
  762 +
  763 + if(null == t)
  764 + this.zdsjActual = null;
  765 + else
  766 + this.zdsjActual = fmtHHmm.print(t);
  767 +
  768 + //更新班次状态
  769 + calcStatus();
  770 + }
  771 +
  772 + /**
  773 + *
  774 + * @Title: setFcsjActualAll
  775 + * @Description: TODO(设置实际终点时间)
  776 + * @throws
  777 + */
  778 + public void setZdsjActualAll(String zdsjActual){
  779 + this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual);
  780 + this.zdsjActual = zdsjActual;
  781 +
  782 + calcStatus();
  783 + }
  784 +
  785 + public Long getSpId() {
  786 + return spId;
  787 + }
  788 +
  789 + public void setSpId(Long spId) {
  790 + this.spId = spId;
  791 + }
  792 +
  793 + public String getRealExecDate() {
  794 + return realExecDate;
  795 + }
  796 +
  797 + public void setRealExecDate(String realExecDate) {
  798 + this.realExecDate = realExecDate;
  799 + }
  800 +
  801 + public void calcStatus() {
  802 + if(this.status == -1)
  803 + return;
  804 +
  805 + this.status = 0;
  806 + if(StringUtils.isNotBlank(this.fcsjActual)){
  807 + this.status = 1;
  808 +
  809 + //进出场班次并且没有计划里程的
  810 + if((this.bcType.equals("out") || this.bcType.equals("in"))
  811 + && this.jhlc == null){
  812 + this.status = 2;
  813 + }
  814 + }
  815 + if(StringUtils.isNotBlank(this.zdsjActual))
  816 + this.status = 2;
  817 + }
  818 +
  819 + public void destroy(){
  820 + this.jhlc = 0.0;
  821 + if(this.isSflj())
  822 + this.jhlcOrig = 0.0;
  823 + this.status = -1;
  824 + this.clearFcsjActual();
  825 + }
  826 +
  827 + public boolean isDestroy(){
  828 + return this.status == -1;
  829 + }
  830 +
  831 +/* public boolean isNotDestroy(){
  832 + return this.status != -1;
  833 + }*/
  834 +
  835 + public Set<ChildTaskPlan> getcTasks() {
  836 + return cTasks;
  837 + }
  838 +
  839 +/* public void setcTasks(Set<ChildTaskPlan> cTasks) {
  840 + this.cTasks = cTasks;
  841 + }*/
  842 +
  843 + public String getScheduleDateStr() {
  844 + return scheduleDateStr;
  845 + }
  846 +
  847 + public void setScheduleDateStr(String scheduleDateStr) {
  848 + this.scheduleDateStr = scheduleDateStr;
  849 + }
  850 +
  851 + public void clearFcsjActual(){
  852 + this.setFcsjActual(null);
  853 + this.setFcsjActualTime(null);
  854 + this.calcStatus();
  855 + }
  856 +
  857 + //清除实际终点时间
  858 + public void clearZdsjActual(){
  859 + this.setZdsjActual(null);
  860 + this.setZdsjActualTime(null);
  861 +
  862 + calcStatus();
  863 + }
  864 +
  865 + public boolean isLate() {
  866 + return late;
  867 + }
  868 +
  869 + public void setLate(boolean late) {
  870 + this.late = late;
  871 + }
  872 +
  873 + public String getAdjustExps() {
  874 + return adjustExps;
  875 + }
  876 +
  877 + public void setAdjustExps(String adjustExps) {
  878 + this.adjustExps = adjustExps;
  879 + }
  880 +
  881 + public boolean isReissue() {
  882 + return reissue;
  883 + }
  884 +
  885 + public void setReissue(boolean reissue) {
  886 + this.reissue = reissue;
  887 + }
  888 +
  889 + public Double getRealMileage() {
  890 + return realMileage;
  891 + }
  892 +
  893 + public void setRealMileage(Double realMileage) {
  894 + this.realMileage = realMileage;
  895 + }
  896 +
  897 + public Double getJhlcOrig() {
  898 + return jhlcOrig;
  899 + }
  900 +
  901 + public void setJhlcOrig(Double jhlcOrig) {
  902 + this.jhlcOrig = jhlcOrig;
  903 + }
  904 +
  905 + public void reCalcLate() {
  906 + if(this.getStatus() == 0
  907 + && this.getFcsjActual() == null
  908 + && this.dfsjT < System.currentTimeMillis()){
  909 + this.setLate(true);
  910 + }
  911 + else
  912 + this.setLate(false);
  913 + }
  914 +
  915 + public String getRemark() {
  916 + return remark;
  917 + }
  918 +
  919 + public void setRemark(String remark) {
  920 + this.remark = remark;
  921 + }
  922 +
  923 + public float getLateMinute() {
  924 + return lateMinute;
  925 + }
  926 +
  927 + public void setLateMinute(float lateMinute) {
  928 + this.lateMinute = lateMinute;
  929 + }
  930 +
  931 + public boolean isLate2() {
  932 + return late2;
  933 + }
  934 +
  935 + public void setLate2(boolean late2) {
  936 + this.late2 = late2;
  937 + }
  938 +
  939 + public int getFcpSn() {
  940 + return fcpSn;
  941 + }
  942 +
  943 + public void setFcpSn(int fcpSn) {
  944 + this.fcpSn = fcpSn;
  945 + }
  946 +
  947 + public boolean _isInout(){
  948 + return this.getBcType().equals("out") || this.getBcType().equals("in");
  949 + }
  950 +
  951 + public boolean isDeleted() {
  952 + return deleted;
  953 + }
  954 +
  955 + public void setDeleted(boolean deleted) {
  956 + this.deleted = deleted;
  957 + }
  958 +
  959 + public int getSaveFailCount() {
  960 + return saveFailCount;
  961 + }
  962 +
  963 + public void setSaveFailCount(int saveFailCount) {
  964 + this.saveFailCount = saveFailCount;
  965 + }
  966 +
  967 + public int getSiginCompate() {
  968 + return siginCompate;
  969 + }
  970 +
  971 + public void setSiginCompate(int siginCompate) {
  972 + this.siginCompate = siginCompate;
  973 + }
  974 +
  975 + public Integer getDriftStatus() {
  976 + return driftStatus;
  977 + }
  978 +
  979 + public void setDriftStatus(Integer driftStatus) {
  980 + this.driftStatus = driftStatus;
  981 + }
  982 +
  983 + public boolean isCcService() {
  984 + return ccService;
  985 + }
  986 +
  987 + public void setCcService(boolean ccService) {
  988 + this.ccService = ccService;
  989 + }
  990 +
  991 + public String getMajorStationName() {
  992 + return majorStationName;
  993 + }
  994 +
  995 + public void setMajorStationName(String majorStationName) {
  996 + this.majorStationName = majorStationName;
  997 + }
  998 +
  999 + public int getRfidState() {
  1000 + return rfidState;
  1001 + }
  1002 +
  1003 + public void setRfidState(int rfidState) {
  1004 + this.rfidState = rfidState;
  1005 + }
  1006 +}
src/main/java/com/bsth/websocket/dto/WsScheduleRealInfo.java
1 -package com.bsth.websocket.dto;  
2 -  
3 -import com.bsth.entity.realcontrol.ChildTaskPlan;  
4 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
5 -  
6 -import javax.persistence.FetchType;  
7 -import javax.persistence.OneToMany;  
8 -import javax.persistence.Transient;  
9 -import java.util.*;  
10 -  
11 -/**  
12 - * 精简字段的实际排班 entity  
13 - * webSocket 传输用,去掉了页面不需要的一些字段  
14 - * Created by panzhao on 2017/11/14.  
15 - */  
16 -public class WsScheduleRealInfo {  
17 -  
18 - public static WsScheduleRealInfo getInstance(ScheduleRealInfo sch){  
19 - if(null == sch)  
20 - return null;  
21 - WsScheduleRealInfo wss = new WsScheduleRealInfo();  
22 - wss.id = sch.getId();  
23 - wss.scheduleDateStr = sch.getScheduleDateStr();  
24 - wss.realExecDate = sch.getRealExecDate();  
25 - wss.xlName = sch.getXlName();  
26 - wss.xlBm = sch.getXlBm();  
27 - wss.lpName = sch.getLpName();  
28 - wss.clZbh = sch.getClZbh();  
29 - wss.jGh = sch.getjGh();  
30 - wss.jName = sch.getjName();  
31 - wss.sGh = sch.getsGh();  
32 - wss.sName = sch.getsName();  
33 - wss.xlDir = sch.getXlDir();  
34 - wss.qdzCode = sch.getQdzCode();  
35 - wss.qdzName = sch.getQdzName();  
36 - wss.zdzCode = sch.getZdzCode();  
37 - wss.zdzName = sch.getZdzName();  
38 - wss.fcsj = sch.getFcsj();  
39 - wss.fcsjT = sch.getFcsjT();  
40 - wss.zdsj = sch.getZdsj();  
41 - wss.zdsjT = sch.getZdsjT();  
42 - wss.jhlc = sch.getJhlc();  
43 - wss.jhlcOrig = sch.getJhlcOrig();  
44 - wss.bcsj = sch.getBcsj();  
45 - wss.bcType = sch.getBcType();  
46 - wss.majorStationName = sch.getMajorStationName();  
47 - wss.fcsjActual = sch.getFcsjActual();  
48 - wss.fcsjActualTime = sch.getFcsjActualTime();  
49 - wss.zdsjActual = sch.getZdsjActual();  
50 - wss.zdsjActualTime = sch.getZdsjActualTime();  
51 - wss.status = sch.getStatus();  
52 - wss.adjustExps = sch.getAdjustExps();  
53 - wss.sflj = sch.isSflj();  
54 - wss.late = sch.isLate();  
55 - wss.late2 = sch.isLate2();  
56 - wss.lateMinute = sch.getLateMinute();  
57 - wss.remarks = sch.getRemarks();  
58 - wss.dfsj = sch.getDfsj();  
59 - wss.dfsjT = sch.getDfsjT();  
60 - wss.directiveState = sch.getDirectiveState();  
61 - wss.qdzArrDatejh = sch.getQdzArrDatejh();  
62 - wss.qdzArrDatesj = sch.getQdzArrDatesj();  
63 - wss.cTasks = sch.getcTasks();  
64 - wss.gsName = sch.getGsName();  
65 - wss.gsBm = sch.getGsBm();  
66 - wss.fgsName = sch.getFgsName();  
67 - wss.fgsBm = sch.getFgsBm();  
68 - wss.ccService = sch.isCcService();  
69 - return wss;  
70 - }  
71 -  
72 -  
73 - public static List<WsScheduleRealInfo> getMultiInstance(Collection<ScheduleRealInfo> list){  
74 - List<WsScheduleRealInfo> rs = new ArrayList<>();  
75 - for(ScheduleRealInfo sch : list){  
76 - rs.add(getInstance(sch));  
77 - }  
78 - return rs;  
79 - }  
80 -  
81 - /** 主键Id */  
82 - private Long id;  
83 -  
84 - /** 排班日期字符串 YYYY-MM-DD */  
85 - private String scheduleDateStr;  
86 -  
87 - /** 真实执行时间 yyyy-MM-dd */  
88 - private String realExecDate;  
89 -  
90 - /** 线路名称 */  
91 - private String xlName;  
92 - /** 线路编码 */  
93 - private String xlBm;  
94 -  
95 - /** 路牌名称 */  
96 - private String lpName;  
97 -  
98 - /** 车辆自编号 */  
99 - private String clZbh;  
100 -  
101 - /** 驾驶员工号 */  
102 - private String jGh;  
103 - /** 驾驶员名字 */  
104 - private String jName;  
105 - /** 售票员工号 */  
106 - private String sGh;  
107 - /** 售票员名字 */  
108 - private String sName;  
109 -  
110 - /** 线路方向 */  
111 - private String xlDir;  
112 - /** 起点站code*/  
113 - private String qdzCode;  
114 - /** 起点站名字 */  
115 - private String qdzName;  
116 -  
117 - /** 终点站code*/  
118 - private String zdzCode;  
119 - /** 终点站名字 */  
120 - private String zdzName;  
121 -  
122 - /** 计划发车时间(格式 HH:mm) */  
123 - private String fcsj;  
124 - /** 计划发车时间戳*/  
125 - @Transient  
126 - private Long fcsjT;  
127 -  
128 - /** 计划终点时间(格式 HH:mm) */  
129 - private String zdsj;  
130 - /** 计划终点时间戳*/  
131 - @Transient  
132 - private Long zdsjT;  
133 -  
134 - /** 计划里程 */  
135 - private Double jhlc;  
136 -  
137 - /** 原始计划里程 (原计调的数据) */  
138 - private Double jhlcOrig;  
139 - /** 班次历时 */  
140 - private Integer bcsj;  
141 -  
142 - /**  
143 - * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶  
144 - */  
145 - private String bcType;  
146 -  
147 - //放站班次 站点名称  
148 - private String majorStationName;  
149 -  
150 - /** 实际发车时间*/  
151 - private String fcsjActual;  
152 - /** 实际发车时间戳*/  
153 - @Transient  
154 - private Long fcsjActualTime;  
155 - /**实际终点时间 */  
156 - private String zdsjActual;  
157 - /** 实际终点时间戳*/  
158 - @Transient  
159 - private Long zdsjActualTime;  
160 -  
161 - /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */  
162 - private int status;  
163 -  
164 - private String adjustExps;  
165 -  
166 - /** 是否是临加班次 */  
167 - private boolean sflj;  
168 -  
169 - /** 是否误点 (应发未发)*/  
170 - @Transient  
171 - private boolean late;  
172 -  
173 - /** 是否误点 (应发未到) */  
174 - @Transient  
175 - private boolean late2;  
176 - /** 误点停靠时间 */  
177 - @Transient  
178 - private float lateMinute;  
179 -  
180 - /** 备注*/  
181 - private String remarks;  
182 -  
183 - /**待发时间(格式 HH:mm) */  
184 - private String dfsj;  
185 -  
186 - /**待发时间戳 */  
187 - @Transient  
188 - private Long dfsjT;  
189 -  
190 - /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */  
191 - private Integer directiveState = -1;  
192 -  
193 - /** 起点站计划到达时间 */  
194 - @Transient  
195 - private String qdzArrDatejh;  
196 -  
197 - /** 起点站实际到达时间 */  
198 - @Transient  
199 - private String qdzArrDatesj;  
200 -  
201 - /** 子任务 */  
202 - @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")  
203 - private Set<ChildTaskPlan> cTasks = new HashSet<>();  
204 -  
205 - /** 关联的公司名称 */  
206 - private String gsName;  
207 - /** 关联的公司编码 */  
208 - private String gsBm;  
209 - /** 关联的分公司名称 */  
210 - private String fgsName;  
211 - /** 关联的分公司编码 */  
212 - private String fgsBm;  
213 -  
214 - /**  
215 - * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成  
216 - */  
217 - private boolean ccService;  
218 -  
219 - public Long getId() {  
220 - return id;  
221 - }  
222 -  
223 - public void setId(Long id) {  
224 - this.id = id;  
225 - }  
226 -  
227 - public String getScheduleDateStr() {  
228 - return scheduleDateStr;  
229 - }  
230 -  
231 - public void setScheduleDateStr(String scheduleDateStr) {  
232 - this.scheduleDateStr = scheduleDateStr;  
233 - }  
234 -  
235 - public String getRealExecDate() {  
236 - return realExecDate;  
237 - }  
238 -  
239 - public void setRealExecDate(String realExecDate) {  
240 - this.realExecDate = realExecDate;  
241 - }  
242 -  
243 - public String getXlName() {  
244 - return xlName;  
245 - }  
246 -  
247 - public void setXlName(String xlName) {  
248 - this.xlName = xlName;  
249 - }  
250 -  
251 - public String getXlBm() {  
252 - return xlBm;  
253 - }  
254 -  
255 - public void setXlBm(String xlBm) {  
256 - this.xlBm = xlBm;  
257 - }  
258 -  
259 - public String getLpName() {  
260 - return lpName;  
261 - }  
262 -  
263 - public void setLpName(String lpName) {  
264 - this.lpName = lpName;  
265 - }  
266 -  
267 - public String getClZbh() {  
268 - return clZbh;  
269 - }  
270 -  
271 - public void setClZbh(String clZbh) {  
272 - this.clZbh = clZbh;  
273 - }  
274 -  
275 - public String getjGh() {  
276 - return jGh;  
277 - }  
278 -  
279 - public void setjGh(String jGh) {  
280 - this.jGh = jGh;  
281 - }  
282 -  
283 - public String getjName() {  
284 - return jName;  
285 - }  
286 -  
287 - public void setjName(String jName) {  
288 - this.jName = jName;  
289 - }  
290 -  
291 - public String getsGh() {  
292 - return sGh;  
293 - }  
294 -  
295 - public void setsGh(String sGh) {  
296 - this.sGh = sGh;  
297 - }  
298 -  
299 - public String getsName() {  
300 - return sName;  
301 - }  
302 -  
303 - public void setsName(String sName) {  
304 - this.sName = sName;  
305 - }  
306 -  
307 - public String getXlDir() {  
308 - return xlDir;  
309 - }  
310 -  
311 - public void setXlDir(String xlDir) {  
312 - this.xlDir = xlDir;  
313 - }  
314 -  
315 - public String getQdzCode() {  
316 - return qdzCode;  
317 - }  
318 -  
319 - public void setQdzCode(String qdzCode) {  
320 - this.qdzCode = qdzCode;  
321 - }  
322 -  
323 - public String getQdzName() {  
324 - return qdzName;  
325 - }  
326 -  
327 - public void setQdzName(String qdzName) {  
328 - this.qdzName = qdzName;  
329 - }  
330 -  
331 - public String getZdzCode() {  
332 - return zdzCode;  
333 - }  
334 -  
335 - public void setZdzCode(String zdzCode) {  
336 - this.zdzCode = zdzCode;  
337 - }  
338 -  
339 - public String getZdzName() {  
340 - return zdzName;  
341 - }  
342 -  
343 - public void setZdzName(String zdzName) {  
344 - this.zdzName = zdzName;  
345 - }  
346 -  
347 - public String getFcsj() {  
348 - return fcsj;  
349 - }  
350 -  
351 - public void setFcsj(String fcsj) {  
352 - this.fcsj = fcsj;  
353 - }  
354 -  
355 - public Long getFcsjT() {  
356 - return fcsjT;  
357 - }  
358 -  
359 - public void setFcsjT(Long fcsjT) {  
360 - this.fcsjT = fcsjT;  
361 - }  
362 -  
363 - public String getZdsj() {  
364 - return zdsj;  
365 - }  
366 -  
367 - public void setZdsj(String zdsj) {  
368 - this.zdsj = zdsj;  
369 - }  
370 -  
371 - public Long getZdsjT() {  
372 - return zdsjT;  
373 - }  
374 -  
375 - public void setZdsjT(Long zdsjT) {  
376 - this.zdsjT = zdsjT;  
377 - }  
378 -  
379 - public Double getJhlc() {  
380 - return jhlc;  
381 - }  
382 -  
383 - public void setJhlc(Double jhlc) {  
384 - this.jhlc = jhlc;  
385 - }  
386 -  
387 - public Double getJhlcOrig() {  
388 - return jhlcOrig;  
389 - }  
390 -  
391 - public void setJhlcOrig(Double jhlcOrig) {  
392 - this.jhlcOrig = jhlcOrig;  
393 - }  
394 -  
395 - public Integer getBcsj() {  
396 - return bcsj;  
397 - }  
398 -  
399 - public void setBcsj(Integer bcsj) {  
400 - this.bcsj = bcsj;  
401 - }  
402 -  
403 - public String getBcType() {  
404 - return bcType;  
405 - }  
406 -  
407 - public void setBcType(String bcType) {  
408 - this.bcType = bcType;  
409 - }  
410 -  
411 - public String getMajorStationName() {  
412 - return majorStationName;  
413 - }  
414 -  
415 - public void setMajorStationName(String majorStationName) {  
416 - this.majorStationName = majorStationName;  
417 - }  
418 -  
419 - public String getFcsjActual() {  
420 - return fcsjActual;  
421 - }  
422 -  
423 - public void setFcsjActual(String fcsjActual) {  
424 - this.fcsjActual = fcsjActual;  
425 - }  
426 -  
427 - public Long getFcsjActualTime() {  
428 - return fcsjActualTime;  
429 - }  
430 -  
431 - public void setFcsjActualTime(Long fcsjActualTime) {  
432 - this.fcsjActualTime = fcsjActualTime;  
433 - }  
434 -  
435 - public String getZdsjActual() {  
436 - return zdsjActual;  
437 - }  
438 -  
439 - public void setZdsjActual(String zdsjActual) {  
440 - this.zdsjActual = zdsjActual;  
441 - }  
442 -  
443 - public Long getZdsjActualTime() {  
444 - return zdsjActualTime;  
445 - }  
446 -  
447 - public void setZdsjActualTime(Long zdsjActualTime) {  
448 - this.zdsjActualTime = zdsjActualTime;  
449 - }  
450 -  
451 - public int getStatus() {  
452 - return status;  
453 - }  
454 -  
455 - public void setStatus(int status) {  
456 - this.status = status;  
457 - }  
458 -  
459 - public String getAdjustExps() {  
460 - return adjustExps;  
461 - }  
462 -  
463 - public void setAdjustExps(String adjustExps) {  
464 - this.adjustExps = adjustExps;  
465 - }  
466 -  
467 - public boolean isSflj() {  
468 - return sflj;  
469 - }  
470 -  
471 - public void setSflj(boolean sflj) {  
472 - this.sflj = sflj;  
473 - }  
474 -  
475 - public boolean isLate() {  
476 - return late;  
477 - }  
478 -  
479 - public void setLate(boolean late) {  
480 - this.late = late;  
481 - }  
482 -  
483 - public boolean isLate2() {  
484 - return late2;  
485 - }  
486 -  
487 - public void setLate2(boolean late2) {  
488 - this.late2 = late2;  
489 - }  
490 -  
491 - public float getLateMinute() {  
492 - return lateMinute;  
493 - }  
494 -  
495 - public void setLateMinute(float lateMinute) {  
496 - this.lateMinute = lateMinute;  
497 - }  
498 -  
499 - public String getRemarks() {  
500 - return remarks;  
501 - }  
502 -  
503 - public void setRemarks(String remarks) {  
504 - this.remarks = remarks;  
505 - }  
506 -  
507 - public String getDfsj() {  
508 - return dfsj;  
509 - }  
510 -  
511 - public void setDfsj(String dfsj) {  
512 - this.dfsj = dfsj;  
513 - }  
514 -  
515 - public Long getDfsjT() {  
516 - return dfsjT;  
517 - }  
518 -  
519 - public void setDfsjT(Long dfsjT) {  
520 - this.dfsjT = dfsjT;  
521 - }  
522 -  
523 - public Integer getDirectiveState() {  
524 - return directiveState;  
525 - }  
526 -  
527 - public void setDirectiveState(Integer directiveState) {  
528 - this.directiveState = directiveState;  
529 - }  
530 -  
531 - public String getQdzArrDatejh() {  
532 - return qdzArrDatejh;  
533 - }  
534 -  
535 - public void setQdzArrDatejh(String qdzArrDatejh) {  
536 - this.qdzArrDatejh = qdzArrDatejh;  
537 - }  
538 -  
539 - public String getQdzArrDatesj() {  
540 - return qdzArrDatesj;  
541 - }  
542 -  
543 - public void setQdzArrDatesj(String qdzArrDatesj) {  
544 - this.qdzArrDatesj = qdzArrDatesj;  
545 - }  
546 -  
547 - public Set<ChildTaskPlan> getcTasks() {  
548 - return cTasks;  
549 - }  
550 -  
551 - public void setcTasks(Set<ChildTaskPlan> cTasks) {  
552 - this.cTasks = cTasks;  
553 - }  
554 -  
555 - public String getGsName() {  
556 - return gsName;  
557 - }  
558 -  
559 - public void setGsName(String gsName) {  
560 - this.gsName = gsName;  
561 - }  
562 -  
563 - public String getGsBm() {  
564 - return gsBm;  
565 - }  
566 -  
567 - public void setGsBm(String gsBm) {  
568 - this.gsBm = gsBm;  
569 - }  
570 -  
571 - public String getFgsName() {  
572 - return fgsName;  
573 - }  
574 -  
575 - public void setFgsName(String fgsName) {  
576 - this.fgsName = fgsName;  
577 - }  
578 -  
579 - public String getFgsBm() {  
580 - return fgsBm;  
581 - }  
582 -  
583 - public void setFgsBm(String fgsBm) {  
584 - this.fgsBm = fgsBm;  
585 - }  
586 -  
587 - public boolean isCcService() {  
588 - return ccService;  
589 - }  
590 -  
591 - public void setCcService(boolean ccService) {  
592 - this.ccService = ccService;  
593 - }  
594 -} 1 +package com.bsth.websocket.dto;
  2 +
  3 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  4 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  5 +
  6 +import javax.persistence.FetchType;
  7 +import javax.persistence.OneToMany;
  8 +import javax.persistence.Transient;
  9 +import java.util.*;
  10 +
  11 +/**
  12 + * 精简字段的实际排班 entity
  13 + * webSocket 传输用,去掉了页面不需要的一些字段
  14 + * Created by panzhao on 2017/11/14.
  15 + */
  16 +public class WsScheduleRealInfo {
  17 +
  18 + public static WsScheduleRealInfo getInstance(ScheduleRealInfo sch){
  19 + if(null == sch)
  20 + return null;
  21 + WsScheduleRealInfo wss = new WsScheduleRealInfo();
  22 + wss.id = sch.getId();
  23 + wss.scheduleDateStr = sch.getScheduleDateStr();
  24 + wss.realExecDate = sch.getRealExecDate();
  25 + wss.xlName = sch.getXlName();
  26 + wss.xlBm = sch.getXlBm();
  27 + wss.lpName = sch.getLpName();
  28 + wss.clZbh = sch.getClZbh();
  29 + wss.jGh = sch.getjGh();
  30 + wss.jName = sch.getjName();
  31 + wss.sGh = sch.getsGh();
  32 + wss.sName = sch.getsName();
  33 + wss.xlDir = sch.getXlDir();
  34 + wss.qdzCode = sch.getQdzCode();
  35 + wss.qdzName = sch.getQdzName();
  36 + wss.zdzCode = sch.getZdzCode();
  37 + wss.zdzName = sch.getZdzName();
  38 + wss.fcsj = sch.getFcsj();
  39 + wss.fcsjT = sch.getFcsjT();
  40 + wss.zdsj = sch.getZdsj();
  41 + wss.zdsjT = sch.getZdsjT();
  42 + wss.jhlc = sch.getJhlc();
  43 + wss.jhlcOrig = sch.getJhlcOrig();
  44 + wss.bcsj = sch.getBcsj();
  45 + wss.bcType = sch.getBcType();
  46 + wss.majorStationName = sch.getMajorStationName();
  47 + wss.fcsjActual = sch.getFcsjActual();
  48 + wss.fcsjActualTime = sch.getFcsjActualTime();
  49 + wss.zdsjActual = sch.getZdsjActual();
  50 + wss.zdsjActualTime = sch.getZdsjActualTime();
  51 + wss.status = sch.getStatus();
  52 + wss.adjustExps = sch.getAdjustExps();
  53 + wss.sflj = sch.isSflj();
  54 + wss.late = sch.isLate();
  55 + wss.late2 = sch.isLate2();
  56 + wss.lateMinute = sch.getLateMinute();
  57 + wss.remarks = sch.getRemarks();
  58 + wss.dfsj = sch.getDfsj();
  59 + wss.dfsjT = sch.getDfsjT();
  60 + wss.directiveState = sch.getDirectiveState();
  61 + wss.qdzArrDatejh = sch.getQdzArrDatejh();
  62 + wss.qdzArrDatesj = sch.getQdzArrDatesj();
  63 + wss.cTasks = sch.getcTasks();
  64 + wss.gsName = sch.getGsName();
  65 + wss.gsBm = sch.getGsBm();
  66 + wss.fgsName = sch.getFgsName();
  67 + wss.fgsBm = sch.getFgsBm();
  68 + wss.ccService = sch.isCcService();
  69 + wss.rfidState = sch.getRfidState();
  70 + return wss;
  71 + }
  72 +
  73 +
  74 + public static List<WsScheduleRealInfo> getMultiInstance(Collection<ScheduleRealInfo> list){
  75 + List<WsScheduleRealInfo> rs = new ArrayList<>();
  76 + for(ScheduleRealInfo sch : list){
  77 + rs.add(getInstance(sch));
  78 + }
  79 + return rs;
  80 + }
  81 +
  82 + /** 主键Id */
  83 + private Long id;
  84 +
  85 + /** 排班日期字符串 YYYY-MM-DD */
  86 + private String scheduleDateStr;
  87 +
  88 + /** 真实执行时间 yyyy-MM-dd */
  89 + private String realExecDate;
  90 +
  91 + /** 线路名称 */
  92 + private String xlName;
  93 + /** 线路编码 */
  94 + private String xlBm;
  95 +
  96 + /** 路牌名称 */
  97 + private String lpName;
  98 +
  99 + /** 车辆自编号 */
  100 + private String clZbh;
  101 +
  102 + /** 驾驶员工号 */
  103 + private String jGh;
  104 + /** 驾驶员名字 */
  105 + private String jName;
  106 + /** 售票员工号 */
  107 + private String sGh;
  108 + /** 售票员名字 */
  109 + private String sName;
  110 +
  111 + /** 线路方向 */
  112 + private String xlDir;
  113 + /** 起点站code*/
  114 + private String qdzCode;
  115 + /** 起点站名字 */
  116 + private String qdzName;
  117 +
  118 + /** 终点站code*/
  119 + private String zdzCode;
  120 + /** 终点站名字 */
  121 + private String zdzName;
  122 +
  123 + /** 计划发车时间(格式 HH:mm) */
  124 + private String fcsj;
  125 + /** 计划发车时间戳*/
  126 + @Transient
  127 + private Long fcsjT;
  128 +
  129 + /** 计划终点时间(格式 HH:mm) */
  130 + private String zdsj;
  131 + /** 计划终点时间戳*/
  132 + @Transient
  133 + private Long zdsjT;
  134 +
  135 + /** 计划里程 */
  136 + private Double jhlc;
  137 +
  138 + /** 原始计划里程 (原计调的数据) */
  139 + private Double jhlcOrig;
  140 + /** 班次历时 */
  141 + private Integer bcsj;
  142 +
  143 + /**
  144 + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
  145 + */
  146 + private String bcType;
  147 +
  148 + //放站班次 站点名称
  149 + private String majorStationName;
  150 +
  151 + /** 实际发车时间*/
  152 + private String fcsjActual;
  153 + /** 实际发车时间戳*/
  154 + @Transient
  155 + private Long fcsjActualTime;
  156 + /**实际终点时间 */
  157 + private String zdsjActual;
  158 + /** 实际终点时间戳*/
  159 + @Transient
  160 + private Long zdsjActualTime;
  161 +
  162 + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
  163 + private int status;
  164 +
  165 + private String adjustExps;
  166 +
  167 + /** 是否是临加班次 */
  168 + private boolean sflj;
  169 +
  170 + /** 是否误点 (应发未发)*/
  171 + @Transient
  172 + private boolean late;
  173 +
  174 + /** 是否误点 (应发未到) */
  175 + @Transient
  176 + private boolean late2;
  177 + /** 误点停靠时间 */
  178 + @Transient
  179 + private float lateMinute;
  180 +
  181 + /** 备注*/
  182 + private String remarks;
  183 +
  184 + /**待发时间(格式 HH:mm) */
  185 + private String dfsj;
  186 +
  187 + /**待发时间戳 */
  188 + @Transient
  189 + private Long dfsjT;
  190 +
  191 + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
  192 + private Integer directiveState = -1;
  193 +
  194 + /** 起点站计划到达时间 */
  195 + @Transient
  196 + private String qdzArrDatejh;
  197 +
  198 + /** 起点站实际到达时间 */
  199 + @Transient
  200 + private String qdzArrDatesj;
  201 +
  202 + /** 子任务 */
  203 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
  204 + private Set<ChildTaskPlan> cTasks = new HashSet<>();
  205 +
  206 + /** 关联的公司名称 */
  207 + private String gsName;
  208 + /** 关联的公司编码 */
  209 + private String gsBm;
  210 + /** 关联的分公司名称 */
  211 + private String fgsName;
  212 + /** 关联的分公司编码 */
  213 + private String fgsBm;
  214 +
  215 + /**
  216 + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
  217 + */
  218 + private boolean ccService;
  219 + /**
  220 + * rfid状态
  221 + */
  222 + private int rfidState;
  223 +
  224 + public Long getId() {
  225 + return id;
  226 + }
  227 +
  228 + public void setId(Long id) {
  229 + this.id = id;
  230 + }
  231 +
  232 + public String getScheduleDateStr() {
  233 + return scheduleDateStr;
  234 + }
  235 +
  236 + public void setScheduleDateStr(String scheduleDateStr) {
  237 + this.scheduleDateStr = scheduleDateStr;
  238 + }
  239 +
  240 + public String getRealExecDate() {
  241 + return realExecDate;
  242 + }
  243 +
  244 + public void setRealExecDate(String realExecDate) {
  245 + this.realExecDate = realExecDate;
  246 + }
  247 +
  248 + public String getXlName() {
  249 + return xlName;
  250 + }
  251 +
  252 + public void setXlName(String xlName) {
  253 + this.xlName = xlName;
  254 + }
  255 +
  256 + public String getXlBm() {
  257 + return xlBm;
  258 + }
  259 +
  260 + public void setXlBm(String xlBm) {
  261 + this.xlBm = xlBm;
  262 + }
  263 +
  264 + public String getLpName() {
  265 + return lpName;
  266 + }
  267 +
  268 + public void setLpName(String lpName) {
  269 + this.lpName = lpName;
  270 + }
  271 +
  272 + public String getClZbh() {
  273 + return clZbh;
  274 + }
  275 +
  276 + public void setClZbh(String clZbh) {
  277 + this.clZbh = clZbh;
  278 + }
  279 +
  280 + public String getjGh() {
  281 + return jGh;
  282 + }
  283 +
  284 + public void setjGh(String jGh) {
  285 + this.jGh = jGh;
  286 + }
  287 +
  288 + public String getjName() {
  289 + return jName;
  290 + }
  291 +
  292 + public void setjName(String jName) {
  293 + this.jName = jName;
  294 + }
  295 +
  296 + public String getsGh() {
  297 + return sGh;
  298 + }
  299 +
  300 + public void setsGh(String sGh) {
  301 + this.sGh = sGh;
  302 + }
  303 +
  304 + public String getsName() {
  305 + return sName;
  306 + }
  307 +
  308 + public void setsName(String sName) {
  309 + this.sName = sName;
  310 + }
  311 +
  312 + public String getXlDir() {
  313 + return xlDir;
  314 + }
  315 +
  316 + public void setXlDir(String xlDir) {
  317 + this.xlDir = xlDir;
  318 + }
  319 +
  320 + public String getQdzCode() {
  321 + return qdzCode;
  322 + }
  323 +
  324 + public void setQdzCode(String qdzCode) {
  325 + this.qdzCode = qdzCode;
  326 + }
  327 +
  328 + public String getQdzName() {
  329 + return qdzName;
  330 + }
  331 +
  332 + public void setQdzName(String qdzName) {
  333 + this.qdzName = qdzName;
  334 + }
  335 +
  336 + public String getZdzCode() {
  337 + return zdzCode;
  338 + }
  339 +
  340 + public void setZdzCode(String zdzCode) {
  341 + this.zdzCode = zdzCode;
  342 + }
  343 +
  344 + public String getZdzName() {
  345 + return zdzName;
  346 + }
  347 +
  348 + public void setZdzName(String zdzName) {
  349 + this.zdzName = zdzName;
  350 + }
  351 +
  352 + public String getFcsj() {
  353 + return fcsj;
  354 + }
  355 +
  356 + public void setFcsj(String fcsj) {
  357 + this.fcsj = fcsj;
  358 + }
  359 +
  360 + public Long getFcsjT() {
  361 + return fcsjT;
  362 + }
  363 +
  364 + public void setFcsjT(Long fcsjT) {
  365 + this.fcsjT = fcsjT;
  366 + }
  367 +
  368 + public String getZdsj() {
  369 + return zdsj;
  370 + }
  371 +
  372 + public void setZdsj(String zdsj) {
  373 + this.zdsj = zdsj;
  374 + }
  375 +
  376 + public Long getZdsjT() {
  377 + return zdsjT;
  378 + }
  379 +
  380 + public void setZdsjT(Long zdsjT) {
  381 + this.zdsjT = zdsjT;
  382 + }
  383 +
  384 + public Double getJhlc() {
  385 + return jhlc;
  386 + }
  387 +
  388 + public void setJhlc(Double jhlc) {
  389 + this.jhlc = jhlc;
  390 + }
  391 +
  392 + public Double getJhlcOrig() {
  393 + return jhlcOrig;
  394 + }
  395 +
  396 + public void setJhlcOrig(Double jhlcOrig) {
  397 + this.jhlcOrig = jhlcOrig;
  398 + }
  399 +
  400 + public Integer getBcsj() {
  401 + return bcsj;
  402 + }
  403 +
  404 + public void setBcsj(Integer bcsj) {
  405 + this.bcsj = bcsj;
  406 + }
  407 +
  408 + public String getBcType() {
  409 + return bcType;
  410 + }
  411 +
  412 + public void setBcType(String bcType) {
  413 + this.bcType = bcType;
  414 + }
  415 +
  416 + public String getMajorStationName() {
  417 + return majorStationName;
  418 + }
  419 +
  420 + public void setMajorStationName(String majorStationName) {
  421 + this.majorStationName = majorStationName;
  422 + }
  423 +
  424 + public String getFcsjActual() {
  425 + return fcsjActual;
  426 + }
  427 +
  428 + public void setFcsjActual(String fcsjActual) {
  429 + this.fcsjActual = fcsjActual;
  430 + }
  431 +
  432 + public Long getFcsjActualTime() {
  433 + return fcsjActualTime;
  434 + }
  435 +
  436 + public void setFcsjActualTime(Long fcsjActualTime) {
  437 + this.fcsjActualTime = fcsjActualTime;
  438 + }
  439 +
  440 + public String getZdsjActual() {
  441 + return zdsjActual;
  442 + }
  443 +
  444 + public void setZdsjActual(String zdsjActual) {
  445 + this.zdsjActual = zdsjActual;
  446 + }
  447 +
  448 + public Long getZdsjActualTime() {
  449 + return zdsjActualTime;
  450 + }
  451 +
  452 + public void setZdsjActualTime(Long zdsjActualTime) {
  453 + this.zdsjActualTime = zdsjActualTime;
  454 + }
  455 +
  456 + public int getStatus() {
  457 + return status;
  458 + }
  459 +
  460 + public void setStatus(int status) {
  461 + this.status = status;
  462 + }
  463 +
  464 + public String getAdjustExps() {
  465 + return adjustExps;
  466 + }
  467 +
  468 + public void setAdjustExps(String adjustExps) {
  469 + this.adjustExps = adjustExps;
  470 + }
  471 +
  472 + public boolean isSflj() {
  473 + return sflj;
  474 + }
  475 +
  476 + public void setSflj(boolean sflj) {
  477 + this.sflj = sflj;
  478 + }
  479 +
  480 + public boolean isLate() {
  481 + return late;
  482 + }
  483 +
  484 + public void setLate(boolean late) {
  485 + this.late = late;
  486 + }
  487 +
  488 + public boolean isLate2() {
  489 + return late2;
  490 + }
  491 +
  492 + public void setLate2(boolean late2) {
  493 + this.late2 = late2;
  494 + }
  495 +
  496 + public float getLateMinute() {
  497 + return lateMinute;
  498 + }
  499 +
  500 + public void setLateMinute(float lateMinute) {
  501 + this.lateMinute = lateMinute;
  502 + }
  503 +
  504 + public String getRemarks() {
  505 + return remarks;
  506 + }
  507 +
  508 + public void setRemarks(String remarks) {
  509 + this.remarks = remarks;
  510 + }
  511 +
  512 + public String getDfsj() {
  513 + return dfsj;
  514 + }
  515 +
  516 + public void setDfsj(String dfsj) {
  517 + this.dfsj = dfsj;
  518 + }
  519 +
  520 + public Long getDfsjT() {
  521 + return dfsjT;
  522 + }
  523 +
  524 + public void setDfsjT(Long dfsjT) {
  525 + this.dfsjT = dfsjT;
  526 + }
  527 +
  528 + public Integer getDirectiveState() {
  529 + return directiveState;
  530 + }
  531 +
  532 + public void setDirectiveState(Integer directiveState) {
  533 + this.directiveState = directiveState;
  534 + }
  535 +
  536 + public String getQdzArrDatejh() {
  537 + return qdzArrDatejh;
  538 + }
  539 +
  540 + public void setQdzArrDatejh(String qdzArrDatejh) {
  541 + this.qdzArrDatejh = qdzArrDatejh;
  542 + }
  543 +
  544 + public String getQdzArrDatesj() {
  545 + return qdzArrDatesj;
  546 + }
  547 +
  548 + public void setQdzArrDatesj(String qdzArrDatesj) {
  549 + this.qdzArrDatesj = qdzArrDatesj;
  550 + }
  551 +
  552 + public Set<ChildTaskPlan> getcTasks() {
  553 + return cTasks;
  554 + }
  555 +
  556 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  557 + this.cTasks = cTasks;
  558 + }
  559 +
  560 + public String getGsName() {
  561 + return gsName;
  562 + }
  563 +
  564 + public void setGsName(String gsName) {
  565 + this.gsName = gsName;
  566 + }
  567 +
  568 + public String getGsBm() {
  569 + return gsBm;
  570 + }
  571 +
  572 + public void setGsBm(String gsBm) {
  573 + this.gsBm = gsBm;
  574 + }
  575 +
  576 + public String getFgsName() {
  577 + return fgsName;
  578 + }
  579 +
  580 + public void setFgsName(String fgsName) {
  581 + this.fgsName = fgsName;
  582 + }
  583 +
  584 + public String getFgsBm() {
  585 + return fgsBm;
  586 + }
  587 +
  588 + public void setFgsBm(String fgsBm) {
  589 + this.fgsBm = fgsBm;
  590 + }
  591 +
  592 + public boolean isCcService() {
  593 + return ccService;
  594 + }
  595 +
  596 + public void setCcService(boolean ccService) {
  597 + this.ccService = ccService;
  598 + }
  599 +
  600 + public int getRfidState() {
  601 + return rfidState;
  602 + }
  603 +
  604 + public void setRfidState(int rfidState) {
  605 + this.rfidState = rfidState;
  606 + }
  607 +}
src/main/java/com/bsth/websocket/handler/SendUtils.java
1 -package com.bsth.websocket.handler;  
2 -  
3 -import com.alibaba.fastjson.JSONObject;  
4 -import com.bsth.data.BasicData;  
5 -import com.bsth.data.LineConfigData;  
6 -import com.bsth.data.gpsdata_v2.entity.GpsEntity;  
7 -import com.bsth.data.safe_driv.SafeDriv;  
8 -import com.bsth.entity.directive.D80;  
9 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
10 -import com.bsth.websocket.dto.WsScheduleRealInfo;  
11 -import com.fasterxml.jackson.core.JsonProcessingException;  
12 -import com.fasterxml.jackson.databind.ObjectMapper;  
13 -import org.apache.commons.lang3.StringUtils;  
14 -import org.slf4j.Logger;  
15 -import org.slf4j.LoggerFactory;  
16 -import org.springframework.beans.factory.annotation.Autowired;  
17 -import org.springframework.stereotype.Component;  
18 -  
19 -import java.text.SimpleDateFormat;  
20 -import java.util.*;  
21 -  
22 -@Component  
23 -public class SendUtils{  
24 -  
25 - @Autowired  
26 - private RealControlSocketHandler socketHandler;  
27 -  
28 - @Autowired  
29 - LineConfigData lineConfigData;  
30 -  
31 - private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");  
32 -  
33 - private static Logger logger = LoggerFactory.getLogger(SendUtils.class);  
34 -  
35 - /**  
36 - * @throws JsonProcessingException  
37 - * TODO(推送发车信息)  
38 - */  
39 - public void sendFcsj(ScheduleRealInfo sch) {  
40 -  
41 - Map<String, Object> map = new HashMap<>();  
42 - map.put("fn", "faChe");  
43 - map.put("t", WsScheduleRealInfo.getInstance(sch));  
44 - map.put("dataStr", sdf.format(new Date()));  
45 -  
46 - ObjectMapper mapper = new ObjectMapper();  
47 -  
48 - try {  
49 - socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));  
50 - } catch (Exception e) {  
51 - logger.error("", e);  
52 - }  
53 - }  
54 -  
55 - /**  
56 - *  
57 - * @Title: sendFcsjArtificial  
58 - * @Description: TODO(要求页面刷新班次)  
59 - * @throws  
60 - */  
61 - public void refreshSch(List<ScheduleRealInfo> list){  
62 - if(null == list || list.size() == 0)  
63 - return;  
64 -  
65 - Map<String, Object> map = new HashMap<>();  
66 - map.put("fn", "refreshSch");  
67 - map.put("ts", WsScheduleRealInfo.getMultiInstance(list));  
68 -  
69 - ObjectMapper mapper = new ObjectMapper();  
70 -  
71 - try {  
72 - socketHandler.sendMessageToLine(list.get(0).getXlBm(), mapper.writeValueAsString(map));  
73 - } catch (Exception e) {  
74 - logger.error("", e);  
75 - }  
76 - }  
77 -  
78 - /**  
79 - * @throws JsonProcessingException  
80 - * @throws NumberFormatException @Title: sendFcsj @Description:  
81 - * TODO(推送到达终点时间) @param @param schedule 班次 @throws  
82 - */  
83 - public void sendZdsj(ScheduleRealInfo sch, ScheduleRealInfo nextSch, int finish) {  
84 -  
85 - Map<String, Object> map = new HashMap<>();  
86 - map.put("fn", "zhongDian");  
87 - map.put("t", WsScheduleRealInfo.getInstance(sch));  
88 - map.put("nt", WsScheduleRealInfo.getInstance(nextSch));  
89 - map.put("finish", finish);  
90 - map.put("dataStr", sdf.format(new Date()));  
91 -  
92 - ObjectMapper mapper = new ObjectMapper();  
93 -  
94 - try {  
95 - socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));  
96 - } catch (Exception e) {  
97 - logger.error("", e);  
98 - }  
99 - }  
100 -  
101 - /**  
102 - * 推送班次信号状态  
103 - * @param state  
104 -  
105 - public void sendSignalState(SignalState state){  
106 - Map<String, Object> map = new HashMap<>();  
107 - map.put("fn", "signal_state");  
108 - map.put("data", state);  
109 -  
110 - ObjectMapper mapper = new ObjectMapper();  
111 -  
112 - try {  
113 - socketHandler.sendMessageToLine(state.getLineCode(), mapper.writeValueAsString(map));  
114 - } catch (Exception e) {  
115 - logger.error("", e);  
116 - }  
117 - }*/  
118 -  
119 - /**  
120 - *  
121 - * @Title: sendDirectiveToPage  
122 - * @Description: TODO(调度指令状态推送)  
123 - */  
124 - public void sendDirectiveToPage(ScheduleRealInfo sch) {  
125 -  
126 - Map<String, Object> map = new HashMap<>();  
127 - map.put("fn", "directive");  
128 - map.put("t", WsScheduleRealInfo.getInstance(sch));;  
129 -  
130 - ObjectMapper mapper = new ObjectMapper();  
131 -  
132 - try {  
133 - socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));  
134 - } catch (JsonProcessingException e) {  
135 - logger.error("", e);  
136 - }  
137 - }  
138 -  
139 - public void send80ToPage(D80 d80) {  
140 - d80.getData().setNbbm(BasicData.deviceId2NbbmMap.get(d80.getDeviceId()));  
141 - JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(d80));  
142 - json.put("fn", "report80");  
143 - socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), json.toJSONString());  
144 - }  
145 -  
146 - public void refreshSch(ScheduleRealInfo sch) {  
147 - List<ScheduleRealInfo> list = new ArrayList<>();  
148 - list.add(sch);  
149 - refreshSch(list);  
150 - }  
151 -  
152 - public void deviceOffline(GpsEntity gps){  
153 - Map<String, Object> map = new HashMap<>();  
154 - map.put("fn", "deviceOffline");  
155 - map.put("gps", gps);  
156 - ObjectMapper mapper = new ObjectMapper();  
157 -  
158 - try {  
159 - socketHandler.sendMessageToLine(gps.getLineId().toString(), mapper.writeValueAsString(map));  
160 - } catch (JsonProcessingException e) {  
161 - logger.error("", e);  
162 - }  
163 - }  
164 -  
165 - public void sendSafeDriv(SafeDriv sd){  
166 - Map<String, Object> map = new HashMap<>();  
167 - map.put("fn", "safeDriv");  
168 - map.put("t", sd);;  
169 - ObjectMapper mapper = new ObjectMapper();  
170 -  
171 - try {  
172 - socketHandler.sendMessageToLine(sd.getXlbm(), mapper.writeValueAsString(map));  
173 - } catch (JsonProcessingException e) {  
174 - logger.error("", e);  
175 - }  
176 - }  
177 -  
178 - /**  
179 - * 通知客户端,开始进行误点调整  
180 - * @param sch  
181 - */  
182 - public void sendAutoWdtz(ScheduleRealInfo sch, ScheduleRealInfo cancel){  
183 - Map<String, Object> map = new HashMap<>();  
184 - map.put("fn", "auto_wdtz");  
185 - map.put("id", sch.getId());  
186 - if(cancel != null)  
187 - map.put("cancelId", cancel.getId());  
188 - map.put("lineCode", sch.getXlBm());  
189 - map.put("minute", sch.getLateMinute());  
190 - ObjectMapper mapper = new ObjectMapper();  
191 -  
192 - try {  
193 - socketHandler.sendMessageToLine(sch.getXlBm() ,mapper.writeValueAsString(map));  
194 -  
195 - } catch (JsonProcessingException e) {  
196 - logger.error("", e);  
197 - }  
198 - }  
199 -  
200 - /**  
201 - * 对所有线调用户进行广播  
202 - * @param t  
203 - */  
204 - public void sendRadioText(String t, String lineCode){  
205 - Map<String, Object> map = new HashMap<>();  
206 - map.put("fn", "admin_radio_text");  
207 - map.put("t", t);  
208 - ObjectMapper mapper = new ObjectMapper();  
209 -  
210 - try {  
211 - if(StringUtils.isNotEmpty(lineCode))  
212 - socketHandler.sendMessageToLine(lineCode, mapper.writeValueAsString(map));  
213 - else  
214 - socketHandler.sendMessage(mapper.writeValueAsString(map));  
215 - } catch (JsonProcessingException e) {  
216 - logger.error("", e);  
217 - }  
218 - }  
219 -} 1 +package com.bsth.websocket.handler;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.bsth.data.BasicData;
  5 +import com.bsth.data.LineConfigData;
  6 +import com.bsth.data.gpsdata_v2.entity.GpsEntity;
  7 +import com.bsth.data.safe_driv.SafeDriv;
  8 +import com.bsth.entity.directive.D80;
  9 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  10 +import com.bsth.websocket.dto.WsScheduleRealInfo;
  11 +import com.fasterxml.jackson.core.JsonProcessingException;
  12 +import com.fasterxml.jackson.databind.ObjectMapper;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.stereotype.Component;
  18 +
  19 +import java.text.SimpleDateFormat;
  20 +import java.util.*;
  21 +
  22 +@Component
  23 +public class SendUtils{
  24 +
  25 + @Autowired
  26 + private RealControlSocketHandler socketHandler;
  27 +
  28 + @Autowired
  29 + LineConfigData lineConfigData;
  30 +
  31 + private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
  32 +
  33 + private static Logger logger = LoggerFactory.getLogger(SendUtils.class);
  34 +
  35 + /**
  36 + * @throws JsonProcessingException
  37 + * TODO(推送发车信息)
  38 + */
  39 + public void sendFcsj(ScheduleRealInfo sch) {
  40 +
  41 + Map<String, Object> map = new HashMap<>();
  42 + map.put("fn", "faChe");
  43 + map.put("t", WsScheduleRealInfo.getInstance(sch));
  44 + map.put("dataStr", sdf.format(new Date()));
  45 +
  46 + ObjectMapper mapper = new ObjectMapper();
  47 +
  48 + try {
  49 + socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));
  50 + } catch (Exception e) {
  51 + logger.error("", e);
  52 + }
  53 + }
  54 +
  55 + /**
  56 + *
  57 + * @Title: sendFcsjArtificial
  58 + * @Description: TODO(要求页面刷新班次)
  59 + * @throws
  60 + */
  61 + public void refreshSch(List<ScheduleRealInfo> list){
  62 + if(null == list || list.size() == 0)
  63 + return;
  64 +
  65 + Map<String, Object> map = new HashMap<>();
  66 + map.put("fn", "refreshSch");
  67 + map.put("ts", WsScheduleRealInfo.getMultiInstance(list));
  68 +
  69 + ObjectMapper mapper = new ObjectMapper();
  70 +
  71 + try {
  72 + socketHandler.sendMessageToLine(list.get(0).getXlBm(), mapper.writeValueAsString(map));
  73 + } catch (Exception e) {
  74 + logger.error("", e);
  75 + }
  76 + }
  77 +
  78 + /**
  79 + * @throws JsonProcessingException
  80 + * @throws NumberFormatException @Title: sendFcsj @Description:
  81 + * TODO(推送到达终点时间) @param @param schedule 班次 @throws
  82 + */
  83 + public void sendZdsj(ScheduleRealInfo sch, ScheduleRealInfo nextSch, int finish) {
  84 +
  85 + Map<String, Object> map = new HashMap<>();
  86 + map.put("fn", "zhongDian");
  87 + map.put("t", WsScheduleRealInfo.getInstance(sch));
  88 + map.put("nt", WsScheduleRealInfo.getInstance(nextSch));
  89 + map.put("finish", finish);
  90 + map.put("dataStr", sdf.format(new Date()));
  91 +
  92 + ObjectMapper mapper = new ObjectMapper();
  93 +
  94 + try {
  95 + socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));
  96 + } catch (Exception e) {
  97 + logger.error("", e);
  98 + }
  99 + }
  100 +
  101 + /**
  102 + * 推送班次信号状态
  103 + * @param state
  104 +
  105 + public void sendSignalState(SignalState state){
  106 + Map<String, Object> map = new HashMap<>();
  107 + map.put("fn", "signal_state");
  108 + map.put("data", state);
  109 +
  110 + ObjectMapper mapper = new ObjectMapper();
  111 +
  112 + try {
  113 + socketHandler.sendMessageToLine(state.getLineCode(), mapper.writeValueAsString(map));
  114 + } catch (Exception e) {
  115 + logger.error("", e);
  116 + }
  117 + }*/
  118 +
  119 + /**
  120 + *
  121 + * @Title: sendDirectiveToPage
  122 + * @Description: TODO(调度指令状态推送)
  123 + */
  124 + public void sendDirectiveToPage(ScheduleRealInfo sch) {
  125 +
  126 + Map<String, Object> map = new HashMap<>();
  127 + map.put("fn", "directive");
  128 + map.put("t", WsScheduleRealInfo.getInstance(sch));;
  129 +
  130 + ObjectMapper mapper = new ObjectMapper();
  131 +
  132 + try {
  133 + socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));
  134 + } catch (JsonProcessingException e) {
  135 + logger.error("", e);
  136 + }
  137 + }
  138 +
  139 + public void send80ToPage(D80 d80) {
  140 + d80.getData().setNbbm(BasicData.deviceId2NbbmMap.get(d80.getDeviceId()));
  141 + JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(d80));
  142 + json.put("fn", "report80");
  143 + socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), json.toJSONString());
  144 + }
  145 +
  146 + public void refreshSch(ScheduleRealInfo sch) {
  147 + List<ScheduleRealInfo> list = new ArrayList<>();
  148 + list.add(sch);
  149 + refreshSch(list);
  150 + }
  151 +
  152 + public void deviceOffline(GpsEntity gps){
  153 + Map<String, Object> map = new HashMap<>();
  154 + map.put("fn", "deviceOffline");
  155 + map.put("gps", gps);
  156 + ObjectMapper mapper = new ObjectMapper();
  157 +
  158 + try {
  159 + socketHandler.sendMessageToLine(gps.getLineId().toString(), mapper.writeValueAsString(map));
  160 + } catch (JsonProcessingException e) {
  161 + logger.error("", e);
  162 + }
  163 + }
  164 +
  165 + public void sendSafeDriv(SafeDriv sd){
  166 + Map<String, Object> map = new HashMap<>();
  167 + map.put("fn", "safeDriv");
  168 + map.put("t", sd);;
  169 + ObjectMapper mapper = new ObjectMapper();
  170 +
  171 + try {
  172 + socketHandler.sendMessageToLine(sd.getXlbm(), mapper.writeValueAsString(map));
  173 + } catch (JsonProcessingException e) {
  174 + logger.error("", e);
  175 + }
  176 + }
  177 +
  178 + /**
  179 + * 通知客户端,开始进行误点调整
  180 + * @param sch
  181 + */
  182 + public void sendAutoWdtz(ScheduleRealInfo sch, ScheduleRealInfo cancel){
  183 + Map<String, Object> map = new HashMap<>();
  184 + map.put("fn", "auto_wdtz");
  185 + map.put("id", sch.getId());
  186 + if(cancel != null)
  187 + map.put("cancelId", cancel.getId());
  188 + map.put("lineCode", sch.getXlBm());
  189 + map.put("minute", sch.getLateMinute());
  190 + ObjectMapper mapper = new ObjectMapper();
  191 +
  192 + try {
  193 + socketHandler.sendMessageToLine(sch.getXlBm() ,mapper.writeValueAsString(map));
  194 +
  195 + } catch (JsonProcessingException e) {
  196 + logger.error("", e);
  197 + }
  198 + }
  199 +
  200 + /**
  201 + * 对所有线调用户进行广播
  202 + * @param t
  203 + */
  204 + public void sendRadioText(String t, String lineCode){
  205 + Map<String, Object> map = new HashMap<>();
  206 + map.put("fn", "admin_radio_text");
  207 + map.put("t", t);
  208 + ObjectMapper mapper = new ObjectMapper();
  209 +
  210 + try {
  211 + if(StringUtils.isNotEmpty(lineCode))
  212 + socketHandler.sendMessageToLine(lineCode, mapper.writeValueAsString(map));
  213 + else
  214 + socketHandler.sendMessage(mapper.writeValueAsString(map));
  215 + } catch (JsonProcessingException e) {
  216 + logger.error("", e);
  217 + }
  218 + }
  219 +
  220 + /**
  221 + * RFID有更新时发送数据至线调页面
  222 + * @param sch
  223 + */
  224 + public void sendRfid(ScheduleRealInfo sch) {
  225 + Map<String, Object> map = new HashMap<>();
  226 + map.put("fn", "rfid");
  227 + map.put("data", WsScheduleRealInfo.getInstance(sch));
  228 + ObjectMapper mapper = new ObjectMapper();
  229 +
  230 + try {
  231 + socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map));
  232 + } catch (JsonProcessingException e) {
  233 + logger.error("", e);
  234 + }
  235 + }
  236 +}
src/main/resources/static/real_control_v2/css/line_schedule.css
1 -.line_schedule {  
2 - height: 100%;  
3 - overflow: hidden;  
4 -}  
5 -  
6 -.line_schedule .uk-grid {  
7 - margin-left: 0;  
8 -}  
9 -  
10 -.line_schedule .uk-grid>* {  
11 - padding: 0;  
12 -}  
13 -  
14 -.line_schedule div.uk-width-1-6, .line_schedule div.uk-width-1-2 {  
15 - padding: 0 2px 2px 2px;  
16 - height: 100%;  
17 -}  
18 -  
19 -.line_schedule .footer-chart {  
20 - height: 233px;  
21 - margin-top: 5px;  
22 -}  
23 -  
24 -.line_schedule .uk-grid.top-container {  
25 - height: calc(100% - 250px);  
26 - margin-top: 5px;  
27 - overflow: hidden;  
28 -}  
29 -  
30 -.line_schedule .card-panel {  
31 - padding: 0;  
32 - height: 100%;  
33 - border: 1px solid #ddd;  
34 - background: #fafafa;  
35 - border-radius: 4px;  
36 - moz-user-select: -moz-none;  
37 - -moz-user-select: none;  
38 - -o-user-select: none;  
39 - -khtml-user-select: none;  
40 - -webkit-user-select: none;  
41 - -ms-user-select: none;  
42 - user-select: none;  
43 -}  
44 -  
45 -.line_schedule .ct_table {  
46 - padding-top: 36px;  
47 - color: #000;  
48 -}  
49 -  
50 -.line_schedule .ct_table>.ct_table_head {  
51 - height: 36px;  
52 - line-height: 36px;  
53 -}  
54 -  
55 -.line_schedule .schedule-wrap {  
56 - height: calc(100% - 1px);  
57 - padding: 0;  
58 -}  
59 -  
60 -.line_schedule .schedule-wrap .header-title i.uk-icon-question-circle{  
61 - cursor: pointer;  
62 - font-size: 14px;  
63 - color: #cccaca;  
64 -}  
65 -  
66 -.line_schedule .schedule-wrap h3 {  
67 - margin: 7px 0 5px;  
68 - text-indent: 5px;  
69 - margin: 0;  
70 - height: 31px;  
71 - line-height: 31px;  
72 -}  
73 -  
74 -.line_schedule .schedule-wrap.up h3 {  
75 - color: #2765A7;  
76 -}  
77 -  
78 -.line_schedule .schedule-wrap.down h3 {  
79 - color: #C92121;  
80 -}  
81 -  
82 -.line-schedule-table dl dt:nth-of-type(1), .line-schedule-table dl dd:nth-of-type(1) {  
83 - width: 50px;  
84 -}  
85 -  
86 -.line-schedule-table dl dd:nth-of-type(1) {  
87 - background: #eae8e8;  
88 - /*border-bottom: 1px solid #b3b3b3;*/  
89 - border-right: 1px solid #b3b3b3;  
90 - text-align: center;  
91 - text-indent: -3px;  
92 -}  
93 -  
94 -.line-schedule-table dl dt:nth-of-type(2), .line-schedule-table dl dd:nth-of-type(2) {  
95 - width: 55px;  
96 - text-align: center;  
97 -}  
98 -  
99 -.line-schedule-table dl dt:nth-of-type(3), .line-schedule-table dl dd:nth-of-type(3) {  
100 - width: calc(2% + 66px);  
101 - position: relative;  
102 -}  
103 -.line-schedule-table dl dd:nth-of-type(3)>i{  
104 - position: absolute;  
105 - color: #313030;  
106 - top: 1px;  
107 - right: 3px;  
108 - text-shadow: 0 -1px 0 rgba(0,0,0,.2);  
109 -}  
110 -  
111 -.line-schedule-table dl dt:nth-of-type(4), .line-schedule-table dl dd:nth-of-type(4) {  
112 - width: 10%;  
113 - /*color: #676767;*/  
114 -}  
115 -  
116 -.line-schedule-table dl dt:nth-of-type(5), .line-schedule-table dl dd:nth-of-type(5) {  
117 - width: 10%;  
118 -}  
119 -  
120 -.line-schedule-table dl dt:nth-of-type(6), .line-schedule-table dl dd:nth-of-type(6) {  
121 - width: calc(13% + 18px);  
122 - /*color: #676767;*/  
123 -}  
124 -  
125 -.line-schedule-table dl dt:nth-of-type(7), .line-schedule-table dl dd:nth-of-type(7) {  
126 - width: calc(10% + 10px);  
127 -}  
128 -  
129 -.line-schedule-table dl dt:nth-of-type(8), .line-schedule-table dl dd:nth-of-type(8) {  
130 - width: calc(51% - 233px);  
131 -}  
132 -  
133 -.line-schedule-table dl dt:nth-of-type(9), .line-schedule-table dl dd:nth-of-type(9) {  
134 - width: 65px;  
135 - border-right: 0;  
136 -}  
137 -  
138 -.schedule-body {  
139 - height: calc(100% - 31px);  
140 - background: #fff;  
141 -}  
142 -  
143 -.schedule-body .ct_table_wrap {  
144 - height: 100%;  
145 - border-bottom: 0;  
146 - overflow-x: hidden;  
147 -}  
148 -  
149 -.schedule-body .ct_table_wrap .ct_table .ct_table_body dl:last-child {  
150 - border-bottom: 0;  
151 -}  
152 -  
153 -.schedule-body .ct_table>.ct_table_body dl:hover dd:nth-of-type(1) {  
154 - background: #fafafa;  
155 - background: linear-gradient(to right, #fafafa, #f5fbff);  
156 -}  
157 -  
158 -.schedule-body .ct_table dl dd, .schedule-body .ct_table dl dt {  
159 - font-size: 14px;  
160 - line-height: 37px;  
161 -}  
162 -  
163 -.ct_table .uk-badge {  
164 - padding: 0 1px 0 1px;  
165 - text-indent: 0;  
166 - font-family: 华文细黑;  
167 -}  
168 -  
169 -.ct_table .uk-badge.uk-badge-notification{  
170 - text-indent: -1px;  
171 -}  
172 -  
173 -.schedule-body .ct_table dl._active, .schedule-body .ct_table>.ct_table_body dl._active:hover {  
174 - background: #dedede;  
175 -}  
176 -  
177 -.schedule-body .ct_table dl._active dd {  
178 - background: #cef9e3!important;  
179 - color: #484848;  
180 -}  
181 -  
182 -.schedule-body .ct_table dl._active dd a {  
183 - color: #0162b5;  
184 -}  
185 -  
186 -.schedule-body .ct_table dl._active dd.seq_no {  
187 - background: #94e6bd !important;  
188 - color: #156138;  
189 - font-weight: 600;  
190 -}  
191 -  
192 -.schedule-body .ct_table dl.drag-active, .schedule-body .ct_table>.ct_table_body dl.drag-active:hover {  
193 - background: #dedede;  
194 -}  
195 -  
196 -.schedule-body .ct_table dl.drag-active dd {  
197 - background: #cef9e3!important;  
198 - color: #484848;  
199 - border-top: 1px solid #e0d7d7 !important;  
200 -}  
201 -  
202 -.schedule-body .ct_table dl.drag-active dd a {  
203 - color: #0162b5;  
204 -}  
205 -  
206 -.schedule-body .ct_table dl.drag-active dd.seq_no {  
207 - background: #94e6bd !important;  
208 - color: #156138;  
209 - font-weight: 600;  
210 -}  
211 -  
212 -.schedule-body .ct_table dl._search_hide{  
213 - display: none !important;  
214 -}  
215 -  
216 -.context-menu-list.schedule-ct-menu {  
217 - /*font-size: 13px;*/  
218 - font-family: 微软雅黑;  
219 -}  
220 -  
221 -.context-menu-list.schedule-ct-menu .context-menu-item {  
222 - padding: .25em 2em;  
223 -}  
224 -  
225 -.context-menu-list.schedule-ct-menu-input {  
226 - width: 88px !important;  
227 - min-width: 80px !important;  
228 - font-family: 微软雅黑;  
229 -}  
230 -  
231 -.context-menu-list.schedule-ct-menu-input .context-menu-item {  
232 - padding: .25em 2em;  
233 -}  
234 -  
235 -.db-input {  
236 - width: calc(100% - 8px);  
237 - height: calc(100% - 9px);  
238 - margin-left: -4px;  
239 - vertical-align: top;  
240 - font-size: 13px;  
241 - color: red;  
242 - font-family: 微软雅黑;  
243 - margin-top: 1px;  
244 -}  
245 -  
246 -.schedule-body .ct_table dl {  
247 - height: 36px;  
248 -}  
249 -  
250 -.schedule-body .ct_table dl:nth-child(even){  
251 - background: rgba(101, 204, 220, 0.13);  
252 -}  
253 -  
254 -span.fcsj-diff {  
255 - /*color: gray;*/  
256 - margin-left: 3px;  
257 -}  
258 -  
259 -  
260 -/** 图例 */  
261 -  
262 -.tl-yzx {  
263 - background: rgb( 192,192,255);  
264 - border-top: 1px solid #d9d9d9 !important;  
265 - color: #444;  
266 -}  
267 -  
268 -.tl-wfyd {  
269 - background: rgb( 246,193,10);  
270 - border-top: 1px solid #d9d9d9 !important;  
271 - color: #444;  
272 -}  
273 -  
274 -.tl-xxfc{  
275 - background: rgb(0,255,255);  
276 - color: #484747;  
277 -}  
278 -  
279 -.tl-wd{  
280 - background: rgb(255,255,0);  
281 - color: #444;  
282 -}  
283 -  
284 -.tl-xxsd{  
285 - background: rgb(205,133,63);  
286 - /*color: #f5f4f4;*/  
287 -}  
288 -  
289 -.tl-xxrd{  
290 - background: rgb(255,99,71);  
291 - border-top: 1px solid #ebebeb !important;  
292 - /*color: #fff;*/  
293 -}  
294 -  
295 -.tl-qrlb {  
296 - background: rgb( 128,128,0);  
297 - color: #EAEBEC;  
298 - font-size: 13px;  
299 -}  
300 -  
301 -.tl-qrlb::before {  
302 - content: '烂班';  
303 -}  
304 -  
305 -.tl-zzzx {  
306 - background: rgb(173,255,47);  
307 - color: #444;  
308 - border-top: 1px solid #d9d9d9 !important;  
309 -}  
310 -  
311 -.ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx {  
312 - background: none;  
313 -}  
314 -  
315 -.ct_table>.ct_table_body dl:hover dd.tl-qrlb, .ct_table>.ct_table_body dl.context-menu-active dd.tl-qrlb {  
316 - font-weight: 600;  
317 -}  
318 -  
319 -.schedule-body .ct_table dl.drag-active dd.tl-qrlb {  
320 - color: red;  
321 - font-weight: 600;  
322 -}  
323 -  
324 -.line_schedule .footer-chart .svg-wrap {  
325 - width: 100%;  
326 - height: 100%;  
327 - position: relative;  
328 -}  
329 -  
330 -.ct-form-modal form .uk-grid+.uk-grid {  
331 - margin-top: 10px;  
332 -}  
333 -  
334 -.ct-form-modal form small {  
335 - color: #928e8e;  
336 - margin-left: 3px;  
337 -}  
338 -  
339 -.ct-form-modal form input, .ct-form-modal form select {  
340 - width: 100%;  
341 - height: 34px;  
342 -}  
343 -  
344 -.ct-form-modal form small.font-danger {  
345 - color: red;  
346 -}  
347 -  
348 -.ct-form-modal form.uk-form-horizontal .uk-form-label {  
349 - width: 80px;  
350 -}  
351 -  
352 -.ct-form-modal form.uk-form-horizontal .uk-form-controls {  
353 - margin-left: 85px;  
354 -}  
355 -  
356 -.sch-time-checkbox-list {  
357 - height: 240px;  
358 - overflow: auto;  
359 - border: 1px solid #c4c4c4;  
360 - border-radius: 4px;  
361 - padding: 9px 0;  
362 -}  
363 -  
364 -.sch-time-checkbox-list label {  
365 - display: block;  
366 - font-size: 16px;  
367 - border-bottom: 1px dashed #e6e3e3;  
368 - height: 30px;  
369 - line-height: 30px;  
370 - padding-left: 12px;  
371 -}  
372 -  
373 -.report-type-checkbox-list {  
374 - height: 150px;  
375 - overflow: auto;  
376 - border: 1px solid #c4c4c4;  
377 - border-radius: 4px;  
378 - padding: 9px 0;  
379 -}  
380 -  
381 -.report-type-checkbox-list label {  
382 - display: block;  
383 - font-size: 14px;  
384 - border-bottom: 1px dashed #e6e3e3;  
385 - height: 30px;  
386 - line-height: 30px;  
387 - padding-left: 12px;  
388 -}  
389 -  
390 -/*.sch-time-checkbox-list label input[type=checkbox] {  
391 - width: 20px;  
392 - height: 18px !important;  
393 - vertical-align: middle;  
394 - margin-top: -3px;  
395 -}*/  
396 -  
397 -.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-label {  
398 - width: 100%;  
399 -}  
400 -  
401 -.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls {  
402 - margin: 32px 0 0 0;  
403 -}  
404 -  
405 -.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls textarea {  
406 - width: 100%;  
407 -}  
408 -  
409 -.ct-form-modal span.uk-form-help-inline,  
410 -.ct-form-modal p.uk-form-help-block{  
411 - color: #888888;  
412 - font-size: 13px;  
413 -}  
414 -  
415 -  
416 -/** 批量待发调整 */  
417 -  
418 -.ct_table.multi-dftz-table {  
419 - width: 100%;  
420 - border-left: 1px solid #e6e6e6;  
421 - padding-top: 35px;  
422 - vertical-align: top;  
423 - -webkit-user-select: none;  
424 - -moz-user-select: none;  
425 - -ms-user-select: none;  
426 - user-select: none;  
427 -}  
428 -  
429 -.ct_table.multi-dftz-table>.ct_table_head, .ct_table.multi-dftz-table dl {  
430 - height: 35px;  
431 - line-height: 35px;  
432 -}  
433 -  
434 -.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt {  
435 - line-height: 37px;  
436 -}  
437 -  
438 -.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt {  
439 - font-size: 14px;  
440 -}  
441 -  
442 -.multi-dftz-table dl dt:nth-of-type(1), .multi-dftz-table dl dd:nth-of-type(1) {  
443 - width: 10%;  
444 - text-align: center;  
445 -}  
446 -  
447 -.multi-dftz-table dl dt:nth-of-type(2), .multi-dftz-table dl dd:nth-of-type(2) {  
448 - width: 14%;  
449 -}  
450 -  
451 -.multi-dftz-table dl dt:nth-of-type(3), .multi-dftz-table dl dd:nth-of-type(3) {  
452 - width: 14%;  
453 -}  
454 -  
455 -.multi-dftz-table dl dt:nth-of-type(4), .multi-dftz-table dl dd:nth-of-type(4) {  
456 - width: 15%;  
457 -}  
458 -  
459 -.multi-dftz-table dl dt:nth-of-type(5), .multi-dftz-table dl dd:nth-of-type(5) {  
460 - width: 15%;  
461 -}  
462 -  
463 -.multi-dftz-table dl dt:nth-of-type(6), .multi-dftz-table dl dd:nth-of-type(6) {  
464 - width: 31%;  
465 - border-right: 0;  
466 - position: relative;  
467 -}  
468 -  
469 -.ct_table.multi-dftz-table input {  
470 - width: 70%;  
471 - height: 27px;  
472 - font-family: 微软雅黑;  
473 - color: #545353;  
474 - border: 1px solid #b1b1b1;  
475 - border-radius: 3px;  
476 - font-size: 14px;  
477 -}  
478 -  
479 -.ct_table.multi-dftz-table input.modify {  
480 - color: #447eb1;  
481 - border: 1px solid #689cd0;  
482 -}  
483 -  
484 -span.modify-num {  
485 - position: absolute;  
486 - bottom: 2px;  
487 - right: 3px;  
488 - color: blue;  
489 - font-family: 华文细黑;  
490 - height: 25px;  
491 - width: 35px;  
492 - line-height: 25px;  
493 - text-align: center;  
494 - text-indent: 0;  
495 -}  
496 -  
497 -span.modify-num.negative {  
498 - color: red;  
499 -}  
500 -  
501 -span.drag-panel {  
502 - padding: 6px 7px;  
503 - display: inline-block;  
504 - margin-bottom: 5px;  
505 - background: #fafafa;  
506 - color: #666;  
507 - border: 1px solid #e5e5e5;  
508 - border-radius: 4px;  
509 - width: 120px;  
510 - cursor: move;  
511 - position: absolute;  
512 - z-index: 2;  
513 - transition: all .2s ease;  
514 -}  
515 -  
516 -span.drag-panel.no-anim {  
517 - transition: none;  
518 -}  
519 -  
520 -span.drag-panel.disable {  
521 - opacity: 0.2;  
522 - cursor: no-drop;  
523 -}  
524 -  
525 -span.drag-panel.draging {  
526 - opacity: 0;  
527 -}  
528 -  
529 -div.drop-rail:before {  
530 - font-size: 12px;  
531 - color: #eeeaea;  
532 - width: 100%;  
533 - display: block;  
534 - text-align: center;  
535 - margin-top: 7px;  
536 - content: ' '  
537 -}  
538 -  
539 -div.drop-rail[data-type="people"]:before {  
540 - content: "驾驶员";  
541 -}  
542 -  
543 -div.drop-rail[data-type="car"]:before {  
544 - content: "车辆";  
545 -}  
546 -  
547 -#schedule-multi-tzrc-modal {  
548 - -webkit-user-select: none;  
549 - -moz-user-select: none;  
550 - -ms-user-select: none;  
551 - user-select: none;  
552 -}  
553 -  
554 -#schedule-multi-tzrc-modal .tm-grid-truncate>.uk-width-medium-1-4 {  
555 - padding: 7px 0 10px 10px;  
556 -}  
557 -  
558 -.drag-panel-wrap {  
559 - width: 163px;  
560 - height: 94px;  
561 -}  
562 -  
563 -.drag-panel-wrap.over {  
564 - border: 1px dashed #b3b2b2;  
565 -}  
566 -  
567 -dl.relevance-active dd:nth-child(n+2) {  
568 - background: #d2d2d2 !important;  
569 -}  
570 -  
571 -dl.relevance-active.intimity dd:nth-child(n+2) {  
572 - background: #8baabf !important;  
573 - color: white;  
574 -}  
575 -  
576 -dl.relevance-active.intimity dd:nth-child(n+2) a {  
577 - color: white !important;  
578 -}  
579 -  
580 -dl.relevance-active dd.tl-qrlb,  
581 -dl.relevance-active.intimity dd.tl-qrlb{  
582 - background: linear-gradient(to right, #a9a911, #808000, #8baabf) !important;  
583 - color: #f8e9cd;  
584 -}  
585 -  
586 -dl.relevance-active dd.tl-wfyd,  
587 -dl.relevance-active.intimity dd.tl-wfyd{  
588 - background: linear-gradient(to right, rgb( 246,193,10), rgb(226, 226, 168), #8baabf) !important;  
589 - color: #f8e9cd;  
590 -}  
591 -  
592 -dl.relevance-active dd.tl-wd,  
593 -dl.relevance-active.intimity dd.tl-wd{  
594 - background: linear-gradient(to right, #ffff00, rgb(226, 226, 168), rgb(139, 170, 191)) !important;  
595 -}  
596 -  
597 -dl.relevance-active dd.tl-qrlb,  
598 -dl.relevance-active.intimity dd.tl-yzx{  
599 - background: linear-gradient(to right, #dcdcfd, #c0c0ff, #8baabf) !important;  
600 - color: #272727;  
601 -}  
602 -  
603 -dl.relevance-active dd.tl-zzzx,  
604 -dl.relevance-active.intimity dd.tl-zzzx {  
605 - background: linear-gradient(to right, #def5bb, #adff2f, #8baabf) !important;  
606 - color: #565252;  
607 -}  
608 -  
609 -dl.relevance-active dd.tl-zzzx span.fcsj-diff,  
610 -dl.relevance-active.intimity dd.tl-zzzx span.fcsj-diff {  
611 - color: #5e5a5a  
612 -}  
613 -  
614 -dl.relevance-active dd.tl-xxsd,  
615 -dl.relevance-active.intimity dd.tl-xxsd {  
616 - background: linear-gradient(to right, #8baabf, #cd853f, #dc9958) !important;  
617 -}  
618 -  
619 -dl.relevance-active dd.tl-xxrd,  
620 -dl.relevance-active.intimity dd.tl-xxrd {  
621 - background: linear-gradient(to right, #8baabf, #ff6347, #ff8f7b) !important;  
622 -}  
623 -  
624 -dl.relevance-active dd.tl-xxfc,  
625 -dl.relevance-active.intimity dd.tl-xxfc {  
626 - background: linear-gradient(to right, #8baabf, rgb(43, 185, 185), rgb(0,255,255)) !important;  
627 -}  
628 -  
629 -dl.relevance-active.intimity dd span.fcsj-diff {  
630 - color: #616060;  
631 -}  
632 -  
633 -dl.relevance-active dd span.fcsj-diff{  
634 - color: #aba6a6;  
635 -}  
636 -  
637 -/*dl.relevance-active a {  
638 - color: #dff0ff;  
639 -}*/  
640 -  
641 -.right-text-lp {  
642 - position: absolute;  
643 - right: 7px;  
644 - padding: 0 5px;  
645 - border-radius: 5px;  
646 - font-size: 12px;  
647 - color: #a0a0a0;  
648 -}  
649 -  
650 -div.drop-rail {  
651 - position: absolute;  
652 - width: 140px;  
653 - height: 36px;  
654 - margin: -2px 0 0 -3px;  
655 - background: transparent;  
656 - z-index: 1;  
657 -}  
658 -  
659 -div.drop-rail.over {  
660 - border: 1px dashed #dddddd;  
661 -}  
662 -  
663 -.uk-table.comf-result tbody tr td:nth-of-type(1) {  
664 - font-family: 微软雅黑;  
665 -}  
666 -  
667 -.uk-table.comf-result tbody tr td:nth-of-type(3) {  
668 - color: #888686;  
669 -}  
670 -  
671 -.uk-table.comf-result tbody tr td:nth-of-type(4) {  
672 - color: #366fad;  
673 -}  
674 -  
675 -label.destroy-sch{  
676 - color: #928e8e;  
677 -}  
678 -label.destroy-sch small{  
679 - color: #e25e5e;  
680 -}  
681 -  
682 -.main-schedule-table dl dt:nth-of-type(1), .main-schedule-table dl dd:nth-of-type(1) {  
683 - width: 6%;  
684 - text-align: center;  
685 -}  
686 -.main-schedule-table dl dt:nth-of-type(2), .main-schedule-table dl dd:nth-of-type(2) {  
687 - width: 14%;  
688 -}  
689 -.main-schedule-table dl dt:nth-of-type(3), .main-schedule-table dl dd:nth-of-type(3) {  
690 - width: 10%;  
691 -}  
692 -.main-schedule-table dl dt:nth-of-type(4), .main-schedule-table dl dd:nth-of-type(4) {  
693 - width: 19%;  
694 -}  
695 -.main-schedule-table dl dt:nth-of-type(5), .main-schedule-table dl dd:nth-of-type(5) {  
696 - width: 19%;  
697 -}  
698 -.main-schedule-table dl dt:nth-of-type(6), .main-schedule-table dl dd:nth-of-type(6) {  
699 - width: 10%;  
700 -}  
701 -.main-schedule-table dl dt:nth-of-type(7), .main-schedule-table dl dd:nth-of-type(7) {  
702 - width: 12%;  
703 -}  
704 -.main-schedule-table dl dt:nth-of-type(8), .main-schedule-table dl dd:nth-of-type(8) {  
705 - width: 10%;  
706 -}  
707 -  
708 -.main-schedule-table.ct_table dl.active,  
709 -.main-schedule-table.ct_table>.ct_table_body dl.active:hover,  
710 -.main-schedule-table.ct_table>.ct_table_body dl.context-menu-active{  
711 - background: #9393bf;  
712 - box-shadow: 0 0 4px #656c71;  
713 - color: white;  
714 -}  
715 -  
716 -.main-schedule-table span.sjfc-time{  
717 - color:#07d  
718 -}  
719 -  
720 -.main-schedule-table dl.active span.sjfc-time{  
721 - background: white;  
722 - border-radius: 5px;  
723 - padding: 2px 1px;  
724 - vertical-align: middle;  
725 -}  
726 -  
727 -.sub-task-table dl dt:nth-of-type(1), .sub-task-table dl dd:nth-of-type(1) {  
728 - width: 6%;  
729 - text-align: center;  
730 -}  
731 -.sub-task-table dl dt:nth-of-type(2), .sub-task-table dl dd:nth-of-type(2) {  
732 - width: 13%;  
733 -}  
734 -.sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) {  
735 - width: 16%;  
736 -}  
737 -.sub-task-table dl dt:nth-of-type(4), .sub-task-table dl dd:nth-of-type(4) {  
738 - width: 16%;  
739 -}  
740 -.sub-task-table dl dt:nth-of-type(5), .sub-task-table dl dd:nth-of-type(5) {  
741 - width: 11%;  
742 -}  
743 -.sub-task-table dl dt:nth-of-type(6), .sub-task-table dl dd:nth-of-type(6) {  
744 - width: 11%;  
745 -}  
746 -.sub-task-table dl dt:nth-of-type(7), .sub-task-table dl dd:nth-of-type(7) {  
747 - width: 16%;  
748 -}  
749 -.sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) {  
750 - width: 9%;  
751 -}  
752 -  
753 -.sub-task-table>.ct_table_body>dl:last-child dd{  
754 - border-bottom: 0;  
755 -}  
756 -  
757 -.add-temp-sch-icon{  
758 - float: right;  
759 - margin: 0 3px 0;  
760 - padding: 0;  
761 - font-size: 13px;  
762 - text-decoration: underline;  
763 -}  
764 -  
765 -.add-temp-lp-icon{  
766 - cursor: pointer;  
767 - margin-left: 5px;  
768 -}  
769 -  
770 -  
771 -input.i-cbox[type=checkbox]{  
772 - width: 20px;  
773 - height: 18px;  
774 - vertical-align: middle;  
775 - margin-top: -3px;  
776 -}  
777 -  
778 -.sys-note-80,  
779 -.sys-note-42{  
780 - width: calc(100% - 10px) !important;  
781 - margin: 5px !important;  
782 - cursor: default;  
783 -}  
784 -  
785 -.sys-note-80:hover,  
786 -.sys-note-42:hover{  
787 - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);  
788 -}  
789 -  
790 -.sys-note-80 .uk-panel-box,  
791 -.sys-note-42 .uk-panel-box{  
792 - padding: 10px;  
793 -}  
794 -.sys-note-80 .uk-panel-title{  
795 - margin-bottom: 3px;  
796 - font-size: 15px;  
797 -}  
798 -  
799 -.sys-note-42 .title{  
800 - font-family: 微软雅黑;  
801 - margin-bottom: 3px;  
802 -}  
803 -.sys-note-80 .uk-button-group,  
804 -.sys-note-42 .uk-button-group{  
805 - display: block;  
806 - margin-top: 5px;  
807 -}  
808 -  
809 -  
810 -  
811 -.sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) {  
812 - width: 25%;  
813 -}  
814 -.sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) {  
815 - width: 18%;  
816 -}  
817 -.sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) {  
818 - width: 21%;  
819 -}  
820 -.sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) {  
821 - width: 21%;  
822 -}  
823 -.sch-tzrc-table dl dt:nth-of-type(5), .sch-tzrc-table dl dd:nth-of-type(5) {  
824 - width: 15%;  
825 -}  
826 -  
827 -.ct-form-modal .uk-autocomplete{  
828 - width: 100%;  
829 -}  
830 -  
831 -/*.sch-tzrc-table.ct_table dl.active,  
832 -.sch-tzrc-table.ct_table>.ct_table_body dl.active:hover,  
833 -.sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{  
834 - background: #e6e6e6;  
835 -}*/  
836 -  
837 -.search_sch_panel{  
838 - float: right;  
839 -}  
840 -  
841 -.search_sch_panel .uk-form input[type=text]{  
842 - width: 80px;  
843 - background: #fafafa;  
844 - border: 0;  
845 - border-bottom: 1px solid #ddd;  
846 - font-size: 14px;  
847 - height: 20px;  
848 - transition: all .3s ease;  
849 -}  
850 -  
851 -.search_sch_panel .uk-form div.uk-form-icon.active input[type=text]{  
852 - width: 145px;  
853 -}  
854 -  
855 -.search_sch_panel .uk-form div.uk-form-icon i.cancel{  
856 - position: absolute;  
857 - right: 8px;  
858 - font-size: 13px;  
859 - color: #c3b9ba;  
860 - cursor: pointer;  
861 - display: none;  
862 - padding: 0;  
863 - pointer-events: auto;  
864 - width: 18px;  
865 - text-indent: 0;  
866 -}  
867 -  
868 -/*.search_sch_panel .uk-form div.uk-form-icon i.cancel:before{*/  
869 -  
870 -/*}*/  
871 -  
872 -.search_sch_panel .uk-form div.uk-form-icon.active i.cancel{  
873 - display: block;  
874 -}  
875 -  
876 -.search_sch_panel .uk-form input[type=text]::-webkit-input-placeholder{  
877 - font-size: 12px;  
878 - color: #cecece;  
879 -}  
880 -.device_event_str{  
881 - font-size: 10px;  
882 - color: #bdbdbd;  
883 - margin-left: 3px;  
884 -}  
885 -  
886 -  
887 -.tl-tip-panel{  
888 - padding: 3px;  
889 -}  
890 -  
891 -.tl-tip-panel .ct_title{  
892 - display: inline-block;  
893 - width: 42px;  
894 - vertical-align: top;  
895 - margin-top: 5px;  
896 - color: grey;  
897 - font-family: 微软雅黑;  
898 - margin: 5px 0 0 3px;  
899 -}  
900 -.tl-tip-panel span{  
901 - display: inline-block;  
902 - font-size: 11px;  
903 - width: 60px;  
904 - height: 21px;  
905 - line-height: 21px;  
906 - text-align: center;  
907 - margin: 3px 1px;  
908 - border-radius: 3px;  
909 -}  
910 -  
911 -.qtip.sch-tl-tip{  
912 - max-width: 335px;  
913 -}  
914 -  
915 -.sfsj-sch-detail{  
916 - list-style: none;  
917 - padding: 5px 0px;  
918 - margin-bottom: 3px;  
919 -}  
920 -.sfsj-sch-detail li{  
921 - font-size: 14px;  
922 - line-height: 24px;  
923 -}  
924 -  
925 -.sfsj-sch-detail li span{  
926 - display: inline-block;  
927 - width: 65px;  
928 - text-align: right;  
929 - color: #bab6b6;  
930 - font-family: 微软雅黑;  
931 - font-size: 13px;  
932 -}  
933 -  
934 -#add-sub-task-inpark-modal .uk-panel-box{  
935 - background-color: #ffffff;  
936 -}  
937 -  
938 -#add-sub-task-inpark-modal .pl5{  
939 - padding-left: 5px;  
940 -}  
941 -  
942 -#add-sub-task-inpark-modal.uk-modal .uk-form.fv-form{  
943 - margin-bottom: 0px !important;  
944 -}  
945 -#add-sub-task-inpark-modal .uk-form select,  
946 -#add-sub-task-inpark-modal .uk-form input[type=text],  
947 -#add-sub-task-inpark-modal .uk-form input[type=time]{  
948 - width: 100%  
949 -}  
950 -  
951 -#add-sub-task-inpark-modal .uk-grid{  
952 - margin-top: 10px;  
953 -}  
954 -  
955 -.sub-task-card{  
956 - display: inline-block;vertical-align: top;margin-right: 1%;  
957 - width: 48.5%;  
958 -}  
959 -  
960 -.sub-task-card.destroy-card{  
961 - vertical-align: top;  
962 - margin-right: 0;  
963 - display: none;  
964 -}  
965 -  
966 -#add-sub-task-inpark-modal .uk-modal-dialog{  
967 - width: 755px;  
968 - /*transition: all .3s ease;*/  
969 -}  
970 -  
971 -#add-sub-task-inpark-modal .uk-modal-dialog.three-children{  
972 - width: 955px;  
973 -}  
974 -  
975 -#add-sub-task-inpark-modal .uk-modal-dialog.three-children .sub-task-card{  
976 - width: 32%;  
977 -}  
978 -  
979 -.uk-modal-footer .ct-footer-left{  
980 - float: left;  
981 - font-size: 12px;  
982 -}  
983 -  
984 -.uk-modal-footer .ct-footer-left a{  
985 - color: #6e6b6b;  
986 - margin-right: 5px;  
987 -}  
988 -  
989 -.fixed_legend{  
990 - font-size: 12px;  
991 - display: none;  
992 - height: 28px;  
993 - border-radius: 4px;  
994 - background: #efeeee;  
995 - padding-bottom: .5px;  
996 - margin-left: 10px;  
997 - padding-right: 8px;  
998 -}  
999 -.fixed_legend>div{  
1000 - height: 100%;  
1001 -}  
1002 -.fixed_legend span{  
1003 - padding: 4px 4px;  
1004 - border-radius: 2px;  
1005 - margin-right: 5px;  
1006 - font-size: 12px;  
1007 -}  
1008 -  
1009 -.fixed_legend span:last-child{  
1010 - margin-right: 0px;  
1011 -}  
1012 -  
1013 -/*.fixed_legend i{  
1014 - font-size: 16px;  
1015 - vertical-align: middle;  
1016 - margin: -3px 3px 0 0;  
1017 -}*/  
1018 -  
1019 -.fixed_legend .tl-qrlb::before{  
1020 - font-size: 12px;  
1021 -}  
1022 -  
1023 -.schedule-body .ct_table dl.dl-last-sch{  
1024 - height: 55px;  
1025 -}  
1026 -  
1027 -.schedule-body .ct_table dl.dl-last-sch dd{  
1028 - line-height: 55px;  
1029 -}  
1030 -  
1031 -.schedule-body .ct_table dl.dl-last-sch dd.fcsjActualCell{  
1032 - line-height: 28px;  
1033 -}  
1034 -  
1035 -dd.fcsjActualCell div.last-sch-sunken{  
1036 - height: 25px;  
1037 - line-height: 25px;  
1038 - margin: 0;  
1039 - background: #fff;  
1040 - /*border-top: 1px solid #eeeeee;*/  
1041 -}  
1042 -  
1043 -dd.fcsjActualCell.tl-yzx div.last-sch-sunken {  
1044 - background: #c1ddf0;  
1045 - border-top: 1px solid #c1d3df;  
1046 -}  
1047 -  
1048 -dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge {  
1049 - background: rgb(255, 255, 255);  
1050 - color: black;  
1051 -}  
1052 -  
1053 -dd.fcsjActualCell div.last-sch-sunken span._badge{  
1054 - font-size: 13px;  
1055 - border-radius: 0 9px 9px 0;  
1056 - padding-left: 0;  
1057 - width: 81px;  
1058 - display: inline-block;  
1059 - height: 23px;  
1060 - line-height: 23px;  
1061 - box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12);  
1062 - vertical-align: top;  
1063 - margin-right: 3px;  
1064 - margin-top: 1px;  
1065 - margin-left: -7px;  
1066 - /* text-indent: 2px; */  
1067 - border-left: 0;  
1068 - /* transform: scale(.9); */  
1069 - color: grey;  
1070 -}  
1071 -  
1072 -.relevance-active dd.fcsjActualCell div.last-sch-sunken{  
1073 - background: #f1efef;  
1074 -}  
1075 -  
1076 -.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken{  
1077 - background: #76a6c7 !important;  
1078 - border-top: 1px solid #f7f8f8 !important;  
1079 - color: #f8f8f8;  
1080 -}  
1081 -  
1082 -.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken span._badge{  
1083 - background: #76a6c7 ;  
1084 - color: #ffffff ;  
1085 -}  
1086 -  
1087 -.drag-active dd.fcsjActualCell div.last-sch-sunken{  
1088 - background: #cef9e3 !important;  
1089 - border-top: 1px solid #d9e6e0 !important;  
1090 -}  
1091 -  
1092 -.drag-active dd.fcsjActualCell div.last-sch-sunken span._badge{  
1093 - color: #6e6969;  
1094 - background: #cef9e3;  
1095 -}  
1096 -  
1097 -.ct_table>.ct_table_body dl.dl-last-sch:hover div.last-sch-sunken,  
1098 -.ct_table>.ct_table_body dl.dl-last-sch.context-menu-active div.last-sch-sunken{  
1099 - background: #f5fbff;  
1100 -}  
1101 -  
1102 -dd.fcsjActualCell{  
1103 - position: relative;  
1104 -}  
1105 -  
1106 -i.signal_state_icon{  
1107 - position: absolute;  
1108 - right: 5px;  
1109 - top: 7px;  
1110 - box-shadow: 0px 0px 11px 0 rgba(0, 0, 0, 0.2), -1px 3px 8px 0 rgba(0, 0, 0, 0.19);  
1111 - text-indent: 0;  
1112 - border-radius: 15px;  
1113 - cursor: pointer;  
1114 -}  
1115 -  
1116 -i.signal_state_icon.uk-icon-question-circle{  
1117 - color: #e85252 !important;  
1118 -}  
1119 -  
1120 -i.signal_state_icon.uk-icon-reply{  
1121 - color: #4134e3 !important;  
1122 - box-shadow: none;  
1123 -}  
1124 -  
1125 -.child-task-status{  
1126 - float: right;  
1127 - font-size: 13px;  
1128 -}  
1129 -  
1130 -.child-task-status.fail{  
1131 - color: red;  
1132 - /*text-shadow: red 0px 0px 20px;*/  
1133 -}  
1134 -  
1135 -.child-task-status.fail span.calc-detail{  
1136 - font-family: Consolas,monospace,serif;  
1137 - white-space: nowrap;  
1138 - font-size: 14px; 1 +.line_schedule {
  2 + height: 100%;
  3 + overflow: hidden;
  4 +}
  5 +
  6 +.line_schedule .uk-grid {
  7 + margin-left: 0;
  8 +}
  9 +
  10 +.line_schedule .uk-grid>* {
  11 + padding: 0;
  12 +}
  13 +
  14 +.line_schedule div.uk-width-1-6, .line_schedule div.uk-width-1-2 {
  15 + padding: 0 2px 2px 2px;
  16 + height: 100%;
  17 +}
  18 +
  19 +.line_schedule .footer-chart {
  20 + height: 233px;
  21 + margin-top: 5px;
  22 +}
  23 +
  24 +.line_schedule .uk-grid.top-container {
  25 + height: calc(100% - 250px);
  26 + margin-top: 5px;
  27 + overflow: hidden;
  28 +}
  29 +
  30 +.line_schedule .card-panel {
  31 + padding: 0;
  32 + height: 100%;
  33 + border: 1px solid #ddd;
  34 + background: #fafafa;
  35 + border-radius: 4px;
  36 + moz-user-select: -moz-none;
  37 + -moz-user-select: none;
  38 + -o-user-select: none;
  39 + -khtml-user-select: none;
  40 + -webkit-user-select: none;
  41 + -ms-user-select: none;
  42 + user-select: none;
  43 +}
  44 +
  45 +.line_schedule .ct_table {
  46 + padding-top: 36px;
  47 + color: #000;
  48 +}
  49 +
  50 +.line_schedule .ct_table>.ct_table_head {
  51 + height: 36px;
  52 + line-height: 36px;
  53 +}
  54 +
  55 +.line_schedule .schedule-wrap {
  56 + height: calc(100% - 1px);
  57 + padding: 0;
  58 +}
  59 +
  60 +.line_schedule .schedule-wrap .header-title i.uk-icon-question-circle{
  61 + cursor: pointer;
  62 + font-size: 14px;
  63 + color: #cccaca;
  64 +}
  65 +
  66 +.line_schedule .schedule-wrap h3 {
  67 + margin: 7px 0 5px;
  68 + text-indent: 5px;
  69 + margin: 0;
  70 + height: 31px;
  71 + line-height: 31px;
  72 +}
  73 +
  74 +.line_schedule .schedule-wrap.up h3 {
  75 + color: #2765A7;
  76 +}
  77 +
  78 +.line_schedule .schedule-wrap.down h3 {
  79 + color: #C92121;
  80 +}
  81 +
  82 +.line-schedule-table dl dt:nth-of-type(1), .line-schedule-table dl dd:nth-of-type(1) {
  83 + width: 50px;
  84 +}
  85 +
  86 +.line-schedule-table dl dd:nth-of-type(1) {
  87 + background: #eae8e8;
  88 + /*border-bottom: 1px solid #b3b3b3;*/
  89 + border-right: 1px solid #b3b3b3;
  90 + text-align: center;
  91 + text-indent: -3px;
  92 +}
  93 +
  94 +.line-schedule-table dl dt:nth-of-type(2), .line-schedule-table dl dd:nth-of-type(2) {
  95 + width: 55px;
  96 + text-align: center;
  97 +}
  98 +
  99 +.line-schedule-table dl dt:nth-of-type(3), .line-schedule-table dl dd:nth-of-type(3) {
  100 + width: 30px;
  101 + text-align: center;
  102 +}
  103 +
  104 +.line-schedule-table dl dt:nth-of-type(4), .line-schedule-table dl dd:nth-of-type(4) {
  105 + width: calc(2% + 66px);
  106 + position: relative;
  107 +}
  108 +.line-schedule-table dl dd:nth-of-type(4)>i{
  109 + position: absolute;
  110 + color: #313030;
  111 + top: 1px;
  112 + right: 3px;
  113 + text-shadow: 0 -1px 0 rgba(0,0,0,.2);
  114 +}
  115 +
  116 +.line-schedule-table dl dt:nth-of-type(5), .line-schedule-table dl dd:nth-of-type(5) {
  117 + width: 10%;
  118 + /*color: #676767;*/
  119 +}
  120 +
  121 +.line-schedule-table dl dt:nth-of-type(6), .line-schedule-table dl dd:nth-of-type(6) {
  122 + width: 10%;
  123 +}
  124 +
  125 +.line-schedule-table dl dt:nth-of-type(7), .line-schedule-table dl dd:nth-of-type(7) {
  126 + width: calc(13% + 18px);
  127 + /*color: #676767;*/
  128 +}
  129 +
  130 +.line-schedule-table dl dt:nth-of-type(8), .line-schedule-table dl dd:nth-of-type(8) {
  131 + width: calc(10% + 10px);
  132 +}
  133 +
  134 +.line-schedule-table dl dt:nth-of-type(9), .line-schedule-table dl dd:nth-of-type(9) {
  135 + width: calc(51% - 263px);
  136 +}
  137 +
  138 +.line-schedule-table dl dt:nth-of-type(10), .line-schedule-table dl dd:nth-of-type(10) {
  139 + width: 65px;
  140 + border-right: 0;
  141 +}
  142 +
  143 +.schedule-body {
  144 + height: calc(100% - 31px);
  145 + background: #fff;
  146 +}
  147 +
  148 +.schedule-body .ct_table_wrap {
  149 + height: 100%;
  150 + border-bottom: 0;
  151 + overflow-x: hidden;
  152 +}
  153 +
  154 +.schedule-body .ct_table_wrap .ct_table .ct_table_body dl:last-child {
  155 + border-bottom: 0;
  156 +}
  157 +
  158 +.schedule-body .ct_table>.ct_table_body dl:hover dd:nth-of-type(1) {
  159 + background: #fafafa;
  160 + background: linear-gradient(to right, #fafafa, #f5fbff);
  161 +}
  162 +
  163 +.schedule-body .ct_table dl dd, .schedule-body .ct_table dl dt {
  164 + font-size: 14px;
  165 + line-height: 37px;
  166 +}
  167 +
  168 +.ct_table .uk-badge {
  169 + padding: 0 1px 0 1px;
  170 + text-indent: 0;
  171 + font-family: 华文细黑;
  172 +}
  173 +
  174 +.ct_table .uk-badge.uk-badge-notification{
  175 + text-indent: -1px;
  176 +}
  177 +
  178 +.schedule-body .ct_table dl._active, .schedule-body .ct_table>.ct_table_body dl._active:hover {
  179 + background: #dedede;
  180 +}
  181 +
  182 +.schedule-body .ct_table dl._active dd {
  183 + background: #cef9e3!important;
  184 + color: #484848;
  185 +}
  186 +
  187 +.schedule-body .ct_table dl._active dd a {
  188 + color: #0162b5;
  189 +}
  190 +
  191 +.schedule-body .ct_table dl._active dd.seq_no {
  192 + background: #94e6bd !important;
  193 + color: #156138;
  194 + font-weight: 600;
  195 +}
  196 +
  197 +.schedule-body .ct_table dl.drag-active, .schedule-body .ct_table>.ct_table_body dl.drag-active:hover {
  198 + background: #dedede;
  199 +}
  200 +
  201 +.schedule-body .ct_table dl.drag-active dd {
  202 + background: #cef9e3!important;
  203 + color: #484848;
  204 + border-top: 1px solid #e0d7d7 !important;
  205 +}
  206 +
  207 +.schedule-body .ct_table dl.drag-active dd a {
  208 + color: #0162b5;
  209 +}
  210 +
  211 +.schedule-body .ct_table dl.drag-active dd.seq_no {
  212 + background: #94e6bd !important;
  213 + color: #156138;
  214 + font-weight: 600;
  215 +}
  216 +
  217 +.schedule-body .ct_table dl._search_hide{
  218 + display: none !important;
  219 +}
  220 +
  221 +.context-menu-list.schedule-ct-menu {
  222 + /*font-size: 13px;*/
  223 + font-family: 微软雅黑;
  224 +}
  225 +
  226 +.context-menu-list.schedule-ct-menu .context-menu-item {
  227 + padding: .25em 2em;
  228 +}
  229 +
  230 +.context-menu-list.schedule-ct-menu-input {
  231 + width: 88px !important;
  232 + min-width: 80px !important;
  233 + font-family: 微软雅黑;
  234 +}
  235 +
  236 +.context-menu-list.schedule-ct-menu-input .context-menu-item {
  237 + padding: .25em 2em;
  238 +}
  239 +
  240 +.db-input {
  241 + width: calc(100% - 8px);
  242 + height: calc(100% - 9px);
  243 + margin-left: -4px;
  244 + vertical-align: top;
  245 + font-size: 13px;
  246 + color: red;
  247 + font-family: 微软雅黑;
  248 + margin-top: 1px;
  249 +}
  250 +
  251 +.schedule-body .ct_table dl {
  252 + height: 36px;
  253 +}
  254 +
  255 +.schedule-body .ct_table dl:nth-child(even){
  256 + background: rgba(101, 204, 220, 0.13);
  257 +}
  258 +
  259 +span.fcsj-diff {
  260 + /*color: gray;*/
  261 + margin-left: 3px;
  262 +}
  263 +
  264 +
  265 +/** 图例 */
  266 +
  267 +.tl-yzx {
  268 + background: rgb( 192,192,255);
  269 + border-top: 1px solid #d9d9d9 !important;
  270 + color: #444;
  271 +}
  272 +
  273 +.tl-wfyd {
  274 + background: rgb( 246,193,10);
  275 + border-top: 1px solid #d9d9d9 !important;
  276 + color: #444;
  277 +}
  278 +
  279 +.tl-xxfc{
  280 + background: rgb(0,255,255);
  281 + color: #484747;
  282 +}
  283 +
  284 +.tl-wd{
  285 + background: rgb(255,255,0);
  286 + color: #444;
  287 +}
  288 +
  289 +.tl-xxsd{
  290 + background: rgb(205,133,63);
  291 + /*color: #f5f4f4;*/
  292 +}
  293 +
  294 +.tl-xxrd{
  295 + background: rgb(255,99,71);
  296 + border-top: 1px solid #ebebeb !important;
  297 + /*color: #fff;*/
  298 +}
  299 +
  300 +.tl-qrlb {
  301 + background: rgb( 128,128,0);
  302 + color: #EAEBEC;
  303 + font-size: 13px;
  304 +}
  305 +
  306 +.tl-qrlb::before {
  307 + content: '烂班';
  308 +}
  309 +
  310 +.tl-zzzx {
  311 + background: rgb(173,255,47);
  312 + color: #444;
  313 + border-top: 1px solid #d9d9d9 !important;
  314 +}
  315 +
  316 +.tl-green {
  317 + background: green;
  318 + color: green;
  319 +}
  320 +
  321 +.tl-yellow {
  322 + background: yellow;
  323 + color: yellow;
  324 +}
  325 +
  326 +.tl-grey {
  327 + background: grey;
  328 + color: grey;
  329 +}
  330 +
  331 +.tl-white {
  332 + background: white;
  333 + color: white;
  334 +}
  335 +
  336 +.ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx {
  337 + background: none;
  338 +}
  339 +
  340 +.ct_table>.ct_table_body dl:hover dd.tl-qrlb, .ct_table>.ct_table_body dl.context-menu-active dd.tl-qrlb {
  341 + font-weight: 600;
  342 +}
  343 +
  344 +.schedule-body .ct_table dl.drag-active dd.tl-qrlb {
  345 + color: red;
  346 + font-weight: 600;
  347 +}
  348 +
  349 +.line_schedule .footer-chart .svg-wrap {
  350 + width: 100%;
  351 + height: 100%;
  352 + position: relative;
  353 +}
  354 +
  355 +.ct-form-modal form .uk-grid+.uk-grid {
  356 + margin-top: 10px;
  357 +}
  358 +
  359 +.ct-form-modal form small {
  360 + color: #928e8e;
  361 + margin-left: 3px;
  362 +}
  363 +
  364 +.ct-form-modal form input, .ct-form-modal form select {
  365 + width: 100%;
  366 + height: 34px;
  367 +}
  368 +
  369 +.ct-form-modal form small.font-danger {
  370 + color: red;
  371 +}
  372 +
  373 +.ct-form-modal form.uk-form-horizontal .uk-form-label {
  374 + width: 80px;
  375 +}
  376 +
  377 +.ct-form-modal form.uk-form-horizontal .uk-form-controls {
  378 + margin-left: 85px;
  379 +}
  380 +
  381 +.sch-time-checkbox-list {
  382 + height: 240px;
  383 + overflow: auto;
  384 + border: 1px solid #c4c4c4;
  385 + border-radius: 4px;
  386 + padding: 9px 0;
  387 +}
  388 +
  389 +.sch-time-checkbox-list label {
  390 + display: block;
  391 + font-size: 16px;
  392 + border-bottom: 1px dashed #e6e3e3;
  393 + height: 30px;
  394 + line-height: 30px;
  395 + padding-left: 12px;
  396 +}
  397 +
  398 +.report-type-checkbox-list {
  399 + height: 150px;
  400 + overflow: auto;
  401 + border: 1px solid #c4c4c4;
  402 + border-radius: 4px;
  403 + padding: 9px 0;
  404 +}
  405 +
  406 +.report-type-checkbox-list label {
  407 + display: block;
  408 + font-size: 14px;
  409 + border-bottom: 1px dashed #e6e3e3;
  410 + height: 30px;
  411 + line-height: 30px;
  412 + padding-left: 12px;
  413 +}
  414 +
  415 +/*.sch-time-checkbox-list label input[type=checkbox] {
  416 + width: 20px;
  417 + height: 18px !important;
  418 + vertical-align: middle;
  419 + margin-top: -3px;
  420 +}*/
  421 +
  422 +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-label {
  423 + width: 100%;
  424 +}
  425 +
  426 +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls {
  427 + margin: 32px 0 0 0;
  428 +}
  429 +
  430 +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls textarea {
  431 + width: 100%;
  432 +}
  433 +
  434 +.ct-form-modal span.uk-form-help-inline,
  435 +.ct-form-modal p.uk-form-help-block{
  436 + color: #888888;
  437 + font-size: 13px;
  438 +}
  439 +
  440 +
  441 +/** 批量待发调整 */
  442 +
  443 +.ct_table.multi-dftz-table {
  444 + width: 100%;
  445 + border-left: 1px solid #e6e6e6;
  446 + padding-top: 35px;
  447 + vertical-align: top;
  448 + -webkit-user-select: none;
  449 + -moz-user-select: none;
  450 + -ms-user-select: none;
  451 + user-select: none;
  452 +}
  453 +
  454 +.ct_table.multi-dftz-table>.ct_table_head, .ct_table.multi-dftz-table dl {
  455 + height: 35px;
  456 + line-height: 35px;
  457 +}
  458 +
  459 +.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt {
  460 + line-height: 37px;
  461 +}
  462 +
  463 +.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt {
  464 + font-size: 14px;
  465 +}
  466 +
  467 +.multi-dftz-table dl dt:nth-of-type(1), .multi-dftz-table dl dd:nth-of-type(1) {
  468 + width: 10%;
  469 + text-align: center;
  470 +}
  471 +
  472 +.multi-dftz-table dl dt:nth-of-type(2), .multi-dftz-table dl dd:nth-of-type(2) {
  473 + width: 14%;
  474 +}
  475 +
  476 +.multi-dftz-table dl dt:nth-of-type(3), .multi-dftz-table dl dd:nth-of-type(3) {
  477 + width: 14%;
  478 +}
  479 +
  480 +.multi-dftz-table dl dt:nth-of-type(4), .multi-dftz-table dl dd:nth-of-type(4) {
  481 + width: 15%;
  482 +}
  483 +
  484 +.multi-dftz-table dl dt:nth-of-type(5), .multi-dftz-table dl dd:nth-of-type(5) {
  485 + width: 15%;
  486 +}
  487 +
  488 +.multi-dftz-table dl dt:nth-of-type(6), .multi-dftz-table dl dd:nth-of-type(6) {
  489 + width: 31%;
  490 + border-right: 0;
  491 + position: relative;
  492 +}
  493 +
  494 +.ct_table.multi-dftz-table input {
  495 + width: 70%;
  496 + height: 27px;
  497 + font-family: 微软雅黑;
  498 + color: #545353;
  499 + border: 1px solid #b1b1b1;
  500 + border-radius: 3px;
  501 + font-size: 14px;
  502 +}
  503 +
  504 +.ct_table.multi-dftz-table input.modify {
  505 + color: #447eb1;
  506 + border: 1px solid #689cd0;
  507 +}
  508 +
  509 +span.modify-num {
  510 + position: absolute;
  511 + bottom: 2px;
  512 + right: 3px;
  513 + color: blue;
  514 + font-family: 华文细黑;
  515 + height: 25px;
  516 + width: 35px;
  517 + line-height: 25px;
  518 + text-align: center;
  519 + text-indent: 0;
  520 +}
  521 +
  522 +span.modify-num.negative {
  523 + color: red;
  524 +}
  525 +
  526 +span.drag-panel {
  527 + padding: 6px 7px;
  528 + display: inline-block;
  529 + margin-bottom: 5px;
  530 + background: #fafafa;
  531 + color: #666;
  532 + border: 1px solid #e5e5e5;
  533 + border-radius: 4px;
  534 + width: 120px;
  535 + cursor: move;
  536 + position: absolute;
  537 + z-index: 2;
  538 + transition: all .2s ease;
  539 +}
  540 +
  541 +span.drag-panel.no-anim {
  542 + transition: none;
  543 +}
  544 +
  545 +span.drag-panel.disable {
  546 + opacity: 0.2;
  547 + cursor: no-drop;
  548 +}
  549 +
  550 +span.drag-panel.draging {
  551 + opacity: 0;
  552 +}
  553 +
  554 +div.drop-rail:before {
  555 + font-size: 12px;
  556 + color: #eeeaea;
  557 + width: 100%;
  558 + display: block;
  559 + text-align: center;
  560 + margin-top: 7px;
  561 + content: ' '
  562 +}
  563 +
  564 +div.drop-rail[data-type="people"]:before {
  565 + content: "驾驶员";
  566 +}
  567 +
  568 +div.drop-rail[data-type="car"]:before {
  569 + content: "车辆";
  570 +}
  571 +
  572 +#schedule-multi-tzrc-modal {
  573 + -webkit-user-select: none;
  574 + -moz-user-select: none;
  575 + -ms-user-select: none;
  576 + user-select: none;
  577 +}
  578 +
  579 +#schedule-multi-tzrc-modal .tm-grid-truncate>.uk-width-medium-1-4 {
  580 + padding: 7px 0 10px 10px;
  581 +}
  582 +
  583 +.drag-panel-wrap {
  584 + width: 163px;
  585 + height: 94px;
  586 +}
  587 +
  588 +.drag-panel-wrap.over {
  589 + border: 1px dashed #b3b2b2;
  590 +}
  591 +
  592 +dl.relevance-active dd:nth-child(n+2) {
  593 + background: #d2d2d2 !important;
  594 +}
  595 +
  596 +dl.relevance-active.intimity dd:nth-child(n+2) {
  597 + background: #8baabf !important;
  598 + color: white;
  599 +}
  600 +
  601 +dl.relevance-active.intimity dd:nth-child(n+2) a {
  602 + color: white !important;
  603 +}
  604 +
  605 +dl.relevance-active dd.tl-qrlb,
  606 +dl.relevance-active.intimity dd.tl-qrlb{
  607 + background: linear-gradient(to right, #a9a911, #808000, #8baabf) !important;
  608 + color: #f8e9cd;
  609 +}
  610 +
  611 +dl.relevance-active dd.tl-wfyd,
  612 +dl.relevance-active.intimity dd.tl-wfyd{
  613 + background: linear-gradient(to right, rgb( 246,193,10), rgb(226, 226, 168), #8baabf) !important;
  614 + color: #f8e9cd;
  615 +}
  616 +
  617 +dl.relevance-active dd.tl-wd,
  618 +dl.relevance-active.intimity dd.tl-wd{
  619 + background: linear-gradient(to right, #ffff00, rgb(226, 226, 168), rgb(139, 170, 191)) !important;
  620 +}
  621 +
  622 +dl.relevance-active dd.tl-qrlb,
  623 +dl.relevance-active.intimity dd.tl-yzx{
  624 + background: linear-gradient(to right, #dcdcfd, #c0c0ff, #8baabf) !important;
  625 + color: #272727;
  626 +}
  627 +
  628 +dl.relevance-active dd.tl-zzzx,
  629 +dl.relevance-active.intimity dd.tl-zzzx {
  630 + background: linear-gradient(to right, #def5bb, #adff2f, #8baabf) !important;
  631 + color: #565252;
  632 +}
  633 +
  634 +dl.relevance-active dd.tl-zzzx span.fcsj-diff,
  635 +dl.relevance-active.intimity dd.tl-zzzx span.fcsj-diff {
  636 + color: #5e5a5a
  637 +}
  638 +
  639 +dl.relevance-active dd.tl-xxsd,
  640 +dl.relevance-active.intimity dd.tl-xxsd {
  641 + background: linear-gradient(to right, #8baabf, #cd853f, #dc9958) !important;
  642 +}
  643 +
  644 +dl.relevance-active dd.tl-xxrd,
  645 +dl.relevance-active.intimity dd.tl-xxrd {
  646 + background: linear-gradient(to right, #8baabf, #ff6347, #ff8f7b) !important;
  647 +}
  648 +
  649 +dl.relevance-active dd.tl-xxfc,
  650 +dl.relevance-active.intimity dd.tl-xxfc {
  651 + background: linear-gradient(to right, #8baabf, rgb(43, 185, 185), rgb(0,255,255)) !important;
  652 +}
  653 +
  654 +dl.relevance-active dd.tl-green,
  655 +dl.relevance-active.intimity dd.tl-green {
  656 + background: linear-gradient(to right, green, green, #8baabf) !important;
  657 +}
  658 +
  659 +dl.relevance-active dd.tl-yellow,
  660 +dl.relevance-active.intimity dd.tl-yellow {
  661 + background: linear-gradient(to right, yellow, yellow, #8baabf) !important;
  662 +}
  663 +
  664 +dl.relevance-active dd.tl-grey,
  665 +dl.relevance-active.intimity dd.tl-grey {
  666 + background: linear-gradient(to right, grey, grey, #8baabf) !important;
  667 +}
  668 +
  669 +dl.relevance-active dd.tl-white,
  670 +dl.relevance-active.intimity dd.tl-white {
  671 + background: linear-gradient(to right, #ffffff, #ffffff, #8baabf) !important;
  672 +}
  673 +
  674 +dl.relevance-active.intimity dd span.fcsj-diff {
  675 + color: #616060;
  676 +}
  677 +
  678 +dl.relevance-active dd span.fcsj-diff{
  679 + color: #aba6a6;
  680 +}
  681 +
  682 +/*dl.relevance-active a {
  683 + color: #dff0ff;
  684 +}*/
  685 +
  686 +.right-text-lp {
  687 + position: absolute;
  688 + right: 7px;
  689 + padding: 0 5px;
  690 + border-radius: 5px;
  691 + font-size: 12px;
  692 + color: #a0a0a0;
  693 +}
  694 +
  695 +div.drop-rail {
  696 + position: absolute;
  697 + width: 140px;
  698 + height: 36px;
  699 + margin: -2px 0 0 -3px;
  700 + background: transparent;
  701 + z-index: 1;
  702 +}
  703 +
  704 +div.drop-rail.over {
  705 + border: 1px dashed #dddddd;
  706 +}
  707 +
  708 +.uk-table.comf-result tbody tr td:nth-of-type(1) {
  709 + font-family: 微软雅黑;
  710 +}
  711 +
  712 +.uk-table.comf-result tbody tr td:nth-of-type(3) {
  713 + color: #888686;
  714 +}
  715 +
  716 +.uk-table.comf-result tbody tr td:nth-of-type(4) {
  717 + color: #366fad;
  718 +}
  719 +
  720 +label.destroy-sch{
  721 + color: #928e8e;
  722 +}
  723 +label.destroy-sch small{
  724 + color: #e25e5e;
  725 +}
  726 +
  727 +.main-schedule-table dl dt:nth-of-type(1), .main-schedule-table dl dd:nth-of-type(1) {
  728 + width: 6%;
  729 + text-align: center;
  730 +}
  731 +.main-schedule-table dl dt:nth-of-type(2), .main-schedule-table dl dd:nth-of-type(2) {
  732 + width: 14%;
  733 +}
  734 +.main-schedule-table dl dt:nth-of-type(3), .main-schedule-table dl dd:nth-of-type(3) {
  735 + width: 10%;
  736 +}
  737 +.main-schedule-table dl dt:nth-of-type(4), .main-schedule-table dl dd:nth-of-type(4) {
  738 + width: 19%;
  739 +}
  740 +.main-schedule-table dl dt:nth-of-type(5), .main-schedule-table dl dd:nth-of-type(5) {
  741 + width: 19%;
  742 +}
  743 +.main-schedule-table dl dt:nth-of-type(6), .main-schedule-table dl dd:nth-of-type(6) {
  744 + width: 10%;
  745 +}
  746 +.main-schedule-table dl dt:nth-of-type(7), .main-schedule-table dl dd:nth-of-type(7) {
  747 + width: 12%;
  748 +}
  749 +.main-schedule-table dl dt:nth-of-type(8), .main-schedule-table dl dd:nth-of-type(8) {
  750 + width: 10%;
  751 +}
  752 +
  753 +.main-schedule-table.ct_table dl.active,
  754 +.main-schedule-table.ct_table>.ct_table_body dl.active:hover,
  755 +.main-schedule-table.ct_table>.ct_table_body dl.context-menu-active{
  756 + background: #9393bf;
  757 + box-shadow: 0 0 4px #656c71;
  758 + color: white;
  759 +}
  760 +
  761 +.main-schedule-table span.sjfc-time{
  762 + color:#07d
  763 +}
  764 +
  765 +.main-schedule-table dl.active span.sjfc-time{
  766 + background: white;
  767 + border-radius: 5px;
  768 + padding: 2px 1px;
  769 + vertical-align: middle;
  770 +}
  771 +
  772 +.sub-task-table dl dt:nth-of-type(1), .sub-task-table dl dd:nth-of-type(1) {
  773 + width: 6%;
  774 + text-align: center;
  775 +}
  776 +.sub-task-table dl dt:nth-of-type(2), .sub-task-table dl dd:nth-of-type(2) {
  777 + width: 13%;
  778 +}
  779 +.sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) {
  780 + width: 16%;
  781 +}
  782 +.sub-task-table dl dt:nth-of-type(4), .sub-task-table dl dd:nth-of-type(4) {
  783 + width: 16%;
  784 +}
  785 +.sub-task-table dl dt:nth-of-type(5), .sub-task-table dl dd:nth-of-type(5) {
  786 + width: 11%;
  787 +}
  788 +.sub-task-table dl dt:nth-of-type(6), .sub-task-table dl dd:nth-of-type(6) {
  789 + width: 11%;
  790 +}
  791 +.sub-task-table dl dt:nth-of-type(7), .sub-task-table dl dd:nth-of-type(7) {
  792 + width: 16%;
  793 +}
  794 +.sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) {
  795 + width: 9%;
  796 +}
  797 +
  798 +.sub-task-table>.ct_table_body>dl:last-child dd{
  799 + border-bottom: 0;
  800 +}
  801 +
  802 +.add-temp-sch-icon{
  803 + float: right;
  804 + margin: 0 3px 0;
  805 + padding: 0;
  806 + font-size: 13px;
  807 + text-decoration: underline;
  808 +}
  809 +
  810 +.add-temp-lp-icon{
  811 + cursor: pointer;
  812 + margin-left: 5px;
  813 +}
  814 +
  815 +
  816 +input.i-cbox[type=checkbox]{
  817 + width: 20px;
  818 + height: 18px;
  819 + vertical-align: middle;
  820 + margin-top: -3px;
  821 +}
  822 +
  823 +.sys-note-80,
  824 +.sys-note-42{
  825 + width: calc(100% - 10px) !important;
  826 + margin: 5px !important;
  827 + cursor: default;
  828 +}
  829 +
  830 +.sys-note-80:hover,
  831 +.sys-note-42:hover{
  832 + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
  833 +}
  834 +
  835 +.sys-note-80 .uk-panel-box,
  836 +.sys-note-42 .uk-panel-box{
  837 + padding: 10px;
  838 +}
  839 +.sys-note-80 .uk-panel-title{
  840 + margin-bottom: 3px;
  841 + font-size: 15px;
  842 +}
  843 +
  844 +.sys-note-42 .title{
  845 + font-family: 微软雅黑;
  846 + margin-bottom: 3px;
  847 +}
  848 +.sys-note-80 .uk-button-group,
  849 +.sys-note-42 .uk-button-group{
  850 + display: block;
  851 + margin-top: 5px;
  852 +}
  853 +
  854 +
  855 +
  856 +.sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) {
  857 + width: 25%;
  858 +}
  859 +.sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) {
  860 + width: 18%;
  861 +}
  862 +.sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) {
  863 + width: 21%;
  864 +}
  865 +.sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) {
  866 + width: 21%;
  867 +}
  868 +.sch-tzrc-table dl dt:nth-of-type(5), .sch-tzrc-table dl dd:nth-of-type(5) {
  869 + width: 15%;
  870 +}
  871 +
  872 +.ct-form-modal .uk-autocomplete{
  873 + width: 100%;
  874 +}
  875 +
  876 +/*.sch-tzrc-table.ct_table dl.active,
  877 +.sch-tzrc-table.ct_table>.ct_table_body dl.active:hover,
  878 +.sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{
  879 + background: #e6e6e6;
  880 +}*/
  881 +
  882 +.search_sch_panel{
  883 + float: right;
  884 +}
  885 +
  886 +.search_sch_panel .uk-form input[type=text]{
  887 + width: 80px;
  888 + background: #fafafa;
  889 + border: 0;
  890 + border-bottom: 1px solid #ddd;
  891 + font-size: 14px;
  892 + height: 20px;
  893 + transition: all .3s ease;
  894 +}
  895 +
  896 +.search_sch_panel .uk-form div.uk-form-icon.active input[type=text]{
  897 + width: 145px;
  898 +}
  899 +
  900 +.search_sch_panel .uk-form div.uk-form-icon i.cancel{
  901 + position: absolute;
  902 + right: 8px;
  903 + font-size: 13px;
  904 + color: #c3b9ba;
  905 + cursor: pointer;
  906 + display: none;
  907 + padding: 0;
  908 + pointer-events: auto;
  909 + width: 18px;
  910 + text-indent: 0;
  911 +}
  912 +
  913 +/*.search_sch_panel .uk-form div.uk-form-icon i.cancel:before{*/
  914 +
  915 +/*}*/
  916 +
  917 +.search_sch_panel .uk-form div.uk-form-icon.active i.cancel{
  918 + display: block;
  919 +}
  920 +
  921 +.search_sch_panel .uk-form input[type=text]::-webkit-input-placeholder{
  922 + font-size: 12px;
  923 + color: #cecece;
  924 +}
  925 +.device_event_str{
  926 + font-size: 10px;
  927 + color: #bdbdbd;
  928 + margin-left: 3px;
  929 +}
  930 +
  931 +
  932 +.tl-tip-panel{
  933 + padding: 3px;
  934 +}
  935 +
  936 +.tl-tip-panel .ct_title{
  937 + display: inline-block;
  938 + width: 42px;
  939 + vertical-align: top;
  940 + margin-top: 5px;
  941 + color: grey;
  942 + font-family: 微软雅黑;
  943 + margin: 5px 0 0 3px;
  944 +}
  945 +.tl-tip-panel span{
  946 + display: inline-block;
  947 + font-size: 11px;
  948 + width: 60px;
  949 + height: 21px;
  950 + line-height: 21px;
  951 + text-align: center;
  952 + margin: 3px 1px;
  953 + border-radius: 3px;
  954 +}
  955 +
  956 +.qtip.sch-tl-tip{
  957 + max-width: 335px;
  958 +}
  959 +
  960 +.sfsj-sch-detail{
  961 + list-style: none;
  962 + padding: 5px 0px;
  963 + margin-bottom: 3px;
  964 +}
  965 +.sfsj-sch-detail li{
  966 + font-size: 14px;
  967 + line-height: 24px;
  968 +}
  969 +
  970 +.sfsj-sch-detail li span{
  971 + display: inline-block;
  972 + width: 65px;
  973 + text-align: right;
  974 + color: #bab6b6;
  975 + font-family: 微软雅黑;
  976 + font-size: 13px;
  977 +}
  978 +
  979 +#add-sub-task-inpark-modal .uk-panel-box{
  980 + background-color: #ffffff;
  981 +}
  982 +
  983 +#add-sub-task-inpark-modal .pl5{
  984 + padding-left: 5px;
  985 +}
  986 +
  987 +#add-sub-task-inpark-modal.uk-modal .uk-form.fv-form{
  988 + margin-bottom: 0px !important;
  989 +}
  990 +#add-sub-task-inpark-modal .uk-form select,
  991 +#add-sub-task-inpark-modal .uk-form input[type=text],
  992 +#add-sub-task-inpark-modal .uk-form input[type=time]{
  993 + width: 100%
  994 +}
  995 +
  996 +#add-sub-task-inpark-modal .uk-grid{
  997 + margin-top: 10px;
  998 +}
  999 +
  1000 +.sub-task-card{
  1001 + display: inline-block;vertical-align: top;margin-right: 1%;
  1002 + width: 48.5%;
  1003 +}
  1004 +
  1005 +.sub-task-card.destroy-card{
  1006 + vertical-align: top;
  1007 + margin-right: 0;
  1008 + display: none;
  1009 +}
  1010 +
  1011 +#add-sub-task-inpark-modal .uk-modal-dialog{
  1012 + width: 755px;
  1013 + /*transition: all .3s ease;*/
  1014 +}
  1015 +
  1016 +#add-sub-task-inpark-modal .uk-modal-dialog.three-children{
  1017 + width: 955px;
  1018 +}
  1019 +
  1020 +#add-sub-task-inpark-modal .uk-modal-dialog.three-children .sub-task-card{
  1021 + width: 32%;
  1022 +}
  1023 +
  1024 +.uk-modal-footer .ct-footer-left{
  1025 + float: left;
  1026 + font-size: 12px;
  1027 +}
  1028 +
  1029 +.uk-modal-footer .ct-footer-left a{
  1030 + color: #6e6b6b;
  1031 + margin-right: 5px;
  1032 +}
  1033 +
  1034 +.fixed_legend{
  1035 + font-size: 12px;
  1036 + display: none;
  1037 + height: 28px;
  1038 + border-radius: 4px;
  1039 + background: #efeeee;
  1040 + padding-bottom: .5px;
  1041 + margin-left: 10px;
  1042 + padding-right: 8px;
  1043 +}
  1044 +.fixed_legend>div{
  1045 + height: 100%;
  1046 +}
  1047 +.fixed_legend span{
  1048 + padding: 4px 4px;
  1049 + border-radius: 2px;
  1050 + margin-right: 5px;
  1051 + font-size: 12px;
  1052 +}
  1053 +
  1054 +.fixed_legend span:last-child{
  1055 + margin-right: 0px;
  1056 +}
  1057 +
  1058 +/*.fixed_legend i{
  1059 + font-size: 16px;
  1060 + vertical-align: middle;
  1061 + margin: -3px 3px 0 0;
  1062 +}*/
  1063 +
  1064 +.fixed_legend .tl-qrlb::before{
  1065 + font-size: 12px;
  1066 +}
  1067 +
  1068 +.schedule-body .ct_table dl.dl-last-sch{
  1069 + height: 55px;
  1070 +}
  1071 +
  1072 +.schedule-body .ct_table dl.dl-last-sch dd{
  1073 + line-height: 55px;
  1074 +}
  1075 +
  1076 +.schedule-body .ct_table dl.dl-last-sch dd.fcsjActualCell{
  1077 + line-height: 28px;
  1078 +}
  1079 +
  1080 +dd.fcsjActualCell div.last-sch-sunken{
  1081 + height: 25px;
  1082 + line-height: 25px;
  1083 + margin: 0;
  1084 + background: #fff;
  1085 + /*border-top: 1px solid #eeeeee;*/
  1086 +}
  1087 +
  1088 +dd.fcsjActualCell.tl-yzx div.last-sch-sunken {
  1089 + background: #c1ddf0;
  1090 + border-top: 1px solid #c1d3df;
  1091 +}
  1092 +
  1093 +dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge {
  1094 + background: rgb(255, 255, 255);
  1095 + color: black;
  1096 +}
  1097 +
  1098 +dd.fcsjActualCell div.last-sch-sunken span._badge{
  1099 + font-size: 13px;
  1100 + border-radius: 0 9px 9px 0;
  1101 + padding-left: 0;
  1102 + width: 81px;
  1103 + display: inline-block;
  1104 + height: 23px;
  1105 + line-height: 23px;
  1106 + box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12);
  1107 + vertical-align: top;
  1108 + margin-right: 3px;
  1109 + margin-top: 1px;
  1110 + margin-left: -7px;
  1111 + /* text-indent: 2px; */
  1112 + border-left: 0;
  1113 + /* transform: scale(.9); */
  1114 + color: grey;
  1115 +}
  1116 +
  1117 +.relevance-active dd.fcsjActualCell div.last-sch-sunken{
  1118 + background: #f1efef;
  1119 +}
  1120 +
  1121 +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken{
  1122 + background: #76a6c7 !important;
  1123 + border-top: 1px solid #f7f8f8 !important;
  1124 + color: #f8f8f8;
  1125 +}
  1126 +
  1127 +.intimity.relevance-active dd.fcsjActualCell div.last-sch-sunken span._badge{
  1128 + background: #76a6c7 ;
  1129 + color: #ffffff ;
  1130 +}
  1131 +
  1132 +.drag-active dd.fcsjActualCell div.last-sch-sunken{
  1133 + background: #cef9e3 !important;
  1134 + border-top: 1px solid #d9e6e0 !important;
  1135 +}
  1136 +
  1137 +.drag-active dd.fcsjActualCell div.last-sch-sunken span._badge{
  1138 + color: #6e6969;
  1139 + background: #cef9e3;
  1140 +}
  1141 +
  1142 +.ct_table>.ct_table_body dl.dl-last-sch:hover div.last-sch-sunken,
  1143 +.ct_table>.ct_table_body dl.dl-last-sch.context-menu-active div.last-sch-sunken{
  1144 + background: #f5fbff;
  1145 +}
  1146 +
  1147 +dd.fcsjActualCell{
  1148 + position: relative;
  1149 +}
  1150 +
  1151 +i.signal_state_icon{
  1152 + position: absolute;
  1153 + right: 5px;
  1154 + top: 7px;
  1155 + box-shadow: 0px 0px 11px 0 rgba(0, 0, 0, 0.2), -1px 3px 8px 0 rgba(0, 0, 0, 0.19);
  1156 + text-indent: 0;
  1157 + border-radius: 15px;
  1158 + cursor: pointer;
  1159 +}
  1160 +
  1161 +i.signal_state_icon.uk-icon-question-circle{
  1162 + color: #e85252 !important;
  1163 +}
  1164 +
  1165 +i.signal_state_icon.uk-icon-reply{
  1166 + color: #4134e3 !important;
  1167 + box-shadow: none;
  1168 +}
  1169 +
  1170 +.child-task-status{
  1171 + float: right;
  1172 + font-size: 13px;
  1173 +}
  1174 +
  1175 +.child-task-status.fail{
  1176 + color: red;
  1177 + /*text-shadow: red 0px 0px 20px;*/
  1178 +}
  1179 +
  1180 +.child-task-status.fail span.calc-detail{
  1181 + font-family: Consolas,monospace,serif;
  1182 + white-space: nowrap;
  1183 + font-size: 14px;
1139 } 1184 }
1140 \ No newline at end of file 1185 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
1 -<div>  
2 - <script id="line-schedule-table-temp" type="text/html">  
3 - <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}">  
4 - <h3 class="header-title">  
5 - {{if dir==0}}  
6 - {{line.startStationName}}  
7 - {{else}}  
8 - {{line.endStationName}}  
9 - {{/if}}  
10 - <i class="uk-icon-question-circle uk-icon-hover"></i>  
11 - <div class="fixed_legend">  
12 - <div>  
13 - <span class="tl-xxfc">消息发出</span>  
14 - <span class="tl-xxsd">消息收到</span>  
15 - <span class="tl-xxrd">消息阅读</span>  
16 - &nbsp;  
17 - <span class="tl-wd">误点</span>  
18 - <span class="tl-zzzx">正在执行</span>  
19 - <span class="tl-qrlb"></span>  
20 - <span class="tl-yzx">已执行</span>  
21 - <a>  
22 - <i class="uk-icon-angle-double-up fixed_legend_close"></i>  
23 - </a>  
24 - </div>  
25 - </div>  
26 - <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i>  
27 - <i class="uk-icon-qrcode uk-icon-hover ct_calu_icon" data-toggle="tooltip" data-placement="bottom" title="计算应到实到时间对比"></i>  
28 -  
29 - <!--<i class="uk-icon-share-alt uk-icon-hover tp_info_icon" ></i>-->  
30 -  
31 - <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span>  
32 - <div class="search_sch_panel">  
33 - <form class="uk-form" onsubmit="javascript:return false;">  
34 - <div class="uk-autocomplete sch-search-autocom">  
35 - <div class="uk-form-icon">  
36 - <i class="uk-icon-search"></i>  
37 - <input type="text" placeholder="搜索">  
38 - <i class="cancel uk-icon-times-circle" data-uk-tooltip="{pos:'right'}" title="取消过滤"></i>  
39 - </div>  
40 - </div>  
41 - </form>  
42 - </div>  
43 - </h3>  
44 - <div class="schedule-body">  
45 - <div class="ct_table_wrap">  
46 - <div class="ct_table line-schedule-table">  
47 - <div class="ct_table_head">  
48 - <dl>  
49 - <dt>序号</dt>  
50 - <dt>路牌</dt>  
51 - <dt>车辆</dt>  
52 - <dt>应到</dt>  
53 - <dt>实到</dt>  
54 - <dt sort-field>计发</dt>  
55 - <dt sort-field>待发</dt>  
56 - <dt>实发</dt>  
57 - <dt>原因</dt>  
58 - </dl>  
59 - </div>  
60 - <div class="ct_table_body">  
61 - {{each list as sch i}}  
62 - <dl data-id="{{sch.id}}">  
63 - <dd class="seq_no">{{i + 1}}</dd>  
64 - <dd class="lpName"><a>{{sch.lpName}}</a></dd>  
65 - <dd data-nbbm="{{sch.clZbh}}"  
66 - class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}">  
67 - {{sch.clZbh}}  
68 - </dd>  
69 - <dd>{{sch.qdzArrDatejh}}</dd>  
70 - <dd class="qdzArrDatesjDD"><span class="qdzArrDatesjSPAN">{{sch.qdzArrDatesj}}</span><span class="arrsj-diff">{{sch.arrsj_diff}}</span></dd>  
71 - <dd data-sort-val={{sch.fcsjT}}>  
72 - {{sch.fcsj}}  
73 - {{if sch.bcType == "out"}}  
74 - <span class="uk-badge uk-badge-success out">出场</span>  
75 - {{else if sch.bcType == "in"}}  
76 - <span class="uk-badge uk-badge-warning in">进场</span>  
77 - {{else if sch.bcType == "venting"}}  
78 - <span class="uk-badge uk-badge-danger">直放</span>  
79 - {{else if sch.bcType == "major"}}  
80 - <span class="uk-badge uk-badge-danger">放站</span>  
81 - {{else if sch.bcType == "region"}}  
82 - <span class="uk-badge sch_region">区间</span>  
83 - {{else if sch.bcType == "ldks"}}  
84 - <span class="uk-badge sch_ldks">空驶</span>  
85 - {{/if}}  
86 - {{if sch.sflj}}  
87 - <span class="uk-badge uk-badge-danger">临加</span>  
88 - {{/if}}  
89 - {{if sch.cTasks.length > 0}}  
90 - <span class="uk-badge uk-badge-notification c_task {{if sch.c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{sch.cTasks.length}}</span>  
91 - {{/if}}  
92 - {{if sch.lpChange==1}}  
93 - <span class="uk-badge uk-badge-success out">换</span>  
94 - {{/if}}  
95 - </dd>  
96 - <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">  
97 - {{sch.dfsj}}  
98 - {{if sch.late2}}  
99 - <span class="late-badge">?+{{sch.lateMinute}}</span>  
100 - {{/if}}  
101 - </dd>  
102 - <dd data-uk-observe class="  
103 - {{if sch.status==-1}}  
104 - tl-qrlb  
105 - {{else if sch.status==2}}  
106 - tl-yzx  
107 - {{else if sch.status==1}}  
108 - tl-zzzx  
109 - {{else if sch.status ==4}}  
110 - tl-wfyd  
111 - {{else if sch.status == 0 && sch.late}}  
112 - tl-wd  
113 - {{/if}} fcsjActualCell">  
114 - {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span>  
115 - </dd>  
116 - <dd data-uk-observe>  
117 -  
118 - <span title="{{sch.remarks}}"  
119 - data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span>  
120 - </dd>  
121 - </dl>  
122 - {{/each}}  
123 - </div>  
124 - </div>  
125 - </div>  
126 - </div>  
127 - </div>  
128 - </script>  
129 -  
130 - <script id="line-schedule-fcsj-temp" type="text/html">  
131 - <dd data-sort-val={{fcsjT}}>  
132 - {{fcsj}}  
133 - {{if bcType == "out"}}  
134 - <span class="uk-badge uk-badge-success out">出场</span>  
135 - {{else if bcType == "in"}}  
136 - <span class="uk-badge uk-badge-warning in">进场</span>  
137 - {{else if bcType == "venting"}}  
138 - <span class="uk-badge uk-badge-danger">直放</span>  
139 - {{else if bcType == "major"}}  
140 - <span class="uk-badge uk-badge-danger">放站</span>  
141 - {{else if bcType == "region"}}  
142 - <span class="uk-badge sch_region">区间</span>  
143 - {{else if bcType == "ldks"}}  
144 - <span class="uk-badge sch_ldks">空驶</span>  
145 - {{/if}}  
146 - {{if sflj}}  
147 - <span class="uk-badge uk-badge-danger">临加</span>  
148 - {{/if}}  
149 - {{if cTasks.length > 0}}  
150 - <span class="uk-badge uk-badge-notification c_task {{if c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{cTasks.length}}</span>  
151 - {{/if}}  
152 - </dd>  
153 - </script>  
154 -  
155 - <script id="line-schedule-sfsj-temp" type="text/html">  
156 - <dd data-uk-observe class="  
157 - {{if status==-1}}  
158 - tl-qrlb  
159 - {{else if status==2}}  
160 - tl-yzx  
161 - {{else if status==1}}  
162 - tl-zzzx  
163 - {{else if status == 0 && late}}  
164 - tl-wd  
165 - {{/if}} fcsjActualCell">  
166 - {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span>  
167 - </dd>  
168 - </script>  
169 -  
170 - <script id="line-schedule-nbbm-temp" type="text/html">  
171 - <dd data-nbbm="{{clZbh}}"  
172 - class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}">  
173 - {{clZbh}}  
174 - </dd>  
175 - </script>  
176 -  
177 - <script id="sfsj_sch-detail-temp" type="text/html">  
178 - <ul class="sfsj-sch-detail">  
179 - <li><span>路牌:</span>{{lpName}}</li>  
180 - <li><span>车辆:</span>{{clZbh}}</li>  
181 - <li><span>计发:</span>{{fcsj}}</li>  
182 - <li><span>实发:</span>{{fcsjActual}}</li>  
183 - <li><span>计达:</span>{{zdsj}}</li>  
184 - <li><span>实达:</span>{{zdsjActual}}</li>  
185 - <li><span>驾驶员:</span>{{jGh}}/{{jName}}</li>  
186 - <li><span>售票员:</span>{{sGh}}/{{sName}}</li>  
187 - <li><span>终点站:</span>{{zdzName}}</li>  
188 - </ul>  
189 - </script>  
190 -  
191 - <script id="last-sch-sunken-temp" type="text/html">  
192 - <div class="last-sch-sunken">  
193 - <span class="_badge">{{zdsj}}/{{zdsjActual}}</span>  
194 - </div>  
195 - </script>  
196 -  
197 - <script id="sch-lp-mileage-tip-temp" type="text/html">  
198 - {{each data as obj i}}  
199 - {{if i > 0}}<hr>{{/if}}  
200 -  
201 - <h5 class="_title"> <span class="lp_name">{{lpName}}</span>&nbsp;&nbsp;<a>{{obj.key}}</a></h5>  
202 - <div class="LD_item">  
203 - <span>营运:<a>{{obj.serviceMileage}}</a></span>  
204 - <span>烂班:<a>{{obj.destroyMileage}}</a></span>  
205 - <span>空驶:<a>{{obj.emptyMileage}}</a></span>  
206 - </div>  
207 - {{/each}}  
208 - </script>  
209 -</div> 1 +<div>
  2 + <script id="line-schedule-table-temp" type="text/html">
  3 + <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}">
  4 + <h3 class="header-title">
  5 + {{if dir==0}}
  6 + {{line.startStationName}}
  7 + {{else}}
  8 + {{line.endStationName}}
  9 + {{/if}}
  10 + <i class="uk-icon-question-circle uk-icon-hover"></i>
  11 + <div class="fixed_legend">
  12 + <div>
  13 + <span class="tl-xxfc">消息发出</span>
  14 + <span class="tl-xxsd">消息收到</span>
  15 + <span class="tl-xxrd">消息阅读</span>
  16 + &nbsp;
  17 + <span class="tl-wd">误点</span>
  18 + <span class="tl-zzzx">正在执行</span>
  19 + <span class="tl-qrlb"></span>
  20 + <span class="tl-yzx">已执行</span>
  21 + <a>
  22 + <i class="uk-icon-angle-double-up fixed_legend_close"></i>
  23 + </a>
  24 + </div>
  25 + </div>
  26 + <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i>
  27 + <i class="uk-icon-qrcode uk-icon-hover ct_calu_icon" data-toggle="tooltip" data-placement="bottom" title="计算应到实到时间对比"></i>
  28 +
  29 + <!--<i class="uk-icon-share-alt uk-icon-hover tp_info_icon" ></i>-->
  30 +
  31 + <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span>
  32 + <div class="search_sch_panel">
  33 + <form class="uk-form" onsubmit="javascript:return false;">
  34 + <div class="uk-autocomplete sch-search-autocom">
  35 + <div class="uk-form-icon">
  36 + <i class="uk-icon-search"></i>
  37 + <input type="text" placeholder="搜索">
  38 + <i class="cancel uk-icon-times-circle" data-uk-tooltip="{pos:'right'}" title="取消过滤"></i>
  39 + </div>
  40 + </div>
  41 + </form>
  42 + </div>
  43 + </h3>
  44 + <div class="schedule-body">
  45 + <div class="ct_table_wrap">
  46 + <div class="ct_table line-schedule-table">
  47 + <div class="ct_table_head">
  48 + <dl>
  49 + <dt>序号</dt>
  50 + <dt>路牌</dt>
  51 + <dt>RFID</dt>
  52 + <dt>车辆</dt>
  53 + <dt>应到</dt>
  54 + <dt>实到</dt>
  55 + <dt sort-field>计发</dt>
  56 + <dt sort-field>待发</dt>
  57 + <dt>实发</dt>
  58 + <dt>原因</dt>
  59 + </dl>
  60 + </div>
  61 + <div class="ct_table_body">
  62 + {{each list as sch i}}
  63 + <dl data-id="{{sch.id}}">
  64 + <dd class="seq_no">{{i + 1}}</dd>
  65 + <dd class="lpName"><a>{{sch.lpName}}</a></dd>
  66 + <dd class="{{if (sch.bcType == 'in') || (sch.bcType == 'out')}}tl-white{{else if !sch.qdzArrDatesj}}tl-white{{else if (sch.rfidState & 1) == 1 && (sch.rfidState & 2) == 2}}tl-green{{else if (sch.rfidState & 1) == 1}}tl-yellow{{else}}tl-grey{{/if}}"></dd>
  67 + <dd data-nbbm="{{sch.clZbh}}"
  68 + class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}">
  69 + {{sch.clZbh}}
  70 + </dd>
  71 + <dd>{{sch.qdzArrDatejh}}</dd>
  72 + <dd class="qdzArrDatesjDD"><span class="qdzArrDatesjSPAN">{{sch.qdzArrDatesj}}</span><span class="arrsj-diff">{{sch.arrsj_diff}}</span></dd>
  73 + <dd data-sort-val={{sch.fcsjT}}>
  74 + {{sch.fcsj}}
  75 + {{if sch.bcType == "out"}}
  76 + <span class="uk-badge uk-badge-success out">出场</span>
  77 + {{else if sch.bcType == "in"}}
  78 + <span class="uk-badge uk-badge-warning in">进场</span>
  79 + {{else if sch.bcType == "venting"}}
  80 + <span class="uk-badge uk-badge-danger">直放</span>
  81 + {{else if sch.bcType == "major"}}
  82 + <span class="uk-badge uk-badge-danger">放站</span>
  83 + {{else if sch.bcType == "region"}}
  84 + <span class="uk-badge sch_region">区间</span>
  85 + {{else if sch.bcType == "ldks"}}
  86 + <span class="uk-badge sch_ldks">空驶</span>
  87 + {{/if}}
  88 + {{if sch.sflj}}
  89 + <span class="uk-badge uk-badge-danger">临加</span>
  90 + {{/if}}
  91 + {{if sch.cTasks.length > 0}}
  92 + <span class="uk-badge uk-badge-notification c_task {{if sch.c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{sch.cTasks.length}}</span>
  93 + {{/if}}
  94 + {{if sch.lpChange==1}}
  95 + <span class="uk-badge uk-badge-success out">换</span>
  96 + {{/if}}
  97 + </dd>
  98 + <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">
  99 + {{sch.dfsj}}
  100 + {{if sch.late2}}
  101 + <span class="late-badge">?+{{sch.lateMinute}}</span>
  102 + {{/if}}
  103 + </dd>
  104 + <dd data-uk-observe class="
  105 + {{if sch.status==-1}}
  106 + tl-qrlb
  107 + {{else if sch.status==2}}
  108 + tl-yzx
  109 + {{else if sch.status==1}}
  110 + tl-zzzx
  111 + {{else if sch.status ==4}}
  112 + tl-wfyd
  113 + {{else if sch.status == 0 && sch.late}}
  114 + tl-wd
  115 + {{/if}} fcsjActualCell">
  116 + {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span>
  117 + </dd>
  118 + <dd data-uk-observe>
  119 +
  120 + <span title="{{sch.remarks}}"
  121 + data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span>
  122 + </dd>
  123 + </dl>
  124 + {{/each}}
  125 + </div>
  126 + </div>
  127 + </div>
  128 + </div>
  129 + </div>
  130 + </script>
  131 +
  132 + <script id="line-schedule-fcsj-temp" type="text/html">
  133 + <dd data-sort-val={{fcsjT}}>
  134 + {{fcsj}}
  135 + {{if bcType == "out"}}
  136 + <span class="uk-badge uk-badge-success out">出场</span>
  137 + {{else if bcType == "in"}}
  138 + <span class="uk-badge uk-badge-warning in">进场</span>
  139 + {{else if bcType == "venting"}}
  140 + <span class="uk-badge uk-badge-danger">直放</span>
  141 + {{else if bcType == "major"}}
  142 + <span class="uk-badge uk-badge-danger">放站</span>
  143 + {{else if bcType == "region"}}
  144 + <span class="uk-badge sch_region">区间</span>
  145 + {{else if bcType == "ldks"}}
  146 + <span class="uk-badge sch_ldks">空驶</span>
  147 + {{/if}}
  148 + {{if sflj}}
  149 + <span class="uk-badge uk-badge-danger">临加</span>
  150 + {{/if}}
  151 + {{if cTasks.length > 0}}
  152 + <span class="uk-badge uk-badge-notification c_task {{if c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{cTasks.length}}</span>
  153 + {{/if}}
  154 + </dd>
  155 + </script>
  156 +
  157 + <script id="line-schedule-sfsj-temp" type="text/html">
  158 + <dd data-uk-observe class="
  159 + {{if status==-1}}
  160 + tl-qrlb
  161 + {{else if status==2}}
  162 + tl-yzx
  163 + {{else if status==1}}
  164 + tl-zzzx
  165 + {{else if status == 0 && late}}
  166 + tl-wd
  167 + {{/if}} fcsjActualCell">
  168 + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span>
  169 + </dd>
  170 + </script>
  171 +
  172 + <script id="line-schedule-nbbm-temp" type="text/html">
  173 + <dd data-nbbm="{{clZbh}}"
  174 + class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}">
  175 + {{clZbh}}
  176 + </dd>
  177 + </script>
  178 +
  179 + <script id="sfsj_sch-detail-temp" type="text/html">
  180 + <ul class="sfsj-sch-detail">
  181 + <li><span>路牌:</span>{{lpName}}</li>
  182 + <li><span>车辆:</span>{{clZbh}}</li>
  183 + <li><span>计发:</span>{{fcsj}}</li>
  184 + <li><span>实发:</span>{{fcsjActual}}</li>
  185 + <li><span>计达:</span>{{zdsj}}</li>
  186 + <li><span>实达:</span>{{zdsjActual}}</li>
  187 + <li><span>驾驶员:</span>{{jGh}}/{{jName}}</li>
  188 + <li><span>售票员:</span>{{sGh}}/{{sName}}</li>
  189 + <li><span>终点站:</span>{{zdzName}}</li>
  190 + </ul>
  191 + </script>
  192 +
  193 + <script id="last-sch-sunken-temp" type="text/html">
  194 + <div class="last-sch-sunken">
  195 + <span class="_badge">{{zdsj}}/{{zdsjActual}}</span>
  196 + </div>
  197 + </script>
  198 +
  199 + <script id="sch-lp-mileage-tip-temp" type="text/html">
  200 + {{each data as obj i}}
  201 + {{if i > 0}}<hr>{{/if}}
  202 +
  203 + <h5 class="_title"> <span class="lp_name">{{lpName}}</span>&nbsp;&nbsp;<a>{{obj.key}}</a></h5>
  204 + <div class="LD_item">
  205 + <span>营运:<a>{{obj.serviceMileage}}</a></span>
  206 + <span>烂班:<a>{{obj.destroyMileage}}</a></span>
  207 + <span>空驶:<a>{{obj.emptyMileage}}</a></span>
  208 + </div>
  209 + {{/each}}
  210 + </script>
  211 +</div>
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
1 -/** schedule table */  
2 -  
3 -var gb_schedule_table = (function () {  
4 -  
5 - var temps;  
6 - //线路分组的班次数据  
7 - var line2Schedule = {};  
8 - //车辆应发未发车辆数  
9 - var car_yfwf_map = {};  
10 - //班次站点编码和实际不符数据  
11 - var errorCodeData = {};  
12 -  
13 - var bcTypeOrderMap = {  
14 - 'out':0,  
15 - 'normal':1,  
16 - 'region':2,  
17 - 'major':3,  
18 - 'venting':4,  
19 - 'ldks':5,  
20 - 'in':6  
21 - };  
22 - var typeOrder = function (type) {  
23 - return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0;  
24 - };  
25 - var schedule_sort = function (s1, s2) {  
26 - var diff = s1['fcsjT'] - s2['fcsjT'];  
27 - return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']);  
28 - };  
29 -  
30 - var show = function (cb) {  
31 - //从服务器获取班次数据  
32 - $.get('/realSchedule/lines', {  
33 - lines: gb_data_basic.line_idx  
34 - }, function (rs) {  
35 - for (var lineCode in rs) {  
36 - line2Schedule[lineCode] = {};  
37 -  
38 - //排序  
39 - rs[lineCode].sort(schedule_sort);  
40 - //calc shift  
41 - $.each(rs[lineCode], function () {  
42 - if(this.status==-1)  
43 - clearActualTime(this);  
44 - calc_sch_real_shift(this);  
45 - wfydcolor(this);  
46 - line2Schedule[lineCode][this.id] = this;  
47 - //子任务公里是否与计划平  
48 - this.c_t_mileage_status = calcCTaskMileageStatus(this);  
49 - });  
50 - //计算应发未发  
51 - calc_yfwf_num(lineCode);  
52 - }  
53 - ep.emit('data', rs);  
54 - });  
55 -  
56 - //加载班次表格渲染模板  
57 - $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) {  
58 - ep.emit('temp', gb_common.compileTempByDom(dom, {  
59 - compress: true  
60 - }));  
61 - });  
62 -  
63 - var ep = EventProxy.create("data", "temp", function (data, temp) {  
64 - temps = temp;  
65 - var lineCode, dirData, htmlStr;  
66 - $('#main-tab-content .line_schedule').each(function () {  
67 - lineCode = $(this).data('id');  
68 - if (arrayIsNull(data[lineCode]))  
69 - return true;  
70 - dirData = gb_common.groupBy(data[lineCode], 'xlDir');  
71 - for (var upDown in dirData) {  
72 - htmlStr = temps['line-schedule-table-temp']({  
73 - dir: upDown,  
74 - line: gb_data_basic.codeToLine[lineCode],  
75 - list: dirData[upDown]  
76 - });  
77 -  
78 - $('.schedule-wrap .card-panel:eq(' + upDown + ')', this)  
79 - .html(htmlStr);  
80 - }  
81 -  
82 - //标记路牌最后一个班次  
83 - markerLastByLine(lineCode);  
84 - //初始化图例相关,dbclick 不能代理事件  
85 - //gb_sch_legend.init(this);  
86 - });  
87 - //初始化图例  
88 - gb_sch_legend.init();  
89 - var content = $('.line_schedule .ct_table_wrap');  
90 - //初始化滚动条  
91 - content.perfectScrollbar({suppressScrollX: true});  
92 - //fixed table head  
93 - gb_ct_table.fixedHead(content);  
94 - //enable sort  
95 - gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init);  
96 - //dbclick event  
97 - gb_schedule_table_dbclick.init();  
98 - //双击实发  
99 - gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell'));  
100 - //双击车辆  
101 - gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]'));  
102 - //搜索框初始化  
103 - gb_sch_search.init();  
104 -  
105 - //监听gps车辆信息  
106 - gb_data_gps.registerCallback(renderCarRemark);  
107 - gb_sch_legend.showYdSdDb();  
108 - cb && cb();  
109 - });  
110 -  
111 - };  
112 -  
113 - var renderCarRemark = function () {  
114 - try{  
115 - var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code');  
116 - if($activeTab.length==0)  
117 - return;  
118 - var lineCode = $activeTab.data('code');  
119 - var array = gb_common.get_vals(line2Schedule[lineCode]);  
120 - var nbbms = {};  
121 - for(var i=0,sch;sch=array[i++];){  
122 - nbbms[sch.clZbh]=1;  
123 - }  
124 -  
125 - var $activeWrap = $('#main-tab-content .line_schedule.uk-active .schedule-wrap .schedule-body');  
126 - var gps, e;  
127 - for(var nbbm in nbbms){  
128 - gps = gb_data_gps.findGpsByNbbm(nbbm);  
129 - e = $('.ct_table_body dl>dd[data-nbbm='+nbbm+']', $activeWrap);  
130 - $('i', e).remove();  
131 -  
132 - if(gps && gps['planCode']!=lineCode && gps.remark)  
133 - $(e).append('<i class="uk-icon-exclamation-circle" data-uk-tooltip title="'+gps.remark+'"></i>');  
134 - }  
135 - }catch (e){  
136 - console.log(e);  
137 - }  
138 - };  
139 -  
140 - /**  
141 - * 计算子任务公里是否和计划平  
142 - * @param sch  
143 - */  
144 - var calcCTaskMileageStatus = function (sch) {  
145 - if(!sch.cTasks || sch.cTasks.length==0)  
146 - return 0;  
147 - var sum = 0;  
148 - $.each(sch.cTasks, function () {  
149 - if (this.mileageType == 'service') {  
150 - sum = gb_common.accAdd(sum, this.mileage);  
151 - }  
152 - });  
153 -  
154 - if (sum != sch.jhlcOrig) {  
155 - return -1;  
156 - }  
157 - return 0;  
158 - };  
159 -  
160 -  
161 - //重置序号  
162 - var reset_seq_no = function (dls) {  
163 - dls.each(function (i, dl) {  
164 - $('dd:eq(0)', dl).text(i + 1);  
165 - });  
166 - };  
167 -  
168 - //计算实发时间差值  
169 - var calc_sch_real_shift = function (sch) {  
170 - if (sch['fcsjActualTime']){  
171 - var fs = 'YYYY-MM-DD HH:mm'  
172 - ,m1 = moment(sch['fcsjActualTime']).format(fs)  
173 - ,m2 = moment(sch['dfsjT']).format(fs);//去掉秒  
174 - console.log(moment(m1, fs).format('X'))  
175 - console.log(moment(m2, fs).format('X'))  
176 - var diff = moment(m1, fs).format('X') - moment(m2, fs).format('X')  
177 - ,fcsj_diff = parseInt(diff / 60, 10);;  
178 -  
179 - if(fcsj_diff > 0)  
180 - sch.fcsj_diff = '( +' + fcsj_diff + ' )';  
181 - else if (fcsj_diff < 0)  
182 - sch.fcsj_diff = '( ' + fcsj_diff + ' )';  
183 - else  
184 - sch.fcsj_diff = '';  
185 - }  
186 - };  
187 - //无发有到时间  
188 - var wfydcolor=function (sch) {  
189 - if (sch.fcsjActual==null&&sch.zdsjActual!=null&&sch.zdsjActual!=''&&sch.status!=-1) {//sch.qdzArrDatesj!=''&&sch.qdzArrDatesj!=null&&  
190 - sch.status=4;  
191 - }  
192 - }  
193 -  
194 -  
195 -  
196 - function arrayIsNull(array) {  
197 - return !array || array.length == 0;  
198 - }  
199 -  
200 - var findScheduleByLine = function (lineCode) {  
201 - return line2Schedule[lineCode];  
202 - };  
203 -  
204 - //新增一个班次,附带更新的班次  
205 - var insertSchedule = function (sch, upArr) {  
206 - var xls = {};  
207 - xls[sch.xlBm] = 1;  
208 - line2Schedule[sch.xlBm][sch.id] = sch;  
209 - //update  
210 - if (isArray(upArr)) {  
211 - $.each(upArr, function () {  
212 - line2Schedule[this.xlBm][this.id] = this;  
213 - xls[this.xlBm] = 1;  
214 - });  
215 - }  
216 -  
217 - //重新渲染表格  
218 - for(var xlBm in xls){  
219 - reRenderTable(sch.xlBm);  
220 - }  
221 - //定位到新添加的班次  
222 - scroToDl(sch);  
223 - };  
224 -  
225 - /**  
226 - * 重新渲染表格  
227 - */  
228 - var reRenderTable = function (lineCode) {  
229 - var data = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort),  
230 - dirData = gb_common.groupBy(data, 'xlDir'),  
231 - tabCont = $('li.line_schedule[data-id=' + lineCode + ']'),  
232 - htmlStr;  
233 -  
234 - if($.isEmptyObject(dirData)){  
235 - $('.schedule-wrap .card-panel', tabCont).html('');  
236 - }  
237 - else {  
238 - for (var upDown in dirData) {  
239 - htmlStr = temps['line-schedule-table-temp']({  
240 - dir: upDown,  
241 - line: gb_data_basic.codeToLine[lineCode],  
242 - list: dirData[upDown]  
243 - });  
244 - $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr);  
245 - }  
246 - //图例相关  
247 - gb_sch_legend.init(tabCont);  
248 - //标记末班  
249 - markerLastByLine(lineCode);  
250 - //计算应发未发  
251 - calc_yfwf_num(lineCode);  
252 - //重新固定表头  
253 - gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont));  
254 -  
255 - //重新初始化排序  
256 - gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init);  
257 - //重新初始化双击待发调整  
258 - gb_schedule_table_dbclick.init();  
259 - //重新初始化双击实发发车信息微调  
260 - gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont));  
261 - //重新初始化双击车辆  
262 - gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]'));  
263 - //滚动条  
264 - $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true});  
265 -  
266 - //搜索模板初始化  
267 - gb_sch_search.init();  
268 - }  
269 - };  
270 -  
271 -  
272 - /**  
273 - * 重新从服务器加载数据,并刷新表格  
274 - * @param lineCode  
275 - */  
276 - var reLoadAndRefresh = function (lineCode) {  
277 - $.get('/realSchedule/lines', {  
278 - lines: lineCode + ','  
279 - }, function (rs) {  
280 - if(!rs || $.isEmptyObject(rs)){  
281 - line2Schedule[lineCode] = {};  
282 - }  
283 - else{  
284 - //排序  
285 - rs[lineCode].sort(schedule_sort);  
286 - line2Schedule[lineCode] = {};  
287 - //calc shift  
288 - $.each(rs[lineCode], function () {  
289 - calc_sch_real_shift(this);  
290 - line2Schedule[lineCode][this.id] = this;  
291 - });  
292 - }  
293 - //计算应发未发  
294 - calc_yfwf_num(lineCode);  
295 - //重新渲染  
296 - reRenderTable(lineCode);  
297 - });  
298 - };  
299 -  
300 - //删除一个班次  
301 - var deheteSchedule = function (sch) {  
302 - sch = line2Schedule[sch.xlBm][sch.id];  
303 - if (sch) {  
304 - var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'),  
305 - dls = dl.parent().find('dl');  
306 - delete line2Schedule[sch.xlBm][sch.id];  
307 - dl.remove();  
308 - reset_seq_no(dls);  
309 - calc_yfwf_num(sch.xlBm);  
310 - }  
311 - };  
312 -  
313 - /**  
314 - * 更新班次  
315 - * @param schArr  
316 - */  
317 - var updateSchedule = function (schArr) {  
318 -  
319 - if (!isArray(schArr))  
320 - schArr = [schArr];  
321 -  
322 - //var tMaps = {};  
323 - $.each(schArr, function () {  
324 - try {  
325 - if(this.status==-1)  
326 - clearActualTime(this);  
327 - //子任务公里是否与计划平  
328 - this.c_t_mileage_status = calcCTaskMileageStatus(this);  
329 - line2Schedule[this.xlBm][this.id] = this;  
330 - updateDom(this);  
331 - }catch(e){}  
332 - });  
333 -  
334 - /* //重新标记末班  
335 - var ts=[];  
336 - for(var k in tMaps){  
337 - ts = k.split('_');  
338 - markerLastByNbbm(ts[0], ts[1]);  
339 - }*/  
340 - };  
341 -  
342 -  
343 - /**  
344 - * 更新班次 -只更新数据,不更新dom  
345 - * @param schArr  
346 - */  
347 - var updateData = function (schArr) {  
348 - if (!isArray(schArr))  
349 - schArr = [schArr];  
350 - $.each(schArr, function () {  
351 - if(this.status==-1)  
352 - clearActualTime(this);  
353 - line2Schedule[this.xlBm][this.id] = this;  
354 - });  
355 - };  
356 -  
357 - //update dom  
358 - var updateDom = function (sch) {  
359 - if (!sch) return;  
360 - var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']');  
361 - var dds = $('dd', dl);  
362 - $(dds[1]).find('a').text(sch.lpName);  
363 -  
364 - //车辆自编号  
365 - var $newDds2 = $(temps['line-schedule-nbbm-temp'](sch));  
366 - $(dds[2]).replaceWith($newDds2);  
367 - //车辆双击  
368 - gb_schedule_table_dbclick.carCellClick($newDds2);  
369 - $(dds[3]).text(sch.qdzArrDatejh ? sch.qdzArrDatejh : '');  
370 - $(dds[4]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : '');  
371 -  
372 - //计发时间  
373 - var d5html = temps['line-schedule-fcsj-temp'](sch);  
374 - if (sch.lpChange == 1) {  
375 - d5html = d5html.replace('</dd>', '') + '<span class="uk-badge uk-badge-success out">换</span>' + '</dd>';  
376 - }  
377 - $(dds[5]).replaceWith(d5html);  
378 - //待发时间  
379 - var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':'');  
380 - $(dds[6]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr);  
381 -  
382 - //实发时间  
383 - calc_sch_real_shift(sch);  
384 - var sfsjDd = $(temps['line-schedule-sfsj-temp'](sch));  
385 - //双击  
386 - gb_schedule_table_dbclick.sfsjCellClick(sfsjDd);  
387 - $(dds[7]).replaceWith(sfsjDd);  
388 - if (sch.remarks)  
389 - $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>');  
390 - else  
391 - $(dds[8]).html('');  
392 -  
393 - //信号状态标记  
394 - gb_signal_state.marker_sch(sch);  
395 - //班次是车辆的最后一班  
396 - if (dl.hasClass('dl-last-sch'))  
397 - markerLastSch([sch]);  
398 -  
399 - renderCarRemark();  
400 - };  
401 -  
402 - //单击实发单元格显示详细信息  
403 - $(document).on('click', 'dd.fcsjActualCell', function () {  
404 - var that = this;  
405 - $(that).qtip({  
406 - show: true,  
407 - content: {  
408 - text: function (e) {  
409 - var lineCode = $(that).parents('li.line_schedule').data('id')  
410 - , id = $(that).parents('dl').data('id')  
411 - , sch = line2Schedule[lineCode][id];  
412 - return temps['sfsj_sch-detail-temp'](sch);  
413 - }  
414 - }  
415 - , style: {  
416 - classes: 'qtip-dark qtip-rounded qtip-shadow'  
417 - },  
418 - hide: {  
419 - fixed: true,  
420 - delay: 300  
421 - },  
422 - position: {  
423 - target: that,  
424 - my: 'center left',  
425 - at: 'center right'  
426 - },  
427 - events: {  
428 - hidden: function (event, api) {  
429 - $(this).qtip('destroy', true);  
430 - }  
431 - }  
432 - });  
433 -  
434 - //车辆rect 闪烁、  
435 - var wrap = $(that).parents('li.line_schedule');  
436 - var nbbm = $(that).parents('dl').find('dd:eq(2)').data('nbbm');  
437 - var device = gb_data_basic.nbbm2deviceMap()[nbbm];  
438 - var $rect = $('svg.line-chart g.gps-wrap rect[_id=rct_' + device + ']', wrap);  
439 -  
440 - //merge_hide  
441 - if ($rect.hasClass('merge_hide') || $rect.attr('y') < 0)  
442 - return;  
443 - $rect.attr('class', 'twinkle').one('animationend', function () {  
444 - $(this).removeAttr('class');  
445 - });  
446 - });  
447 -  
448 - //拖拽选中...  
449 - var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no';  
450 - var drag_strat;  
451 - $(document).on('mousedown', seq_nos, function (e) {  
452 - if (e.button != 0) return;  
453 - var dl = $(this).parent();  
454 - if (dl.hasClass('drag-active'))  
455 - dl.removeClass('drag-active');  
456 - else  
457 - dl.addClass('drag-active');  
458 -  
459 - drag_strat = parseInt($(this).text()) - 1;  
460 - }).on('mouseup', function () {  
461 - drag_strat = null;  
462 - }).on('mouseover', seq_nos, function () {  
463 - if (drag_strat != null) {  
464 - var e = parseInt($(this).text()),  
465 - dls = $(this).parents('.ct_table_body').find('dl');  
466 -  
467 - reset_drag_active_all(this);  
468 - //向上选中  
469 - if (e <= drag_strat) {  
470 - for (var i = drag_strat; i > e - 2; i--)  
471 - $(dls[i]).addClass('drag-active');  
472 - }  
473 - //向下选中  
474 - else {  
475 - for (var j = drag_strat; j < e; j++)  
476 - $(dls[j]).addClass('drag-active');  
477 - }  
478 - }  
479 - }).on('click', seq_nos, function () {  
480 - reset_relevance_active(this);  
481 - });  
482 - //非seq_no 单元格点击  
483 - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () {  
484 - reset_drag_active_all(this);  
485 - //选中相关班次  
486 - var id = $(this).parent().data('id'),  
487 - contWrap = $(this).parents('li.line_schedule'),  
488 - lineCode = contWrap.data('id'),  
489 - sch = line2Schedule[lineCode][id],  
490 - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) {  
491 - return item.clZbh == sch.clZbh;  
492 - }).sort(schedule_sort),  
493 - nextSch, tempDL;  
494 -  
495 - getDl(sch).addClass('intimity');  
496 - $.each(schArr, function (i) {  
497 - tempDL = $('dl[data-id=' + this.id + ']', contWrap);  
498 - tempDL.addClass('relevance-active');  
499 - if (i < schArr.length - 1 && this.id == id) {  
500 - nextSch = schArr[i + 1];  
501 - }  
502 - });  
503 -  
504 - if (nextSch) {  
505 - $('dl[data-id=' + nextSch.id + ']', contWrap).addClass('intimity');  
506 - /*if (nextSch.xlDir == sch.xlDir)  
507 - return;*/  
508 - //滚动到下一个班次  
509 - if(nextSch.xlDir != sch.xlDir)  
510 - scroToDl(nextSch);  
511 -  
512 - }  
513 -  
514 - //如果有打开轨迹回放  
515 - if($('.layui-layer.play_back-layer').is(':visible')){  
516 - gb_map_play_back.setParam(sch);  
517 - }  
518 - });  
519 -  
520 - //路牌点击  
521 - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () {  
522 - reset_drag_active_all(this);  
523 - //选中路牌下相关班次  
524 - var id = $(this).parent().data('id'),  
525 - contWrap = $(this).parents('li.line_schedule'),  
526 - lineCode = contWrap.data('id'),  
527 - sch = line2Schedule[lineCode][id],  
528 - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) {  
529 - return item.lpName == sch.lpName;  
530 - }).sort(schedule_sort);  
531 - $.each(schArr, function (i) {  
532 - $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity');  
533 - });  
534 -  
535 - //notify_succ('高亮路牌 ' + sch.lpName);  
536 - showLpMileageTip(lineCode, sch.lpName, schArr);  
537 - });  
538 -  
539 - var showLpMileageTipBySch = function (sch) {  
540 - if(!$('.mileage_elec_panel', $('.line_schedule[data-id='+sch.xlBm+']')).is(':visible'))  
541 - return;  
542 -  
543 - var schArr = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (item) {  
544 - return item.lpName == sch.lpName;  
545 - }).sort(schedule_sort);  
546 -  
547 - showLpMileageTip(sch.xlBm, sch.lpName, schArr);  
548 - };  
549 - /**  
550 - * 弹出路牌公里统计tip  
551 - * @param lineCode  
552 - * @param lpName  
553 - * @param array  
554 - */  
555 - var showLpMileageTip = function (lineCode, lpName, array) {  
556 - var wrap = $('.line_schedule[data-id='+lineCode+']');  
557 - //按驾驶员&车辆分组统计  
558 - var data=mileageTipGroupData(array);  
559 - //统计公里  
560 - var list=[];  
561 - for(var key in data){  
562 - list.push({  
563 - key : key,  
564 - serviceMileage: gb_sch_mileage_count.serviceMileage(data[key]),  
565 - destroyMileage: gb_sch_mileage_count.destroyMileage(data[key]),  
566 - emptyMileage: gb_sch_mileage_count.emptyMileage(data[key])  
567 - })  
568 - }  
569 - var htmlStr = temps['sch-lp-mileage-tip-temp']({data: list, lpName:lpName});  
570 - $('.mileage_elec_panel', wrap).html(htmlStr).addClass('uk-animation-slide-bottom').show()  
571 - .one('animationEnd', function () {  
572 - $(this).removeClass('uk-animation-slide-bottom');  
573 - });  
574 - };  
575 -  
576 - /**  
577 - * 分组数据,处理子任务里的中途换车  
578 - * @param array  
579 - */  
580 - var mileageTipGroupData = function (arr) {  
581 - var list = JSON.parse(JSON.stringify(arr));  
582 - var cts;  
583 - var zthcArray=[];  
584 - var sch;  
585 - for(var i=0,len=list.length;i<len;i++){  
586 - sch = list[i];  
587 - cts = sch['cTasks'];  
588 - if(!cts || cts.length==0)  
589 - continue;  
590 -  
591 - sch['cTasks'] = [];  
592 - //有子任务  
593 - for(var j=0,ct;ct=cts[j++];){  
594 - if(!ct.nbbm || ct.nbbm==sch.clZbh){  
595 - sch['cTasks'].push(ct);  
596 - continue;  
597 - }  
598 -  
599 - zthcArray.push(cloneByCTask(sch, ct));  
600 - }  
601 - }  
602 -  
603 - if(zthcArray.length > 0)  
604 - list = list.concat(zthcArray);  
605 -  
606 - var data={},key;  
607 - for(var i=0,len=list.length;i<len;i++){  
608 - key = list[i].clZbh+'/'+list[i].jGh+'('+list[i].jName+')';  
609 - if(!data[key])  
610 - data[key] = [];  
611 - data[key].push(list[i]);  
612 - }  
613 - return data;  
614 - };  
615 -  
616 - var cloneByCTask = function (sch, ct) {  
617 - var newObj = JSON.parse(JSON.stringify(sch));  
618 - newObj['cTasks']=[];  
619 - newObj.clZbh = ct.nbbm;  
620 - newObj.fcsjActual = ct.startDate;  
621 - newObj.zdsjActual = ct.endDate;  
622 - newObj.jhlc = ct.mileage;  
623 - newObj.jhlcOrig = ct.mileage;  
624 -  
625 - if(ct.type2=='1')  
626 - newObj.bcType='normal';  
627 - else if(ct.type2=='2'){  
628 - newObj.bcType='in';  
629 - }else if(ct.type2=='3')  
630 - newObj.bcType='out';  
631 -  
632 - return newObj;  
633 - };  
634 -  
635 - //头部点击去掉选中光标  
636 - $(document).on('click', '.header-title', function () {  
637 - reset_drag_active_all(this);  
638 - });  
639 -  
640 - var scroToDl = function (sch) {  
641 - var dl = getDl(sch),  
642 - cont = dl.parents('.ct_table_wrap'),  
643 - diff = cont.height() / 2;  
644 - cont.animate({  
645 - scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff  
646 - }, 500);  
647 -  
648 - return dl;  
649 - };  
650 -  
651 - var getDl = function (sch) {  
652 - return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']'));  
653 - };  
654 -  
655 - var reset_drag_active_all = function (dd) {  
656 - $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active');  
657 - reset_relevance_active(dd);  
658 -  
659 - $('.mileage_elec_panel', $(dd).parents('.top-container')).hide().remove('uk-animation-slide-bottom');  
660 - };  
661 -  
662 - var reset_relevance_active = function (dd) {  
663 - $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity');  
664 - };  
665 -  
666 -  
667 - //计算应发未发数量 car_yfwf_map  
668 - var calc_yfwf_num = function (lineCode) {  
669 -  
670 - var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort),  
671 - yfwf_num = 0,  
672 - t = new Date().valueOf();  
673 -  
674 - var carYfwfMap = {}, nbbm;  
675 - $.each(schArr, function () {  
676 - /*if (this.dfsjT > t)  
677 - return false;*/  
678 -  
679 - if (this.dfsjT < t &&  
680 - this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) {  
681 - yfwf_num++;  
682 - nbbm = this.clZbh;  
683 - if (carYfwfMap[nbbm])  
684 - carYfwfMap[nbbm]++;  
685 - else  
686 - carYfwfMap[nbbm] = 1;  
687 - }  
688 - });  
689 - car_yfwf_map[lineCode] = carYfwfMap;  
690 -  
691 - $('#badge_yfwf_num_' + lineCode).text(yfwf_num);  
692 - };  
693 -  
694 - //标记终点时间 -线路  
695 - var markerLastByLine = function (lineCode) {  
696 - var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'lpName');  
697 -  
698 - var array, lastSch, dl;  
699 - for (var nbbm in data) {  
700 - array = data[nbbm].sort(schedule_sort);  
701 - markerLastSch(array);  
702 - }  
703 - };  
704 -  
705 - //标记终点时间 -车辆  
706 - var markerLastByNbbm = function (lineCode, nbbm) {  
707 - var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) {  
708 - return a.clZbh == nbbm && a.status != -1;  
709 - }).sort(schedule_sort);  
710 -  
711 - removeMarkers(lineCode, array);  
712 - markerLastSch(array);  
713 - };  
714 -  
715 - var markerLastSch = function (array) {  
716 - var lastSch = array[array.length - 1];  
717 -  
718 - if (!lastSch.jhlc)  
719 - return;  
720 -  
721 - var dl = getDl(lastSch);  
722 - dl.addClass('dl-last-sch');  
723 -  
724 - $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch));  
725 - };  
726 -  
727 - //清除线路下指定班次的 末班标记  
728 - var removeMarkers = function (lineCode, array) {  
729 - var idx = [];  
730 - $.each(array, function () {  
731 - idx.push(this.id);  
732 - });  
733 -  
734 - $('dl.dl-last-sch', 'li.line_schedule[data-id=' + lineCode + ']').each(function () {  
735 - if ($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))) {  
736 - $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove();  
737 - }  
738 - });  
739 - };  
740 -  
741 - var schDestroyFilter = function (a) {  
742 - return a.status != -1;  
743 - };  
744 -  
745 - /* 下一个班次 */  
746 - var getNextSch = function (sch) {  
747 - var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) {  
748 - return a.clZbh == sch.clZbh;  
749 - }).sort(schedule_sort);  
750 -  
751 - for (var i = 0, item; item = array[i++];) {  
752 - if (array[i].id == sch.id) {  
753 - return i < array.length ? array[i + 1] : null;  
754 - }  
755 - }  
756 - };  
757 -  
758 - /* 下一个班次普通班次 */  
759 - var getNextNormalSch = function (sch) {  
760 -  
761 - var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) {  
762 - return a.clZbh == sch.clZbh && a.bcType=='normal';  
763 - }).sort(schedule_sort);  
764 -  
765 - for (var i = 0; i < array.length; i++) {  
766 - if (array[i].id == sch.id) {  
767 - return i < array.length ? array[i + 1] : null;  
768 - }  
769 - }  
770 - };  
771 -  
772 - /** 添加备注信息 */  
773 - var addRemarks = function (list, remarks) {  
774 - //if(!list || list)  
775 - var i = 0, sch;  
776 -  
777 - (function () {  
778 - var f = arguments.callee;  
779 - if(i >= list.length){  
780 - return;  
781 - }  
782 - sch = list[i];  
783 - gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) {  
784 - if(rs.t){  
785 - sch = rs.t;  
786 - line2Schedule[sch.xlBm][sch.id] = sch;  
787 - updateDom(sch);  
788 - i++;  
789 - f();  
790 - }  
791 - });  
792 - })();  
793 - };  
794 -  
795 - /**  
796 - * 显示误点停靠时间标记  
797 - * @param id  
798 - * @param minute  
799 - */  
800 - var showLateBadge = function (lineCode, id, minute) {  
801 - var dfCell = cancelLateBadge(lineCode, id);  
802 - $(dfCell).append('<span class="late-badge">?+'+minute+'</span>');  
803 - };  
804 -  
805 - /**  
806 - * 取消误点标记  
807 - * @param lineCode  
808 - * @param id  
809 - */  
810 - var cancelLateBadge = function (lineCode, id) {  
811 - var $dl = getDl({id: id, xlBm: lineCode});  
812 - var dfCell = $dl.find('dd')[6];  
813 - $('.late-badge',dfCell).remove();  
814 - return dfCell;  
815 - };  
816 -  
817 -  
818 - /**  
819 - * 刷新页面的所有线路班次  
820 - */  
821 - var refreshAll = function () {  
822 - show();  
823 - };  
824 -  
825 - /**  
826 - * 获取线路下营运的车辆  
827 - */  
828 - var findNbbmByLineCode = function (lineCode) {  
829 - try{  
830 - return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode])));  
831 - }catch (e){  
832 - return [];  
833 - }  
834 - };  
835 -  
836 - var clearActualTime = function (sch) {  
837 - try{  
838 - sch.fcsjActual=null;  
839 - sch.fcsjActualTime=null;  
840 - sch.zdsjActual=null;  
841 - sch.zdsjActualTime=null;  
842 - }catch (e){  
843 - console.log(e);  
844 - }  
845 - };  
846 -  
847 - /**  
848 - * 班次站点编码异常信息  
849 - * @param list  
850 - */  
851 - var putSCodeErrorInfo = function (list) {  
852 - //按线路走向分组  
853 - var data = {};  
854 - var k;  
855 - for(var i=0,obj;obj=list[i++];){  
856 - k = obj.lineCode+'_'+obj.upDown;  
857 -  
858 - if(obj.realStationCode && obj.realStationCode.indexOf('^') != -1)  
859 - obj.realStationCode = obj.realStationCode.split('^')[0];  
860 -  
861 - if(!data[k])  
862 - data[k] = [];  
863 - data[k].push(obj);  
864 - }  
865 -  
866 - var wrap;  
867 - for(var k in data){  
868 - wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']');  
869 - if(wrap.length==0)  
870 - continue;  
871 -  
872 - $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap)  
873 - .html('o(* ̄▽ ̄*)o 班次和站点关联有点问题!!').show();  
874 - }  
875 -  
876 - errorCodeData = data;  
877 - };  
878 -  
879 - var findSCodeErrorInfo = function (lineCode, upDown) {  
880 - return errorCodeData[lineCode+'_'+upDown];  
881 - };  
882 -  
883 - return {  
884 - show: show,  
885 - findScheduleByLine: findScheduleByLine,  
886 - updateSchedule: updateSchedule,  
887 - updateData: updateData,  
888 - deheteSchedule: deheteSchedule,  
889 - insertSchedule: insertSchedule,  
890 - schedule_sort: schedule_sort,  
891 - calc_yfwf_num: calc_yfwf_num,  
892 - car_yfwf_map: function (lineCode) {  
893 - return car_yfwf_map[lineCode];  
894 - },  
895 - scroToDl: scroToDl,  
896 - reset_drag_active_all: reset_drag_active_all,  
897 - getDl: getDl,  
898 - getNextSch: getNextSch,  
899 - addRemarks: addRemarks,  
900 - reLoadAndRefresh: reLoadAndRefresh,  
901 - showLateBadge: showLateBadge,  
902 - cancelLateBadge: cancelLateBadge,  
903 - refreshAll: refreshAll,  
904 - getNextNormalSch: getNextNormalSch,  
905 - findNbbmByLineCode:findNbbmByLineCode,  
906 - showLpMileageTipBySch: showLpMileageTipBySch,  
907 - renderCarRemark: renderCarRemark,  
908 - putSCodeErrorInfo: putSCodeErrorInfo,  
909 - findSCodeErrorInfo: findSCodeErrorInfo  
910 - };  
911 -})(); 1 +/** schedule table */
  2 +
  3 +var gb_schedule_table = (function () {
  4 +
  5 + var temps;
  6 + //线路分组的班次数据
  7 + var line2Schedule = {};
  8 + //车辆应发未发车辆数
  9 + var car_yfwf_map = {};
  10 + //班次站点编码和实际不符数据
  11 + var errorCodeData = {};
  12 +
  13 + var bcTypeOrderMap = {
  14 + 'out':0,
  15 + 'normal':1,
  16 + 'region':2,
  17 + 'major':3,
  18 + 'venting':4,
  19 + 'ldks':5,
  20 + 'in':6
  21 + };
  22 + var typeOrder = function (type) {
  23 + return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0;
  24 + };
  25 + var schedule_sort = function (s1, s2) {
  26 + var diff = s1['fcsjT'] - s2['fcsjT'];
  27 + return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']);
  28 + };
  29 +
  30 + var show = function (cb) {
  31 + //从服务器获取班次数据
  32 + $.get('/realSchedule/lines', {
  33 + lines: gb_data_basic.line_idx
  34 + }, function (rs) {
  35 + for (var lineCode in rs) {
  36 + line2Schedule[lineCode] = {};
  37 +
  38 + //排序
  39 + rs[lineCode].sort(schedule_sort);
  40 + //calc shift
  41 + $.each(rs[lineCode], function () {
  42 + if(this.status==-1)
  43 + clearActualTime(this);
  44 + calc_sch_real_shift(this);
  45 + wfydcolor(this);
  46 + line2Schedule[lineCode][this.id] = this;
  47 + //子任务公里是否与计划平
  48 + this.c_t_mileage_status = calcCTaskMileageStatus(this);
  49 + });
  50 + //计算应发未发
  51 + calc_yfwf_num(lineCode);
  52 + }
  53 + ep.emit('data', rs);
  54 + });
  55 +
  56 + //加载班次表格渲染模板
  57 + $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) {
  58 + ep.emit('temp', gb_common.compileTempByDom(dom, {
  59 + compress: true
  60 + }));
  61 + });
  62 +
  63 + var ep = EventProxy.create("data", "temp", function (data, temp) {
  64 + temps = temp;
  65 + var lineCode, dirData, htmlStr;
  66 + $('#main-tab-content .line_schedule').each(function () {
  67 + lineCode = $(this).data('id');
  68 + if (arrayIsNull(data[lineCode]))
  69 + return true;
  70 + dirData = gb_common.groupBy(data[lineCode], 'xlDir');
  71 + for (var upDown in dirData) {
  72 + htmlStr = temps['line-schedule-table-temp']({
  73 + dir: upDown,
  74 + line: gb_data_basic.codeToLine[lineCode],
  75 + list: dirData[upDown]
  76 + });
  77 +
  78 + $('.schedule-wrap .card-panel:eq(' + upDown + ')', this)
  79 + .html(htmlStr);
  80 + }
  81 +
  82 + //标记路牌最后一个班次
  83 + markerLastByLine(lineCode);
  84 + //初始化图例相关,dbclick 不能代理事件
  85 + //gb_sch_legend.init(this);
  86 + });
  87 + //初始化图例
  88 + gb_sch_legend.init();
  89 + var content = $('.line_schedule .ct_table_wrap');
  90 + //初始化滚动条
  91 + content.perfectScrollbar({suppressScrollX: true});
  92 + //fixed table head
  93 + gb_ct_table.fixedHead(content);
  94 + //enable sort
  95 + gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init);
  96 + //dbclick event
  97 + gb_schedule_table_dbclick.init();
  98 + //双击实发
  99 + gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell'));
  100 + //双击车辆
  101 + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]'));
  102 + //搜索框初始化
  103 + gb_sch_search.init();
  104 +
  105 + //监听gps车辆信息
  106 + gb_data_gps.registerCallback(renderCarRemark);
  107 + gb_sch_legend.showYdSdDb();
  108 + cb && cb();
  109 + });
  110 +
  111 + };
  112 +
  113 + var renderCarRemark = function () {
  114 + try{
  115 + var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code');
  116 + if($activeTab.length==0)
  117 + return;
  118 + var lineCode = $activeTab.data('code');
  119 + var array = gb_common.get_vals(line2Schedule[lineCode]);
  120 + var nbbms = {};
  121 + for(var i=0,sch;sch=array[i++];){
  122 + nbbms[sch.clZbh]=1;
  123 + }
  124 +
  125 + var $activeWrap = $('#main-tab-content .line_schedule.uk-active .schedule-wrap .schedule-body');
  126 + var gps, e;
  127 + for(var nbbm in nbbms){
  128 + gps = gb_data_gps.findGpsByNbbm(nbbm);
  129 + e = $('.ct_table_body dl>dd[data-nbbm='+nbbm+']', $activeWrap);
  130 + $('i', e).remove();
  131 +
  132 + if(gps && gps['planCode']!=lineCode && gps.remark)
  133 + $(e).append('<i class="uk-icon-exclamation-circle" data-uk-tooltip title="'+gps.remark+'"></i>');
  134 + }
  135 + }catch (e){
  136 + console.log(e);
  137 + }
  138 + };
  139 +
  140 + /**
  141 + * 计算子任务公里是否和计划平
  142 + * @param sch
  143 + */
  144 + var calcCTaskMileageStatus = function (sch) {
  145 + if(!sch.cTasks || sch.cTasks.length==0)
  146 + return 0;
  147 + var sum = 0;
  148 + $.each(sch.cTasks, function () {
  149 + if (this.mileageType == 'service') {
  150 + sum = gb_common.accAdd(sum, this.mileage);
  151 + }
  152 + });
  153 +
  154 + if (sum != sch.jhlcOrig) {
  155 + return -1;
  156 + }
  157 + return 0;
  158 + };
  159 +
  160 +
  161 + //重置序号
  162 + var reset_seq_no = function (dls) {
  163 + dls.each(function (i, dl) {
  164 + $('dd:eq(0)', dl).text(i + 1);
  165 + });
  166 + };
  167 +
  168 + //计算实发时间差值
  169 + var calc_sch_real_shift = function (sch) {
  170 + if (sch['fcsjActualTime']){
  171 + var fs = 'YYYY-MM-DD HH:mm'
  172 + ,m1 = moment(sch['fcsjActualTime']).format(fs)
  173 + ,m2 = moment(sch['dfsjT']).format(fs);//去掉秒
  174 + console.log(moment(m1, fs).format('X'))
  175 + console.log(moment(m2, fs).format('X'))
  176 + var diff = moment(m1, fs).format('X') - moment(m2, fs).format('X')
  177 + ,fcsj_diff = parseInt(diff / 60, 10);;
  178 +
  179 + if(fcsj_diff > 0)
  180 + sch.fcsj_diff = '( +' + fcsj_diff + ' )';
  181 + else if (fcsj_diff < 0)
  182 + sch.fcsj_diff = '( ' + fcsj_diff + ' )';
  183 + else
  184 + sch.fcsj_diff = '';
  185 + }
  186 + };
  187 + //无发有到时间
  188 + var wfydcolor=function (sch) {
  189 + if (sch.fcsjActual==null&&sch.zdsjActual!=null&&sch.zdsjActual!=''&&sch.status!=-1) {//sch.qdzArrDatesj!=''&&sch.qdzArrDatesj!=null&&
  190 + sch.status=4;
  191 + }
  192 + }
  193 +
  194 +
  195 +
  196 + function arrayIsNull(array) {
  197 + return !array || array.length == 0;
  198 + }
  199 +
  200 + var findScheduleByLine = function (lineCode) {
  201 + return line2Schedule[lineCode];
  202 + };
  203 +
  204 + //新增一个班次,附带更新的班次
  205 + var insertSchedule = function (sch, upArr) {
  206 + var xls = {};
  207 + xls[sch.xlBm] = 1;
  208 + line2Schedule[sch.xlBm][sch.id] = sch;
  209 + //update
  210 + if (isArray(upArr)) {
  211 + $.each(upArr, function () {
  212 + line2Schedule[this.xlBm][this.id] = this;
  213 + xls[this.xlBm] = 1;
  214 + });
  215 + }
  216 +
  217 + //重新渲染表格
  218 + for(var xlBm in xls){
  219 + reRenderTable(sch.xlBm);
  220 + }
  221 + //定位到新添加的班次
  222 + scroToDl(sch);
  223 + };
  224 +
  225 + /**
  226 + * 重新渲染表格
  227 + */
  228 + var reRenderTable = function (lineCode) {
  229 + var data = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort),
  230 + dirData = gb_common.groupBy(data, 'xlDir'),
  231 + tabCont = $('li.line_schedule[data-id=' + lineCode + ']'),
  232 + htmlStr;
  233 +
  234 + if($.isEmptyObject(dirData)){
  235 + $('.schedule-wrap .card-panel', tabCont).html('');
  236 + }
  237 + else {
  238 + for (var upDown in dirData) {
  239 + htmlStr = temps['line-schedule-table-temp']({
  240 + dir: upDown,
  241 + line: gb_data_basic.codeToLine[lineCode],
  242 + list: dirData[upDown]
  243 + });
  244 + $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr);
  245 + }
  246 + //图例相关
  247 + gb_sch_legend.init(tabCont);
  248 + //标记末班
  249 + markerLastByLine(lineCode);
  250 + //计算应发未发
  251 + calc_yfwf_num(lineCode);
  252 + //重新固定表头
  253 + gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont));
  254 +
  255 + //重新初始化排序
  256 + gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init);
  257 + //重新初始化双击待发调整
  258 + gb_schedule_table_dbclick.init();
  259 + //重新初始化双击实发发车信息微调
  260 + gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont));
  261 + //重新初始化双击车辆
  262 + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]'));
  263 + //滚动条
  264 + $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true});
  265 +
  266 + //搜索模板初始化
  267 + gb_sch_search.init();
  268 + }
  269 + };
  270 +
  271 +
  272 + /**
  273 + * 重新从服务器加载数据,并刷新表格
  274 + * @param lineCode
  275 + */
  276 + var reLoadAndRefresh = function (lineCode) {
  277 + $.get('/realSchedule/lines', {
  278 + lines: lineCode + ','
  279 + }, function (rs) {
  280 + if(!rs || $.isEmptyObject(rs)){
  281 + line2Schedule[lineCode] = {};
  282 + }
  283 + else{
  284 + //排序
  285 + rs[lineCode].sort(schedule_sort);
  286 + line2Schedule[lineCode] = {};
  287 + //calc shift
  288 + $.each(rs[lineCode], function () {
  289 + calc_sch_real_shift(this);
  290 + line2Schedule[lineCode][this.id] = this;
  291 + });
  292 + }
  293 + //计算应发未发
  294 + calc_yfwf_num(lineCode);
  295 + //重新渲染
  296 + reRenderTable(lineCode);
  297 + });
  298 + };
  299 +
  300 + //删除一个班次
  301 + var deheteSchedule = function (sch) {
  302 + sch = line2Schedule[sch.xlBm][sch.id];
  303 + if (sch) {
  304 + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'),
  305 + dls = dl.parent().find('dl');
  306 + delete line2Schedule[sch.xlBm][sch.id];
  307 + dl.remove();
  308 + reset_seq_no(dls);
  309 + calc_yfwf_num(sch.xlBm);
  310 + }
  311 + };
  312 +
  313 + /**
  314 + * 更新班次
  315 + * @param schArr
  316 + */
  317 + var updateSchedule = function (schArr) {
  318 +
  319 + if (!isArray(schArr))
  320 + schArr = [schArr];
  321 +
  322 + //var tMaps = {};
  323 + $.each(schArr, function () {
  324 + try {
  325 + if(this.status==-1)
  326 + clearActualTime(this);
  327 + //子任务公里是否与计划平
  328 + this.c_t_mileage_status = calcCTaskMileageStatus(this);
  329 + line2Schedule[this.xlBm][this.id] = this;
  330 + updateDom(this);
  331 + }catch(e){}
  332 + });
  333 +
  334 + /* //重新标记末班
  335 + var ts=[];
  336 + for(var k in tMaps){
  337 + ts = k.split('_');
  338 + markerLastByNbbm(ts[0], ts[1]);
  339 + }*/
  340 + };
  341 +
  342 +
  343 + /**
  344 + * 更新班次 -只更新数据,不更新dom
  345 + * @param schArr
  346 + */
  347 + var updateData = function (schArr) {
  348 + if (!isArray(schArr))
  349 + schArr = [schArr];
  350 + $.each(schArr, function () {
  351 + if(this.status==-1)
  352 + clearActualTime(this);
  353 + line2Schedule[this.xlBm][this.id] = this;
  354 + });
  355 + };
  356 +
  357 + //update dom
  358 + var updateDom = function (sch) {
  359 + if (!sch) return;
  360 + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']');
  361 + var dds = $('dd', dl);
  362 + $(dds[1]).find('a').text(sch.lpName);
  363 + var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey';
  364 + if (sch.rfidState & 1 == 1) {
  365 + light = 'tl-yellow';
  366 + if (sch.rfidState & 2 == 2) {
  367 + light = 'tl-green';
  368 + }
  369 + }
  370 + if (!(sch.bcType == 'in' || sch.bcType == 'out')) {
  371 + $(dds[2]).style('background', light);
  372 + }
  373 + //车辆自编号
  374 + var $newDds3 = $(temps['line-schedule-nbbm-temp'](sch));
  375 + $(dds[3]).replaceWith($newDds3);
  376 + //车辆双击
  377 + gb_schedule_table_dbclick.carCellClick($newDds3);
  378 + $(dds[4]).text(sch.qdzArrDatejh ? sch.qdzArrDatejh : '');
  379 + $(dds[5]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : '');
  380 +
  381 + //计发时间
  382 + var d5html = temps['line-schedule-fcsj-temp'](sch);
  383 + if (sch.lpChange == 1) {
  384 + d5html = d5html.replace('</dd>', '') + '<span class="uk-badge uk-badge-success out">换</span>' + '</dd>';
  385 + }
  386 + $(dds[6]).replaceWith(d5html);
  387 + //待发时间
  388 + var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':'');
  389 + $(dds[7]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr);
  390 +
  391 + //实发时间
  392 + calc_sch_real_shift(sch);
  393 + var sfsjDd = $(temps['line-schedule-sfsj-temp'](sch));
  394 + //双击
  395 + gb_schedule_table_dbclick.sfsjCellClick(sfsjDd);
  396 + $(dds[8]).replaceWith(sfsjDd);
  397 + if (sch.remarks)
  398 + $(dds[9]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>');
  399 + else
  400 + $(dds[9]).html('');
  401 +
  402 + //信号状态标记
  403 + gb_signal_state.marker_sch(sch);
  404 + //班次是车辆的最后一班
  405 + if (dl.hasClass('dl-last-sch'))
  406 + markerLastSch([sch]);
  407 +
  408 + renderCarRemark();
  409 + };
  410 +
  411 + //单击实发单元格显示详细信息
  412 + $(document).on('click', 'dd.fcsjActualCell', function () {
  413 + var that = this;
  414 + $(that).qtip({
  415 + show: true,
  416 + content: {
  417 + text: function (e) {
  418 + var lineCode = $(that).parents('li.line_schedule').data('id')
  419 + , id = $(that).parents('dl').data('id')
  420 + , sch = line2Schedule[lineCode][id];
  421 + return temps['sfsj_sch-detail-temp'](sch);
  422 + }
  423 + }
  424 + , style: {
  425 + classes: 'qtip-dark qtip-rounded qtip-shadow'
  426 + },
  427 + hide: {
  428 + fixed: true,
  429 + delay: 300
  430 + },
  431 + position: {
  432 + target: that,
  433 + my: 'center left',
  434 + at: 'center right'
  435 + },
  436 + events: {
  437 + hidden: function (event, api) {
  438 + $(this).qtip('destroy', true);
  439 + }
  440 + }
  441 + });
  442 +
  443 + //车辆rect 闪烁、
  444 + var wrap = $(that).parents('li.line_schedule');
  445 + var nbbm = $(that).parents('dl').find('dd:eq(2)').data('nbbm');
  446 + var device = gb_data_basic.nbbm2deviceMap()[nbbm];
  447 + var $rect = $('svg.line-chart g.gps-wrap rect[_id=rct_' + device + ']', wrap);
  448 +
  449 + //merge_hide
  450 + if ($rect.hasClass('merge_hide') || $rect.attr('y') < 0)
  451 + return;
  452 + $rect.attr('class', 'twinkle').one('animationend', function () {
  453 + $(this).removeAttr('class');
  454 + });
  455 + });
  456 +
  457 + //拖拽选中...
  458 + var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no';
  459 + var drag_strat;
  460 + $(document).on('mousedown', seq_nos, function (e) {
  461 + if (e.button != 0) return;
  462 + var dl = $(this).parent();
  463 + if (dl.hasClass('drag-active'))
  464 + dl.removeClass('drag-active');
  465 + else
  466 + dl.addClass('drag-active');
  467 +
  468 + drag_strat = parseInt($(this).text()) - 1;
  469 + }).on('mouseup', function () {
  470 + drag_strat = null;
  471 + }).on('mouseover', seq_nos, function () {
  472 + if (drag_strat != null) {
  473 + var e = parseInt($(this).text()),
  474 + dls = $(this).parents('.ct_table_body').find('dl');
  475 +
  476 + reset_drag_active_all(this);
  477 + //向上选中
  478 + if (e <= drag_strat) {
  479 + for (var i = drag_strat; i > e - 2; i--)
  480 + $(dls[i]).addClass('drag-active');
  481 + }
  482 + //向下选中
  483 + else {
  484 + for (var j = drag_strat; j < e; j++)
  485 + $(dls[j]).addClass('drag-active');
  486 + }
  487 + }
  488 + }).on('click', seq_nos, function () {
  489 + reset_relevance_active(this);
  490 + });
  491 + //非seq_no 单元格点击
  492 + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () {
  493 + reset_drag_active_all(this);
  494 + //选中相关班次
  495 + var id = $(this).parent().data('id'),
  496 + contWrap = $(this).parents('li.line_schedule'),
  497 + lineCode = contWrap.data('id'),
  498 + sch = line2Schedule[lineCode][id],
  499 + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) {
  500 + return item.clZbh == sch.clZbh;
  501 + }).sort(schedule_sort),
  502 + nextSch, tempDL;
  503 +
  504 + getDl(sch).addClass('intimity');
  505 + $.each(schArr, function (i) {
  506 + tempDL = $('dl[data-id=' + this.id + ']', contWrap);
  507 + tempDL.addClass('relevance-active');
  508 + if (i < schArr.length - 1 && this.id == id) {
  509 + nextSch = schArr[i + 1];
  510 + }
  511 + });
  512 +
  513 + if (nextSch) {
  514 + $('dl[data-id=' + nextSch.id + ']', contWrap).addClass('intimity');
  515 + /*if (nextSch.xlDir == sch.xlDir)
  516 + return;*/
  517 + //滚动到下一个班次
  518 + if(nextSch.xlDir != sch.xlDir)
  519 + scroToDl(nextSch);
  520 +
  521 + }
  522 +
  523 + //如果有打开轨迹回放
  524 + if($('.layui-layer.play_back-layer').is(':visible')){
  525 + gb_map_play_back.setParam(sch);
  526 + }
  527 + });
  528 +
  529 + //路牌点击
  530 + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () {
  531 + reset_drag_active_all(this);
  532 + //选中路牌下相关班次
  533 + var id = $(this).parent().data('id'),
  534 + contWrap = $(this).parents('li.line_schedule'),
  535 + lineCode = contWrap.data('id'),
  536 + sch = line2Schedule[lineCode][id],
  537 + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) {
  538 + return item.lpName == sch.lpName;
  539 + }).sort(schedule_sort);
  540 + $.each(schArr, function (i) {
  541 + $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity');
  542 + });
  543 +
  544 + //notify_succ('高亮路牌 ' + sch.lpName);
  545 + showLpMileageTip(lineCode, sch.lpName, schArr);
  546 + });
  547 +
  548 + var showLpMileageTipBySch = function (sch) {
  549 + if(!$('.mileage_elec_panel', $('.line_schedule[data-id='+sch.xlBm+']')).is(':visible'))
  550 + return;
  551 +
  552 + var schArr = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (item) {
  553 + return item.lpName == sch.lpName;
  554 + }).sort(schedule_sort);
  555 +
  556 + showLpMileageTip(sch.xlBm, sch.lpName, schArr);
  557 + };
  558 + /**
  559 + * 弹出路牌公里统计tip
  560 + * @param lineCode
  561 + * @param lpName
  562 + * @param array
  563 + */
  564 + var showLpMileageTip = function (lineCode, lpName, array) {
  565 + var wrap = $('.line_schedule[data-id='+lineCode+']');
  566 + //按驾驶员&车辆分组统计
  567 + var data=mileageTipGroupData(array);
  568 + //统计公里
  569 + var list=[];
  570 + for(var key in data){
  571 + list.push({
  572 + key : key,
  573 + serviceMileage: gb_sch_mileage_count.serviceMileage(data[key]),
  574 + destroyMileage: gb_sch_mileage_count.destroyMileage(data[key]),
  575 + emptyMileage: gb_sch_mileage_count.emptyMileage(data[key])
  576 + })
  577 + }
  578 + var htmlStr = temps['sch-lp-mileage-tip-temp']({data: list, lpName:lpName});
  579 + $('.mileage_elec_panel', wrap).html(htmlStr).addClass('uk-animation-slide-bottom').show()
  580 + .one('animationEnd', function () {
  581 + $(this).removeClass('uk-animation-slide-bottom');
  582 + });
  583 + };
  584 +
  585 + /**
  586 + * 分组数据,处理子任务里的中途换车
  587 + * @param array
  588 + */
  589 + var mileageTipGroupData = function (arr) {
  590 + var list = JSON.parse(JSON.stringify(arr));
  591 + var cts;
  592 + var zthcArray=[];
  593 + var sch;
  594 + for(var i=0,len=list.length;i<len;i++){
  595 + sch = list[i];
  596 + cts = sch['cTasks'];
  597 + if(!cts || cts.length==0)
  598 + continue;
  599 +
  600 + sch['cTasks'] = [];
  601 + //有子任务
  602 + for(var j=0,ct;ct=cts[j++];){
  603 + if(!ct.nbbm || ct.nbbm==sch.clZbh){
  604 + sch['cTasks'].push(ct);
  605 + continue;
  606 + }
  607 +
  608 + zthcArray.push(cloneByCTask(sch, ct));
  609 + }
  610 + }
  611 +
  612 + if(zthcArray.length > 0)
  613 + list = list.concat(zthcArray);
  614 +
  615 + var data={},key;
  616 + for(var i=0,len=list.length;i<len;i++){
  617 + key = list[i].clZbh+'/'+list[i].jGh+'('+list[i].jName+')';
  618 + if(!data[key])
  619 + data[key] = [];
  620 + data[key].push(list[i]);
  621 + }
  622 + return data;
  623 + };
  624 +
  625 + var cloneByCTask = function (sch, ct) {
  626 + var newObj = JSON.parse(JSON.stringify(sch));
  627 + newObj['cTasks']=[];
  628 + newObj.clZbh = ct.nbbm;
  629 + newObj.fcsjActual = ct.startDate;
  630 + newObj.zdsjActual = ct.endDate;
  631 + newObj.jhlc = ct.mileage;
  632 + newObj.jhlcOrig = ct.mileage;
  633 +
  634 + if(ct.type2=='1')
  635 + newObj.bcType='normal';
  636 + else if(ct.type2=='2'){
  637 + newObj.bcType='in';
  638 + }else if(ct.type2=='3')
  639 + newObj.bcType='out';
  640 +
  641 + return newObj;
  642 + };
  643 +
  644 + //头部点击去掉选中光标
  645 + $(document).on('click', '.header-title', function () {
  646 + reset_drag_active_all(this);
  647 + });
  648 +
  649 + var scroToDl = function (sch) {
  650 + var dl = getDl(sch),
  651 + cont = dl.parents('.ct_table_wrap'),
  652 + diff = cont.height() / 2;
  653 + cont.animate({
  654 + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff
  655 + }, 500);
  656 +
  657 + return dl;
  658 + };
  659 +
  660 + var getDl = function (sch) {
  661 + return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']'));
  662 + };
  663 +
  664 + var reset_drag_active_all = function (dd) {
  665 + $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active');
  666 + reset_relevance_active(dd);
  667 +
  668 + $('.mileage_elec_panel', $(dd).parents('.top-container')).hide().remove('uk-animation-slide-bottom');
  669 + };
  670 +
  671 + var reset_relevance_active = function (dd) {
  672 + $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity');
  673 + };
  674 +
  675 +
  676 + //计算应发未发数量 car_yfwf_map
  677 + var calc_yfwf_num = function (lineCode) {
  678 +
  679 + var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort),
  680 + yfwf_num = 0,
  681 + t = new Date().valueOf();
  682 +
  683 + var carYfwfMap = {}, nbbm;
  684 + $.each(schArr, function () {
  685 + /*if (this.dfsjT > t)
  686 + return false;*/
  687 +
  688 + if (this.dfsjT < t &&
  689 + this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) {
  690 + yfwf_num++;
  691 + nbbm = this.clZbh;
  692 + if (carYfwfMap[nbbm])
  693 + carYfwfMap[nbbm]++;
  694 + else
  695 + carYfwfMap[nbbm] = 1;
  696 + }
  697 + });
  698 + car_yfwf_map[lineCode] = carYfwfMap;
  699 +
  700 + $('#badge_yfwf_num_' + lineCode).text(yfwf_num);
  701 + };
  702 +
  703 + //标记终点时间 -线路
  704 + var markerLastByLine = function (lineCode) {
  705 + var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'lpName');
  706 +
  707 + var array, lastSch, dl;
  708 + for (var nbbm in data) {
  709 + array = data[nbbm].sort(schedule_sort);
  710 + markerLastSch(array);
  711 + }
  712 + };
  713 +
  714 + //标记终点时间 -车辆
  715 + var markerLastByNbbm = function (lineCode, nbbm) {
  716 + var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) {
  717 + return a.clZbh == nbbm && a.status != -1;
  718 + }).sort(schedule_sort);
  719 +
  720 + removeMarkers(lineCode, array);
  721 + markerLastSch(array);
  722 + };
  723 +
  724 + var markerLastSch = function (array) {
  725 + var lastSch = array[array.length - 1];
  726 +
  727 + if (!lastSch.jhlc)
  728 + return;
  729 +
  730 + var dl = getDl(lastSch);
  731 + dl.addClass('dl-last-sch');
  732 +
  733 + $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch));
  734 + };
  735 +
  736 + //清除线路下指定班次的 末班标记
  737 + var removeMarkers = function (lineCode, array) {
  738 + var idx = [];
  739 + $.each(array, function () {
  740 + idx.push(this.id);
  741 + });
  742 +
  743 + $('dl.dl-last-sch', 'li.line_schedule[data-id=' + lineCode + ']').each(function () {
  744 + if ($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))) {
  745 + $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove();
  746 + }
  747 + });
  748 + };
  749 +
  750 + var schDestroyFilter = function (a) {
  751 + return a.status != -1;
  752 + };
  753 +
  754 + /* 下一个班次 */
  755 + var getNextSch = function (sch) {
  756 + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) {
  757 + return a.clZbh == sch.clZbh;
  758 + }).sort(schedule_sort);
  759 +
  760 + for (var i = 0, item; item = array[i++];) {
  761 + if (array[i].id == sch.id) {
  762 + return i < array.length ? array[i + 1] : null;
  763 + }
  764 + }
  765 + };
  766 +
  767 + /* 下一个班次普通班次 */
  768 + var getNextNormalSch = function (sch) {
  769 +
  770 + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) {
  771 + return a.clZbh == sch.clZbh && a.bcType=='normal';
  772 + }).sort(schedule_sort);
  773 +
  774 + for (var i = 0; i < array.length; i++) {
  775 + if (array[i].id == sch.id) {
  776 + return i < array.length ? array[i + 1] : null;
  777 + }
  778 + }
  779 + };
  780 +
  781 + /** 添加备注信息 */
  782 + var addRemarks = function (list, remarks) {
  783 + //if(!list || list)
  784 + var i = 0, sch;
  785 +
  786 + (function () {
  787 + var f = arguments.callee;
  788 + if(i >= list.length){
  789 + return;
  790 + }
  791 + sch = list[i];
  792 + gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) {
  793 + if(rs.t){
  794 + sch = rs.t;
  795 + line2Schedule[sch.xlBm][sch.id] = sch;
  796 + updateDom(sch);
  797 + i++;
  798 + f();
  799 + }
  800 + });
  801 + })();
  802 + };
  803 +
  804 + /**
  805 + * 显示误点停靠时间标记
  806 + * @param id
  807 + * @param minute
  808 + */
  809 + var showLateBadge = function (lineCode, id, minute) {
  810 + var dfCell = cancelLateBadge(lineCode, id);
  811 + $(dfCell).append('<span class="late-badge">?+'+minute+'</span>');
  812 + };
  813 +
  814 + /**
  815 + * 取消误点标记
  816 + * @param lineCode
  817 + * @param id
  818 + */
  819 + var cancelLateBadge = function (lineCode, id) {
  820 + var $dl = getDl({id: id, xlBm: lineCode});
  821 + var dfCell = $dl.find('dd')[6];
  822 + $('.late-badge',dfCell).remove();
  823 + return dfCell;
  824 + };
  825 +
  826 +
  827 + /**
  828 + * 刷新页面的所有线路班次
  829 + */
  830 + var refreshAll = function () {
  831 + show();
  832 + };
  833 +
  834 + /**
  835 + * 获取线路下营运的车辆
  836 + */
  837 + var findNbbmByLineCode = function (lineCode) {
  838 + try{
  839 + return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode])));
  840 + }catch (e){
  841 + return [];
  842 + }
  843 + };
  844 +
  845 + var clearActualTime = function (sch) {
  846 + try{
  847 + sch.fcsjActual=null;
  848 + sch.fcsjActualTime=null;
  849 + sch.zdsjActual=null;
  850 + sch.zdsjActualTime=null;
  851 + }catch (e){
  852 + console.log(e);
  853 + }
  854 + };
  855 +
  856 + /**
  857 + * 班次站点编码异常信息
  858 + * @param list
  859 + */
  860 + var putSCodeErrorInfo = function (list) {
  861 + //按线路走向分组
  862 + var data = {};
  863 + var k;
  864 + for(var i=0,obj;obj=list[i++];){
  865 + k = obj.lineCode+'_'+obj.upDown;
  866 +
  867 + if(obj.realStationCode && obj.realStationCode.indexOf('^') != -1)
  868 + obj.realStationCode = obj.realStationCode.split('^')[0];
  869 +
  870 + if(!data[k])
  871 + data[k] = [];
  872 + data[k].push(obj);
  873 + }
  874 +
  875 + var wrap;
  876 + for(var k in data){
  877 + wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']');
  878 + if(wrap.length==0)
  879 + continue;
  880 +
  881 + $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap)
  882 + .html('o(* ̄▽ ̄*)o 班次和站点关联有点问题!!').show();
  883 + }
  884 +
  885 + errorCodeData = data;
  886 + };
  887 +
  888 + var findSCodeErrorInfo = function (lineCode, upDown) {
  889 + return errorCodeData[lineCode+'_'+upDown];
  890 + };
  891 +
  892 + var refreshRfid = function (sch) {
  893 + var $dl = getDl({id: sch.id, xlBm: sch.xlBm});
  894 + var dfCell = $dl.find('dd')[2];
  895 + var light = !sch.qdzArrDatesj ? 'tl-white' : 'tl-grey';
  896 + if (sch.rfidState & 1 == 1) {
  897 + light = 'tl-yellow';
  898 + if (sch.rfidState & 2 == 2) {
  899 + light = 'tl-green';
  900 + }
  901 + }
  902 + if (!(sch.bcType == 'in' || sch.bcType == 'out')) {
  903 + $(dfCell).attr('class', light);
  904 + }
  905 + };
  906 +
  907 + return {
  908 + show: show,
  909 + findScheduleByLine: findScheduleByLine,
  910 + updateSchedule: updateSchedule,
  911 + updateData: updateData,
  912 + deheteSchedule: deheteSchedule,
  913 + insertSchedule: insertSchedule,
  914 + schedule_sort: schedule_sort,
  915 + calc_yfwf_num: calc_yfwf_num,
  916 + car_yfwf_map: function (lineCode) {
  917 + return car_yfwf_map[lineCode];
  918 + },
  919 + scroToDl: scroToDl,
  920 + reset_drag_active_all: reset_drag_active_all,
  921 + getDl: getDl,
  922 + getNextSch: getNextSch,
  923 + addRemarks: addRemarks,
  924 + reLoadAndRefresh: reLoadAndRefresh,
  925 + showLateBadge: showLateBadge,
  926 + cancelLateBadge: cancelLateBadge,
  927 + refreshAll: refreshAll,
  928 + getNextNormalSch: getNextNormalSch,
  929 + findNbbmByLineCode:findNbbmByLineCode,
  930 + showLpMileageTipBySch: showLpMileageTipBySch,
  931 + renderCarRemark: renderCarRemark,
  932 + putSCodeErrorInfo: putSCodeErrorInfo,
  933 + findSCodeErrorInfo: findSCodeErrorInfo,
  934 + refreshRfid: refreshRfid
  935 + };
  936 +})();
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
1 -var gb_sch_websocket = (function () {  
2 -  
3 - var temps;  
4 - $.get('/real_control_v2/fragments/line_schedule/sys_mailbox.html', function (dom) {  
5 - temps = gb_common.compileTempByDom(dom);  
6 - });  
7 -  
8 - var schSock = null;  
9 - var recInterval = null;  
10 - var reConnSpace = 1500;//重连间隔  
11 - var reConnCount; //重连次数  
12 - var maxReConn = 6; //最多重连次数  
13 - var new_conn = function () {  
14 - schSock = new SockJS('/sockjs/realcontrol');  
15 - schSock.onopen = function (e) {  
16 - if(reConnCount && reConnCount > 1){  
17 - gb_schedule_table.refreshAll();  
18 - console.log('重新连接,刷新班次');  
19 - }  
20 - reConnCount = 1;  
21 - clearInterval(recInterval);  
22 - console.log('webSocket[realcontrol] onopen');  
23 - $('body>.north').removeClass('scok-colse');  
24 - setTimeout(regListen, 500);  
25 - };  
26 -  
27 - //接收消息  
28 - schSock.onmessage = function (e) {  
29 - try {  
30 - var jsonMsg = $.parseJSON(e.data);  
31 - msgHandle[jsonMsg.fn](jsonMsg);  
32 - } catch (e) {  
33 - console.log(e, e.data);  
34 - }  
35 - };  
36 -  
37 - //断开  
38 - schSock.onclose = function (e) {  
39 - console.log('和服务器连接断开....', e);  
40 - $('body>.north').addClass('scok-colse');  
41 - //1.5秒后重新连接  
42 - recInterval = setTimeout(function () {  
43 - reConnCount++;  
44 - if(reConnCount > maxReConn){  
45 - $('body>.north').addClass('re_conn_error');  
46 - clearInterval(recInterval);  
47 - return;  
48 - }  
49 - new_conn();  
50 - }, reConnSpace * reConnCount);  
51 - };  
52 - };  
53 -  
54 - //初始化websocket连接  
55 - new_conn();  
56 -  
57 - function regListen() {  
58 - //注册线路监听  
59 - var data = {  
60 - operCode: 'register_line',  
61 - idx: gb_data_basic.line_idx  
62 - };  
63 - schSock.send(JSON.stringify(data));  
64 - console.log('regListen....', data);  
65 - }  
66 -  
67 - /**  
68 - * 计算未处理消息  
69 - */  
70 - var calcUntreated = function (lineCode) {  
71 - var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length;  
72 - $('#badge_untreated_num_' + lineCode).text(size);  
73 - };  
74 -  
75 - var calcUntreatedAll = function () {  
76 - $('#main-tab-content li.line_schedule').each(function () {  
77 - calcUntreated($(this).data('id'));  
78 - });  
79 - };  
80 -  
81 -  
82 - //80协议上报  
83 - var report80 = function (msg) {  
84 - msg.dateStr = moment(msg.timestamp).format('HH:mm');  
85 - msg.text = gb_common.reqCode80[msg.data.requestCode];  
86 - if (!msg.text)  
87 - msg.text = '(未知的请求码 ' + msg.data.requestCode + ')';  
88 -  
89 - var $item = $(temps['sys-note-80-temp'](msg));  
90 - findMailBox(msg.data.lineId).prepend($item);  
91 - //tts  
92 - var ttsMsg = $item.find('.uk-panel-title').text();  
93 - gb_tts.speak(ttsMsg, msg.data.lineId);  
94 -  
95 - calcUntreated(msg.data.lineId);  
96 - };  
97 -  
98 - var safeDriv = function (msg) {  
99 - gb_safe_driv.pop(msg.t);  
100 - };  
101 -  
102 - /**  
103 - * 自动误点调整  
104 - * @param msg  
105 - */  
106 - var autoWdtz = function (msg) {  
107 - var schId = msg.id;  
108 - var minute = msg.minute;  
109 - var lineCode = msg.lineCode;  
110 - gb_schedule_table.showLateBadge(lineCode, schId, minute);  
111 - if(msg['cancelId']){  
112 - gb_schedule_table.cancelLateBadge(lineCode, msg['cancelId']);  
113 - }  
114 - };  
115 -  
116 - var waitRemoves = [];  
117 - //车辆发出  
118 - var faChe = function (msg) {  
119 - gb_schedule_table.updateSchedule(msg.t);  
120 - msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000);  
121 -  
122 - var $item = $(temps['sys-note-42-temp'](msg));  
123 - findMailBox(msg.t.xlBm).prepend($item);  
124 - waitRemoves.push({  
125 - t: currentSecond(),  
126 - dom: msg.domId  
127 - });  
128 -  
129 - //tts  
130 - var ttsMsg = $item.find('.title').text();  
131 - gb_tts.speak(ttsMsg, msg.t.xlBm);  
132 - gb_schedule_table.calc_yfwf_num(msg.t.xlBm);  
133 -  
134 - calcUntreated(msg.t.xlBm);  
135 - };  
136 -  
137 - //到达终点  
138 - var zhongDian = function (msg) {  
139 - gb_schedule_table.updateSchedule(msg.t);  
140 - gb_schedule_table.updateSchedule(msg.nt);  
141 - msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000);  
142 -  
143 - var $item = $(temps['sys-note-42_1-temp'](msg));  
144 - findMailBox(msg.t.xlBm).prepend($item);  
145 - waitRemoves.push({  
146 - t: currentSecond(),  
147 - dom: msg.domId  
148 - });  
149 - //tts  
150 - var ttsMsg = $item.find('.title').text();  
151 - gb_tts.speak(ttsMsg, msg.t.xlBm);  
152 -  
153 - calcUntreated(msg.t.xlBm);  
154 - //更新路牌公里统计面板  
155 - gb_schedule_table.showLpMileageTipBySch(msg.t);  
156 - };  
157 -  
158 - //服务器通知刷新班次  
159 - var refreshSch = function (msg) {  
160 - gb_schedule_table.updateSchedule(msg.ts);  
161 - /*//重新计算应发未发  
162 - var idx={};  
163 - $.each(msg.ts, function(i, t){  
164 - if(idx[t.xlBm])  
165 - return true;  
166 - gb_schedule_table.calc_yfwf_num(t.xlBm);  
167 - idx[t.xlBm]=1;  
168 - });*/  
169 - };  
170 -  
171 - //80消息确认  
172 - var d80Confirm = function (msg) {  
173 - $('.sys-mailbox .sys-note-80[data-id=' + msg.id + ']').remove();  
174 - //重新计算未读消息  
175 - calcUntreated(msg.lineId);  
176 - //重新计算应发未发  
177 - gb_schedule_table.calc_yfwf_num(msg.lineId);  
178 - };  
179 -  
180 - //指令状态改变  
181 - var directiveStatus = function (msg) {  
182 - gb_schedule_table.updateSchedule(msg.t);  
183 - };  
184 -  
185 - //班次信号状态  
186 - var signalState = function (msg) {  
187 - gb_signal_state.put(msg.data);  
188 - };  
189 -  
190 - var msgHandle = {  
191 - report80: report80,  
192 - faChe: faChe,  
193 - zhongDian: zhongDian,  
194 - refreshSch: refreshSch,  
195 - d80Confirm: d80Confirm,  
196 - directive: directiveStatus,  
197 - signal_state: signalState,  
198 - deviceOffline: deviceOffline,  
199 - safeDriv: safeDriv,  
200 - auto_wdtz: autoWdtz  
201 - };  
202 -  
203 - function currentSecond() {  
204 - return Date.parse(new Date()) / 1000;  
205 - }  
206 -  
207 - var mailBoxs = {};  
208 -  
209 - function findMailBox(lineCode) {  
210 - if (mailBoxs[lineCode])  
211 - return mailBoxs[lineCode];  
212 -  
213 - var mbox = $('li.line_schedule[data-id=' + lineCode + ']').find('div.sys-mailbox');  
214 - mailBoxs[lineCode] = mbox;  
215 - return mbox;  
216 - }  
217 -  
218 -  
219 - //42确定  
220 - $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function (e) {  
221 - e.stopPropagation();  
222 - $(this).parents('.sys-note-42').remove();  
223 - var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length  
224 - , lineCode = $(this).data('line');  
225 -  
226 - $('#badge_untreated_num_' + lineCode).text(size);  
227 - });  
228 -  
229 - //42消息点击  
230 - $(document).on('click', '.sys-mailbox .sys-note-42', function () {  
231 - var lineCode = $(this).parents('li.line_schedule').data('id')  
232 - , id = $(this).data('id');  
233 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];  
234 - var dl = gb_schedule_table.scroToDl(sch);  
235 - //高亮  
236 - gb_schedule_table.reset_drag_active_all(dl);  
237 - dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');  
238 - });  
239 -  
240 - //80消息点击  
241 - $(document).on('click', '.sys-mailbox .sys-note-80', function () {  
242 - var lineCode = $(this).parents('li.line_schedule').data('id')  
243 - , id = $(this).data('schid');  
244 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];  
245 - var dl = gb_schedule_table.scroToDl(sch);  
246 - //高亮  
247 - gb_schedule_table.reset_drag_active_all(dl);  
248 - dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');  
249 - });  
250 -  
251 - //80同意  
252 - $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function (e) {  
253 - e.stopPropagation();  
254 - $(this).attr('disabled', 'disabled');  
255 - var panel = $(this).parents('.sys-note-80')  
256 - , id = panel.data('id');  
257 -  
258 - reply80({id: id, reply: 0});  
259 - return false;  
260 - });  
261 -  
262 - //80不同意  
263 - $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function (e) {  
264 - e.stopPropagation();  
265 - $(this).attr('disabled', 'disabled');  
266 - var panel = $(this).parents('.sys-note-80')  
267 - , id = panel.data('id');  
268 -  
269 - reply80({id: id, reply: -1});  
270 - return false;  
271 - });  
272 -  
273 - var reply80 = function (data, cb) {  
274 - gb_common.$post('/directive/reply80', data, function (rs) {  
275 - if (rs.msg)  
276 - notify_succ(rs.msg);  
277 - cb && cb();  
278 - });  
279 - };  
280 -  
281 -  
282 - //定时到离站信使清理掉  
283 - !function () {  
284 - var f = arguments.callee,  
285 - ct = Date.parse(new Date()) / 1000,  
286 - item, elem;  
287 - try {  
288 - for (var i = 0; i < 1000; i++) {  
289 - if (waitRemoves.length == 0)  
290 - break;  
291 - item = waitRemoves[0];  
292 - if (ct - item.t >= 30) {  
293 - waitRemoves.shift();  
294 - elem = $('#' + item.dom);  
295 - if (elem)  
296 - elem.remove();  
297 - }  
298 - }  
299 - } catch (e) {  
300 - console.log(e);  
301 - }  
302 -  
303 - //计算未读消息  
304 - calcUntreatedAll();  
305 - setTimeout(f, 5000);  
306 - }();  
307 -  
308 - /**  
309 - * 设备掉线  
310 - * @param msg  
311 - */  
312 - function deviceOffline(msg) {  
313 - gb_data_gps.deviceOffline(msg.gps);  
314 - }  
315 -  
316 - /**  
317 - * 信号撤销  
318 - */  
319 - $(document).on('click','.sys-note-42 .cancel_link', function () {  
320 - var id = $(this).data('id'),  
321 - lineCode = $(this).data('line');  
322 -  
323 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];  
324 - if(!sch)  
325 - return;  
326 -  
327 - var confirmBtn = $(this).parent().find('.uk-button-primary');  
328 - var type = $(this).data('type');  
329 - var fun = type==1?gb_schedule_context_menu.cxzx:gb_schedule_context_menu.cxsf;  
330 -  
331 - fun(sch, function () {  
332 - confirmBtn.trigger('click');  
333 - });  
334 - });  
335 -  
336 - /**  
337 - * 到站信号修改  
338 - */  
339 - $(document).on('click', '.sys-note-42 .edit_link', function () {  
340 - var id = $(this).data('id'),  
341 - lineCode = $(this).data('line');  
342 -  
343 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];  
344 - if(!sch)  
345 - return;  
346 -  
347 - var nextSch = gb_schedule_table.getNextSch(sch);  
348 - gb_schedule_context_menu.dftz(nextSch);  
349 - });  
350 -  
351 - /**  
352 - * 信使 sys-note-80 编辑  
353 - */  
354 - $(document).on('click', '.sys-note-80 .edit_link', function () {  
355 - var id = $(this).data('id'),  
356 - lineCode = $(this).data('line');  
357 -  
358 - var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];  
359 - if(!sch)  
360 - return;  
361 -  
362 - gb_schedule_context_menu.fcxxwt(sch);  
363 - });  
364 -  
365 - return {  
366 - sock: function () {  
367 - return schSock;  
368 - }  
369 - };  
370 -})(); 1 +var gb_sch_websocket = (function () {
  2 +
  3 + var temps;
  4 + $.get('/real_control_v2/fragments/line_schedule/sys_mailbox.html', function (dom) {
  5 + temps = gb_common.compileTempByDom(dom);
  6 + });
  7 +
  8 + var schSock = null;
  9 + var recInterval = null;
  10 + var reConnSpace = 1500;//重连间隔
  11 + var reConnCount; //重连次数
  12 + var maxReConn = 6; //最多重连次数
  13 + var new_conn = function () {
  14 + schSock = new SockJS('/sockjs/realcontrol');
  15 + schSock.onopen = function (e) {
  16 + if(reConnCount && reConnCount > 1){
  17 + gb_schedule_table.refreshAll();
  18 + console.log('重新连接,刷新班次');
  19 + }
  20 + reConnCount = 1;
  21 + clearInterval(recInterval);
  22 + console.log('webSocket[realcontrol] onopen');
  23 + $('body>.north').removeClass('scok-colse');
  24 + setTimeout(regListen, 500);
  25 + };
  26 +
  27 + //接收消息
  28 + schSock.onmessage = function (e) {
  29 + try {
  30 + var jsonMsg = $.parseJSON(e.data);
  31 + msgHandle[jsonMsg.fn](jsonMsg);
  32 + } catch (e) {
  33 + console.log(e, e.data);
  34 + }
  35 + };
  36 +
  37 + //断开
  38 + schSock.onclose = function (e) {
  39 + console.log('和服务器连接断开....', e);
  40 + $('body>.north').addClass('scok-colse');
  41 + //1.5秒后重新连接
  42 + recInterval = setTimeout(function () {
  43 + reConnCount++;
  44 + if(reConnCount > maxReConn){
  45 + $('body>.north').addClass('re_conn_error');
  46 + clearInterval(recInterval);
  47 + return;
  48 + }
  49 + new_conn();
  50 + }, reConnSpace * reConnCount);
  51 + };
  52 + };
  53 +
  54 + //初始化websocket连接
  55 + new_conn();
  56 +
  57 + function regListen() {
  58 + //注册线路监听
  59 + var data = {
  60 + operCode: 'register_line',
  61 + idx: gb_data_basic.line_idx
  62 + };
  63 + schSock.send(JSON.stringify(data));
  64 + console.log('regListen....', data);
  65 + }
  66 +
  67 + /**
  68 + * 计算未处理消息
  69 + */
  70 + var calcUntreated = function (lineCode) {
  71 + var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length;
  72 + $('#badge_untreated_num_' + lineCode).text(size);
  73 + };
  74 +
  75 + var calcUntreatedAll = function () {
  76 + $('#main-tab-content li.line_schedule').each(function () {
  77 + calcUntreated($(this).data('id'));
  78 + });
  79 + };
  80 +
  81 +
  82 + //80协议上报
  83 + var report80 = function (msg) {
  84 + msg.dateStr = moment(msg.timestamp).format('HH:mm');
  85 + msg.text = gb_common.reqCode80[msg.data.requestCode];
  86 + if (!msg.text)
  87 + msg.text = '(未知的请求码 ' + msg.data.requestCode + ')';
  88 +
  89 + var $item = $(temps['sys-note-80-temp'](msg));
  90 + findMailBox(msg.data.lineId).prepend($item);
  91 + //tts
  92 + var ttsMsg = $item.find('.uk-panel-title').text();
  93 + gb_tts.speak(ttsMsg, msg.data.lineId);
  94 +
  95 + calcUntreated(msg.data.lineId);
  96 + };
  97 +
  98 + var safeDriv = function (msg) {
  99 + gb_safe_driv.pop(msg.t);
  100 + };
  101 +
  102 + /**
  103 + * 自动误点调整
  104 + * @param msg
  105 + */
  106 + var autoWdtz = function (msg) {
  107 + var schId = msg.id;
  108 + var minute = msg.minute;
  109 + var lineCode = msg.lineCode;
  110 + gb_schedule_table.showLateBadge(lineCode, schId, minute);
  111 + if(msg['cancelId']){
  112 + gb_schedule_table.cancelLateBadge(lineCode, msg['cancelId']);
  113 + }
  114 + };
  115 +
  116 + var waitRemoves = [];
  117 + //车辆发出
  118 + var faChe = function (msg) {
  119 + gb_schedule_table.updateSchedule(msg.t);
  120 + msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000);
  121 +
  122 + var $item = $(temps['sys-note-42-temp'](msg));
  123 + findMailBox(msg.t.xlBm).prepend($item);
  124 + waitRemoves.push({
  125 + t: currentSecond(),
  126 + dom: msg.domId
  127 + });
  128 +
  129 + //tts
  130 + var ttsMsg = $item.find('.title').text();
  131 + gb_tts.speak(ttsMsg, msg.t.xlBm);
  132 + gb_schedule_table.calc_yfwf_num(msg.t.xlBm);
  133 +
  134 + calcUntreated(msg.t.xlBm);
  135 + };
  136 +
  137 + //到达终点
  138 + var zhongDian = function (msg) {
  139 + gb_schedule_table.updateSchedule(msg.t);
  140 + gb_schedule_table.updateSchedule(msg.nt);
  141 + msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000);
  142 +
  143 + var $item = $(temps['sys-note-42_1-temp'](msg));
  144 + findMailBox(msg.t.xlBm).prepend($item);
  145 + waitRemoves.push({
  146 + t: currentSecond(),
  147 + dom: msg.domId
  148 + });
  149 + //tts
  150 + var ttsMsg = $item.find('.title').text();
  151 + gb_tts.speak(ttsMsg, msg.t.xlBm);
  152 +
  153 + calcUntreated(msg.t.xlBm);
  154 + //更新路牌公里统计面板
  155 + gb_schedule_table.showLpMileageTipBySch(msg.t);
  156 + };
  157 +
  158 + //服务器通知刷新班次
  159 + var refreshSch = function (msg) {
  160 + gb_schedule_table.updateSchedule(msg.ts);
  161 + /*//重新计算应发未发
  162 + var idx={};
  163 + $.each(msg.ts, function(i, t){
  164 + if(idx[t.xlBm])
  165 + return true;
  166 + gb_schedule_table.calc_yfwf_num(t.xlBm);
  167 + idx[t.xlBm]=1;
  168 + });*/
  169 + };
  170 +
  171 + //80消息确认
  172 + var d80Confirm = function (msg) {
  173 + $('.sys-mailbox .sys-note-80[data-id=' + msg.id + ']').remove();
  174 + //重新计算未读消息
  175 + calcUntreated(msg.lineId);
  176 + //重新计算应发未发
  177 + gb_schedule_table.calc_yfwf_num(msg.lineId);
  178 + };
  179 +
  180 + //指令状态改变
  181 + var directiveStatus = function (msg) {
  182 + gb_schedule_table.updateSchedule(msg.t);
  183 + };
  184 +
  185 + //班次信号状态
  186 + var signalState = function (msg) {
  187 + gb_signal_state.put(msg.data);
  188 + };
  189 +
  190 + //rfid状态
  191 + var refreshRfid = function(msg) {
  192 + gb_schedule_table.refreshRfid(msg.data);
  193 + };
  194 +
  195 + var msgHandle = {
  196 + report80: report80,
  197 + faChe: faChe,
  198 + zhongDian: zhongDian,
  199 + refreshSch: refreshSch,
  200 + d80Confirm: d80Confirm,
  201 + directive: directiveStatus,
  202 + signal_state: signalState,
  203 + deviceOffline: deviceOffline,
  204 + safeDriv: safeDriv,
  205 + auto_wdtz: autoWdtz,
  206 + rfid: refreshRfid
  207 + };
  208 +
  209 + function currentSecond() {
  210 + return Date.parse(new Date()) / 1000;
  211 + }
  212 +
  213 + var mailBoxs = {};
  214 +
  215 + function findMailBox(lineCode) {
  216 + if (mailBoxs[lineCode])
  217 + return mailBoxs[lineCode];
  218 +
  219 + var mbox = $('li.line_schedule[data-id=' + lineCode + ']').find('div.sys-mailbox');
  220 + mailBoxs[lineCode] = mbox;
  221 + return mbox;
  222 + }
  223 +
  224 +
  225 + //42确定
  226 + $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function (e) {
  227 + e.stopPropagation();
  228 + $(this).parents('.sys-note-42').remove();
  229 + var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length
  230 + , lineCode = $(this).data('line');
  231 +
  232 + $('#badge_untreated_num_' + lineCode).text(size);
  233 + });
  234 +
  235 + //42消息点击
  236 + $(document).on('click', '.sys-mailbox .sys-note-42', function () {
  237 + var lineCode = $(this).parents('li.line_schedule').data('id')
  238 + , id = $(this).data('id');
  239 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  240 + var dl = gb_schedule_table.scroToDl(sch);
  241 + //高亮
  242 + gb_schedule_table.reset_drag_active_all(dl);
  243 + dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
  244 + });
  245 +
  246 + //80消息点击
  247 + $(document).on('click', '.sys-mailbox .sys-note-80', function () {
  248 + var lineCode = $(this).parents('li.line_schedule').data('id')
  249 + , id = $(this).data('schid');
  250 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  251 + var dl = gb_schedule_table.scroToDl(sch);
  252 + //高亮
  253 + gb_schedule_table.reset_drag_active_all(dl);
  254 + dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
  255 + });
  256 +
  257 + //80同意
  258 + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function (e) {
  259 + e.stopPropagation();
  260 + $(this).attr('disabled', 'disabled');
  261 + var panel = $(this).parents('.sys-note-80')
  262 + , id = panel.data('id');
  263 +
  264 + reply80({id: id, reply: 0});
  265 + return false;
  266 + });
  267 +
  268 + //80不同意
  269 + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function (e) {
  270 + e.stopPropagation();
  271 + $(this).attr('disabled', 'disabled');
  272 + var panel = $(this).parents('.sys-note-80')
  273 + , id = panel.data('id');
  274 +
  275 + reply80({id: id, reply: -1});
  276 + return false;
  277 + });
  278 +
  279 + var reply80 = function (data, cb) {
  280 + gb_common.$post('/directive/reply80', data, function (rs) {
  281 + if (rs.msg)
  282 + notify_succ(rs.msg);
  283 + cb && cb();
  284 + });
  285 + };
  286 +
  287 +
  288 + //定时到离站信使清理掉
  289 + !function () {
  290 + var f = arguments.callee,
  291 + ct = Date.parse(new Date()) / 1000,
  292 + item, elem;
  293 + try {
  294 + for (var i = 0; i < 1000; i++) {
  295 + if (waitRemoves.length == 0)
  296 + break;
  297 + item = waitRemoves[0];
  298 + if (ct - item.t >= 30) {
  299 + waitRemoves.shift();
  300 + elem = $('#' + item.dom);
  301 + if (elem)
  302 + elem.remove();
  303 + }
  304 + }
  305 + } catch (e) {
  306 + console.log(e);
  307 + }
  308 +
  309 + //计算未读消息
  310 + calcUntreatedAll();
  311 + setTimeout(f, 5000);
  312 + }();
  313 +
  314 + /**
  315 + * 设备掉线
  316 + * @param msg
  317 + */
  318 + function deviceOffline(msg) {
  319 + gb_data_gps.deviceOffline(msg.gps);
  320 + }
  321 +
  322 + /**
  323 + * 信号撤销
  324 + */
  325 + $(document).on('click','.sys-note-42 .cancel_link', function () {
  326 + var id = $(this).data('id'),
  327 + lineCode = $(this).data('line');
  328 +
  329 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  330 + if(!sch)
  331 + return;
  332 +
  333 + var confirmBtn = $(this).parent().find('.uk-button-primary');
  334 + var type = $(this).data('type');
  335 + var fun = type==1?gb_schedule_context_menu.cxzx:gb_schedule_context_menu.cxsf;
  336 +
  337 + fun(sch, function () {
  338 + confirmBtn.trigger('click');
  339 + });
  340 + });
  341 +
  342 + /**
  343 + * 到站信号修改
  344 + */
  345 + $(document).on('click', '.sys-note-42 .edit_link', function () {
  346 + var id = $(this).data('id'),
  347 + lineCode = $(this).data('line');
  348 +
  349 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  350 + if(!sch)
  351 + return;
  352 +
  353 + var nextSch = gb_schedule_table.getNextSch(sch);
  354 + gb_schedule_context_menu.dftz(nextSch);
  355 + });
  356 +
  357 + /**
  358 + * 信使 sys-note-80 编辑
  359 + */
  360 + $(document).on('click', '.sys-note-80 .edit_link', function () {
  361 + var id = $(this).data('id'),
  362 + lineCode = $(this).data('line');
  363 +
  364 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  365 + if(!sch)
  366 + return;
  367 +
  368 + gb_schedule_context_menu.fcxxwt(sch);
  369 + });
  370 +
  371 + return {
  372 + sock: function () {
  373 + return schSock;
  374 + }
  375 + };
  376 +})();