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
//验证二维码
UnitInfo unitInfo=new UnitInfo();
unitInfo= unitInfoMapper.selectById(unitDataDto.getUnitInformation().getSequenceNbr());
UnitInformation unitInformation= unitDataDto.getUnitInformation();
JSONArray regionName = getRegionName();
List<RegionModel> list = JSONArray.parseArray(regionName.toJSONString(), RegionModel.class);
......@@ -575,6 +576,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInformation.setHeadCardPhotoFrontUrl(unitInformation.getHeadCardPhotoFrontUrl());
unitInformation.setRegisterPcdCodeList(unitInformation.getRegisterPcdCodeList());
unitInformation.setWorkPcdCodeList(unitInformation.getWorkPcdCodeList());
List<Long> dis= unitInformation.getRegionalCompaniesSeq();
List<String> disST= dis.stream().map(x->x+"").collect(Collectors.toList());
BeanUtils.copyProperties(unitInformation,unitInfo);
CommerceInfo commerceInfo=new CommerceInfo();
commerceInfo= commerceInfoMapper.selectById(unitDataDto.getCommerceDto().getSequenceNbr());
......@@ -583,12 +587,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
commerceDto.setLegalPersonCardPhotoBackUrl(commerceDto.getLegalPersonCardPhotoBackUrl());
commerceDto.setLegalPersonCardPhotoFrontUrl(commerceDto.getLegalPersonCardPhotoFrontUrl());
BeanUtils.copyProperties(commerceDto,commerceInfo);
unitInfo.setRegionalCompaniesSeq(disST);
unitInfoMapper.updateById(unitInfo);
commerceInfoMapper.updateById(commerceInfo);
//区域公司
LambdaQueryWrapper<RegionalCompanies> qu=new LambdaQueryWrapper<>();
qu.eq(RegionalCompanies::getUnitId,unitInfo.getSequenceNbr());
qu.eq(RegionalCompanies::getUnitId,unitInfo.getAmosCompanySeq());
regionalCompaniesMapper.delete(qu);
List<RegionalCompanies> regionalComp= new ArrayList<>();
FeignClientResult<Collection<CompanyModel>> feignClientResult= Privilege.companyClient.querySubAgencyTree(regionalCompanies);
......@@ -598,7 +603,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
for (Object aLong : lisd) {
for (CompanyModel compan : companyModel) {
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);
continue;
}
......
......@@ -3,6 +3,10 @@ package com.yeejoin.amos.boot.module.jxiop.api.mapper;
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.StationPlan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @description:
......@@ -12,5 +16,13 @@ import com.yeejoin.amos.boot.module.jxiop.api.entity.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 @@
<version>1.9.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.taosdata.jdbc</groupId>
<artifactId>taos-jdbcdriver</artifactId>
<version>3.2.4</version>
</dependency>
</dependencies>
<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;
public class CommonConstans {
//光伏发电量系数
public static final Double pvGenPoweActor = 0.00001;
public static final Double pvGenPoweActorDay = 0.1;
public static final Double pvGenPoweActornew = 0.0001;
// public static final Double pvGenPoweActor = 0.00001;
// public static final Double pvGenPoweActorDay = 0.1;
// 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 {
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000
public static final Double carbonDioxide = 0.997 * 10 / 10000;
// 节约标准煤(万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
public static final Double toner = 0.30;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51
......@@ -34,7 +39,7 @@ public class CommonConstans {
//万Kwh转MV
public static final Integer wkwhToMv = 10;
//kw转MV
public static final Double kwToMv =0.0001 ;
public static final Double kwToMv = 0.0001;
// 正常运行 发电状态=1
// 告警运行 报警状态=1
......@@ -92,7 +97,7 @@ public class CommonConstans {
public static final String QueryStringDataType = "dataType";
public static final String QueryStringDisplayName = "displayName";
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 QueryStringFrontMoudleNotKeyWord = "frontModule";
}
......@@ -223,7 +223,7 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"};
String[] columnLists = new String[]{"瞬时风速"};
String[] columnLists = new String[]{"30秒平均风速"};
Map<String, Object> columnMap = new HashMap<>();
for (String column : columnList) {
......@@ -232,7 +232,13 @@ public class MonitorFanIdxController extends BaseController {
}
for (String column : columnLists) {
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<>();
......@@ -652,12 +658,9 @@ public class MonitorFanIdxController extends BaseController {
for (String column : columnList) {
Double result = commonServiceImpl.getTotalByIndicatiorByGF(gatewayId, column);
if (column.equals("日发电量")) {
columnMap.put(column, String.format(CommonConstans.Fourdecimalplaces, result * CommonConstans.pvGenPoweActorDay));
} else {
columnMap.put(column, result);
}
}
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光差保护_总反向有功电度"));
......@@ -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));
yearMap.put("name",name);
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);
monthDataGF.add(monthMap);
yearDataGF.add(yearMap);
......
......@@ -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.biz.dto.*;
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.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.boot.module.jxiop.biz.service.impl.*;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -43,6 +40,9 @@ public class MonitoringMapController extends BaseController {
@Autowired
MonitoringServiceImpl monitoringServiceImpl;
@Autowired
LargeScreenImpl largeScreenImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "获取监盘全国地图数据")
......@@ -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) {
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 {
} catch (Exception e) {
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));
}
......
......@@ -120,7 +120,7 @@ public class LargeScreenImpl {
mapdta.put("YFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActornew)));
break;
case NFD:
mapdta.put("NFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActornew)));
mapdta.put("NFD", Double.valueOf(format2.format(parsedSum.getValue()*CommonConstans.pvGenPoweActorYear)));
break;
default:
break;
......@@ -245,15 +245,15 @@ public class LargeScreenImpl {
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActornew));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActornew));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActorYear));
}
}
mapdta.put("RSD", dailyPower.get());
mapdta.put("YFD", monthlyPower.get());
mapdta.put("NFD", annualPower.get());
mapdta.put("RSD", keepFourdecimalPlaces(dailyPower.get()));
mapdta.put("YFD", keepFourdecimalPlaces(monthlyPower.get()));
mapdta.put("NFD", keepFourdecimalPlaces(annualPower.get()));
// //总和
......@@ -306,6 +306,7 @@ public class LargeScreenImpl {
ybfbn = new BigDecimal(ybfbn).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
mapdta.put("NJHWC", ybfbn);
try {
System.out.println(JSON.toJSONString(mapdta));
emqKeeper.getMqttClient().publish("qyyxzb/"+s, JSON.toJSONString(mapdta).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
......@@ -417,13 +418,13 @@ public class LargeScreenImpl {
List<String> value=new ArrayList<>();
value.add(RSD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName",value);
map.put("equipmentIndexName.keyword",value);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("moon",value1);
map.put("moon.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day", ESDailyPowerGeneration.class);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword", ESDailyPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
......@@ -466,13 +467,13 @@ public class LargeScreenImpl {
List<String> value=new ArrayList<>();
value.add(RSD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName",value);
map.put("gatewayId", gatewayId);
map.put("equipmentIndexName.keyword",value);
map.put("gatewayId.keyword", gatewayId);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("moon",value1);
map.put("moon.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day",ESDailyPowerGeneration.class);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword",ESDailyPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
......@@ -503,10 +504,318 @@ public class LargeScreenImpl {
//全国月发电量趋势
@Scheduled(cron = "0/10 * * * * ?")
public List<Double> gettimedateyfd( ){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(new Date());
List<Double> listdate= new ArrayList<>();
List<String> value=new ArrayList<>();
value.add(YFD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName.keyword",value);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("year.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword", ESMoonPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
for (Terms.Bucket bucket : lidate) {
Aggregations aggregation= bucket.getAggregations();
List<Aggregation> listdata= Objects.nonNull(aggregation)?aggregation.asList():null;
for (Aggregation agg : listdata) {
ParsedSum parsedSum =(ParsedSum)agg;
mapdta.put(bucket.getKeyAsString(), Double.valueOf(format2.format(parsedSum.getValue())));
}
}
//组装数据
List<String> list= yueReport();
for (String s : list) {
if(mapdta!=null&&mapdta.containsKey(s)){
listdate.add(mapdta.get(s));
}else{
listdate.add(0d);
}
}
Map<String,Object> mapjn=new HashMap<>();
mapjn.put("seriesData",listdate);
mapjn.put("axisData",list);
try {
System.out.println(JSON.toJSONString(mapjn));
emqKeeper.getMqttClient().publish("topic_yfd", JSON.toJSONString(mapjn).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
}
return listdate;
}
//区域月发电量趋势
//获取区域月日发电量
@Scheduled(cron = "0/10 * * * * ?")
public void sendQYFDLMqttyfd(){
List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
Map<String, List<StationCacheInfoDto>> belongAreaList = listStationCacheInfoDto.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getBelongArea));
for (String s : belongAreaList.keySet()) {
List<String> ids = belongAreaList.get(s).stream().map(StationCacheInfoDto::getFanGatewayId).collect(Collectors.toList());
gettimedateqyyfd(new Date(),ids,s);
}
}
public List<Double> gettimedateqyyfd( Date date,List<String> gatewayId,String areaCode){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(date);
List<Double> listdate= new ArrayList<>();
List<String> value=new ArrayList<>();
value.add(YFD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName.keyword",value);
map.put("gatewayId.keyword", gatewayId);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("year.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword",ESMoonPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
for (Terms.Bucket bucket : lidate) {
Aggregations aggregation= bucket.getAggregations();
List<Aggregation> listdata= Objects.nonNull(aggregation)?aggregation.asList():null;
for (Aggregation agg : listdata) {
ParsedSum parsedSum =(ParsedSum)agg;
mapdta.put(bucket.getKeyAsString(), Double.valueOf(format2.format(parsedSum.getValue())));
}
}
//组装数据
List<String> list= yueReport();
for (String s : list) {
if(mapdta!=null&&mapdta.containsKey(s)){
listdate.add(mapdta.get(s));
}else{
listdate.add(0d);
}
}
Map<String,Object> mapjn=new HashMap<>();
mapjn.put("seriesData",listdate);
mapjn.put("axisData",list);
try {
System.out.println(JSON.toJSONString(mapjn));
emqKeeper.getMqttClient().publish("qyyfd/fdqs/"+areaCode, JSON.toJSONString(mapjn).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
}
return listdate;
}
//全国发电完成趋势
@Scheduled(cron = "0/10 * * * * ?")
public List<Double> gettimedateyfdqs( ){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(new Date());
List<Double> listdate= new ArrayList<>();
List<String> value=new ArrayList<>();
value.add(YFD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName.keyword",value);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("year.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword", ESMoonPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
for (Terms.Bucket bucket : lidate) {
Aggregations aggregation= bucket.getAggregations();
List<Aggregation> listdata= Objects.nonNull(aggregation)?aggregation.asList():null;
for (Aggregation agg : listdata) {
ParsedSum parsedSum =(ParsedSum)agg;
mapdta.put(bucket.getKeyAsString(), Double.valueOf(format2.format(parsedSum.getValue())));
}
}
//计划完成量
Map<String,Double> mapwc=new HashMap<>();
QueryWrapper<StationPlan> wrapper = new QueryWrapper<>();
wrapper.select(" monthly ,sum(value) value ");
wrapper.eq("year", monthy);
wrapper.groupBy("monthly");
List<Map<String, Object>> list1 = StationPlanMapper.selectMaps(wrapper);
for (Map<String, Object> stringObjectMap : list1) {
mapwc.put(stringObjectMap.get("monthly").toString(),Double.valueOf(stringObjectMap.get("value").toString()));
}
//组装数据
List<String> list= yueReport();
for (String s : list) {
if(mapdta!=null&&mapdta.containsKey(s)){
if (mapwc!=null&&mapwc.containsKey(s)){
listdate.add(Double.valueOf(format2.format(mapdta.get(s)/mapwc.get(s)*100)));
}else{
listdate.add(0d);
}
}else{
listdate.add(0d);
}
}
Map<String,Object> mapjn=new HashMap<>();
mapjn.put("seriesData",listdate);
mapjn.put("axisData",list);
try {
System.out.println(JSON.toJSONString(mapjn));
emqKeeper.getMqttClient().publish("topic_yfdqs", JSON.toJSONString(mapjn).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
}
return listdate;
}
//区域发电完成趋势
@Scheduled(cron = "0/10 * * * * ?")
public void sendQYFDLMqttyfdqs(){
List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
Map<String, List<StationCacheInfoDto>> belongAreaList = listStationCacheInfoDto.stream().collect(Collectors.groupingBy(StationCacheInfoDto::getBelongArea));
for (String s : belongAreaList.keySet()) {
List<String> ids = belongAreaList.get(s).stream().map(StationCacheInfoDto::getFanGatewayId).collect(Collectors.toList());
List<String> idsStationId = belongAreaList.get(s).stream().map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
gettimedateqyyfdqs(new Date(),ids,s,idsStationId);
}
}
public List<Double> gettimedateqyyfdqs( Date date,List<String> gatewayId,String areaCode,List<String> idsStationId){
SimpleDateFormat myFmt2=new SimpleDateFormat("yyyy");
String monthy= myFmt2.format(date);
List<Double> listdate= new ArrayList<>();
List<String> value=new ArrayList<>();
value.add(YFD);
Map<String,List<String>> map=new HashMap<>();
map.put("equipmentIndexName.keyword",value);
map.put("gatewayId.keyword", gatewayId);
List<String> value1=new ArrayList<>();
value1.add(monthy);
map.put("year.keyword",value1);
List<? extends Terms.Bucket> lidate= commonServiceImpl.getgroupsum(map,"value" ,"day.keyword",ESMoonPowerGeneration.class);
Map<String,Double> mapdta=new HashMap<>();
DecimalFormat format2 = new DecimalFormat("#.0000");
for (Terms.Bucket bucket : lidate) {
Aggregations aggregation= bucket.getAggregations();
List<Aggregation> listdata= Objects.nonNull(aggregation)?aggregation.asList():null;
for (Aggregation agg : listdata) {
ParsedSum parsedSum =(ParsedSum)agg;
mapdta.put(bucket.getKeyAsString(), Double.valueOf(format2.format(parsedSum.getValue())));
}
}
//计划完成量
Map<String,Double> mapwc=new HashMap<>();
QueryWrapper<StationPlan> wrapper = new QueryWrapper<>();
wrapper.select(" monthly ,sum(value) value ");
wrapper.eq("year", monthy);
wrapper.in("station_basic_id",idsStationId);
wrapper.groupBy("monthly");
List<Map<String, Object>> list1 = StationPlanMapper.selectMaps(wrapper);
for (Map<String, Object> stringObjectMap : list1) {
mapwc.put(stringObjectMap.get("monthly").toString(),Double.valueOf(stringObjectMap.get("value").toString()));
}
//组装数据
List<String> list= yueReport();
for (String s : list) {
if(mapdta!=null&&mapdta.containsKey(s)){
if (mapwc!=null&&mapwc.containsKey(s)){
listdate.add(Double.valueOf(format2.format(mapdta.get(s)/mapwc.get(s)*100)));
}else{
listdate.add(0d);
}
}else{
listdate.add(0d);
}
}
Map<String,Object> mapjn=new HashMap<>();
mapjn.put("seriesData",listdate);
mapjn.put("axisData",list);
try {
System.out.println(JSON.toJSONString(mapjn));
emqKeeper.getMqttClient().publish("qyyfdqs/fdqs/"+areaCode, JSON.toJSONString(mapjn).getBytes(),0,false);
} catch (MqttException e) {
e.printStackTrace();
}
return listdate;
}
public List<String> yueReport() {
List<String> list=new ArrayList<>();
for (int i = 1; i < 13; i++ ) {
list.add(String.valueOf(i));
}
return list;
}
public List<String> dayReport(Date month) {
......
......@@ -651,10 +651,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Map<String,Object> map1 = new HashMap<>();
Map<String,Object> map2 = new HashMap<>();
map1.put("data", values);
if (StringUtils.isNotEmpty(gatewayId)){
map2.put("data", valueList);
seriesData.add(map2);
}
// if (StringUtils.isNotEmpty(gatewayId)){
// map2.put("data", valueList);
// seriesData.add(map2);
// }
seriesData.add(map1);
map.put("seriesData", seriesData);
map.put("axisData",time);
......
......@@ -888,13 +888,13 @@ public class MonitoringServiceImpl {
stringHashMap5.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfMonthFD.get()) + "/" + String.format(CommonConstans.Twodecimalplaces, powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew));
list1.add(stringHashMap5);
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);
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);
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);
page1.setRecords(list1);
HashMap<String, String> stringHashMap9 = new HashMap<>();
......@@ -908,15 +908,15 @@ public class MonitoringServiceImpl {
resultMap.put("YJHWC", String.format(CommonConstans.Twodecimalplaces, (powerOfMonthFD.get() + powerOfMonthGF.get() * CommonConstans.pvGenPoweActornew)/moonValue* 100));
list2.add(stringHashMap10);
HashMap<String, String> stringHashMap11 = new HashMap<>();
stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD.get() + powerOfAnnualGF.get() * CommonConstans.pvGenPoweActornew));
resultMap.put("Year",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.pvGenPoweActorYear));
list2.add(stringHashMap11);
HashMap<String, String> stringHashMap12 = new HashMap<>();
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD.get() + powerOfAnnualGF.get()*CommonConstans.pvGenPoweActornew) /yearValue* 100));
resultMap.put("NJHWC",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.pvGenPoweActorYear) /yearValue* 100));
list2.add(stringHashMap12);
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<>();
stringHashMap13.put("title", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide)));
stringHashMap13.put("unit", "二氧化碳减排量(万t)");
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;//package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESDailyPowerGeneration;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESYearPowerGeneration;
import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.StationCacheInfoDto;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESDailyPowerGenerationRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESMoonPowerGenerationRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESYearPowerGenerationRepository;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.utils.InfluxDButils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.stereotype.Service;
......@@ -38,7 +42,8 @@ public class PowerGenerationImpl {
ESMoonPowerGenerationRepository moonPowerGenerationRepository;
@Autowired
ESDailyPowerGenerationRepository dailyPowerGenerationRepository;
@Autowired(required=true)
IndicatorDataMapper indicatorDataMapper;
//获取指定指标,当天最后一条数据
public List<IndexDto> getlast(String gatewayId, String value,String daty){
......@@ -67,23 +72,45 @@ public class PowerGenerationImpl {
//@Async("jxiopAsyncExecutor")
public void addPowerGeneration(StationCacheInfoDto stationCacheInfoDto,String gatewayId, String value, String dateFormat, String type, String stationType,String datyvalue){
//获取指标值
List<IndexDto> indexDto=null;
// List<IndexDto> indexDto=null;
List<IndicatorData> indexDto=null;
Date currentDayStartTime = DateUtils.getCurrentDayStartTime(new Date());
Date currentDayEndTime = DateUtils.getCurrentDayEndTime(new Date());
String startTime = DateUtils.convertDateToString(currentDayStartTime, DateUtils.DATE_TIME_PATTERN);
String endTime = DateUtils.convertDateToString(currentDayEndTime, DateUtils.DATE_TIME_PATTERN);
Double flags=null;
if("FDZ".equals(stationType)){
indexDto= this.getlast(gatewayId,value, datyvalue);
//indexDto= this.getlast(gatewayId,value, datyvalue);
indexDto= indicatorDataMapper.selectlastfd(value, gatewayId, startTime, endTime);
}else{
//增加系数转化
//"日发电量"
if("日发电量".equals(value)){
//"日发电量"
flags= CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay;
}else if("月发电量".equals(value)){
//"月发电量"
flags= CommonConstans.pvGenPoweActornew;
}else{
indexDto= this.getlastgf(gatewayId,value,datyvalue);
//"年发电量"
flags= CommonConstans.pvGenPoweActorYear;
}
indexDto= indicatorDataMapper.selectlastgf(value, gatewayId, startTime, endTime);
//indexDto= this.getlastgf(gatewayId,value,datyvalue);
}
SimpleDateFormat myFmt2=new SimpleDateFormat(dateFormat);
Date now=new Date();
String daty= myFmt2.format(now);
this.PowerGeneration(stationCacheInfoDto,indexDto,daty,type);
this.PowerGeneration(stationCacheInfoDto,indexDto,daty,type,flags);
}
//更新es
public void PowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndexDto> indexDto,String daty,String type){
public void PowerGeneration(StationCacheInfoDto stationCacheInfoDto, List<IndicatorData> indexDto,String daty,String type,Double flags){
Calendar calendar = Calendar.getInstance();
int day = calendar.get(Calendar.DATE);
int month = calendar.get(Calendar.MONTH) + 1;
......@@ -100,15 +127,15 @@ public class PowerGenerationImpl {
switch (type) {
case "day":
List<ESDailyPowerGeneration> listd= this.getESDailyPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(day),monthy);
List<ESDailyPowerGeneration> listd= this.getESDailyPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(day),monthy,flags);
dailyPowerGenerationRepository.saveAll(listd);
break;
case "moon":
List<ESMoonPowerGeneration> listm= this.getESMoonPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(month),yeary);
List<ESMoonPowerGeneration> listm= this.getESMoonPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(month),yeary,flags);
moonPowerGenerationRepository.saveAll(listm);
break;
case "year":
List<ESYearPowerGeneration> listy= this.getESYearPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(year));
List<ESYearPowerGeneration> listy= this.getESYearPowerGeneration(stationCacheInfoDto,indexDto,daty,String.valueOf(year),flags);
yearPowerGenerationRepository.saveAll(listy);
break;
default:
......@@ -119,11 +146,16 @@ public class PowerGenerationImpl {
// 组装数据
public List<ESDailyPowerGeneration> getESDailyPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndexDto> indexDto,String daty,String day,String month){
public List<ESDailyPowerGeneration> getESDailyPowerGeneration(StationCacheInfoDto stationCacheInfoDto, List<IndicatorData> indexDto,String daty,String day,String month,Double flags){
List<ESDailyPowerGeneration> list=new ArrayList<>();
if(indexDto!=null&&!indexDto.isEmpty()){
for (IndexDto dto : indexDto) {
for (IndicatorData dto : indexDto) {
double value=dto.getValueF()!=null?(double)dto.getValueF():0.0;
if(flags!=null){
value=value*flags;
}
ESDailyPowerGeneration dailyPowerGeneration=new ESDailyPowerGeneration(
daty+"_"+dto.getAddress(),
stationCacheInfoDto.getStationId(),
......@@ -134,7 +166,7 @@ public class PowerGenerationImpl {
day,
dto.getGatewayId(),
new Date(),
dto.getValue()!=null?Double.valueOf(dto.getValue()):null,
value,
dto.getEquipmentIndexName(),
dto.getEquipmentNumber(),
dto.getAddress(),
......@@ -145,10 +177,14 @@ public class PowerGenerationImpl {
}
return list;
}
public List<ESMoonPowerGeneration> getESMoonPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndexDto> indexDto,String daty,String day,String year){
public List<ESMoonPowerGeneration> getESMoonPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,String year,Double flags){
List<ESMoonPowerGeneration> list=new ArrayList<>();
if(indexDto!=null&&!indexDto.isEmpty()){
for (IndexDto dto : indexDto) {
for (IndicatorData dto : indexDto) {
double value=dto.getValueF()!=null?(double)dto.getValueF():0.0;
if(flags!=null){
value=value*flags;
}
ESMoonPowerGeneration moonPowerGeneration=new ESMoonPowerGeneration(
daty+"_"+dto.getAddress(),
stationCacheInfoDto.getStationId(),
......@@ -159,7 +195,7 @@ public class PowerGenerationImpl {
day,
dto.getGatewayId(),
new Date(),
dto.getValue()!=null?Double.valueOf(dto.getValue()):null,
value,
dto.getEquipmentIndexName(),
dto.getEquipmentNumber(),
dto.getAddress(),
......@@ -170,10 +206,14 @@ public class PowerGenerationImpl {
}
return list;
}
public List<ESYearPowerGeneration> getESYearPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndexDto> indexDto,String daty,String day){
public List<ESYearPowerGeneration> getESYearPowerGeneration(StationCacheInfoDto stationCacheInfoDto,List<IndicatorData> indexDto,String daty,String day,Double flags){
List<ESYearPowerGeneration> list=new ArrayList<>();
if(indexDto!=null&&!indexDto.isEmpty()){
for (IndexDto dto : indexDto) {
for (IndicatorData dto : indexDto) {
double value=dto.getValueF()!=null?(double)dto.getValueF():0.0;
if(flags!=null){
value=value*flags;
}
ESYearPowerGeneration yearPowerGeneration=new ESYearPowerGeneration(
daty+"_"+dto.getAddress(),
stationCacheInfoDto.getStationId(),
......@@ -184,7 +224,7 @@ public class PowerGenerationImpl {
day,
dto.getGatewayId(),
new Date(),
dto.getValue()!=null?Double.valueOf(dto.getValue()):null,
value,
dto.getEquipmentIndexName(),
dto.getEquipmentNumber(),
dto.getAddress()
......
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
spring.db2.datasource.password=Yeejoin@2020
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.instance.hostname=172.16.10.220
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
......
......@@ -20,7 +20,7 @@
"url": "upload/jxiop/amos_studio/6CE2792ABEEAE816CB798649A6796.png"
},
{
"title": "瞬时风速",
"title": "30秒平均风速",
"title1": "平均风速(m/s)",
"url": "upload/jxiop/amos_studio/3B66742AAB2FEB0F5CEC10DA50156F.png"
},
......
package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class CommonConstans {
//光伏发电量系数
public static final Double pvGenPoweActor = 0.0001;
public static final Double pvGenPoweActorDay = 0.01;
public static final Double pvGenPoweActor = 0.000001;
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 {
// 装机容量=场站所有逆变器装机容量总和
//
// 通用:
// 发电量完成率=(月/年)发电量/(月/年)发电量指标
// 小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标
// 可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW)
// 二氧化碳减排量(万t)=发电量(万kW·h)*0.997 * 10 / 10000
public static final Double carbonDioxide = 0.997 * 10 / 10000;
// 节约标准煤(万t)=发电量(万kW·h)*0.29
public static final Double standardCoal = 0.29/10000;
// 炭粉尘减排量(t)=发电量(万kW·h)*0.30
public static final Double toner = 0.30;
// 二氧化硫减排量(t)=发电量(万kW·h)*1.51
public static final Double sulfurDioxide = 1.51;
// 氮氧化物减排量(t)=发电量(万kW·h)*1.69
public static final Double oxynitride = 1.69;
// ◎节省标准煤:发电量0.410
// ◎节省千克原煤:发电量0.559810
// ◎减排千克“二氧化碳”:发电量0.99710
// ◎减排千克“碳粉尘”:发电量0.27210
// ◎减排千克二氧化硫:发电量0.0310
// ◎减排千克氮氧化物:发电量0.01510
// 二氧化碳
public static final Double carbonDioxide = 0.997 * 10;
//标准煤
public static final Double standardCoal = 0.4 * 10;
//炭粉尘减排量
public static final Double toner = 0.272 * 10;
//二氧化硫减排量
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;
//万Kwh转MV
public static final Integer wkwhToMv = 10;
//kw转MV
public static final Double kwToMv =0.0001 ;
public static final Double kwToMv = 0.0001;
// 正常运行 发电状态=1
......@@ -103,7 +114,13 @@ public class CommonConstans {
public static final String QueryStringDisplayNameKeyword = "displayName.keyword";
public static final String QueryStringIsAlarm = "isAlarm";
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 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 {
// }
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( "日发电量",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("日发电量", 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秒平均风速")));
Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"));
......@@ -615,34 +614,22 @@ public class MonitorFanIdxController extends BaseController {
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getFanGatewayId();
String boosterGatewayId = stationBasic.getBoosterGatewayId();
String[] columnList = new String[]{"日发电量", "月发电量", "年发电量"};
String[] columnList = new String[]{CommonConstans.taiHeGenIndicatorDay, CommonConstans.taiHeGenIndicatorMonth, CommonConstans.taiHeGenIndicatorYear};
String[] columnLists = new String[]{"有功功率"};
Map<String, Object> columnMap = new HashMap<>();
//日 月 年发电量同仅统计逆变器数据
List<Map<String, Object>> mapList;
for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column);
if (column.equals("日发电量")) {
columnMap.put(column, String.format(CommonConstans.Fourdecimalplaces, result * CommonConstans.pvGenPoweActorDay));
} else {
Double result = commonService.getTotalByIndicatiorByGF(boosterGatewayId, column);
columnMap.put(column, result);
}
}
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.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result1 = commonService.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
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='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
columnMap.put("有功功率", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P") * CommonConstans.kwToMv * 10));
String num = monitorFanIndicator.getEquipCount(gatewayId, "GF");
columnMap.put("风机台数", num);
......@@ -654,25 +641,25 @@ public class MonitorFanIdxController extends BaseController {
data.put("title", columnMap.get("装机容量").toString());
objects.add(data);
Map<String, Object> data1 = new HashMap<>();
data1.put("title", columnMap.get("日发电量").toString());
data1.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorDay).toString());
objects.add(data1);
Map<String, Object> data2 = new HashMap<>();
data2.put("title", columnMap.get("风机台数").toString().replace(".0", ""));
objects.add(data2);
Map<String, Object> data3 = new HashMap<>();
data3.put("title", columnMap.get("月发电量").toString());
data3.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorMonth).toString());
objects.add(data3);
Map<String, Object> data4 = new HashMap<>();
data4.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
objects.add(data4);
Map<String, Object> data5 = new HashMap<>();
data5.put("title", columnMap.get("年发电量").toString());
data5.put("title", columnMap.get(CommonConstans.taiHeGenIndicatorYear).toString());
objects.add(data5);
Map<String, Object> data6 = new HashMap<>();
data6.put("title", columnMap.get("有功功率").toString());
objects.add(data6);
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);
Map<String, Object> data8 = new HashMap<>();
data8.put("title", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射累计")));
......
......@@ -235,18 +235,16 @@ public class CommonServiceImpl {
//用于组装-es查询条件
Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> likeQuerCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
List<ESEquipments> result = getListDataByCondtions(queryCondtion, null, ESEquipments.class);
Double totalvalue = 0.00;
try {
totalvalue = result.stream().filter(stringObjectMap -> !ObjectUtils.isEmpty(stringObjectMap.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).sum();
} catch (Exception e) {
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) {
......@@ -364,17 +362,17 @@ public class CommonServiceImpl {
二氧化硫减排量(t)=发电量(万kW·h)*1.51
氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/
co2.setUnit("二氧化碳减排量(t)");
co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide));
co2.setUnit("二氧化碳减排量(t)");
co2.setTitle(String.format("%.2f", totalSocialContribution * CommonConstans.carbonDioxide*CommonConstans.kgToT));
socialContributionDtoList.add(co2);
coal.setUnit("节约标准煤(t)");
coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal)));
coal.setUnit("节约标准煤(t)");
coal.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.standardCoal*CommonConstans.kgToT)));
socialContributionDtoList.add(coal);
toner.setUnit("碳粉尘减排量(t)");
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner * CommonConstans.tToWT)));
toner.setUnit("碳粉尘减排量(t)");
toner.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.toner * CommonConstans.kgToT)));
socialContributionDtoList.add(toner);
so2.setUnit("二氧化硫减排量(t)");
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide * CommonConstans.tToWT)));
so2.setUnit("二氧化硫减排量(t)");
so2.setTitle(String.format("%.2f", (totalSocialContribution * CommonConstans.sulfurDioxide * CommonConstans.kgToT)));
socialContributionDtoList.add(so2);
socialContributionDtoPage.setRecords(socialContributionDtoList);
socialContributionDtoPage.setTotal(100);
......
......@@ -219,7 +219,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
esEquipments.setValue(String.format(CommonConstans.Fourdecimalplaces, Double.valueOf(esEquipments.getValue()) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
}
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 {
}
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) {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>();
......@@ -1743,11 +1753,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
break;
case "日发电量":
double v = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("dayNum", keepTwoDecimalPlaces(String.valueOf(v)));
map.put("dayNum", keepFourDecimalPlaces(String.valueOf(v)));
break;
case "总发电量":
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActor;
map.put("yearNum", keepTwoDecimalPlaces(String.valueOf(a)));
double a = Double.parseDouble(e.getValueF().toString()) * CommonConstans.pvGenPoweActorCurrentData;
map.put("yearNum", keepFourDecimalPlaces(String.valueOf(a)));
break;
}
});
......
......@@ -101,12 +101,11 @@ public class MonitoringServiceIMQTTmpl {
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getTotalByIndicatior(stationBasic.getFanGatewayId(), "年发电量"));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
totalSocialContribution.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
}
});
Page<SocialContributionDto> socialContributionDtoPage = commonService.getSocialContributionDtoList(totalSocialContribution.get());
......@@ -154,14 +153,12 @@ public class MonitoringServiceIMQTTmpl {
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>();
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay) ));
monthlyPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
annualPower.updateAndGet(v -> v + monitoringServiceImpl.keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear) ));
}
});
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.imageio.plugins.common.I18NImpl;
import com.yeejoin.amos.boot.module.jxiop.api.entity.*;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.*;
import com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments;
......@@ -14,13 +15,10 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.*;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import org.apache.velocity.runtime.directive.contrib.For;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
......@@ -191,7 +189,7 @@ public class MonitoringServiceImpl {
colModels.add(colModelAnnualPower);
List<StationCacheInfoDto> stationCacheInfoDtoList = commonServiceImpl.getListStationCacheInfoDto();
List<StationCacheInfoDto> stationCacheInfoDtos = stationCacheInfoDtoList.stream().filter(stationCacheInfoDto -> stationCacheInfoDto.getBelongProvince().equals(provinceName)).collect(Collectors.toList());
if(ObjectUtils.isEmpty(stationCacheInfoDtos)){
if (ObjectUtils.isEmpty(stationCacheInfoDtos)) {
DataGridMock dataGridMock = new DataGridMock(current, 0, false, 1, null);
ResultsData resultsData = new ResultsData(dataGridMock, colModels);
return resultsData;
......@@ -251,24 +249,22 @@ public class MonitoringServiceImpl {
fdzInstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>();
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
Map<String, List<String>> queryCondtion1 = new HashMap<>();
queryCondtion1.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("WTX-801_25_WTX-801_总辐射", "南瑞光差保护_313P"));
queryCondtion1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, null);
List<ESEquipments> result1 = commonServiceImpl.getListDataByCondtions(queryCondtion1, null, ESEquipments.class);
completionOfPowerIndicatorsDto.setWindSpeedOrIrradiance(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "WTX-801_25_WTX-801_总辐射")));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P")));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
completionOfPowerIndicatorsDto.setMonthlyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
completionOfPowerIndicatorsDto.setAnnualPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
gfzannualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
gfzinstallCapacity.updateAndGet(v -> v + Double.parseDouble(stationCacheInfoDto.getInstalledCapacity()));
}
} catch (Exception exception) {
......@@ -602,12 +598,10 @@ public class MonitoringServiceImpl {
total.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
total.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorDay));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
}
} catch (Exception e) {
......@@ -640,12 +634,10 @@ public class MonitoringServiceImpl {
Double total1 = 0.00;
if (!stationBasic.getStationType().equals("FDZ")) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
total1 = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor;
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total1 = commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear);
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
......@@ -675,11 +667,9 @@ public class MonitoringServiceImpl {
if (!stationBasic.getStationType().equals("FDZ")) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor;
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total = commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth);
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
......@@ -692,7 +682,7 @@ public class MonitoringServiceImpl {
});
HashMap<String, List<String>> hashMap = new HashMap<>();
List<String> xList = getXListofRecentOneYear();
List<String> yList = Arrays.asList("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "12000", String.format(CommonConstans.Twodecimalplaces, monthlyPower.get()));
List<String> yList = Arrays.asList("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", String.format(CommonConstans.Twodecimalplaces, monthlyPower.get()));
hashMap.put("axisData", xList);
hashMap.put("seriesData", yList);
return hashMap;
......@@ -719,14 +709,12 @@ public class MonitoringServiceImpl {
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay)));
monthlyPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth)));
annualPower.updateAndGet(v -> v + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
}
});
HashMap<String, String> dayHashMap = new HashMap<>();
......@@ -776,11 +764,9 @@ public class MonitoringServiceImpl {
if (!stationBasic.getStationType().equals("FDZ")) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor;
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total = commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth);
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
......@@ -793,7 +779,7 @@ public class MonitoringServiceImpl {
});
HashMap<String, List<String>> hashMap = new HashMap<>();
List<String> xList = getXListofRecentOneYear();
List<String> yList = Arrays.asList("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "120", String.format(CommonConstans.Twodecimalplaces, monthlyPower.get() % 200));
List<String> yList = Arrays.asList("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", String.format(CommonConstans.Twodecimalplaces, monthlyPower.get() % 200));
hashMap.put("axisData", xList);
hashMap.put("seriesData", yList);
return hashMap;
......@@ -819,12 +805,10 @@ public class MonitoringServiceImpl {
List<Map<String, Object>> mapListData = new ArrayList<>();
if (!stationBasic.getStationType().equals("FDZ")) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
total.set(commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor);
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorMonth));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total.set(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
......@@ -872,40 +856,37 @@ public class MonitoringServiceImpl {
} else {
stationBasicListAll = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("fan_gateway_id"));
}
String indicator = "日发电量";
AtomicReference<String> indicator = new AtomicReference<>("日发电量");
if (tabValue.equals("1")) {
indicator = "月发电量";
indicator.set("月发电量");
} else if (tabValue.equals("2")) {
indicator = "年发电量";
indicator.set("年发电量");
}
//填写发电小时数
String finalIndicator = indicator;
stationBasicListAll.forEach(stationBasic -> {
Double install1 = getStationCaPACITYL(stationBasic.getStationNumber());
BigDecimal gfInstall = new BigDecimal( String.format("%.2f", install1));
BigDecimal gfInstall = new BigDecimal(String.format("%.2f", install1));
Double total = 0.00;
List<Map<String, Object>> mapListData = new ArrayList<>();
if (!stationBasic.getStationType().equals("FDZ")) {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
// total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay;
if (finalIndicator.equals("日发电量")) {
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay;
} else {
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator) * CommonConstans.pvGenPoweActor;
indicator.set(CommonConstans.taiHeGenIndicatorDay);
if (tabValue.equals("1")) {
indicator.set(CommonConstans.taiHeGenIndicatorMonth);
} else if (tabValue.equals("2")) {
indicator.set(CommonConstans.taiHeGenIndicatorYear);
}
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator.get()));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total = commonServiceImpl.getSumByEquipmentIndxName(result, indicator.get());
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(finalIndicator));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(indicator.get()));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
total = commonServiceImpl.getSumByEquipmentIndxName(result, finalIndicator);
total = commonServiceImpl.getSumByEquipmentIndxName(result, indicator.get());
}
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, (total * 10) / gfInstall.doubleValue()));
if (stationBasic.getAddress().equals("NaN")) {
......@@ -1024,61 +1005,59 @@ public class MonitoringServiceImpl {
for (int i = 0; i < gfList.size(); i++) {
StationBasic stationBasic = gfList.get(i);
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> likeQuerCondtion = new HashMap<>();
likeQuerCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, likeQuerCondtion);
powerOfDayGF = powerOfDayGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
powerOfMonthGF = powerOfMonthGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
powerOfAnnualGF = powerOfAnnualGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, CommonConstans.taiHeGenIndicator);
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
powerOfDayGF = powerOfDayGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorDay));
powerOfMonthGF = powerOfMonthGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorMonth));
powerOfAnnualGF = powerOfAnnualGF + keepFourdecimalPlaces(commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear));
}
HashMap<String, String> stringHashMap4 = new HashMap<>();
stringHashMap4.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfDayGF * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay));
stringHashMap4.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfDayGF));
list1.add(stringHashMap4);
HashMap<String, String> stringHashMap5 = new HashMap<>();
stringHashMap5.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfMonthGF * CommonConstans.pvGenPoweActor));
stringHashMap5.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfMonthGF));
list1.add(stringHashMap5);
HashMap<String, String> stringHashMap6 = new HashMap<>();
stringHashMap6.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualGF * CommonConstans.pvGenPoweActor));
stringHashMap6.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD) + "/" + String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualGF));
list1.add(stringHashMap6);
HashMap<String, String> stringHashMap7 = new HashMap<>();
stringHashMap7.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD * 100) / fdzValue) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF * CommonConstans.pvGenPoweActor * 100) / gfvalue));
stringHashMap7.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD * 100) / fdzValue) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF * 100) / gfvalue));
list1.add(stringHashMap7);
HashMap<String, String> stringHashMap8 = new HashMap<>();
stringHashMap8.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD * CommonConstans.wkwhToMv) / fdzInstall.doubleValue()) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF * CommonConstans.pvGenPoweActor * CommonConstans.wkwhToMv) / gfInstall.doubleValue()));
stringHashMap8.put("title", String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualFD * CommonConstans.wkwhToMv) / fdzInstall.doubleValue()) + "/" + String.format(CommonConstans.Twodecimalplaces, (powerOfAnnualGF * CommonConstans.wkwhToMv) / gfInstall.doubleValue()));
list1.add(stringHashMap8);
page1.setRecords(list1);
HashMap<String, String> stringHashMap9 = new HashMap<>();
stringHashMap9.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD + (powerOfDayGF * CommonConstans.pvGenPoweActor * CommonConstans.pvGenPoweActorDay)));
stringHashMap9.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfDayFD + powerOfDayGF));
list2.add(stringHashMap9);
HashMap<String, String> stringHashMap10 = new HashMap<>();
stringHashMap10.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD + powerOfMonthGF * CommonConstans.pvGenPoweActor));
stringHashMap10.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfMonthFD + powerOfMonthGF));
list2.add(stringHashMap10);
HashMap<String, String> stringHashMap11 = new HashMap<>();
stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD + powerOfAnnualGF * CommonConstans.pvGenPoweActor));
stringHashMap11.put("title", String.format(CommonConstans.Fourdecimalplaces, powerOfAnnualFD + powerOfAnnualGF));
list2.add(stringHashMap11);
HashMap<String, String> stringHashMap12 = new HashMap<>();
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, ((powerOfAnnualFD + powerOfAnnualGF * CommonConstans.pvGenPoweActor) * 100) / yearValue));
stringHashMap12.put("title", String.format(CommonConstans.Twodecimalplaces, ((powerOfAnnualFD + powerOfAnnualGF) * 100) / yearValue));
list2.add(stringHashMap12);
page2.setRecords(list2);
Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF * CommonConstans.pvGenPoweActor);
Double totalAnnual = (powerOfAnnualFD + powerOfAnnualGF);
HashMap<String, String> stringHashMap13 = new HashMap<>();
stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide)));
stringHashMap13.put("title2", "二氧化碳减排量(t)");
stringHashMap13.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.carbonDioxide * CommonConstans.kgToT)));
stringHashMap13.put("title2", "二氧化碳减排量(t)");
list3.add(stringHashMap13);
HashMap<String, String> stringHashMap14 = new HashMap<>();
stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal)));
stringHashMap14.put("title2", "节约标准煤(t)");
stringHashMap14.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.standardCoal * CommonConstans.kgToT)));
stringHashMap14.put("title2", "节约标准煤(t)");
list3.add(stringHashMap14);
HashMap<String, String> stringHashMap15 = new HashMap<>();
stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner * CommonConstans.tToWT)));
stringHashMap15.put("title2", "碳粉尘减排量(t)");
stringHashMap15.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.toner * CommonConstans.kgToT)));
stringHashMap15.put("title2", "碳粉尘减排量(t)");
list3.add(stringHashMap15);
HashMap<String, String> stringHashMap16 = new HashMap<>();
stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide * CommonConstans.tToWT)));
stringHashMap16.put("title2", "二氧化硫减排量(t)");
stringHashMap16.put("title1", String.format(CommonConstans.Twodecimalplaces, (totalAnnual * CommonConstans.sulfurDioxide * CommonConstans.kgToT)));
stringHashMap16.put("title2", "二氧化硫减排量(t)");
list3.add(stringHashMap16);
page3.setRecords(list3);
try {
......@@ -1104,12 +1083,11 @@ public class MonitoringServiceImpl {
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")));
} else {
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put(CommonConstans.QueryStringFrontMoudle, "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class, shouldQueryCondtion);
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor));
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList(CommonConstans.taiHeGenIndicatorYear));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
stationBasic.setAddress(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, CommonConstans.taiHeGenIndicatorYear)));
}
});
List<StationBasic> fdzList = stationBasicListAll.stream().filter(stationBasic -> stationBasic.getStationType().equals("FDZ")).collect(Collectors.toList());
......
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