Commit acf67cf5f16e37228504629172e98a809cad532f

Authored by 王通
1 parent bd7fbe9f

1.新增站点路由时,设置默认站级中心点(站点中心点)

src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
@@ -208,6 +208,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I @@ -208,6 +208,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I
208 stationRoute.setStationCode(stationRoute.getStation().getStationCode()); 208 stationRoute.setStationCode(stationRoute.getStation().getStationCode());
209 209
210 Station station = stationRoute.getStation(); 210 Station station = stationRoute.getStation();
  211 + stationRoute.setCenterPointWkt(station.getCenterPointWkt());
  212 + if (!StringUtils.isEmpty(stationRoute.getCenterPointWkt())) {
  213 + centerPoint(stationRoute);
  214 + }
  215 +
211 if (station.getId() == null) { 216 if (station.getId() == null) {
212 station.setId(currentId + count); 217 station.setId(currentId + count);
213 station.setStationCode(station.getId().toString()); 218 station.setStationCode(station.getId().toString());
@@ -252,10 +257,15 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I @@ -252,10 +257,15 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I
252 Integer currentVersion = lineVersionsRepository.findCurrentVersion(line.getId()); 257 Integer currentVersion = lineVersionsRepository.findCurrentVersion(line.getId());
253 boolean isPresent = stationRepository.findById(station.getId()).isPresent(); 258 boolean isPresent = stationRepository.findById(station.getId()).isPresent();
254 stationRoute.setLineCode(line.getLineCode()); 259 stationRoute.setLineCode(line.getLineCode());
  260 + stationRoute.setCenterPointWkt(station.getCenterPointWkt());
255 if (stationRoute.getVersions() < currentVersion) { 261 if (stationRoute.getVersions() < currentVersion) {
256 throw new IllegalArgumentException("历史版本不可变更"); 262 throw new IllegalArgumentException("历史版本不可变更");
257 } 263 }
258 264
  265 + if (!StringUtils.isEmpty(stationRoute.getCenterPointWkt())) {
  266 + centerPoint(stationRoute);
  267 + }
  268 +
259 // 中心点坐标信息 269 // 中心点坐标信息
260 if (!isPresent) { 270 if (!isPresent) {
261 centerPoint(station); 271 centerPoint(station);