diff --git a/src/main/java/club/joylink/xiannccda/controller/FaultQueryController.java b/src/main/java/club/joylink/xiannccda/controller/FaultQueryController.java index 09aca71..755b980 100644 --- a/src/main/java/club/joylink/xiannccda/controller/FaultQueryController.java +++ b/src/main/java/club/joylink/xiannccda/controller/FaultQueryController.java @@ -9,10 +9,12 @@ import club.joylink.xiannccda.dto.alertTip.AlertTipQueryDTO; import club.joylink.xiannccda.dto.alertTip.AlertTipSaveDTO; import club.joylink.xiannccda.dto.fq.FaultQueryReqDTO; import club.joylink.xiannccda.dto.fq.FaultType; +import club.joylink.xiannccda.dto.fq.FaultType.FaultTypeDetail; import club.joylink.xiannccda.entity.AlertTip; import club.joylink.xiannccda.entity.FaultQuery; import club.joylink.xiannccda.repository.IFaultQueryRepository; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; @@ -54,15 +56,14 @@ public class FaultQueryController { @Operation(summary = "查询故障类型") @GetMapping("/type") // @CommonLogAnno(name = "决策信息-查看", logType = CommonLogTypeEnum.OPERATE, subLogType = SubEventType.QUERY) - public Map> faultType() { - Map> mapTypList = Maps.newHashMap(); - mapTypList.put(3, List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE, "车辆故障应急处置指导关键点"), new FaultType(FaultQueryType.FAULT_EXIT_SERVICE, "车辆故障退出服务地点"))); - mapTypList.put(4, List.of(new FaultType(FaultQueryType.FAULT_EMERGENCY_GUIDE_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_EXIT_SERVICE_T_CCD_5037, "车辆故障退出服务地点CCD-5037车型"))); - - return mapTypList; + public List faultType() { + return List.of(new FaultType(3, + List.of(new FaultTypeDetail(FaultQueryType.FAULT_EMERGENCY_GUIDE, "车辆故障应急处置指导关键点"), new FaultTypeDetail(FaultQueryType.FAULT_EXIT_SERVICE, "车辆故障退出服务地点"))) + , new FaultType(4, List.of(new FaultTypeDetail(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_DK37, "车辆故障应急处置指导关键点-DK37车型"), + new FaultTypeDetail(FaultQueryType.FAULT_EXIT_SERVICE_T_DK37, "车辆故障退出服务地点-DK37车型") + , new FaultTypeDetail(FaultQueryType.FAULT_EMERGENCY_GUIDE_T_CCD_5037, "车辆故障应急处置指导关键点CCD-5037车型"), + new FaultTypeDetail(FaultQueryType.FAULT_EXIT_SERVICE_T_CCD_5037, "车辆故障退出服务地点CCD-5037车型"))) + ); } @SecurityRequirement(name = "jwt") diff --git a/src/main/java/club/joylink/xiannccda/dto/fq/FaultType.java b/src/main/java/club/joylink/xiannccda/dto/fq/FaultType.java index 3745381..cf45598 100644 --- a/src/main/java/club/joylink/xiannccda/dto/fq/FaultType.java +++ b/src/main/java/club/joylink/xiannccda/dto/fq/FaultType.java @@ -1,16 +1,28 @@ package club.joylink.xiannccda.dto.fq; import club.joylink.xiannccda.constants.common.FaultQueryType; +import java.util.List; import lombok.Data; @Data public class FaultType { - private String faultType; - private String typeName; + private Integer lineId; + private List fts; - public FaultType(FaultQueryType qt, String name) { - this.faultType = qt.name(); - this.typeName = name; + public FaultType(Integer lineId, List fts) { + this.lineId = lineId; + this.fts = fts; + } + + public static class FaultTypeDetail { + + private String faultType; + private String typeName; + + public FaultTypeDetail(FaultQueryType qt, String name) { + this.faultType = qt.name(); + this.typeName = name; + } } }