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 | 111 | * @param version |
| 112 | 112 | */ |
| 113 | 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 | 213 | * @param version |
| 214 | 214 | */ |
| 215 | 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 | 123 | String lineCode = lineVersions.getLineCode(); |
| 124 | 124 | Integer versions = lineVersions.getVersions(); |
| 125 | 125 | |
| 126 | - stationRouteRepository.deleteByLineAndVersion(lineId, versions); | |
| 126 | + stationRouteRepository.deleteByLineAndVersion(lineId); | |
| 127 | 127 | stationRouteRepository.updateFromHistory(lineId, versions); |
| 128 | - sectionRouteRepository.deleteByLineAndVersion(lineId, versions); | |
| 128 | + sectionRouteRepository.deleteByLineAndVersion(lineId); | |
| 129 | 129 | sectionRouteRepository.updateFromHistory(lineId, versions); |
| 130 | 130 | // 更新线路版本 |
| 131 | 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 | 116 | } |
| 117 | 117 | |
| 118 | 118 | protected void refreshCurrent(int lineId, int version) { |
| 119 | - sectionRouteRepository.deleteByLineAndVersion(lineId, version); | |
| 119 | + sectionRouteRepository.deleteByLineAndVersion(lineId); | |
| 120 | 120 | sectionRouteRepository.updateFromHistory(lineId, version); |
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 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 | 8 | import com.bsth.util.CoordinateConverter; |
| 9 | 9 | import com.bsth.util.CustomBeanUtils; |
| 10 | 10 | import com.bsth.util.GeoConverter; |
| 11 | +import com.fasterxml.jackson.core.JsonProcessingException; | |
| 12 | +import com.fasterxml.jackson.databind.ObjectMapper; | |
| 11 | 13 | import org.geolatte.geom.LineString; |
| 12 | 14 | import org.geolatte.geom.Point; |
| 13 | 15 | import org.geolatte.geom.Polygon; |
| ... | ... | @@ -244,6 +246,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 244 | 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 | 254 | lsStationRouteRepository.updateStatiouRouteCode(stationRoute); |
| 248 | 255 | CustomBeanUtils.copyPropertiesIgnoredNull(stationRoute, stationRoute1); |
| 249 | 256 | lsStationRouteRepository.save(stationRoute1); |
| ... | ... | @@ -353,7 +360,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 353 | 360 | } |
| 354 | 361 | |
| 355 | 362 | protected void refreshCurrent(int lineId, int version) { |
| 356 | - stationRouteRepository.deleteByLineAndVersion(lineId, version); | |
| 363 | + stationRouteRepository.deleteByLineAndVersion(lineId); | |
| 357 | 364 | stationRouteRepository.updateFromHistory(lineId, version); |
| 358 | 365 | } |
| 359 | 366 | } | ... | ... |