Commit f3215d30 authored by tangwei's avatar tangwei

解决冲突

parents 839c055c 828839f4
......@@ -37,4 +37,6 @@ public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicato
int queryRunRecordTotal( @Param("list") String[] list);
Object getIndicatoralueTotal(String gateway,String indicator);
}
......@@ -77,6 +77,7 @@
<select id="queryRunRecord" resultType="com.yeejoin.amos.boot.module.jxiop.api.dto.RunRecord">
......@@ -113,8 +114,4 @@
</mapper>
......@@ -110,6 +110,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public IPage<RunRecord> queryRunRecord(long size,String[] gateway, int current){
Page<RunRecord> page = new Page<>(current, size);
......@@ -121,5 +122,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
/**
* 根据网关与指标获取指标的平均值
* @param gateway
* @param indicator
* @return
*/
public Object getIndicatoralueTotal(String gateway,String indicator){
return monitorFanIndicatorregionMapper.getIndicatoralueTotal(gateway,indicator);
}
}
......@@ -55,6 +55,7 @@ public class MonitoringServiceImpl {
*/
public List<RegionNationWideDto> getNationWideInfo(String provinceName){
List<RegionNationWideDto> regionNationWideDtoList= new ArrayList<>();
//如果 provinceName 为空则表示当前为全国地图 否则则为省份地图
if(ObjectUtils.isEmpty(provinceName)||provinceName.equals("")){
List<Region> regionList = this.regionMapper.selectList(new QueryWrapper<Region>().eq("level",1));
for (int i = 0; i < regionList.size(); i++) {
......@@ -66,6 +67,9 @@ public class MonitoringServiceImpl {
Region region = regionList.get(i);
List<StationBasic> list = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area",region.getRegionCode()));
list.forEach(stationBasic -> {
if(!ObjectUtils.isEmpty(stationBasic.getGatewayId())&&!ObjectUtils.isEmpty(stationBasic.getStationNumber())){
regionNationWideDto.setJsJoin(true);
}
if(stationBasic.getStationType().equals("FDZ")){
fengdianMW.set(getStationCaPACITYL(stationBasic.getStationNumber()));
fengdian.getAndSet(fengdian.get() + 1);
......@@ -88,8 +92,10 @@ public class MonitoringServiceImpl {
RegionNationWideDto regionNationWideDto =new RegionNationWideDto();
regionNationWideDto.setStaitionName(stationBasic.getStationName());
regionNationWideDto.setStaitionType(stationBasic.getStationType());
String speendOrirradiate = "";
if(stationBasic.getStationType().equals("FDZ")){
speendOrirradiate = (String) getIndicatoralueAvage(stationBasic.getGatewayId(),"30秒平均风速");
regionNationWideDto.setSpeendOrirradiate(speendOrirradiate);
}else{
regionNationWideDto.setSpeendOrirradiate(String.valueOf(Math.random()*1000));
}
......@@ -112,4 +118,38 @@ public class MonitoringServiceImpl {
public Double getStationCaPACITYL(String werks){
return this.SjglZsjZsbtzServiceImpl.getStationCapactityByStationWerks(werks);
}
/**
* 根据网关id以及指标值 获取同一网关下指标的平均值
* @param gateway 网关id
* @param indicatorcName 指标名称
* @return 同一网关下指标的平均值
*/
public Object getIndicatoralueAvage (String gateway ,String indicatorcName){
return this.monitorFanIndicatorImpl.getIndicatoralueAvage(gateway,indicatorcName);
}
/**
* 根据网关id以及指标值 同一网关下指标的值总和
* @param gateway 网关id
* @param indicatorcName 指标名称
* @return 同一网关下指标的值总和
*/
public Object getIndicatoralueTotal (String gateway ,String indicatorcName){
return this.monitorFanIndicatorImpl.getIndicatoralueTotal(gateway,indicatorcName);
}
public void getTotalSocialContribution(){
HashMap<String,Double> hashMap = new HashMap<>();
AtomicReference<Double> totalSocialContribution = new AtomicReference<>(0.0);
//获取所有网关id不为空的数据
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("gateway_id"));
stationBasicList.forEach(stationBasic -> {
totalSocialContribution.updateAndGet(v -> v + (Double) monitorFanIndicatorImpl.getIndicatoralueTotal(stationBasic.getStationNumber(), "年发电量"));
});
//
// hashMap.put("CO2",(totalSocialContribution * 0.3049)/1000000);
// hashMap.put("Coal",totalSocialContribution*);
// hashMap.put("Toner",totalSocialContribution*);
// hashMap.put("S02",totalSocialContribution*);
}
}
......@@ -45,24 +45,27 @@ public class StationDataTaskImpl {
@Autowired
MonitorFanIndicatorAsync monitorFanIndicatorAsync;
/**
* 获取 List<StationTaksDto>
* @return <StationTaksDto>
*/
public List<StationTaksDto> getListStationBasic() {
List<StationTaksDto> stationTaksDtoList = new ArrayList<>();
List<StationBasic> stationBasicList= stationBasicServiceImpl.list();
stationBasicList.forEach(stationBasic -> {
StationTaksDto stationTaksDto = new StationTaksDto();
stationTaksDto.setStationNumber(stationBasic.getStationNumber());
stationTaksDto.setGateway(stationBasic.getGatewayId());
stationTaksDtoList.add(stationTaksDto);
});
return stationTaksDtoList;
return stationBasicServiceImpl.getStationTaksDtoList();
}
/**
* @deprecated 获取该场站下所有的风机信息
* @param stationTaksDto
* @return List<DeviceDto> 设备信息列表
*/
public List<DeviceDto> getListDevice(StationTaksDto stationTaksDto) {
List<DeviceDto> deviceDtoList = new ArrayList<>();
//获取风机的字典id
TpriDmpDatabook tpriDmpDatabook = tpriDmpDatabookServiceImpl.getTpriDmpDatabookByDataName("风机");
//根据字典id与场站编码获取所有的风机列表
List<SjglZsjZsbtz> sjglZsjZsbtzList = sjglZsjZsbtzServiceImpl .getSjglZsjZsbtzList(tpriDmpDatabook.getDataid(),stationTaksDto.getStationNumber());
//遍历风机列表对于需要的参数进行组装
sjglZsjZsbtzList.forEach(sjglZsjZsbtz -> {
DeviceDto deviceDto = new DeviceDto();
deviceDto.setGateway(stationTaksDto.getGateway());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment