Commit 2bc59b4c authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents fd6430b7 970b0394
package com.yeejoin.amos.kgd.config;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
/**
* @Author: xl
* @Description:
* @Date: 2023/10/9 18:45
*/
@Configuration
public class SocketConfig {
@PostConstruct
public void init() {
}
}
...@@ -535,6 +535,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -535,6 +535,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//验证二维码 //验证二维码
UnitInfo unitInfo=new UnitInfo(); UnitInfo unitInfo=new UnitInfo();
unitInfo= unitInfoMapper.selectById(unitDataDto.getUnitInformation().getSequenceNbr()); unitInfo= unitInfoMapper.selectById(unitDataDto.getUnitInformation().getSequenceNbr());
UnitInformation unitInformation= unitDataDto.getUnitInformation(); UnitInformation unitInformation= unitDataDto.getUnitInformation();
JSONArray regionName = getRegionName(); JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class); List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
...@@ -575,6 +576,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -575,6 +576,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInformation.setHeadCardPhotoFrontUrl(unitInformation.getHeadCardPhotoFrontUrl()); unitInformation.setHeadCardPhotoFrontUrl(unitInformation.getHeadCardPhotoFrontUrl());
unitInformation.setRegisterPcdCodeList(unitInformation.getRegisterPcdCodeList()); unitInformation.setRegisterPcdCodeList(unitInformation.getRegisterPcdCodeList());
unitInformation.setWorkPcdCodeList(unitInformation.getWorkPcdCodeList()); unitInformation.setWorkPcdCodeList(unitInformation.getWorkPcdCodeList());
List<Long> dis= unitInformation.getRegionalCompaniesSeq();
List<String> disST= dis.stream().map(x->x+"").collect(Collectors.toList());
BeanUtils.copyProperties(unitInformation,unitInfo); BeanUtils.copyProperties(unitInformation,unitInfo);
CommerceInfo commerceInfo=new CommerceInfo(); CommerceInfo commerceInfo=new CommerceInfo();
commerceInfo= commerceInfoMapper.selectById(unitDataDto.getCommerceDto().getSequenceNbr()); commerceInfo= commerceInfoMapper.selectById(unitDataDto.getCommerceDto().getSequenceNbr());
...@@ -583,12 +587,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -583,12 +587,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
commerceDto.setLegalPersonCardPhotoBackUrl(commerceDto.getLegalPersonCardPhotoBackUrl()); commerceDto.setLegalPersonCardPhotoBackUrl(commerceDto.getLegalPersonCardPhotoBackUrl());
commerceDto.setLegalPersonCardPhotoFrontUrl(commerceDto.getLegalPersonCardPhotoFrontUrl()); commerceDto.setLegalPersonCardPhotoFrontUrl(commerceDto.getLegalPersonCardPhotoFrontUrl());
BeanUtils.copyProperties(commerceDto,commerceInfo); BeanUtils.copyProperties(commerceDto,commerceInfo);
unitInfo.setRegionalCompaniesSeq(disST);
unitInfoMapper.updateById(unitInfo); unitInfoMapper.updateById(unitInfo);
commerceInfoMapper.updateById(commerceInfo); commerceInfoMapper.updateById(commerceInfo);
//区域公司 //区域公司
LambdaQueryWrapper<RegionalCompanies> qu=new LambdaQueryWrapper<>(); LambdaQueryWrapper<RegionalCompanies> qu=new LambdaQueryWrapper<>();
qu.eq(RegionalCompanies::getUnitId,unitInfo.getSequenceNbr()); qu.eq(RegionalCompanies::getUnitId,unitInfo.getAmosCompanySeq());
regionalCompaniesMapper.delete(qu); regionalCompaniesMapper.delete(qu);
List<RegionalCompanies> regionalComp= new ArrayList<>(); List<RegionalCompanies> regionalComp= new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult= Privilege.companyClient.querySubAgencyTree(regionalCompanies); FeignClientResult<Collection<CompanyModel>> feignClientResult= Privilege.companyClient.querySubAgencyTree(regionalCompanies);
...@@ -598,7 +603,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -598,7 +603,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
for (Object aLong : lisd) { for (Object aLong : lisd) {
for (CompanyModel compan : companyModel) { for (CompanyModel compan : companyModel) {
if(compan.getSequenceNbr().longValue()==Long.valueOf(aLong.toString()).longValue()){ if(compan.getSequenceNbr().longValue()==Long.valueOf(aLong.toString()).longValue()){
RegionalCompanies re= new RegionalCompanies(Long.valueOf(aLong.toString()), compan.getCompanyName(), compan.getOrgCode(), unitInfo.getSequenceNbr()); RegionalCompanies re= new RegionalCompanies(Long.valueOf(aLong.toString()), compan.getCompanyName(), compan.getOrgCode(), unitInfo.getAmosCompanySeq());
regionalComp.add(re); regionalComp.add(re);
continue; continue;
} }
......
...@@ -3,6 +3,10 @@ package com.yeejoin.amos.boot.module.jxiop.api.mapper; ...@@ -3,6 +3,10 @@ package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.PersonAccount; import com.yeejoin.amos.boot.module.jxiop.api.entity.PersonAccount;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan; import com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/** /**
* @description: * @description:
...@@ -12,5 +16,13 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan; ...@@ -12,5 +16,13 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.StationPlan;
public interface StationPlanMapper extends BaseMapper<StationPlan> { public interface StationPlanMapper extends BaseMapper<StationPlan> {
// //获取当年全国没有 完成计划
// @Select("SELECT monthly ,sum(value) value from station_plan where year= #{year} GROUP BY monthly ")
// List<StationPlan> getStationPlanby(@Param("year") String year);
//
// //获取当年全国没有 完成计划
//
// @Select("SELECT monthly ,sum(value) value from station_plan where year= #{year} GROUP BY monthly ")
// List<StationPlan> getStationPlanbyids(@Param("year") String year);
} }
...@@ -41,6 +41,11 @@ ...@@ -41,6 +41,11 @@
<version>1.9.0-SNAPSHOT</version> <version>1.9.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>3.2.4</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.yeejoin.amos.boot.module.jxiop.biz.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import javax.sql.DataSource;
/**
* 从数据源配置
* 若需要配置更多数据源 , 直接在yml中添加数据源配置再增加相应的新的数据源配置类即可
*/
@Configuration
@MapperScan(basePackages = "com.yeejoin.amos.boot.module.jxiop.biz.tdmapper", sqlSessionFactoryRef = "taosSqlSessionFactory")
public class TdEngineConfig {
private Logger logger = LoggerFactory.getLogger(TdEngineConfig.class);
// 精确到 cluster 目录,以便跟其他数据源隔离
private static final String MAPPER_LOCATION = "classpath*:mapper/tdengine/*.xml";
@Value("${spring.db3.datasource.url}")
private String dbUrl;
@Value("${spring.db3.datasource.username}")
private String username;
@Value("${spring.db3.datasource.password}")
private String password;
@Value("${spring.db3.datasource.driver-class-name}")
private String driverClassName;
@Bean(name = "taosDataSource") //声明其为Bean实例
public DataSource clusterDataSource() {
DruidDataSource datasource = new DruidDataSource();
datasource.setUrl(this.dbUrl);
datasource.setUsername(username);
datasource.setPassword(password);
datasource.setDriverClassName(driverClassName);
return datasource;
}
@Bean(name = "taosTransactionManager")
public DataSourceTransactionManager clusterTransactionManager() {
return new DataSourceTransactionManager(clusterDataSource());
}
@Bean(name = "taosSqlSessionFactory")
public SqlSessionFactory clusterSqlSessionFactory(@Qualifier("taosDataSource") DataSource culsterDataSource)
throws Exception {
final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
sessionFactory.setDataSource(culsterDataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
.getResources(TdEngineConfig.MAPPER_LOCATION));
sessionFactory.setTypeAliasesPackage("com.yeejoin.amos.boot.module.jxiop.biz.entity");
//mybatis 数据库字段与实体类属性驼峰映射配置
sessionFactory.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);
return sessionFactory.getObject();
}
}
...@@ -4,9 +4,14 @@ import java.util.HashMap; ...@@ -4,9 +4,14 @@ import java.util.HashMap;
public class CommonConstans { public class CommonConstans {
//光伏发电量系数 //光伏发电量系数
public static final Double pvGenPoweActor = 0.00001; // public static final Double pvGenPoweActor = 0.00001;
public static final Double pvGenPoweActorDay = 0.1; // public static final Double pvGenPoweActorDay = 0.1;
public static final Double pvGenPoweActornew = 0.0001; // public static final Double pvGenPoweActornew = 0.0001;
public static final Double pvGenPoweActornew = 0.000001;
public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActorDay = 1.0;
public static final Double pvGenPoweActorYear = 0.0001;
// 风电站: // 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和 // (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和 // 装机容量=场站所有风机装机容量总和
...@@ -22,7 +27,7 @@ public class CommonConstans { ...@@ -22,7 +27,7 @@ public class CommonConstans {
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000 // 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000
public static final Double carbonDioxide = 0.997 * 10 / 10000; public static final Double carbonDioxide = 0.997 * 10 / 10000;
// 节约标准煤(万t)=发电量(万kW·h)*0.29 // 节约标准煤(万t)=发电量(万kW·h)*0.29
public static final Double standardCoal = 0.29/10000; public static final Double standardCoal = 0.29 / 10000;
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30 // 炭粉尘减排量(t)=发电量(万kW·h)*0.30
public static final Double toner = 0.30; public static final Double toner = 0.30;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51 // 二氧化硫减排量(t)=发电量(万kW·h)*1.51
...@@ -34,7 +39,7 @@ public class CommonConstans { ...@@ -34,7 +39,7 @@ public class CommonConstans {
//万Kwh转MV //万Kwh转MV
public static final Integer wkwhToMv = 10; public static final Integer wkwhToMv = 10;
//kw转MV //kw转MV
public static final Double kwToMv =0.0001 ; public static final Double kwToMv = 0.0001;
// 正常运行 发电状态=1 // 正常运行 发电状态=1
// 告警运行 报警状态=1 // 告警运行 报警状态=1
...@@ -92,7 +97,7 @@ public class CommonConstans { ...@@ -92,7 +97,7 @@ public class CommonConstans {
public static final String QueryStringDataType = "dataType"; public static final String QueryStringDataType = "dataType";
public static final String QueryStringDisplayName = "displayName"; public static final String QueryStringDisplayName = "displayName";
public static final String QueryStringIsAlarm = "isAlarm"; public static final String QueryStringIsAlarm = "isAlarm";
public static final String Twodecimalplaces= "%.2f"; public static final String Twodecimalplaces = "%.2f";
public static final String Fourdecimalplaces = "%.4f"; public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule"; public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
} }
...@@ -223,7 +223,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -223,7 +223,7 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId(); String gatewayId = stationBasic.getFanGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"}; String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"};
String[] columnLists = new String[]{"瞬时风速"}; String[] columnLists = new String[]{"30秒平均风速"};
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
for (String column : columnList) { for (String column : columnList) {
...@@ -232,7 +232,13 @@ public class MonitorFanIdxController extends BaseController { ...@@ -232,7 +232,13 @@ public class MonitorFanIdxController extends BaseController {
} }
for (String column : columnLists) { for (String column : columnLists) {
Double result = commonServiceImpl.getAvgvalueByIndicatior(gatewayId, column); Double result = commonServiceImpl.getAvgvalueByIndicatior(gatewayId, column);
columnMap.put(column, String.format("%.2f", result));
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("30秒平均风速"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
List<ESEquipments> result2 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put(column, String.format("%.2f", result2.get(0).getValueF()));
} }
Map<String, List<String>> queryCondtion1 = new HashMap<>(); Map<String, List<String>> queryCondtion1 = new HashMap<>();
...@@ -652,12 +658,9 @@ public class MonitorFanIdxController extends BaseController { ...@@ -652,12 +658,9 @@ public class MonitorFanIdxController extends BaseController {
for (String column : columnList) { for (String column : columnList) {
Double result = commonServiceImpl.getTotalByIndicatiorByGF(gatewayId, column); Double result = commonServiceImpl.getTotalByIndicatiorByGF(gatewayId, column);
if (column.equals("日发电量")) {
columnMap.put(column, String.format(CommonConstans.Fourdecimalplaces, result * CommonConstans.pvGenPoweActorDay));
} else {
columnMap.put(column, result); columnMap.put(column, result);
} }
}
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P", "WTX-801_25_WTX-801_总辐射累计", "WTX-801_25_WTX-801_总辐射", "313光差保护_总反向有功电度")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P", "WTX-801_25_WTX-801_总辐射累计", "WTX-801_25_WTX-801_总辐射", "313光差保护_总反向有功电度"));
...@@ -944,7 +947,7 @@ public class MonitorFanIdxController extends BaseController { ...@@ -944,7 +947,7 @@ public class MonitorFanIdxController extends BaseController {
monthMap.put("value",map.get("月发电量") == null?0:String.format("%.4f",Double.parseDouble(map.get("月发电量").toString())* CommonConstans.pvGenPoweActornew)); monthMap.put("value",map.get("月发电量") == null?0:String.format("%.4f",Double.parseDouble(map.get("月发电量").toString())* CommonConstans.pvGenPoweActornew));
yearMap.put("name",name); yearMap.put("name",name);
yearMap.put("gateWayId",stationBasic.getFanGatewayId()); yearMap.put("gateWayId",stationBasic.getFanGatewayId());
yearMap.put("value",map.get("年发电量") == null?0:String.format("%.4f",Double.parseDouble(map.get("年发电量").toString())* CommonConstans.pvGenPoweActornew)); yearMap.put("value",map.get("年发电量") == null?0:String.format("%.4f",Double.parseDouble(map.get("年发电量").toString())* CommonConstans.pvGenPoweActorYear));
datDataGF.add(dayMap); datDataGF.add(dayMap);
monthDataGF.add(monthMap); monthDataGF.add(monthMap);
yearDataGF.add(yearMap); yearDataGF.add(yearMap);
......
...@@ -10,10 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; ...@@ -10,10 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IMapRegionService; import com.yeejoin.amos.boot.module.jxiop.api.service.IMapRegionService;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.*; import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test; import com.yeejoin.amos.boot.module.jxiop.biz.entity.Test;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.*;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.RegionServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.StationBasicServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TestServiceImpl;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection; import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -43,6 +40,9 @@ public class MonitoringMapController extends BaseController { ...@@ -43,6 +40,9 @@ public class MonitoringMapController extends BaseController {
@Autowired @Autowired
MonitoringServiceImpl monitoringServiceImpl; MonitoringServiceImpl monitoringServiceImpl;
@Autowired
LargeScreenImpl largeScreenImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取监盘全国地图数据") @ApiOperation(value = "获取监盘全国地图数据")
...@@ -165,4 +165,29 @@ public class MonitoringMapController extends BaseController { ...@@ -165,4 +165,29 @@ public class MonitoringMapController extends BaseController {
public ResponseModel<HashMap<String, Object>> getTheStationPowerCurve(@RequestParam(required = false)String stationId,@RequestParam(required = false)String date) { public ResponseModel<HashMap<String, Object>> getTheStationPowerCurve(@RequestParam(required = false)String stationId,@RequestParam(required = false)String date) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTheStationPowerCurve(stationId,date)); return ResponseHelper.buildResponse(monitoringServiceImpl.getTheStationPowerCurve(stationId,date));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/getqgqs")
public ResponseModel<HashMap<String, List<String>>> getqgqs() {
largeScreenImpl.sendQYFDLMqttyfdqs();
largeScreenImpl.sendQYFDLMqttyfd();
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "监盘首页- 全国发电量趋势完成率")
@GetMapping("/getqyqs")
public ResponseModel<HashMap<String, List<String>>> getqyqs() {
largeScreenImpl.gettimedateyfdqs();
largeScreenImpl.gettimedateyfd();
return ResponseHelper.buildResponse(null);
}
} }
package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import lombok.Data;
import java.util.Date;
@Data
public class IndicatorData {
private String id;
private String address;
private String dataType;
private String equipmentSpecificName;
private String gatewayId;
private String isAlarm;
private Date createdTime;
private String unit;
private String value;
private Float valueF ;
private String valueLabel;
private String equipmentIndexName;
private String equipmentNumber;
private String displayName;
}
...@@ -406,6 +406,12 @@ public class CommonServiceImpl { ...@@ -406,6 +406,12 @@ public class CommonServiceImpl {
} catch (Exception e) { } catch (Exception e) {
return totalvalue; return totalvalue;
} }
if(indicator.equals("日发电量")){
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor*CommonConstans.pvGenPoweActorDay));
}
if (indicator.equals("年发电量")){
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActorYear));
}
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor)); return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor));
} }
......
...@@ -651,10 +651,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -651,10 +651,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String,Object> map1 = new HashMap<>(); Map<String,Object> map1 = new HashMap<>();
Map<String,Object> map2 = new HashMap<>(); Map<String,Object> map2 = new HashMap<>();
map1.put("data", values); map1.put("data", values);
if (StringUtils.isNotEmpty(gatewayId)){ // if (StringUtils.isNotEmpty(gatewayId)){
map2.put("data", valueList); // map2.put("data", valueList);
seriesData.add(map2); // seriesData.add(map2);
} // }
seriesData.add(map1); seriesData.add(map1);
map.put("seriesData", seriesData); map.put("seriesData", seriesData);
map.put("axisData",time); map.put("axisData",time);
......
...@@ -888,13 +888,13 @@ public class MonitoringServiceImpl { ...@@ -888,13 +888,13 @@ public class MonitoringServiceImpl {
stringHashMap5.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfMonthFD.get()) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew)); stringHashMap5.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfMonthFD.get()) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew));
list1.add(stringHashMap5); list1.add(stringHashMap5);
HashMap<String, String> stringHashMap6 = new HashMap<>(); HashMap<String, String> stringHashMap6 = new HashMap<>();
stringHashMap6.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfAnnualFD.get()) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew)); stringHashMap6.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfAnnualFD.get()) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfAnnualGF.get() * CommonConstans.pvGenPoweActorYear));
list1.add(stringHashMap6); list1.add(stringHashMap6);
HashMap<String, String> stringHashMap7 = new HashMap<>(); HashMap<String, String> stringHashMap7 = new HashMap<>();
stringHashMap7.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfAnnualFD.get()/fdzValue ) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfAnnualGF.get()*CommonConstans.pvGenPoweActornew/gfvalue)); stringHashMap7.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfAnnualFD.get()/fdzValue ) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfAnnualGF.get()*CommonConstans.pvGenPoweActorYear/gfvalue));
list1.add(stringHashMap7); list1.add(stringHashMap7);
HashMap<String, String> stringHashMap8 = new HashMap<>(); HashMap<String, String> stringHashMap8 = new HashMap<>();
stringHashMap8.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() * CommonConstans.wkwhToMv) / fdzInstall.doubleValue()) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew * CommonConstans.wkwhToMv) / gfInstall.doubleValue())); stringHashMap8.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() * CommonConstans.wkwhToMv) / fdzInstall.doubleValue()) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF.get() * CommonConstans.pvGenPoweActorYear * CommonConstans.wkwhToMv) / gfInstall.doubleValue()));
list1.add(stringHashMap8); list1.add(stringHashMap8);
page1.setRecords(list1); page1.setRecords(list1);
HashMap<String, String> stringHashMap9 = new HashMap<>(); HashMap<String, String> stringHashMap9 = new HashMap<>();
...@@ -908,15 +908,15 @@ public class MonitoringServiceImpl { ...@@ -908,15 +908,15 @@ public class MonitoringServiceImpl {
resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces, (powerOfMonthFD.get() + powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew)/moonValue* 100)); resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces, (powerOfMonthFD.get() + powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew)/moonValue* 100));
list2.add(stringHashMap10); list2.add(stringHashMap10);
HashMap<String, String> stringHashMap11 = new HashMap<>(); HashMap<String, String> stringHashMap11 = new HashMap<>();
stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew)); stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActorYear));
resultMap.put("Year",String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew)); resultMap.put("Year",String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActorYear));
list2.add(stringHashMap11); list2.add(stringHashMap11);
HashMap<String, String> stringHashMap12 = new HashMap<>(); HashMap<String, String> stringHashMap12 = new HashMap<>();
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() + powerOfAnnualGF.get()*CommonConstans.pvGenPoweActornew) /yearValue* 100)); stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() + powerOfAnnualGF.get()*CommonConstans.pvGenPoweActorYear) /yearValue* 100));
resultMap.put("NJHWC",String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() + powerOfAnnualGF.get()*CommonConstans.pvGenPoweActornew) /yearValue* 100)); resultMap.put("NJHWC",String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() + powerOfAnnualGF.get()*CommonConstans.pvGenPoweActorYear) /yearValue* 100));
list2.add(stringHashMap12); list2.add(stringHashMap12);
page2.setRecords(list2); page2.setRecords(list2);
Double totalAnnual = (powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew); Double totalAnnual = (powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActorYear);
HashMap<String, String> stringHashMap13 = new HashMap<>(); HashMap<String, String> stringHashMap13 = new HashMap<>();
stringHashMap13.put("title", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide))); stringHashMap13.put("title", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide)));
stringHashMap13.put("unit", "二氧化碳减排量(万t)"); stringHashMap13.put("unit", "二氧化碳减排量(万t)");
......
package com.yeejoin.amos.boot.module.jxiop.biz.tdmapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
@Select("select LAST(address)address,LAST(gateway_id)gatewayId,LAST(data_type)dataType,LAST(equipment_index_name)equipmentIndexName,LAST(`value_f`)valueF,LAST(equipment_number)equipmentNumber,LAST(created_time)createdTime from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and gateway_id =#{gatewayId} and ts >=#{startTime} and ts <=#{endTime} group by address ")
List<IndicatorData> selectlastfd(@Param("equipmentIndexName") String equipmentIndexName,@Param("gatewayId") String gatewayId,@Param("startTime") String startTime, @Param("endTime") String endTime);
@Select("select LAST(address)address,LAST(gateway_id)gatewayId,LAST(data_type)dataType,LAST(equipment_index_name)equipmentIndexName,LAST(`value_f`)valueF,LAST(equipment_number)equipmentNumber,LAST(created_time)createdTime from iot_data.indicator_data where equipment_specific_name like '%逆变器%' and equipment_index_name =#{equipmentIndexName} and gateway_id =#{gatewayId} and ts >=#{startTime} and ts <=#{endTime} group by address ")
List<IndicatorData> selectlastgf(@Param("equipmentIndexName") String equipmentIndexName,@Param("gatewayId") String gatewayId,@Param("startTime") String startTime, @Param("endTime") String endTime);
}
...@@ -12,6 +12,13 @@ spring.db2.datasource.username=root ...@@ -12,6 +12,13 @@ spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020 spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
spring.db3.datasource.url=jdbc:TAOS-RS://139.9.170.47:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db3.datasource.username=root
spring.db3.datasource.password=taosdata
spring.db3.datasource.driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
## eureka properties: ## eureka properties:
eureka.instance.hostname=172.16.10.220 eureka.instance.hostname=172.16.10.220
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"url": "upload/jxiop/amos_studio/6CE2792ABEEAE816CB798649A6796.png" "url": "upload/jxiop/amos_studio/6CE2792ABEEAE816CB798649A6796.png"
}, },
{ {
"title": "瞬时风速", "title": "30秒平均风速",
"title1": "平均风速(m/s)", "title1": "平均风速(m/s)",
"url": "upload/jxiop/amos_studio/3B66742AAB2FEB0F5CEC10DA50156F.png" "url": "upload/jxiop/amos_studio/3B66742AAB2FEB0F5CEC10DA50156F.png"
}, },
......
package com.yeejoin.amos.boot.module.jxiop.biz.constants; package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C; import org.checkerframework.checker.units.qual.C;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
public class CommonConstans { public class CommonConstans {
//光伏发电量系数 //光伏发电量系数
public static final Double pvGenPoweActor = 0.0001; public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActorDay = 0.01; public static final Double pvGenPoweActorDay = 1.0;
public static final Double pvGenPoweActorYear = 0.0001;
public static final Double pvGenPoweActorCurrentData = 0.0001;
// 风电站: // 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和 // (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和 // 装机容量=场站所有风机装机容量总和
...@@ -17,25 +23,30 @@ public class CommonConstans { ...@@ -17,25 +23,30 @@ public class CommonConstans {
// 装机容量=场站所有逆变器装机容量总和 // 装机容量=场站所有逆变器装机容量总和
// //
// 通用: // 通用:
// 发电量完成率=(月/年)发电量/(月/年)发电量指标 // ◎节省标准煤:发电量0.410
// 小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标 // ◎节省千克原煤:发电量0.559810
// 可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW) // ◎减排千克“二氧化碳”:发电量0.99710
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000 // ◎减排千克“碳粉尘”:发电量0.27210
public static final Double carbonDioxide = 0.997 * 10 / 10000; // ◎减排千克二氧化硫:发电量0.0310
// 节约标准煤(万t)=发电量(万kW·h)*0.29 // ◎减排千克氮氧化物:发电量0.01510
public static final Double standardCoal = 0.29/10000; // 二氧化碳
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30 public static final Double carbonDioxide = 0.997 * 10;
public static final Double toner = 0.30; //标准煤
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51 public static final Double standardCoal = 0.4 * 10;
public static final Double sulfurDioxide = 1.51; //炭粉尘减排量
// 氮氧化物减排量(t)=发电量(万kW·h)*1.69 public static final Double toner = 0.272 * 10;
public static final Double oxynitride = 1.69; //二氧化硫减排量
public static final Double sulfurDioxide = 0.03 * 10;
//氮氧化物减排量
public static final Double oxynitride = 0.015 * 10;
//千克转吨
public static final Double kgToT = 0.001;
//吨转万吨 //吨转万吨
public static final Double tToWT = 0.0001; public static final Double tToWT = 0.0001;
//万Kwh转MV //万Kwh转MV
public static final Integer wkwhToMv = 10; public static final Integer wkwhToMv = 10;
//kw转MV //kw转MV
public static final Double kwToMv =0.0001 ; public static final Double kwToMv = 0.0001;
// 正常运行 发电状态=1 // 正常运行 发电状态=1
...@@ -103,7 +114,13 @@ public class CommonConstans { ...@@ -103,7 +114,13 @@ public class CommonConstans {
public static final String QueryStringDisplayNameKeyword = "displayName.keyword"; public static final String QueryStringDisplayNameKeyword = "displayName.keyword";
public static final String QueryStringIsAlarm = "isAlarm"; public static final String QueryStringIsAlarm = "isAlarm";
public static final String QueryStringIsAlarmKeyword = "isAlarm.keyword"; public static final String QueryStringIsAlarmKeyword = "isAlarm.keyword";
public static final String Twodecimalplaces= "%.2f"; public static final String Twodecimalplaces = "%.2f";
public static final String Fourdecimalplaces = "%.4f"; public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule"; public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
//泰和的发电量数据
public static final List<String> taiHeGenIndicator = new ArrayList<>(Arrays.asList("泰和日发电量总和", "泰和月发电量总和", "泰和年发电量总和"));
public static final String taiHeGenIndicatorDay = "泰和日发电量总和";
public static final String taiHeGenIndicatorMonth = "泰和月发电量总和";
public static final String taiHeGenIndicatorYear = "泰和年发电量总和";
} }
...@@ -226,16 +226,15 @@ public class MonitorFanIdxController extends BaseController { ...@@ -226,16 +226,15 @@ public class MonitorFanIdxController extends BaseController {
// } // }
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("30秒平均风速", "日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("30秒平均风速", "日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
List<ESEquipments> result2 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result2 = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put( "日发电量",String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "日发电量"))); columnMap.put("日发电量", String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "日发电量")));
columnMap.put( "月发电量",String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "月发电量"))); columnMap.put("月发电量", String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "月发电量")));
columnMap.put( "年发电量",String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "年发电量"))); columnMap.put("年发电量", String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result2, "年发电量")));
columnMap.put( "30秒平均风速",String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result2, "30秒平均风速"))); columnMap.put("30秒平均风速", String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getAvagerByEquipmentIndxName(result2, "30秒平均风速")));
Map<String, List<String>> queryCondtion1 = new HashMap<>(); Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值")); queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
...@@ -615,34 +614,22 @@ public class MonitorFanIdxController extends BaseController { ...@@ -615,34 +614,22 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId(); String gatewayId = stationBasic.getFanGatewayId();
String boosterGatewayId = stationBasic.getBoosterGatewayId(); String boosterGatewayId = stationBasic.getBoosterGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"}; String[] columnList = new String[]{CommonConstans.taiHeGenIndicatorDay, CommonConstans.taiHeGenIndicatorMonth, CommonConstans.taiHeGenIndicatorYear};
String[] columnLists = new String[]{"有功功率"}; String[] columnLists = new String[]{"有功功率"};
Map<String, Object> columnMap = new HashMap<>(); Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据 //日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList; List<Map<String, Object>> mapList;
for (String column : columnList) { for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column); Double result = commonService.getTotalByIndicatiorByGF(boosterGatewayId, column);
if (column.equals("日发电量")) {
columnMap.put(column, String.format(CommonConstans.Fourdecimalplaces, result * CommonConstans.pvGenPoweActorDay));
} else {
columnMap.put(column, result); columnMap.put(column, result);
} }
}
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P", "WTX-801_25_WTX-801_总辐射累计", "WTX-801_25_WTX-801_总辐射", "313光差保护_总反向有功电度")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P", "WTX-801_25_WTX-801_总辐射累计", "WTX-801_25_WTX-801_总辐射", "313光差保护_总反向有功电度"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class); List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
columnMap.put("有功功率", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P") * CommonConstans.kwToMv*10)); columnMap.put("有功功率", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P") * CommonConstans.kwToMv * 10));
// mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
String num = monitorFanIndicator.getEquipCount(gatewayId, "GF"); String num = monitorFanIndicator.getEquipCount(gatewayId, "GF");
columnMap.put("风机台数", num); columnMap.put("风机台数", num);
...@@ -654,25 +641,25 @@ public class MonitorFanIdxController extends BaseController { ...@@ -654,25 +641,25 @@ public class MonitorFanIdxController extends BaseController {
data.put("title", columnMap.get("装机容量").toString()); data.put("title", columnMap.get("装机容量").toString());
objects.add(data); objects.add(data);
Map<String, Object> data1 = new HashMap<>(); Map<String, Object> data1 = new HashMap<>();
data1.put("title", columnMap.get("日发电量").toString()); data1.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString());
objects.add(data1); objects.add(data1);
Map<String, Object> data2 = new HashMap<>(); Map<String, Object> data2 = new HashMap<>();
data2.put("title", columnMap.get("风机台数").toString().replace(".0", "")); data2.put("title", columnMap.get("风机台数").toString().replace(".0", ""));
objects.add(data2); objects.add(data2);
Map<String, Object> data3 = new HashMap<>(); Map<String, Object> data3 = new HashMap<>();
data3.put("title", columnMap.get("月发电量").toString()); data3.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorMonth).toString());
objects.add(data3); objects.add(data3);
Map<String, Object> data4 = new HashMap<>(); Map<String, Object> data4 = new HashMap<>();
data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射"))); data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
objects.add(data4); objects.add(data4);
Map<String, Object> data5 = new HashMap<>(); Map<String, Object> data5 = new HashMap<>();
data5.put("title", columnMap.get("年发电量").toString()); data5.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorYear).toString());
objects.add(data5); objects.add(data5);
Map<String, Object> data6 = new HashMap<>(); Map<String, Object> data6 = new HashMap<>();
data6.put("title", columnMap.get("有功功率").toString()); data6.put("title", columnMap.get("有功功率").toString());
objects.add(data6); objects.add(data6);
Map<String, Object> data7 = new HashMap<>(); Map<String, Object> data7 = new HashMap<>();
data7.put("title", String.format("%.2f", ((Double.parseDouble(columnMap.get("日发电量").toString()) * CommonConstans.wkwhToMv) / (Double.parseDouble(columnMap.get("装机容量").toString()))))); data7.put("title", String.format("%.2f", ((Double.parseDouble(columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString()) * CommonConstans.wkwhToMv) / (Double.parseDouble(columnMap.get("装机容量").toString())))));
objects.add(data7); objects.add(data7);
Map<String, Object> data8 = new HashMap<>(); Map<String, Object> data8 = new HashMap<>();
data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计"))); data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计")));
......
...@@ -235,18 +235,16 @@ public class CommonServiceImpl { ...@@ -235,18 +235,16 @@ public class CommonServiceImpl {
//用于组装-es查询条件 //用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> likeQuerCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator)); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
Double totalvalue = 0.00; Double totalvalue = 0.00;
try { try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum(); totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) { } catch (Exception e) {
return totalvalue; return totalvalue;
} }
return Double.valueOf(String.format("%.4f", totalvalue * CommonConstans.pvGenPoweActor)); return Double.valueOf(String.format("%.4f", totalvalue ));
} }
public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) { public Double getTotalByIndicatiorAndParams(String gatewayId, String indicator, String querySql) {
...@@ -364,17 +362,17 @@ public class CommonServiceImpl { ...@@ -364,17 +362,17 @@ public class CommonServiceImpl {
二氧化硫减排量(t)=发电量(万kW·h)*1.51 二氧化硫减排量(t)=发电量(万kW·h)*1.51
氮氧化物减排量(t)=发电量(万kW·h)*1.69 氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/ */
co2.setUnit("二氧化碳减排量(t)"); co2.setUnit("二氧化碳减排量(t)");
co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide)); co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide*CommonConstans.kgToT));
socialContributionDtoList.add(co2); socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(t)"); coal.setUnit("节约标准煤(t)");
coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal))); coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal*CommonConstans.kgToT)));
socialContributionDtoList.add(coal); socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(t)"); toner.setUnit("碳粉尘减排量(t)");
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner * CommonConstans.tToWT))); toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner * CommonConstans.kgToT)));
socialContributionDtoList.add(toner); socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(t)"); so2.setUnit("二氧化硫减排量(t)");
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide * CommonConstans.tToWT))); so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide * CommonConstans.kgToT)));
socialContributionDtoList.add(so2); socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList); socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100); socialContributionDtoPage.setTotal(100);
......
...@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
} }
if (powerOther.contains(esEquipments.getEquipmentIndexName())) { if (powerOther.contains(esEquipments.getEquipmentIndexName())) {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor)); esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActorCurrentData));
} }
}); });
} }
...@@ -1600,7 +1600,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1600,7 +1600,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
return s; return s;
} }
public String keepFourDecimalPlaces(String value) {
String s = "0.0000";
if (!ObjectUtils.isEmpty(value)) {
try {
s = String.format(CommonConstans.Fourdecimalplaces, Double.parseDouble(value));
} catch (Exception ex) {
}
}
return s;
}
public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) { public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
...@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
break; break;
case "日发电量": case "日发电量":
double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor; double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v))); map.put("dayNum", keepFourDecimalPlaces(String.valueOf(v)));
break; break;
case "总发电量": case "总发电量":
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor; double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActorCurrentData;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a))); map.put("yearNum", keepFourDecimalPlaces(String.valueOf(a)));
break; break;
} }
}); });
......
...@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl { ...@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl {
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量")); totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion); totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
} }
}); });
Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get()); Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get());
...@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl { ...@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl {
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"))); annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else { } else {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量")); queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId())); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>(); List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器"); dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay) ));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion); monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)); annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear) ));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
} }
}); });
......
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