Browse Source

Merge remote-tracking branch 'origin/prod'

# Conflicts:
#	hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
zhongwei
yang_shj 1 year ago
parent
commit
e37ec4bd30
  1. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java
  2. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java
  3. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
  4. 25
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  5. 3
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -175,7 +175,10 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
this.historyAbnormalAlarmService.save(entity);
// 相同告警只允许添加一次,发送一次消息
explainSet.add(item.getSoeExplain());
// 发送消息
this.sendAlarmMessage(Collections.singletonList(entity),stations);
// 推送短信: 只推送拥有项目经理角色用户
});
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/mapper/EcologyFlowStationMapper.java

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

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java

@ -98,9 +98,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
* @return
*/
@Override
public EcologFlowStationVo station_top(Long deptId) {
List<EcologyFlowStationEntity> stations = this.list(Wrappers.<EcologyFlowStationEntity>lambdaQuery()
.eq(EcologyFlowStationEntity::getCreateDept,deptId));
public EcologFlowStationVo station_top() {
List<EcologyFlowStationEntity> stations = this.list();
if(CollectionUtil.isEmpty(stations)){
return new EcologFlowStationVo();
}
@ -113,7 +112,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
List<EcologyFlowDataEntity> datas = dataService.list(Wrappers.<EcologyFlowDataEntity>lambdaQuery()
.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))
.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList())));
.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()))
);
if(CollectionUtil.isEmpty(datas)){
return station;
}
@ -134,14 +134,8 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl<EcologyFlowSt
* @return
*/
@Override
public List<TrendChartVo> trend_chart(Long deptId,String type) {
List<EcologyFlowStationEntity> stations = this.list(Wrappers.<EcologyFlowStationEntity>lambdaQuery()
.eq(EcologyFlowStationEntity::getCreateDept,deptId));
if(CollectionUtil.isEmpty(stations)){
return new ArrayList<>();
}
public List<TrendChartVo> trend_chart(String type) {
LambdaQueryWrapper<EcologyFlowDataEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()));
if("0".equals(type)){
wrapper.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy"));
}

25
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -452,6 +452,8 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
});
// 设备状态
this.getDeviceParam(emList, deviceClassifyMap, deviceList);
// 运行设备状态设置
this.deviceState(deviceList);
station.setDeviceList(deviceList.stream().sorted(Comparator.comparing((RealDeviceVo::getDeviceName))).collect(Collectors.toList()));
stationList.add(station);
});
@ -473,6 +475,29 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
}
/**
* 设备状态
* @param deviceList
*/
private void deviceState(List<RealDeviceVo> deviceList) {
deviceList.forEach(device->{
// 设备属性列表
List<RealAttributeVo> attbts = device.getAttbtList();
if(CollectionUtil.isEmpty(attbts)){
return;
}
// 功率属性记录
List<RealAttributeVo> powers = attbts.stream().filter(att-> HomePageConstant.powerList.contains(att.getName())).collect(Collectors.toList());
if(CollectionUtil.isEmpty(powers)){
return;
}
if("0.000000".equals(powers.get(0).getValue()) || "-".equals(powers.get(0).getValue()) || HomePageConstant.ON.equals(powers.get(0).getValue())){
return;
}
device.setState(1);
});
}
/**
* 设置站点状态
* @param alarmList
* @param station

3
hzims-service/weather/src/main/java/com/hnac/hzims/weather/mapper/StationMapper.java

@ -1,11 +1,12 @@
package com.hnac.hzims.weather.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.hzimsweather.entity.VStationEntity;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* @author hx
*/
public interface StationMapper extends UserDataScopeBaseMapper<VStationEntity> {
public interface StationMapper extends BaseMapper<VStationEntity> {
}

Loading…
Cancel
Save