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