Commit cd9df2e6d7f2f7767274c8108fa239ed22604de5

Authored by 潘钊
1 parent f46edaf7

update...

src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
@@ -187,12 +187,13 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -187,12 +187,13 @@ public class GeoDataServiceImpl implements GeoDataService {
187 //按路由顺序排列 187 //按路由顺序排列
188 Collections.sort(routes, new StationRouteComp()); 188 Collections.sort(routes, new StationRouteComp());
189 189
190 - //存一份百度坐标,保持现有数据结构完整性  
191 - TransGPS.Location bcLoc = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(String.valueOf(lng)), Double.parseDouble(String.valueOf(lat))))); 190 + //转WGS
  191 + TransGPS.Location wgsLoc = TransGPS.transformFromGCJToWGS(TransGPS.bd_decrypt(TransGPS.LocationMake(Double.parseDouble(String.valueOf(lng)), Double.parseDouble(String.valueOf(lat)))));
  192 +
192 //insert 站点 193 //insert 站点
193 long sCode = GetUIDAndCode.getStationId(); 194 long sCode = GetUIDAndCode.getStationId();
194 jdbcTemplate.update("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions) " + 195 jdbcTemplate.update("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions) " +
195 - " values(?,?,?,?,?,?,?,?,?,?,?)", sCode, sCode, stationName, "b", bcLoc.getLng() + " " + bcLoc.getLat(), lng, lat, 0, 88, "r", 1); 196 + " values(?,?,?,?,?,?,?,?,?,?,?)", sCode, sCode, stationName, "b", lng + " " + lat, wgsLoc.getLng(), wgsLoc.getLat(), 0, 88, "r", 1);
196 197
197 198
198 SaveStationRouteDTO sr; 199 SaveStationRouteDTO sr;
@@ -207,11 +208,11 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -207,11 +208,11 @@ public class GeoDataServiceImpl implements GeoDataService {
207 //重新排序路由 208 //重新排序路由
208 for(int i = 0, size = routes.size(); i < size; i ++){ 209 for(int i = 0, size = routes.size(); i < size; i ++){
209 sr = routes.get(i); 210 sr = routes.get(i);
  211 + sr.setStationRouteCode(no+=step);
210 if(sr.getId().intValue() == prevRouteId){ 212 if(sr.getId().intValue() == prevRouteId){
211 no+=step; 213 no+=step;
212 currentNo = no; 214 currentNo = no;
213 } 215 }
214 - sr.setStationRouteCode(no+=step);  
215 } 216 }
216 217
217 sr = new SaveStationRouteDTO(); 218 sr = new SaveStationRouteDTO();
@@ -242,7 +243,7 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -242,7 +243,7 @@ public class GeoDataServiceImpl implements GeoDataService {
242 243
243 final List<SaveStationRouteDTO> saveList = routes; 244 final List<SaveStationRouteDTO> saveList = routes;
244 //insert 路由 245 //insert 路由
245 - jdbcTemplate.update("delete bsth_c_ls_stationroute where line_code='"+lineCode+"' and line="+lineId+" and directions="+upDown+" and destroy=0 and versions=" + versions); 246 + jdbcTemplate.update("delete from bsth_c_ls_stationroute where line_code='"+lineCode+"' and line="+lineId+" and directions="+upDown+" and destroy=0 and versions=" + versions);
246 jdbcTemplate.batchUpdate("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) " + 247 jdbcTemplate.batchUpdate("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) " +
247 " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() { 248 " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() {
248 @Override 249 @Override