Commit 4d55e2d7b91cf27ec795bc9fe3a16fa723691db9
1 parent
233a9e8b
1.路段接口微调
Showing
2 changed files
with
9 additions
and
8 deletions
src/main/java/com/bsth/server_rs/base_info/section/LD_SectionRestService.java
| ... | ... | @@ -2,13 +2,12 @@ package com.bsth.server_rs.base_info.section; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.server_rs.base_info.section.buffer.LD_SectionBufferData; |
| 4 | 4 | import com.bsth.server_rs.base_info.section.entity.LD_SectionRoute; |
| 5 | +import org.slf4j.Logger; | |
| 6 | +import org.slf4j.LoggerFactory; | |
| 5 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 8 | import org.springframework.stereotype.Component; |
| 7 | 9 | |
| 8 | -import javax.ws.rs.GET; | |
| 9 | -import javax.ws.rs.Path; | |
| 10 | -import javax.ws.rs.PathParam; | |
| 11 | -import javax.ws.rs.Produces; | |
| 10 | +import javax.ws.rs.*; | |
| 12 | 11 | import javax.ws.rs.core.MediaType; |
| 13 | 12 | import java.util.Collection; |
| 14 | 13 | import java.util.List; |
| ... | ... | @@ -23,6 +22,8 @@ import java.util.Map; |
| 23 | 22 | @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) |
| 24 | 23 | public class LD_SectionRestService { |
| 25 | 24 | |
| 25 | + private final static Logger log = LoggerFactory.getLogger(LD_SectionRestService.class); | |
| 26 | + | |
| 26 | 27 | @Autowired |
| 27 | 28 | LD_SectionBufferData sectionBufferData; |
| 28 | 29 | |
| ... | ... | @@ -39,9 +40,9 @@ public class LD_SectionRestService { |
| 39 | 40 | return sectionBufferData.findByLineCode(lineCode); |
| 40 | 41 | } |
| 41 | 42 | |
| 42 | - @GET | |
| 43 | - @Path("/lineName/{lineName}") | |
| 44 | - public List<LD_SectionRoute> findByLineName(@PathParam("lineName") String lineName){ | |
| 43 | + @POST | |
| 44 | + @Path("/lineName") | |
| 45 | + public List<LD_SectionRoute> findByLineName(String lineName){ | |
| 45 | 46 | return sectionBufferData.findByLineName(lineName); |
| 46 | 47 | } |
| 47 | 48 | } | ... | ... |
src/main/java/com/bsth/server_rs/base_info/section/buffer/LD_SectionRefreshThread.java
| ... | ... | @@ -56,7 +56,7 @@ public class LD_SectionRefreshThread extends Thread{ |
| 56 | 56 | LD_SectionBufferData.putRoadSpeeds(roadSpeedList); |
| 57 | 57 | |
| 58 | 58 | //查询最新版本路段信息 |
| 59 | - List<LD_SectionRoute> sectionRoutes = jdbcTemplate.query("select b.line_name,a.line_code,a.section_code,a.directions,a.sectionroute_code,a.versions from (select l.name line_name,l.line_code line_code,max(versions) versions from bsth_c_line l left join bsth_c_line_versions v on l.line_code = v.line_code where l.destroy = 0 group by l.line_code) b left join bsth_c_ls_sectionroute a on a.line_code = b.line_code and a.versions = b.versions where a.destroy = 0 order by a.line_code,a.directions,a.sectionroute_code", BeanPropertyRowMapper.newInstance(LD_SectionRoute.class)); | |
| 59 | + List<LD_SectionRoute> sectionRoutes = jdbcTemplate.query("select b.line_name,a.line_code,a.section_code,a.directions,a.sectionroute_code,a.versions from (select l.name line_name,l.line_code line_code,max(versions) versions from bsth_c_line l left join bsth_c_line_versions v on l.line_code = v.line_code where l.destroy = 0 group by l.name,l.line_code) b left join bsth_c_ls_sectionroute a on a.line_code = b.line_code and a.versions = b.versions where a.destroy = 0 order by a.line_code,a.directions,a.sectionroute_code", BeanPropertyRowMapper.newInstance(LD_SectionRoute.class)); | |
| 60 | 60 | Map<String, List<LD_SectionRoute>> name2sections = new HashMap<>(); |
| 61 | 61 | List<LD_SectionRoute> routes = null; |
| 62 | 62 | String lastedLineName = ""; | ... | ... |