Commit 9bf1aabcf60186bddd77e2a7fa39db46a210004e

Authored by 潘钊
2 parents 67553852 358a13c2

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/resources/static/real_control_v2/js/modal_extend.js
#	src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
Showing 26 changed files with 1888 additions and 902 deletions
src/main/java/com/bsth/controller/StationRouteController.java
... ... @@ -111,7 +111,6 @@ public class StationRouteController extends BaseController<StationRoute, Integer
111 111 */
112 112 @RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET)
113 113 public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) {
114   -
115 114 return service.findStationRouteInfo(map);
116 115 }
117 116  
... ... @@ -140,4 +139,13 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
140 139 return service.updSwitchDir(lineIds);
141 140 }
142 141  
  142 + /**
  143 + *
  144 + * @Title: upddis
  145 + * @Description: TODO(更新站距)
  146 + */
  147 + @RequestMapping(value = "/upddis",method = RequestMethod.POST)
  148 + public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
  149 + return service.upddis(map);
  150 + }
143 151 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -272,4 +272,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
272 272 @Modifying
273 273 @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
274 274 public void stationRouteDir(Integer line);
  275 +
  276 + @Modifying
  277 + @Query(value="update bsth_c_stationroute set distances =?2 where id = ?1 ", nativeQuery=true)
  278 + public void upddis(Integer id,Double dis);
275 279 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -137,7 +137,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
137 137 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
138 138  
139 139 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
140   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
  140 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
141 141 List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
142 142  
143 143 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
... ...
src/main/java/com/bsth/service/StationRouteService.java
... ... @@ -82,4 +82,6 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
82 82 Map<String, Object> findByMultiLine(String lineIds);
83 83  
84 84 Map<String, Object> updSwitchDir(String lineIds);
  85 +
  86 + Map<String, Object> upddis(Map<String, Object> map);
85 87 }
... ...
src/main/java/com/bsth/service/gps/entity/HistoryGps_DTO.java
1   -package com.bsth.service.gps.entity;
2   -
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.JSONObject;
5   -import com.bsth.data.arrival.ArrivalEntity;
6   -import com.fasterxml.jackson.annotation.JsonIgnore;
7   -import com.vividsolutions.jts.geom.Coordinate;
8   -import com.vividsolutions.jts.geom.GeometryFactory;
9   -import com.vividsolutions.jts.geom.Point;
10   -
11   -import java.util.List;
12   -import java.util.Map;
13   -
14   -/**
15   - * 历史GPS DTO
16   - * Created by panzhao on 2017/4/5.
17   - */
18   -public class HistoryGps_DTO {
19   -
20   - public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList){
21   - List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class);
22   -
23   - GeometryFactory geometryFactory = new GeometryFactory();
24   - Point point;
25   - for(HistoryGps_DTO gps : list){
26   - point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
27   - gps.setPoint(point);
28   - }
29   - return list;
30   - }
31   -
32   - private double gcj_lon;
33   - private double gcj_lat;
34   -
35   - private double bd_lon;
36   - private double bd_lat;
37   -
38   - private double lon;
39   - private double lat;
40   -
41   - private String deviceId;
42   - private long ts;
43   - private long timestamp;
44   - private String stopNo;
45   - private float direction;
46   -
47   - private String lineId;
48   - private float speed;
49   - private ArrivalEntity inout_stop_info;
50   - private int inout_stop;
51   -
52   - private String nbbm;
53   - private int state;
54   - private int upDown;
55   -
56   - @JsonIgnore
57   - private Point point;
58   -
59   - /** 路段 */
60   - private Road_DTO road;
61   - /** 和路段的最短距离 */
62   - private double roadMinDistance;
63   -
64   - public double getGcj_lon() {
65   - return gcj_lon;
66   - }
67   -
68   - public void setGcj_lon(double gcj_lon) {
69   - this.gcj_lon = gcj_lon;
70   - }
71   -
72   - public double getGcj_lat() {
73   - return gcj_lat;
74   - }
75   -
76   - public void setGcj_lat(double gcj_lat) {
77   - this.gcj_lat = gcj_lat;
78   - }
79   -
80   - public double getBd_lon() {
81   - return bd_lon;
82   - }
83   -
84   - public void setBd_lon(double bd_lon) {
85   - this.bd_lon = bd_lon;
86   - }
87   -
88   - public double getBd_lat() {
89   - return bd_lat;
90   - }
91   -
92   - public void setBd_lat(double bd_lat) {
93   - this.bd_lat = bd_lat;
94   - }
95   -
96   - public String getDeviceId() {
97   - return deviceId;
98   - }
99   -
100   - public void setDeviceId(String deviceId) {
101   - this.deviceId = deviceId;
102   - }
103   -
104   - public long getTs() {
105   - return ts;
106   - }
107   -
108   - public void setTs(long ts) {
109   - this.ts = ts;
110   - }
111   -
112   - public long getTimestamp() {
113   - return timestamp;
114   - }
115   -
116   - public void setTimestamp(long timestamp) {
117   - this.timestamp = timestamp;
118   - }
119   -
120   - public String getStopNo() {
121   - return stopNo;
122   - }
123   -
124   - public void setStopNo(String stopNo) {
125   - this.stopNo = stopNo;
126   - }
127   -
128   - public float getDirection() {
129   - return direction;
130   - }
131   -
132   - public void setDirection(float direction) {
133   - this.direction = direction;
134   - }
135   -
136   - public String getLineId() {
137   - return lineId;
138   - }
139   -
140   - public void setLineId(String lineId) {
141   - this.lineId = lineId;
142   - }
143   -
144   - public float getSpeed() {
145   - return speed;
146   - }
147   -
148   - public void setSpeed(float speed) {
149   - this.speed = speed;
150   - }
151   -
152   - public ArrivalEntity getInout_stop_info() {
153   - return inout_stop_info;
154   - }
155   -
156   - public void setInout_stop_info(ArrivalEntity inout_stop_info) {
157   - this.inout_stop_info = inout_stop_info;
158   - }
159   -
160   - public int getInout_stop() {
161   - return inout_stop;
162   - }
163   -
164   - public void setInout_stop(int inout_stop) {
165   - this.inout_stop = inout_stop;
166   - }
167   -
168   - public String getNbbm() {
169   - return nbbm;
170   - }
171   -
172   - public void setNbbm(String nbbm) {
173   - this.nbbm = nbbm;
174   - }
175   -
176   - public int getState() {
177   - return state;
178   - }
179   -
180   - public void setState(int state) {
181   - this.state = state;
182   - }
183   -
184   - public int getUpDown() {
185   - return upDown;
186   - }
187   -
188   - public void setUpDown(int upDown) {
189   - this.upDown = upDown;
190   - }
191   -
192   - public Road_DTO getRoad() {
193   - return road;
194   - }
195   -
196   - public void setRoad(Road_DTO road) {
197   - this.road = road;
198   - }
199   -
200   - public double getRoadMinDistance() {
201   - return roadMinDistance;
202   - }
203   -
204   - public void setRoadMinDistance(double roadMinDistance) {
205   - this.roadMinDistance = roadMinDistance;
206   - }
207   -
208   - public double getLon() {
209   - return lon;
210   - }
211   -
212   - public void setLon(double lon) {
213   - this.lon = lon;
214   - }
215   -
216   - public double getLat() {
217   - return lat;
218   - }
219   -
220   - public void setLat(double lat) {
221   - this.lat = lat;
222   - }
223   -
224   - public Point getPoint() {
225   - return point;
226   - }
227   -
228   - public void setPoint(Point point) {
229   - this.point = point;
230   - }
231   -}
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.arrival.ArrivalEntity;
  6 +import com.fasterxml.jackson.annotation.JsonIgnore;
  7 +import com.vividsolutions.jts.geom.Coordinate;
  8 +import com.vividsolutions.jts.geom.GeometryFactory;
  9 +import com.vividsolutions.jts.geom.Point;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 历史GPS DTO
  16 + * Created by panzhao on 2017/4/5.
  17 + */
  18 +public class HistoryGps_DTO {
  19 +
  20 + public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList){
  21 + List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class);
  22 +
  23 + GeometryFactory geometryFactory = new GeometryFactory();
  24 + Point point;
  25 + for(HistoryGps_DTO gps : list){
  26 + point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  27 + gps.setPoint(point);
  28 + }
  29 + return list;
  30 + }
  31 +
  32 + private double gcj_lon;
  33 + private double gcj_lat;
  34 +
  35 + private double bd_lon;
  36 + private double bd_lat;
  37 +
  38 + private double lon;
  39 + private double lat;
  40 +
  41 + private String deviceId;
  42 + private long ts;
  43 + private long timestamp;
  44 + private String stopNo;
  45 + private float direction;
  46 +
  47 + private String lineId;
  48 + private float speed;
  49 + private ArrivalEntity inout_stop_info;
  50 + private int inout_stop;
  51 +
  52 + private String nbbm;
  53 + private int state;
  54 + private int upDown;
  55 +
  56 + @JsonIgnore
  57 + private Point point;
  58 +
  59 + /** 路段 */
  60 + private Road_DTO road;
  61 + /** 和路段的最短距离 */
  62 + private double roadMinDistance;
  63 +
  64 + public double getGcj_lon() {
  65 + return gcj_lon;
  66 + }
  67 +
  68 + public void setGcj_lon(double gcj_lon) {
  69 + this.gcj_lon = gcj_lon;
  70 + }
  71 +
  72 + public double getGcj_lat() {
  73 + return gcj_lat;
  74 + }
  75 +
  76 + public void setGcj_lat(double gcj_lat) {
  77 + this.gcj_lat = gcj_lat;
  78 + }
  79 +
  80 + public double getBd_lon() {
  81 + return bd_lon;
  82 + }
  83 +
  84 + public void setBd_lon(double bd_lon) {
  85 + this.bd_lon = bd_lon;
  86 + }
  87 +
  88 + public double getBd_lat() {
  89 + return bd_lat;
  90 + }
  91 +
  92 + public void setBd_lat(double bd_lat) {
  93 + this.bd_lat = bd_lat;
  94 + }
  95 +
  96 + public String getDeviceId() {
  97 + return deviceId;
  98 + }
  99 +
  100 + public void setDeviceId(String deviceId) {
  101 + this.deviceId = deviceId;
  102 + }
  103 +
  104 + public long getTs() {
  105 + return ts;
  106 + }
  107 +
  108 + public void setTs(long ts) {
  109 + this.ts = ts;
  110 + }
  111 +
  112 + public long getTimestamp() {
  113 + return timestamp;
  114 + }
  115 +
  116 + public void setTimestamp(long timestamp) {
  117 + this.timestamp = timestamp;
  118 + }
  119 +
  120 + public String getStopNo() {
  121 + return stopNo;
  122 + }
  123 +
  124 + public void setStopNo(String stopNo) {
  125 + this.stopNo = stopNo;
  126 + }
  127 +
  128 + public float getDirection() {
  129 + return direction;
  130 + }
  131 +
  132 + public void setDirection(float direction) {
  133 + this.direction = direction;
  134 + }
  135 +
  136 + public String getLineId() {
  137 + return lineId;
  138 + }
  139 +
  140 + public void setLineId(String lineId) {
  141 + this.lineId = lineId;
  142 + }
  143 +
  144 + public float getSpeed() {
  145 + return speed;
  146 + }
  147 +
  148 + public void setSpeed(float speed) {
  149 + this.speed = speed;
  150 + }
  151 +
  152 + public ArrivalEntity getInout_stop_info() {
  153 + return inout_stop_info;
  154 + }
  155 +
  156 + public void setInout_stop_info(ArrivalEntity inout_stop_info) {
  157 + this.inout_stop_info = inout_stop_info;
  158 + }
  159 +
  160 + public int getInout_stop() {
  161 + return inout_stop;
  162 + }
  163 +
  164 + public void setInout_stop(int inout_stop) {
  165 + this.inout_stop = inout_stop;
  166 + }
  167 +
  168 + public String getNbbm() {
  169 + return nbbm;
  170 + }
  171 +
  172 + public void setNbbm(String nbbm) {
  173 + this.nbbm = nbbm;
  174 + }
  175 +
  176 + public int getState() {
  177 + return state;
  178 + }
  179 +
  180 + public void setState(int state) {
  181 + this.state = state;
  182 + }
  183 +
  184 + public int getUpDown() {
  185 + return upDown;
  186 + }
  187 +
  188 + public void setUpDown(int upDown) {
  189 + this.upDown = upDown;
  190 + }
  191 +
  192 + public Road_DTO getRoad() {
  193 + return road;
  194 + }
  195 +
  196 + public void setRoad(Road_DTO road) {
  197 + this.road = road;
  198 + }
  199 +
  200 + public double getRoadMinDistance() {
  201 + return roadMinDistance;
  202 + }
  203 +
  204 + public void setRoadMinDistance(double roadMinDistance) {
  205 + this.roadMinDistance = roadMinDistance;
  206 + }
  207 +
  208 + public double getLon() {
  209 + return lon;
  210 + }
  211 +
  212 + public void setLon(double lon) {
  213 + this.lon = lon;
  214 + }
  215 +
  216 + public double getLat() {
  217 + return lat;
  218 + }
  219 +
  220 + public void setLat(double lat) {
  221 + this.lat = lat;
  222 + }
  223 +
  224 + public Point getPoint() {
  225 + return point;
  226 + }
  227 +
  228 + public void setPoint(Point point) {
  229 + this.point = point;
  230 + }
  231 +}
... ...
src/main/java/com/bsth/service/gps/entity/Road_DTO.java
1   -package com.bsth.service.gps.entity;
2   -
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.JSONObject;
5   -import com.fasterxml.jackson.annotation.JsonIgnore;
6   -import com.vividsolutions.jts.geom.Coordinate;
7   -import com.vividsolutions.jts.geom.GeometryFactory;
8   -import com.vividsolutions.jts.geom.LineString;
9   -
10   -import java.util.ArrayList;
11   -import java.util.List;
12   -import java.util.Map;
13   -
14   -/**
15   - * 路段信息DTO
16   - * Created by panzhao on 2017/4/5.
17   - */
18   -public class Road_DTO {
19   -
20   - public static List<Road_DTO> craete(List<Map<String, Object>> mapList){
21   - List<Road_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), Road_DTO.class);
22   - //处理路段坐标
23   - String polygonStr;
24   - String[] coords;
25   - int i, len;
26   - String[] temps;//1, temps2;
27   - List<Coordinate> cds;
28   -
29   - GeometryFactory geometryFactory = new GeometryFactory();
30   - for(Road_DTO road : list){
31   - polygonStr = road.getGROAD_VECTOR();
32   - coords = polygonStr.substring(11, polygonStr.length() - 1).split(",");
33   - len = coords.length;
34   -
35   - cds = new ArrayList<>();
36   - //每2个点连一条线
37   - for(i = 0; i < len; i ++){
38   - temps = coords[i].split(" ");
39   - cds.add(new Coordinate(Float.parseFloat(temps[1]), Float.parseFloat(temps[0])));
40   - }
41   -
42   - Coordinate[] cdsArray = new Coordinate[cds.size()];
43   - road.setLineStr(geometryFactory.createLineString(cds.toArray(cdsArray)));
44   - }
45   - return list;
46   - }
47   -
48   - private long ID;
49   -
50   - @JsonIgnore
51   - private String GROAD_VECTOR;
52   -
53   - private String ROAD_CODE;
54   -
55   - private String ROAD_NAME;
56   -
57   - private double SPEED;
58   -
59   - @JsonIgnore
60   - private LineString lineStr;
61   -
62   - public long getID() {
63   - return ID;
64   - }
65   -
66   - public void setID(long ID) {
67   - this.ID = ID;
68   - }
69   -
70   - public String getGROAD_VECTOR() {
71   - return GROAD_VECTOR;
72   - }
73   -
74   - public void setGROAD_VECTOR(String GROAD_VECTOR) {
75   - this.GROAD_VECTOR = GROAD_VECTOR;
76   - }
77   -
78   - public String getROAD_CODE() {
79   - return ROAD_CODE;
80   - }
81   -
82   - public void setROAD_CODE(String ROAD_CODE) {
83   - this.ROAD_CODE = ROAD_CODE;
84   - }
85   -
86   - public String getROAD_NAME() {
87   - return ROAD_NAME;
88   - }
89   -
90   - public void setROAD_NAME(String ROAD_NAME) {
91   - this.ROAD_NAME = ROAD_NAME;
92   - }
93   -
94   - public double getSPEED() {
95   - return SPEED;
96   - }
97   -
98   - public void setSPEED(double SPEED) {
99   - this.SPEED = SPEED;
100   - }
101   -
102   - public LineString getLineStr() {
103   - return lineStr;
104   - }
105   -
106   - public void setLineStr(LineString lineStr) {
107   - this.lineStr = lineStr;
108   - }
109   -}
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.fasterxml.jackson.annotation.JsonIgnore;
  6 +import com.vividsolutions.jts.geom.Coordinate;
  7 +import com.vividsolutions.jts.geom.GeometryFactory;
  8 +import com.vividsolutions.jts.geom.LineString;
  9 +
  10 +import java.util.ArrayList;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 路段信息DTO
  16 + * Created by panzhao on 2017/4/5.
  17 + */
  18 +public class Road_DTO {
  19 +
  20 + public static List<Road_DTO> craete(List<Map<String, Object>> mapList){
  21 + List<Road_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), Road_DTO.class);
  22 + //处理路段坐标
  23 + String polygonStr;
  24 + String[] coords;
  25 + int i, len;
  26 + String[] temps;//1, temps2;
  27 + List<Coordinate> cds;
  28 +
  29 + GeometryFactory geometryFactory = new GeometryFactory();
  30 + for(Road_DTO road : list){
  31 + polygonStr = road.getGROAD_VECTOR();
  32 + coords = polygonStr.substring(11, polygonStr.length() - 1).split(",");
  33 + len = coords.length;
  34 +
  35 + cds = new ArrayList<>();
  36 + //每2个点连一条线
  37 + for(i = 0; i < len; i ++){
  38 + temps = coords[i].split(" ");
  39 + cds.add(new Coordinate(Float.parseFloat(temps[1]), Float.parseFloat(temps[0])));
  40 + }
  41 +
  42 + Coordinate[] cdsArray = new Coordinate[cds.size()];
  43 + road.setLineStr(geometryFactory.createLineString(cds.toArray(cdsArray)));
  44 + }
  45 + return list;
  46 + }
  47 +
  48 + private long ID;
  49 +
  50 + @JsonIgnore
  51 + private String GROAD_VECTOR;
  52 +
  53 + private String ROAD_CODE;
  54 +
  55 + private String ROAD_NAME;
  56 +
  57 + private double SPEED;
  58 +
  59 + @JsonIgnore
  60 + private LineString lineStr;
  61 +
  62 + public long getID() {
  63 + return ID;
  64 + }
  65 +
  66 + public void setID(long ID) {
  67 + this.ID = ID;
  68 + }
  69 +
  70 + public String getGROAD_VECTOR() {
  71 + return GROAD_VECTOR;
  72 + }
  73 +
  74 + public void setGROAD_VECTOR(String GROAD_VECTOR) {
  75 + this.GROAD_VECTOR = GROAD_VECTOR;
  76 + }
  77 +
  78 + public String getROAD_CODE() {
  79 + return ROAD_CODE;
  80 + }
  81 +
  82 + public void setROAD_CODE(String ROAD_CODE) {
  83 + this.ROAD_CODE = ROAD_CODE;
  84 + }
  85 +
  86 + public String getROAD_NAME() {
  87 + return ROAD_NAME;
  88 + }
  89 +
  90 + public void setROAD_NAME(String ROAD_NAME) {
  91 + this.ROAD_NAME = ROAD_NAME;
  92 + }
  93 +
  94 + public double getSPEED() {
  95 + return SPEED;
  96 + }
  97 +
  98 + public void setSPEED(double SPEED) {
  99 + this.SPEED = SPEED;
  100 + }
  101 +
  102 + public LineString getLineStr() {
  103 + return lineStr;
  104 + }
  105 +
  106 + public void setLineStr(LineString lineStr) {
  107 + this.lineStr = lineStr;
  108 + }
  109 +}
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -1100,4 +1100,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1100 1100 }
1101 1101 return rs;
1102 1102 }
  1103 +
  1104 + @Override
  1105 + @Transactional
  1106 + public Map<String, Object> upddis(Map<String, Object> map) {
  1107 + Map<String, Object> rs = new HashMap<>();
  1108 + try{
  1109 + Iterator it = map.entrySet().iterator();
  1110 + while(it.hasNext()){
  1111 + java.util.Map.Entry entry = (java.util.Map.Entry)it.next();
  1112 + Integer id = Integer.parseInt(entry.getKey().toString().split("_")[1]); //返回对应的键
  1113 + Double dis = Double.parseDouble(entry.getValue().toString()) / 1000; //返回对应的值
  1114 + repository.upddis(id, dis);
  1115 + }
  1116 + rs.put("status", ResponseCode.SUCCESS);
  1117 + }catch(Exception e){
  1118 + logger.error("", e);
  1119 + rs.put("status", ResponseCode.ERROR);
  1120 + }
  1121 + return rs;
  1122 + }
1103 1123 }
... ...
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
... ... @@ -3365,7 +3365,7 @@
3365 3365 <schema_name/>
3366 3366 </partitioning>
3367 3367 <connection>bus_control_variable</connection>
3368   - <sql>select &#xa;t.id as id&#xa;, g.lp_name as lp&#xa;, g.xl as xl&#xa;, qdz&#xa;, zdz&#xa;, tcc&#xa;, fcsj&#xa;, jhlc&#xa;, bc_type &#xa;, bcs&#xa;, fcno&#xa;, xl_dir&#xa;, isfb&#xa;from bsth_c_s_ttinfo_detail t left join &#xa;bsth_c_s_gbi g on t.lp &#x3d; g.id &#xa;where &#xa;g.xl &#x3d; &#x3f; and&#xa;t.ttinfo &#x3d; &#x3f; &#xa;order by t.bcs asc</sql>
  3368 + <sql>select &#xa;t.id as id&#xa;, concat&#x28;g.id, &#x27;_&#x27;, g.lp_name&#x29; as lp&#xa;, g.xl as xl&#xa;, qdz&#xa;, zdz&#xa;, tcc&#xa;, fcsj&#xa;, jhlc&#xa;, bc_type &#xa;, bcs&#xa;, fcno&#xa;, xl_dir&#xa;, isfb&#xa;from bsth_c_s_ttinfo_detail t left join &#xa;bsth_c_s_gbi g on t.lp &#x3d; g.id &#xa;where &#xa;g.xl &#x3d; &#x3f; and&#xa;t.ttinfo &#x3d; &#x3f; &#xa;order by t.bcs asc</sql>
3369 3369 <limit>0</limit>
3370 3370 <lookup>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</lookup>
3371 3371 <execute_each_row>N</execute_each_row>
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -168,6 +168,13 @@ var GetAjaxData = function(){
168 168 },
169 169  
170 170 // 查询路段信息
  171 + getStationRouteInfo : function(lineId,direction,callback) {
  172 + $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
  173 + callback && callback(resultdata);
  174 + });
  175 + },
  176 +
  177 + // 查询路段信息
171 178 getSectionRouteInfo : function(lineId,direction,callback) {
172 179 $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
173 180 callback && callback(resultdata);
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
... ... @@ -122,6 +122,27 @@ $(function(){
122 122 });*/
123 123 });
124 124  
  125 + $('#wrenchUpDis').on('click',function() {
  126 + var Line = LineObj.getLineObj();
  127 + GetAjaxData.getStation(Line.id,directionUpValue,function(rd) {
  128 + // 加载其它规划选择弹出层mobal页面
  129 + $.get('tzzj.html', function(m){
  130 + $(pjaxContainer).append(m);
  131 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,Line.id,PublicFunctions,rd[0].children[0].children]);
  132 + });
  133 + });
  134 + })
  135 +
  136 + $('#wrenchDownDis').on('click',function() {
  137 + var Line = LineObj.getLineObj();
  138 + GetAjaxData.getStation(Line.id,directionDownValue,function(rd) {
  139 + // 加载其它规划选择弹出层mobal页面
  140 + $.get('tzzj.html', function(m){
  141 + $(pjaxContainer).append(m);
  142 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,Line.id,PublicFunctions,rd[0].children[0].children]);
  143 + });
  144 + });
  145 + })
125 146  
126 147 $('#quoteDown').on('click',function() {
127 148 // 弹出提示层.
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -63,6 +63,10 @@
63 63 </li>
64 64 <li class="divider"> </li>
65 65 <li>
  66 + <a href="javascript:;" id="wrenchUpDis"><i class="fa fa-wrench"></i> 设置上行站距</a>
  67 + </li>
  68 + <li class="divider"> </li>
  69 + <li>
66 70 <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>
67 71 </li>
68 72 <!-- <li>
... ... @@ -154,6 +158,10 @@
154 158 </li>
155 159 <li class="divider"> </li>
156 160 <li>
  161 + <a href="javascript:;" id="wrenchDownDis"><i class="fa fa-wrench"></i> 设置下行站距</a>
  162 + </li>
  163 + <li class="divider"> </li>
  164 + <li>
157 165 <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a>
158 166 </li>
159 167 <!-- <li>
... ...
src/main/resources/static/pages/base/stationroute/tzzj.html 0 → 100644
  1 +<!-- 调整站距 -->
  2 +<div class="modal fade" id="tzzj_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">调整站距 </h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" action="/" method="post" id="tzbcForm" role="form">
  11 + <!-- alert-danger 组件START -->
  12 + <div class="alert alert-danger display-hide" id="tzbcAlert">
  13 + <button class="close" data-close="alert"></button>
  14 + 您的输入有误,请检查下面的输入项
  15 + </div>
  16 + <div class="portlet-body">
  17 + <div class="table-container" style="margin-top: 10px">
  18 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_bctz">
  19 + <thead>
  20 + <tr role="row" class="heading">
  21 + <th width="1%"></th>
  22 + <th width="33%">站点序号</th>
  23 + <th width="33%">站点路由</th>
  24 + <th width="33%">站距(米/单位)</th>
  25 + </tr>
  26 + </thead>
  27 + <tbody></tbody>
  28 + </table>
  29 + </div>
  30 + </div>
  31 + </form>
  32 + </div>
  33 + <div class="modal-footer">
  34 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  35 + <button type="button" class="btn btn-primary" id="tzbcnext">保存</button>
  36 + </div>
  37 + </div>
  38 + </div>
  39 +</div>
  40 +<script type="text/html" id="tzzj_temp">
  41 +{{each list as obj i }}
  42 + <tr role="row" class="filter">
  43 + <td></td>
  44 + <td>
  45 + <!--<input type="text" readonly class="form-control form-filter input-sm" value="{{i+1}}">-->
  46 + {{i+1}}
  47 + </td>
  48 + <td>
  49 + <!-- <input type="text" readonly class="form-control form-filter input-sm" name="station_{{i+1}}" value="{{obj.name}}">-->
  50 + {{obj.name}}
  51 + </td>
  52 + <td>
  53 + <input type="text" class="form-control form-filter input-sm" name="dis_{{obj.stationRouteId}}" value="{{obj.stationRouteDistances * 1000}}">
  54 + </td>
  55 + </tr>
  56 +{{/each}}
  57 +{{if list.length == 0}}
  58 + <tr>
  59 + <td colspan=4><h6 class="muted">没有找到相关数据</h6></td>
  60 + </tr>
  61 + {{/if}}
  62 +</script>
  63 +<script type="text/javascript">
  64 +$('#tzzj_mobal').on('tzzjMobal.show', function(e,map,gd,dir,lineid,pf,rd){
  65 + setTimeout(function(){
  66 + // 加载延迟200毫秒显示mobal
  67 + $('#tzzj_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  68 + },200);
  69 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  70 + $('#tzzj_mobal').on('show.bs.modal', function () {
  71 + console.log(rd);
  72 + // 把数据填充到模版中
  73 + var tbodyHtml = template('tzzj_temp',{list:rd});
  74 + // 把渲染好的模版html文本追加到表格中
  75 + $('#datatable_bctz tbody').html(tbodyHtml);
  76 + });
  77 + // 获取表单元素
  78 + var form = $('#tzbcForm');
  79 + // 错误提示元素
  80 + var tzbcAlert = $('#tzbcAlert', form);
  81 + // 下一步点击事件
  82 + $('#tzbcnext').on('click', function() {
  83 + form.submit();// 表单提交
  84 + });
  85 + // 表单验证
  86 + form.validate({
  87 + errorElement : 'span',
  88 + errorClass : 'help-block help-block-error',
  89 + focusInvalid : false,
  90 + rules : {
  91 + },
  92 + invalidHandler : function(event, validator) {
  93 + tzbcAlert.show();
  94 + App.scrollTo(reladplusname, -200);
  95 + },
  96 + highlight : function(element) {
  97 + $(element).closest('.form-group').addClass('has-error');
  98 + },
  99 + unhighlight : function(element) {
  100 + $(element).closest('.form-group').removeClass('has-error');
  101 + },
  102 + success : function(label) {
  103 + label.closest('.form-group').removeClass('has-error');
  104 + },
  105 + submitHandler : function(f) {
  106 + // 获取表单内容,并序列化
  107 + var params = form.serializeJSON();
  108 + $post('/stationroute/upddis',params,function(data) {
  109 + // 隐藏错误提示
  110 + tzbcAlert.hide();
  111 + // 隐藏 reladplus_mobal 弹出层
  112 + $('#tzzj_mobal').modal('hide');
  113 + if(data.status=='SUCCESS') {
  114 + // 弹出添加成功提示消息
  115 + layer.msg('修改成功...');
  116 + map.clearMarkAndOverlays();
  117 + // 刷新左边树
  118 + pf.resjtreeDate(lineid,dir);
  119 + pf.resjtreeDate(lineid,dir);
  120 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  121 + gd.getSectionRouteInfo(lineid,dir,function(data) {
  122 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  123 + pf.linePanlThree(lineid,data,dir);
  124 + });
  125 + }else {
  126 + // 弹出添加失败提示消息
  127 + layer.msg('修改失败...');
  128 + }
  129 + });
  130 + }
  131 + });
  132 +});
  133 +</script>
0 134 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/add.html
... ... @@ -9,7 +9,6 @@
9 9 width: 69%;
10 10 }
11 11 </style>
12   -
13 12 <!-- 片段标题 START -->
14 13 <div class="page-head">
15 14 <div class="page-title">
... ... @@ -17,8 +16,6 @@
17 16 </div>
18 17 </div>
19 18 <!-- 片段标题 END -->
20   -
21   -
22 19 <!-- 线路信息导航栏组件 START -->
23 20 <ul class="page-breadcrumb breadcrumb">
24 21 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
... ... @@ -26,8 +23,6 @@
26 23 <li><span class="active">时刻表明细制作建模</span></li>
27 24 </ul>
28 25 <!-- 线路信息导航栏组件 END -->
29   -
30   -
31 26 <div class="portlet light bordered" id="form-wizard-info">
32 27 <div class="portlet-title">
33 28 <div class="caption">
... ... @@ -44,7 +39,6 @@
44 39 </div>
45 40 </div>
46 41 <div class="portlet-body form">
47   -
48 42 <!-- START FORM 表单容器 -->
49 43 <form class="form-horizontal" id="submit_argus_form" action="/" method="POST" novalidate="novalidate">
50 44 <div class="form-wizard">
... ... @@ -94,7 +88,6 @@
94 88 <button class="close" data-dismiss="alert"></button>
95 89 验证成功!
96 90 </div>
97   -
98 91 <!-- 线路名称 -->
99 92 <div class="tab-pane active" id="tab1">
100 93 <h3 class="block"> 选择时刻表 </h3>
... ...
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
1 1  
2 2 /**
3   - * 表单的导航向导、验证、提交
4   - *
  3 + * @description : (TODO) 表单的导航向导、验证、提交
5 4 */
6 5  
7 6 var SKBFormWizard = function() {
  7 +
  8 + var bxrcGs = [ {'type':'六工一休','hoursV':6.66, 'minueV':'6:40'},
  9 + {'type':'五工一休','hoursV':6.85, 'minueV':'6:51'},
  10 + {'type':'四工一休','hoursV':7.14, 'minueV':'7:08'},
  11 + {'type':'三工一休','hoursV':7.61, 'minueV':'7:37'},
  12 + {'type':'二工一休','hoursV':8.57, 'minueV':'8:34'},
  13 + {'type':'一工一休','hoursV':11.42, 'minueV':'11:25'},
  14 + {'type':'五工二休','hoursV':7.99, 'minueV':'8:00'},
  15 + {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43'}];
  16 +
  17 + /**
  18 + * @description : (TODO) 获取停站时间.
  19 + *
  20 + * @param [o--当前班次对象;d--班次数组对象;sj--当前班次时间]
  21 + *
  22 + * @return 返回相邻班次的停站时间.
  23 + * */
  24 + function gettzsj(o,d,sj) {
  25 + // 定义停站时间.
  26 + var tzsj = 0;
  27 + // 变量班次数组对象.
  28 + for(var i = 0 ;i<d.length;i++) {
  29 + // 判断是否为同一个路牌.
  30 + if(o.lp.lpNo == d[i].lp.lpNo && o.lp.id == d[i].lp.id) {
  31 + // 判断是否为当前班次的下一个班次.
  32 + if(d[i].fcno - o.fcno ==1){
  33 + // 计算停站时间.
  34 + tzsj = (strToTime(d[i].fcsj) -strToTime(sj)) / 60000;
  35 + continue;
  36 + }
  37 + }
  38 + }
  39 + // 返回停站时间.
  40 + return tzsj;
  41 + }
  42 +
  43 + /**
  44 + * @description : (TODO) 是否切换线路值转换.
  45 + *
  46 + * @param [d--是否切换线路原始值].
  47 + *
  48 + * @return 返回一个是否切换线路值的转换.
  49 + * */
  50 + function isSwitchXlTodm(d) {
  51 + var rstr = 0;
  52 + if(d)
  53 + rstr = 1;
  54 + return rstr;
  55 + }
  56 +
  57 + /**
  58 + * @description : (TODO) 是否分班值转换.
  59 + *
  60 + * @param [d--是否分班原始值].
  61 + *
  62 + * @return 返回一个是否分班值的转换.
  63 + * */
  64 + function isfbTodm(b) {
  65 + var rstr = 0;
  66 + if(b)
  67 + rstr = 1;
  68 + return rstr;
  69 + }
  70 +
  71 + /**
  72 + * @description : (TODO) 获取某个班次的到达时间字符串.
  73 + *
  74 + * @param [tStr--发车时间格式字符串;bcsj--班次历时].
  75 + *
  76 + * @return 返回一个某个班次的到达时间字符串.
  77 + * */
  78 + function getddsj(tStr,bcsj) {
  79 + // 定义当前时间对象.
  80 + var date = new Date();
  81 + // 分割字符串.
  82 + var _str = tStr.split(':');
  83 + // 设值小时.
  84 + date.setHours(parseInt(_str[0]));
  85 + // 设值分钟.
  86 + date.setMiutes(parseInt(_str[1]) + bcsj);
  87 + // 返回到达时间字符串.
  88 + return getTimeStr(date);
  89 + }
  90 +
  91 + /**
  92 + * @description : (TODO) 时间点格式字符串转时间对象.
  93 + *
  94 + * @param [t--时间点格式字符串]
  95 + *
  96 + * @return 返回一个时间点格式字符串转时间对象.
  97 + * */
  98 + var strToTime = function(t) {
  99 + // 定义当前时间对象.
  100 + var d = new Date;
  101 + // 判断是否为空.
  102 + if(t) {
  103 + // 分割字符串.
  104 + var _str = t.split(':');
  105 + // 设值小时.
  106 + d.setHours(parseInt(_str[0]));
  107 + // 设值分钟.
  108 + d.setMinutes(parseInt(_str[1]));
  109 + }
  110 + // 返回一个时间点格式字符串转时间对象.
  111 + return d;
  112 + }
  113 +
  114 + /**
  115 + * @description : (TODO) 时间对象转时间点格式字符串.
  116 + *
  117 + * @param [t--时间对象]
  118 + *
  119 + * @return 返回一个时间对象转时间点格式字符串.
  120 + * */
  121 + function getTimeStr(t) {
  122 + // 定义返回值.
  123 + var _str = '';
  124 + // 判断是否为空.
  125 + if(t) {
  126 + // 重新赋值.
  127 + _str = ((t.getHours()<10? '0' + t.getHours() : t.getHours()) == '00' ? '24' :(t.getHours()<10? '0' + t.getHours() : t.getHours()))
  128 + +':'
  129 + +(t.getMinutes()<10? '0' + t.getMinutes() : t.getMinutes());
  130 + }
  131 + // 返回时间对象转时间点格式字符串.
  132 + return _str;
  133 + }
  134 +
  135 + /**
  136 + * @description : (TODO) 方向值转换.
  137 + *
  138 + * @param [d--方向原始值].
  139 + *
  140 + * @return 返回一个方向值转换.
  141 + * */
  142 + function dmToDh(t) {
  143 + // 定义返回值.
  144 + var reslStr = '';
  145 + // 上行.
  146 + if(t=='0')
  147 + reslStr = 'relationshipGraph-up';
  148 + // 下行.
  149 + else if(t=='1')
  150 + reslStr = 'relationshipGraph-down';
  151 + // 返回一个方向值转换.
  152 + return reslStr;
  153 + }
  154 +
  155 + /**
  156 + * @description : (TODO) 获取线路标准详情.
  157 + *
  158 + * @param [lineId--线路ID;cb--回调函数].
  159 + *
  160 + * @return 返回线路标准详情.
  161 + *
  162 + * @status OK.
  163 + * */
8 164 var getLineInfo = function(lineId,cb) {
9   - // 根据线路标准ID查询详情
  165 + // 1、get异步请求.根据线路ID查询详情.
10 166 $get('/lineInformation',{'line.id_eq':lineId},function(result) {
  167 + // 2、返回线路标准详情.
11 168 return cb && cb(result);
12 169 });
13 170 }
  171 +
  172 + /**
  173 + * @description : (TODO) 获取所有的停车场详情.
  174 + *
  175 + * @param [cb--回调函数].
  176 + *
  177 + * @return 返回所有的停车场详情.
  178 + *
  179 + * @status OK.
  180 + * */
14 181 var gettccInfo = function (cb) {
  182 + // 1、get异步请求.获取所有的停车场详情.
15 183 $get('/carpark/all',null, function(cd){
  184 + // 2、返回所有的停车场详情.
16 185 return cb && cb(cd);
17 186 });
18 187 }
19 188  
  189 + /**
  190 + * @description : (TODO) 时间格式字符串转时间对象.
  191 + *
  192 + * @param [time--时间格式字符串].
  193 + *
  194 + * @return 返回一个时间对象.
  195 + *
  196 + * @status OK.
  197 + * */
20 198 var getDateTime = function(time) {
  199 + // 1、定义一个时间对象.
21 200 var dateTime = new Date();
  201 + // 2、判断参数是否为空或者为undefined.
22 202 if(time !=null && time !='' && typeof(time) !='undefined') {
  203 + // 3、给时间对象重新赋值.
23 204 dateTime = new Date(Date.parse(time.replace(/-/g, "/")));
24 205 }
  206 + // 4、返回时间对象.
25 207 return dateTime;
26 208 }
27 209  
28   -
  210 + /**
  211 + * @description : (TODO) 客流方式填充表单时.根据表单参数封装时间段内的车辆数.
  212 + *
  213 + * @param : [map--表单参数]
  214 + *
  215 + * @returns 返回一个根据表单参数封装时间段内的车辆数数组.
  216 + *
  217 + * @status OK.
  218 + * */
29 219 function getsjdArr(map) {
  220 + // 1、获取营运的开始与结束时间点.
30 221 var seMap = getStartAndEndDate(map);
31   - return [{'num':0,'time':seMap.s + '-' + map.earlyStartTime},
32   - {'num':0,'time':map.earlyStartTime + '-' + map.earlyEndTime},
33   - {'num':0,'time':map.earlyEndTime + '-' + map.lateStartTime},
34   - {'num':0,'time':map.lateStartTime + '-' + map.lateEndTime},
35   - {'num':0,'time':map.lateEndTime + '-' + seMap.e}];
  222 + // 2、返回一个根据表单参数封装时间段内的车辆数数组.
  223 + return [{'num':0,'time':seMap.s + '-' + map.earlyStartTime},// 早高峰之前时间段内的车辆.
  224 + {'num':0,'time':map.earlyStartTime + '-' + map.earlyEndTime}, // 早高峰时间段内的车辆.
  225 + {'num':0,'time':map.earlyEndTime + '-' + map.lateStartTime},// 高峰之间时间段内的车辆
  226 + {'num':0,'time':map.lateStartTime + '-' + map.lateEndTime},// 晚高峰时间段内的车辆.
  227 + {'num':0,'time':map.lateEndTime + '-' + seMap.e}];// 晚高峰之后时间段内的车辆.
36 228 }
37   -
38   - function getStartAndEndDate(map) {
39   - return {'s':getMinDate(map.line.startStationFirstTime,map.line.endStationFirstTime),
40   - 'e':getMaxDate(map.line.startStationEndTime,map.line.endStationEndTime)}
41   - }
42   -
  229 +
  230 + /**
  231 + * @description : (TODO) 获取最小时间(字符串).
  232 + *
  233 + * @param [d1--时间1;d2--时间2].
  234 + *
  235 + * @return 返回一个最小时间(字符串).
  236 + *
  237 + * @status OK.
  238 + * */
43 239 function getMinDate(d1,d2) {
  240 + // 1、定义返回字符串.
44 241 var str = '';
  242 + // 2、判断时间大小.
45 243 if(strToTime(d1)>strToTime(d2))
46 244 str = d2;
47 245 else
48 246 str = d1;
  247 + // 3、返回最小时间(字符串).
49 248 return str;
50 249 }
51 250  
52   - function strToTime(t) {
53   - var d = new Date();
54   - if(t) {
55   - var _str = t.split(':');
56   - d.setHours(parseInt(_str[0]));
57   - d.setMinutes(parseInt(_str[1]));
58   - }
59   - return d;
60   - }
61   -
  251 + /**
  252 + * @description : (TODO) 获取最大时间(字符串).
  253 + *
  254 + * @param [d1--时间1;d2--时间2].
  255 + *
  256 + * @return 返回一个最大时间(字符串).
  257 + *
  258 + * @status OK.
  259 + * */
62 260 function getMaxDate(d1,d2) {
  261 + // 1、定义返回时间字符串.
63 262 var str = '';
  263 + // 2、判断时间大小.
64 264 if(strToTime(d1)>strToTime(d2))
65 265 str = d1;
66 266 else
67 267 str = d2;
  268 + // 3、返回一个最大时间(字符串).
68 269 return str;
69 270 }
70 271  
  272 + /**
  273 + * @description : (TODO) 判断是否这时间段内.
  274 + *
  275 + * @param [st--开始时间;ed--结束时间;sj--当前判断的时间]
  276 + *
  277 + * @return 返回一个布尔值.
  278 + *
  279 + * @status OK.
  280 + * */
71 281 function issjd(st,ed,sj) {
  282 + // 1、定义返回值.
72 283 var tag = false;
  284 + // 2、判断时间大小.
73 285 if(sj<=ed && sj>=st)
  286 + // 3、重新赋值返回值.
74 287 tag = true;
  288 + // 4、返回判断结果布尔值.
75 289 return tag;
76 290 }
77 291  
  292 + /**
  293 + * @description : (TODO) 获取客流数据.
  294 + *
  295 + * @params [url--请求地址;data--请求参数;cb--回调函数]
  296 + *
  297 + * */
  298 + function getJSONP(url, data, cb) {
  299 + $.ajax({
  300 + url : url,
  301 + type : "GET",
  302 + dataType : 'jsonp',
  303 + jsonp : 'jsoncallback',
  304 + data : data,
  305 + success : cb
  306 + });
  307 + }
  308 +
  309 + /**
  310 + * @description : (TODO) 根据获取参数方式来获取表单参数详情html模版页.
  311 + *
  312 + * @param [n--获取参数方式;map--表单参数;lineId--线路ID;krl--客容量;cb--回调函数]
  313 + *
  314 + * @return 返回表单参数详情html模版页.
  315 + *
  316 + * @status OK.
  317 + * */
78 318 var getHtmlTemp = function(n,map,lineId,krl,cb) {
79   - var zzsj = parseInt(map.upTravelTime) + 10*2 + parseInt(map.downTravelTime);
  319 + // 1、定义模版名称.
80 320 var tempName = '';
81   - var date = new Date(),
82   - rq = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (date.getDate()-3);
83   - var startDateTime = rq + ' ' + '00:00';
84   - var endDateTime = rq + ' ' + '23:59';
85   - var params = {'xlid':'10773','startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};
86   - if(n==0) {
  321 + if(n==0)
87 322 tempName = 'carnum_temp';
88   - }else if(n==1) {
89   - tempName = 'bctype_temp';
90   - }
  323 + else if(n==1)
  324 + tempName = 'bctype_temp';
  325 + // 2、获参数详情模版html内容.
91 326 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){
92 327 $('#tab3').append(html);
93   - map.lb = 15;
94   - map.workeLunch = 20;
95   - map.workeDinner = 20;
96   - map.mixstopTime = 3;
97   - map.maxstopTime = 20;
98   - map.stopTime = 10;
  328 + map.lb = 15;// 定义例保时间.
  329 + map.workeLunch = 20;// 定义午餐时间.
  330 + map.workeDinner = 20;// 定义晚餐时间.
  331 + map.mixstopTime = 3;// 定义最小停站间隙
  332 + map.maxstopTime = 22;// 定义最大停站间隙.
  333 + map.stopTime = 10;// 定义停站时间.
99 334 if(n==0) {
100   - getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){
101   - console.log(json);
  335 + // 定义一个周转时间.
  336 + var zzsj = parseInt(map.upTravelTime) + 10*2 + parseInt(map.downTravelTime);
  337 + // 定义时间对象.
  338 + var date = new Date(),
  339 + rq = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (date.getDate()-7);
  340 + // 定义开始时间字符串.
  341 + var startDateTime = rq + ' ' + '00:00';
  342 + // 定义结束时间自妇产.
  343 + var endDateTime = rq + ' ' + '23:59';
  344 + // 定义请求参数集合.
  345 + var params = {'xlid':lineId,'startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};
  346 + /**
  347 + * getJSONP请求获取客流数据.
  348 + *
  349 + * 返回的是一个每次以半小时为间隔作为开始时间点, 在加上周转时间作为结束时间点的 时段段内的客流最大通过量.
  350 + * */
  351 + getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){
  352 + // 定义时段集合,可容量.
102 353 var sjdArr = getsjdArr(map),krlInt = parseInt(krl);
  354 + // 遍历时段集合.
103 355 for(var s = 0 ; s<sjdArr.length;s++) {
  356 + // 分割时间段.
104 357 var strA = sjdArr[s].time.split('-');
  358 + // 定义开始时间与结束时间,车辆数.
105 359 var st = getDateTime(rq + ' ' + strA[0]),et = getDateTime(rq + ' ' + strA[1]),num = 0;
  360 + // 遍历时间段内的客流数据集合.
106 361 for(var j = 0 ; j < json.length; j ++) {
  362 + // 定义当前客流班次产生的时间.
107 363 var dqsj = getDateTime(json[j].sj);
  364 + // 判断是否这时间段内.
108 365 if(issjd(st,et,dqsj)) {
  366 + // 车辆数相加.
109 367 num = num + Math.ceil(parseInt(json[j].tgl)/krlInt);
110 368 }
111 369 }
112 370 sjdArr[s].num = num;
113 371 }
114   - /*map.zgfbeforepcs = sjdArr[0].num;
115   - map.zgfpcs = sjdArr[1].num;
116   - map.gfzjpcs = sjdArr[2].num;
117   - map.wgfpcs = sjdArr[3].num;
118   - map.wgfafterpcs = sjdArr[4].num;*/
119   - map.zgfbeforepcs = 3;
120   - map.zgfpcs = 10;
121   - map.gfzjpcs = 8;
122   - map.wgfpcs = 10;
123   - map.wgfafterpcs = 5;
124   -
  372 + map.zgfbeforepcs = sjdArr[0].num;// 早高峰前配车数
  373 + map.zgfpcs = sjdArr[2].num;// 早高峰配车数
  374 + map.gfzjpcs = sjdArr[4].num;// 高峰之间配车数
  375 + map.wgfpcs = sjdArr[2].num ;// 晚高峰配车数
  376 + map.wgfafterpcs = sjdArr[1].num + sjdArr[3].num;// 晚高峰后配车数
  377 + // 返回参数详情模版.
125 378 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
126 379 });
127 380 }else if(n==1) {
  381 + // 返回参数详情模版.
128 382 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
129 383 }
130 384 });
131 385 }
132   - var getCarNumber = function (param,cb) {
133   - $post('url',param,function(data) {
134   - return cb && cb(data);
135   - })
  386 +
  387 + /**
  388 + * @description (TODO) 格式化成渲染图形数据格式.
  389 + *
  390 + * @param [d--查询出的时刻表明细数据.]
  391 + *
  392 + * @return 返回渲染图形的数据格式.
  393 + * */
  394 + function formatData(d) {
  395 + // 定义返回值.
  396 + var resultD = new Array();
  397 + for(var i =0;i<d.length;i++) {
  398 + var obj = {};
  399 + var ddsj = getddsj(d[i].fcsj,d[i].bcsj);// 到达时间.
  400 + obj.bcType = d[i].bcType;// 班次类型
  401 + obj.bcs = d[i].bcs;// 班次数
  402 + obj.bcsj = d[i].bcsj;// 班次时间
  403 + obj.fcno = d[i].fcno;// 发车序号
  404 + obj.fcsj = d[i].fcsj;// 发车时间
  405 + obj.ARRIVALTIME = ddsj// 到达时间
  406 + obj.jhlc = d[i].jhlc;// 计划里程
  407 + obj.lp = d[i].lp==null ? null : d[i].lp.id;// 路牌id
  408 + obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;// 路牌类型
  409 + obj.parent = d[i].lp.lpName;// 路牌名称
  410 + obj.lpNo = d[i].lp.lpNo;// 路牌编码
  411 + obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;// 停车场id
  412 + obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;// 时刻表id
  413 + obj.xl = d[i].xl==null ? null : d[i].xl.id;// 线路id
  414 + obj.xlDir = dmToDh(d[i].xlDir);// 方向【0:relationshipGraph-up 上行;1:relationshipGraph-down 下行】
  415 + obj.qdz = d[i].qdz==null ? null : d[i].qdz.id;// 起点站id
  416 + obj.zdz = d[i].zdz==null ? null : d[i].zdz.id;//终点站id
  417 + obj.isfb = isfbTodm(d[i].isFB);// 是否分班【0:false;1:true】
  418 + obj.isSwitchXl = isSwitchXlTodm(d[i].isSwitchXl);// 是否切换线路【0:false;1:true】
  419 + obj.STOPTIME = gettzsj(d[i],d,ddsj);// 停站时间.
  420 + resultD.push(obj);
  421 + }
  422 + // 返回渲染图形的数据格式.
  423 + return resultD;
136 424 }
  425 +
  426 + /**
  427 + * @description : (TODO) 获取开始与结束时间字符串.
  428 + *
  429 + * @param [map--表单配置参数]
  430 + *
  431 + * @return 返回开始与结束时间字符串集合.
  432 + * */
  433 + function getStartAndEndDate(map) {
  434 + return {'s':getMinDate(map.line.startStationFirstTime,map.line.endStationFirstTime),
  435 + 'e':getMaxDate(map.line.startStationEndTime,map.line.endStationEndTime)}
  436 + }
  437 +
137 438 return {
138 439 // 启动初始化向导导航
139 440 init : function() {
... ... @@ -160,11 +461,11 @@ var SKBFormWizard = function() {
160 461 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 .
161 462 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 .
162 463 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项.
163   - 'zgfbeforepcs' : {required : true,number : true,digits : true},// 早高峰前车辆数,必填项、必须为整数.
164   - 'zgfpcs' : {required : true,number : true,digits : true},// 早高峰车辆数,必填项、必须为整数.
165   - 'wgfafterpcs' : {required : true,number : true,digits : true},// 晚高峰后车俩数,必填项、必须为整数.
166   - 'wgfpcs' : {required : true,number : true,digits : true},// 晚高峰车俩数,必填项、必须为整数.
167   - 'gfzjpcs' : {required : true,number : true,digits : true},// 高峰中间车辆数,必填项、必须为整数.
  464 + 'zgfbeforepcs' : {required : true,number : true,digits : true, isNum0:true},// 早高峰前车辆数,必填项、必须为整数.
  465 + 'zgfpcs' : {required : true,number : true,digits : true, isNum0:true, isMax: true},// 早高峰车辆数,必填项、必须为整数.
  466 + 'wgfafterpcs' : {required : true,number : true,digits : true, isNum0:true},// 晚高峰后车俩数,必填项、必须为整数.
  467 + 'wgfpcs' : {required : true,number : true,digits : true, isNum0:true, isMax: true},// 晚高峰车俩数,必填项、必须为整数.
  468 + 'gfzjpcs' : {required : true,number : true,digits : true, isNum0:true},// 高峰中间车辆数,必填项、必须为整数.
168 469 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数.
169 470 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数.
170 471 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数.
... ... @@ -192,7 +493,7 @@ var SKBFormWizard = function() {
192 493 'downInMileage' : {number : true},// 下行进场里程,必须为数字.
193 494 'downOutMileage' : {number : true},// 下行出场里程,必须为数字.
194 495 'lb' : {number : true},// 早晚例行保养,必须为数字.
195   - 'clzs':{required : true,number : true,digits : true},// 车辆总数,必填项、必须为整数.
  496 + 'clzs':{required : true,number : true,digits : true, isBcType : true},// 车辆总数,必填项、必须为整数.
196 497 'bxrc' : {required : true},// 早晚例行保养,必须为数字.
197 498 },
198 499  
... ... @@ -243,10 +544,15 @@ var SKBFormWizard = function() {
243 544 * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
244 545 */
245 546 submitHandler : function(f) {
  547 + // 定义localStorage对象.
246 548 var storage = window.localStorage;
  549 + // 表单序列化.
247 550 var argus = form.serializeJSON();
  551 + // 获取站点路由.
248 552 $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0]},function(result) {
  553 + // 判断.
249 554 if(result) {
  555 + // 定义上行起点站,上行终点站,下行起点站,下行终点站.
250 556 var upB ='',upE='',downB='',downE='';
251 557 for(var r = 0 ; r<result.length;r++) {
252 558 if(result[r].directions==0 && result[r].stationMark =='B')
... ... @@ -260,14 +566,16 @@ var SKBFormWizard = function() {
260 566 }
261 567 argus.up_s = upB + '_' + upE;
262 568 argus.down_s = downB + '_' + downE;
  569 + // 获取停车车场.
263 570 $get('/carpark/all',{'parkCode_eq':argus.tcc},function(cp) {
264 571 var tcc_id = '';
265 572 if(cp) {
266 573 tcc_id = cp[0].id;
267 574 }
268   - argus.tcc_id = tcc_id;
269   - argus.skbmc = $('#skbNameSelect').select2('data')[0].text;
270   - argus.xlmc = $('#lineSelect').select2('data')[0].text;
  575 + argus.tcc_id = tcc_id; // 停车场ID.
  576 + argus.skbmc = $('#skbNameSelect').select2('data')[0].text;// 时刻名称.
  577 + argus.xlmc = $('#lineSelect').select2('data')[0].text;// 线路名称.
  578 + // 获取时刻表明细.
271 579 $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) {
272 580 if(data.status=='SUCCESS' && data.data.length>0) {
273 581 argus.istidc = 1;
... ... @@ -277,7 +585,7 @@ var SKBFormWizard = function() {
277 585 btn: ['确定并使用','取消并继续'] //按钮
278 586 }, function(){
279 587 layer.closeAll();
280   - submit(JSON.stringify(gsData(data.data)),argus);
  588 + submit(JSON.stringify(formatData(data.data)),argus);
281 589 }, function(){
282 590 submit(null,argus);
283 591 });
... ... @@ -291,6 +599,8 @@ var SKBFormWizard = function() {
291 599 layer.msg('系统不存在该线路的上、下行起终点站!');
292 600 }
293 601 });
  602 +
  603 + // 表单提交.
294 604 function submit(p,argus) {
295 605 storage.setItem("Gantt_AgursData",JSON.stringify(argus));
296 606 storage.setItem('isDoDate',p);
... ... @@ -298,110 +608,99 @@ var SKBFormWizard = function() {
298 608 }
299 609 }
300 610 });
301   - function gsData(d) {
302   - var resultD = new Array();
303   - for(var i =0;i<d.length;i++) {
304   - var obj = {};
305   - var ddsj = getddsj(d[i].fcsj,d[i].bcsj);
306   - obj.bcType = d[i].bcType;//班次类型
307   - obj.bcs = d[i].bcs;// 班次数
308   - obj.bcsj = d[i].bcsj;// 班次时间
309   - obj.fcno = d[i].fcno;// 发车序号
310   - obj.fcsj = d[i].fcsj;//发车时间
311   - obj.ARRIVALTIME = ddsj//到达时间
312   - obj.jhlc = d[i].jhlc;//计划里程
313   - obj.lp = d[i].lp==null ? null : d[i].lp.id;//路牌id
314   - obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;//路牌类型
315   - obj.parent = d[i].lp.lpName;// 路牌名称
316   - obj.lpNo = d[i].lp.lpNo;//路牌编码
317   - obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;//停车场id
318   - obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;//时刻表id
319   - obj.xl = d[i].xl==null ? null : d[i].xl.id;//线路id
320   - obj.xlDir = dmToDh(d[i].xlDir);// 方向【0:relationshipGraph-up 上行;1:relationshipGraph-down 下行】
321   - obj.qdz = d[i].qdz==null ? null : d[i].qdz.id;// 起点站id
322   - obj.zdz = d[i].zdz==null ? null : d[i].zdz.id;//终点站id
323   - obj.isfb = isfbTodm(d[i].isFB);//是否分班【0:false;1:true】
324   - obj.isSwitchXl = isSwitchXlTodm(d[i].isSwitchXl);// 是否切换线路【0:false;1:true】
325   - obj.STOPTIME = gettzsj(d[i],d,ddsj);
326   - resultD.push(obj);
327   - }
328   - console.log(resultD);
329   - return resultD;
330   - }
331   - function gettzsj(o,d,sj) {
332   - var tzsj = 0;
333   - for(var i = 0 ;i<d.length;i++) {
334   - if(o.lp.lpNo == d[i].lp.lpNo && o.lp.id == d[i].lp.id) {
335   - if(d[i].fcno - o.fcno ==1){
336   - tzsj = (strToTime(d[i].fcsj) -strToTime(sj)) / 60000;
337   - continue;
338   - }
339   -
340   - }
341   - }
342   - return tzsj;
343   - }
344   -
345   - function isSwitchXlTodm(d) {
346   - var rstr = 0;
347   - if(d)
348   - rstr = 1;
349   - return rstr;
350   - }
351   -
352   - function isfbTodm(b) {
353   - var rstr = 0;
354   - if(b)
355   - rstr = 1;
356   - return rstr;
357   - }
358   -
359   - function getddsj(tStr,bcsj) {
360   - var rt = '';
361   - var date = new Date();
362   - var _str = tStr.split(':');
363   - date.setHours(parseInt(_str[0]));
364   - date.setMinutes(parseInt(_str[1]) + bcsj);
365   - return getTimeStr(date);
366   - }
367   -
368   - var strToTime = function(t) {
369   - var d = new Date;
370   - if(t) {
371   - var _str = t.split(':');
372   - d.setHours(parseInt(_str[0]));
373   - d.setMinutes(parseInt(_str[1]));
374   - }
375   - return d;
376   - }
377 611  
378   - function getTimeStr(t) {
379   - var _str = '';
380   - if(t) {
381   - _str = ((t.getHours()<10? '0' + t.getHours() : t.getHours()) == '00' ? '24' :(t.getHours()<10? '0' + t.getHours() : t.getHours()))
382   - +':'
383   - +(t.getMinutes()<10? '0' + t.getMinutes() : t.getMinutes());
384   - }
385   - return _str;
386   - }
  612 + // 验证配车数不能为零.
  613 + $.validator.addMethod('isNum0', function(value,element) {
  614 + // 定义返回值.
  615 + var tag = true;
  616 + var zgfbeforepcs = $('#zgfbeforepcsInput').val(),// 早高峰前配车数.
  617 + zgfpcs = $('#zgfpcsInput').val(),// 早高峰配车数.
  618 + gfzjpcs = $('#gfzjpcsInput').val(),// 高峰之间配车数.
  619 + wgfpcs = $('#wgfpcsInput').val(),// 晚高峰配车数.
  620 + wgfafterpcs = $('#wgfafterpcsInput').val();// 晚高峰后配车数.
  621 + // 判断是否为零.
  622 + if(parseInt(zgfbeforepcs) == 0 || parseInt(zgfbeforepcs) ==0 ||
  623 + parseInt(gfzjpcs) ==0 || parseInt(wgfpcs) ==0 || parseInt(wgfafterpcs) ==0)
  624 + tag = false;
  625 + return tag;
  626 + },function(){return '配车数不能为零!'; });
387 627  
388   - function dmToDh(t) {
389   - var reslStr = '';
390   - if(t=='0')
391   - reslStr = 'relationshipGraph-up';
392   - else if(t=='1')
393   - reslStr = 'relationshipGraph-down';
394   - return reslStr;
395   - }
  628 + // 验证高峰时段内的配车数是否高于其它时段配车数.
  629 + $.validator.addMethod('isMax', function(value,element) {
  630 + var tag = true;
  631 + var zgfbeforepcs = parseInt($('#zgfbeforepcsInput').val()),// 早高峰前配车数.
  632 + zgfpcs = parseInt($('#zgfpcsInput').val()),// 早高峰配车数.
  633 + gfzjpcs = parseInt($('#gfzjpcsInput').val()),// 高峰之间配车数.
  634 + wgfpcs = parseInt($('#wgfpcsInput').val()),// 晚高峰配车数.
  635 + wgfafterpcs = parseInt($('#wgfafterpcsInput').val());// 晚高峰后配车数.
  636 + // 判断高峰时段内的配车数是否高于其它时段配车数.
  637 + if(zgfpcs<zgfbeforepcs || zgfpcs<gfzjpcs || zgfpcs<wgfafterpcs || wgfpcs<zgfbeforepcs || wgfpcs<gfzjpcs || wgfpcs<wgfafterpcs )
  638 + tag = false;
  639 + return tag;
  640 + },function(){return '高峰时段配车数必须高于其它时段配车数!';});
396 641  
  642 + // 验证客流数据分析时客容量为必填项.
397 643 $.validator.addMethod("isBaseRes", function(value,element) {
  644 + // 定义返回值.
398 645 var tag = true;
  646 + // 定义选择获取参数方式值
399 647 var baseChecked = $('#submit_argus_form input[name="baseRes"]:checked').val();
  648 + // 判断
400 649 if(baseChecked == '0' && $('#krlInput').val()== '')
401 650 tag = false;
402 651 return tag;
403 652 }, '客流大数据分析,客流总量为必填项!');
404 653  
  654 + // 验证配车数不能为零.
  655 + $.validator.addMethod('isBcType', function(value,element) {
  656 + // 定义返回值.
  657 + var tag = true;
  658 + // 定义车辆总数,班型人次.
  659 + var clzs = $('#clzsInput').val(),
  660 + bxrc = $('#state_tagsinput').val();
  661 + // 判断.
  662 + if(bxrc=='' || bxrc==null || clzs=='' || clzs==0)
  663 + return false;
  664 + // 定义首末班次开始结束时间集合.
  665 + var map = {'line':{'startStationFirstTime':$('#qdzsbsjInput').val(),
  666 + 'startStationEndTime':$('#qdzmbsjInput').val(),
  667 + 'endStationFirstTime':$('#zdzsbsjInput').val(),
  668 + 'endStationEndTime':$('#zdzmbsjInput').val()}};
  669 + // 定义开始~结束时间.
  670 + var setMap = getStartAndEndDate(map);
  671 + console.log(setMap);
  672 + // 定义最大工时.
  673 + var maxGs = parseInt( ((strToTime(setMap.e) - strToTime(setMap.s)) / 60000) / 60) * parseInt(clzs);
  674 + // 切割班型人次,定义班次人次所用总工时.
  675 + var bxrcAr = bxrc.split(','),countGs = 0;
  676 + // 遍历
  677 + for(var s = 0 ; s< bxrcAr.length;s++) {
  678 + // 切割单个班型人次.
  679 + var s1a = bxrcAr[s].split('/');
  680 + // 定义人次.
  681 + var rs = parseInt(s1a[1]);
  682 + // 定义小时系数.
  683 + var hoursV = 0.0;
  684 + for(var g = 0 ; g < bxrcGs.length; g++) {
  685 + // 判断班型是否一致.
  686 + if(bxrcGs[g].type == s1a[0]) {
  687 + // 重新赋值小时系数.
  688 + hoursV = bxrcGs[g].hoursV;
  689 + }
  690 + }
  691 + // 重新计算班次人次所用总工时.
  692 + countGs = countGs + parseFloat(hoursV.toFixed(2)) * rs;
  693 + }
  694 + // 判断
  695 + if(parseFloat(countGs.toFixed(2))>maxGs)
  696 + tag = false;
  697 + return tag;
  698 + },function(){return '配车总数与班型人次搭配不合理!'; });
  699 +
  700 + /**
  701 + * @description : (TODO) 监听获取参数方式值改变事件.
  702 + *
  703 + * */
405 704 $('input:radio[name="baseRes"]').on('change',function(v) {
406 705 if($(this).val()=='1')
407 706 $('#krlGroup').hide();
... ... @@ -484,25 +783,29 @@ var SKBFormWizard = function() {
484 783 return false;
485 784 }
486 785 if(index==1) {
  786 + // 初始化客容量值.
487 787 if($('#krlInput').val() == '')
488 788 $('#krlInput').val(50);
489 789 }else if(index == 2) {
490   - var baseRes = $('#submit_argus_form input[name="baseRes"]:checked').val(),
491   - lineId = $('#lineSelect').val().split('_')[0],
492   - krl = $('#krlInput').val();
  790 + var baseRes = $('#submit_argus_form input[name="baseRes"]:checked').val(),// 获取参数方式值.
  791 + lineId = $('#lineSelect').val().split('_')[0],// 线路ID.
  792 + krl = $('#krlInput').val();// 客容量
493 793 getLineInfo(lineId,function(r) {
494 794 getHtmlTemp(baseRes,r.content[0],lineId,krl,function(htlMap) {
495 795 $('#tab3').html(htlMap.forminput);
496 796 $('#tab4').html(htlMap.datadisplay);
497 797 if(baseRes==1)
498   - ComponentsBootstrapTagsinput.init();
  798 + ComponentsBootstrapTagsinput.init();// 初始化班型人次Input Tag.
499 799 // 日期控件
500   - $('#qdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
501   - $('#endServiceTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
502   - $('#morningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
503   - $('#morningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
504   - $('#eveningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
505   - $('#eveningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  800 + $('#qdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 起始站首班时间
  801 + $('#qdzmbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 起始站末班时间
  802 + $('#zdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 终点站首班时间
  803 + $('#zdzmbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 终点站末班时间
  804 + $('#zgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰开始时间
  805 + $('#zgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 早高峰结束时间
  806 + $('#wgfkssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰开始时间
  807 + $('#wgfjssjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});// 晚高峰结束时间
  808 + // 初始化停车场下拉框.
506 809 gettccInfo(function(cd) {
507 810 var options = '<option value="">请选择...</option><optgroup label="停车场">';
508 811 var $_len = cd.length;
... ... @@ -543,15 +846,4 @@ var SKBFormWizard = function() {
543 846 $('#submit_argus_form').find('.button-previous').hide();
544 847 }
545 848 }
546   - function getJSONP(url, data, cb) {
547   - $.ajax({
548   - url : url,
549   - type : "GET",
550   - dataType : 'jsonp',
551   - jsonp : 'jsoncallback',
552   - data : data,
553   - success : cb
554   - });
555   - }
556   -
557   -}();
  849 +}();
558 850 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -1217,7 +1217,6 @@ var BaseFun = function() {
1217 1217 qt.push(arr[a]);
1218 1218 }
1219 1219 }
1220   - // debugger;
1221 1220 var tempup = baseF.sortDirArray(upArr);
1222 1221 var tempdown = baseF.sortDirArray(downArr);
1223 1222 return {'upArr':tempup,'downArr':tempdown,'qt':qt};
... ... @@ -1233,7 +1232,6 @@ var BaseFun = function() {
1233 1232 * @status OK.
1234 1233 * */
1235 1234 sortDirArray : function(arr) {
1236   - ///debugger;
1237 1235 //console.log(arr.length);
1238 1236 var list = new Array(),tempArray = new Array();
1239 1237 for(var a =0;a<arr.length;a++) {
... ... @@ -1249,7 +1247,6 @@ var BaseFun = function() {
1249 1247 list.push(arr[d]);
1250 1248 }
1251 1249 }
1252   - //debugger;
1253 1250 //console.log(list.length);
1254 1251 return list;
1255 1252 },
... ... @@ -1261,7 +1258,6 @@ var BaseFun = function() {
1261 1258 * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组
1262 1259 **/
1263 1260 jhfcjx : function(bcArr,dir,zzsj,dataMap) {
1264   - // debugger;
1265 1261 console.log(bcArr.length);
1266 1262 //console.log('调整' + dir + '发车间隙...');
1267 1263 // 1、定义某个方向下的首末班次时间结点.
... ... @@ -1286,7 +1282,6 @@ var BaseFun = function() {
1286 1282 return;
1287 1283 var fcnosj = new Date(kssj);
1288 1284 // 2.4、调整班次
1289   - //debugger;
1290 1285 for(var l = 0 ;l<bcArr.length-1;l++) {
1291 1286 var _t = baseF.getDateTime(bcArr[l].fcsj);
1292 1287 if(_t>temp )
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
... ... @@ -325,17 +325,18 @@ var _animation = function(d3Node) {return d3Node.transition().delay(function(d,i
325 325 * @returns {Object} table.outerHTML
326 326 ************************************************************************************************************************************************/
327 327 var createTooltip = function createTooltip(self) {
328   - var hiddenKeys = ['_PRIVATE_','fcno' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR', /*'INTERVAL',*/'num'],
329   - showKeys = self.configuration.showKeys;
330 328 return d3.tip().attr('class', 'relationshipGraph-tip').offset([-8, -10]).html(function (obj) {
331 329 var keys = Object.keys(obj),
332 330 table = document.createElement('table'),
333 331 count = keys.length,
334 332 rows = [];
  333 + var showKeys = self.configuration.showKeys;
  334 + var hiddenKeys = ['_PRIVATE_' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR','lpNo','lpName','lp','lpType',
  335 + 'jhlc','tcc','ttinfo','xl','isfb','qdz','zdz','isSwitchXl','bz','bcs','fcno'];
335 336 while (count--) {
336   - var element = keys[count],
337   - upperCaseKey = element.toUpperCase();
338   - if (!RelationshipGraph.contains(hiddenKeys, upperCaseKey) && !upperCaseKey.startsWith('__') && obj[element] !='tjz') {
  337 + var element = keys[count];
  338 + // upperCaseKey = element.toUpperCase();
  339 + if (!RelationshipGraph.contains(hiddenKeys, element) && !element.startsWith('__') && obj[element] !='tjz') {
339 340 var row = document.createElement('tr'),
340 341 key = showKeys ? document.createElement('td') : null,
341 342 value = document.createElement('td');
... ... @@ -352,7 +353,7 @@ var createTooltip = function createTooltip(self) {
352 353 else if(element=='xlDir')
353 354 changeKey = '行驶方向:';
354 355 else if(element=='parent')
355   - changeKey = '当前车辆:';
  356 + changeKey = '当前路牌:';
356 357 else if(element=='bcType')
357 358 changeKey = '班次类型:';
358 359 else if(element=='tjbx')
... ... @@ -363,7 +364,7 @@ var createTooltip = function createTooltip(self) {
363 364 row.appendChild(key);
364 365 }
365 366  
366   - if (upperCaseKey == 'VALUE' && !self.configuration.valueKeyName) {
  367 + if (element == 'VALUE' && !self.configuration.valueKeyName) {
367 368 continue;
368 369 }
369 370  
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -101,7 +101,8 @@
101 101 'jclcArr' : BaseFun.formatPairing(gatps.upInMileage,gatps.downInMileage),// 进场里程。[下标0代表上;下标1代表下]
102 102 'cclcArr' : BaseFun.formatPairing(gatps.upOutMileage,gatps.downOutMileage),// 出场里程。[下标0代表上;下标1代表下]
103 103 'pcxssjArr' : BaseFun.formatPairing(gatps.upTravelTime,gatps.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下]
104   - 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime,gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
  104 + 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime=='' ? gatps.upTravelTime : gatps.lateUpTime,
  105 + gatps.lateDownTime=='' ? gatps.downTravelTime : gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
105 106 'pcxslcArr' : BaseFun.formatPairing(gatps.upMileage,gatps.downMileage),// 行驶里程。[下标0代表上;下标1代表下]
106 107 'qdzArr' : BaseFun.qzdz(gatps.up_s.split('_')[0],gatps.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下]
107 108 'zdzArr':BaseFun.qzdz(gatps.up_s.split('_')[1],gatps.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下]
... ...
src/main/resources/static/pages/base/timesmodel/js/tagsinput.js
... ... @@ -25,10 +25,30 @@ var ComponentsBootstrapTagsinput = function() {
25 25 itemValue: 'value',
26 26 itemText: 'text'
27 27 });
  28 +
  29 + $('#state_tagsinput').on('beforeItemAdd', function(event) {
  30 + var bctypeValue = $('#state_tagsinput_bctype').val();
  31 + var rcnum = $('#state_tagsinput_value').val();
  32 + var bxrcAr = $('#state_tagsinput').val().split(',');
  33 + for(var s = 0 ; s< bxrcAr.length;s++) {
  34 + var s1a = bxrcAr[s].split('/');
  35 + if(s1a[0]==bctypeValue) {
  36 + $('#state_tagsinput').tagsinput('remove', bxrcAr[s]);
  37 + }
  38 + }
  39 + });
  40 +
28 41 $('#state_tagsinput_add').on('click', function(){
29 42 var bctypeValue = $('#state_tagsinput_bctype').val();
30 43 var rcnum = $('#state_tagsinput_value').val();
31 44 if(isNull(bctypeValue,rcnum)) {
  45 + var bxrcAr = $('#state_tagsinput').val().split(',');
  46 + for(var s = 0 ; s< bxrcAr.length;s++) {
  47 + var s1a = bxrcAr[s].split('/');
  48 + if(s1a[0]==bctypeValue) {
  49 + rcnum = parseInt(rcnum) + parseInt(s1a[1]);
  50 + }
  51 + }
32 52 elt.tagsinput('add', {
33 53 "value": bctypeValue + '/' + rcnum,
34 54 "text": bctypeValue + '/' + rcnum,
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
... ... @@ -7,123 +7,351 @@
7 7 * TODO:优化开发中
8 8 *
9 9 */
10   -angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
11   - function($compile, $window) {
12   - return {
13   - restrict: 'E',
14   - templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
15   - scope: { // 独立作用域
16   - // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
17   - ds: "=ngModel",
18   - celldbclickFn: "&celldbclick"
19   -
20   - // TODO:
21   -
22   - },
23   - controllerAs: "$saTimeTableCtrl",
24   - bindToController: true,
25   - controller: function() {
26   - var self = this;
27   - this.$$headToolTip = ""; // 表头tooltip信息
28   -
29   - // TODO:
30   - },
31   -
32   - /**,
33   - * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
34   - * @param tElem
35   - * @param tAttrs
36   - * @returns {{pre: Function, post: Function}}
37   - */
38   - compile: function(tElem, tAttrs) {
39   - // 获取属性
40   - var $attr_name = tAttrs["name"]; // 控件的名字
41   - if (!$attr_name) {
42   - throw new Error("saTimeTable指令 name属性required");
  10 +
  11 +angular.module('ScheduleApp').factory(
  12 + 'SaTimeTableUtils',
  13 + [
  14 + function() {
  15 + // 内部班次信息类
  16 + // detailInfo是后台返回的数据,格式如下:
  17 + // {"ttdid":null,"fcsj":"3/17.10","bc_type":null,"xldir":null,"isfb":false,"qdz":null,"zdz":null,"tcc":null}
  18 + var BcInfo = function(detailInfo) {
  19 + this.ttdid = detailInfo && detailInfo.ttdid; // 时刻表id
  20 + this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间
  21 + this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型
  22 + this.xldir = detailInfo && detailInfo.xldir; // 线路上下行
  23 + this.isfb = detailInfo && detailInfo.isfb; // 是否分班
  24 + this.qdz = detailInfo && detailInfo.qdz; // 起点站id
  25 + this.zdz = detailInfo && detailInfo.zdz; // 终点站id
  26 + this.tcc = detailInfo && detailInfo.tcc; // 停车场id
  27 +
  28 + // 路牌信息
  29 + this.lpId = undefined; // id
  30 + this.lpName = undefined; // 名字
  31 +
  32 + // 发车序号,班次数
  33 + this.fcno = undefined;
  34 + this.bcs = undefined;
  35 +
  36 + this.sel = false; // 是否被选中
  37 +
  38 + // 其余函数判定的内部保存值
  39 + this.isCanSel = false;
  40 + this.isValidInfo = false;
  41 +
  42 + };
  43 + BcInfo.prototype.canUpdate = function() { // 是否能更新
  44 + if (this.sel && this.ttdid) {
  45 + return true;
  46 + } else {
  47 + return false;
  48 + }
  49 + };
  50 + BcInfo.prototype.canDelete = function() { // 是否能删除
  51 + if (this.sel && this.ttdid) {
  52 + return true;
  53 + } else {
  54 + return false;
43 55 }
44   - var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
45   -
46   - // 内部controlAs名字
47   - var ctrlAs = '$saTimeTableCtrl';
48   -
49   - // 当前选中的cell
50   - var startRowIndex = undefined;
51   - var startColIndex = undefined;
52   - var shiftKey = false; // shift键是否被按住
53   - var ctrlKey = false; // ctrl是否被按住
54   - // shift选中的cell
55   - var shiftCells = [];
56   -
57   - // TODO:
58   -
59   - return {
60   - pre: function(scope, element, attr) {
61   - // TODO:
62   - //alert(element.find("#tooltipTest").html());
63   - //$compile(element.find("#tooltipTest"))(scope);
64   -
65   - },
66   - post: function(scope, element, attr) {
67   - // TODO:
68   -
69   - // ------------------- dom事件处理function -----------------//
70   - scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
71   - console.log("click " + "row=" + rowindex + ",col=" + colindex);
72   - var internal_ds = scope[ctrlAs].ds.detailInfos;
73   -
74   - if (cell.ttdid) { // 是班次的单元格才能操作
75   - cell.sel = !cell.sel;
  56 + };
  57 + BcInfo.prototype.canSel = function() { // 是否能选中
  58 + if (this.ttdid) {
  59 + this.isCanSel = true;
  60 + return true;
  61 + } else if (this.fcsj) {
  62 + // 没有ttdid,有fcsj标识,
  63 + // 由于是后台返回数据的格式,这种就是路牌和汇总信息,不能选中
  64 + this.isCanSel = false;
  65 + return false;
  66 + } else {
  67 + // 都是空的,表示是一个空班次,可以选中
  68 + this.isCanSel = true;
  69 + return true;
  70 + }
  71 + };
  72 + BcInfo.prototype.validInfo = function() { // 验证班次信息内容是否正确
  73 + if (this.canSel() && this.ttdid) {
  74 + if (this.bc_type == 'in') {
  75 + if (this.qdz == null || this.tcc == null) {
  76 + this.isValidInfo = true;
  77 + return true;
  78 + } else {
  79 + this.isValidInfo = false;
  80 + return false;
  81 + }
  82 + } else if (this.bc_type == 'out') {
  83 + if (this.tcc == null || this.zdz == null) {
  84 + this.isValidInfo = true;
  85 + return true;
  86 + } else {
  87 + this.isValidInfo = false;
  88 + return false;
  89 + }
  90 + } else {
  91 + if (this.qdz == null || this.zdz == null) {
  92 + this.isValidInfo = true;
  93 + return true;
  94 + } else {
  95 + this.isValidInfo = false;
  96 + return false;
  97 + }
  98 + }
  99 + } else {
  100 + this.isValidInfo = true;
  101 + return true;
  102 + }
  103 + };
  104 +
  105 + BcInfo.prototype.where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // 判定班次是否在指定条件内
  106 + var fcsj_m_h = [];
  107 + fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
  108 + fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
  109 +
  110 + var fcsj = new Date(2000,1,1);
  111 + fcsj.setHours(fcsj_m_h[0]);
  112 + fcsj.setMinutes(fcsj_m_h[1]);
  113 +
  114 + var s_temp_date = new Date(2000, 1, 1);
  115 + var e_temp_date = new Date(2000, 1, 1);
  116 +
  117 + if (xldir == 2) { // 上下行
  118 + // 判定是否要进出场班次
  119 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  120 + return false;
  121 + }
  122 +
  123 + if (startTime_h_m) {
  124 + if (endTime_h_m) {
  125 + s_temp_date.setHours(startTime_h_m[0]);
  126 + s_temp_date.setMinutes(startTime_h_m[1]);
  127 + e_temp_date.setHours(endTime_h_m[0]);
  128 + e_temp_date.setMinutes(endTime_h_m[1]);
  129 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  130 + } else {
  131 + s_temp_date.setHours(startTime_h_m[0]);
  132 + s_temp_date.setMinutes(startTime_h_m[1]);
  133 + return fcsj >= s_temp_date;
  134 + }
  135 + } else {
  136 + if (endTime_h_m) {
  137 + e_temp_date.setHours(endTime_h_m[0]);
  138 + e_temp_date.setMinutes(endTime_h_m[1]);
  139 + return fcsj <= e_temp_date;
  140 + } else {
  141 + return false;
  142 + }
  143 + }
  144 + } else {
  145 + // 判定是否要进出场班次
  146 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  147 + return false;
  148 + }
  149 +
  150 + if (xldir == this.xldir) {
  151 + if (startTime_h_m) {
  152 + if (endTime_h_m) {
  153 + s_temp_date.setHours(startTime_h_m[0]);
  154 + s_temp_date.setMinutes(startTime_h_m[1]);
  155 + e_temp_date.setHours(endTime_h_m[0]);
  156 + e_temp_date.setMinutes(endTime_h_m[1]);
  157 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  158 + } else {
  159 + s_temp_date.setHours(startTime_h_m[0]);
  160 + s_temp_date.setMinutes(startTime_h_m[1]);
  161 + return fcsj >= s_temp_date;
  162 + }
  163 + } else {
  164 + if (endTime_h_m) {
  165 + e_temp_date.setHours(endTime_h_m[0]);
  166 + e_temp_date.setMinutes(endTime_h_m[1]);
  167 + return fcsj <= e_temp_date;
  168 + } else {
  169 + return true;
76 170 }
  171 + }
  172 + } else {
  173 + return false;
  174 + }
  175 + }
  176 + };
  177 +
  178 + return {
  179 + createBcInfo: function(detailInfo, lpDetailInfo) {
  180 + var bcInfo = new BcInfo(detailInfo);
  181 + if (!bcInfo.ttdid && bcInfo.fcsj && bcInfo.fcsj.indexOf('_') > 0) {
  182 + var temp_info = bcInfo.fcsj.split('_');
  183 + // 添加信息的属性
  184 + bcInfo.lpName = temp_info[1];
  185 + bcInfo.lpId = temp_info[0];
  186 + // 修改fcsj为路牌名字
  187 + bcInfo.fcsj = bcInfo.lpName;
  188 + }
  189 +
  190 + // 重新设定路牌信息
  191 + if (!bcInfo.lpId) {
  192 + bcInfo.lpId = lpDetailInfo.lpId;
  193 + bcInfo.lpName = lpDetailInfo.lpName;
  194 + }
77 195  
78   - };
79   - scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
80   - if (cell.ttdid) { // 是班次的单元格才能操作
81   - if ($attr_celldbclick) {
82   - // 注意调用方法
83   - scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  196 + return bcInfo;
  197 + },
  198 + initTTInfoDetail: function(formobj, cellinfo, colinfo, xlid, xlname, ttid, ttname) {
  199 + formobj.xl = {};
  200 + formobj.xl.id = xlid;
  201 + formobj.xl.name = xlname;
  202 + formobj.ttinfo = {};
  203 + formobj.ttinfo.id = ttid;
  204 + formobj.ttinfo.name = ttname;
  205 + formobj.lp = {};
  206 + formobj.lp.id = cellinfo.lpId;
  207 + formobj.lp.lpName = cellinfo.lpName;
  208 + formobj.fcno = cellinfo.fcno;
  209 + formobj.bcs = cellinfo.bcs;
  210 + formobj.isFB = cellinfo.isfb;
  211 +
  212 + formobj.bcType = colinfo.bc_type;
  213 + formobj.xlDir = colinfo.xldir;
  214 + if (colinfo.qdz) {
  215 + formobj.qdz = {};
  216 + formobj.qdz.id = colinfo.qdz;
  217 + }
  218 + if (colinfo.zdz) {
  219 + formobj.zdz = {};
  220 + formobj.zdz.id = colinfo.zdz;
  221 + }
  222 + if (colinfo.tcc) {
  223 + formobj.tcc = {};
  224 + formobj.tcc.id = colinfo.tcc;
  225 + }
  226 +
  227 + }
  228 + };
  229 + }
  230 + ]
  231 +);
  232 +
  233 +angular.module('ScheduleApp').directive(
  234 + 'saTimetable',
  235 + [
  236 + '$compile',
  237 + '$window',
  238 + function($compile, $window) {
  239 + return {
  240 + restrict: 'E',
  241 + templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
  242 + scope: { // 独立作用域
  243 + // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
  244 + ds: "=ngModel",
  245 + celldbclickFn: "&celldbclick"
  246 +
  247 + // TODO:
  248 +
  249 + },
  250 + controllerAs: "$saTimeTableCtrl",
  251 + bindToController: true,
  252 + controller: function() {
  253 + var self = this;
  254 + this.$$headToolTip = ""; // 表头tooltip信息
  255 +
  256 + // TODO:
  257 + },
  258 +
  259 + /**,
  260 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  261 + * @param tElem
  262 + * @param tAttrs
  263 + * @returns {{pre: Function, post: Function}}
  264 + */
  265 + compile: function(tElem, tAttrs) {
  266 + // 获取属性
  267 + var $attr_name = tAttrs["name"]; // 控件的名字
  268 + if (!$attr_name) {
  269 + throw new Error("saTimeTable指令 name属性required");
  270 + }
  271 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  272 +
  273 + // 内部controlAs名字
  274 + var ctrlAs = '$saTimeTableCtrl';
  275 +
  276 + // 当前选中的cell
  277 + var startRowIndex = undefined;
  278 + var startColIndex = undefined;
  279 + var shiftKey = false; // shift键是否被按住
  280 + var ctrlKey = false; // ctrl是否被按住
  281 + // shift选中的cell
  282 + var shiftCells = [];
  283 +
  284 + // TODO:
  285 +
  286 + return {
  287 + pre: function(scope, element, attr) {
  288 + // TODO:
  289 + //alert(element.find("#tooltipTest").html());
  290 + //$compile(element.find("#tooltipTest"))(scope);
  291 +
  292 + },
  293 + post: function(scope, element, attr) {
  294 + // TODO:
  295 +
  296 + // ------------------- dom事件处理function -----------------//
  297 + scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
  298 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  299 + var internal_ds = scope[ctrlAs].ds.detailInfos;
  300 +
  301 + if (cell.canSel()) { // 是班次的单元格才能操作
  302 + cell.sel = !cell.sel;
84 303 }
85   - }
86   - };
87   -
88   - // ------------------- 监控function ------------------//
89   - // 监控明细数据,生成表头的tooltip
90   - scope.$watch(
91   - function() {
92   - return scope[ctrlAs].ds;
93   - },
94   - function(newValue, oldValue) {
95   - if (newValue &&
96   - newValue.detailHeads &&
97   - newValue.detailHeads.length > 0) {
98   - var tooltip = [];
99   - tooltip.push("出场");
100   - angular.forEach(newValue.detailHeads, function(value) {
101   - if (value != "出场" &&
102   - value != "路牌" &&
103   - value != "进场" &&
104   - value != "空驶班次/空驶里程" &&
105   - value != "运营班次/运营里程" ) {
106   - var exist = false;
107   - angular.forEach(tooltip, function(tip) {
108   - if (tip == value) {
109   - exist = true;
  304 +
  305 + };
  306 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  307 + if (cell.canSel()) { // 是班次的单元格才能操作
  308 + if ($attr_celldbclick) {
  309 + // 注意调用方法
  310 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  311 + }
  312 + }
  313 + };
  314 +
  315 + // ------------------- 监控function ------------------//
  316 + // 监控明细数据,生成表头的tooltip
  317 + scope.$watch(
  318 + function() {
  319 + return scope[ctrlAs].ds;
  320 + },
  321 + function(newValue, oldValue) {
  322 + if (newValue &&
  323 + newValue.detailHeads &&
  324 + newValue.detailHeads.length > 0) {
  325 + var tooltip = [];
  326 + tooltip.push("出场");
  327 + angular.forEach(newValue.detailHeads, function(value) {
  328 + if (value != "出场" &&
  329 + value != "路牌" &&
  330 + value != "进场" &&
  331 + value != "空驶班次/空驶里程" &&
  332 + value != "运营班次/运营里程" ) {
  333 + var exist = false;
  334 + angular.forEach(tooltip, function(tip) {
  335 + if (tip == value) {
  336 + exist = true;
  337 + }
  338 + });
  339 + if (!exist) {
  340 + tooltip.push(value);
110 341 }
111   - });
112   - if (!exist) {
113   - tooltip.push(value);
114 342 }
115   - }
116   - });
117   - tooltip.push("进场");
118   - scope[ctrlAs].$$headToolTip = tooltip.join(",");
119   - }
120   - },
121   - true
122   - )
123   - }
124   - };
125   - }
  343 + });
  344 + tooltip.push("进场");
  345 + scope[ctrlAs].$$headToolTip = tooltip.join(",");
  346 + }
  347 + },
  348 + true
  349 + )
  350 + }
  351 + };
  352 + }
126 353  
127   - };
128   - }
129   -]);
  354 + };
  355 + }
  356 + ]
  357 +);
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -3705,126 +3705,354 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saBcgroup&#39;, [
3705 3705 * TODO:优化开发中
3706 3706 *
3707 3707 */
3708   -angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
3709   - function($compile, $window) {
3710   - return {
3711   - restrict: 'E',
3712   - templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
3713   - scope: { // 独立作用域
3714   - // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
3715   - ds: "=ngModel",
3716   - celldbclickFn: "&celldbclick"
3717 3708  
3718   - // TODO:
  3709 +angular.module('ScheduleApp').factory(
  3710 + 'SaTimeTableUtils',
  3711 + [
  3712 + function() {
  3713 + // 内部班次信息类
  3714 + // detailInfo是后台返回的数据,格式如下:
  3715 + // {"ttdid":null,"fcsj":"3/17.10","bc_type":null,"xldir":null,"isfb":false,"qdz":null,"zdz":null,"tcc":null}
  3716 + var BcInfo = function(detailInfo) {
  3717 + this.ttdid = detailInfo && detailInfo.ttdid; // 时刻表id
  3718 + this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间
  3719 + this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型
  3720 + this.xldir = detailInfo && detailInfo.xldir; // 线路上下行
  3721 + this.isfb = detailInfo && detailInfo.isfb; // 是否分班
  3722 + this.qdz = detailInfo && detailInfo.qdz; // 起点站id
  3723 + this.zdz = detailInfo && detailInfo.zdz; // 终点站id
  3724 + this.tcc = detailInfo && detailInfo.tcc; // 停车场id
  3725 +
  3726 + // 路牌信息
  3727 + this.lpId = undefined; // id
  3728 + this.lpName = undefined; // 名字
  3729 +
  3730 + // 发车序号,班次数
  3731 + this.fcno = undefined;
  3732 + this.bcs = undefined;
  3733 +
  3734 + this.sel = false; // 是否被选中
  3735 +
  3736 + // 其余函数判定的内部保存值
  3737 + this.isCanSel = false;
  3738 + this.isValidInfo = false;
3719 3739  
3720   - },
3721   - controllerAs: "$saTimeTableCtrl",
3722   - bindToController: true,
3723   - controller: function() {
3724   - var self = this;
3725   - this.$$headToolTip = ""; // 表头tooltip信息
  3740 + };
  3741 + BcInfo.prototype.canUpdate = function() { // 是否能更新
  3742 + if (this.sel && this.ttdid) {
  3743 + return true;
  3744 + } else {
  3745 + return false;
  3746 + }
  3747 + };
  3748 + BcInfo.prototype.canDelete = function() { // 是否能删除
  3749 + if (this.sel && this.ttdid) {
  3750 + return true;
  3751 + } else {
  3752 + return false;
  3753 + }
  3754 + };
  3755 + BcInfo.prototype.canSel = function() { // 是否能选中
  3756 + if (this.ttdid) {
  3757 + this.isCanSel = true;
  3758 + return true;
  3759 + } else if (this.fcsj) {
  3760 + // 没有ttdid,有fcsj标识,
  3761 + // 由于是后台返回数据的格式,这种就是路牌和汇总信息,不能选中
  3762 + this.isCanSel = false;
  3763 + return false;
  3764 + } else {
  3765 + // 都是空的,表示是一个空班次,可以选中
  3766 + this.isCanSel = true;
  3767 + return true;
  3768 + }
  3769 + };
  3770 + BcInfo.prototype.validInfo = function() { // 验证班次信息内容是否正确
  3771 + if (this.canSel() && this.ttdid) {
  3772 + if (this.bc_type == 'in') {
  3773 + if (this.qdz == null || this.tcc == null) {
  3774 + this.isValidInfo = true;
  3775 + return true;
  3776 + } else {
  3777 + this.isValidInfo = false;
  3778 + return false;
  3779 + }
  3780 + } else if (this.bc_type == 'out') {
  3781 + if (this.tcc == null || this.zdz == null) {
  3782 + this.isValidInfo = true;
  3783 + return true;
  3784 + } else {
  3785 + this.isValidInfo = false;
  3786 + return false;
  3787 + }
  3788 + } else {
  3789 + if (this.qdz == null || this.zdz == null) {
  3790 + this.isValidInfo = true;
  3791 + return true;
  3792 + } else {
  3793 + this.isValidInfo = false;
  3794 + return false;
  3795 + }
  3796 + }
  3797 + } else {
  3798 + this.isValidInfo = true;
  3799 + return true;
  3800 + }
  3801 + };
3726 3802  
3727   - // TODO:
3728   - },
  3803 + BcInfo.prototype.where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // 判定班次是否在指定条件内
  3804 + var fcsj_m_h = [];
  3805 + fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
  3806 + fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
3729 3807  
3730   - /**,
3731   - * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
3732   - * @param tElem
3733   - * @param tAttrs
3734   - * @returns {{pre: Function, post: Function}}
3735   - */
3736   - compile: function(tElem, tAttrs) {
3737   - // 获取属性
3738   - var $attr_name = tAttrs["name"]; // 控件的名字
3739   - if (!$attr_name) {
3740   - throw new Error("saTimeTable指令 name属性required");
  3808 + var fcsj = new Date(2000,1,1);
  3809 + fcsj.setHours(fcsj_m_h[0]);
  3810 + fcsj.setMinutes(fcsj_m_h[1]);
  3811 +
  3812 + var s_temp_date = new Date(2000, 1, 1);
  3813 + var e_temp_date = new Date(2000, 1, 1);
  3814 +
  3815 + if (xldir == 2) { // 上下行
  3816 + // 判定是否要进出场班次
  3817 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  3818 + return false;
  3819 + }
  3820 +
  3821 + if (startTime_h_m) {
  3822 + if (endTime_h_m) {
  3823 + s_temp_date.setHours(startTime_h_m[0]);
  3824 + s_temp_date.setMinutes(startTime_h_m[1]);
  3825 + e_temp_date.setHours(endTime_h_m[0]);
  3826 + e_temp_date.setMinutes(endTime_h_m[1]);
  3827 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  3828 + } else {
  3829 + s_temp_date.setHours(startTime_h_m[0]);
  3830 + s_temp_date.setMinutes(startTime_h_m[1]);
  3831 + return fcsj >= s_temp_date;
  3832 + }
  3833 + } else {
  3834 + if (endTime_h_m) {
  3835 + e_temp_date.setHours(endTime_h_m[0]);
  3836 + e_temp_date.setMinutes(endTime_h_m[1]);
  3837 + return fcsj <= e_temp_date;
  3838 + } else {
  3839 + return false;
  3840 + }
  3841 + }
  3842 + } else {
  3843 + // 判定是否要进出场班次
  3844 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  3845 + return false;
  3846 + }
  3847 +
  3848 + if (xldir == this.xldir) {
  3849 + if (startTime_h_m) {
  3850 + if (endTime_h_m) {
  3851 + s_temp_date.setHours(startTime_h_m[0]);
  3852 + s_temp_date.setMinutes(startTime_h_m[1]);
  3853 + e_temp_date.setHours(endTime_h_m[0]);
  3854 + e_temp_date.setMinutes(endTime_h_m[1]);
  3855 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  3856 + } else {
  3857 + s_temp_date.setHours(startTime_h_m[0]);
  3858 + s_temp_date.setMinutes(startTime_h_m[1]);
  3859 + return fcsj >= s_temp_date;
  3860 + }
  3861 + } else {
  3862 + if (endTime_h_m) {
  3863 + e_temp_date.setHours(endTime_h_m[0]);
  3864 + e_temp_date.setMinutes(endTime_h_m[1]);
  3865 + return fcsj <= e_temp_date;
  3866 + } else {
  3867 + return true;
  3868 + }
  3869 + }
  3870 + } else {
  3871 + return false;
  3872 + }
3741 3873 }
3742   - var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  3874 + };
3743 3875  
3744   - // 内部controlAs名字
3745   - var ctrlAs = '$saTimeTableCtrl';
  3876 + return {
  3877 + createBcInfo: function(detailInfo, lpDetailInfo) {
  3878 + var bcInfo = new BcInfo(detailInfo);
  3879 + if (!bcInfo.ttdid && bcInfo.fcsj && bcInfo.fcsj.indexOf('_') > 0) {
  3880 + var temp_info = bcInfo.fcsj.split('_');
  3881 + // 添加信息的属性
  3882 + bcInfo.lpName = temp_info[1];
  3883 + bcInfo.lpId = temp_info[0];
  3884 + // 修改fcsj为路牌名字
  3885 + bcInfo.fcsj = bcInfo.lpName;
  3886 + }
3746 3887  
3747   - // 当前选中的cell
3748   - var startRowIndex = undefined;
3749   - var startColIndex = undefined;
3750   - var shiftKey = false; // shift键是否被按住
3751   - var ctrlKey = false; // ctrl是否被按住
3752   - // shift选中的cell
3753   - var shiftCells = [];
  3888 + // 重新设定路牌信息
  3889 + if (!bcInfo.lpId) {
  3890 + bcInfo.lpId = lpDetailInfo.lpId;
  3891 + bcInfo.lpName = lpDetailInfo.lpName;
  3892 + }
3754 3893  
3755   - // TODO:
  3894 + return bcInfo;
  3895 + },
  3896 + initTTInfoDetail: function(formobj, cellinfo, colinfo, xlid, xlname, ttid, ttname) {
  3897 + formobj.xl = {};
  3898 + formobj.xl.id = xlid;
  3899 + formobj.xl.name = xlname;
  3900 + formobj.ttinfo = {};
  3901 + formobj.ttinfo.id = ttid;
  3902 + formobj.ttinfo.name = ttname;
  3903 + formobj.lp = {};
  3904 + formobj.lp.id = cellinfo.lpId;
  3905 + formobj.lp.lpName = cellinfo.lpName;
  3906 + formobj.fcno = cellinfo.fcno;
  3907 + formobj.bcs = cellinfo.bcs;
  3908 + formobj.isFB = cellinfo.isfb;
  3909 +
  3910 + formobj.bcType = colinfo.bc_type;
  3911 + formobj.xlDir = colinfo.xldir;
  3912 + if (colinfo.qdz) {
  3913 + formobj.qdz = {};
  3914 + formobj.qdz.id = colinfo.qdz;
  3915 + }
  3916 + if (colinfo.zdz) {
  3917 + formobj.zdz = {};
  3918 + formobj.zdz.id = colinfo.zdz;
  3919 + }
  3920 + if (colinfo.tcc) {
  3921 + formobj.tcc = {};
  3922 + formobj.tcc.id = colinfo.tcc;
  3923 + }
3756 3924  
3757   - return {
3758   - pre: function(scope, element, attr) {
3759   - // TODO:
3760   - //alert(element.find("#tooltipTest").html());
3761   - //$compile(element.find("#tooltipTest"))(scope);
  3925 + }
  3926 + };
  3927 + }
  3928 + ]
  3929 +);
3762 3930  
3763   - },
3764   - post: function(scope, element, attr) {
3765   - // TODO:
  3931 +angular.module('ScheduleApp').directive(
  3932 + 'saTimetable',
  3933 + [
  3934 + '$compile',
  3935 + '$window',
  3936 + function($compile, $window) {
  3937 + return {
  3938 + restrict: 'E',
  3939 + templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
  3940 + scope: { // 独立作用域
  3941 + // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
  3942 + ds: "=ngModel",
  3943 + celldbclickFn: "&celldbclick"
3766 3944  
3767   - // ------------------- dom事件处理function -----------------//
3768   - scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
3769   - console.log("click " + "row=" + rowindex + ",col=" + colindex);
3770   - var internal_ds = scope[ctrlAs].ds.detailInfos;
  3945 + // TODO:
3771 3946  
3772   - if (cell.ttdid) { // 是班次的单元格才能操作
3773   - cell.sel = !cell.sel;
3774   - }
  3947 + },
  3948 + controllerAs: "$saTimeTableCtrl",
  3949 + bindToController: true,
  3950 + controller: function() {
  3951 + var self = this;
  3952 + this.$$headToolTip = ""; // 表头tooltip信息
3775 3953  
3776   - };
3777   - scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
3778   - if (cell.ttdid) { // 是班次的单元格才能操作
3779   - if ($attr_celldbclick) {
3780   - // 注意调用方法
3781   - scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  3954 + // TODO:
  3955 + },
  3956 +
  3957 + /**,
  3958 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  3959 + * @param tElem
  3960 + * @param tAttrs
  3961 + * @returns {{pre: Function, post: Function}}
  3962 + */
  3963 + compile: function(tElem, tAttrs) {
  3964 + // 获取属性
  3965 + var $attr_name = tAttrs["name"]; // 控件的名字
  3966 + if (!$attr_name) {
  3967 + throw new Error("saTimeTable指令 name属性required");
  3968 + }
  3969 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  3970 +
  3971 + // 内部controlAs名字
  3972 + var ctrlAs = '$saTimeTableCtrl';
  3973 +
  3974 + // 当前选中的cell
  3975 + var startRowIndex = undefined;
  3976 + var startColIndex = undefined;
  3977 + var shiftKey = false; // shift键是否被按住
  3978 + var ctrlKey = false; // ctrl是否被按住
  3979 + // shift选中的cell
  3980 + var shiftCells = [];
  3981 +
  3982 + // TODO:
  3983 +
  3984 + return {
  3985 + pre: function(scope, element, attr) {
  3986 + // TODO:
  3987 + //alert(element.find("#tooltipTest").html());
  3988 + //$compile(element.find("#tooltipTest"))(scope);
  3989 +
  3990 + },
  3991 + post: function(scope, element, attr) {
  3992 + // TODO:
  3993 +
  3994 + // ------------------- dom事件处理function -----------------//
  3995 + scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
  3996 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  3997 + var internal_ds = scope[ctrlAs].ds.detailInfos;
  3998 +
  3999 + if (cell.canSel()) { // 是班次的单元格才能操作
  4000 + cell.sel = !cell.sel;
3782 4001 }
3783   - }
3784   - };
3785 4002  
3786   - // ------------------- 监控function ------------------//
3787   - // 监控明细数据,生成表头的tooltip
3788   - scope.$watch(
3789   - function() {
3790   - return scope[ctrlAs].ds;
3791   - },
3792   - function(newValue, oldValue) {
3793   - if (newValue &&
3794   - newValue.detailHeads &&
3795   - newValue.detailHeads.length > 0) {
3796   - var tooltip = [];
3797   - tooltip.push("出场");
3798   - angular.forEach(newValue.detailHeads, function(value) {
3799   - if (value != "出场" &&
3800   - value != "路牌" &&
3801   - value != "进场" &&
3802   - value != "空驶班次/空驶里程" &&
3803   - value != "运营班次/运营里程" ) {
3804   - var exist = false;
3805   - angular.forEach(tooltip, function(tip) {
3806   - if (tip == value) {
3807   - exist = true;
  4003 + };
  4004 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  4005 + if (cell.canSel()) { // 是班次的单元格才能操作
  4006 + if ($attr_celldbclick) {
  4007 + // 注意调用方法
  4008 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  4009 + }
  4010 + }
  4011 + };
  4012 +
  4013 + // ------------------- 监控function ------------------//
  4014 + // 监控明细数据,生成表头的tooltip
  4015 + scope.$watch(
  4016 + function() {
  4017 + return scope[ctrlAs].ds;
  4018 + },
  4019 + function(newValue, oldValue) {
  4020 + if (newValue &&
  4021 + newValue.detailHeads &&
  4022 + newValue.detailHeads.length > 0) {
  4023 + var tooltip = [];
  4024 + tooltip.push("出场");
  4025 + angular.forEach(newValue.detailHeads, function(value) {
  4026 + if (value != "出场" &&
  4027 + value != "路牌" &&
  4028 + value != "进场" &&
  4029 + value != "空驶班次/空驶里程" &&
  4030 + value != "运营班次/运营里程" ) {
  4031 + var exist = false;
  4032 + angular.forEach(tooltip, function(tip) {
  4033 + if (tip == value) {
  4034 + exist = true;
  4035 + }
  4036 + });
  4037 + if (!exist) {
  4038 + tooltip.push(value);
3808 4039 }
3809   - });
3810   - if (!exist) {
3811   - tooltip.push(value);
3812 4040 }
3813   - }
3814   - });
3815   - tooltip.push("进场");
3816   - scope[ctrlAs].$$headToolTip = tooltip.join(",");
3817   - }
3818   - },
3819   - true
3820   - )
3821   - }
3822   - };
3823   - }
  4041 + });
  4042 + tooltip.push("进场");
  4043 + scope[ctrlAs].$$headToolTip = tooltip.join(",");
  4044 + }
  4045 + },
  4046 + true
  4047 + )
  4048 + }
  4049 + };
  4050 + }
3824 4051  
3825   - };
3826   - }
3827   -]);
  4052 + };
  4053 + }
  4054 + ]
  4055 +);
3828 4056  
3829 4057 /**
3830 4058 * saScpdate指令(非通用指令,只在排版计划form中使用)。
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
... ... @@ -1149,7 +1149,7 @@ ScheduleApp.config([
1149 1149 }
1150 1150 })
1151 1151 .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑
1152   - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  1152 + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex',
1153 1153 views: {
1154 1154 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'}
1155 1155 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
... ... @@ -59,6 +59,12 @@
59 59 批量修改
60 60 </a>
61 61 </li>
  62 + <li>
  63 + <a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">
  64 + <i class="fa fa-file-excel-o"></i>
  65 + 批量删除
  66 + </a>
  67 + </li>
62 68 <li class="divider"></li>
63 69 <li>
64 70 <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
... ... @@ -82,7 +82,7 @@ ScheduleApp.config([
82 82 }
83 83 })
84 84 .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑
85   - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  85 + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex',
86 86 views: {
87 87 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'}
88 88 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -5,7 +5,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
5 5 'TimeTableDetailManageService_g',
6 6 '$state',
7 7 '$q',
8   - function(service, $state, $q) {
  8 + 'SaTimeTableUtils',
  9 + function(service, $state, $q, SaTimeTableUtils) {
9 10  
10 11 // 查询对象类
11 12 var queryClass = service.rest;
... ... @@ -14,6 +15,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
14 15 var editInfo = {
15 16 detailHeads: [], // 时刻表头信息
16 17 detailInfos: [], // 时刻表明细信息
  18 + columnBcInfo: [], // 每列班次的信息
17 19 yydesc: "" // 营运汇总描述
18 20 };
19 21  
... ... @@ -34,6 +36,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 36 editInfo = {
35 37 detailHeads: [], // 时刻表头信息
36 38 detailInfos: [], // 时刻表明细信息
  39 + columnBcInfo: [], // 每列班次的信息(保存每列的站点信息)
37 40 yydesc: "" // 营运汇总描述
38 41 };
39 42  
... ... @@ -42,116 +45,37 @@ angular.module(&#39;ScheduleApp&#39;).factory(
42 45 editInfo.detailHeads = result.header;
43 46 editInfo.detailInfos = result.contents;
44 47 editInfo.yydesc = result.yy_desc;
  48 + editInfo.columnBcInfo = [editInfo.detailInfos[0].length];
45 49  
46   - // detailInfos里添加是否选中的flag
  50 + // 将editInfo.detailInfos中的值重新修正一遍
47 51 for (var i = 0; i < editInfo.detailInfos.length; i++) {
48 52 for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
49   - editInfo.detailInfos[i][j].sel = false;
50   - // 给cell定义一个valid属性,及方法,判定这个班次的数据是否正常
51   - editInfo.detailInfos[i][j].invalidFlag = true;
52   - editInfo.detailInfos[i][j].validInfo = function() { // 验证方法
53   - if (!this.ttdid) {
54   - this.invalidFlag = false;
55   - return;
56   - }
57   -
58   - if (this.bc_type == 'in') {
59   - if (this.qdz == null || this.tcc == null) {
60   - this.invalidFlag = true;
61   - } else {
62   - this.invalidFlag = false;
63   - }
64   - } else if (this.bc_type == 'out') {
65   - if (this.tcc == null || this.zdz == null) {
66   - this.invalidFlag = true;
67   - } else {
68   - this.invalidFlag = false;
69   - }
70   - } else {
71   - if (this.qdz == null || this.zdz == null) {
72   - this.invalidFlag = true;
73   - } else {
74   - this.invalidFlag = false;
75   - }
76   - }
77   - };
78   - editInfo.detailInfos[i][j].where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // where方法
79   - var fcsj_m_h = [];
80   - fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
81   - fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
82   -
83   - var fcsj = new Date(2000,1,1);
84   - fcsj.setHours(fcsj_m_h[0]);
85   - fcsj.setMinutes(fcsj_m_h[1]);
86   -
87   - var s_temp_date = new Date(2000, 1, 1);
88   - var e_temp_date = new Date(2000, 1, 1);
89   -
90   - if (xldir == 2) { // 上下行
91   - // 判定是否要进出场班次
92   - if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
93   - return false;
94   - }
95   -
96   - if (startTime_h_m) {
97   - if (endTime_h_m) {
98   - s_temp_date.setHours(startTime_h_m[0]);
99   - s_temp_date.setMinutes(startTime_h_m[1]);
100   - e_temp_date.setHours(endTime_h_m[0]);
101   - e_temp_date.setMinutes(endTime_h_m[1]);
102   - return fcsj >= s_temp_date && fcsj <= e_temp_date;
103   - } else {
104   - s_temp_date.setHours(startTime_h_m[0]);
105   - s_temp_date.setMinutes(startTime_h_m[1]);
106   - return fcsj >= s_temp_date;
107   - }
108   - } else {
109   - if (endTime_h_m) {
110   - e_temp_date.setHours(endTime_h_m[0]);
111   - e_temp_date.setMinutes(endTime_h_m[1]);
112   - return fcsj <= e_temp_date;
113   - } else {
114   - return false;
115   - }
116   - }
117   - } else {
118   - // 判定是否要进出场班次
119   - if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
120   - return false;
121   - }
122   -
123   - if (xldir == this.xldir) {
124   - if (startTime_h_m) {
125   - if (endTime_h_m) {
126   - s_temp_date.setHours(startTime_h_m[0]);
127   - s_temp_date.setMinutes(startTime_h_m[1]);
128   - e_temp_date.setHours(endTime_h_m[0]);
129   - e_temp_date.setMinutes(endTime_h_m[1]);
130   - return fcsj >= s_temp_date && fcsj <= e_temp_date;
131   - } else {
132   - s_temp_date.setHours(startTime_h_m[0]);
133   - s_temp_date.setMinutes(startTime_h_m[1]);
134   - return fcsj >= s_temp_date;
135   - }
136   - } else {
137   - if (endTime_h_m) {
138   - e_temp_date.setHours(endTime_h_m[0]);
139   - e_temp_date.setMinutes(endTime_h_m[1]);
140   - return fcsj <= e_temp_date;
141   - } else {
142   - return true;
143   - }
144   - }
145   - } else {
146   - return false;
147   - }
148   - }
149   -
150   - };
151   - editInfo.detailInfos[i][j].validInfo();
  53 + var detailInfo = SaTimeTableUtils.createBcInfo(
  54 + editInfo.detailInfos[i][j],
  55 + editInfo.detailInfos[i][0]
  56 + );
  57 + detailInfo.fcno = j;
  58 + detailInfo.bcs = i * (editInfo.detailInfos[i].length - 3) + j;
  59 + detailInfo.validInfo();
  60 + editInfo.detailInfos[i][j] = detailInfo;
  61 +
  62 + if (!editInfo.columnBcInfo[j]) {
  63 + editInfo.columnBcInfo[j] = {};
  64 + }
  65 + if (!editInfo.columnBcInfo[j].bc_type && detailInfo.ttdid) {
  66 + // 设定站点信息
  67 + editInfo.columnBcInfo[j].bc_type = detailInfo.bc_type;
  68 + editInfo.columnBcInfo[j].xldir = detailInfo.xldir;
  69 + editInfo.columnBcInfo[j].isfb = detailInfo.isfb;
  70 + editInfo.columnBcInfo[j].qdz = detailInfo.qdz;
  71 + editInfo.columnBcInfo[j].zdz = detailInfo.zdz;
  72 + editInfo.columnBcInfo[j].tcc = detailInfo.tcc;
  73 + }
152 74  
153 75 }
154 76 }
  77 +
  78 + console.log(editInfo.columnBcInfo);
155 79 } else {
156 80 alert(result.msg);
157 81 }
... ... @@ -169,6 +93,57 @@ angular.module(&#39;ScheduleApp&#39;).factory(
169 93 return flag;
170 94 },
171 95  
  96 + deleteInfos: function() { // 批量删除数据
  97 + var deferred = $q.defer();
  98 +
  99 + // 找出所有选中的ttinfodetailids
  100 + var ttinfodetailIds = [];
  101 + for (var i = 0; i < editInfo.detailInfos.length; i++) {
  102 + for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
  103 + if (editInfo.detailInfos[i][j].canDelete())
  104 + ttinfodetailIds.push(editInfo.detailInfos[i][j]);
  105 + }
  106 + }
  107 + // ajax调用
  108 + var success_counts = 0; // 成功数
  109 + var error_counts = 0; // 失败数
  110 + for (var n = 0; n < ttinfodetailIds.length; n++) {
  111 + (function(index) {
  112 + queryClass.delete({id: ttinfodetailIds[index].ttdid}, function(value) {
  113 + if (value.status == 'ERROR') {
  114 + error_counts ++;
  115 + if (success_counts + error_counts == ttinfodetailIds.length) {
  116 + deferred.reject();
  117 + }
  118 + } else {
  119 + // 赋值(上下行,发车时间,班次类型,起点站,终点站,停车场)
  120 + ttinfodetailIds[index].fcsj = undefined;
  121 + ttinfodetailIds[index].xldir = undefined;
  122 + ttinfodetailIds[index].bc_type = undefined;
  123 + ttinfodetailIds[index].qdz = undefined;
  124 + ttinfodetailIds[index].zdz = undefined;
  125 + ttinfodetailIds[index].tcc = undefined;
  126 +
  127 + ttinfodetailIds[index].validInfo();
  128 +
  129 + success_counts ++;
  130 + if (success_counts + error_counts == ttinfodetailIds.length) {
  131 + deferred.resolve();
  132 + }
  133 + }
  134 + }, function(value) {
  135 + error_counts ++;
  136 + if (success_counts + error_counts == ttinfodetailIds.length) {
  137 + deferred.reject();
  138 + }
  139 + });
  140 +
  141 + })(n);
  142 + }
  143 +
  144 + return deferred.promise;
  145 + },
  146 +
172 147 editInfos: function(updateObject) { // 批量保存数据 // TODO:
173 148 var deferred = $q.defer();
174 149  
... ... @@ -176,7 +151,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
176 151 var ttinfodetailIds = [];
177 152 for (var i = 0; i < editInfo.detailInfos.length; i++) {
178 153 for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
179   - if (editInfo.detailInfos[i][j].sel == true)
  154 + if (editInfo.detailInfos[i][j].canUpdate())
180 155 ttinfodetailIds.push(editInfo.detailInfos[i][j]);
181 156 }
182 157 }
... ... @@ -329,7 +304,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
329 304 xlid: self.xlid,
330 305 ttid: self.ttid,
331 306 xlname: self.xlname,
332   - ttname: self.ttname
  307 + ttname: self.ttname,
  308 + rowindex: r,
  309 + colindex: c
333 310 }
334 311 );
335 312 };
... ... @@ -360,6 +337,30 @@ angular.module(&#39;ScheduleApp&#39;).controller(
360 337 });
361 338 };
362 339  
  340 + // 批量删除
  341 + self.deleteInfos = function() {
  342 + if (!service.editIsSel()) {
  343 + alert("请选择班次信息");
  344 + return;
  345 + }
  346 + service.deleteInfos().then(function() {
  347 + $state.go("ttInfoDetailManage_edit3", {
  348 + xlid: self.xlid,
  349 + ttid: self.ttid,
  350 + xlname: self.xlname,
  351 + ttname: self.ttname
  352 + });
  353 + }, function() {
  354 + alert("批量删除失败!");
  355 + $state.go("ttInfoDetailManage_edit3", {
  356 + xlid: self.xlid,
  357 + ttid: self.ttid,
  358 + xlname: self.xlname,
  359 + ttname: self.ttname
  360 + });
  361 + });
  362 + };
  363 +
363 364 // 查询对象类
364 365 var TTInfoDetail = service.getQueryClass();
365 366  
... ... @@ -445,7 +446,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
445 446 'TimeTableDetailManageService_old',
446 447 '$stateParams',
447 448 '$state',
448   - function(service, $stateParams, $state) {
  449 + 'SaTimeTableUtils',
  450 + function(service, $stateParams, $state, SaTimeTableUtils) {
449 451 var self = this;
450 452 var TTInfoDetail = service.getQueryClass();
451 453  
... ... @@ -465,6 +467,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
465 467 self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
466 468 self.xlname = $stateParams.xlname; // 获取传过来的线路名字
467 469 self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  470 + self.rowindex = $stateParams.rowindex; // 修改的第几行
  471 + self.colindex = $stateParams.colindex; // 修改的第几列
468 472  
469 473 self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
470 474  
... ... @@ -509,6 +513,24 @@ angular.module(&#39;ScheduleApp&#39;).controller(
509 513 "->班次详细信息";
510 514 });
511 515  
  516 + } else { // 此单元格为空,使用columnBcInfo填充
  517 + SaTimeTableUtils.initTTInfoDetail(
  518 + self.TimeTableDetailForSave,
  519 + service.getEditInfo().detailInfos[self.rowindex][self.colindex],
  520 + service.getEditInfo().columnBcInfo[self.colindex],
  521 + self.xlid,
  522 + self.xlname,
  523 + self.ttid,
  524 + self.ttname
  525 + );
  526 +
  527 + self.stop_temp.setModelValue(self.TimeTableDetailForSave);
  528 + self.title2 =
  529 + self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +
  530 + "->路牌" + self.TimeTableDetailForSave.lp.lpName +
  531 + "->发车顺序号" + self.TimeTableDetailForSave.fcno +
  532 + "->班次详细信息";
  533 +
512 534 }
513 535  
514 536 // 提交方法
... ... @@ -523,22 +545,18 @@ angular.module(&#39;ScheduleApp&#39;).controller(
523 545 self.TimeTableDetailForSave.$save(function(value) {
524 546 // 修正内部edit的值
525 547 var detailInfos = service.getEditInfo().detailInfos;
526   - for (var i = 0; i < detailInfos.length; i ++) {
527   - for (var j = 0; j < detailInfos[i].length; j++) {
528   - if (detailInfos[i][j].ttdid == id) {
529   - // 赋值(上下行,发车时间,班次类型)
530   - detailInfos[i][j].fcsj = value.fcsj || undefined;
531   - detailInfos[i][j].xldir = value.xlDir || undefined;
532   - detailInfos[i][j].bc_type = value.bcType || undefined;
533   - detailInfos[i][j].tcc = value.tcc || undefined;
534   - detailInfos[i][j].zdz = value.zdz || undefined;
535   - detailInfos[i][j].qdz = value.qdz || undefined;
536   - detailInfos[i][j].isfb = value.isFB;
537   -
538   - detailInfos[i][j].validInfo();
539   - }
540   - }
541   - }
  548 + var detailInfo = detailInfos[self.rowindex][self.colindex];
  549 + // 赋值(上下行,发车时间,班次类型)
  550 + detailInfo.fcsj = value.fcsj || undefined;
  551 + detailInfo.xldir = value.xlDir || undefined;
  552 + detailInfo.bc_type = value.bcType || undefined;
  553 + detailInfo.tcc = value.tcc || undefined;
  554 + detailInfo.zdz = value.zdz || undefined;
  555 + detailInfo.qdz = value.qdz || undefined;
  556 + detailInfo.isfb = value.isFB;
  557 +
  558 + detailInfo.validInfo();
  559 +
542 560 //$state.go("ttInfoDetailManage_edit", {
543 561 // xlid: self.xlid,
544 562 // ttid: self.ttid,
... ... @@ -567,6 +585,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
567 585 '$stateParams',
568 586 '$state',
569 587 function(service, $stateParams, $state) {
  588 + // TODO:
  589 +
570 590 var self = this;
571 591 var TTInfoDetail = service.getQueryClass();
572 592  
... ...
src/main/resources/static/real_control_v2/js/modal_extend.js
... ... @@ -7,9 +7,9 @@ $(document).on(&#39;show.uk.modal&#39;, &#39;.uk-modal.ct_move_modal&#39;, function () {
7 7 if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-blank'))
8 8 return;
9 9  
10   -/* //临时放过轨迹回放
11   - if($(this).attr('id')=='map-playback-modal')
12   - return;*/
  10 + /* //临时放过轨迹回放
  11 + if($(this).attr('id')=='map-playback-modal')
  12 + return;*/
13 13  
14 14 //计算居中位置
15 15 var win = $('body');
... ... @@ -92,5 +92,4 @@ var modal_move = function (m_header) {
92 92 _moveFlag = false;
93 93 _moveObj = null;
94 94 });
95   -
96 95 };
97 96 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
... ... @@ -284,13 +284,13 @@
284 284  
285 285 <script id="multi_inout_info_cont_temp" type="text/html">
286 286 {{each list as item i}}
287   - <dl>
288   - <dd>{{item.stopName}}</dd>
289   - <dd>{{item.in_time_str}}</dd>
290   - <dd>{{item.out_time_str}}</dd>
291   - <dd></dd>
292   - <dd></dd>
293   - </dl>
  287 + <dl>
  288 + <dd>{{item.stopName}}</dd>
  289 + <dd>{{item.in_time_str}}</dd>
  290 + <dd>{{item.out_time_str}}</dd>
  291 + <dd></dd>
  292 + <dd></dd>
  293 + </dl>
294 294 {{/each}}
295 295 </script>
296 296 <script>
... ... @@ -503,10 +503,10 @@
503 503 var add = function (gps) {
504 504  
505 505 /*if (gps.inout_stop == -1)
506   - return;
  506 + return;
507 507  
508   - var htmlStr = template('', {obj: gps['inout_stop_info']});
509   - $('.inout_table_wrap .ct_table .ct_table_body', modal).html(htmlStr);*/
  508 + var htmlStr = template('', {obj: gps['inout_stop_info']});
  509 + $('.inout_table_wrap .ct_table .ct_table_body', modal).html(htmlStr);*/
510 510 };
511 511  
512 512 var clear = function () {
... ... @@ -522,7 +522,7 @@
522 522 }
523 523 };
524 524  
525   -
  525 +
526 526 var matchOut = function (info, gps) {
527 527 if(!info)
528 528 return;
... ...