StationController.java
6.75 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
package com.bsth.controller;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 com.bsth.entity.Station;
import com.bsth.service.StationService;
import com.bsth.util.GetUIDAndCode;
/**
*
* @ClassName: StationController(站点控制器)
*
* @Extends : BaseController
*
* @Description: TODO(站点控制层)
*
* @Author bsth@lq
*
* @Date 2016年05月03日 上午9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@RestController
@RequestMapping("station")
public class StationController extends BaseController<Station, Integer> {
@Autowired
private StationService service;
/** 日志记录器 */
private static final Logger LOGGER = LoggerFactory.getLogger(StationController.class);
/**
* @Description :TODO(根据坐标点匹配数据库中的站点)
*
* @param map: <point:坐标点; name:站点名>
*
*/
@RequestMapping(value="matchStation" , method = RequestMethod.GET)
public Map<String, Object> matchStation(@RequestParam Map<String, Object> map) {
return service.matchStation(map);
}
/**
* @Description :TODO(系统规划保存数据)
*
* @param map <stationJSON:站点信息;
*
* - - - - - - sectionJSON:路段信息;
*
* - - - - - - dbType:坐标类型;
*
* - - - - - - destroy:是否撤销;
*
* - - - - - - directions:方向;
*
* - - - - - - lineId:线路ID;
*
* - - - - - - radius:圆半径
*
* - - - - - - shapesType:图形类型
*
* - - - - - - speedLimit:限速>
*
* @return Map<String, Object> <SUCCESS ; ERROR>
*/
@RequestMapping(value="collectionSave" , method = RequestMethod.POST)
public Map<String, Object> collectionSave(@RequestParam Map<String, Object> map) {
return service.systemSaveStations(map);
}
@RequestMapping(value="manualSave" , method = RequestMethod.POST)
public Map<String, Object> manualSave(@RequestParam Map<String, Object> map) {
return service.manualSave(map);
}
@RequestMapping(value="cacheSave" , method = RequestMethod.POST)
public Map<String, Object> cacheSave(@RequestParam Map<String, Object> map) {
return service.cacheSave(map);
}
/**
* @Description :TODO(新增站点保存)
*
* @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
*
* descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
*
* gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
*
* stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
*
* versions:版本号;x:城建坐标x;y:城建坐标y>
*
* @return Map<String, Object> <SUCCESS ; ERROR>
*/
@RequestMapping(value="stationSave" , method = RequestMethod.POST)
public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) {
map.put("createBy", "");
map.put("updateBy", "");
return service.stationSaveMap(map);
}
/**
* @Description :TODO(更新站点保存)
*
* @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
*
* descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
*
* gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
*
* stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
*
* versions:版本号;x:城建坐标x;y:城建坐标y>
*
* @return Map<String, Object> <SUCCESS ; ERROR>
*/
@RequestMapping(value="stationUpdate" , method = RequestMethod.POST)
public Map<String, Object> stationUpdate(@RequestParam Map<String, Object> map) {
map.put("updateBy", "");
return service.stationUpdate(map);
}
/**
* @Description :TODO(更新缓存站点保存)
*
* @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
*
* descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
*
* gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
*
* stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
*
* versions:版本号;x:城建坐标x;y:城建坐标y>
*
* @return Map<String, Object> <SUCCESS ; ERROR>
*/
@RequestMapping(value="stationCacheUpdate" , method = RequestMethod.POST)
public Map<String, Object> stationCacheUpdate(@RequestParam Map<String, Object> map) {
map.put("updateBy", "");
return service.stationCacheUpdate(map);
}
/**
* @Description :TODO(更新内部编码)
* @param stationCount,sectionCount 更新数
*/
@RequestMapping(value="updateStationAndSectionCode" , method = RequestMethod.GET)
public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {
System.out.println(stationCount+" _ "+ sectionCount );
for(int i = 0; i < stationCount; i++) {
System.out.println(stationCount);
GetUIDAndCode.getStationId();
}
for(int i = 0; i < sectionCount; i++) {
System.out.println(sectionCount);
GetUIDAndCode.getSectionId();
}
return 1;
}
/**
* @Description :TODO(查询站点编码)
*
* @return int <stationCode站点编码>
*/
@RequestMapping(value="getStationCode" , method = RequestMethod.GET)
public long getStationCode() {
return GetUIDAndCode.getStationId();
}
/**
* @Description :TODO(查询站点编码)
*
* @return int <stationCode站点编码>
*/
@RequestMapping(value="stationCacheSave" , method = RequestMethod.POST)
public Map<String, Object> stationCacheSave(@RequestParam Map<String, Object> map) {
map.put("createBy", "");
map.put("updateBy", "");
return service.stationCacheSave(map);
}
}