StationRouteController.java
8.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
package com.bsth.controller;
import com.bsth.entity.Station;
import com.bsth.entity.StationRoute;
import com.bsth.entity.StationRouteCache;
import com.bsth.repository.StationRouteCacheRepository;
import com.bsth.repository.StationRouteRepository;
import com.bsth.service.StationRouteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
/**
*
* @ClassName: StationRouteController(站点路由控制器)
*
* @Extends : BaseController
*
* @Description: TODO(站点路由控制层)
*
* @Author bsth@lq
*
* @Date 2016年5月03日 上午9:21:17
*
* @Dersion 公交调度系统BS版 0.1
*
*/
@RestController
@RequestMapping("stationroute")
public class StationRouteController extends BaseController<StationRoute, Integer> {
@Autowired
StationRouteService service;
@Autowired
StationRouteRepository stationRouteRepository;
@Autowired
StationRouteCacheRepository stationRouteCacheRepository;
/**
* @param @param map
* @throws
* @Title: list
* @Description: TODO(多条件查询)
*/
@RequestMapping(value = "/all", method = RequestMethod.GET)
public Iterable<StationRoute> list(@RequestParam Map<String, Object> map) {
return service.list(map);
}
@RequestMapping(value = "/cacheList", method = RequestMethod.GET)
public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {
return service.cacheList(map);
}
/**
* @Description :TODO(查询路段信息)
*
* @param map <line.id_eq:线路ID; directions_eq:方向>
*
* @return Map<String, Object>
*/
@RequestMapping(value = "/export" , method = RequestMethod.GET)
public Map<String, Object> export(@RequestParam Integer id, HttpServletResponse resp) {
return service.getSectionRouteExport(id, resp);
}
/**
* @param String
* @throws
* @Description: TODO(批量撤销站点)
*/
@RequestMapping(value = "/batchDestroy", method = RequestMethod.GET)
public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
return service.updateStationRouteInfoFormId(map);
}
/**
* @Description :TODO(查询树站点与路段数据)
*
* @param map <line.id_eq:线路ID; directions_eq:方向>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/findStations" , method = RequestMethod.GET)
public List<Map<String, Object>> findStations(@RequestParam Map<String, Object> map) {
return service.findPoints(map);
}
@RequestMapping(value = "/systemQuote" , method = RequestMethod.POST)
public Map<String, Object> systemQuote(@RequestParam Map<String, Object> map) {
return service.systemQuote(map);
}
/**
* @Description :TODO(查询线路某方向下的站点序号与类型)
*
* @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/findUpStationRouteCode" , method = RequestMethod.GET)
public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {
return service.findUpStationRouteCode(map);
}
/**
* @Description :TODO(查询线路某方向下的站点序号与类型)
*/
@RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET)
public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) {
return service.findCacheUpStationRouteCode(map);
}
/**
* @Description :TODO(查询站点的下一个缓存站点)
*/
@RequestMapping(value = "/findDownStationRoute" , method = RequestMethod.GET)
public List<Map<String, Object>> findDownStationRoute(@RequestParam Map<String, Object> map) {
return service.findDownStationRoute(map);
}
/**
* @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
*
* @param map <lineId:线路ID; direction:方向>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/getStationRouteCenterPoints" , method = RequestMethod.GET)
public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) {
return service.getStationRouteCenterPoints(map);
}
/**
* @Description :TODO(查询线路某方向下所有站点)
*
* @param map <lineId:线路ID; direction:方向>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/getStationRouteList" , method = RequestMethod.GET)
public List<Map<String, Object>> getStationRouteList(@RequestParam Map<String, Object> map) {
return service.getStationRouteList(map);
}
/**
* @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
*
* @param map <lineId:线路ID; direction:方向>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/getStationRouteCacheCenterPoints" , method = RequestMethod.GET)
public List<Map<String, Object>> getStationRouteCacheCenterPoints(@RequestParam Map<String, Object> map) {
return service.getStationRouteCacheCenterPoints(map);
}
/**
* @Description :TODO(撤销站点)
*
* @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)>
*
* @return Map<String, Object> <SUCCESS ; ERROR>
*/
@RequestMapping(value = "/stationRouteIsDestroy" , method = RequestMethod.POST)
public Map<String, Object> stationRouteIsDestroy(@RequestParam Map<String, Object> map) {
return service.stationRouteIsDestroy(map);
}
/**
* @Description : TODO(根据线路ID生成行单)
*
* @param map <id:线路ID>
*
* @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>
*/
@RequestMapping(value = "/usingSingle",method = RequestMethod.POST)
public Map<String, Object> usingSingle(@RequestParam Map<String, Object> map) {
return service.usingSingle(map);
}
/**
* @Description : TODO(根据站点路由Id查询详情)
*
* @param map <id:站点路由ID>
*
* @return List<Map<String, Object>>
*/
@RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET)
public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) {
return service.findStationRouteInfo(map);
}
@RequestMapping(value = "/stations", method = RequestMethod.GET)
public List<Map<String, Object>> findStations(Integer xlid, Integer xldir) {
return stationRouteRepository.findStations(xlid, xldir);
}
/**
*
* @Title: findByMultiLine
* @Description: TODO(多线路路由查询)
*/
@RequestMapping(value = "/multiLine", method = RequestMethod.GET)
public Map<String, Object> findByMultiLine(@RequestParam String lineIds){
return service.findByMultiLine(lineIds);
}
/**
*
* @Title: updSwitchDir
* @Description: TODO(上下行切换)
*/
@RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST)
public Map<String, Object> updSwitchDir(@RequestParam String lineIds){
return service.updSwitchDir(lineIds);
}
/**
*
* @Title: upddis
* @Description: TODO(更新站距)
*/
@RequestMapping(value = "/upddis",method = RequestMethod.POST)
public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
return service.upddis(map);
}
/**
*
* @Title: findCacheStationRoute
* @Description: TODO(查询缓存路由)
*/
@RequestMapping(value = "/findCacheStationRoute",method = RequestMethod.GET)
public List<StationRouteCache> findCacheStationRoute(@RequestParam Map<String, Object> map) {
int lineId = Integer.parseInt(map.get("lineId").toString());
int dir = Integer.parseInt(map.get("dir").toString());
return stationRouteCacheRepository.findstationRoute(lineId, dir);
}
/**
*
* @Title: findCachePoint
*
* @param map <lineId:线路ID; dir:方向>
*
* @Description: TODO(查询缓存路由)
*/
@RequestMapping(value = "/findCachePoint",method = RequestMethod.GET)
public List<Map<String, Object>> findCachePoint(@RequestParam Map<String, Object> map) {
int lineId = Integer.parseInt(map.get("lineId").toString());
int dir = Integer.parseInt(map.get("dir").toString());
return service.findCachePoint(lineId, dir);
}
}