Commit c1373fa3 authored by tangwei's avatar tangwei

解决冲突

parents 1493e496 5dcd7d47
......@@ -10,4 +10,5 @@ public class FullViewRecallDataDTO {
private String equipmentName;
private String subSystem;
private String pointName;
private String indexAddress;
}
......@@ -8,6 +8,8 @@ public class FullViewRecallInfoDTO {
private String loc;
private String name;
private Double score;
private String scoreRange;
private String status;
private String scoreRange = "";
private String status = "";
private Boolean isRoot = false;
private String category = "";
}
......@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.Date;
/**
*
......@@ -38,8 +39,8 @@ public class IdxBizPvHealthLevel{
/**
*
*/
@TableField("REC_DATE")
private LocalDateTime recDate;
@TableField("REC_DATE")
private Date recDate;
/**
*
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
......@@ -81,4 +82,13 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List<FullViewRecallDataDTO> getFullViewRecall();
List<Map<String, Object>> getStationIndexInfo();
List<Map<String, Object>> getEquipmentIndexInfo();
List<Map<String, Object>> getSubSystemIndexInfo();
List<Map<String, Object>> getPointNameIndexInfo();
List<IdxBizFanHealthLevel> getHealthLevelInfoList();
}
......@@ -46,6 +46,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();
}
}
......@@ -6,7 +6,8 @@ import java.util.HashMap;
public class CommonConstans {
//光伏发电量系数
public static final Double pvGenPoweActor = 0.000001;
public static final Double pvGenPoweActor = 0.00001;
public static final Double pvGenPoweActorDay = 0.01;
// 风电站:
// (日/月/年)发电量=场站所有风机(日/月/年)发电量总和
// 装机容量=场站所有风机装机容量总和
......@@ -33,6 +34,10 @@ public class CommonConstans {
public static final Double tToWT = 0.0001;
//万Kwh转MV
public static final Integer wkwhToMv = 10;
//kw转MV
public static final Double kwToMv =0.0001 ;
// 正常运行 发电状态=1
// 告警运行 报警状态=1
// 正常停机 停机状态=1
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -19,6 +20,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EquipAlarmEventServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -69,6 +71,8 @@ public class MonitorFanIdxController extends BaseController {
@Value("${fan.statuts.stattuspath}")
private String fanStatusImagePathPrefix;
@Autowired
IndicatorDataMapper indicatorDataMapper;
@Autowired
MonitorFanIndicatorMapper monitorFanIndicatorMapper;
......@@ -609,23 +613,21 @@ public class MonitorFanIdxController extends BaseController {
for (String column : columnList) {
Double result = commonService.getTotalByIndicatiorByGF(gatewayId, column);
columnMap.put(column, String.format("%.2f",result));
columnMap.put(column, String.format("%.2f",result*CommonConstans.pvGenPoweActor));
}
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("南瑞光差保护_313P","WTX-801_25_WTX-801_总辐射累计","WTX-801_25_WTX-801_总辐射"));
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")/1000));
columnMap.put("有功功率", String.format("%.2f", commonService.getSumByEquipmentIndxName(result1,"南瑞光差保护_313P")*CommonConstans.kwToMv));
// mapList = influxdbUtil.query("SELECT * FROM indicators_" + stationBasic.getFanGatewayId() + " where frontModule=~/逆变器/ and(equipmentIndexName='日发电量' or equipmentIndexName='月发电量' or equipmentIndexName='年发电量' or equipmentIndexName='有功功率')");
//日-月-年-发电量需要保留四位小数问题修改
String num = monitorFanIndicator.getEquipCount(gatewayId,"GF");
columnMap.put("风机台数",num);
Double capacityl = commonService.getStationCapactityByStationWerks(stationBasic.getStationNumber());
//装机容量保留两位小数
columnMap.put("装机容量",String.format("%.2f",capacityl));
......@@ -658,7 +660,12 @@ public class MonitorFanIdxController extends BaseController {
data8.put("title",String.format("%.2f",commonService.getSumByEquipmentIndxName(result1,"WTX-801_25_WTX-801_总辐射累计")));
objects.add(data8);
Map<String, Object> data9 = new HashMap<>();
data9.put("title","0.00%");//综合效率
//综合效率 = 发电量/理论发电量
//理论发电量 = 峰值日照数 * 总装机容量
//峰值日照数 = 累计辐照度/3.6
Double powerAll = Double.valueOf((indicatorDataMapper.selectLastDataOfPower("313光差保护_总反向有功电度",boosterGatewayId).getValueF()*CommonConstans.kwToMv*0.028));
Double overallEfficiency = powerAll/((commonService.getSumByEquipmentIndxName(result1,"WTX-801_25_WTX-801_总辐射累计")/3.6)*capacityl);
data9.put("title",String.format("%.2f",overallEfficiency*100)+"%");//综合效率
objects.add(data9);
IPage<Map<String,Object>> result = new Page<>();
result.setRecords(objects);
......
package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import io.github.classgraph.json.Id;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.sql.Timestamp;
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;
}
......@@ -43,34 +43,34 @@ public class StationCacheDataInit implements CommandLineRunner {
Logger logger = LoggerFactory.getLogger(StationCacheDataInit.class);
public void run(String... args) throws Exception {
List<StationCacheInfoDto> stationCacheInfoDtos = new ArrayList<>();
redisTemplate.delete("station_info_cache");
List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL", 1));
List<MapRegion> mapRegionList = mapRegionMapper.selectList(new QueryWrapper<MapRegion>().isNotNull("name"));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
stationBasicList.forEach(stationBasic -> {
StationCacheInfoDto stationCacheInfoDto = new StationCacheInfoDto();
stationCacheInfoDto.setStationId(stationBasic.getSequenceNbr().toString());
stationCacheInfoDto.setStationName(stationBasic.getStationName());
stationCacheInfoDto.setStationType(stationBasic.getStationType());
stationCacheInfoDto.setBelongProvince(regionList.stream().filter(region -> region.getRegionCode().toString().equals(stationBasic.getBelongArea().replace("[", "").split(",")[0])).map(region -> region.getRegionName()).collect(Collectors.toList()).get(0));
stationCacheInfoDto.setBelongArea(mapRegionList.stream().filter(mapRegion -> mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 2)) || mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 3))).map(mapRegion -> mapRegion.getName()).collect(Collectors.toList()).get(0));
stationCacheInfoDto.setInstalledCapacity(String.format("%.2f", sjglZsjZsbtzMapper.getStationCapactityByStationWerks(stationBasic.getStationNumber())));
try {
List<QueryDto> queryDtoList = new ArrayList<>();
queryDtoList.add(new QueryDto("gatewayId", stationBasic.getFanGatewayId()));
queryDtoList.add(new QueryDto("equipmentIndexName.keyword", "有功功率"));
if (!stationBasic.getStationType().equals("FDZ")) {
queryDtoList.add(new QueryDto("frontModule", "逆变器"));
}
stationCacheInfoDto.setEquipmentNumbers(commonServiceImpl.getCount(queryDtoList, "equipmentNumber.Keyword", ESEquipments.class).toString());
} catch (Exception exception) {
logger.info("--------------------查询ES错误---------------------------");
}
stationCacheInfoDto.setFanGatewayId(stationBasic.getFanGatewayId());
stationCacheInfoDto.setBoosterGatewayId(stationBasic.getBoosterGatewayId());
stationCacheInfoDtos.add(stationCacheInfoDto);
});
redisTemplate.opsForList().leftPushAll("station_info_cache", stationCacheInfoDtos);
// List<StationCacheInfoDto> stationCacheInfoDtos = new ArrayList<>();
// redisTemplate.delete("station_info_cache");
// List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL", 1));
// List<MapRegion> mapRegionList = mapRegionMapper.selectList(new QueryWrapper<MapRegion>().isNotNull("name"));
// List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
// stationBasicList.forEach(stationBasic -> {
// StationCacheInfoDto stationCacheInfoDto = new StationCacheInfoDto();
// stationCacheInfoDto.setStationId(stationBasic.getSequenceNbr().toString());
// stationCacheInfoDto.setStationName(stationBasic.getStationName());
// stationCacheInfoDto.setStationType(stationBasic.getStationType());
// stationCacheInfoDto.setBelongProvince(regionList.stream().filter(region -> region.getRegionCode().toString().equals(stationBasic.getBelongArea().replace("[", "").split(",")[0])).map(region -> region.getRegionName()).collect(Collectors.toList()).get(0));
// stationCacheInfoDto.setBelongArea(mapRegionList.stream().filter(mapRegion -> mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 2)) || mapRegion.getProvince().contains(stationCacheInfoDto.getBelongProvince().substring(0, 3))).map(mapRegion -> mapRegion.getName()).collect(Collectors.toList()).get(0));
// stationCacheInfoDto.setInstalledCapacity(String.format("%.2f", sjglZsjZsbtzMapper.getStationCapactityByStationWerks(stationBasic.getStationNumber())));
// try {
// List<QueryDto> queryDtoList = new ArrayList<>();
// queryDtoList.add(new QueryDto("gatewayId", stationBasic.getFanGatewayId()));
// queryDtoList.add(new QueryDto("equipmentIndexName.keyword", "有功功率"));
// if (!stationBasic.getStationType().equals("FDZ")) {
// queryDtoList.add(new QueryDto("frontModule", "逆变器"));
// }
// stationCacheInfoDto.setEquipmentNumbers(commonServiceImpl.getCount(queryDtoList, "equipmentNumber.Keyword", ESEquipments.class).toString());
// } catch (Exception exception) {
// logger.info("--------------------查询ES错误---------------------------");
// }
// stationCacheInfoDto.setFanGatewayId(stationBasic.getFanGatewayId());
// stationCacheInfoDto.setBoosterGatewayId(stationBasic.getBoosterGatewayId());
// stationCacheInfoDtos.add(stationCacheInfoDto);
// });
// redisTemplate.opsForList().leftPushAll("station_info_cache", stationCacheInfoDtos);
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.ColModel;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.DataGridMock;
import com.yeejoin.amos.boot.module.jxiop.biz.dto.EquipAlarmEventDto;
......@@ -11,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -19,16 +23,19 @@ public class EquipAlarmEventServiceImpl extends BaseService<EquipAlarmEventDto,
@Autowired
EquipAlarmEventMapper equipAlarmEventMapper;
@Autowired
StationBasicMapper stationBasicMapper;
public ResultsData getEventByEquipIndex(String gatewayId, int current, int size, String equipIndex, String frontModule) {
public ResultsData getEventByEquipIndex(String gatewayId, int current, int size, String equipIndex, String frontModule) {
List<EquipAlarmEvent> equipAlarmEvents = new ArrayList<>();
//参数传递进来的实际上为场站id
StationBasic stationBasic = this.stationBasicMapper.selectById(gatewayId);
LambdaQueryWrapper<EquipAlarmEvent> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(EquipAlarmEvent::getEquipIndex, equipIndex);
queryWrapper.eq(EquipAlarmEvent::getGatewayId, gatewayId);
queryWrapper.eq(EquipAlarmEvent::getGatewayId, stationBasic.getFanGatewayId());
queryWrapper.eq(EquipAlarmEvent::getFrontModule, frontModule);
queryWrapper.orderByDesc(EquipAlarmEvent::getCreatedTime);
List<EquipAlarmEvent> equipAlarmEvents = equipAlarmEventMapper.selectList(queryWrapper);
equipAlarmEvents = equipAlarmEventMapper.selectList(queryWrapper);
DataGridMock DataGridMock = new DataGridMock(current, equipAlarmEvents.size(), false, current, equipAlarmEvents);
ColModel colModelEventMovement = new ColModel("equipName", "equipName", "设备名", "设备名", "dataGrid", "equipName");
ColModel colModelStationName = new ColModel("alarmDesc", "alarmDesc", "事件描述", "事件描述", "dataGrid", "alarmDesc");
......@@ -37,6 +44,4 @@ public class EquipAlarmEventServiceImpl extends BaseService<EquipAlarmEventDto,
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
}
......@@ -163,7 +163,7 @@ public class MonitoringServiceIMQTTmpl {
Map<String, String> shouldQueryCondtion = new HashMap<>();
shouldQueryCondtion.put("frontModule", "逆变器");
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, shouldQueryCondtion, ESEquipments.class);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")*CommonConstans.pvGenPoweActor);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量")*CommonConstans.pvGenPoweActor*CommonConstans.pvGenPoweActorDay);
monthlyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量")*CommonConstans.pvGenPoweActor);
annualPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量")*CommonConstans.pvGenPoweActor);
}
......
......@@ -221,8 +221,8 @@ public class MonitoringServiceImpl {
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeQuerCondtion);
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")/1000));
completionOfPowerIndicatorsDto.setDailyPower(String.format(CommonConstans.Fourdecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor));
completionOfPowerIndicatorsDto.setActivePower(String.format(CommonConstans.Twodecimalplaces, commonServiceImpl.getSumByEquipmentIndxName(result1, "南瑞光差保护_313P")*CommonConstans.kwToMv));
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, new BigDecimal(commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor)));
}
......@@ -287,7 +287,7 @@ public class MonitoringServiceImpl {
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationCacheInfoDto.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor*CommonConstans.pvGenPoweActorDay);
monthlyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor);
annualPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
}
......@@ -611,7 +611,7 @@ public class MonitoringServiceImpl {
queryCondtion.put(CommonConstans.QueryStringEquipmentIndexName, Arrays.asList("日发电量", "月发电量", "年发电量"));
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getFanGatewayId()));
List<ESEquipments> result = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor);
dailyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量") * CommonConstans.pvGenPoweActor*CommonConstans.pvGenPoweActorDay);
monthlyPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量") * CommonConstans.pvGenPoweActor);
annualPower.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量") * CommonConstans.pvGenPoweActor);
}
......@@ -927,7 +927,7 @@ public class MonitoringServiceImpl {
list1.add(stringHashMap8);
page1.setRecords(list1);
HashMap<String, String> stringHashMap9 = new HashMap<>();
stringHashMap9.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfDayFD.get() + powerOfDayGF.get() * CommonConstans.pvGenPoweActor));
stringHashMap9.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfDayFD.get() + (powerOfDayGF.get() * CommonConstans.pvGenPoweActor*CommonConstans.pvGenPoweActorDay)));
list2.add(stringHashMap9);
HashMap<String, String> stringHashMap10 = new HashMap<>();
stringHashMap10.put("title", String.format(CommonConstans.Twodecimalplaces, powerOfMonthFD.get() + powerOfMonthGF.get() * CommonConstans.pvGenPoweActor));
......
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 `value`, created_time, `value_f` as valueF from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumber(@Param("equipmentIndexName") String equipmentIndexName, @Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select `value`, created_time, `value_f` as valueF, equipment_index_name from iot_data.indicator_data where equipment_index_name like '%路电流%' and equipment_number = #{equipmentNumber} and ts >= #{startTime} and ts <= #{endTime} and gateway_id =#{gatewayId}")
List<IndicatorData> selectDataByequipmentIndexNameAndtimeAndEquipmentNumberPv(@Param("equipmentNumber") String equipmentNumber, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gatewayId") String gatewayId);
@Select("select last(`value_f`) as `value_f`,created_time from iot_data.indicator_data where equipment_index_name =#{equipmentIndexName} and gateway_id=#{gatewayId} ")
IndicatorData selectLastDataOfPower(@Param("equipmentIndexName") String equipmentIndexName, @Param("gatewayId") String gatewayId);
}
## DB properties:
## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url=jdbc:mysql://39.98.224.23:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.url=jdbc:mysql://139.9.173.44:3306/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db1.datasource.username=root
spring.db1.datasource.password=Yeejoin@2020
spring.db1.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## db2-sync_data
spring.db2.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url=jdbc:mysql://39.98.224.23:3306/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.url=jdbc:mysql://139.9.173.44:3306/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.db2.datasource.username=root
spring.db2.datasource.password=Yeejoin@2020
spring.db2.datasource.driver-class-name: com.mysql.cj.jdbc.Driver
## db3-td-engine
#spring.db3.datasource.type: com.alibaba.druid.pool.DruidDataSource
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/
......
......@@ -82,10 +82,10 @@ windSpeed.cron = 0 25 9 * * ?
#本地使用 0 0 5 29 2 ? ? 线上使用 0 */5 * * * ?
windSpeed.Scheduled.cron = 0 0 5 29 2 ?
spring.elasticsearch.rest.uris=http://39.98.224.23:9200
spring.elasticsearch.rest.uris=http://139.9.173.44:9200
spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.password=Yeejoin@2020
spring.elasticsearch.rest.read-timeout=30000
#elasticsearch.username= elastic
......
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