From 922cb14c0832fa2a0fb018f6d44b038fc4beaa0f Mon Sep 17 00:00:00 2001 From: tiger_zhou Date: Wed, 20 Sep 2023 16:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xiannccda/controller/AlertMockController.java | 4 ++-- .../joylink/xiannccda/service/AlertMockService.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/club/joylink/xiannccda/controller/AlertMockController.java b/src/main/java/club/joylink/xiannccda/controller/AlertMockController.java index d5c33ef..4281246 100644 --- a/src/main/java/club/joylink/xiannccda/controller/AlertMockController.java +++ b/src/main/java/club/joylink/xiannccda/controller/AlertMockController.java @@ -39,8 +39,8 @@ public class AlertMockController { @SecurityRequirement(name = "jwt") @Operation(summary = "设置模拟故障") @ApiResponse(description = "设置模拟故障") - @PostMapping("/set2/{alertType}") - public void setAlert2(@RequestBody String json, @PathVariable("alertType") AlertType alertType) { + @PostMapping("/localDemoTest/{alertType}") + public void localDemoTest(@RequestBody String json, @PathVariable("alertType") AlertType alertType) { alertMockService.newSetAlert(json, alertType); } diff --git a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java index a5acf76..8f6d74f 100644 --- a/src/main/java/club/joylink/xiannccda/service/AlertMockService.java +++ b/src/main/java/club/joylink/xiannccda/service/AlertMockService.java @@ -110,7 +110,7 @@ public class AlertMockService { bb.setTimestamp(System.currentTimeMillis() / 1000); bb.setId(dto.getFrist()); bb.setIpRtuStusDown(true); - return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), bb, station.getName(), AlertDeviceType.DEVICE_TYPE_RTU, true); + return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_RTU, station.getCommon().getId(), bb, station.getName(), AlertDeviceType.DEVICE_TYPE_RTU, false); } case PLATFORM_DOOR_CANNOT_OPEN -> { Optional pfOptional = LineGraphicDataRepository.getDevices(lineId, Platform.class).filter(d -> dto.getDeviceCodes().contains(d.getCode())).findAny(); @@ -121,7 +121,7 @@ public class AlertMockService { platform.setTimestamp(System.currentTimeMillis() / 1000); Platform pf = pfOptional.orElse(null); return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_PLATFORM, pf.getCommon().getId(), platform, platform.getId(), AlertDeviceType.DEVICE_TYPE_PLATFORM, - true); + false); } case PLATFORM_DOOR_CANNOT_CLOSE -> { Optional pfOptional = LineGraphicDataRepository.getDevices(lineId, Platform.class).filter(d -> dto.getDeviceCodes().contains(d.getCode())).findAny(); @@ -133,7 +133,7 @@ public class AlertMockService { platform.setTimestamp(System.currentTimeMillis() / 1000); Platform pf = pfOptional.orElse(null); return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_PLATFORM, pf.getCommon().getId(), platform, platform.getId(), AlertDeviceType.DEVICE_TYPE_PLATFORM, - true); + false); } /* case SWITCH_LOST -> { Optional turnoutOptional = LineGraphicDataRepository.getDevices(lineId, Turnout.class).filter(d -> dto.getDeviceCodes().contains(d.getCode())).findAny(); @@ -155,7 +155,7 @@ public class AlertMockService { switchs.setReceiveTime(System.currentTimeMillis()); switchs.setIpSingleSwitchStusLostIndication(true); Turnout turnout = turnoutOptional.orElse(null); - return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_SWITCH, turnout.getCommon().getId(), switchs, dto.getAll(), AlertDeviceType.DEVICE_TYPE_SWITCH, true); + return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_SWITCH, turnout.getCommon().getId(), switchs, dto.getAll(), AlertDeviceType.DEVICE_TYPE_SWITCH, false); } case AXLE_LED_RED, AXLE_LED_ORANGE, AXLE_LED_ORANGE_MOST, AXLE_LED_RED_MOST -> { Optional lsOptional = LineGraphicDataRepository.getDevices(lineId, LogicSection.class).filter(d -> dto.getDeviceCodes().contains(d.getCode())).findAny(); @@ -164,7 +164,7 @@ public class AlertMockService { track.setLineId(dto.getLineId()); track.setTimestamp(System.currentTimeMillis() / 1000); LogicSection ls = lsOptional.orElse(null); - return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_TRACK, ls.getCommon().getId(), track, dto.getAll(), AlertDeviceType.DEVICE_TYPE_TRACK, true); + return this.alertInfoService.createAlert(dto.getAlertType(), AlertDeviceType.DEVICE_TYPE_TRACK, ls.getCommon().getId(), track, dto.getAll(), AlertDeviceType.DEVICE_TYPE_TRACK, false); } case TRAIN_EB_ATP -> { @@ -176,7 +176,7 @@ public class AlertMockService { track.setTimestamp(System.currentTimeMillis() / 1000); LogicSection ls = lsOptional.orElse(null); - return this.alertInfoService.createAlert(AlertType.TRAIN_EB_ATP, AlertDeviceType.DEVICE_TYPE_TRAIN, ls.getCommon().getId(), track, "测试车组号", AlertDeviceType.DEVICE_TYPE_TRAIN, true); + return this.alertInfoService.createAlert(AlertType.TRAIN_EB_ATP, AlertDeviceType.DEVICE_TYPE_TRAIN, ls.getCommon().getId(), track, "测试车组号", AlertDeviceType.DEVICE_TYPE_TRAIN, false); } default -> throw new IllegalStateException("Unexpected value: " + dto.getAlertType());