Browse Source

#告警处理

zhongwei
yang_shj 2 years ago
parent
commit
50a94340b1
  1. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java
  2. 45
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmDataVo.java
  3. 30
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmParamVo.java
  4. 31
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmReustVo.java
  5. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/OperAccessTaskClient.java
  6. 32
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java
  7. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java
  8. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java
  9. 98
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  10. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  11. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/StAlamRecordService.java
  12. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/entity/AlarmHandleEntity.java

@ -15,6 +15,9 @@ import java.util.Date;
@ApiModel(value = "告警处理对象") @ApiModel(value = "告警处理对象")
public class AlarmHandleEntity extends BaseEntity { public class AlarmHandleEntity extends BaseEntity {
@ApiModelProperty("告警Id")
private Long alarmId;
@ApiModelProperty("站点编码") @ApiModelProperty("站点编码")
private String stationCode; private String stationCode;

45
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmDataVo.java

@ -0,0 +1,45 @@
package com.hnac.hzims.operational.alert.vo;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/23 14:06:27
* @version 4.0.0
*/
@Data
public class AlarmDataVo extends SoeData {
@ApiModelProperty(value = "数量")
private String unitName;
@ApiModelProperty(value = "数量")
private String pointName;
@ApiModelProperty(value = "数量")
private int count;
@ApiModelProperty(value = "站点编号")
private String stationCode;
@ApiModelProperty(value = "站点名称")
private String stationName;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "是否绑定")
private Boolean isBinding;
@ApiModelProperty(value = "站点类型: 2-待运维 1-云服务")
private String serveType;
@ApiModelProperty(value = "告警类型")
private String type;
@ApiModelProperty(value = "告警是否处理")
private Boolean isHandle;
}

30
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmParamVo.java

@ -0,0 +1,30 @@
package com.hnac.hzims.operational.alert.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ysj
* @date 2023/03/23 13:34:37
* @version 4.0.0
*/
@Data
public class AlarmParamVo {
@ApiModelProperty(value = "查询开始时间:yyyy-MM-dd HH:mm:ss")
private String date;
@ApiModelProperty(value = "默认,系统,告警,故障,用户操作,遥测越限,遥信变位,注册信息,信息提示,设备巡检,遥控操作,遥测越限恢复,未定义,通讯中断,数据异常")
private String type;
@ApiModelProperty(value = "当前页码")
private Integer current;
@ApiModelProperty(value = "每页条目")
private Integer size;
@ApiModelProperty(value = "站点编码")
private String code;
}

31
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmReustVo.java

@ -0,0 +1,31 @@
package com.hnac.hzims.operational.alert.vo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author ysj
* @date 2023/03/23 13:34:37
* @version 4.0.0
*/
@Data
public class AlarmReustVo {
@ApiModelProperty(value = "最新的时间")
private String date;
@ApiModelProperty(value = "告警数据")
private List<AlarmDataVo> soeList;
@ApiModelProperty(value = "数量统计")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer count;
@ApiModelProperty(value = "总条数")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long total;
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/feign/OperAccessTaskClient.java

@ -1,7 +1,6 @@
package com.hnac.hzims.operational.access.feign; package com.hnac.hzims.operational.access.feign;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -12,10 +11,6 @@ import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
import com.hnac.hzims.operational.feign.IAccessTaskClient; import com.hnac.hzims.operational.feign.IAccessTaskClient;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;

32
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/controller/AbnormalAlarmController.java

@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity; 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.config.vo.AlarmDataPageVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.config.vo.AlarmVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo; import com.hnac.hzims.operational.config.vo.*;
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;
@ -34,7 +34,7 @@ public class AbnormalAlarmController extends BladeController {
* 统计通讯中断时间 * 统计通讯中断时间
*/ */
@GetMapping("/statisticsTime") @GetMapping("/statisticsTime")
@ApiOperationSupport(order = 0) @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(HistoryAbnormalAlarmEntity entity, Query query) {
IPage<HistoryAbnormalAlarmVo> pages = service.getAlarmTime(query,entity); IPage<HistoryAbnormalAlarmVo> pages = service.getAlarmTime(query,entity);
@ -53,7 +53,7 @@ public class AbnormalAlarmController extends BladeController {
} }
@GetMapping("/queryStationName") @GetMapping("/queryStationName")
@ApiOperationSupport(order = 0) @ApiOperationSupport(order = 2)
@ApiOperation(value = "查询站点") @ApiOperation(value = "查询站点")
public R<List<String>> queryStationName() { public R<List<String>> queryStationName() {
List<String> res = service.queryStationName(); List<String> res = service.queryStationName();
@ -63,7 +63,7 @@ public class AbnormalAlarmController extends BladeController {
* 详情 * 详情
*/ */
@GetMapping("/detail") @GetMapping("/detail")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "详情", notes = "传入HistoryAbnormalAlarmEntity")
public R<HistoryAbnormalAlarmEntity> detail(HistoryAbnormalAlarmEntity entity) { public R<HistoryAbnormalAlarmEntity> detail(HistoryAbnormalAlarmEntity entity) {
HistoryAbnormalAlarmEntity detail = service.getOne(Condition.getQueryWrapper(entity)); HistoryAbnormalAlarmEntity detail = service.getOne(Condition.getQueryWrapper(entity));
@ -74,7 +74,7 @@ public class AbnormalAlarmController extends BladeController {
* 分页 * 分页
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 4)
@ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "分页", notes = "传入HistoryAbnormalAlarmEntity")
public R<IPage<HistoryAbnormalAlarmEntity>> list(HistoryAbnormalAlarmEntity entity, Query query) { public R<IPage<HistoryAbnormalAlarmEntity>> list(HistoryAbnormalAlarmEntity entity, Query query) {
IPage<HistoryAbnormalAlarmEntity> pages = service.page(Condition.getPage(query), Condition.getQueryWrapper(entity)); IPage<HistoryAbnormalAlarmEntity> pages = service.page(Condition.getPage(query), Condition.getQueryWrapper(entity));
@ -85,7 +85,7 @@ public class AbnormalAlarmController extends BladeController {
* 新增或修改 * 新增或修改
*/ */
@PostMapping("/submit") @PostMapping("/submit")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 5)
@ApiOperation(value = "新增或修改", notes = "传入HistoryAbnormalAlarmEntity") @ApiOperation(value = "新增或修改", notes = "传入HistoryAbnormalAlarmEntity")
public R submit(@Valid @RequestBody HistoryAbnormalAlarmEntity entity) { public R submit(@Valid @RequestBody HistoryAbnormalAlarmEntity entity) {
return R.status(service.saveOrUpdate(entity)); return R.status(service.saveOrUpdate(entity));
@ -96,17 +96,27 @@ public class AbnormalAlarmController extends BladeController {
* 删除 * 删除
*/ */
@PostMapping("/remove") @PostMapping("/remove")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 6)
@ApiOperation(value = "逻辑删除", notes = "传入ids") @ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.deleteLogic(Func.toLongList(ids))); return R.status(service.deleteLogic(Func.toLongList(ids)));
} }
/** /**
*
*/
@ApiOperation(value = "智能优化接口")
@ApiOperationSupport(order = 7)
@RequestMapping(value = "/alarms", method = {RequestMethod.GET, RequestMethod.POST})
public R<AlarmReustVo> alarms(AlarmParamVo param){
return R.data(service.alarms(param));
}
/**
* 智能告警数量: 时间范围当天 * 智能告警数量: 时间范围当天
*/ */
@ApiOperation(value = "智能告警数量") @ApiOperation(value = "智能告警数量")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 8)
@RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/count", method = {RequestMethod.GET, RequestMethod.POST})
public R<List<IntelligentAlarmCountVo>> count(){ public R<List<IntelligentAlarmCountVo>> count(){
return R.data(service.alarmCount()); return R.data(service.alarmCount());
@ -117,7 +127,7 @@ public class AbnormalAlarmController extends BladeController {
* 智能告警数据: 时间范围当天 * 智能告警数据: 时间范围当天
*/ */
@ApiOperation(value = "智能告警数据") @ApiOperation(value = "智能告警数据")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 9)
@RequestMapping(value = "/data", method = RequestMethod.GET) @RequestMapping(value = "/data", method = RequestMethod.GET)
public R<IPage<AlarmVo>> data(AlarmDataPageVo page,Query query) { public R<IPage<AlarmVo>> data(AlarmDataPageVo page,Query query) {
return R.data(service.alarmData(page,query)); return R.data(service.alarmData(page,query));

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/HistoryAbnormalAlarmService.java

@ -2,16 +2,13 @@ package com.hnac.hzims.operational.alert.service;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.config.vo.AlarmDataPageVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.config.vo.AlarmVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo; import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.fill.vo.OverConfigVo;
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;
import org.springblade.core.tool.api.R;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -27,6 +24,8 @@ public interface HistoryAbnormalAlarmService extends BaseService<HistoryAbnormal
IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAbnormalAlarmEntity entity,Query query); IPage<HistoryAbnormalAlarmVo> queryByEntity(HistoryAbnormalAlarmEntity entity,Query query);
AlarmReustVo alarms(AlarmParamVo param);
// 智能告警数量: 时间范围当天 // 智能告警数量: 时间范围当天
List<IntelligentAlarmCountVo> alarmCount(); List<IntelligentAlarmCountVo> alarmCount();

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlarmHandleServiceImpl.java

@ -68,6 +68,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
detail.setFilePath(param.getFilePath()); detail.setFilePath(param.getFilePath());
detailService.save(detail); detailService.save(detail);
AlarmHandleEntity entity = new AlarmHandleEntity(); AlarmHandleEntity entity = new AlarmHandleEntity();
entity.setAlarmId(param.getAlarmId());
entity.setDetailId(detail.getId()); entity.setDetailId(detail.getId());
entity.setAlarmTime(param.getAlarmTime()); entity.setAlarmTime(param.getAlarmTime());
entity.setAlarmContent(param.getAlarmContent()); entity.setAlarmContent(param.getAlarmContent());

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

@ -5,12 +5,16 @@ 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.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant;
import com.hnac.hzims.operational.alert.entity.AlarmHandleEntity;
import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity; import com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity;
import com.hnac.hzims.operational.alert.mapper.HistoryAbnormalAlarmMapper; import com.hnac.hzims.operational.alert.mapper.HistoryAbnormalAlarmMapper;
import com.hnac.hzims.operational.alert.service.AlarmHandleService;
import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService; import com.hnac.hzims.operational.alert.service.HistoryAbnormalAlarmService;
import com.hnac.hzims.operational.config.vo.AlarmDataPageVo; import com.hnac.hzims.operational.alert.vo.AlarmDataVo;
import com.hnac.hzims.operational.config.vo.AlarmVo; import com.hnac.hzims.operational.alert.vo.AlarmParamVo;
import com.hnac.hzims.operational.config.vo.IntelligentAlarmCountVo; import com.hnac.hzims.operational.alert.vo.AlarmReustVo;
import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.main.vo.WaterMonDataVo;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant; import com.hnac.hzims.operational.maintenance.constants.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
@ -51,6 +55,8 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
private final IStationService stationService; private final IStationService stationService;
private final AlarmHandleService handleService;
private final ISoeClient alarmClient; private final ISoeClient alarmClient;
@Value("${hzims.operation.alarm.types}") @Value("${hzims.operation.alarm.types}")
@ -198,6 +204,92 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} }
/** /**
* 告警优化
* @param param
* @return
*/
@Override
public AlarmReustVo alarms(AlarmParamVo param) {
// 查询站点
LambdaQueryWrapper<StationEntity> wrapper = Wrappers.lambdaQuery();
if(StringUtils.isNotEmpty(param.getCode())){
wrapper.eq(StationEntity::getCode,param.getCode());
}
List<StationEntity> stations = stationService.list(wrapper);
if(CollectionUtil.isEmpty(stations)){
return new AlarmReustVo();
}
// 查询告警数据
DateTimeFormatter format = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
SoeQueryConditionByStation condition = new SoeQueryConditionByStation();
/*if (StringUtils.isEmpty(param.getDate())) {
condition.setBeginTime(LocalDateTime.parse(
DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00", format
));
} else {
condition.setBeginTime(LocalDateTime.parse(param.getDate(), format));
}*/
// condition.setEndTime(LocalDateTime.now());
// FIXME 测试使用时间
condition.setBeginTime(LocalDateTime.parse("2023-02-01 00:00:00", format));
condition.setEndTime(LocalDateTime.parse("2023-02-27 00:00:00", format));
condition.setNeedPage(true);
condition.setPage(param.getCurrent());
condition.setLimit(param.getSize());
condition.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
condition.setTypes(Arrays.asList(param.getType().split(",")));
Result<HzPage<SoeData>> result = alarmClient.getByStationsAndTime(condition);
if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){
return new AlarmReustVo();
}
// 查询处理告警
List<Long> handles = this.getAlarmHandleIds();
// 返回数据
AlarmReustVo response = new AlarmReustVo();
List<AlarmDataVo> datas = result.getData().getRecords().stream().map(alarm -> {
AlarmDataVo record = new AlarmDataVo();
// 继承类属性拷贝
BeanUtil.copyProperties(alarm, record);
if(CollectionUtil.isEmpty(handles)){
record.setIsHandle(false);
}else{
record.setIsHandle(handles.contains(alarm.getId()));
}
record.setStationCode(alarm.getStation());
record.setContent(alarm.getSoeExplain());
record.setType(alarm.getSoeType());
record.setSoeType(AbnormalAlarmConstant.TYPE_NAMES[Integer.valueOf(alarm.getSoeType())]);
List<StationEntity> filter = stations.stream().filter(station -> station.getCode().equals(alarm.getStation())).collect(Collectors.toList());
if (CollectionUtil.isEmpty(filter)) {
return record;
}
record.setStationName(filter.get(0).getName());
record.setServeType(filter.get(0).getServeType());
return record;
}).sorted(Comparator.comparing(AlarmDataVo::getIsHandle)
.thenComparing(AlarmDataVo::getTs, Comparator.reverseOrder())).collect(Collectors.toList());
response.setCount(datas.size());
response.setSoeList(datas);
response.setTotal(result.getData().getTotal());
return response;
}
/**
* 获取处理数据ID集合
* @return
*/
private List<Long> getAlarmHandleIds() {
List<AlarmHandleEntity> handles = handleService.list();
if(CollectionUtil.isEmpty(handles)){
return null;
}
return handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList());
}
/**
* 告警数量:时间范围-当天 * 告警数量:时间范围-当天
* @return * @return
*/ */

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java

@ -787,11 +787,11 @@ public class TargetServiceImpl implements TargetService {
WaterTargetVo water = new WaterTargetVo(); WaterTargetVo water = new WaterTargetVo();
water.setStationName(station.getName()); water.setStationName(station.getName());
if(CollectionUtil.isEmpty(pumps)){ if(CollectionUtil.isEmpty(pumps)){
water.setUse(0.0); water.setLoad(0.0);
return water; return water;
} }
Double use = pumps.stream().filter(o->o.getDeptId().equals(station.getRefDept())).mapToDouble(WaterPumpRealVo::getActivePower).sum(); Double use = pumps.stream().filter(o->o.getDeptId().equals(station.getRefDept())).mapToDouble(WaterPumpRealVo::getActivePower).sum();
water.setUse(Optional.ofNullable(use).orElse(0.0)); water.setLoad(Optional.ofNullable(use).orElse(0.0));
return water; return water;
}).sorted(Comparator.comparing(WaterTargetVo::getLoad)).collect(Collectors.toList()); }).sorted(Comparator.comparing(WaterTargetVo::getLoad)).collect(Collectors.toList());
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/StAlamRecordService.java

@ -1,7 +1,6 @@
package com.hnac.hzims.operational.config.service; package com.hnac.hzims.operational.config.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity; import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import com.hnac.hzims.operational.config.vo.FaultVo; import com.hnac.hzims.operational.config.vo.FaultVo;

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/service/impl/StAlamRecordServiceImpl.java

@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo;
import com.hnac.hzims.fdp.feign.IFdpMonitorClient; import com.hnac.hzims.fdp.feign.IFdpMonitorClient;
@ -22,6 +23,7 @@ import com.hnac.hzims.operational.config.service.StFocusPropertiesService;
import com.hnac.hzims.operational.config.vo.*; import com.hnac.hzims.operational.config.vo.*;
import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService;
import com.hnac.hzims.operational.main.vo.SoeDataVo; import com.hnac.hzims.operational.main.vo.SoeDataVo;
import com.hnac.hzims.operational.maintenance.constants.HomePageConstant;
import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.service.IStationService;
import com.hnac.hzims.operational.util.ExcelUtil; import com.hnac.hzims.operational.util.ExcelUtil;
@ -48,6 +50,7 @@ import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

Loading…
Cancel
Save