diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/HistoryAlarmVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/HistoryAlarmVo.java new file mode 100644 index 0000000..dad9dc4 --- /dev/null +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/HistoryAlarmVo.java @@ -0,0 +1,42 @@ +package com.hnac.hzims.operational.alert.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springblade.core.mp.base.BaseEntity; + +import java.util.Date; +import java.util.List; + +@Data +public class HistoryAlarmVo extends BaseEntity { + + @ApiModelProperty("ID") + private Long id; + + @ApiModelProperty("站点编码") + private String stationId; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("告警编码") + private Long alarmId; + + @ApiModelProperty("检查点") + private String realId; + + @ApiModelProperty("告警开始时间") + private Date startTime; + + @ApiModelProperty("告警结束时间") + private Date endTime; + + @ApiModelProperty("告警类型") + private List type; + + @ApiModelProperty("状态") + private Integer status; + + @ApiModelProperty("告警原因") + private String soeExplain; +} \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java index f2fbf01..9602b7e 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java @@ -7,9 +7,10 @@ import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity; import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService; import com.hnac.hzims.operational.alert.vo.AlarmParamVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo; -import com.hnac.hzims.operational.alert.vo.SoeParamVo; -import com.hnac.hzims.operational.alert.vo.SoeReustVo; -import com.hnac.hzims.operational.config.vo.*; +import com.hnac.hzims.operational.alert.vo.HistoryAlarmVo; +import com.hnac.hzims.operational.config.vo.AlarmDataPageVo; +import com.hnac.hzims.operational.config.vo.AlarmVo; +import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo; import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -40,10 +41,10 @@ public class AbnormalAlarmController extends BladeController { * 统计通讯中断时间 */ @ApiLog - @GetMapping("/statisticsTime") + @RequestMapping(value = "/statisticsTime", method = {RequestMethod.GET, RequestMethod.POST}) @ApiOperationSupport(order = 1) @ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity") - public R> statisticsTime(HistoryAbnormalAlarmEntity entity, Query query) { + public R> statisticsTime(HistoryAlarmVo entity, Query query) { IPage pages = service.getAlarmTime(query,entity); return R.data(pages); } @@ -52,10 +53,10 @@ public class AbnormalAlarmController extends BladeController { * 统计通讯中断二级目录查询 */ @ApiLog - @GetMapping("/queryByEntity") + @RequestMapping(value = "/queryByEntity", method = {RequestMethod.GET, RequestMethod.POST}) @ApiOperationSupport(order = 1) @ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity") - public R> queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { + public R> queryByEntity(HistoryAlarmVo entity, Query query) { IPage pages = service.queryByEntity(entity,query); return R.data(pages); } @@ -72,7 +73,7 @@ public class AbnormalAlarmController extends BladeController { * 详情 */ @ApiLog - @GetMapping("/detail") + @RequestMapping(value = "/detail", method = {RequestMethod.GET, RequestMethod.POST}) @ApiOperationSupport(order = 3) @ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity") public R detail(HistoryAbnormalAlarmEntity entity) { diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java index 4f396c1..8ab23c1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity; import com.hnac.hzims.operational.alert.vo.AlarmParamVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo; -import com.hnac.hzims.operational.alert.vo.SoeParamVo; -import com.hnac.hzims.operational.alert.vo.SoeReustVo; -import com.hnac.hzims.operational.config.vo.*; +import com.hnac.hzims.operational.alert.vo.HistoryAlarmVo; +import com.hnac.hzims.operational.config.vo.AlarmDataPageVo; +import com.hnac.hzims.operational.config.vo.AlarmVo; +import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo; import com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; @@ -23,9 +24,9 @@ public interface HistoryAbnormalAlarmService extends BaseService list(IPage page, String type); - IPage getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity); + IPage getAlarmTime(Query query, HistoryAlarmVo entity); - IPage queryByEntity(HistoryAbnormalAlarmEntity entity,Query query); + IPage queryByEntity(HistoryAlarmVo entity,Query query); AlarmReustVo alarms(AlarmParamVo param); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java index 57e41fa..71ba8b5 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java @@ -102,7 +102,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity) { + public IPage getAlarmTime(Query query, HistoryAlarmVo entity) { QueryWrapper alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); List historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper); if (historyAbnormalAlarmEntity == null) { @@ -131,8 +131,11 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { + private QueryWrapper getAlarmEntityQueryWrapper(HistoryAlarmVo entity) { QueryWrapper queryWrapper = new QueryWrapper<>(); if (entity.getStationName() != null) { String[] list = entity.getStationName().split(","); queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, Arrays.stream(list).collect(Collectors.toList())); } if (entity.getType() != null) { - queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType()); + queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getType, entity.getType()); } if (entity.getStartTime() != null) { queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime()); @@ -174,7 +177,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { + public IPage queryByEntity(HistoryAlarmVo entity, Query query) { QueryWrapper alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); IPage historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper); List records = historyAbnormalAlarmEntityIPage.getRecords();