Commit 156f7f3edffc6d0edaa32b7706164ff849b695ad
1 parent
6fdc25b4
通过URL传参访问车辆和通道信息
Showing
10 changed files
with
52 additions
and
4 deletions
src/main/java/com/bsth/controller/video/VideoController.java
| ... | ... | @@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSON; |
| 5 | 5 | import com.bsth.common.ResponseCode; |
| 6 | 6 | import com.bsth.controller.schedule.basicinfo.legacy.CarsController; |
| 7 | 7 | import com.bsth.entity.Business; |
| 8 | +import com.bsth.entity.CarDevice; | |
| 8 | 9 | import com.bsth.entity.Cars; |
| 9 | 10 | import com.bsth.entity.Line; |
| 10 | 11 | import com.bsth.entity.video.CarsTreeTable; |
| 11 | 12 | import com.bsth.entity.video.VideoChannel; |
| 12 | 13 | import com.bsth.entity.video.VideoTree; |
| 13 | 14 | import com.bsth.service.BusinessService; |
| 15 | +import com.bsth.service.CarDeviceService; | |
| 16 | +import com.bsth.service.CarsService; | |
| 14 | 17 | import com.bsth.service.LineService; |
| 15 | 18 | import com.bsth.service.impl.videoimpl.WvpConfig; |
| 16 | 19 | import com.bsth.service.video.VideoService; |
| ... | ... | @@ -41,6 +44,8 @@ public class VideoController { |
| 41 | 44 | |
| 42 | 45 | @Autowired |
| 43 | 46 | private WvpConfig wvpConfig; |
| 47 | + @Autowired | |
| 48 | + private CarsService carsService; | |
| 44 | 49 | |
| 45 | 50 | @GetMapping("/tree") |
| 46 | 51 | public Map<String, Object> combinationTree() { |
| ... | ... | @@ -59,9 +64,23 @@ public class VideoController { |
| 59 | 64 | |
| 60 | 65 | @GetMapping("/tree/carNo/{parentId}") |
| 61 | 66 | public List<VideoTree> layTreeNodeCarNo(@PathVariable("parentId") String parentId) { |
| 62 | - return videoService.combinationTreeOfCar(parentId, false,false); | |
| 67 | + return videoService.combinationTreeOfCar(parentId, false, false); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @GetMapping("/tree/caNO/sim/{zbh}") | |
| 71 | + public Map<String, String> queryZBH(@PathVariable String zbh) { | |
| 72 | + Map<String, String> result = new HashMap<>(); | |
| 73 | + | |
| 74 | + | |
| 75 | + Cars cars = carsService.queryCarsByInsideCode(zbh); | |
| 76 | + | |
| 77 | + String sim = Objects.nonNull(cars)?cars.getSimNo():null; | |
| 78 | + result.put("sim", sim); | |
| 79 | + result.put("status", "1"); | |
| 80 | + return result; | |
| 63 | 81 | } |
| 64 | 82 | |
| 83 | + | |
| 65 | 84 | @GetMapping("/tree/search") |
| 66 | 85 | public Map<String, Object> searchLayTreeNode(HttpServletRequest request) { |
| 67 | 86 | Map<String, Object> result = new HashMap<>(); |
| ... | ... | @@ -71,7 +90,7 @@ public class VideoController { |
| 71 | 90 | } |
| 72 | 91 | List<VideoTree> groups = null; |
| 73 | 92 | try { |
| 74 | - groups = videoService.searchTreeDataByCarNo(carNo, Boolean.TRUE,Boolean.TRUE); | |
| 93 | + groups = videoService.searchTreeDataByCarNo(carNo, Boolean.TRUE, Boolean.TRUE); | |
| 75 | 94 | |
| 76 | 95 | |
| 77 | 96 | setAttributeToPage(result); |
| ... | ... | @@ -151,7 +170,7 @@ public class VideoController { |
| 151 | 170 | public Map<String, Object> queryChannelsTree(@PathVariable String carNo) { |
| 152 | 171 | Map<String, Object> result = new HashMap<>(); |
| 153 | 172 | try { |
| 154 | - List<VideoTree> trees = videoService.queryChannelsTree(carNo, Boolean.TRUE,Boolean.FALSE); | |
| 173 | + List<VideoTree> trees = videoService.queryChannelsTree(carNo, Boolean.TRUE, Boolean.FALSE); | |
| 155 | 174 | setAttributeToPage(result); |
| 156 | 175 | result.put("data", trees); |
| 157 | 176 | result.put("status", ResponseCode.SUCCESS); | ... | ... |
src/main/java/com/bsth/entity/Cars.java
| ... | ... | @@ -144,6 +144,8 @@ public class Cars extends BEntity implements Serializable { |
| 144 | 144 | private Integer isSwitch; |
| 145 | 145 | /** 线路名称(TODO:在原系统里没有,这里暂时留着,并且不做线路关联,只保留个名字) */ |
| 146 | 146 | private String xlmc; |
| 147 | + /**sim 卡号*/ | |
| 148 | + private String simNo; | |
| 147 | 149 | |
| 148 | 150 | public Cars() {} |
| 149 | 151 | |
| ... | ... | @@ -532,4 +534,12 @@ public class Cars extends BEntity implements Serializable { |
| 532 | 534 | public void setHydrogen(Boolean hydrogen) { |
| 533 | 535 | this.hydrogen = hydrogen; |
| 534 | 536 | } |
| 537 | + | |
| 538 | + public String getSimNo() { | |
| 539 | + return simNo; | |
| 540 | + } | |
| 541 | + | |
| 542 | + public void setSimNo(String simNo) { | |
| 543 | + this.simNo = simNo; | |
| 544 | + } | |
| 535 | 545 | } | ... | ... |
src/main/java/com/bsth/entity/video/VideoTree.java
src/main/java/com/bsth/filter/BaseFilter.java
| ... | ... | @@ -20,7 +20,7 @@ public abstract class BaseFilter implements Filter { |
| 20 | 20 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, |
| 21 | 21 | Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, |
| 22 | 22 | Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, Constants.VEHICLE_DATA_SYNC_URL, |
| 23 | - Constants.FILE_AUTH, Constants.I18N_LOGIN}; | |
| 23 | + Constants.FILE_AUTH, Constants.I18N_LOGIN,"/video/**"}; | |
| 24 | 24 | |
| 25 | 25 | @Override |
| 26 | 26 | public void destroy() { | ... | ... |
src/main/java/com/bsth/repository/CarsRepository.java
| ... | ... | @@ -18,4 +18,7 @@ public interface CarsRepository extends BaseRepository<Cars, Integer>{ |
| 18 | 18 | |
| 19 | 19 | @Query(value="select s from Cars s where s.insideCode=?1") |
| 20 | 20 | List<Cars> findCarsByCode(String insideCode); |
| 21 | + | |
| 22 | + @Query(value="select s from Cars s where s.insideCode=?1") | |
| 23 | + Cars findByInsideCode(String simNo); | |
| 21 | 24 | } | ... | ... |
src/main/java/com/bsth/service/CarDeviceService.java
src/main/java/com/bsth/service/CarsService.java
src/main/java/com/bsth/service/impl/CarsServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.Cars; |
| 4 | +import com.bsth.repository.CarsRepository; | |
| 4 | 5 | import com.bsth.service.CarsService; |
| 5 | 6 | import org.springframework.stereotype.Service; |
| 6 | 7 | |
| 8 | +import javax.annotation.Resource; | |
| 9 | + | |
| 7 | 10 | /** |
| 8 | 11 | * Created by xu on 16/5/31. |
| 9 | 12 | */ |
| 10 | 13 | @Service |
| 11 | 14 | public class CarsServiceImpl extends BaseServiceImpl<Cars, Integer> implements CarsService { |
| 15 | + @Resource | |
| 16 | + private CarsRepository carsRepository; | |
| 17 | + | |
| 18 | + public Cars queryCarsByInsideCode(String zbh) { | |
| 19 | + return carsRepository.findByInsideCode(zbh); | |
| 20 | + } | |
| 12 | 21 | } | ... | ... |
src/main/java/com/bsth/service/impl/videoimpl/VideoServiceImpl.java