Commit 34ca053f5500543b0e89623416efb7a4062c57d2

Authored by 潘钊
1 parent b1f60e76

update...

src/main/java/com/bsth/websocket/entity/WsScheduleRealInfo.java deleted 100644 → 0
1   -package com.bsth.websocket.entity;
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.ArrayList;
10   -import java.util.HashSet;
11   -import java.util.List;
12   -import java.util.Set;
13   -
14   -/**
15   - * 精简字段的实际排班 entity
16   - * webSocket 传输用,去掉了页面不需要的一些字段
17   - * Created by panzhao on 2017/11/14.
18   - */
19   -public class WsScheduleRealInfo {
20   -
21   - public static WsScheduleRealInfo getInstance(ScheduleRealInfo sch){
22   - if(null == sch)
23   - return null;
24   - WsScheduleRealInfo wss = new WsScheduleRealInfo();
25   - wss.id = sch.getId();
26   - wss.scheduleDateStr = sch.getScheduleDateStr();
27   - wss.realExecDate = sch.getRealExecDate();
28   - wss.xlName = sch.getXlName();
29   - wss.xlBm = sch.getXlBm();
30   - wss.lpName = sch.getLpName();
31   - wss.clZbh = sch.getClZbh();
32   - wss.jGh = sch.getjGh();
33   - wss.jName = sch.getjName();
34   - wss.sGh = sch.getsGh();
35   - wss.sName = sch.getsName();
36   - wss.xlDir = sch.getXlDir();
37   - wss.qdzCode = sch.getQdzCode();
38   - wss.qdzName = sch.getQdzName();
39   - wss.zdzCode = sch.getZdzCode();
40   - wss.zdzName = sch.getZdzName();
41   - wss.fcsj = sch.getFcsj();
42   - wss.fcsjT = sch.getFcsjT();
43   - wss.zdsj = sch.getZdsj();
44   - wss.zdsjT = sch.getZdsjT();
45   - wss.jhlc = sch.getJhlc();
46   - wss.jhlcOrig = sch.getJhlcOrig();
47   - wss.bcsj = sch.getBcsj();
48   - wss.bcType = sch.getBcType();
49   - wss.majorStationName = sch.getMajorStationName();
50   - wss.fcsjActual = sch.getFcsjActual();
51   - wss.fcsjActualTime = sch.getFcsjActualTime();
52   - wss.zdsjActual = sch.getZdsjActual();
53   - wss.zdsjActualTime = sch.getZdsjActualTime();
54   - wss.status = sch.getStatus();
55   - wss.adjustExps = sch.getAdjustExps();
56   - wss.sflj = sch.isSflj();
57   - wss.late = sch.isLate();
58   - wss.late2 = sch.isLate2();
59   - wss.lateMinute = sch.getLateMinute();
60   - wss.remarks = sch.getRemarks();
61   - wss.dfsj = sch.getDfsj();
62   - wss.dfsjT = sch.getDfsjT();
63   - wss.directiveState = sch.getDirectiveState();
64   - wss.qdzArrDatejh = sch.getQdzArrDatejh();
65   - wss.qdzArrDatesj = sch.getQdzArrDatesj();
66   - wss.cTasks = sch.getcTasks();
67   - wss.gsName = sch.getGsName();
68   - wss.gsBm = sch.getGsBm();
69   - wss.fgsName = sch.getFgsName();
70   - wss.fgsBm = sch.getFgsBm();
71   - wss.dfAuto = sch.isDfAuto();
72   - wss.online = sch.isOnline();
73   - wss.reissue = sch.isReissue();
74   - wss.driftStatus = sch.getDriftStatus();
75   - wss.ccService = sch.isCcService();
76   - return wss;
77   - }
78   -
79   -
80   - public static List<WsScheduleRealInfo> getMultiInstance(List<ScheduleRealInfo> list){
81   - List<WsScheduleRealInfo> rs = new ArrayList<>();
82   - for(ScheduleRealInfo sch : list){
83   - rs.add(getInstance(sch));
84   - }
85   - return rs;
86   - }
87   -
88   - /** 主键Id */
89   - private Long id;
90   -
91   - /** 排班日期字符串 YYYY-MM-DD */
92   - private String scheduleDateStr;
93   -
94   - /** 真实执行时间 yyyy-MM-dd */
95   - private String realExecDate;
96   -
97   - /** 线路名称 */
98   - private String xlName;
99   - /** 线路编码 */
100   - private String xlBm;
101   -
102   - /** 路牌名称 */
103   - private String lpName;
104   -
105   - /** 车辆自编号 */
106   - private String clZbh;
107   -
108   - /** 驾驶员工号 */
109   - private String jGh;
110   - /** 驾驶员名字 */
111   - private String jName;
112   - /** 售票员工号 */
113   - private String sGh;
114   - /** 售票员名字 */
115   - private String sName;
116   -
117   - /** 线路方向 */
118   - private String xlDir;
119   - /** 起点站code*/
120   - private String qdzCode;
121   - /** 起点站名字 */
122   - private String qdzName;
123   -
124   - /** 终点站code*/
125   - private String zdzCode;
126   - /** 终点站名字 */
127   - private String zdzName;
128   -
129   - /** 计划发车时间(格式 HH:mm) */
130   - private String fcsj;
131   - /** 计划发车时间戳*/
132   - @Transient
133   - private Long fcsjT;
134   -
135   - /** 计划终点时间(格式 HH:mm) */
136   - private String zdsj;
137   - /** 计划终点时间戳*/
138   - @Transient
139   - private Long zdsjT;
140   -
141   - /** 计划里程 */
142   - private Double jhlc;
143   -
144   - /** 原始计划里程 (原计调的数据) */
145   - private Double jhlcOrig;
146   - /** 班次历时 */
147   - private Integer bcsj;
148   -
149   - /**
150   - * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
151   - */
152   - private String bcType;
153   -
154   - //放站班次 站点名称
155   - private String majorStationName;
156   -
157   - /** 实际发车时间*/
158   - private String fcsjActual;
159   - /** 实际发车时间戳*/
160   - @Transient
161   - private Long fcsjActualTime;
162   - /**实际终点时间 */
163   - private String zdsjActual;
164   - /** 实际终点时间戳*/
165   - @Transient
166   - private Long zdsjActualTime;
167   -
168   - /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
169   - private int status;
170   -
171   - private String adjustExps;
172   -
173   - /** 是否是临加班次 */
174   - private boolean sflj;
175   -
176   - /** 是否误点 (应发未发)*/
177   - @Transient
178   - private boolean late;
179   -
180   - /** 是否误点 (应发未到) */
181   - @Transient
182   - private boolean late2;
183   - /** 误点停靠时间 */
184   - @Transient
185   - private float lateMinute;
186   -
187   - /** 备注*/
188   - private String remarks;
189   -
190   - /**待发时间(格式 HH:mm) */
191   - private String dfsj;
192   -
193   - /**待发时间戳 */
194   - @Transient
195   - private Long dfsjT;
196   -
197   - /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
198   - private Integer directiveState = -1;
199   -
200   - /** 起点站计划到达时间 */
201   - @Transient
202   - private String qdzArrDatejh;
203   -
204   - /** 起点站实际到达时间 */
205   - @Transient
206   - private String qdzArrDatesj;
207   -
208   - /** 子任务 */
209   - @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
210   - private Set<ChildTaskPlan> cTasks = new HashSet<>();
211   -
212   - /** 关联的公司名称 */
213   - private String gsName;
214   - /** 关联的公司编码 */
215   - private String gsBm;
216   - /** 关联的分公司名称 */
217   - private String fgsName;
218   - /** 关联的分公司编码 */
219   - private String fgsBm;
220   -
221   - //待发调试(是否自动调整)
222   - private boolean dfAuto;
223   - //是否有GPS信号
224   - private boolean online;
225   -
226   - /** 是否有补发GPS信号 */
227   - private boolean reissue;
228   -
229   - /**
230   - * 漂移状态
231   - * 1: 发车漂移
232   - * 2:到站漂移
233   - * 3:中途漂移
234   - */
235   - private Integer driftStatus = 0;
236   -
237   - /**
238   - * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
239   - */
240   - private boolean ccService;
241   -
242   - public Long getId() {
243   - return id;
244   - }
245   -
246   - public void setId(Long id) {
247   - this.id = id;
248   - }
249   -
250   - public String getScheduleDateStr() {
251   - return scheduleDateStr;
252   - }
253   -
254   - public void setScheduleDateStr(String scheduleDateStr) {
255   - this.scheduleDateStr = scheduleDateStr;
256   - }
257   -
258   - public String getRealExecDate() {
259   - return realExecDate;
260   - }
261   -
262   - public void setRealExecDate(String realExecDate) {
263   - this.realExecDate = realExecDate;
264   - }
265   -
266   - public String getXlName() {
267   - return xlName;
268   - }
269   -
270   - public void setXlName(String xlName) {
271   - this.xlName = xlName;
272   - }
273   -
274   - public String getXlBm() {
275   - return xlBm;
276   - }
277   -
278   - public void setXlBm(String xlBm) {
279   - this.xlBm = xlBm;
280   - }
281   -
282   - public String getLpName() {
283   - return lpName;
284   - }
285   -
286   - public void setLpName(String lpName) {
287   - this.lpName = lpName;
288   - }
289   -
290   - public String getClZbh() {
291   - return clZbh;
292   - }
293   -
294   - public void setClZbh(String clZbh) {
295   - this.clZbh = clZbh;
296   - }
297   -
298   - public String getjGh() {
299   - return jGh;
300   - }
301   -
302   - public void setjGh(String jGh) {
303   - this.jGh = jGh;
304   - }
305   -
306   - public String getjName() {
307   - return jName;
308   - }
309   -
310   - public void setjName(String jName) {
311   - this.jName = jName;
312   - }
313   -
314   - public String getsGh() {
315   - return sGh;
316   - }
317   -
318   - public void setsGh(String sGh) {
319   - this.sGh = sGh;
320   - }
321   -
322   - public String getsName() {
323   - return sName;
324   - }
325   -
326   - public void setsName(String sName) {
327   - this.sName = sName;
328   - }
329   -
330   - public String getXlDir() {
331   - return xlDir;
332   - }
333   -
334   - public void setXlDir(String xlDir) {
335   - this.xlDir = xlDir;
336   - }
337   -
338   - public String getQdzCode() {
339   - return qdzCode;
340   - }
341   -
342   - public void setQdzCode(String qdzCode) {
343   - this.qdzCode = qdzCode;
344   - }
345   -
346   - public String getQdzName() {
347   - return qdzName;
348   - }
349   -
350   - public void setQdzName(String qdzName) {
351   - this.qdzName = qdzName;
352   - }
353   -
354   - public String getZdzCode() {
355   - return zdzCode;
356   - }
357   -
358   - public void setZdzCode(String zdzCode) {
359   - this.zdzCode = zdzCode;
360   - }
361   -
362   - public String getZdzName() {
363   - return zdzName;
364   - }
365   -
366   - public void setZdzName(String zdzName) {
367   - this.zdzName = zdzName;
368   - }
369   -
370   - public String getFcsj() {
371   - return fcsj;
372   - }
373   -
374   - public void setFcsj(String fcsj) {
375   - this.fcsj = fcsj;
376   - }
377   -
378   - public Long getFcsjT() {
379   - return fcsjT;
380   - }
381   -
382   - public void setFcsjT(Long fcsjT) {
383   - this.fcsjT = fcsjT;
384   - }
385   -
386   - public String getZdsj() {
387   - return zdsj;
388   - }
389   -
390   - public void setZdsj(String zdsj) {
391   - this.zdsj = zdsj;
392   - }
393   -
394   - public Long getZdsjT() {
395   - return zdsjT;
396   - }
397   -
398   - public void setZdsjT(Long zdsjT) {
399   - this.zdsjT = zdsjT;
400   - }
401   -
402   - public Double getJhlc() {
403   - return jhlc;
404   - }
405   -
406   - public void setJhlc(Double jhlc) {
407   - this.jhlc = jhlc;
408   - }
409   -
410   - public Double getJhlcOrig() {
411   - return jhlcOrig;
412   - }
413   -
414   - public void setJhlcOrig(Double jhlcOrig) {
415   - this.jhlcOrig = jhlcOrig;
416   - }
417   -
418   - public Integer getBcsj() {
419   - return bcsj;
420   - }
421   -
422   - public void setBcsj(Integer bcsj) {
423   - this.bcsj = bcsj;
424   - }
425   -
426   - public String getBcType() {
427   - return bcType;
428   - }
429   -
430   - public void setBcType(String bcType) {
431   - this.bcType = bcType;
432   - }
433   -
434   - public String getMajorStationName() {
435   - return majorStationName;
436   - }
437   -
438   - public void setMajorStationName(String majorStationName) {
439   - this.majorStationName = majorStationName;
440   - }
441   -
442   - public String getFcsjActual() {
443   - return fcsjActual;
444   - }
445   -
446   - public void setFcsjActual(String fcsjActual) {
447   - this.fcsjActual = fcsjActual;
448   - }
449   -
450   - public Long getFcsjActualTime() {
451   - return fcsjActualTime;
452   - }
453   -
454   - public void setFcsjActualTime(Long fcsjActualTime) {
455   - this.fcsjActualTime = fcsjActualTime;
456   - }
457   -
458   - public String getZdsjActual() {
459   - return zdsjActual;
460   - }
461   -
462   - public void setZdsjActual(String zdsjActual) {
463   - this.zdsjActual = zdsjActual;
464   - }
465   -
466   - public Long getZdsjActualTime() {
467   - return zdsjActualTime;
468   - }
469   -
470   - public void setZdsjActualTime(Long zdsjActualTime) {
471   - this.zdsjActualTime = zdsjActualTime;
472   - }
473   -
474   - public int getStatus() {
475   - return status;
476   - }
477   -
478   - public void setStatus(int status) {
479   - this.status = status;
480   - }
481   -
482   - public String getAdjustExps() {
483   - return adjustExps;
484   - }
485   -
486   - public void setAdjustExps(String adjustExps) {
487   - this.adjustExps = adjustExps;
488   - }
489   -
490   - public boolean isSflj() {
491   - return sflj;
492   - }
493   -
494   - public void setSflj(boolean sflj) {
495   - this.sflj = sflj;
496   - }
497   -
498   - public boolean isLate() {
499   - return late;
500   - }
501   -
502   - public void setLate(boolean late) {
503   - this.late = late;
504   - }
505   -
506   - public boolean isLate2() {
507   - return late2;
508   - }
509   -
510   - public void setLate2(boolean late2) {
511   - this.late2 = late2;
512   - }
513   -
514   - public float getLateMinute() {
515   - return lateMinute;
516   - }
517   -
518   - public void setLateMinute(float lateMinute) {
519   - this.lateMinute = lateMinute;
520   - }
521   -
522   - public String getRemarks() {
523   - return remarks;
524   - }
525   -
526   - public void setRemarks(String remarks) {
527   - this.remarks = remarks;
528   - }
529   -
530   - public String getDfsj() {
531   - return dfsj;
532   - }
533   -
534   - public void setDfsj(String dfsj) {
535   - this.dfsj = dfsj;
536   - }
537   -
538   - public Long getDfsjT() {
539   - return dfsjT;
540   - }
541   -
542   - public void setDfsjT(Long dfsjT) {
543   - this.dfsjT = dfsjT;
544   - }
545   -
546   - public Integer getDirectiveState() {
547   - return directiveState;
548   - }
549   -
550   - public void setDirectiveState(Integer directiveState) {
551   - this.directiveState = directiveState;
552   - }
553   -
554   - public String getQdzArrDatejh() {
555   - return qdzArrDatejh;
556   - }
557   -
558   - public void setQdzArrDatejh(String qdzArrDatejh) {
559   - this.qdzArrDatejh = qdzArrDatejh;
560   - }
561   -
562   - public String getQdzArrDatesj() {
563   - return qdzArrDatesj;
564   - }
565   -
566   - public void setQdzArrDatesj(String qdzArrDatesj) {
567   - this.qdzArrDatesj = qdzArrDatesj;
568   - }
569   -
570   - public Set<ChildTaskPlan> getcTasks() {
571   - return cTasks;
572   - }
573   -
574   - public void setcTasks(Set<ChildTaskPlan> cTasks) {
575   - this.cTasks = cTasks;
576   - }
577   -
578   - public String getGsName() {
579   - return gsName;
580   - }
581   -
582   - public void setGsName(String gsName) {
583   - this.gsName = gsName;
584   - }
585   -
586   - public String getGsBm() {
587   - return gsBm;
588   - }
589   -
590   - public void setGsBm(String gsBm) {
591   - this.gsBm = gsBm;
592   - }
593   -
594   - public String getFgsName() {
595   - return fgsName;
596   - }
597   -
598   - public void setFgsName(String fgsName) {
599   - this.fgsName = fgsName;
600   - }
601   -
602   - public String getFgsBm() {
603   - return fgsBm;
604   - }
605   -
606   - public void setFgsBm(String fgsBm) {
607   - this.fgsBm = fgsBm;
608   - }
609   -
610   - public boolean isDfAuto() {
611   - return dfAuto;
612   - }
613   -
614   - public void setDfAuto(boolean dfAuto) {
615   - this.dfAuto = dfAuto;
616   - }
617   -
618   - public boolean isOnline() {
619   - return online;
620   - }
621   -
622   - public void setOnline(boolean online) {
623   - this.online = online;
624   - }
625   -
626   - public boolean isReissue() {
627   - return reissue;
628   - }
629   -
630   - public void setReissue(boolean reissue) {
631   - this.reissue = reissue;
632   - }
633   -
634   - public Integer getDriftStatus() {
635   - return driftStatus;
636   - }
637   -
638   - public void setDriftStatus(Integer driftStatus) {
639   - this.driftStatus = driftStatus;
640   - }
641   -
642   - public boolean isCcService() {
643   - return ccService;
644   - }
645   -
646   - public void setCcService(boolean ccService) {
647   - this.ccService = ccService;
648   - }
649   -}
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -7,7 +7,6 @@ import com.bsth.data.gpsdata_v2.entity.GpsEntity;
7 7 import com.bsth.data.safe_driv.SafeDriv;
8 8 import com.bsth.entity.directive.D80;
9 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10   -import com.bsth.websocket.entity.WsScheduleRealInfo;
11 10 import com.fasterxml.jackson.core.JsonProcessingException;
12 11 import com.fasterxml.jackson.databind.ObjectMapper;
13 12 import org.slf4j.Logger;
... ... @@ -39,7 +38,7 @@ public class SendUtils{
39 38  
40 39 Map<String, Object> map = new HashMap<>();
41 40 map.put("fn", "faChe");
42   - map.put("t", WsScheduleRealInfo.getInstance(sch));
  41 + map.put("t", sch);
43 42 map.put("dataStr", sdf.format(new Date()));
44 43  
45 44 ObjectMapper mapper = new ObjectMapper();
... ... @@ -63,7 +62,7 @@ public class SendUtils{
63 62  
64 63 Map<String, Object> map = new HashMap<>();
65 64 map.put("fn", "refreshSch");
66   - map.put("ts", WsScheduleRealInfo.getMultiInstance(list));
  65 + map.put("ts", list);
67 66  
68 67 ObjectMapper mapper = new ObjectMapper();
69 68  
... ... @@ -83,8 +82,8 @@ public class SendUtils{
83 82  
84 83 Map<String, Object> map = new HashMap<>();
85 84 map.put("fn", "zhongDian");
86   - map.put("t", WsScheduleRealInfo.getInstance(sch));
87   - map.put("nt", WsScheduleRealInfo.getInstance(nextSch));
  85 + map.put("t", sch);
  86 + map.put("nt", nextSch);
88 87 map.put("finish", finish);
89 88 map.put("dataStr", sdf.format(new Date()));
90 89  
... ... @@ -124,7 +123,7 @@ public class SendUtils{
124 123  
125 124 Map<String, Object> map = new HashMap<>();
126 125 map.put("fn", "directive");
127   - map.put("t", WsScheduleRealInfo.getInstance(sch));;
  126 + map.put("t", sch);;
128 127  
129 128 ObjectMapper mapper = new ObjectMapper();
130 129  
... ...