Commit ee5b156951e7302a2687610aa9c4fd40cf7a8644

Authored by 王通
1 parent 02346635

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

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