调整,添加故障查询功能
All checks were successful
local-test分支构建docker并发布运行 / Docker-Build (push) Successful in 1m15s

This commit is contained in:
tiger_zhou 2024-11-07 16:40:42 +08:00
parent 38c2005d82
commit cc5ab22cb1
5 changed files with 26 additions and 20 deletions

View File

@ -133,7 +133,7 @@ public class NccAlertInfo implements AlertInfo, Cloneable {
case BLUE_DISPLAY, PLATFORM_DOOR_CANNOT_CLOSE, PLATFORM_DOOR_CANNOT_OPEN, case BLUE_DISPLAY, PLATFORM_DOOR_CANNOT_CLOSE, PLATFORM_DOOR_CANNOT_OPEN,
PLATFORM_DOOR_WITHOUT_LOCKED_SIGNAL, TRAIN_DELAY_10, SWITCH_LOST, SWITCH_FW_LOST, SWITCH_All_LOST, SWITCH_DW_LOST, PLATFORM_DOOR_WITHOUT_LOCKED_SIGNAL, TRAIN_DELAY_10, SWITCH_LOST, SWITCH_FW_LOST, SWITCH_All_LOST, SWITCH_DW_LOST,
SWITCH_LOST_MOST, SWITCH_LOST_INTERLOCK_AREA, AXLE_LED_RED, AXLE_LED_ORANGE, AXLE_LED_ORANGE_MOST, AXLE_LED_RED_MOST, TRAIN_EB_ATP, SWITCH_LOST_MOST, SWITCH_LOST_INTERLOCK_AREA, AXLE_LED_RED, AXLE_LED_ORANGE, AXLE_LED_ORANGE_MOST, AXLE_LED_RED_MOST, TRAIN_EB_ATP,
ALL_LINE_BLUE_DISPLAY, AXLE_LED_RED_INTERLOCK_AREA, AXLE_LED_ORANGE_INTERLOCK_AREA -> { ALL_LINE_BLUE_DISPLAY, AXLE_LED_RED_INTERLOCK_AREA, AXLE_LED_ORANGE_INTERLOCK_AREA, SWITCH_JAMMED -> {
return "I"; return "I";
} }
case PLATFORM_EMERG_STOP -> { case PLATFORM_EMERG_STOP -> {

View File

@ -92,10 +92,13 @@ public class SwitchLostAndJammedTask implements AlertMonitoringTask {
private void checkJammed(Switch.Builder switchBuild, String layoutId) { private void checkJammed(Switch.Builder switchBuild, String layoutId) {
if (switchBuild.getIpSingleSwitchStusJammed()) { if (switchBuild.getIpSingleSwitchStusJammed()) {
if (alertDataSource.putAlterDevice(switchBuild.getLineId(), JAMMED_NAME, switchBuild.getId())) {
String alertMsg = String.format("设备[%s]挤岔", switchBuild.getId()); String alertMsg = String.format("设备[%s]挤岔", switchBuild.getId());
NccAlertInfo alertInfo = this.alertInfoService.createAlert2(Optional.empty(), AlertType.SWITCH_JAMMED, switchBuild, alertMsg, layoutId, NccAlertInfo alertInfo = this.alertInfoService.createAlert2(Optional.empty(), AlertType.SWITCH_JAMMED, switchBuild, alertMsg, layoutId,
AlertDeviceType.DEVICE_TYPE_SWITCH, false); AlertDeviceType.DEVICE_TYPE_SWITCH, false);
alertManager.emit(alertInfo); alertManager.emit(alertInfo);
}
} else { } else {
alertDataSource.removeAlterDevice(switchBuild.getLineId(), JAMMED_NAME, switchBuild.getId()); alertDataSource.removeAlterDevice(switchBuild.getLineId(), JAMMED_NAME, switchBuild.getId());
} }

View File

@ -13,12 +13,14 @@ import club.joylink.xiannccda.entity.AlertTip;
import club.joylink.xiannccda.entity.FaultQuery; import club.joylink.xiannccda.entity.FaultQuery;
import club.joylink.xiannccda.repository.IFaultQueryRepository; import club.joylink.xiannccda.repository.IFaultQueryRepository;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Maps;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -37,7 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2024-11-06 * @since 2024-11-06
*/ */
@RestController @RestController
@RequestMapping("/fault/query") @RequestMapping("/api/fault/query")
@Tag(name = "故障查询管理") @Tag(name = "故障查询管理")
public class FaultQueryController { public class FaultQueryController {
@ -50,19 +52,17 @@ public class FaultQueryController {
@SecurityRequirement(name = "jwt") @SecurityRequirement(name = "jwt")
@Operation(summary = "查询故障类型") @Operation(summary = "查询故障类型")
@GetMapping("/type/{lineId}") @GetMapping("/type")
// @CommonLogAnno(name = "决策信息-查看", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY) // @CommonLogAnno(name = "决策信息-查看", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY)
public List<FaultType> faultType(@PathVariable("lineId") Integer lineId) { public Map<Integer, List<FaultType>> faultType() {
if (lineId == 3) { Map<Integer, List<FaultType>> mapTypList = Maps.newHashMap();
return List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE, "车辆故障应急处置指导关键点"), new FaultType(FaultQueryType.FAULT_EXIT_SERVICE, "车辆故障退出服务地点")); mapTypList.put(3, List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE, "车辆故障应急处置指导关键点"), new FaultType(FaultQueryType.FAULT_EXIT_SERVICE, "车辆故障退出服务地点")));
} else if (lineId == 4) { mapTypList.put(4, List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_DK37, "车辆故障应急处置指导关键点-DK37车型"),
return List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_DK37, "车辆故障应急处置指导关键点-DK37车型"),
new FaultType(FaultQueryType.FAULT_EXIT_SERVICE_T_DK37, "车辆故障退出服务地点-DK37车型") new FaultType(FaultQueryType.FAULT_EXIT_SERVICE_T_DK37, "车辆故障退出服务地点-DK37车型")
, new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_CCD_5037, "车辆故障应急处置指导关键点CCD-5037车型"), , new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_CCD_5037, "车辆故障应急处置指导关键点CCD-5037车型"),
new FaultType(FaultQueryType.FAULT_EXIT_SERVICE_T_CCD_5037, "车辆故障退出服务地点CCD-5037车型") new FaultType(FaultQueryType.FAULT_EXIT_SERVICE_T_CCD_5037, "车辆故障退出服务地点CCD-5037车型")));
);
} return mapTypList;
return Collections.emptyList();
} }
@SecurityRequirement(name = "jwt") @SecurityRequirement(name = "jwt")
@ -80,7 +80,6 @@ public class FaultQueryController {
// @CommonLogAnno(name = "决策信息-查看", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY) // @CommonLogAnno(name = "决策信息-查看", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY)
public FaultQuery getById(@PathVariable int id) { public FaultQuery getById(@PathVariable int id) {
return faultQueryRepository.getById(id); return faultQueryRepository.getById(id);
} }
@SecurityRequirement(name = "jwt") @SecurityRequirement(name = "jwt")

View File

@ -9,4 +9,6 @@ public class FaultQueryReqDTO extends CommonPage {
private Integer lineId; private Integer lineId;
private FaultQueryType queryType; private FaultQueryType queryType;
private String faultName;
} }

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Objects; import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -39,7 +40,8 @@ public class FaultQueryRepository extends ServiceImpl<FaultQueryMapper, FaultQue
public IPage<FaultQuery> page(FaultQueryReqDTO reqDTO) { public IPage<FaultQuery> page(FaultQueryReqDTO reqDTO) {
QueryWrapper<FaultQuery> qw = new QueryWrapper<>(); QueryWrapper<FaultQuery> qw = new QueryWrapper<>();
qw.lambda().eq(Objects.nonNull(reqDTO.getLineId()), FaultQuery::getLineId, reqDTO.getLineId()) qw.lambda().eq(Objects.nonNull(reqDTO.getLineId()), FaultQuery::getLineId, reqDTO.getLineId())
.eq(Objects.nonNull(reqDTO.getQueryType()), FaultQuery::getFaultType, reqDTO.getQueryType()); .eq(Objects.nonNull(reqDTO.getQueryType()), FaultQuery::getFaultType, reqDTO.getQueryType())
.eq(StringUtils.isNotEmpty(reqDTO.getFaultName()), FaultQuery::getFaultNameShower, reqDTO.getFaultName());
return this.page(CommonPageRequest.defaultPage(), qw); return this.page(CommonPageRequest.defaultPage(), qw);
} }
} }