Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
33e7e64de0
  1. 42
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/HistoryAlarmVo.java
  2. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  3. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java
  4. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

42
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<String> type;
@ApiModelProperty("状态")
private Integer status;
@ApiModelProperty("告警原因")
private String soeExplain;
}

17
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.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.alert.vo.AlarmParamVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.alert.vo.AlarmReustVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.alert.vo.SoeParamVo; import com.hnac.hzims.operational.alert.vo.HistoryAlarmVo;
import com.hnac.hzims.operational.alert.vo.SoeReustVo; import com.hnac.hzims.operational.config.vo.AlarmDataPageVo;
import com.hnac.hzims.operational.config.vo.*; 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 com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -40,10 +41,10 @@ public class AbnormalAlarmController extends BladeController {
* 统计通讯中断时间 * 统计通讯中断时间
*/ */
@ApiLog @ApiLog
@GetMapping("/statisticsTime") @RequestMapping(value = "/statisticsTime", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity") @ApiOperation(value = "统计通讯中断时间", notes = "传入imsDutyMainEntity")
public R<IPage<HistoryAbnormalAlarmVo>> statisticsTime(HistoryAbnormalAlarmEntity entity, Query query) { public R<IPage<HistoryAbnormalAlarmVo>> statisticsTime(HistoryAlarmVo entity, Query query) {
IPage<HistoryAbnormalAlarmVo> pages = service.getAlarmTime(query,entity); IPage<HistoryAbnormalAlarmVo> pages = service.getAlarmTime(query,entity);
return R.data(pages); return R.data(pages);
} }
@ -52,10 +53,10 @@ public class AbnormalAlarmController extends BladeController {
* 统计通讯中断二级目录查询 * 统计通讯中断二级目录查询
*/ */
@ApiLog @ApiLog
@GetMapping("/queryByEntity") @RequestMapping(value = "/queryByEntity", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity") @ApiOperation(value = "统计通讯中断二级目录查询", notes = "传入imsDutyMainEntity")
public R<IPage<HistoryAbnormalAlarmVo>> queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { public R<IPage<HistoryAbnormalAlarmVo>> queryByEntity(HistoryAlarmVo entity, Query query) {
IPage<HistoryAbnormalAlarmVo> pages = service.queryByEntity(entity,query); IPage<HistoryAbnormalAlarmVo> pages = service.queryByEntity(entity,query);
return R.data(pages); return R.data(pages);
} }
@ -72,7 +73,7 @@ public class AbnormalAlarmController extends BladeController {
* 详情 * 详情
*/ */
@ApiLog @ApiLog
@GetMapping("/detail") @RequestMapping(value = "/detail", method = {RequestMethod.GET, RequestMethod.POST})
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity")
public R<HistoryAbnormalAlarmEntity> detail(HistoryAbnormalAlarmEntity entity) { public R<HistoryAbnormalAlarmEntity> detail(HistoryAbnormalAlarmEntity entity) {

11
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.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.vo.AlarmParamVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.alert.vo.AlarmReustVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.alert.vo.SoeParamVo; import com.hnac.hzims.operational.alert.vo.HistoryAlarmVo;
import com.hnac.hzims.operational.alert.vo.SoeReustVo; import com.hnac.hzims.operational.config.vo.AlarmDataPageVo;
import com.hnac.hzims.operational.config.vo.*; 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 com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@ -23,9 +24,9 @@ public interface HistoryAbnormalAlarmService extends BaseService<HistoryAbnormal
IPage<HistoryAbnormalAlarmVo> list(IPage<HistoryAbnormalAlarmVo> page, String type); IPage<HistoryAbnormalAlarmVo> list(IPage<HistoryAbnormalAlarmVo> page, String type);
IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity); IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAlarmVo entity);
IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAbnormalAlarmEntity entity,Query query); IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAlarmVo entity,Query query);
AlarmReustVo alarms(AlarmParamVo param); AlarmReustVo alarms(AlarmParamVo param);

15
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -102,7 +102,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
* @return * @return
*/ */
@Override @Override
public IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAbnormalAlarmEntity entity) { public IPage<HistoryAbnormalAlarmVo> getAlarmTime(Query query, HistoryAlarmVo entity) {
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity);
List<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper); List<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntity = this.baseMapper.selectList(alarmEntityQueryWrapper);
if (historyAbnormalAlarmEntity == null) { if (historyAbnormalAlarmEntity == null) {
@ -131,8 +131,11 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
String key = entry.getKey(); String key = entry.getKey();
historyAbnormalAlarmVo.setStationName(key); historyAbnormalAlarmVo.setStationName(key);
historyAbnormalAlarmVo.setTimes(timesList.get(key)); historyAbnormalAlarmVo.setTimes(timesList.get(key));
if (StringUtils.isNotEmpty(entity.getType())) { if (CollectionUtil.isNotEmpty(entity.getType())) {
historyAbnormalAlarmVo.setType(entity.getType()); //只有告警类型唯一,前端才根据这个字段进行渲染
if (entity.getType().size()==1) {
historyAbnormalAlarmVo.setType(entity.getType().get(0));
}
} }
res.add(historyAbnormalAlarmVo); res.add(historyAbnormalAlarmVo);
} }
@ -155,14 +158,14 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} }
private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAlarmVo entity) {
QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>();
if (entity.getStationName() != null) { if (entity.getStationName() != null) {
String[] list = entity.getStationName().split(","); String[] list = entity.getStationName().split(",");
queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, Arrays.stream(list).collect(Collectors.toList())); queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, Arrays.stream(list).collect(Collectors.toList()));
} }
if (entity.getType() != null) { if (entity.getType() != null) {
queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType()); queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getType, entity.getType());
} }
if (entity.getStartTime() != null) { if (entity.getStartTime() != null) {
queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime()); queryWrapper.lambda().ge(HistoryAbnormalAlarmEntity::getStartTime, entity.getStartTime());
@ -174,7 +177,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} }
@Override @Override
public IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAbnormalAlarmEntity entity, Query query) { public IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAlarmVo entity, Query query) {
QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity); QueryWrapper<HistoryAbnormalAlarmEntity> alarmEntityQueryWrapper = getAlarmEntityQueryWrapper(entity);
IPage<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper); IPage<HistoryAbnormalAlarmEntity> historyAbnormalAlarmEntityIPage = this.baseMapper.selectPage(Condition.getPage(query), alarmEntityQueryWrapper);
List<HistoryAbnormalAlarmEntity> records = historyAbnormalAlarmEntityIPage.getRecords(); List<HistoryAbnormalAlarmEntity> records = historyAbnormalAlarmEntityIPage.getRecords();

Loading…
Cancel
Save