Commit 755475755a81e205e5154d62d0703df524ea54d5
1 parent
adddaad6
1.线路翻版本修正
Showing
5 changed files
with
15 additions
and
8 deletions
src/main/java/com/bsth/repository/SectionRouteRepository.java
| @@ -111,8 +111,8 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | @@ -111,8 +111,8 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | ||
| 111 | * @param version | 111 | * @param version |
| 112 | */ | 112 | */ |
| 113 | @Modifying | 113 | @Modifying |
| 114 | - @Query(value="delete from SectionRoute sr where sr.line.id = ?1 and sr.versions = ?2") | ||
| 115 | - void deleteByLineAndVersion(Integer lineId, Integer version); | 114 | + @Query(value="delete from SectionRoute sr where sr.line.id = ?1") |
| 115 | + void deleteByLineAndVersion(Integer lineId); | ||
| 116 | 116 | ||
| 117 | /** | 117 | /** |
| 118 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 | 118 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 |
src/main/java/com/bsth/repository/StationRouteRepository.java
| @@ -213,8 +213,8 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | @@ -213,8 +213,8 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 213 | * @param version | 213 | * @param version |
| 214 | */ | 214 | */ |
| 215 | @Modifying | 215 | @Modifying |
| 216 | - @Query(value="delete from StationRoute sr where sr.line.id = ?1 and sr.versions = ?2") | ||
| 217 | - void deleteByLineAndVersion(Integer lineId, Integer version); | 216 | + @Query(value="delete from StationRoute sr where sr.line.id = ?1") |
| 217 | + void deleteByLineAndVersion(Integer lineId); | ||
| 218 | 218 | ||
| 219 | /** | 219 | /** |
| 220 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 | 220 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| @@ -123,9 +123,9 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -123,9 +123,9 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 123 | String lineCode = lineVersions.getLineCode(); | 123 | String lineCode = lineVersions.getLineCode(); |
| 124 | Integer versions = lineVersions.getVersions(); | 124 | Integer versions = lineVersions.getVersions(); |
| 125 | 125 | ||
| 126 | - stationRouteRepository.deleteByLineAndVersion(lineId, versions); | 126 | + stationRouteRepository.deleteByLineAndVersion(lineId); |
| 127 | stationRouteRepository.updateFromHistory(lineId, versions); | 127 | stationRouteRepository.updateFromHistory(lineId, versions); |
| 128 | - sectionRouteRepository.deleteByLineAndVersion(lineId, versions); | 128 | + sectionRouteRepository.deleteByLineAndVersion(lineId); |
| 129 | sectionRouteRepository.updateFromHistory(lineId, versions); | 129 | sectionRouteRepository.updateFromHistory(lineId, versions); |
| 130 | // 更新线路版本 | 130 | // 更新线路版本 |
| 131 | repository.updateOdlVersions(lineId, lineCode); | 131 | repository.updateOdlVersions(lineId, lineCode); |
src/main/java/com/bsth/service/impl/LsSectionRouteServiceImpl.java
| @@ -116,7 +116,7 @@ public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, I | @@ -116,7 +116,7 @@ public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, I | ||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | protected void refreshCurrent(int lineId, int version) { | 118 | protected void refreshCurrent(int lineId, int version) { |
| 119 | - sectionRouteRepository.deleteByLineAndVersion(lineId, version); | 119 | + sectionRouteRepository.deleteByLineAndVersion(lineId); |
| 120 | sectionRouteRepository.updateFromHistory(lineId, version); | 120 | sectionRouteRepository.updateFromHistory(lineId, version); |
| 121 | } | 121 | } |
| 122 | } | 122 | } |
| 123 | \ No newline at end of file | 123 | \ No newline at end of file |
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
| @@ -8,6 +8,8 @@ import com.bsth.service.LsStationRouteService; | @@ -8,6 +8,8 @@ import com.bsth.service.LsStationRouteService; | ||
| 8 | import com.bsth.util.CoordinateConverter; | 8 | import com.bsth.util.CoordinateConverter; |
| 9 | import com.bsth.util.CustomBeanUtils; | 9 | import com.bsth.util.CustomBeanUtils; |
| 10 | import com.bsth.util.GeoConverter; | 10 | import com.bsth.util.GeoConverter; |
| 11 | +import com.fasterxml.jackson.core.JsonProcessingException; | ||
| 12 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 11 | import org.geolatte.geom.LineString; | 13 | import org.geolatte.geom.LineString; |
| 12 | import org.geolatte.geom.Point; | 14 | import org.geolatte.geom.Point; |
| 13 | import org.geolatte.geom.Polygon; | 15 | import org.geolatte.geom.Polygon; |
| @@ -244,6 +246,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -244,6 +246,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 244 | bufferPolygon(stationRoute); | 246 | bufferPolygon(stationRoute); |
| 245 | } | 247 | } |
| 246 | 248 | ||
| 249 | + try { | ||
| 250 | + logger.error(new ObjectMapper().writeValueAsString(stationRoute)); | ||
| 251 | + } catch (JsonProcessingException e) { | ||
| 252 | + throw new RuntimeException(e); | ||
| 253 | + } | ||
| 247 | lsStationRouteRepository.updateStatiouRouteCode(stationRoute); | 254 | lsStationRouteRepository.updateStatiouRouteCode(stationRoute); |
| 248 | CustomBeanUtils.copyPropertiesIgnoredNull(stationRoute, stationRoute1); | 255 | CustomBeanUtils.copyPropertiesIgnoredNull(stationRoute, stationRoute1); |
| 249 | lsStationRouteRepository.save(stationRoute1); | 256 | lsStationRouteRepository.save(stationRoute1); |
| @@ -353,7 +360,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | @@ -353,7 +360,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I | ||
| 353 | } | 360 | } |
| 354 | 361 | ||
| 355 | protected void refreshCurrent(int lineId, int version) { | 362 | protected void refreshCurrent(int lineId, int version) { |
| 356 | - stationRouteRepository.deleteByLineAndVersion(lineId, version); | 363 | + stationRouteRepository.deleteByLineAndVersion(lineId); |
| 357 | stationRouteRepository.updateFromHistory(lineId, version); | 364 | stationRouteRepository.updateFromHistory(lineId, version); |
| 358 | } | 365 | } |
| 359 | } | 366 | } |