Commit cd0d13a5 authored by hezhuozhi's avatar hezhuozhi

【智能分析】添加升压站并进行分析

parent 88b62f9b
...@@ -152,6 +152,9 @@ public class IdxBizFanPointVarCorrelation{ ...@@ -152,6 +152,9 @@ public class IdxBizFanPointVarCorrelation{
/** /**
* 匹配工况变量 * 匹配工况变量
*/ */
@TableField("ORG_CODE")
private String orgCode;
@TableField("MATCH_PROCESS_PONIT") @TableField("MATCH_PROCESS_PONIT")
private String matchProcessPoint; private String matchProcessPoint;
} }
...@@ -152,6 +152,10 @@ public class IdxBizPvPointVarCorrelation{ ...@@ -152,6 +152,10 @@ public class IdxBizPvPointVarCorrelation{
@TableField("PROCESS_POINT_NAME") @TableField("PROCESS_POINT_NAME")
private String processPointName; private String processPointName;
@TableField("ORG_CODE")
private String orgCode;
@TableField("MATCH_PROCESS_POINT") @TableField("MATCH_PROCESS_POINT")
private String matchProcessPoint; private String matchProcessPoint;
} }
...@@ -13,21 +13,21 @@ import java.util.Date; ...@@ -13,21 +13,21 @@ import java.util.Date;
public interface Constant { public interface Constant {
// 风电相关性消费者 // 风电相关性消费者
String kafkaTopicConsumer = "FAN_XGX"; String kafkaTopicConsumer = "FAN_XGX_NEW";
// 光伏相关性消费者 // 光伏相关性消费者
String kafkaTopicConsumerPv = "PV_XGX"; String kafkaTopicConsumerPv = "PV_XGX_NEW";
// 风电 工况区间划分 // 风电 工况区间划分
String kafkaTopicConsumerGKHFFan = "FAN_QJHF"; String kafkaTopicConsumerGKHFFan = "FAN_QJHF_NEW";
// 光伏 工况区间划分 // 光伏 工况区间划分
String kafkaTopicConsumerGKHFPv = "PV_QJHF"; String kafkaTopicConsumerGKHFPv = "PV_QJHF_NEW";
// 风电 中心值计算 // 风电 中心值计算
String kafkaTopicConsumerZXZFan = "FAN_ZXZ"; String kafkaTopicConsumerZXZFan = "FAN_ZXZ_NEW";
// 光伏 中心值计算 // 光伏 中心值计算
String kafkaTopicConsumerZXZPv = "PV_ZXZ"; String kafkaTopicConsumerZXZPv = "PV_ZXZ_NEW";
} }
...@@ -247,6 +247,7 @@ public class KafkaConsumerService { ...@@ -247,6 +247,7 @@ public class KafkaConsumerService {
idxBizFanPointVarCentralValue.setSubSystem(analysisVariable.getSubSystem()); idxBizFanPointVarCentralValue.setSubSystem(analysisVariable.getSubSystem());
idxBizFanPointVarCentralValue.setNumber(analysisVariable.getNumber()); idxBizFanPointVarCentralValue.setNumber(analysisVariable.getNumber());
idxBizFanPointVarCentralValue.setEquipmentName(analysisVariable.getEquipmentName()); idxBizFanPointVarCentralValue.setEquipmentName(analysisVariable.getEquipmentName());
idxBizFanPointVarCentralValue.setOrgCode(analysisVariable.getOrgCode());
insertList.add(idxBizFanPointVarCentralValue); insertList.add(idxBizFanPointVarCentralValue);
} }
if (CollectionUtils.isNotEmpty(insertList)) { if (CollectionUtils.isNotEmpty(insertList)) {
...@@ -963,6 +964,7 @@ public class KafkaConsumerService { ...@@ -963,6 +964,7 @@ public class KafkaConsumerService {
idxBizPvPointVarCentralValue.setSubarray(analysisVariable.getSubarray()); idxBizPvPointVarCentralValue.setSubarray(analysisVariable.getSubarray());
idxBizPvPointVarCentralValue.setManufacturer(analysisVariable.getManufacturer()); idxBizPvPointVarCentralValue.setManufacturer(analysisVariable.getManufacturer());
idxBizPvPointVarCentralValue.setEquipmentName(analysisVariable.getEquipmentName()); idxBizPvPointVarCentralValue.setEquipmentName(analysisVariable.getEquipmentName());
idxBizPvPointVarCentralValue.setOrgCode(analysisVariable.getOrgCode());
insertList.add(idxBizPvPointVarCentralValue); insertList.add(idxBizPvPointVarCentralValue);
} }
if (CollectionUtils.isNotEmpty(insertList)) { if (CollectionUtils.isNotEmpty(insertList)) {
......
package com.yeejoin.amos.boot.module.jxiop.biz.listener; package com.yeejoin.amos.boot.module.jxiop.biz.listener;
import java.text.ParseException; import cn.hutool.core.date.DateUtil;
import java.util.Date;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TdengineTimeServiceImpl; import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.TdengineTimeServiceImpl;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqxListener;
import javax.annotation.PostConstruct;
import java.text.ParseException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Date;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
/** /**
* @author Administrator * @author Administrator
...@@ -97,6 +94,12 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener { ...@@ -97,6 +94,12 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
String pvResult = pv.get(); String pvResult = pv.get();
// 区域 全域最后统一生成 // 区域 全域最后统一生成
tdengineTimeService.insertMomentDataAll(format); tdengineTimeService.insertMomentDataAll(format);
if (isWholeHour(format)){
tdengineTimeService.insertHourData();
}
if (isWholeDay(format)){
tdengineTimeService.insertDayData();
}
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
System.out.println("任务执行异常"); System.out.println("任务执行异常");
e.printStackTrace(); e.printStackTrace();
...@@ -156,4 +159,23 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener { ...@@ -156,4 +159,23 @@ public class SyncESDataToTdengineMqttListener extends EmqxListener {
// }).start(); // }).start();
// } // }
} }
private boolean isWholeHour(String dateTimeStr) {
try {
DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(dateTimeStr, FORMATTER);
return dateTime.getMinute() == 0 && dateTime.getSecond() == 0;
} catch (DateTimeParseException e) {
return false;
}
}
private boolean isWholeDay(String dateTimeStr) {
try {
DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime dateTime = LocalDateTime.parse(dateTimeStr, FORMATTER);
return dateTime.getMinute() == 0 && dateTime.getSecond() == 0 && dateTime.getHour() == 0;
} catch (DateTimeParseException e) {
return false;
}
}
} }
...@@ -100,7 +100,7 @@ public class TdengineTimeServiceImpl { ...@@ -100,7 +100,7 @@ public class TdengineTimeServiceImpl {
/** /**
* 风电 - 按小时生成测点、子系统、设备、场站、区域 数据 * 风电 - 按小时生成测点、子系统、设备、场站、区域 数据
*/ */
@Scheduled(cron = "0 0 0/1 * * ? ") // @Scheduled(cron = "0 0 0/1 * * ? ")
public void insertHourData() throws ParseException { public void insertHourData() throws ParseException {
if (!openHealth) { if (!openHealth) {
return; return;
...@@ -191,7 +191,7 @@ public class TdengineTimeServiceImpl { ...@@ -191,7 +191,7 @@ public class TdengineTimeServiceImpl {
/** /**
* 风电 - 按天生成测点、子系统、设备、场站、区域 数据 * 风电 - 按天生成测点、子系统、设备、场站、区域 数据
*/ */
@Scheduled(cron = "0 05 0 1/1 * ? ") // @Scheduled(cron = "0 05 0 1/1 * ? ")
public void insertDayData() throws ParseException { public void insertDayData() throws ParseException {
if (!openHealth) { if (!openHealth) {
return; return;
......
...@@ -26,7 +26,7 @@ spring.db6.datasource.password=Yeejoin@2020 ...@@ -26,7 +26,7 @@ spring.db6.datasource.password=Yeejoin@2020
spring.db6.datasource.driver-class-name=com.kingbase8.Driver spring.db6.datasource.driver-class-name=com.kingbase8.Driver
## eureka properties: ## eureka properties:
eureka.instance.hostname=47.92.234.253 eureka.instance.hostname=10.20.1.160
eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/ eureka.client.serviceUrl.defaultZone=http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties: ## redis properties:
spring.redis.database=1 spring.redis.database=1
...@@ -166,7 +166,7 @@ pictureUrl=upload/jxiop/syz/ ...@@ -166,7 +166,7 @@ pictureUrl=upload/jxiop/syz/
#kafka #kafka
spring.kafka.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.bootstrap-servers=10.20.0.223:9092
spring.kafka.producer.retries=1 spring.kafka.producer.retries=1
spring.kafka.producer.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.producer.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200
spring.kafka.producer.batch-size=16384 spring.kafka.producer.batch-size=16384
...@@ -175,7 +175,7 @@ spring.kafka.producer.acks=1 ...@@ -175,7 +175,7 @@ spring.kafka.producer.acks=1
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.consumer.group-id=consumerGroup spring.kafka.consumer.group-id=consumerGroup
spring.kafka.consumer.bootstrap-servers=10.20.0.223:9092,10.20.0.133:9200 spring.kafka.consumer.bootstrap-servers=10.20.0.223:9092
spring.kafka.consumer.enable-auto-commit=false spring.kafka.consumer.enable-auto-commit=false
spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
......
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