diff --git a/src/main/java/club/joylink/rtss/controller/publish/MapController.java b/src/main/java/club/joylink/rtss/controller/publish/MapController.java index 954a8f1e3..6b8e85e6a 100644 --- a/src/main/java/club/joylink/rtss/controller/publish/MapController.java +++ b/src/main/java/club/joylink/rtss/controller/publish/MapController.java @@ -209,6 +209,12 @@ public class MapController { return this.iMapService.isMapNameExist(name); } + @ApiOperation("校验所有地图数据") + @GetMapping("/all/simulationCheck") + public List doSimulationCheckAll(@ApiIgnore @RequestAttribute UserVO user) { + return this.iMapService.doSimulationCheckAll(user); + } + @ApiOperation(value = "检测地图仿真数据是否存在错误") @GetMapping(path = "/{id}/simulationCheck") public List doSimulationCheck(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) { diff --git a/src/main/java/club/joylink/rtss/services/IMapService.java b/src/main/java/club/joylink/rtss/services/IMapService.java index ac68dbb77..e2c175d47 100644 --- a/src/main/java/club/joylink/rtss/services/IMapService.java +++ b/src/main/java/club/joylink/rtss/services/IMapService.java @@ -297,4 +297,10 @@ public interface IMapService { * 查询属于该集中站的区段 */ List querySectionBelongTheDeviceStation(Long mapId, String stationCode); + + /** + * 校验所有地图数据 + * @return + */ + List doSimulationCheckAll(UserVO user); } diff --git a/src/main/java/club/joylink/rtss/services/MapService.java b/src/main/java/club/joylink/rtss/services/MapService.java index 8de86d87c..6d408acb6 100644 --- a/src/main/java/club/joylink/rtss/services/MapService.java +++ b/src/main/java/club/joylink/rtss/services/MapService.java @@ -882,6 +882,25 @@ public class MapService implements IMapService { .filter(section -> section.getStationCode().equals(stationCode)).collect(Collectors.toList()); } + @Override + public List doSimulationCheckAll(UserVO user) { + List mapVOS = listOnline(); + List errorMaps = new ArrayList<>(); + for (MapVO map : mapVOS) { + List list = null; + try { + list = doSimulationCheck(map.getId(), user); + } catch (RuntimeException e) { + errorMaps.add(map); + e.printStackTrace(); + } + if (!CollectionUtils.isEmpty(list)) { + errorMaps.add(map); + } + } + return errorMaps; + } + /** * 该版本的地图数据是否存在 */