Commit 9c9325d36fa2bdb0e129493a79b992d14803a5be

Authored by 王通
1 parent 90a713df

1.中运量线路数据接口

src/main/java/com/bsth/CXFConfig.java
... ... @@ -13,6 +13,7 @@ import com.bsth.server_rs.destroy.DestroyDetailRestService;
13 13 import com.bsth.server_rs.directive.DirectiveRestService;
14 14 import com.bsth.server_rs.exception.AesExceptionMapper;
15 15 import com.bsth.server_rs.gps.GpsRestService;
  16 +import com.bsth.server_rs.schedule.SchedulePlanService;
16 17 import com.bsth.server_rs.schedule.ScheduleRealService;
17 18 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
18 19 import org.apache.cxf.Bus;
... ... @@ -40,6 +41,8 @@ public class CXFConfig {
40 41 }
41 42  
42 43 @Autowired
  44 + SchedulePlanService schedulePlanService;
  45 + @Autowired
43 46 ScheduleRealService scheduleRealService;
44 47 @Autowired
45 48 StationRestService stationRestService;
... ... @@ -66,6 +69,7 @@ public class CXFConfig {
66 69 new CarRestService(),
67 70 new PersonRestService(),
68 71 gpsRestService,
  72 + schedulePlanService,
69 73 scheduleRealService,
70 74 stationRestService,
71 75 ldSectionRestService,
... ...
src/main/java/com/bsth/entity/ScheduleExec.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +/**
  4 + * @author Hill
  5 + */
  6 +public class ScheduleExec {
  7 +
  8 + private String lineName;
  9 +
  10 + private String plate;
  11 +
  12 + private String lpName;
  13 +
  14 + private String fcsj;
  15 +
  16 + private Long time;
  17 +
  18 + public String getLineName() {
  19 + return lineName;
  20 + }
  21 +
  22 + public void setLineName(String lineName) {
  23 + this.lineName = lineName;
  24 + }
  25 +
  26 + public String getPlate() {
  27 + return plate;
  28 + }
  29 +
  30 + public void setPlate(String plate) {
  31 + this.plate = plate;
  32 + }
  33 +
  34 + public String getLpName() {
  35 + return lpName;
  36 + }
  37 +
  38 + public void setLpName(String lpName) {
  39 + this.lpName = lpName;
  40 + }
  41 +
  42 + public String getFcsj() {
  43 + return fcsj;
  44 + }
  45 +
  46 + public void setFcsj(String fcsj) {
  47 + this.fcsj = fcsj;
  48 + }
  49 +
  50 + public Long getTime() {
  51 + return time;
  52 + }
  53 +
  54 + public void setTime(Long time) {
  55 + this.time = time;
  56 + }
  57 +}
... ...
src/main/java/com/bsth/entity/ScheduleRealInfo.java
1   -package com.bsth.entity;
2   -
3   -import org.joda.time.format.DateTimeFormat;
4   -import org.joda.time.format.DateTimeFormatter;
5   -
6   -import javax.persistence.*;
7   -import java.io.Serializable;
8   -import java.util.Date;
9   -import java.util.HashSet;
10   -import java.util.Set;
11   -
12   -/**
13   - * 实际排班计划明细。
14   - */
15   -@Entity
16   -@Table(name = "bsth_c_s_sp_info_real")
17   -@NamedEntityGraphs({
18   - @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = {
19   - @NamedAttributeNode("cTasks")
20   - })
21   -})
22   -public class ScheduleRealInfo implements Serializable{
23   -
24   -
25   -
26   - /** 主键Id */
27   - @Id
28   - private Long id;
29   -
30   - /** 计划ID */
31   - private Long spId;
32   -
33   - /** 排班计划日期 */
34   - private Date scheduleDate;
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   - /** 发车顺序号 */
85   - private Integer fcno;
86   - /** 对应班次数 */
87   - private Integer bcs;
88   - /** 计划里程 */
89   - private Double jhlc;
90   -
91   - /** 原始计划里程 (原计调的数据) */
92   - private Double jhlcOrig;
93   -
94   - /** 班次历时 */
95   - private Integer bcsj;
96   -
97   - /**
98   - * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
99   - */
100   - private String bcType;
101   -
102   - /** 创建日期 */
103   - @Column(name = "create_date")
104   - private Date createDate;
105   - /** 修改日期 */
106   - @Column(name = "update_date")
107   - private Date updateDate;
108   -
109   - /** 实际发车时间*/
110   - private String fcsjActual;
111   - /** 实际发车时间戳*/
112   - @Transient
113   - private Long fcsjActualTime;
114   - /**实际终点时间 */
115   - private String zdsjActual;
116   - /** 实际终点时间戳*/
117   - @Transient
118   - private Long zdsjActualTime;
119   -
120   - /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
121   - private int status;
122   -
123   - private String adjustExps;
124   -
125   - /** 是否是临加班次 */
126   - private boolean sflj;
127   -
128   - /** 是否误点*/
129   - @Transient
130   - private boolean late;
131   -
132   - /** 备注*/
133   - private String remarks;
134   -
135   - /**待发时间(格式 HH:mm) */
136   - private String dfsj;
137   -
138   - /**待发时间戳 */
139   - @Transient
140   - private Long dfsjT;
141   -
142   - /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
143   - private Integer directiveState = -1;
144   -
145   - /** 起点站计划到达时间 */
146   - @Transient
147   - private String qdzArrDatejh;
148   -
149   - /** 起点站实际到达时间 */
150   - @Transient
151   - private String qdzArrDatesj;
152   -
153   - /** 子任务 */
154   - @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
155   - private Set<ChildTaskPlan> cTasks = new HashSet<>();
156   -
157   - /** 关联的公司名称 */
158   - private String gsName;
159   - /** 关联的公司编码 */
160   - private String gsBm;
161   - /** 关联的分公司名称 */
162   - private String fgsName;
163   - /** 关联的分公司编码 */
164   - private String fgsBm;
165   - /** 出场顺序号 */
166   - private Integer ccno;
167   -
168   - //待发调试(是否自动调整)
169   - private boolean dfAuto;
170   - //是否有GPS信号
171   - private boolean online;
172   -
173   - /** 是否有补发GPS信号 */
174   - private boolean reissue;
175   -
176   -
177   -
178   - /**
179   - * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
180   - */
181   - private boolean ccService;
182   - private Integer lpChange;
183   -
184   - /**
185   - * rfid状态
186   - */
187   - private int rfidState;
188   -
189   - /**
190   - * 起点站rfid状态
191   - */
192   - private int firstRfidState;
193   -
194   - @Override
195   - public int hashCode() {
196   - return (this.id + this.scheduleDateStr + this.xlBm + this.fcsj).hashCode();
197   - }
198   -
199   - @Override
200   - public boolean equals(Object obj) {
201   - return this.id.equals(((ScheduleRealInfo)obj).getId());
202   - }
203   -
204   - public Long getId() {
205   - return id;
206   - }
207   -
208   - public void setId(Long id) {
209   - this.id = id;
210   - }
211   -
212   - public Long getSpId() {
213   - return spId;
214   - }
215   -
216   - public void setSpId(Long spId) {
217   - this.spId = spId;
218   - }
219   -
220   - public Date getScheduleDate() {
221   - return scheduleDate;
222   - }
223   -
224   - public void setScheduleDate(Date scheduleDate) {
225   - this.scheduleDate = scheduleDate;
226   - }
227   -
228   - public String getScheduleDateStr() {
229   - return scheduleDateStr;
230   - }
231   -
232   - public void setScheduleDateStr(String scheduleDateStr) {
233   - this.scheduleDateStr = scheduleDateStr;
234   - }
235   -
236   - public String getRealExecDate() {
237   - return realExecDate;
238   - }
239   -
240   - public void setRealExecDate(String realExecDate) {
241   - this.realExecDate = realExecDate;
242   - }
243   -
244   - public String getXlName() {
245   - return xlName;
246   - }
247   -
248   - public void setXlName(String xlName) {
249   - this.xlName = xlName;
250   - }
251   -
252   - public String getXlBm() {
253   - return xlBm;
254   - }
255   -
256   - public void setXlBm(String xlBm) {
257   - this.xlBm = xlBm;
258   - }
259   -
260   - public String getLpName() {
261   - return lpName;
262   - }
263   -
264   - public void setLpName(String lpName) {
265   - this.lpName = lpName;
266   - }
267   -
268   - public String getClZbh() {
269   - return clZbh;
270   - }
271   -
272   - public void setClZbh(String clZbh) {
273   - this.clZbh = clZbh;
274   - }
275   -
276   - public String getjGh() {
277   - return jGh;
278   - }
279   -
280   - public void setjGh(String jGh) {
281   - this.jGh = jGh;
282   - }
283   -
284   - public String getjName() {
285   - return jName;
286   - }
287   -
288   - public void setjName(String jName) {
289   - this.jName = jName;
290   - }
291   -
292   - public String getsGh() {
293   - return sGh;
294   - }
295   -
296   - public void setsGh(String sGh) {
297   - this.sGh = sGh;
298   - }
299   -
300   - public String getsName() {
301   - return sName;
302   - }
303   -
304   - public void setsName(String sName) {
305   - this.sName = sName;
306   - }
307   -
308   - public String getXlDir() {
309   - return xlDir;
310   - }
311   -
312   - public void setXlDir(String xlDir) {
313   - this.xlDir = xlDir;
314   - }
315   -
316   - public String getQdzCode() {
317   - return qdzCode;
318   - }
319   -
320   - public void setQdzCode(String qdzCode) {
321   - this.qdzCode = qdzCode;
322   - }
323   -
324   - public String getQdzName() {
325   - return qdzName;
326   - }
327   -
328   - public void setQdzName(String qdzName) {
329   - this.qdzName = qdzName;
330   - }
331   -
332   - public String getZdzCode() {
333   - return zdzCode;
334   - }
335   -
336   - public void setZdzCode(String zdzCode) {
337   - this.zdzCode = zdzCode;
338   - }
339   -
340   - public String getZdzName() {
341   - return zdzName;
342   - }
343   -
344   - public void setZdzName(String zdzName) {
345   - this.zdzName = zdzName;
346   - }
347   -
348   - public String getFcsj() {
349   - return fcsj;
350   - }
351   -
352   - public void setFcsj(String fcsj) {
353   - this.fcsj = fcsj;
354   - }
355   -
356   - public Long getFcsjT() {
357   - return fcsjT;
358   - }
359   -
360   - public void setFcsjT(Long fcsjT) {
361   - this.fcsjT = fcsjT;
362   - }
363   -
364   - public String getZdsj() {
365   - return zdsj;
366   - }
367   -
368   - public void setZdsj(String zdsj) {
369   - this.zdsj = zdsj;
370   - }
371   -
372   - public Long getZdsjT() {
373   - return zdsjT;
374   - }
375   -
376   - public void setZdsjT(Long zdsjT) {
377   - this.zdsjT = zdsjT;
378   - }
379   -
380   - public Integer getFcno() {
381   - return fcno;
382   - }
383   -
384   - public void setFcno(Integer fcno) {
385   - this.fcno = fcno;
386   - }
387   -
388   - public Integer getBcs() {
389   - return bcs;
390   - }
391   -
392   - public void setBcs(Integer bcs) {
393   - this.bcs = bcs;
394   - }
395   -
396   - public Double getJhlc() {
397   - return jhlc;
398   - }
399   -
400   - public void setJhlc(Double jhlc) {
401   - this.jhlc = jhlc;
402   - }
403   -
404   - public Integer getBcsj() {
405   - return bcsj;
406   - }
407   -
408   - public void setBcsj(Integer bcsj) {
409   - this.bcsj = bcsj;
410   - }
411   -
412   - public String getBcType() {
413   - return bcType;
414   - }
415   -
416   - public void setBcType(String bcType) {
417   - this.bcType = bcType;
418   - }
419   -
420   - public Date getCreateDate() {
421   - return createDate;
422   - }
423   -
424   - public void setCreateDate(Date createDate) {
425   - this.createDate = createDate;
426   - }
427   -
428   - public Date getUpdateDate() {
429   - return updateDate;
430   - }
431   -
432   - public void setUpdateDate(Date updateDate) {
433   - this.updateDate = updateDate;
434   - }
435   -
436   - public String getFcsjActual() {
437   - return fcsjActual;
438   - }
439   -
440   - public void setFcsjActual(String fcsjActual) {
441   - this.fcsjActual = fcsjActual;
442   - }
443   -
444   - public Long getFcsjActualTime() {
445   - return fcsjActualTime;
446   - }
447   -
448   - public void setFcsjActualTime(Long fcsjActualTime) {
449   - this.fcsjActualTime = fcsjActualTime;
450   - }
451   -
452   - public String getZdsjActual() {
453   - return zdsjActual;
454   - }
455   -
456   - public void setZdsjActual(String zdsjActual) {
457   - this.zdsjActual = zdsjActual;
458   - }
459   -
460   - public Long getZdsjActualTime() {
461   - return zdsjActualTime;
462   - }
463   -
464   - public void setZdsjActualTime(Long zdsjActualTime) {
465   - this.zdsjActualTime = zdsjActualTime;
466   - }
467   -
468   - public int getStatus() {
469   - return status;
470   - }
471   -
472   - public void setStatus(int status) {
473   - this.status = status;
474   - }
475   -
476   - public String getAdjustExps() {
477   - return adjustExps;
478   - }
479   -
480   - public void setAdjustExps(String adjustExps) {
481   - this.adjustExps = adjustExps;
482   - }
483   -
484   - public boolean isSflj() {
485   - return sflj;
486   - }
487   -
488   - public void setSflj(boolean sflj) {
489   - this.sflj = sflj;
490   - }
491   -
492   - public boolean isLate() {
493   - return late;
494   - }
495   -
496   - public void setLate(boolean late) {
497   - this.late = late;
498   - }
499   -
500   - public String getRemarks() {
501   - return remarks;
502   - }
503   -
504   - public void setRemarks(String remarks) {
505   - this.remarks = remarks;
506   - }
507   -
508   - public String getDfsj() {
509   - return dfsj;
510   - }
511   -
512   - public void setDfsj(String dfsj) {
513   - this.dfsj = dfsj;
514   - }
515   -
516   - public Long getDfsjT() {
517   - return dfsjT;
518   - }
519   -
520   - public void setDfsjT(Long dfsjT) {
521   - this.dfsjT = dfsjT;
522   - }
523   -
524   - public Integer getDirectiveState() {
525   - return directiveState;
526   - }
527   -
528   - public void setDirectiveState(Integer directiveState) {
529   - this.directiveState = directiveState;
530   - }
531   -
532   - public String getQdzArrDatejh() {
533   - return qdzArrDatejh;
534   - }
535   -
536   - public void setQdzArrDatejh(String qdzArrDatejh) {
537   - this.qdzArrDatejh = qdzArrDatejh;
538   - }
539   -
540   - public String getQdzArrDatesj() {
541   - return qdzArrDatesj;
542   - }
543   -
544   - public void setQdzArrDatesj(String qdzArrDatesj) {
545   - this.qdzArrDatesj = qdzArrDatesj;
546   - }
547   -
548   - public Set<ChildTaskPlan> getcTasks() {
549   - return cTasks;
550   - }
551   -
552   - public void setcTasks(Set<ChildTaskPlan> cTasks) {
553   - this.cTasks = cTasks;
554   - }
555   -
556   - public String getGsName() {
557   - return gsName;
558   - }
559   -
560   - public void setGsName(String gsName) {
561   - this.gsName = gsName;
562   - }
563   -
564   - public String getGsBm() {
565   - return gsBm;
566   - }
567   -
568   - public void setGsBm(String gsBm) {
569   - this.gsBm = gsBm;
570   - }
571   -
572   - public String getFgsName() {
573   - return fgsName;
574   - }
575   -
576   - public void setFgsName(String fgsName) {
577   - this.fgsName = fgsName;
578   - }
579   -
580   - public String getFgsBm() {
581   - return fgsBm;
582   - }
583   -
584   - public void setFgsBm(String fgsBm) {
585   - this.fgsBm = fgsBm;
586   - }
587   -
588   - public Integer getCcno() {
589   - return ccno;
590   - }
591   -
592   - public void setCcno(Integer ccno) {
593   - this.ccno = ccno;
594   - }
595   -
596   - public boolean isDfAuto() {
597   - return dfAuto;
598   - }
599   -
600   - public void setDfAuto(boolean dfAuto) {
601   - this.dfAuto = dfAuto;
602   - }
603   -
604   - public boolean isOnline() {
605   - return online;
606   - }
607   -
608   - public void setOnline(boolean online) {
609   - this.online = online;
610   - }
611   -
612   - public boolean isReissue() {
613   - return reissue;
614   - }
615   -
616   - public void setReissue(boolean reissue) {
617   - this.reissue = reissue;
618   - }
619   -
620   - public boolean isCcService() {
621   - return ccService;
622   - }
623   -
624   - public void setCcService(boolean ccService) {
625   - this.ccService = ccService;
626   - }
627   -
628   - public Integer getLpChange() {
629   - return lpChange;
630   - }
631   -
632   - public void setLpChange(Integer lpChange) {
633   - this.lpChange = lpChange;
634   - }
635   -
636   - public Double getJhlcOrig() {
637   - return jhlcOrig;
638   - }
639   -
640   - public void setJhlcOrig(Double jhlcOrig) {
641   - this.jhlcOrig = jhlcOrig;
642   - }
643   -
644   - public int getRfidState() {
645   - return rfidState;
646   - }
647   -
648   - public void setRfidState(int rfidState) {
649   - this.rfidState = rfidState;
650   - }
651   -
652   - public int getFirstRfidState() {
653   - return firstRfidState;
654   - }
655   -
656   - public void setFirstRfidState(int firstRfidState) {
657   - this.firstRfidState = firstRfidState;
658   - }
659   -
660   - @Transient
661   - private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
662   - /**
663   - *
664   - * @Title: setFcsjActualAll
665   - * @Description: TODO(设置实际发车时间 时间戳)
666   - * @throws
667   - */
668   - public void setFcsjActualAll(Long t){
669   - this.fcsjActualTime = t;
670   - this.fcsjActual = fmtHHmm.print(t);
671   - }
672   -
673   - /**
674   - *
675   - * @Title: setFcsjActualAll
676   - * @Description: TODO(设置实际终点时间)
677   - * @throws
678   - */
679   - public void setZdsjActualAll(Long t){
680   - this.zdsjActualTime = t;
681   - this.zdsjActual = fmtHHmm.print(t);
682   - }
683   -}
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +import org.joda.time.format.DateTimeFormat;
  5 +import org.joda.time.format.DateTimeFormatter;
  6 +
  7 +import javax.persistence.*;
  8 +import java.io.Serializable;
  9 +import java.util.Date;
  10 +import java.util.HashSet;
  11 +import java.util.Set;
  12 +
  13 +/**
  14 + * 实际排班计划明细。
  15 + */
  16 +@Entity
  17 +@Table(name = "bsth_c_s_sp_info_real")
  18 +@NamedEntityGraphs({
  19 + @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = {
  20 + @NamedAttributeNode("cTasks")
  21 + })
  22 +})
  23 +public class ScheduleRealInfo implements Serializable{
  24 +
  25 +
  26 +
  27 + /** 主键Id */
  28 + @Id
  29 + private Long id;
  30 +
  31 + /** 计划ID */
  32 + private Long spId;
  33 +
  34 + /** 排班计划日期 */
  35 + private Date scheduleDate;
  36 + private String scheduleDateStr;
  37 +
  38 + /** 真实执行时间 yyyy-MM-dd */
  39 + private String realExecDate;
  40 +
  41 + /** 线路名称 */
  42 + @JsonProperty("lineName")
  43 + private String xlName;
  44 + /** 线路编码 */
  45 + private String xlBm;
  46 +
  47 + /** 路牌名称 */
  48 + private String lpName;
  49 +
  50 + /** 车辆自编号 */
  51 + @JsonProperty("plate")
  52 + private String clZbh;
  53 +
  54 + private String jsy;
  55 + /** 驾驶员工号 */
  56 + private String jGh;
  57 + /** 驾驶员名字 */
  58 + private String jName;
  59 +
  60 + private String spy;
  61 + /** 售票员工号 */
  62 + private String sGh;
  63 + /** 售票员名字 */
  64 + private String sName;
  65 +
  66 + /** 线路方向 */
  67 + @JsonProperty("direction")
  68 + private String xlDir;
  69 + /** 起点站code*/
  70 + private String qdzCode;
  71 + /** 起点站名字 */
  72 + private String qdzName;
  73 +
  74 + /** 终点站code*/
  75 + private String zdzCode;
  76 + /** 终点站名字 */
  77 + private String zdzName;
  78 +
  79 + /** 计划发车时间(格式 HH:mm) */
  80 + private String fcsj;
  81 + /** 计划发车时间戳*/
  82 + @Transient
  83 + private Long fcsjT;
  84 +
  85 + /** 计划终点时间(格式 HH:mm) */
  86 + private String zdsj;
  87 + /** 计划终点时间戳*/
  88 + @Transient
  89 + private Long zdsjT;
  90 +
  91 + /** 发车顺序号 */
  92 + private Integer fcno;
  93 + /** 对应班次数 */
  94 + private Integer bcs;
  95 + /** 计划里程 */
  96 + private Double jhlc;
  97 +
  98 + /** 原始计划里程 (原计调的数据) */
  99 + private Double jhlcOrig;
  100 +
  101 + /** 班次历时 */
  102 + private Integer bcsj;
  103 +
  104 + /**
  105 + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
  106 + */
  107 + private String bcType;
  108 +
  109 + /** 创建日期 */
  110 + @Column(name = "create_date")
  111 + private Date createDate;
  112 + /** 修改日期 */
  113 + @Column(name = "update_date")
  114 + private Date updateDate;
  115 +
  116 + /** 实际发车时间*/
  117 + private String fcsjActual;
  118 + /** 实际发车时间戳*/
  119 + @Transient
  120 + private Long fcsjActualTime;
  121 + /**实际终点时间 */
  122 + private String zdsjActual;
  123 + /** 实际终点时间戳*/
  124 + @Transient
  125 + private Long zdsjActualTime;
  126 +
  127 + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
  128 + private int status;
  129 +
  130 + private String adjustExps;
  131 +
  132 + /** 是否是临加班次 */
  133 + private boolean sflj = true;
  134 +
  135 + /** 是否误点*/
  136 + @Transient
  137 + private boolean late;
  138 +
  139 + /** 备注*/
  140 + private String remarks;
  141 +
  142 + /**待发时间(格式 HH:mm) */
  143 + private String dfsj;
  144 +
  145 + /**待发时间戳 */
  146 + @Transient
  147 + private Long dfsjT;
  148 +
  149 + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
  150 + private Integer directiveState = -1;
  151 +
  152 + /** 起点站计划到达时间 */
  153 + @Transient
  154 + private String qdzArrDatejh;
  155 +
  156 + /** 起点站实际到达时间 */
  157 + @Transient
  158 + private String qdzArrDatesj;
  159 +
  160 + /** 子任务 */
  161 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
  162 + private Set<ChildTaskPlan> cTasks = new HashSet<>();
  163 +
  164 + /** 关联的公司名称 */
  165 + private String gsName;
  166 + /** 关联的公司编码 */
  167 + private String gsBm;
  168 + /** 关联的分公司名称 */
  169 + private String fgsName;
  170 + /** 关联的分公司编码 */
  171 + private String fgsBm;
  172 + /** 出场顺序号 */
  173 + private Integer ccno;
  174 +
  175 + //待发调试(是否自动调整)
  176 + private boolean dfAuto;
  177 + //是否有GPS信号
  178 + private boolean online;
  179 +
  180 + /** 是否有补发GPS信号 */
  181 + private boolean reissue;
  182 +
  183 +
  184 +
  185 + /**
  186 + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
  187 + */
  188 + private boolean ccService;
  189 + private Integer lpChange;
  190 +
  191 + /**
  192 + * rfid状态
  193 + */
  194 + private int rfidState;
  195 +
  196 + /**
  197 + * 起点站rfid状态
  198 + */
  199 + private int firstRfidState;
  200 +
  201 + @Override
  202 + public int hashCode() {
  203 + return (this.id + this.scheduleDateStr + this.xlBm + this.fcsj).hashCode();
  204 + }
  205 +
  206 + @Override
  207 + public boolean equals(Object obj) {
  208 + return this.id.equals(((ScheduleRealInfo)obj).getId());
  209 + }
  210 +
  211 + public Long getId() {
  212 + return id;
  213 + }
  214 +
  215 + public void setId(Long id) {
  216 + this.id = id;
  217 + }
  218 +
  219 + public Long getSpId() {
  220 + return spId;
  221 + }
  222 +
  223 + public void setSpId(Long spId) {
  224 + this.spId = spId;
  225 + }
  226 +
  227 + public Date getScheduleDate() {
  228 + return scheduleDate;
  229 + }
  230 +
  231 + public void setScheduleDate(Date scheduleDate) {
  232 + this.scheduleDate = scheduleDate;
  233 + }
  234 +
  235 + public String getScheduleDateStr() {
  236 + return scheduleDateStr;
  237 + }
  238 +
  239 + public void setScheduleDateStr(String scheduleDateStr) {
  240 + this.scheduleDateStr = scheduleDateStr;
  241 + }
  242 +
  243 + public String getRealExecDate() {
  244 + return realExecDate;
  245 + }
  246 +
  247 + public void setRealExecDate(String realExecDate) {
  248 + this.realExecDate = realExecDate;
  249 + }
  250 +
  251 + public String getXlName() {
  252 + return xlName;
  253 + }
  254 +
  255 + public void setXlName(String xlName) {
  256 + this.xlName = xlName;
  257 + }
  258 +
  259 + public String getXlBm() {
  260 + return xlBm;
  261 + }
  262 +
  263 + public void setXlBm(String xlBm) {
  264 + this.xlBm = xlBm;
  265 + }
  266 +
  267 + public String getLpName() {
  268 + return lpName;
  269 + }
  270 +
  271 + public void setLpName(String lpName) {
  272 + this.lpName = lpName;
  273 + }
  274 +
  275 + public String getClZbh() {
  276 + return clZbh;
  277 + }
  278 +
  279 + public void setClZbh(String clZbh) {
  280 + this.clZbh = clZbh;
  281 + }
  282 +
  283 + public String getjGh() {
  284 + return jGh;
  285 + }
  286 +
  287 + public void setjGh(String jGh) {
  288 + this.jGh = jGh;
  289 + }
  290 +
  291 + public String getjName() {
  292 + return jName;
  293 + }
  294 +
  295 + public void setjName(String jName) {
  296 + this.jName = jName;
  297 + }
  298 +
  299 + public String getsGh() {
  300 + return sGh;
  301 + }
  302 +
  303 + public void setsGh(String sGh) {
  304 + this.sGh = sGh;
  305 + }
  306 +
  307 + public String getsName() {
  308 + return sName;
  309 + }
  310 +
  311 + public void setsName(String sName) {
  312 + this.sName = sName;
  313 + }
  314 +
  315 + public String getXlDir() {
  316 + return xlDir;
  317 + }
  318 +
  319 + public void setXlDir(String xlDir) {
  320 + this.xlDir = xlDir;
  321 + }
  322 +
  323 + public String getQdzCode() {
  324 + return qdzCode;
  325 + }
  326 +
  327 + public void setQdzCode(String qdzCode) {
  328 + this.qdzCode = qdzCode;
  329 + }
  330 +
  331 + public String getQdzName() {
  332 + return qdzName;
  333 + }
  334 +
  335 + public void setQdzName(String qdzName) {
  336 + this.qdzName = qdzName;
  337 + }
  338 +
  339 + public String getZdzCode() {
  340 + return zdzCode;
  341 + }
  342 +
  343 + public void setZdzCode(String zdzCode) {
  344 + this.zdzCode = zdzCode;
  345 + }
  346 +
  347 + public String getZdzName() {
  348 + return zdzName;
  349 + }
  350 +
  351 + public void setZdzName(String zdzName) {
  352 + this.zdzName = zdzName;
  353 + }
  354 +
  355 + public String getFcsj() {
  356 + return fcsj;
  357 + }
  358 +
  359 + public void setFcsj(String fcsj) {
  360 + this.fcsj = fcsj;
  361 + }
  362 +
  363 + public Long getFcsjT() {
  364 + return fcsjT;
  365 + }
  366 +
  367 + public void setFcsjT(Long fcsjT) {
  368 + this.fcsjT = fcsjT;
  369 + }
  370 +
  371 + public String getZdsj() {
  372 + return zdsj;
  373 + }
  374 +
  375 + public void setZdsj(String zdsj) {
  376 + this.zdsj = zdsj;
  377 + }
  378 +
  379 + public Long getZdsjT() {
  380 + return zdsjT;
  381 + }
  382 +
  383 + public void setZdsjT(Long zdsjT) {
  384 + this.zdsjT = zdsjT;
  385 + }
  386 +
  387 + public Integer getFcno() {
  388 + return fcno;
  389 + }
  390 +
  391 + public void setFcno(Integer fcno) {
  392 + this.fcno = fcno;
  393 + }
  394 +
  395 + public Integer getBcs() {
  396 + return bcs;
  397 + }
  398 +
  399 + public void setBcs(Integer bcs) {
  400 + this.bcs = bcs;
  401 + }
  402 +
  403 + public Double getJhlc() {
  404 + return jhlc;
  405 + }
  406 +
  407 + public void setJhlc(Double jhlc) {
  408 + this.jhlc = jhlc;
  409 + }
  410 +
  411 + public Integer getBcsj() {
  412 + return bcsj;
  413 + }
  414 +
  415 + public void setBcsj(Integer bcsj) {
  416 + this.bcsj = bcsj;
  417 + }
  418 +
  419 + public String getBcType() {
  420 + return bcType;
  421 + }
  422 +
  423 + public void setBcType(String bcType) {
  424 + this.bcType = bcType;
  425 + }
  426 +
  427 + public Date getCreateDate() {
  428 + return createDate;
  429 + }
  430 +
  431 + public void setCreateDate(Date createDate) {
  432 + this.createDate = createDate;
  433 + }
  434 +
  435 + public Date getUpdateDate() {
  436 + return updateDate;
  437 + }
  438 +
  439 + public void setUpdateDate(Date updateDate) {
  440 + this.updateDate = updateDate;
  441 + }
  442 +
  443 + public String getFcsjActual() {
  444 + return fcsjActual;
  445 + }
  446 +
  447 + public void setFcsjActual(String fcsjActual) {
  448 + this.fcsjActual = fcsjActual;
  449 + }
  450 +
  451 + public Long getFcsjActualTime() {
  452 + return fcsjActualTime;
  453 + }
  454 +
  455 + public void setFcsjActualTime(Long fcsjActualTime) {
  456 + this.fcsjActualTime = fcsjActualTime;
  457 + }
  458 +
  459 + public String getZdsjActual() {
  460 + return zdsjActual;
  461 + }
  462 +
  463 + public void setZdsjActual(String zdsjActual) {
  464 + this.zdsjActual = zdsjActual;
  465 + }
  466 +
  467 + public Long getZdsjActualTime() {
  468 + return zdsjActualTime;
  469 + }
  470 +
  471 + public void setZdsjActualTime(Long zdsjActualTime) {
  472 + this.zdsjActualTime = zdsjActualTime;
  473 + }
  474 +
  475 + public int getStatus() {
  476 + return status;
  477 + }
  478 +
  479 + public void setStatus(int status) {
  480 + this.status = status;
  481 + }
  482 +
  483 + public String getAdjustExps() {
  484 + return adjustExps;
  485 + }
  486 +
  487 + public void setAdjustExps(String adjustExps) {
  488 + this.adjustExps = adjustExps;
  489 + }
  490 +
  491 + public boolean isSflj() {
  492 + return sflj;
  493 + }
  494 +
  495 + public void setSflj(boolean sflj) {
  496 + this.sflj = sflj;
  497 + }
  498 +
  499 + public boolean isLate() {
  500 + return late;
  501 + }
  502 +
  503 + public void setLate(boolean late) {
  504 + this.late = late;
  505 + }
  506 +
  507 + public String getRemarks() {
  508 + return remarks;
  509 + }
  510 +
  511 + public void setRemarks(String remarks) {
  512 + this.remarks = remarks;
  513 + }
  514 +
  515 + public String getDfsj() {
  516 + return dfsj;
  517 + }
  518 +
  519 + public void setDfsj(String dfsj) {
  520 + this.dfsj = dfsj;
  521 + }
  522 +
  523 + public Long getDfsjT() {
  524 + return dfsjT;
  525 + }
  526 +
  527 + public void setDfsjT(Long dfsjT) {
  528 + this.dfsjT = dfsjT;
  529 + }
  530 +
  531 + public Integer getDirectiveState() {
  532 + return directiveState;
  533 + }
  534 +
  535 + public void setDirectiveState(Integer directiveState) {
  536 + this.directiveState = directiveState;
  537 + }
  538 +
  539 + public String getQdzArrDatejh() {
  540 + return qdzArrDatejh;
  541 + }
  542 +
  543 + public void setQdzArrDatejh(String qdzArrDatejh) {
  544 + this.qdzArrDatejh = qdzArrDatejh;
  545 + }
  546 +
  547 + public String getQdzArrDatesj() {
  548 + return qdzArrDatesj;
  549 + }
  550 +
  551 + public void setQdzArrDatesj(String qdzArrDatesj) {
  552 + this.qdzArrDatesj = qdzArrDatesj;
  553 + }
  554 +
  555 + public Set<ChildTaskPlan> getcTasks() {
  556 + return cTasks;
  557 + }
  558 +
  559 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  560 + this.cTasks = cTasks;
  561 + }
  562 +
  563 + public String getGsName() {
  564 + return gsName;
  565 + }
  566 +
  567 + public void setGsName(String gsName) {
  568 + this.gsName = gsName;
  569 + }
  570 +
  571 + public String getGsBm() {
  572 + return gsBm;
  573 + }
  574 +
  575 + public void setGsBm(String gsBm) {
  576 + this.gsBm = gsBm;
  577 + }
  578 +
  579 + public String getFgsName() {
  580 + return fgsName;
  581 + }
  582 +
  583 + public void setFgsName(String fgsName) {
  584 + this.fgsName = fgsName;
  585 + }
  586 +
  587 + public String getFgsBm() {
  588 + return fgsBm;
  589 + }
  590 +
  591 + public void setFgsBm(String fgsBm) {
  592 + this.fgsBm = fgsBm;
  593 + }
  594 +
  595 + public Integer getCcno() {
  596 + return ccno;
  597 + }
  598 +
  599 + public void setCcno(Integer ccno) {
  600 + this.ccno = ccno;
  601 + }
  602 +
  603 + public boolean isDfAuto() {
  604 + return dfAuto;
  605 + }
  606 +
  607 + public void setDfAuto(boolean dfAuto) {
  608 + this.dfAuto = dfAuto;
  609 + }
  610 +
  611 + public boolean isOnline() {
  612 + return online;
  613 + }
  614 +
  615 + public void setOnline(boolean online) {
  616 + this.online = online;
  617 + }
  618 +
  619 + public boolean isReissue() {
  620 + return reissue;
  621 + }
  622 +
  623 + public void setReissue(boolean reissue) {
  624 + this.reissue = reissue;
  625 + }
  626 +
  627 + public boolean isCcService() {
  628 + return ccService;
  629 + }
  630 +
  631 + public void setCcService(boolean ccService) {
  632 + this.ccService = ccService;
  633 + }
  634 +
  635 + public Integer getLpChange() {
  636 + return lpChange;
  637 + }
  638 +
  639 + public void setLpChange(Integer lpChange) {
  640 + this.lpChange = lpChange;
  641 + }
  642 +
  643 + public Double getJhlcOrig() {
  644 + return jhlcOrig;
  645 + }
  646 +
  647 + public void setJhlcOrig(Double jhlcOrig) {
  648 + this.jhlcOrig = jhlcOrig;
  649 + }
  650 +
  651 + public int getRfidState() {
  652 + return rfidState;
  653 + }
  654 +
  655 + public void setRfidState(int rfidState) {
  656 + this.rfidState = rfidState;
  657 + }
  658 +
  659 + public int getFirstRfidState() {
  660 + return firstRfidState;
  661 + }
  662 +
  663 + public void setFirstRfidState(int firstRfidState) {
  664 + this.firstRfidState = firstRfidState;
  665 + }
  666 +
  667 + @Transient
  668 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  669 + /**
  670 + *
  671 + * @Title: setFcsjActualAll
  672 + * @Description: TODO(设置实际发车时间 时间戳)
  673 + * @throws
  674 + */
  675 + public void setFcsjActualAll(Long t){
  676 + this.fcsjActualTime = t;
  677 + this.fcsjActual = fmtHHmm.print(t);
  678 + }
  679 +
  680 + /**
  681 + *
  682 + * @Title: setFcsjActualAll
  683 + * @Description: TODO(设置实际终点时间)
  684 + * @throws
  685 + */
  686 + public void setZdsjActualAll(Long t){
  687 + this.zdsjActualTime = t;
  688 + this.zdsjActual = fmtHHmm.print(t);
  689 + }
  690 +
  691 + public String getJsy() {
  692 + return jsy;
  693 + }
  694 +
  695 + public void setJsy(String jsy) {
  696 + this.jsy = jsy;
  697 + }
  698 +
  699 + public String getSpy() {
  700 + return spy;
  701 + }
  702 +
  703 + public void setSpy(String spy) {
  704 + this.spy = spy;
  705 + }
  706 +}
... ...
src/main/java/com/bsth/entity/TimeTable.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * @author Hill
  7 + */
  8 +public class TimeTable {
  9 +
  10 + private String lineCode;
  11 +
  12 + private Double totalMileage;
  13 +
  14 + private Double serviceMileage;
  15 +
  16 + private String weekDays;
  17 +
  18 + private List<TimeTableDetail> details;
  19 +
  20 + public String getLineCode() {
  21 + return lineCode;
  22 + }
  23 +
  24 + public void setLineCode(String lineCode) {
  25 + this.lineCode = lineCode;
  26 + }
  27 +
  28 + public Double getTotalMileage() {
  29 + return totalMileage;
  30 + }
  31 +
  32 + public void setTotalMileage(Double totalMileage) {
  33 + this.totalMileage = totalMileage;
  34 + }
  35 +
  36 + public Double getServiceMileage() {
  37 + return serviceMileage;
  38 + }
  39 +
  40 + public void setServiceMileage(Double serviceMileage) {
  41 + this.serviceMileage = serviceMileage;
  42 + }
  43 +
  44 + public String getWeekDays() {
  45 + return weekDays;
  46 + }
  47 +
  48 + public void setWeekDays(String weekDays) {
  49 + this.weekDays = weekDays;
  50 + }
  51 +
  52 + public List<TimeTableDetail> getDetails() {
  53 + return details;
  54 + }
  55 +
  56 + public void setDetails(List<TimeTableDetail> details) {
  57 + this.details = details;
  58 + }
  59 +}
... ...
src/main/java/com/bsth/entity/TimeTableDetail.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +public class TimeTableDetail {
  4 +
  5 + private String bcType;
  6 +
  7 + private int bcs;
  8 +
  9 + private int bcsj;
  10 +
  11 + private String lpName;
  12 +
  13 + private int direction;
  14 +
  15 + private String startStation;
  16 +
  17 + private String endStation;
  18 +
  19 + private String leaveTime;
  20 +
  21 + private String arrivalTime;
  22 +
  23 + public String getBcType() {
  24 + return bcType;
  25 + }
  26 +
  27 + public void setBcType(String bcType) {
  28 + this.bcType = bcType;
  29 + }
  30 +
  31 + public int getBcs() {
  32 + return bcs;
  33 + }
  34 +
  35 + public void setBcs(int bcs) {
  36 + this.bcs = bcs;
  37 + }
  38 +
  39 + public int getBcsj() {
  40 + return bcsj;
  41 + }
  42 +
  43 + public void setBcsj(int bcsj) {
  44 + this.bcsj = bcsj;
  45 + }
  46 +
  47 + public String getLpName() {
  48 + return lpName;
  49 + }
  50 +
  51 + public void setLpName(String lpName) {
  52 + this.lpName = lpName;
  53 + }
  54 +
  55 + public int getDirection() {
  56 + return direction;
  57 + }
  58 +
  59 + public void setDirection(int direction) {
  60 + this.direction = direction;
  61 + }
  62 +
  63 + public String getStartStation() {
  64 + return startStation;
  65 + }
  66 +
  67 + public void setStartStation(String startStation) {
  68 + this.startStation = startStation;
  69 + }
  70 +
  71 + public String getEndStation() {
  72 + return endStation;
  73 + }
  74 +
  75 + public void setEndStation(String endStation) {
  76 + this.endStation = endStation;
  77 + }
  78 +
  79 + public String getLeaveTime() {
  80 + return leaveTime;
  81 + }
  82 +
  83 + public void setLeaveTime(String leaveTime) {
  84 + this.leaveTime = leaveTime;
  85 + }
  86 +
  87 + public String getArrivalTime() {
  88 + return arrivalTime;
  89 + }
  90 +
  91 + public void setArrivalTime(String arrivalTime) {
  92 + this.arrivalTime = arrivalTime;
  93 + }
  94 +}
... ...
src/main/java/com/bsth/entity/ZylInfo.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +/**
  4 + * 中运量下发指令时携带信息
  5 + * 发GPS时需回传此信息
  6 + * @author Hill
  7 + */
  8 +public class ZylInfo {
  9 +
  10 + /**
  11 + * 线路编码
  12 + */
  13 + private int lineId;
  14 +
  15 + /**
  16 + * 车次
  17 + */
  18 + private int trainNum;
  19 +
  20 + public ZylInfo() {
  21 +
  22 + }
  23 +
  24 + public ZylInfo(int lineId, int trainNum) {
  25 + this.lineId = lineId;
  26 + this.trainNum = trainNum;
  27 + }
  28 +
  29 + public int getLineId() {
  30 + return lineId;
  31 + }
  32 +
  33 + public void setLineId(int lineId) {
  34 + this.lineId = lineId;
  35 + }
  36 +
  37 + public int getTrainNum() {
  38 + return trainNum;
  39 + }
  40 +
  41 + public void setTrainNum(int trainNum) {
  42 + this.trainNum = trainNum;
  43 + }
  44 +}
... ...
src/main/java/com/bsth/server_rs/base_info/car/Car.java
1   -package com.bsth.server_rs.base_info.car;
2   -
3   -import javax.xml.bind.annotation.XmlRootElement;
4   -import java.io.Serializable;
5   -
6   -/**
7   - * 车辆信息
8   - * Created by panzhao on 2017/3/30.
9   - */
10   -@XmlRootElement
11   -public class Car implements Serializable {
12   -
13   - /**
14   - * 自编号/内部编号
15   - */
16   - private String nbbm;
17   -
18   - /**
19   - * 公司代码
20   - */
21   - private String companyCode;
22   - /**
23   - * 分公司编码
24   - */
25   - private String brancheCompanyCode;
26   -
27   - /**
28   - * 车牌号
29   - */
30   - private String carPlate;
31   - /**
32   - * 设备终端号
33   - */
34   - private String equipmentCode;
35   - /**
36   - * 车辆类型
37   - */
38   - private String carType;
39   - /**
40   - * 是否机动车(机动车类型选择)
41   - */
42   - private String vehicleStats;
43   -
44   - /**
45   - * 是否电车(TODO:在原系统里没有,这里暂时留着)
46   - */
47   - private Boolean sfdc;
48   - /**
49   - * 是否报废
50   - */
51   - private Boolean scrapState;
52   -
53   - /**
54   - * RFID 车卡ID号(16进制)
55   - */
56   - private String idRfid;
57   -
58   - /**
59   - * RFID 标签号
60   - */
61   - private String tagRfid;
62   -
63   - private String lineCode;
64   -
65   - private String lineName;
66   -
67   - private String remark;
68   -
69   - public String getNbbm() {
70   - return nbbm;
71   - }
72   -
73   - public void setNbbm(String nbbm) {
74   - this.nbbm = nbbm;
75   - }
76   -
77   - public String getCompanyCode() {
78   - return companyCode;
79   - }
80   -
81   - public void setCompanyCode(String companyCode) {
82   - this.companyCode = companyCode;
83   - }
84   -
85   - public String getBrancheCompanyCode() {
86   - return brancheCompanyCode;
87   - }
88   -
89   - public void setBrancheCompanyCode(String brancheCompanyCode) {
90   - this.brancheCompanyCode = brancheCompanyCode;
91   - }
92   -
93   - public String getCarPlate() {
94   - return carPlate;
95   - }
96   -
97   - public void setCarPlate(String carPlate) {
98   - this.carPlate = carPlate;
99   - }
100   -
101   - public String getEquipmentCode() {
102   - return equipmentCode;
103   - }
104   -
105   - public void setEquipmentCode(String equipmentCode) {
106   - this.equipmentCode = equipmentCode;
107   - }
108   -
109   - public String getCarType() {
110   - return carType;
111   - }
112   -
113   - public void setCarType(String carType) {
114   - this.carType = carType;
115   - }
116   -
117   - public String getVehicleStats() {
118   - return vehicleStats;
119   - }
120   -
121   - public void setVehicleStats(String vehicleStats) {
122   - this.vehicleStats = vehicleStats;
123   - }
124   -
125   - public Boolean getSfdc() {
126   - return sfdc;
127   - }
128   -
129   - public void setSfdc(Boolean sfdc) {
130   - this.sfdc = sfdc;
131   - }
132   -
133   - public Boolean getScrapState() {
134   - return scrapState;
135   - }
136   -
137   - public void setScrapState(Boolean scrapState) {
138   - this.scrapState = scrapState;
139   - }
140   -
141   - public String getIdRfid() {
142   - return idRfid;
143   - }
144   -
145   - public void setIdRfid(String idRfid) {
146   - this.idRfid = idRfid;
147   - }
148   -
149   - public String getTagRfid() {
150   - return tagRfid;
151   - }
152   -
153   - public void setTagRfid(String tagRfid) {
154   - this.tagRfid = tagRfid;
155   - }
156   -
157   - public String getLineCode() {
158   - return lineCode;
159   - }
160   -
161   - public void setLineCode(String lineCode) {
162   - this.lineCode = lineCode;
163   - }
164   -
165   - public String getLineName() {
166   - return lineName;
167   - }
168   -
169   - public void setLineName(String lineName) {
170   - this.lineName = lineName;
171   - }
172   -
173   - public String getRemark() {
174   - return remark;
175   - }
176   -
177   - public void setRemark(String remark) {
178   - this.remark = remark;
179   - }
180   -}
  1 +package com.bsth.server_rs.base_info.car;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonProperty;
  4 +
  5 +import javax.xml.bind.annotation.XmlRootElement;
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 车辆信息
  10 + * Created by panzhao on 2017/3/30.
  11 + */
  12 +@XmlRootElement
  13 +public class Car implements Serializable {
  14 +
  15 + /**
  16 + * 自编号/内部编号
  17 + */
  18 + private String nbbm;
  19 +
  20 + /**
  21 + * 公司代码
  22 + */
  23 + private String companyCode;
  24 + /**
  25 + * 分公司编码
  26 + */
  27 + private String brancheCompanyCode;
  28 +
  29 + /**
  30 + * 车牌号
  31 + */
  32 + @JsonProperty("plate")
  33 + private String carPlate;
  34 + /**
  35 + * 设备终端号
  36 + */
  37 + private String equipmentCode;
  38 + /**
  39 + * 车辆类型
  40 + */
  41 + private String carType;
  42 + /**
  43 + * 是否机动车(机动车类型选择)
  44 + */
  45 + private String vehicleStats;
  46 +
  47 + /**
  48 + * 是否电车(TODO:在原系统里没有,这里暂时留着)
  49 + */
  50 + private Boolean sfdc;
  51 + /**
  52 + * 是否报废
  53 + */
  54 + private Boolean scrapState;
  55 +
  56 + /**
  57 + * RFID 车卡ID号(16进制)
  58 + */
  59 + private String idRfid;
  60 +
  61 + /**
  62 + * RFID 标签号
  63 + */
  64 + private String tagRfid;
  65 +
  66 + private String lineCode;
  67 +
  68 + private String lineName;
  69 +
  70 + private String remark;
  71 +
  72 + /**
  73 + * 位0为1 油
  74 + * 位1为1 电
  75 + * 位2为1 氢
  76 + */
  77 + private int energyType;
  78 +
  79 + /**
  80 + * 17位vin码
  81 + */
  82 + private String vin;
  83 +
  84 + public String getNbbm() {
  85 + return nbbm;
  86 + }
  87 +
  88 + public void setNbbm(String nbbm) {
  89 + this.nbbm = nbbm;
  90 + }
  91 +
  92 + public String getCompanyCode() {
  93 + return companyCode;
  94 + }
  95 +
  96 + public void setCompanyCode(String companyCode) {
  97 + this.companyCode = companyCode;
  98 + }
  99 +
  100 + public String getBrancheCompanyCode() {
  101 + return brancheCompanyCode;
  102 + }
  103 +
  104 + public void setBrancheCompanyCode(String brancheCompanyCode) {
  105 + this.brancheCompanyCode = brancheCompanyCode;
  106 + }
  107 +
  108 + public String getCarPlate() {
  109 + return carPlate;
  110 + }
  111 +
  112 + public void setCarPlate(String carPlate) {
  113 + this.carPlate = carPlate;
  114 + }
  115 +
  116 + public String getEquipmentCode() {
  117 + return equipmentCode;
  118 + }
  119 +
  120 + public void setEquipmentCode(String equipmentCode) {
  121 + this.equipmentCode = equipmentCode;
  122 + }
  123 +
  124 + public String getCarType() {
  125 + return carType;
  126 + }
  127 +
  128 + public void setCarType(String carType) {
  129 + this.carType = carType;
  130 + }
  131 +
  132 + public String getVehicleStats() {
  133 + return vehicleStats;
  134 + }
  135 +
  136 + public void setVehicleStats(String vehicleStats) {
  137 + this.vehicleStats = vehicleStats;
  138 + }
  139 +
  140 + public Boolean getSfdc() {
  141 + return sfdc;
  142 + }
  143 +
  144 + public void setSfdc(Boolean sfdc) {
  145 + this.sfdc = sfdc;
  146 + }
  147 +
  148 + public Boolean getScrapState() {
  149 + return scrapState;
  150 + }
  151 +
  152 + public void setScrapState(Boolean scrapState) {
  153 + this.scrapState = scrapState;
  154 + }
  155 +
  156 + public String getIdRfid() {
  157 + return idRfid;
  158 + }
  159 +
  160 + public void setIdRfid(String idRfid) {
  161 + this.idRfid = idRfid;
  162 + }
  163 +
  164 + public String getTagRfid() {
  165 + return tagRfid;
  166 + }
  167 +
  168 + public void setTagRfid(String tagRfid) {
  169 + this.tagRfid = tagRfid;
  170 + }
  171 +
  172 + public String getLineCode() {
  173 + return lineCode;
  174 + }
  175 +
  176 + public void setLineCode(String lineCode) {
  177 + this.lineCode = lineCode;
  178 + }
  179 +
  180 + public String getLineName() {
  181 + return lineName;
  182 + }
  183 +
  184 + public void setLineName(String lineName) {
  185 + this.lineName = lineName;
  186 + }
  187 +
  188 + public String getRemark() {
  189 + return remark;
  190 + }
  191 +
  192 + public void setRemark(String remark) {
  193 + this.remark = remark;
  194 + }
  195 +
  196 + public int getEnergyType() {
  197 + return energyType;
  198 + }
  199 +
  200 + public void setEnergyType(int energyType) {
  201 + this.energyType = energyType;
  202 + }
  203 +
  204 + public String getVin() {
  205 + return vin;
  206 + }
  207 +
  208 + public void setVin(String vin) {
  209 + this.vin = vin;
  210 + }
  211 +}
... ...
src/main/java/com/bsth/server_rs/base_info/car/CarRestService.java
1   -package com.bsth.server_rs.base_info.car;
2   -
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.TypeReference;
5   -import com.bsth.server_rs.base_info.car.buffer.CarBufferData;
6   -import com.bsth.server_rs.base_info.dto.BusCardDto;
7   -import org.apache.commons.lang3.StringEscapeUtils;
8   -
9   -import javax.ws.rs.*;
10   -import javax.ws.rs.core.MediaType;
11   -import java.util.List;
12   -import java.util.Map;
13   -
14   -/**
15   - * Created by panzhao on 2017/3/30.
16   - */
17   -@Path("/car")
18   -@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
19   -public class CarRestService {
20   -
21   - @GET
22   - @Path("/all")
23   - public List<Car> findAll(){
24   - return CarBufferData.findAll();
25   - }
26   -
27   - @GET
28   - @Path("/company/{companyId}")
29   - public List<Car> findByCompany(@PathParam("companyId") String companyId) {
30   - return companyId.equals("-9999") ? CarBufferData.findAll() : CarBufferData.findByCompany(companyId);
31   - }
32   -
33   - @GET
34   - @Path("/{nbbm}")
35   - public Car findOne(@PathParam("nbbm") String nbbm) {
36   - return CarBufferData.findOne(nbbm);
37   - }
38   -
39   - @POST
40   - @Path("/setCards")
41   - public Map<String, Object> multiPostCards(String bodyStr){
42   - bodyStr = StringEscapeUtils.unescapeHtml4(bodyStr);
43   - List<BusCardDto> list = JSON.parseObject(bodyStr, new TypeReference<List<BusCardDto>>() {});
44   - return CarBufferData.multiSaveCards(list);
45   - }
46   -}
  1 +package com.bsth.server_rs.base_info.car;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.TypeReference;
  5 +import com.bsth.server_rs.base_info.car.buffer.CarBufferData;
  6 +import com.bsth.server_rs.base_info.dto.BusCardDto;
  7 +import com.bsth.server_rs.base_info.person.PersonRestService;
  8 +import com.bsth.server_rs.base_info.person.Personnel;
  9 +import com.fasterxml.jackson.core.JsonProcessingException;
  10 +import com.fasterxml.jackson.databind.ObjectMapper;
  11 +import org.apache.commons.lang3.StringEscapeUtils;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +
  15 +import javax.ws.rs.*;
  16 +import javax.ws.rs.core.MediaType;
  17 +import java.util.HashMap;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * Created by panzhao on 2017/3/30.
  23 + */
  24 +@Path("/vehicle")
  25 +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
  26 +public class CarRestService {
  27 +
  28 + private final static Logger log = LoggerFactory.getLogger(CarRestService.class);
  29 +
  30 + private ObjectMapper mapper = new ObjectMapper();
  31 +
  32 + @GET
  33 + @Path("/all")
  34 + public List<Car> findAll(){
  35 + return CarBufferData.findAll();
  36 + }
  37 +
  38 + @GET
  39 + @Path("/company/{companyId}")
  40 + public List<Car> findByCompany(@PathParam("companyId") String companyId) {
  41 + return companyId.equals("-9999") ? CarBufferData.findAll() : CarBufferData.findByCompany(companyId);
  42 + }
  43 +
  44 + @GET
  45 + @Path("/{nbbm}")
  46 + public Car findOne(@PathParam("nbbm") String nbbm) {
  47 + return CarBufferData.findOne(nbbm);
  48 + }
  49 +
  50 + @POST
  51 + @Path("/setCards")
  52 + public Map<String, Object> multiPostCards(String bodyStr){
  53 + bodyStr = StringEscapeUtils.unescapeHtml4(bodyStr);
  54 + List<BusCardDto> list = JSON.parseObject(bodyStr, new TypeReference<List<BusCardDto>>() {});
  55 + return CarBufferData.multiSaveCards(list);
  56 + }
  57 +
  58 + @POST
  59 + @Path("")
  60 + public Map<String, Object> save(List<Car> cars) throws JsonProcessingException {
  61 + Map<String, Object> result = new HashMap<>();
  62 + log.info(mapper.writeValueAsString(cars));
  63 +
  64 + return result;
  65 + }
  66 +}
... ...
src/main/java/com/bsth/server_rs/base_info/line/Line.java
1   -package com.bsth.server_rs.base_info.line;
2   -
3   -import com.bsth.server_rs.adapter.DateTimeAdapter;
4   -
5   -import javax.xml.bind.annotation.XmlRootElement;
6   -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
7   -import java.io.Serializable;
8   -import java.util.Date;
9   -
10   -
11   -/**
12   - * @ClassName: Line(线路实体类)
13   - * @Description: TODO(线路)
14   - * @Author bsth@lq
15   - * @Date 2016-4-11 16:06:17
16   - * @Version 公交调度系统BS版 0.1
17   - */
18   -@XmlRootElement
19   -public class Line implements Serializable {
20   -
21   -
22   - /**线路名称 varchar length(50) 不能为空*/
23   - private String name;
24   -
25   - /** 线路编码 varchar length(50) 不能为空*/
26   - private String lineCode;
27   -
28   - /** 起始站名称*/
29   - private String startStationName;
30   -
31   - /** 终点站名称*/
32   - private String endStationName;
33   -
34   - /** 起始站首班车时间 00:00 */
35   - private String startStationFirstTime;
36   -
37   - /** 起始站末班车时间 00:00 */
38   - private String startStationEndTime;
39   -
40   - /** 终点站首班时间 00:00 */
41   - private String endStationFirstTime;
42   -
43   - /** 终点站末班时间 00:00 */
44   - private String endStationEndTime;
45   -
46   - /** 所属公司 */
47   - private String company;
48   -
49   - /**
50   - * 所属公司名称
51   - */
52   - private String companyName;
53   -
54   - /** 分公司 */
55   - private String brancheCompany;
56   -
57   - /** 性质(线路类型) */
58   - private String nature;
59   -
60   - /**线路等级 */
61   - private String level;
62   -
63   - /**是否撤销 <1:是;0:否> */
64   - private Integer destroy;
65   -
66   - /** 是否夜宵线 <1:是;0:否> */
67   - private Integer supperLine;
68   -
69   - /** 设备线路编码 */
70   - private String eqLinecode;
71   -
72   - /**
73   - * 创建日期 timestamp
74   - */
75   - private Date createDate;
76   -
77   - //-------------- 标准信息 -----------
78   - /** 标准总里程 */
79   - private Double totalMileage;
80   - /** 早高峰大间隔(分钟) */
81   - private Double earlyIntervalLg;
82   -
83   - /** 晚高峰大间隔(分钟) */
84   - private Double lateIntervalLg;
85   -
86   - /** 平时大间隔(分钟) */
87   - private Double intervalLg;
88   -
89   - /** 限速(平时) */
90   - private Double speedLimit;
91   -
92   - /** 滞站 */
93   - private Integer lagStation;
94   -
95   - /** 越站 */
96   - private Integer skip;
97   -
98   - /** 超速 */
99   - private Integer speeding;
100   -
101   - /** 串线 */
102   - private Integer crossedLine;
103   -
104   - /** 越界 */
105   - private Integer overflights;
106   -
107   - /**
108   - * 上海市线路编码
109   - */
110   - private String shanghaiLinecode;
111   -
112   - // 环线或双向
113   - private int linePlayType;
114   - // 区内/外
115   - private int region;
116   -
117   - /**
118   - * 运管处和app上线标识
119   - * @return
120   - */
121   - private Integer inUse;
122   -
123   - public String getName() {
124   - return name;
125   - }
126   -
127   - public void setName(String name) {
128   - this.name = name;
129   - }
130   -
131   - public String getLineCode() {
132   - return lineCode;
133   - }
134   -
135   - public void setLineCode(String lineCode) {
136   - this.lineCode = lineCode;
137   - }
138   -
139   - public String getStartStationName() {
140   - return startStationName;
141   - }
142   -
143   - public void setStartStationName(String startStationName) {
144   - this.startStationName = startStationName;
145   - }
146   -
147   - public String getEndStationName() {
148   - return endStationName;
149   - }
150   -
151   - public void setEndStationName(String endStationName) {
152   - this.endStationName = endStationName;
153   - }
154   -
155   - public String getStartStationFirstTime() {
156   - return startStationFirstTime;
157   - }
158   -
159   - public void setStartStationFirstTime(String startStationFirstTime) {
160   - this.startStationFirstTime = startStationFirstTime;
161   - }
162   -
163   - public String getStartStationEndTime() {
164   - return startStationEndTime;
165   - }
166   -
167   - public void setStartStationEndTime(String startStationEndTime) {
168   - this.startStationEndTime = startStationEndTime;
169   - }
170   -
171   - public String getEndStationFirstTime() {
172   - return endStationFirstTime;
173   - }
174   -
175   - public void setEndStationFirstTime(String endStationFirstTime) {
176   - this.endStationFirstTime = endStationFirstTime;
177   - }
178   -
179   - public String getEndStationEndTime() {
180   - return endStationEndTime;
181   - }
182   -
183   - public void setEndStationEndTime(String endStationEndTime) {
184   - this.endStationEndTime = endStationEndTime;
185   - }
186   -
187   - public String getCompany() {
188   - return company;
189   - }
190   -
191   - public void setCompany(String company) {
192   - this.company = company;
193   - }
194   -
195   - public String getCompanyName() {
196   - return companyName;
197   - }
198   -
199   - public void setCompanyName(String companyName) {
200   - this.companyName = companyName;
201   - }
202   -
203   - public String getBrancheCompany() {
204   - return brancheCompany;
205   - }
206   -
207   - public void setBrancheCompany(String brancheCompany) {
208   - this.brancheCompany = brancheCompany;
209   - }
210   -
211   - public String getNature() {
212   - return nature;
213   - }
214   -
215   - public void setNature(String nature) {
216   - this.nature = nature;
217   - }
218   -
219   - public String getLevel() {
220   - return level;
221   - }
222   -
223   - public void setLevel(String level) {
224   - this.level = level;
225   - }
226   -
227   - public Integer getDestroy() {
228   - return destroy;
229   - }
230   -
231   - public void setDestroy(Integer destroy) {
232   - this.destroy = destroy;
233   - }
234   -
235   - public Integer getSupperLine() {
236   - return supperLine;
237   - }
238   -
239   - public void setSupperLine(Integer supperLine) {
240   - this.supperLine = supperLine;
241   - }
242   -
243   - public String getEqLinecode() {
244   - return eqLinecode;
245   - }
246   -
247   - public void setEqLinecode(String eqLinecode) {
248   - this.eqLinecode = eqLinecode;
249   - }
250   -
251   - @XmlJavaTypeAdapter(DateTimeAdapter.class)
252   - public Date getCreateDate() {
253   - return createDate;
254   - }
255   -
256   - public void setCreateDate(Date createDate) {
257   - this.createDate = createDate;
258   - }
259   -
260   - public Double getTotalMileage() {
261   - return totalMileage;
262   - }
263   -
264   - public void setTotalMileage(Double totalMileage) {
265   - this.totalMileage = totalMileage;
266   - }
267   -
268   - public Double getEarlyIntervalLg() {
269   - return earlyIntervalLg;
270   - }
271   -
272   - public void setEarlyIntervalLg(Double earlyIntervalLg) {
273   - this.earlyIntervalLg = earlyIntervalLg;
274   - }
275   -
276   - public Double getLateIntervalLg() {
277   - return lateIntervalLg;
278   - }
279   -
280   - public void setLateIntervalLg(Double lateIntervalLg) {
281   - this.lateIntervalLg = lateIntervalLg;
282   - }
283   -
284   - public Double getIntervalLg() {
285   - return intervalLg;
286   - }
287   -
288   - public void setIntervalLg(Double intervalLg) {
289   - this.intervalLg = intervalLg;
290   - }
291   -
292   - public Double getSpeedLimit() {
293   - return speedLimit;
294   - }
295   -
296   - public void setSpeedLimit(Double speedLimit) {
297   - this.speedLimit = speedLimit;
298   - }
299   -
300   - public Integer getLagStation() {
301   - return lagStation;
302   - }
303   -
304   - public void setLagStation(Integer lagStation) {
305   - this.lagStation = lagStation;
306   - }
307   -
308   - public Integer getSkip() {
309   - return skip;
310   - }
311   -
312   - public void setSkip(Integer skip) {
313   - this.skip = skip;
314   - }
315   -
316   - public Integer getSpeeding() {
317   - return speeding;
318   - }
319   -
320   - public void setSpeeding(Integer speeding) {
321   - this.speeding = speeding;
322   - }
323   -
324   - public Integer getCrossedLine() {
325   - return crossedLine;
326   - }
327   -
328   - public void setCrossedLine(Integer crossedLine) {
329   - this.crossedLine = crossedLine;
330   - }
331   -
332   - public Integer getOverflights() {
333   - return overflights;
334   - }
335   -
336   - public void setOverflights(Integer overflights) {
337   - this.overflights = overflights;
338   - }
339   -
340   - public String getShanghaiLinecode() {
341   - return shanghaiLinecode;
342   - }
343   -
344   - public void setShanghaiLinecode(String shanghaiLinecode) {
345   - this.shanghaiLinecode = shanghaiLinecode;
346   - }
347   -
348   - public int getLinePlayType() {
349   - return linePlayType;
350   - }
351   -
352   - public void setLinePlayType(int linePlayType) {
353   - this.linePlayType = linePlayType;
354   - }
355   -
356   - public int getRegion() {
357   - return region;
358   - }
359   -
360   - public void setRegion(int region) {
361   - this.region = region;
362   - }
363   -
364   - public Integer getInUse() {
365   - return inUse;
366   - }
367   -
368   - public void setInUse(Integer inUse) {
369   - this.inUse = inUse;
370   - }
371   -}
  1 +package com.bsth.server_rs.base_info.line;
  2 +
  3 +import com.bsth.server_rs.adapter.DateTimeAdapter;
  4 +
  5 +import javax.xml.bind.annotation.XmlRootElement;
  6 +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  7 +import java.io.Serializable;
  8 +import java.util.Date;
  9 +
  10 +
  11 +/**
  12 + * @ClassName: Line(线路实体类)
  13 + * @Description: TODO(线路)
  14 + * @Author bsth@lq
  15 + * @Date 2016-4-11 16:06:17
  16 + * @Version 公交调度系统BS版 0.1
  17 + */
  18 +@XmlRootElement
  19 +public class Line implements Serializable {
  20 +
  21 +
  22 + /**线路名称 varchar length(50) 不能为空*/
  23 + private String name;
  24 +
  25 + /** 线路编码 varchar length(50) 不能为空*/
  26 + private String lineCode;
  27 +
  28 + /** 起始站名称*/
  29 + private String startStationName;
  30 +
  31 + /** 终点站名称*/
  32 + private String endStationName;
  33 +
  34 + /** 起始站首班车时间 00:00 */
  35 + private String startStationFirstTime;
  36 +
  37 + /** 起始站末班车时间 00:00 */
  38 + private String startStationEndTime;
  39 +
  40 + /** 终点站首班时间 00:00 */
  41 + private String endStationFirstTime;
  42 +
  43 + /** 终点站末班时间 00:00 */
  44 + private String endStationEndTime;
  45 +
  46 + /** 所属公司 */
  47 + private String company;
  48 +
  49 + /**
  50 + * 所属公司名称
  51 + */
  52 + private String companyName;
  53 +
  54 + /** 分公司 */
  55 + private String brancheCompany;
  56 +
  57 + /** 性质(线路类型) */
  58 + private String nature;
  59 +
  60 + /**线路等级 */
  61 + private String level;
  62 +
  63 + /**是否撤销 <1:是;0:否> */
  64 + private Integer destroy;
  65 +
  66 + /** 是否夜宵线 <1:是;0:否> */
  67 + private Integer supperLine;
  68 +
  69 + /** 设备线路编码 */
  70 + private String eqLinecode;
  71 +
  72 + /**
  73 + * 创建日期 timestamp
  74 + */
  75 + private Date createDate;
  76 +
  77 + //-------------- 标准信息 -----------
  78 + /** 标准总里程 */
  79 + private Double totalMileage;
  80 + /** 早高峰大间隔(分钟) */
  81 + private Double earlyIntervalLg;
  82 +
  83 + /** 晚高峰大间隔(分钟) */
  84 + private Double lateIntervalLg;
  85 +
  86 + /** 平时大间隔(分钟) */
  87 + private Double intervalLg;
  88 +
  89 + /** 限速(平时) */
  90 + private Double speedLimit;
  91 +
  92 + /** 滞站 */
  93 + private Integer lagStation;
  94 +
  95 + /** 越站 */
  96 + private Integer skip;
  97 +
  98 + /** 超速 */
  99 + private Integer speeding;
  100 +
  101 + /** 串线 */
  102 + private Integer crossedLine;
  103 +
  104 + /** 越界 */
  105 + private Integer overflights;
  106 +
  107 + /**
  108 + * 上海市线路编码
  109 + */
  110 + private String shanghaiLinecode;
  111 +
  112 + // 环线或双向
  113 + private int linePlayType;
  114 + // 区内/外
  115 + private int region;
  116 +
  117 + /**
  118 + * 运管处和app上线标识
  119 + * @return
  120 + */
  121 + private Integer inUse;
  122 +
  123 + private Double upMileage;
  124 +
  125 + private Double downMileage;
  126 +
  127 + private Double upTravelTime;
  128 +
  129 + private Double downTravelTime;
  130 +
  131 + public String getName() {
  132 + return name;
  133 + }
  134 +
  135 + public void setName(String name) {
  136 + this.name = name;
  137 + }
  138 +
  139 + public String getLineCode() {
  140 + return lineCode;
  141 + }
  142 +
  143 + public void setLineCode(String lineCode) {
  144 + this.lineCode = lineCode;
  145 + }
  146 +
  147 + public String getStartStationName() {
  148 + return startStationName;
  149 + }
  150 +
  151 + public void setStartStationName(String startStationName) {
  152 + this.startStationName = startStationName;
  153 + }
  154 +
  155 + public String getEndStationName() {
  156 + return endStationName;
  157 + }
  158 +
  159 + public void setEndStationName(String endStationName) {
  160 + this.endStationName = endStationName;
  161 + }
  162 +
  163 + public String getStartStationFirstTime() {
  164 + return startStationFirstTime;
  165 + }
  166 +
  167 + public void setStartStationFirstTime(String startStationFirstTime) {
  168 + this.startStationFirstTime = startStationFirstTime;
  169 + }
  170 +
  171 + public String getStartStationEndTime() {
  172 + return startStationEndTime;
  173 + }
  174 +
  175 + public void setStartStationEndTime(String startStationEndTime) {
  176 + this.startStationEndTime = startStationEndTime;
  177 + }
  178 +
  179 + public String getEndStationFirstTime() {
  180 + return endStationFirstTime;
  181 + }
  182 +
  183 + public void setEndStationFirstTime(String endStationFirstTime) {
  184 + this.endStationFirstTime = endStationFirstTime;
  185 + }
  186 +
  187 + public String getEndStationEndTime() {
  188 + return endStationEndTime;
  189 + }
  190 +
  191 + public void setEndStationEndTime(String endStationEndTime) {
  192 + this.endStationEndTime = endStationEndTime;
  193 + }
  194 +
  195 + public String getCompany() {
  196 + return company;
  197 + }
  198 +
  199 + public void setCompany(String company) {
  200 + this.company = company;
  201 + }
  202 +
  203 + public String getCompanyName() {
  204 + return companyName;
  205 + }
  206 +
  207 + public void setCompanyName(String companyName) {
  208 + this.companyName = companyName;
  209 + }
  210 +
  211 + public String getBrancheCompany() {
  212 + return brancheCompany;
  213 + }
  214 +
  215 + public void setBrancheCompany(String brancheCompany) {
  216 + this.brancheCompany = brancheCompany;
  217 + }
  218 +
  219 + public String getNature() {
  220 + return nature;
  221 + }
  222 +
  223 + public void setNature(String nature) {
  224 + this.nature = nature;
  225 + }
  226 +
  227 + public String getLevel() {
  228 + return level;
  229 + }
  230 +
  231 + public void setLevel(String level) {
  232 + this.level = level;
  233 + }
  234 +
  235 + public Integer getDestroy() {
  236 + return destroy;
  237 + }
  238 +
  239 + public void setDestroy(Integer destroy) {
  240 + this.destroy = destroy;
  241 + }
  242 +
  243 + public Integer getSupperLine() {
  244 + return supperLine;
  245 + }
  246 +
  247 + public void setSupperLine(Integer supperLine) {
  248 + this.supperLine = supperLine;
  249 + }
  250 +
  251 + public String getEqLinecode() {
  252 + return eqLinecode;
  253 + }
  254 +
  255 + public void setEqLinecode(String eqLinecode) {
  256 + this.eqLinecode = eqLinecode;
  257 + }
  258 +
  259 + @XmlJavaTypeAdapter(DateTimeAdapter.class)
  260 + public Date getCreateDate() {
  261 + return createDate;
  262 + }
  263 +
  264 + public void setCreateDate(Date createDate) {
  265 + this.createDate = createDate;
  266 + }
  267 +
  268 + public Double getTotalMileage() {
  269 + return totalMileage;
  270 + }
  271 +
  272 + public void setTotalMileage(Double totalMileage) {
  273 + this.totalMileage = totalMileage;
  274 + }
  275 +
  276 + public Double getEarlyIntervalLg() {
  277 + return earlyIntervalLg;
  278 + }
  279 +
  280 + public void setEarlyIntervalLg(Double earlyIntervalLg) {
  281 + this.earlyIntervalLg = earlyIntervalLg;
  282 + }
  283 +
  284 + public Double getLateIntervalLg() {
  285 + return lateIntervalLg;
  286 + }
  287 +
  288 + public void setLateIntervalLg(Double lateIntervalLg) {
  289 + this.lateIntervalLg = lateIntervalLg;
  290 + }
  291 +
  292 + public Double getIntervalLg() {
  293 + return intervalLg;
  294 + }
  295 +
  296 + public void setIntervalLg(Double intervalLg) {
  297 + this.intervalLg = intervalLg;
  298 + }
  299 +
  300 + public Double getSpeedLimit() {
  301 + return speedLimit;
  302 + }
  303 +
  304 + public void setSpeedLimit(Double speedLimit) {
  305 + this.speedLimit = speedLimit;
  306 + }
  307 +
  308 + public Integer getLagStation() {
  309 + return lagStation;
  310 + }
  311 +
  312 + public void setLagStation(Integer lagStation) {
  313 + this.lagStation = lagStation;
  314 + }
  315 +
  316 + public Integer getSkip() {
  317 + return skip;
  318 + }
  319 +
  320 + public void setSkip(Integer skip) {
  321 + this.skip = skip;
  322 + }
  323 +
  324 + public Integer getSpeeding() {
  325 + return speeding;
  326 + }
  327 +
  328 + public void setSpeeding(Integer speeding) {
  329 + this.speeding = speeding;
  330 + }
  331 +
  332 + public Integer getCrossedLine() {
  333 + return crossedLine;
  334 + }
  335 +
  336 + public void setCrossedLine(Integer crossedLine) {
  337 + this.crossedLine = crossedLine;
  338 + }
  339 +
  340 + public Integer getOverflights() {
  341 + return overflights;
  342 + }
  343 +
  344 + public void setOverflights(Integer overflights) {
  345 + this.overflights = overflights;
  346 + }
  347 +
  348 + public String getShanghaiLinecode() {
  349 + return shanghaiLinecode;
  350 + }
  351 +
  352 + public void setShanghaiLinecode(String shanghaiLinecode) {
  353 + this.shanghaiLinecode = shanghaiLinecode;
  354 + }
  355 +
  356 + public int getLinePlayType() {
  357 + return linePlayType;
  358 + }
  359 +
  360 + public void setLinePlayType(int linePlayType) {
  361 + this.linePlayType = linePlayType;
  362 + }
  363 +
  364 + public int getRegion() {
  365 + return region;
  366 + }
  367 +
  368 + public void setRegion(int region) {
  369 + this.region = region;
  370 + }
  371 +
  372 + public Integer getInUse() {
  373 + return inUse;
  374 + }
  375 +
  376 + public void setInUse(Integer inUse) {
  377 + this.inUse = inUse;
  378 + }
  379 +
  380 + public Double getUpMileage() {
  381 + return upMileage;
  382 + }
  383 +
  384 + public void setUpMileage(Double upMileage) {
  385 + this.upMileage = upMileage;
  386 + }
  387 +
  388 + public Double getDownMileage() {
  389 + return downMileage;
  390 + }
  391 +
  392 + public void setDownMileage(Double downMileage) {
  393 + this.downMileage = downMileage;
  394 + }
  395 +
  396 + public Double getUpTravelTime() {
  397 + return upTravelTime;
  398 + }
  399 +
  400 + public void setUpTravelTime(Double upTravelTime) {
  401 + this.upTravelTime = upTravelTime;
  402 + }
  403 +
  404 + public Double getDownTravelTime() {
  405 + return downTravelTime;
  406 + }
  407 +
  408 + public void setDownTravelTime(Double downTravelTime) {
  409 + this.downTravelTime = downTravelTime;
  410 + }
  411 +}
... ...
src/main/java/com/bsth/server_rs/base_info/line/LineRestService.java
1 1 package com.bsth.server_rs.base_info.line;
2 2  
3 3 import com.bsth.server_rs.base_info.line.buffer.LineBufferData;
  4 +import com.bsth.server_rs.schedule.ScheduleRealService;
  5 +import com.fasterxml.jackson.core.JsonProcessingException;
  6 +import com.fasterxml.jackson.databind.ObjectMapper;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
4 9  
5   -import javax.ws.rs.GET;
6   -import javax.ws.rs.Path;
7   -import javax.ws.rs.PathParam;
8   -import javax.ws.rs.Produces;
  10 +import javax.ws.rs.*;
9 11 import javax.ws.rs.core.MediaType;
10   -import java.util.ArrayList;
11   -import java.util.Arrays;
12   -import java.util.List;
13   -import java.util.stream.Collectors;
  12 +import java.util.*;
14 13  
15 14 /**
16 15 * 线路 Rest Service
... ... @@ -20,6 +19,10 @@ import java.util.stream.Collectors;
20 19 @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
21 20 public class LineRestService {
22 21  
  22 + private final static Logger log = LoggerFactory.getLogger(LineRestService.class);
  23 +
  24 + private ObjectMapper mapper = new ObjectMapper();
  25 +
23 26 @GET
24 27 @Path("/all")
25 28 public List<Line> findAll(){
... ... @@ -52,4 +55,13 @@ public class LineRestService {
52 55 public Line findOne(@PathParam("lineCode") String lineCode) {
53 56 return LineBufferData.findOne(lineCode);
54 57 }
  58 +
  59 + @POST
  60 + @Path("")
  61 + public Map<String, Object> save(List<Line> lines) throws JsonProcessingException {
  62 + Map<String, Object> result = new HashMap<>();
  63 + log.info(mapper.writeValueAsString(lines));
  64 +
  65 + return result;
  66 + }
55 67 }
... ...
src/main/java/com/bsth/server_rs/base_info/person/PersonRestService.java
1   -package com.bsth.server_rs.base_info.person;
2   -
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.TypeReference;
5   -import com.bsth.server_rs.base_info.dto.PersonCardDto;
6   -import com.bsth.server_rs.base_info.person.buffer.PersonBufferData;
7   -import org.apache.commons.lang3.StringEscapeUtils;
8   -
9   -import javax.ws.rs.*;
10   -import javax.ws.rs.core.MediaType;
11   -import java.util.List;
12   -import java.util.Map;
13   -
14   -/**
15   - * Created by panzhao on 2017/3/28.
16   - */
17   -@Path("/person")
18   -@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
19   -public class PersonRestService {
20   -
21   - @GET
22   - @Path("/all")
23   - public List<Personnel> findAll(){
24   - return PersonBufferData.findAll();
25   - }
26   -
27   - @GET
28   - @Path("/company/{companyId}")
29   - public List<Personnel> findByCompany(@PathParam("companyId") String companyId) {
30   - return companyId.equals("-9999") ? PersonBufferData.findAll() : PersonBufferData.findByCompany(companyId);
31   - }
32   -
33   - @GET
34   - @Path("/{workId}")
35   - public Personnel findOne(@PathParam("workId") String workId) {
36   - return PersonBufferData.findOne(workId);
37   - }
38   -
39   - @POST
40   - @Path("/setCards")
41   - public Map<String, Object> multiPostCards(String bodyStr){
42   - bodyStr = StringEscapeUtils.unescapeHtml4(bodyStr);
43   - List<PersonCardDto> list = JSON.parseObject(bodyStr, new TypeReference<List<PersonCardDto>>() {});
44   - return PersonBufferData.multiSaveCards(list);
45   - }
46   -}
  1 +package com.bsth.server_rs.base_info.person;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.TypeReference;
  5 +import com.bsth.server_rs.base_info.dto.PersonCardDto;
  6 +import com.bsth.server_rs.base_info.line.LineRestService;
  7 +import com.bsth.server_rs.base_info.person.buffer.PersonBufferData;
  8 +import com.bsth.server_rs.base_info.station.entity.StationRotue;
  9 +import com.fasterxml.jackson.core.JsonProcessingException;
  10 +import com.fasterxml.jackson.databind.ObjectMapper;
  11 +import org.apache.commons.lang3.StringEscapeUtils;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +
  15 +import javax.ws.rs.*;
  16 +import javax.ws.rs.core.MediaType;
  17 +import java.util.HashMap;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * Created by panzhao on 2017/3/28.
  23 + */
  24 +@Path("/employee")
  25 +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
  26 +public class PersonRestService {
  27 +
  28 + private final static Logger log = LoggerFactory.getLogger(PersonRestService.class);
  29 +
  30 + private ObjectMapper mapper = new ObjectMapper();
  31 +
  32 + @GET
  33 + @Path("/all")
  34 + public List<Personnel> findAll(){
  35 + return PersonBufferData.findAll();
  36 + }
  37 +
  38 + @GET
  39 + @Path("/company/{companyId}")
  40 + public List<Personnel> findByCompany(@PathParam("companyId") String companyId) {
  41 + return companyId.equals("-9999") ? PersonBufferData.findAll() : PersonBufferData.findByCompany(companyId);
  42 + }
  43 +
  44 + @GET
  45 + @Path("/{workId}")
  46 + public Personnel findOne(@PathParam("workId") String workId) {
  47 + return PersonBufferData.findOne(workId);
  48 + }
  49 +
  50 + @POST
  51 + @Path("/setCards")
  52 + public Map<String, Object> multiPostCards(String bodyStr){
  53 + bodyStr = StringEscapeUtils.unescapeHtml4(bodyStr);
  54 + List<PersonCardDto> list = JSON.parseObject(bodyStr, new TypeReference<List<PersonCardDto>>() {});
  55 + return PersonBufferData.multiSaveCards(list);
  56 + }
  57 +
  58 + @POST
  59 + @Path("")
  60 + public Map<String, Object> save(List<Personnel> personnels) throws JsonProcessingException {
  61 + Map<String, Object> result = new HashMap<>();
  62 + log.info(mapper.writeValueAsString(personnels));
  63 +
  64 + return result;
  65 + }
  66 +}
... ...
src/main/java/com/bsth/server_rs/base_info/station/StationRestService.java
1   -package com.bsth.server_rs.base_info.station;
2   -
3   -import com.bsth.server_rs.base_info.station.buffer.StationBufferData;
4   -import com.bsth.server_rs.base_info.station.entity.StationRotue;
5   -import org.springframework.stereotype.Component;
6   -
7   -import javax.ws.rs.GET;
8   -import javax.ws.rs.Path;
9   -import javax.ws.rs.PathParam;
10   -import javax.ws.rs.Produces;
11   -import javax.ws.rs.core.MediaType;
12   -import java.util.Collection;
13   -import java.util.Map;
14   -
15   -/**
16   - * Created by panzhao on 2017/8/31.
17   - */
18   -@Component
19   -@Path("/station")
20   -@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
21   -public class StationRestService {
22   -
23   - @GET
24   - @Path("/all")
25   - public Map<String, Collection<StationRotue>> findAll(){
26   - return StationBufferData.findAllRoute();
27   - }
28   -
29   - @GET
30   - @Path("/{company}")
31   - public Map<String, Collection<StationRotue>> findByCompany(@PathParam("company") String company){
32   - return StationBufferData.findRouteByCompany(company);
33   - }
34   -
35   - @GET
36   - @Path("/line/{lineCode}")
37   - public Map<String, Collection<StationRotue>> findByLineCode(@PathParam("lineCode") String lineCode){
38   - return StationBufferData.findRouteByLineCode(lineCode);
39   - }
40   -}
  1 +package com.bsth.server_rs.base_info.station;
  2 +
  3 +import com.bsth.server_rs.base_info.line.Line;
  4 +import com.bsth.server_rs.base_info.line.LineRestService;
  5 +import com.bsth.server_rs.base_info.station.buffer.StationBufferData;
  6 +import com.bsth.server_rs.base_info.station.entity.StationRotue;
  7 +import com.fasterxml.jackson.core.JsonProcessingException;
  8 +import com.fasterxml.jackson.databind.ObjectMapper;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import javax.ws.rs.*;
  14 +import javax.ws.rs.core.MediaType;
  15 +import java.util.Collection;
  16 +import java.util.HashMap;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +
  20 +/**
  21 + * Created by panzhao on 2017/8/31.
  22 + */
  23 +@Component
  24 +@Path("/station")
  25 +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
  26 +public class StationRestService {
  27 +
  28 + private final static Logger log = LoggerFactory.getLogger(StationRestService.class);
  29 +
  30 + private ObjectMapper mapper = new ObjectMapper();
  31 +
  32 + @GET
  33 + @Path("/all")
  34 + public Map<String, Collection<StationRotue>> findAll(){
  35 + return StationBufferData.findAllRoute();
  36 + }
  37 +
  38 + @GET
  39 + @Path("/{company}")
  40 + public Map<String, Collection<StationRotue>> findByCompany(@PathParam("company") String company){
  41 + return StationBufferData.findRouteByCompany(company);
  42 + }
  43 +
  44 + @GET
  45 + @Path("/line/{lineCode}")
  46 + public Map<String, Collection<StationRotue>> findByLineCode(@PathParam("lineCode") String lineCode){
  47 + return StationBufferData.findRouteByLineCode(lineCode);
  48 + }
  49 +
  50 + @POST
  51 + @Path("")
  52 + public Map<String, Object> save(List<StationRotue> stationRotues) throws JsonProcessingException {
  53 + Map<String, Object> result = new HashMap<>();
  54 + log.info(mapper.writeValueAsString(stationRotues));
  55 +
  56 + return result;
  57 + }
  58 +}
... ...
src/main/java/com/bsth/server_rs/base_info/station/entity/StationRotue.java
1   -package com.bsth.server_rs.base_info.station.entity;
2   -
3   -/**
4   - * Created by panzhao on 2017/8/31.
5   - */
6   -public class StationRotue {
7   -
8   - /** 线路编码 */
9   - private String lineCode;
10   -
11   - /** 站点路由序号 */
12   - private Integer stationRouteCode;
13   -
14   - private String stationCode;
15   -
16   - private String stationName;
17   -
18   - private Station station;
19   -
20   - /**
21   - * 站点类型
22   - * ------ B:起点站
23   - * ------ Z:中途站
24   - * ------ E:终点站
25   - * ------ T:停车场
26   - */
27   - private String stationMark;
28   -
29   - /** 站点路由到站距离 */
30   - private Double distances;
31   -
32   - /** 站点路由到站时间 */
33   - private Double toTime;
34   -
35   - /** 首班时间 */
36   - private String firstTime;
37   -
38   - /** 末班时间 */
39   - private String endTime;
40   -
41   - /** 站点路由方向 */
42   - private Integer directions;
43   -
44   - /** 版本号 */
45   - private Integer versions;
46   -
47   - public String getLineCode() {
48   - return lineCode;
49   - }
50   -
51   - public void setLineCode(String lineCode) {
52   - this.lineCode = lineCode;
53   - }
54   -
55   - public Integer getStationRouteCode() {
56   - return stationRouteCode;
57   - }
58   -
59   - public void setStationRouteCode(Integer stationRouteCode) {
60   - this.stationRouteCode = stationRouteCode;
61   - }
62   -
63   - public Station getStation() {
64   - return station;
65   - }
66   -
67   - public void setStation(Station station) {
68   - this.station = station;
69   - }
70   -
71   - public String getStationMark() {
72   - return stationMark;
73   - }
74   -
75   - public void setStationMark(String stationMark) {
76   - this.stationMark = stationMark;
77   - }
78   -
79   - public Double getDistances() {
80   - return distances;
81   - }
82   -
83   - public void setDistances(Double distances) {
84   - this.distances = distances;
85   - }
86   -
87   - public Double getToTime() {
88   - return toTime;
89   - }
90   -
91   - public void setToTime(Double toTime) {
92   - this.toTime = toTime;
93   - }
94   -
95   - public String getFirstTime() {
96   - return firstTime;
97   - }
98   -
99   - public void setFirstTime(String firstTime) {
100   - this.firstTime = firstTime;
101   - }
102   -
103   - public String getEndTime() {
104   - return endTime;
105   - }
106   -
107   - public void setEndTime(String endTime) {
108   - this.endTime = endTime;
109   - }
110   -
111   - public Integer getDirections() {
112   - return directions;
113   - }
114   -
115   - public void setDirections(Integer directions) {
116   - this.directions = directions;
117   - }
118   -
119   - public Integer getVersions() {
120   - return versions;
121   - }
122   -
123   - public void setVersions(Integer versions) {
124   - this.versions = versions;
125   - }
126   -
127   - public String getStationCode() {
128   - return stationCode;
129   - }
130   -
131   - public void setStationCode(String stationCode) {
132   - this.stationCode = stationCode;
133   - }
134   -
135   - public String getStationName() {
136   - return stationName;
137   - }
138   -
139   - public void setStationName(String stationName) {
140   - this.stationName = stationName;
141   - }
142   -}
  1 +package com.bsth.server_rs.base_info.station.entity;
  2 +
  3 +/**
  4 + * Created by panzhao on 2017/8/31.
  5 + */
  6 +public class StationRotue {
  7 +
  8 + /** 线路编码 */
  9 + private String lineCode;
  10 +
  11 + /** 站点路由序号 */
  12 + private Integer stationRouteCode;
  13 +
  14 + private String stationCode;
  15 +
  16 + private String stationName;
  17 +
  18 + private Station station;
  19 +
  20 + /**
  21 + * 站点类型
  22 + * ------ B:起点站
  23 + * ------ Z:中途站
  24 + * ------ E:终点站
  25 + * ------ T:停车场
  26 + */
  27 + private String stationMark;
  28 +
  29 + /** 站点路由到站距离 */
  30 + private Double distances;
  31 +
  32 + /** 站点路由到站时间 */
  33 + private Double toTime;
  34 +
  35 + /** 首班时间 */
  36 + private String firstTime;
  37 +
  38 + /** 末班时间 */
  39 + private String endTime;
  40 +
  41 + /** 站点路由方向 */
  42 + private Integer directions;
  43 +
  44 + /** 版本号 */
  45 + private Integer versions;
  46 +
  47 + private Float lon;
  48 +
  49 + private Float lat;
  50 +
  51 + public String getLineCode() {
  52 + return lineCode;
  53 + }
  54 +
  55 + public void setLineCode(String lineCode) {
  56 + this.lineCode = lineCode;
  57 + }
  58 +
  59 + public Integer getStationRouteCode() {
  60 + return stationRouteCode;
  61 + }
  62 +
  63 + public void setStationRouteCode(Integer stationRouteCode) {
  64 + this.stationRouteCode = stationRouteCode;
  65 + }
  66 +
  67 + public Station getStation() {
  68 + return station;
  69 + }
  70 +
  71 + public void setStation(Station station) {
  72 + this.station = station;
  73 + }
  74 +
  75 + public String getStationMark() {
  76 + return stationMark;
  77 + }
  78 +
  79 + public void setStationMark(String stationMark) {
  80 + this.stationMark = stationMark;
  81 + }
  82 +
  83 + public Double getDistances() {
  84 + return distances;
  85 + }
  86 +
  87 + public void setDistances(Double distances) {
  88 + this.distances = distances;
  89 + }
  90 +
  91 + public Double getToTime() {
  92 + return toTime;
  93 + }
  94 +
  95 + public void setToTime(Double toTime) {
  96 + this.toTime = toTime;
  97 + }
  98 +
  99 + public String getFirstTime() {
  100 + return firstTime;
  101 + }
  102 +
  103 + public void setFirstTime(String firstTime) {
  104 + this.firstTime = firstTime;
  105 + }
  106 +
  107 + public String getEndTime() {
  108 + return endTime;
  109 + }
  110 +
  111 + public void setEndTime(String endTime) {
  112 + this.endTime = endTime;
  113 + }
  114 +
  115 + public Integer getDirections() {
  116 + return directions;
  117 + }
  118 +
  119 + public void setDirections(Integer directions) {
  120 + this.directions = directions;
  121 + }
  122 +
  123 + public Integer getVersions() {
  124 + return versions;
  125 + }
  126 +
  127 + public void setVersions(Integer versions) {
  128 + this.versions = versions;
  129 + }
  130 +
  131 + public String getStationCode() {
  132 + return stationCode;
  133 + }
  134 +
  135 + public void setStationCode(String stationCode) {
  136 + this.stationCode = stationCode;
  137 + }
  138 +
  139 + public String getStationName() {
  140 + return stationName;
  141 + }
  142 +
  143 + public void setStationName(String stationName) {
  144 + this.stationName = stationName;
  145 + }
  146 +
  147 + public Float getLon() {
  148 + return lon;
  149 + }
  150 +
  151 + public void setLon(Float lon) {
  152 + this.lon = lon;
  153 + }
  154 +
  155 + public Float getLat() {
  156 + return lat;
  157 + }
  158 +
  159 + public void setLat(Float lat) {
  160 + this.lat = lat;
  161 + }
  162 +}
... ...
src/main/java/com/bsth/server_rs/gps/buffer/BasicDataRefreshThread.java
1   -package com.bsth.server_rs.gps.buffer;
2   -
3   -import java.sql.ResultSet;
4   -import java.sql.SQLException;
5   -import java.util.ArrayList;
6   -import java.util.List;
7   -import java.util.Map;
8   -
9   -import org.slf4j.Logger;
10   -import org.slf4j.LoggerFactory;
11   -import org.springframework.beans.factory.InitializingBean;
12   -import org.springframework.beans.factory.annotation.Autowired;
13   -import org.springframework.jdbc.core.JdbcTemplate;
14   -import org.springframework.jdbc.core.RowMapper;
15   -import org.springframework.stereotype.Component;
16   -
17   -import com.bsth.server_rs.gps.entity.LineInfo;
18   -import com.bsth.server_rs.gps.entity.Point;
19   -import com.bsth.server_rs.gps.entity.StopInfo;
20   -
21   -/**
22   - * Created by panzhao on 2017/3/30.
23   - */
24   -@Component
25   -public class BasicDataRefreshThread extends Thread implements InitializingBean {
26   -
27   - Logger logger = LoggerFactory.getLogger(this.getClass());
28   -
29   - @Autowired
30   - private JdbcTemplate jdbcTemplate;
31   -
32   - @Override
33   - public void run() {
34   - loadBasicData();
35   - }
36   -
37   - private void loadBasicData() {
38   - try {
39   - String qline = "select a.id,in_use,line_code,name,start_station_name,start_station_first_time,start_station_end_time,end_station_name,end_station_first_time,end_station_end_time,company,branche_company,length,telephone,speed_limit,shanghai_linecode,line_play_type,up_travel_time,down_travel_time from bsth_c_line a left join bsth_c_line_information b on a.id = b.line where a.destroy = 0 and a.nature = 'hlwgj'";
40   - String qstop = "select b.id,b.station_cod,b.station_name,b.road_coding,b.g_lonx,b.g_laty,b.shapes_type,b.radius,AsText(b.g_polygon_grid) as g_polygon_grid,a.line,a.line_code,a.directions,a.distances from bsth_c_stationroute a join bsth_c_station b on a.station = b.id where a.destroy = 0 order by a.line,a.directions,a.station_route_code";
41   - String qcar = "select equipment_code device_id, car_plate plate_no from bsth_c_cars";
42   -
43   - List<LineInfo> lines = jdbcTemplate.query(qline, new RowMapperLineInfo());
44   - List<StopInfo> stops = jdbcTemplate.query(qstop, new RowMapperStopInfo());
45   - List<Map<String, Object>> cars = jdbcTemplate.queryForList(qcar);
46   -
47   - // 缓存线路基本信息
48   - for (LineInfo line : lines) {
49   - BasicDataBuffer.putLine(line.getLineId(), line);
50   - }
51   -
52   - // 线路信息中添加上下行站点信息
53   - int oldId = -1;
54   - LineInfo line = null;
55   - for (StopInfo stop : stops) {
56   - if (stop.getLineCode() != oldId) {
57   - oldId = stop.getLineCode();
58   - line = BasicDataBuffer.getLineById(oldId);
59   - }
60   - if (line != null) {
61   - if (stop.getDirections() == 0) line.getStopsUp().add(stop);
62   - else line.getStopsDown().add(stop);
63   - }
64   - }
65   -
66   - for (Map<String, Object> car : cars) {
67   - BasicDataBuffer.putCar((String)car.get("device_id"), (String)car.get("plate_no"));
68   - }
69   -
70   - logger.info("基础数据加载成功");
71   - }catch (Exception e){
72   - logger.error("基础数据加载失败", e);
73   - }
74   - }
75   -
76   - final class RowMapperLineInfo implements RowMapper<LineInfo> {
77   -
78   - @Override
79   - public LineInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
80   - // TODO Auto-generated method stub
81   - LineInfo line = new LineInfo();
82   - line.setId(rs.getInt("id"));
83   - line.setInUse(rs.getInt("in_use"));
84   - line.setLineId(rs.getInt("line_code"));
85   - line.setLineName(rs.getString("name"));
86   - //line.setStartStation(rs.getInt("start_station"));
87   - line.setStartStationName(rs.getString("start_station_name"));
88   - line.setStartStationFirstTime(rs.getString("start_station_first_time"));
89   - line.setStartStationEndTime(rs.getString("start_station_end_time"));
90   - //line.setEndStation(rs.getInt("end_station"));
91   - line.setEndStationName(rs.getString("end_station_name"));
92   - line.setEndStationFirstTime(rs.getString("end_station_first_time"));
93   - line.setEndStationEndTime(rs.getString("end_station_end_time"));
94   - line.setCompany(rs.getString("company"));
95   - line.setBrancheCompany(rs.getString("branche_company"));
96   - line.setTelephone(rs.getString("telephone"));
97   - line.setLinePlayType(rs.getInt("line_play_type"));
98   - return line;
99   - }
100   -
101   - }
102   -
103   - final class RowMapperStopInfo implements RowMapper<StopInfo> {
104   -
105   - @Override
106   - public StopInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
107   - // TODO Auto-generated method stub
108   - StopInfo stop = new StopInfo();
109   - stop.setId(rs.getInt("id"));
110   - stop.setStationCod(rs.getString("station_cod"));
111   - stop.setStationName(rs.getString("station_name"));
112   - //stop.setStationType(rs.getString("station_type"));
113   - stop.setRoadCoding(rs.getString("road_coding"));
114   - float lon = rs.getFloat("g_lonx");
115   - float lat = rs.getFloat("g_laty");
116   - stop.setPoint(new Point(lon, lat));
117   - stop.setLineId(rs.getInt("line"));
118   - stop.setLineCode(rs.getInt("line_code"));
119   - stop.setDirections(rs.getInt("directions"));
120   - stop.setShapesType(rs.getString("shapes_type"));
121   - stop.setRadius(rs.getInt("radius"));
122   - stop.setPoints(new ArrayList<Point>());
123   - stop.setDistances(rs.getDouble("distances")*1000);
124   - return stop;
125   - }
126   -
127   - }
128   -
129   - @Override
130   - public void afterPropertiesSet() throws Exception {
131   - // TODO Auto-generated method stub
132   - loadBasicData();
133   - }
134   -}
  1 +package com.bsth.server_rs.gps.buffer;
  2 +
  3 +import java.sql.ResultSet;
  4 +import java.sql.SQLException;
  5 +import java.util.ArrayList;
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.factory.InitializingBean;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.jdbc.core.JdbcTemplate;
  14 +import org.springframework.jdbc.core.RowMapper;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import com.bsth.server_rs.gps.entity.LineInfo;
  18 +import com.bsth.server_rs.gps.entity.Point;
  19 +import com.bsth.server_rs.gps.entity.StopInfo;
  20 +
  21 +/**
  22 + * Created by panzhao on 2017/3/30.
  23 + */
  24 +@Component
  25 +public class BasicDataRefreshThread extends Thread implements InitializingBean {
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Autowired
  30 + private JdbcTemplate jdbcTemplate;
  31 +
  32 + @Override
  33 + public void run() {
  34 + loadBasicData();
  35 + }
  36 +
  37 + private void loadBasicData() {
  38 + try {
  39 + String qline = "select a.id,in_use,line_code,name,start_station_name,start_station_first_time,start_station_end_time,end_station_name,end_station_first_time,end_station_end_time,company,branche_company,length,telephone,speed_limit,shanghai_linecode,line_play_type,up_travel_time,down_travel_time from bsth_c_line a left join bsth_c_line_information b on a.id = b.line where a.destroy = 0 and a.nature = 'hlwgj'";
  40 + String qstop = "select b.id,b.station_cod,b.station_name,b.road_coding,b.g_lonx,b.g_laty,b.shapes_type,b.radius,AsText(b.g_polygon_grid) as g_polygon_grid,a.line,a.line_code,a.directions,a.distances from bsth_c_stationroute a join bsth_c_station b on a.station = b.id where a.destroy = 0 order by a.line,a.directions,a.station_route_code";
  41 + String qcar = "select equipment_code device_id, car_plate plate_no from bsth_c_cars";
  42 +
  43 + List<LineInfo> lines = jdbcTemplate.query(qline, new RowMapperLineInfo());
  44 + List<StopInfo> stops = jdbcTemplate.query(qstop, new RowMapperStopInfo());
  45 + List<Map<String, Object>> cars = jdbcTemplate.queryForList(qcar);
  46 +
  47 + // 缓存线路基本信息
  48 + for (LineInfo line : lines) {
  49 + BasicDataBuffer.putLine(line.getLineId(), line);
  50 + }
  51 +
  52 + // 线路信息中添加上下行站点信息
  53 + int oldId = -1;
  54 + LineInfo line = null;
  55 + for (StopInfo stop : stops) {
  56 + if (stop.getLineCode() != oldId) {
  57 + oldId = stop.getLineCode();
  58 + line = BasicDataBuffer.getLineById(oldId);
  59 + }
  60 + if (line != null) {
  61 + if (stop.getDirections() == 0) line.getStopsUp().add(stop);
  62 + else line.getStopsDown().add(stop);
  63 + }
  64 + }
  65 +
  66 + for (Map<String, Object> car : cars) {
  67 + String plateNo = (String)car.get("plate_no");
  68 + if (plateNo != null) {
  69 + BasicDataBuffer.putCar((String)car.get("device_id"), plateNo.replace("沪","").replace("-", ""));
  70 + }
  71 + }
  72 +
  73 + logger.info("基础数据加载成功");
  74 + }catch (Exception e){
  75 + logger.error("基础数据加载失败", e);
  76 + }
  77 + }
  78 +
  79 + final class RowMapperLineInfo implements RowMapper<LineInfo> {
  80 +
  81 + @Override
  82 + public LineInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  83 + // TODO Auto-generated method stub
  84 + LineInfo line = new LineInfo();
  85 + line.setId(rs.getInt("id"));
  86 + line.setInUse(rs.getInt("in_use"));
  87 + line.setLineId(rs.getInt("line_code"));
  88 + line.setLineName(rs.getString("name"));
  89 + //line.setStartStation(rs.getInt("start_station"));
  90 + line.setStartStationName(rs.getString("start_station_name"));
  91 + line.setStartStationFirstTime(rs.getString("start_station_first_time"));
  92 + line.setStartStationEndTime(rs.getString("start_station_end_time"));
  93 + //line.setEndStation(rs.getInt("end_station"));
  94 + line.setEndStationName(rs.getString("end_station_name"));
  95 + line.setEndStationFirstTime(rs.getString("end_station_first_time"));
  96 + line.setEndStationEndTime(rs.getString("end_station_end_time"));
  97 + line.setCompany(rs.getString("company"));
  98 + line.setBrancheCompany(rs.getString("branche_company"));
  99 + line.setTelephone(rs.getString("telephone"));
  100 + line.setLinePlayType(rs.getInt("line_play_type"));
  101 + return line;
  102 + }
  103 +
  104 + }
  105 +
  106 + final class RowMapperStopInfo implements RowMapper<StopInfo> {
  107 +
  108 + @Override
  109 + public StopInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  110 + // TODO Auto-generated method stub
  111 + StopInfo stop = new StopInfo();
  112 + stop.setId(rs.getInt("id"));
  113 + stop.setStationCod(rs.getString("station_cod"));
  114 + stop.setStationName(rs.getString("station_name"));
  115 + //stop.setStationType(rs.getString("station_type"));
  116 + stop.setRoadCoding(rs.getString("road_coding"));
  117 + float lon = rs.getFloat("g_lonx");
  118 + float lat = rs.getFloat("g_laty");
  119 + stop.setPoint(new Point(lon, lat));
  120 + stop.setLineId(rs.getInt("line"));
  121 + stop.setLineCode(rs.getInt("line_code"));
  122 + stop.setDirections(rs.getInt("directions"));
  123 + stop.setShapesType(rs.getString("shapes_type"));
  124 + stop.setRadius(rs.getInt("radius"));
  125 + stop.setPoints(new ArrayList<Point>());
  126 + stop.setDistances(rs.getDouble("distances")*1000);
  127 + return stop;
  128 + }
  129 +
  130 + }
  131 +
  132 + @Override
  133 + public void afterPropertiesSet() throws Exception {
  134 + // TODO Auto-generated method stub
  135 + loadBasicData();
  136 + }
  137 +}
... ...
src/main/java/com/bsth/server_rs/schedule/SchedulePlanService.java 0 → 100644
  1 +package com.bsth.server_rs.schedule;
  2 +
  3 +import com.bsth.entity.ScheduleRealInfo;
  4 +import com.bsth.server_rs.gps.buffer.GpsRealDataBuffer;
  5 +import com.bsth.server_rs.gps.entity.GpsEntity;
  6 +import com.fasterxml.jackson.core.JsonProcessingException;
  7 +import com.fasterxml.jackson.databind.ObjectMapper;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import javax.ws.rs.*;
  13 +import javax.ws.rs.core.MediaType;
  14 +import java.util.HashMap;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +@Component
  19 +@Path("/plan")
  20 +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
  21 +public class SchedulePlanService {
  22 +
  23 + private final static Logger log = LoggerFactory.getLogger(SchedulePlanService.class);
  24 +
  25 + private ObjectMapper mapper = new ObjectMapper();
  26 +
  27 + @POST
  28 + public Map<String, Object> save(List<ScheduleRealInfo> reals) throws JsonProcessingException {
  29 + Map<String, Object> result = new HashMap<>();
  30 + log.info(mapper.writeValueAsString(reals));
  31 + result.put("code", 0);
  32 + result.put("msg", "ok");
  33 +
  34 + return result;
  35 + }
  36 +}
... ...
src/main/java/com/bsth/server_rs/schedule/ScheduleRealService.java
1 1 package com.bsth.server_rs.schedule;
2 2  
  3 +import com.bsth.entity.ScheduleExec;
  4 +import com.bsth.entity.ScheduleRealInfo;
  5 +import com.fasterxml.jackson.core.JsonProcessingException;
  6 +import com.fasterxml.jackson.databind.ObjectMapper;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
3 9 import org.springframework.stereotype.Component;
4 10  
  11 +import javax.ws.rs.POST;
  12 +import javax.ws.rs.Path;
  13 +import javax.ws.rs.Produces;
  14 +import javax.ws.rs.core.MediaType;
  15 +import java.util.HashMap;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
5 19 @Component
  20 +@Path("/real")
  21 +@Produces({MediaType.APPLICATION_JSON})
6 22 public class ScheduleRealService {
  23 +
  24 + private final static Logger log = LoggerFactory.getLogger(ScheduleRealService.class);
  25 +
  26 + private ObjectMapper mapper = new ObjectMapper();
  27 +
  28 + @POST
  29 + @Path("/leave")
  30 + public Map<String, Object> leave(List<ScheduleExec> execs) throws JsonProcessingException {
  31 + Map<String, Object> result = new HashMap<>();
  32 + log.info(mapper.writeValueAsString(execs));
  33 + result.put("code", 0);
  34 + result.put("msg", "ok");
  35 +
  36 + return result;
  37 + }
  38 +
  39 + @POST
  40 + @Path("/arrival")
  41 + public Map<String, Object> arrival(List<ScheduleExec> execs) throws JsonProcessingException {
  42 + Map<String, Object> result = new HashMap<>();
  43 + log.info(mapper.writeValueAsString(execs));
  44 + result.put("code", 0);
  45 + result.put("msg", "ok");
  46 +
  47 + return result;
  48 + }
  49 +
  50 + @POST
  51 + @Path("/destroy")
  52 + public Map<String, Object> destroy(List<ScheduleExec> execs) throws JsonProcessingException {
  53 + Map<String, Object> result = new HashMap<>();
  54 + log.info(mapper.writeValueAsString(execs));
  55 + result.put("code", 0);
  56 + result.put("msg", "ok");
  57 +
  58 + return result;
  59 + }
7 60 }
... ...