Commit 035cd2c5bf4b47f1e1d923685e45c48cb3fd4217
1 parent
2460355e
站点与路段基础数据编辑功能修订.
Showing
1 changed file
with
3 additions
and
3 deletions
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
| @@ -241,6 +241,7 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -241,6 +241,7 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 241 | Integer toDir = map.get("toDir")==null ? null : Integer.parseInt(map.get("toDir").toString()); | 241 | Integer toDir = map.get("toDir")==null ? null : Integer.parseInt(map.get("toDir").toString()); |
| 242 | if(line!=null && dir!=null) { | 242 | if(line!=null && dir!=null) { |
| 243 | List<Object[]> list = repository.getSectionRoute(line, dir); | 243 | List<Object[]> list = repository.getSectionRoute(line, dir); |
| 244 | + int src = repository.sectionRouteCodeMaxId(); | ||
| 244 | for(int i = 0 ; i<list.size() ; i++) { | 245 | for(int i = 0 ; i<list.size() ; i++) { |
| 245 | int sectionId = Integer.parseInt(String.valueOf(repository2.sectionMaxId())) + 1 ; | 246 | int sectionId = Integer.parseInt(String.valueOf(repository2.sectionMaxId())) + 1 ; |
| 246 | String sectionCode = String.valueOf(sectionId); | 247 | String sectionCode = String.valueOf(sectionId); |
| @@ -270,10 +271,9 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -270,10 +271,9 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 270 | SectionRoute sr = new SectionRoute(); | 271 | SectionRoute sr = new SectionRoute(); |
| 271 | Line lineObject = lineRepository.findOne(line); | 272 | Line lineObject = lineRepository.findOne(line); |
| 272 | Section section = repository2.findOne(sectionId); | 273 | Section section = repository2.findOne(sectionId); |
| 273 | - int src = repository.sectionRouteCodeMaxId(); | ||
| 274 | - src = src == 0 ? list.size() : src - (list.size()-i)*10 ; | 274 | + Integer xh = (src == 0 ? (toDir ==1? (list.size()-i)*10 : (list.size()+i)*10) : toDir==1? (src + (list.size()-i)*10) : (src + (list.size()+i)*10)) ; |
| 275 | sr.setId(sectionRouteId); | 275 | sr.setId(sectionRouteId); |
| 276 | - sr.setSectionrouteCode(src); | 276 | + sr.setSectionrouteCode(xh); |
| 277 | sr.setLineCode(lineObject.getLineCode()); | 277 | sr.setLineCode(lineObject.getLineCode()); |
| 278 | sr.setSectionCode(sectionCode); | 278 | sr.setSectionCode(sectionCode); |
| 279 | sr.setDirections(toDir); | 279 | sr.setDirections(toDir); |