Commit 68068761 authored by tangwei's avatar tangwei

解决冲突

parents 5a1ecb3a 572a7608
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-system-jxiop</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-jxiop-bigscreen-biz</artifactId>
<version>1.0.0</version>
<name>amos-boot-module-jxiop-bigscreen-biz</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jxiop-monitor-biz</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.8.5-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
package com.yeejoin.amos;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.net.InetAddress;
/**
* <pre>
* 智信能源科技服务启动类
* </pre>
*
* @author DELL
*/
@EnableTransactionManagement
@EnableConfigurationProperties
@ServletComponentScan
@EnableDiscoveryClient
@EnableFeignClients
@EnableAsync
@EnableEurekaClient
@EnableScheduling
@MapperScan({ "org.typroject.tyboot.demo.face.orm.dao*", "org.typroject.tyboot.face.*.orm.dao*",
"org.typroject.tyboot.core.auth.face.orm.dao*", "org.typroject.tyboot.component.*.face.orm.dao*",
"com.yeejoin.amos.boot.module.**.api.mapper", "com.yeejoin.amos.boot.biz.common.dao.mapper","com.yeejoin.amos.boot.module.common.biz.*","com.yeejoin.amos.boot.module.jxiop.api.mapper" })
@ComponentScan(basePackages = { "org.typroject", "com.yeejoin.amos" })
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})
//@SpringBootApplication
public class AmosJxiopBigScreenApplication {
private static final Logger logger = LoggerFactory.getLogger(AmosJxiopBigScreenApplication.class);
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(AmosJxiopBigScreenApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
logger.info("\n----------------------------------------------------------\n\t"
+ "Application Amos-Biz-Boot-Jxiop-Montior is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port
+ path + "/doc.html\n" + "----------------------------------------------------------");
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.squareup.moshi.Json;
import com.yeejoin.amos.component.influxdb.InfluxDbConnection;
import com.yeejoin.amos.component.influxdb.InfluxdbUtil;
import org.influxdb.dto.QueryResult;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class InfluxDButils {
@Autowired
InfluxDbConnection influxDbConnection;
@Autowired
InfluxdbUtil influxdbUtil;
public <T> List<T> getListData(String sql, Class<T> clazz) {
List<T> list = new ArrayList<>();
try {
QueryResult query = influxDbConnection.query(sql);
List<QueryResult.Result> queryResults = query.getResults();
for (QueryResult.Result result : queryResults) {
List<QueryResult.Series> series = result.getSeries();
if (series == null) {
continue;
}
for (QueryResult.Series serie : series) {
List<List<Object>> values = serie.getValues();
List<String> columns = serie.getColumns();
for (int i = 0; i < values.size(); ++i) {
T object = clazz.newInstance();
BeanWrapperImpl bean = new BeanWrapperImpl(object);
for (int j = 0; j < columns.size(); ++j) {
String k = columns.get(j);
Object v = values.get(i).get(j);
if ("time".equals(k)) {
continue;
} else {
bean.setPropertyValue(k, v);
}
}
list.add(object);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
public <T> List<T> getListData1(String sql, Class<T> clazz) {
List<T> list = new ArrayList<>();
try {
List<Map<String,Object>> mapList = influxdbUtil.query(sql);
list=mapList.stream().map(stringObjectMap -> JSONObject.parseObject(JSON.toJSONString(stringObjectMap),clazz)).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
public <T> List<T> getListDataAll(String sql, Class<T> clazz) {
List<T> list = new ArrayList<>();
try {
QueryResult query = influxDbConnection.query(sql);
List<QueryResult.Result> queryResults = query.getResults();
for (QueryResult.Result result : queryResults) {
List<QueryResult.Series> series = result.getSeries();
if (series == null) {
continue;
}
for (QueryResult.Series serie : series) {
List<List<Object>> values = serie.getValues();
List<String> columns = serie.getColumns();
for (int i = 0; i < values.size(); ++i) {
T object = clazz.newInstance();
BeanWrapperImpl bean = new BeanWrapperImpl(object);
for (int j = 0; j < columns.size(); ++j) {
String k = columns.get(j);
Object v = values.get(i).get(j);
bean.setPropertyValue(k, v);
}
list.add(object);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
}
## DB properties:
## db1-production database
spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
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://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
## eureka properties:
eureka.instance.hostname=172.16.10.220
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database=1
spring.redis.host=172.16.10.220
spring.redis.port=6379
spring.redis.password=yeejoin@2020
spring.cache.type=GENERIC
j2cache.open-spring-cache=true
j2cache.cache-clean-mode=passive
j2cache.allow-null-values=true
j2cache.redis-client=lettuce
j2cache.l2-cache-open=true
j2cache.broadcast=net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
j2cache.L1.provider_class=caffeine
j2cache.L2.provider_class=net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section=lettuce
j2cache.sync_ttl_to_redis=true
j2cache.default_cache_null_object=false
j2cache.serialization=fst
caffeine.properties=/caffeine.properties
lettuce.mode=single
lettuce.namespace=
lettuce.storage=generic
lettuce.channel=j2cache
lettuce.scheme=redis
lettuce.hosts=${spring.redis.host}:${spring.redis.port}
lettuce.password=${spring.redis.password}
lettuce.database=${spring.redis.database}
lettuce.sentinelMasterId=
lettuce.maxTotal=100
lettuce.maxIdle=10
lettuce.minIdle=10
lettuce.timeout=10000
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.220:1883
emqx.user-name=admin
emqx.password=public
mqtt.scene.host=mqtt://172.16.10.220:8083/mqtt
mqtt.client.product.id=mqtt
mqtt.topic=topic_mqtt
spring.mqtt.completionTimeout=3000
emqx.max-inflight=1000
## influxDB
#spring.influx.url= http://172.16.3.155:18186
#spring.influx.password=Yeejoin@2020
#spring.influx.user=root
#spring.influx.database=iot_platform
#spring.influx.retention_policy=default
#spring.influx.retention_policy_time=30d
#spring.influx.actions=10000
#spring.influx.bufferLimit=20000
## influxDB
#spring.influx.url= http://139.9.171.247:8086
#spring.influx.password=Yeejoin@2023
#spring.influx.user=admin
#spring.influx.database=iot_platform
#spring.influx.retention_policy=default
#spring.influx.retention_policy_time=30d
#spring.influx.actions=10000
#spring.influx.bufferLimit=20000
spring.influx.url=http://139.9.173.44:18086
spring.influx.password=Yeejoin@2020
spring.influx.user=root
spring.influx.database=iot_platform
spring.influx.retention_policy=default
spring.influx.retention_policy_time=30d
spring.influx.actions=10000
spring.influx.bufferLimit=20000
knife4j.production=false
knife4j.enable=true
knife4j.basic.enable=true
knife4j.basic.username=admin
knife4j.basic.password=a1234560
management.security.enabled=true
spring.security.user.name=admin
spring.security.user.password=a1234560
fire-rescue=123
mybatis-plus.global-config.db-config.update-strategy=ignored
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key=qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url=tcp://139.9.173.44:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.jms.pub-sub-domain=false
myqueue=amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
# ?????????
fan.statuts.stattuspath=upload/jxiop/device_status
pictureUrl=upload/jxiop/syz/
spring.application.name=AMOS-JXIOP-BIGSCREEN
server.servlet.context-path=/jxiop-bigscreen
server.port=33300
server.uri-encoding=UTF-8
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
## mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
### DB properties:
#spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.type=com.zaxxer.hikari.HikariDataSource
#spring.datasource.hikari.minimum-idle=10
#spring.datasource.hikari.maximum-pool-size=25
#spring.datasource.hikari.auto-commit=true
#spring.datasource.hikari.idle-timeout=30000
#spring.datasource.hikari.pool-name=DatebookHikariCP
#spring.datasource.hikari.max-lifetime=120000
#spring.datasource.hikari.connection-timeout=30000
#spring.datasource.hikari.connection-test-query=SELECT 1
#JPA Configuration:
spring.jpa.show-sql=false
spring.jpa.open-in-view=true
#spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
##liquibase
spring.liquibase.change-log=classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled=false
## eureka properties:
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.41
eureka.client.registry-fetch-interval-seconds=5
eureka.instance.health-check-url-path=/actuator/health
eureka.instance.lease-expiration-duration-in-seconds=10
eureka.instance.lease-renewal-interval-in-seconds=5
eureka.instance.metadata-map.management.context-path=${server.servlet.context-path}/actuator
eureka.instance.status-page-url-path=/actuator/info
eureka.instance.metadata-map.management.api-docs=http://localhost:${server.port}${server.servlet.context-path}/doc.html
## redis properties:
spring.redis.lettuce.pool.max-active=200
spring.redis.lettuce.pool.max-wait=-1
spring.redis.lettuce.pool.max-idle=10
spring.redis.lettuce.pool.min-idle=0
## redis失效时间
redis.cache.failure.time=10800
spring.servlet.multipart.maxFileSize=100MB
spring.servlet.multipart.maxRequestSize=100MB
spring.main.allow-bean-definition-overriding=true
spring.http.encoding.charset=utf-8
spring.http.encoding.enabled=true
spring.http.encoding.force=true
privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000
#场站实时数据
station.task.cron=* * */10 * * ?
#是否切片
station.isok=false
#风机更新数据切片量
station.section=10
gl.sum.column=日发电量,月发电量,年发电量
gl.avg.column=有功功率,日利用小时,瞬时风速
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>7</MaxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>30mb</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="com.baomidou.mybatisplus" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<logger name="org.typroject" level="DEBUG"/>
<logger name="com.yeejoin" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
......@@ -765,5 +765,30 @@ public class MonitorFanIdxController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "集电线路图右侧 光伏列表")
@GetMapping("/gfList")
@Scheduled(cron = "0/10 * * * * ? ")
public ResponseModel getListByNbq() {
LambdaQueryWrapper<StationBasic> wrapper = new LambdaQueryWrapper<>();
List<StationBasic> stationBasics = stationBasicMapper.selectList(wrapper);
for (StationBasic stationBasic : stationBasics) {
String gatewayId = stationBasic.getFanGatewayId();
String werks = stationBasic.getStationNumber();
monitorFanIndicator.getListByNbq(gatewayId,werks,stationBasic.getSequenceNbr().toString());
}
return CommonResponseUtil.success();
}
@ApiOperation(value = "风机-三维告警")
@GetMapping("/partofWaring3D")
public ResponseModel<Map<String, Object>> partofWaring3D(@RequestParam(value = "stationId")String stationId,@RequestParam(value = "equipNum") String equipNum) {
Map<String, Object> result = monitorFanIndicator.partofWaring3D(stationId,equipNum);
return ResponseHelper.buildResponse(result);
}
}
......@@ -158,4 +158,11 @@ public class MonitoringMapController extends BaseController {
public void getTotalData() {
monitoringServiceImpl.getTotalData();
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(value = "运行监盘-功率曲线")
@GetMapping("/getTheStationPowerCurve")
public ResponseModel<HashMap<String, Object>> getTheStationPowerCurve(@RequestParam(required = false)String stationId,@RequestParam(required = false)String date) {
return ResponseHelper.buildResponse(monitoringServiceImpl.getTheStationPowerCurve(stationId,date));
}
}
......@@ -24,5 +24,6 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
List<Map<String,Object>> getStationInfoMapByStationWerks(String WERKS, String DATAID);
List<Map<String,Object>> getStationInfoMapByStationGFWerks(String WERKS,String DATAID);
}
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* @description:
......@@ -17,4 +18,6 @@ public interface IMonitorFanIndicator {
ResultsData getNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
ResultsData getLsNationWideInfo( int current, int size, String stationBasicId, String equipmentNumber);
Map<String, Object> partofWaring3D(String stationId, String equipNum);
}
......@@ -31,6 +31,7 @@ import com.yeejoin.amos.component.robot.BadRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.runtime.directive.Break;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.BeanUtils;
......@@ -186,6 +187,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return resultsData;
}
public IPage<IndexDto> getFanIdxInfoByPage(String equipNum, String stationId, String frontModule, int current, int size, String systemType) {
StationBasic stationBasic = getOneByStationNumber(stationId);
Page<IndexDto> page = new Page<>(current, size);
......@@ -1649,5 +1652,97 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map.put("axisData",timeMap.keySet());
return map;
}
public void getListByNbq(String gatewayId,String werks,String stationId){
String sql = " SELECT * FROM indicators_"+gatewayId+" WHERE equipmentIndexName ='总直流功率' and frontModule = '逆变器'";
String sql1 = " SELECT * FROM indicators_"+gatewayId+" WHERE equipmentIndexName ='有功功率' and frontModule = '逆变器'";
List<IndicatorsDto> listData = influxDButils.getListData(sql, IndicatorsDto.class);
List<IndicatorsDto> listData1 = influxDButils.getListData(sql1, IndicatorsDto.class);
// 将两组数据合并成一个集合中 将总直流功率数据 放入 另一个集合的valueLable中
for (IndicatorsDto listDatum : listData) {
for (IndicatorsDto indicatorsDto : listData1) {
if (indicatorsDto.getEquipmentNumber().equals(listDatum.getEquipmentNumber())){
indicatorsDto.setValueLabel(listDatum.getValue());
}
}
}
List< Map<String, String>> maps = new ArrayList<>();
Set<String> nums = new HashSet<>();
//此处组装数据 每一个Map代表一个逆变器
for (IndicatorsDto indicatorsDto : listData1) {
int num = Integer.parseInt(indicatorsDto.getEquipmentNumber().substring(0, 2));
nums.add(String.valueOf(num));
Map<String, String> map = new HashMap<>();
String equipNum = indicatorsDto.getEquipmentNumber();
String number = equipNum.substring(equipNum.length() - 1);
map.put("titie",String.valueOf(num));
map.put("titie"+number,equipNum);
map.put("value"+number,indicatorsDto.getValue());
map.put("valueLabel"+number,indicatorsDto.getValueLabel());
maps.add(map);
}
TpriDmpDatabook tpriDmpDatabook = tpriDmpDatabookServiceImpl.getTpriDmpDatabookByDataName("集电线");
List<Map<String,Object>> dataMaps = sjglZsjZsbtzServiceImpl.sjglZsjZsbtzMapper.getStationInfoMapByStationGFWerks(werks, tpriDmpDatabook.getDataid().toString());
int i = 0;
//逆变器需要根据所属集电线分类组装 下面循环是将同一子阵下的不同逆变器组装为消息数据
for (Map<String, Object> dataMap : dataMaps) {
List<Map<String,String>> statusMaps = new ArrayList<>();
String equipNum = dataMap.get("equipNum").toString();
for (String num : nums) {
Map<String, String> map = new HashMap<>();
map.put("titie","#"+num);
for (Map<String, String> stringMap : maps) {
if (stringMap.get("titie").equals(num)){
map.putAll(stringMap);
}
}
if (equipNum.contains(num)){
statusMaps.add(map);
}
}
IPage<Map<String,String>> result = new Page<>();
result.setRecords(statusMaps);
result.setCurrent(1);
result.setTotal(statusMaps.size());
i += 1;
try {
emqKeeper.getMqttClient().publish(stationId+"/fj/group"+i,JSON.toJSONString(result).getBytes(),0,false);
} catch (MqttException e) {
log.info("消息发送失败");
e.printStackTrace();
}
}
}
@Override
public Map<String, Object> partofWaring3D(String stationId, String equipNum) {
Map<String,Object> resultMap=new HashMap<>();
StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String querySql = "SELECT * FROM indicators_"+stationBasic.getFanGatewayId()+" WHERE equipmentNumber = '"+equipNum+"' and equipmentIndexName =~/实时故障/";
List<IndicatorsDto> indicatorsDtoList = influxDButils.getListData(querySql,IndicatorsDto.class);
//获取风机型号
String type = indicatorsDtoList.get(0).getEquipmentSpecificName().substring(0,5);
List<String> sytemNames =Arrays.asList("发电机系统","机舱与塔筒系统","变流与主控系统","偏航与液压系统","叶轮系统");
List<SystemEnum> systemEnumListAll = systemEnumMapper.selectList(new QueryWrapper<SystemEnum>().isNotNull("system_name"));
sytemNames.forEach(name->{
resultMap.put(name,false);
List<SystemEnum> systemEnumList = systemEnumListAll.stream().filter(systemEnum -> systemEnum.getSyetemName().equals(name)).collect(Collectors.toList());
outer:for(SystemEnum systemEnum:systemEnumList) {
for (IndicatorsDto indicatorsDto : indicatorsDtoList) {
if (indicatorsDto.getEquipmentSpecificName().contains(systemEnum.getCode()) && indicatorsDto.getValue().equals(systemEnum.getEunmValue())) {
resultMap.put(name, true);
break outer;
}
}
}
});
return resultMap;
}
}
......@@ -19,4 +19,22 @@
</select>
<select id="getStationInfoMapByStationGFWerks" resultType="map">
SELECT LEFT
( b.SBMC, 4 ) AS NAME,
GROUP_CONCAT( REPLACE ( SUBSTRING_INDEX( b.SBMC, "#",- 1 ), '光伏阵区系统', '' ) ) AS equipNum
FROM
(
SELECT
*
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN ( SELECT DBID FROM `sjgl_zsj_zsbtz` WHERE MACHGENRE = ( SELECT DATAID FROM `tpri_dmp_databook` WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
) B
GROUP BY
B.FSB
</select>
</mapper>
......@@ -15,7 +15,8 @@
<module>amos-boot-module-jxiop-biz</module>
<module>amos-boot-module-hygf-api</module>
<module>amos-boot-module-hygf-biz</module>
<module>amos-boot-module-jxiop-monitor-biz</module>
<module>amos-boot-module-jxiop-monitor-biz</module>
<module>amos-boot-module-jxiop-bigscreen-biz</module>
</modules>
<dependencies>
......@@ -95,6 +96,16 @@
<artifactId>pooled-jms</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-influxdb</artifactId>
<version>1.9.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
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