From fb2f66f27554563b6f88fa7bacbb786070e4d0fc Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 10 May 2021 15:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=A1=E9=AA=8C=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/publish/MapController.java | 6 ++++++ .../joylink/rtss/services/IMapService.java | 6 ++++++ .../joylink/rtss/services/MapService.java | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+) 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; + } + /** * 该版本的地图数据是否存在 */