Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
0a15fe7a0d
  1. 7
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmMergeVo.java
  2. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DutyGroupVo.java
  3. 2
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java
  4. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryLevelAlarmMapper.java
  5. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlertMerageServiceImpl.java
  6. 38
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java
  7. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryLevelAlarmServiceImpl.java
  8. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java
  9. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java
  10. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/TargetServiceImpl.java
  11. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/LevelAlarmRegular.java
  12. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/DeptServiceImpl.java

7
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/alert/vo/AlarmMergeVo.java

@ -2,6 +2,7 @@ package com.hnac.hzims.operational.alert.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -28,9 +29,15 @@ public class AlarmMergeVo{
@ApiModelProperty("告警编号") @ApiModelProperty("告警编号")
private String alarmCode; private String alarmCode;
@ApiModelProperty("告警等级")
private String level;
@ApiModelProperty("告警类型") @ApiModelProperty("告警类型")
private String type; private String type;
@ApiModelProperty("类型:0-系统告警、2-智能告警")
private Integer alarmType;
@ApiModelProperty("告警内容") @ApiModelProperty("告警内容")
private String content; private String content;

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/DutyGroupVo.java

@ -19,24 +19,7 @@ public class DutyGroupVo {
@ApiModelProperty("区域名称") @ApiModelProperty("区域名称")
private String areaName; private String areaName;
@ApiModelProperty("工作票数量") @ApiModelProperty("数量")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Integer work; private Integer count;
@ApiModelProperty("操作票数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer operateoperate;
@ApiModelProperty("巡检任务数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer inspect;
@ApiModelProperty("消缺数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer defect;
@ApiModelProperty("定期工作数量")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer regularly;
} }

2
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/HomePageConstant.java

@ -266,7 +266,7 @@ public interface HomePageConstant {
* 有功功率 * 有功功率
**/ **/
String PV_LOAD = "active_power"; String PV_LOAD = "active_power";
/** /**1
* 正向无功 * 正向无功
**/ **/
String PV_REACTIVE_POWER = "reactive_power"; String PV_REACTIVE_POWER = "reactive_power";

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryLevelAlarmMapper.java

@ -1,11 +1,11 @@
package com.hnac.hzims.operational.alert.mapper; package com.hnac.hzims.operational.alert.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.alert.entity.HistoryLevelAlarmEntity; import com.hnac.hzims.operational.alert.entity.HistoryLevelAlarmEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/** /**
* @author YSJ * @author YSJ
*/ */
public interface HistoryLevelAlarmMapper extends UserDataScopeBaseMapper<HistoryLevelAlarmEntity> { public interface HistoryLevelAlarmMapper extends BaseMapper<HistoryLevelAlarmEntity> {
} }

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AlertMerageServiceImpl.java

@ -81,7 +81,7 @@ public class AlertMerageServiceImpl implements AlarmMergeService {
List<AlarmMergeVo> alarms = new ArrayList<>(); List<AlarmMergeVo> alarms = new ArrayList<>();
if(CollectionUtil.isNotEmpty(faults)){ if(CollectionUtil.isNotEmpty(faults)){
alarms.addAll(faults.stream().filter(o -> CollectionUtil.isEmpty(handles) alarms.addAll(faults.stream().filter(o -> CollectionUtil.isEmpty(handles)
|| !handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(o.getAlarmId())). || !handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(o.getAlarmId().toString())).
map(fault->{ map(fault->{
AlarmMergeVo alarm = new AlarmMergeVo(); AlarmMergeVo alarm = new AlarmMergeVo();
alarm.setStationCode(fault.getStationId()); alarm.setStationCode(fault.getStationId());
@ -91,6 +91,7 @@ public class AlertMerageServiceImpl implements AlarmMergeService {
alarm.setRealId(fault.getRealId()); alarm.setRealId(fault.getRealId());
alarm.setAlarmCode(String.valueOf(fault.getAlarmId())); alarm.setAlarmCode(String.valueOf(fault.getAlarmId()));
alarm.setType(fault.getType()); alarm.setType(fault.getType());
alarm.setAlarmType(AbnormalAlarmConstant.SYSTEM_ALARM);
return alarm; return alarm;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
} }
@ -111,8 +112,10 @@ public class AlertMerageServiceImpl implements AlarmMergeService {
alarm.setContent(level.getSoeExplain()); alarm.setContent(level.getSoeExplain());
alarm.setDate(level.getAlarmTime()); alarm.setDate(level.getAlarmTime());
alarm.setRealId(level.getRealId()); alarm.setRealId(level.getRealId());
alarm.setLevel(level.getAlarmLevel());
alarm.setAlarmCode(level.getAlarmId()); alarm.setAlarmCode(level.getAlarmId());
alarm.setType(level.getType()); alarm.setType(level.getType());
alarm.setAlarmType(AbnormalAlarmConstant.INTELLIGENCE_ALARM);
return alarm; return alarm;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
} }

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

@ -60,9 +60,6 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
private final ISoeClient alarmClient; private final ISoeClient alarmClient;
private final SoeClient soeClient;
@Value("${hzims.operation.alarm.types}") @Value("${hzims.operation.alarm.types}")
private String types; private String types;
@ -119,10 +116,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} else { } else {
historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(new Date())); historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(new Date()));
} }
List<HistoryAbnormalAlarmVo> voList = historyAbnormalAlarmVos.parallelStream().map(s -> { List<HistoryAbnormalAlarmVo> voList = historyAbnormalAlarmVos.parallelStream().peek(s -> s.setTimes((s.getEndTime().getTime() - s.getStartTime().getTime()))).collect(Collectors.toList());
s.setTimes((s.getEndTime().getTime() - s.getStartTime().getTime()));
return s;
}).collect(Collectors.toList());
//次数统计 //次数统计
Map<String, Long> timesList = voList.stream().collect(Collectors.groupingBy(HistoryAbnormalAlarmEntity::getStationName, Map<String, Long> timesList = voList.stream().collect(Collectors.groupingBy(HistoryAbnormalAlarmEntity::getStationName,
Collectors.counting())); Collectors.counting()));
@ -166,7 +160,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
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, list); 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().eq(HistoryAbnormalAlarmEntity::getType, entity.getType());
@ -194,11 +188,10 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} else { } else {
historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(new Date())); historyAbnormalAlarmVos.stream().filter(s -> s.getEndTime() == null).forEach(s -> s.setEndTime(new Date()));
} }
voList= historyAbnormalAlarmVos.parallelStream().map(s -> { voList= historyAbnormalAlarmVos.parallelStream().peek(s -> {
long duration = s.getEndTime().getTime() - s.getStartTime().getTime(); long duration = s.getEndTime().getTime() - s.getStartTime().getTime();
double v = BigDecimal.valueOf(duration / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); double v = BigDecimal.valueOf(duration / (1000 * 60 * 60.00)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
s.setDuration(v); s.setDuration(v);
return s;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
IPage<HistoryAbnormalAlarmVo> page = Condition.getPage(query); IPage<HistoryAbnormalAlarmVo> page = Condition.getPage(query);
@ -225,24 +218,13 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
} }
// 查询告警数据 // 查询告警数据
DateTimeFormatter format = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME);
SoeQueryConditionByStation condition = new SoeQueryConditionByStation(); SoeQueryConditionByStation condition = new SoeQueryConditionByStation();
/*if (StringUtils.isEmpty(param.getDate())) { condition.setBeginTime(LocalDateTime.parse(DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00", DateUtil.DATETIME_FORMATTER));
condition.setBeginTime(LocalDateTime.parse( condition.setEndTime(LocalDateTime.now());
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-04-01 00:00:00", format));
condition.setEndTime(LocalDateTime.parse("2023-04-11 00:00:00", format));
condition.setNeedPage(true); condition.setNeedPage(true);
condition.setPage(param.getCurrent()); condition.setPage(param.getCurrent());
condition.setLimit(param.getSize()); condition.setLimit(param.getSize());
condition.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); condition.setStationIds(stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
//condition.setStationIds(Collections.singletonList("901900000234"));
List<String> types = Arrays.asList(param.getType().split(",")); List<String> types = Arrays.asList(param.getType().split(","));
condition.setTypes(types); condition.setTypes(types);
Result<HzPage<SoeData>> result = alarmClient.getByStationsAndTime(condition); Result<HzPage<SoeData>> result = alarmClient.getByStationsAndTime(condition);
@ -314,7 +296,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
condition.setBeginTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-01 00:00:00", format)); condition.setBeginTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-01 00:00:00", format));
condition.setEndTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-28 00:00:00", format)); condition.setEndTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-28 00:00:00", format));
condition.setNeedPage(false); condition.setNeedPage(false);
condition.setStationIds(stations.stream().filter(station->StringUtils.isNotEmpty(station.getCode())).map(StationEntity::getCode).collect(Collectors.toList())); condition.setStationIds(stations.stream().map(StationEntity::getCode).filter(StringUtils::isNotEmpty).collect(Collectors.toList()));
// nacos中配置告警类型:"0-默认", "1-系统", "2-告警", "3-故障", "4-用户操作", "5-遥测越限", "6-遥信变位", "7-注册信息", // nacos中配置告警类型:"0-默认", "1-系统", "2-告警", "3-故障", "4-用户操作", "5-遥测越限", "6-遥信变位", "7-注册信息",
// "8-信息提示", "9-设备巡检", "10-遥控操作", "11-遥测越限恢复","12-未定义","13-通讯中断","14-数据异常" // "8-信息提示", "9-设备巡检", "10-遥控操作", "11-遥测越限恢复","12-未定义","13-通讯中断","14-数据异常"
condition.setTypes(Arrays.asList(types.split(","))); condition.setTypes(Arrays.asList(types.split(",")));
@ -323,10 +305,10 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
// 步骤3. TODO 过滤已处理告警 // 步骤3. TODO 过滤已处理告警
// 步骤4.遍历获取 // 步骤4.遍历获取
return Arrays.asList(types.split(",")).stream().map(type->{ return Arrays.stream(types.split(",")).map(type->{
IntelligentAlarmCountVo count = new IntelligentAlarmCountVo(); IntelligentAlarmCountVo count = new IntelligentAlarmCountVo();
count.setType(type); count.setType(type);
count.setName(AbnormalAlarmConstant.TYPE_NAMES[Integer.valueOf(type)]); count.setName(AbnormalAlarmConstant.TYPE_NAMES[Integer.parseInt(type)]);
if(result.isSuccess() && !ObjectUtil.isEmpty(result.getData())){ if(result.isSuccess() && !ObjectUtil.isEmpty(result.getData())){
count.setCount(result.getData().getRecords().stream().filter(record->type.equals(record.getSoeType())).count()); count.setCount(result.getData().getRecords().stream().filter(record->type.equals(record.getSoeType())).count());
}else { }else {
@ -363,7 +345,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
condition.setBeginTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-01 00:00:00", format)); condition.setBeginTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-01 00:00:00", format));
condition.setEndTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-28 00:00:00", format)); condition.setEndTime(LocalDateTime.parse(/*DateUtil.format(new Date(), DateUtil.PATTERN_DATE) +*/ "2022-12-28 00:00:00", format));
condition.setNeedPage(false); condition.setNeedPage(false);
condition.setStationIds(stations.stream().filter(station->StringUtils.isNotEmpty(station.getCode())).map(StationEntity::getCode).collect(Collectors.toList())); condition.setStationIds(stations.stream().map(StationEntity::getCode).filter(StringUtils::isNotEmpty).collect(Collectors.toList()));
// nacos中配置告警类型:"0-默认", "1-系统", "2-告警", "3-故障", "4-用户操作", "5-遥测越限", "6-遥信变位", "7-注册信息", // nacos中配置告警类型:"0-默认", "1-系统", "2-告警", "3-故障", "4-用户操作", "5-遥测越限", "6-遥信变位", "7-注册信息",
// "8-信息提示", "9-设备巡检", "10-遥控操作", "11-遥测越限恢复","12-未定义","13-通讯中断","14-数据异常" // "8-信息提示", "9-设备巡检", "10-遥控操作", "11-遥测越限恢复","12-未定义","13-通讯中断","14-数据异常"
condition.setTypes(type_list); condition.setTypes(type_list);
@ -392,7 +374,7 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
// 步骤4.分页 // 步骤4.分页
page.setTotal(alarms.size()); page.setTotal(alarms.size());
page.setRecords(alarms.stream().sorted(Comparator.comparing(AlarmVo::getTs,Comparator.reverseOrder())) page.setRecords(alarms.stream().sorted(Comparator.comparing(AlarmVo::getTs,Comparator.reverseOrder()))
.skip((long) page.getSize() * (page.getCurrent() - 1)).limit(page.getSize()) .skip(page.getSize() * (page.getCurrent() - 1)).limit(page.getSize())
.collect(Collectors.toList())); .collect(Collectors.toList()));
page.setPages((alarms.size() -1) / page.getSize() + 1); page.setPages((alarms.size() -1) / page.getSize() + 1);
}else{ }else{

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryLevelAlarmServiceImpl.java

@ -57,6 +57,11 @@ public class HistoryLevelAlarmServiceImpl extends BaseServiceImpl<HistoryLevelAl
} }
if(ObjectUtil.isNotEmpty(entity.getStationId())){ if(ObjectUtil.isNotEmpty(entity.getStationId())){
wrapper.eq(HistoryLevelAlarmEntity::getStationId, entity.getStationId()); wrapper.eq(HistoryLevelAlarmEntity::getStationId, entity.getStationId());
}else{
List<StationEntity> stations = stationService.list();
if(CollectionUtil.isNotEmpty(stations)){
wrapper.in(HistoryLevelAlarmEntity::getStationId,stations.stream().map(StationEntity::getCode).collect(Collectors.toList()));
}
} }
IPage<HistoryLevelAlarmEntity> page = super.page(Condition.getPage(query), wrapper); IPage<HistoryLevelAlarmEntity> page = super.page(Condition.getPage(query), wrapper);
List<HistoryLevelAlarmEntity> records = page.getRecords(); List<HistoryLevelAlarmEntity> records = page.getRecords();
@ -64,7 +69,7 @@ public class HistoryLevelAlarmServiceImpl extends BaseServiceImpl<HistoryLevelAl
List<AlarmHandleEntity> handles = handleService.handles(ObjectUtil.isEmpty(entity.getType()) ? AbnormalAlarmConstant.LONG_TYPE_LIST : Collections.singletonList(Long.parseLong(entity.getType())),AbnormalAlarmConstant.INTELLIGENCE_ALARM); List<AlarmHandleEntity> handles = handleService.handles(ObjectUtil.isEmpty(entity.getType()) ? AbnormalAlarmConstant.LONG_TYPE_LIST : Collections.singletonList(Long.parseLong(entity.getType())),AbnormalAlarmConstant.INTELLIGENCE_ALARM);
page.setRecords(records.stream().peek(record-> { page.setRecords(records.stream().peek(record-> {
record.setIsHandle(CollectionUtil.isNotEmpty(handles) || handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(record.getAlarmId())); record.setIsHandle(CollectionUtil.isNotEmpty(handles) && handles.stream().map(AlarmHandleEntity::getAlarmId).collect(Collectors.toList()).contains(record.getAlarmId()));
record.setAlarmType(AbnormalAlarmConstant.INTELLIGENCE_ALARM); record.setAlarmType(AbnormalAlarmConstant.INTELLIGENCE_ALARM);
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
return page; return page;

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/LevelAlarmServiceImpl.java

@ -2,6 +2,8 @@ package com.hnac.hzims.operational.alert.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
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.message.MessageConstants; import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.dto.MessagePushRecordDto;
@ -43,7 +45,7 @@ public class LevelAlarmServiceImpl implements LevelAlarmService {
private final IStationService stationService; private final IStationService stationService;
private final IMainSystemMonitoringService deviceService; private final IEmInfoClient deviceClient;
private final HistoryLevelAlarmService historyLevelAlarmService; private final HistoryLevelAlarmService historyLevelAlarmService;
@ -93,7 +95,7 @@ public class LevelAlarmServiceImpl implements LevelAlarmService {
} }
// 设备 // 设备
List<EminfoAndEmParamVo> devices = deviceService.getEmInfoList(); List<EmInfoEntity> devices = deviceClient.list();
// 查询当天已经记录的告警 // 查询当天已经记录的告警
List<HistoryLevelAlarmEntity> historys = historyLevelAlarmService.list(Wrappers.<HistoryLevelAlarmEntity>lambdaQuery() List<HistoryLevelAlarmEntity> historys = historyLevelAlarmService.list(Wrappers.<HistoryLevelAlarmEntity>lambdaQuery()
@ -114,7 +116,7 @@ public class LevelAlarmServiceImpl implements LevelAlarmService {
// 根据设备找站点 // 根据设备找站点
if(CollectionUtil.isNotEmpty(devices)){ if(CollectionUtil.isNotEmpty(devices)){
// 找到设备 // 找到设备
List<EminfoAndEmParamVo> alarmDevices = devices.stream().filter(device->device.getEmCode().equals(item.getDevicecode())).collect(Collectors.toList()); List<EmInfoEntity> alarmDevices = devices.stream().filter(device->device.getNumber().equals(item.getDevicecode())).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(alarmDevices)){ if(CollectionUtil.isNotEmpty(alarmDevices)){
// 找到站点 // 找到站点
List<StationEntity> alarmStations = stations.stream().filter(station->station.getRefDept().equals(alarmDevices.get(0).getCreateDept())).collect(Collectors.toList()); List<StationEntity> alarmStations = stations.stream().filter(station->station.getRefDept().equals(alarmDevices.get(0).getCreateDept())).collect(Collectors.toList());

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/controller/TargetController.java

@ -139,7 +139,7 @@ public class TargetController {
} }
@ApiLog @ApiLog
@ApiOperation("集团操作票/工作票") @ApiOperation("集团当班数据")
@GetMapping("/duty-group") @GetMapping("/duty-group")
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
public R dutygroup(@RequestParam(value = "areaName",required = false) String areaName,@RequestParam(value = "type") Long type) { public R dutygroup(@RequestParam(value = "areaName",required = false) String areaName,@RequestParam(value = "type") Long type) {

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

@ -1027,19 +1027,19 @@ public class TargetServiceImpl implements TargetService {
} }
// 操作票 // 操作票
if (type == 0) { if (type == 0) {
duty.setOperateoperate(dutys.get(0).getOperationTicketCount()); duty.setCount(dutys.get(0).getOperationTicketCount());
// 工作票 // 工作票
} else if (type == 1) { } else if (type == 1) {
duty.setWork(dutys.get(0).getWorkTicketCount()); duty.setCount(dutys.get(0).getWorkTicketCount());
// 巡检 // 巡检
} else if (type == 2) { } else if (type == 2) {
duty.setInspect(dutys.get(0).getInspectionSum()); duty.setCount(dutys.get(0).getInspectionSum());
// 缺陷 // 缺陷
} else if (type == 3) { } else if (type == 3) {
duty.setDefect(dutys.get(0).getShortagesSum()); duty.setCount(dutys.get(0).getShortagesSum());
// 定期工作 // 定期工作
} else if (type == 4) { } else if (type == 4) {
duty.setRegularly(dutys.get(0).getWorkRegularlySum()); duty.setCount(dutys.get(0).getWorkRegularlySum());
} }
return duty; return duty;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/ws/LevelAlarmRegular.java

@ -29,7 +29,7 @@ public class LevelAlarmRegular{
private LevelAlarmService levelAlarmService; private LevelAlarmService levelAlarmService;
// 定时发送消息 // 定时发送消息
@Scheduled(cron = "0/40 * * * * ?") @Scheduled(cron = "0 0/30 * * * ?")
private void regular(){ private void regular(){
// 检查链接存活状态 // 检查链接存活状态
if(ObjectUtil.isNotEmpty(client) && client.isOpen()){ if(ObjectUtil.isNotEmpty(client) && client.isOpen()){

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/DeptServiceImpl.java

@ -139,7 +139,6 @@ public class DeptServiceImpl implements IDeptService {
@Override @Override
public List<Long> alarmDeptByCurrentUser() { public List<Long> alarmDeptByCurrentUser() {
List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery() List<StationEntity> stations = stationService.list(Wrappers.<StationEntity>lambdaQuery()
.in(StationEntity::getType, Arrays.asList(HomePageConstant.HYDROPOWER,HomePageConstant.PHOTOVOLTAIC,HomePageConstant.PUMPING))
.eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE) .eq(StationEntity::getServeType, HomePageConstant.HYDROPOWER_SERVETYPE)
); );
if(CollectionUtil.isEmpty(stations)){ if(CollectionUtil.isEmpty(stations)){

Loading…
Cancel
Save