代码提交
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -22,7 +22,7 @@
|
|||||||
<module>pqs-process</module>
|
<module>pqs-process</module>
|
||||||
<module>pqs-bpm</module>
|
<module>pqs-bpm</module>
|
||||||
<module>pqs-supervision</module>
|
<module>pqs-supervision</module>
|
||||||
<module>pqs-algorithm</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>灿能微服务生态系统</name>
|
<name>灿能微服务生态系统</name>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
||||||
<middle.server.url>192.168.1.22</middle.server.url>
|
<middle.server.url>192.168.1.22</middle.server.url>
|
||||||
<!--微服务模块发布地址-->
|
<!--微服务模块发布地址-->
|
||||||
<service.server.url>127.0.0.1</service.server.url>
|
<service.server.url>192.168.1.127</service.server.url>
|
||||||
<!--docker仓库地址-->
|
<!--docker仓库地址-->
|
||||||
<docker.server.url>192.168.1.22</docker.server.url>
|
<docker.server.url>192.168.1.22</docker.server.url>
|
||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<!-- <nacos.namespace></nacos.namespace>-->
|
<!-- <nacos.namespace></nacos.namespace>-->
|
||||||
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
||||||
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
<nacos.namespace>78588706-e06f-4580-b612-b26d72493fcb</nacos.namespace>
|
||||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||||
<!-- sentinel:port-->
|
<!-- sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<artifactId>pqs-algorithm</artifactId>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>algorithm-api</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>common-core</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.njcn.algorithm.pojo.param;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 算法编排的计算参数
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0.0
|
|
||||||
* @date 2023年11月03日 09:21
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class CalculatedParam<T> implements Serializable {
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 是否全链路执行算法
|
|
||||||
* 非全链路执行时,tag集合必须非空
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(name = "fullChain",value = "是否全链执行")
|
|
||||||
private boolean fullChain;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 目前仅监测点日统计存在补招功能 by yxb
|
|
||||||
* 是否补招标识,默认不补招
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(name = "repair",value = "是否补招")
|
|
||||||
private boolean repair;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期_yyyy-MM-dd
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(name = "dataDate",value = "时间日期_yyyy-MM-dd")
|
|
||||||
private String dataDate;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 需要执行的组件
|
|
||||||
* 当不需要全链路执行时,通过tag名称动态指定执行某个算法组件
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(name = "tagNames",value = "待执行链节点的tag集合")
|
|
||||||
private Set<String> tagNames;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 待计算的对象索引集合,监测点、设备、母线、变电站、单位下监测点等等
|
|
||||||
*/
|
|
||||||
@ApiModelProperty(name = "idList",value = "索引集合")
|
|
||||||
private List<T> idList;
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<artifactId>pqs-algorithm</artifactId>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>algorithm-boot</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>common-swagger</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>common-microservice</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>common-redis</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>algorithm-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yomahub</groupId>
|
|
||||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
|
||||||
<version>2.12.4.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.yomahub</groupId>
|
|
||||||
<artifactId>liteflow-rule-nacos</artifactId>
|
|
||||||
<version>2.12.4.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--暂态模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>event-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!--稳态模块-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>harmonic-api</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>algorithmboot</finalName>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
<configuration>
|
|
||||||
<compilerArgument>-Xlint:unchecked</compilerArgument>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>repackage</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.spotify</groupId>
|
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
|
||||||
<version>1.2.2</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>build-image</id>
|
|
||||||
<phase>${docker.operate}</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<!--<serverId>36dockerHarbor</serverId>-->
|
|
||||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
|
||||||
<!-- 镜像名称 -->
|
|
||||||
<imageName>${docker.repostory}/${docker.registry.name}/${project.artifactId}</imageName>
|
|
||||||
<imageTags>
|
|
||||||
<imageTag>latest</imageTag>
|
|
||||||
</imageTags>
|
|
||||||
<dockerHost>${docker.url}</dockerHost>
|
|
||||||
<dockerDirectory>${basedir}/</dockerDirectory>
|
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<targetPath>/ROOT</targetPath>
|
|
||||||
<directory>${project.build.directory}</directory>
|
|
||||||
<include>${project.build.finalName}.jar</include>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package com.njcn.algorithm;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/4 14:05
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@EnableFeignClients(basePackages = "com.njcn")
|
|
||||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
|
||||||
public class AlgorithmApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(AlgorithmApplication.class,args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.mapper;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
|
||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 15:55
|
|
||||||
*/
|
|
||||||
public interface RMpEventDetailDMapper extends MppBaseMapper<RMpEventDetailD> {
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 处理在暂态指标明细——月报表数据获取
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/2 10:54
|
|
||||||
* @param lineIds 监测点集合
|
|
||||||
* @param dataDate 统计日期
|
|
||||||
* @param beginMonth 起始时间
|
|
||||||
* @param endMonth 截止时间
|
|
||||||
* @return List<RMpEventDetailDPO>
|
|
||||||
*/
|
|
||||||
List<RMpEventDetailM> handleMonth(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginMonth") DateTime beginMonth, @Param("endMonth") DateTime endMonth);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.mapper;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
|
||||||
* Date: 2022/12/28 14:58【需求编号】
|
|
||||||
*
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface RMpEventDetailMMapper extends MppBaseMapper<RMpEventDetailM> {
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 15:43
|
|
||||||
*/
|
|
||||||
public interface RMpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 处理在暂态指标明细——日报表数据获取
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/2 10:54
|
|
||||||
* @param lineIds 监测点集合
|
|
||||||
* @param dataDate 统计日期
|
|
||||||
* @param beginDay 起始时间
|
|
||||||
* @param endDay 截止时间
|
|
||||||
* @param voltageDip 电压暂降
|
|
||||||
* @param voltageRise 电压暂升
|
|
||||||
* @param shortInterruptions 短时中断
|
|
||||||
* @return List<RMpEventDetailDPO>
|
|
||||||
*/
|
|
||||||
List<RMpEventDetailD> handleDay(@Param("lineIds") List<String> lineIds, @Param("dataDate") String dataDate, @Param("beginDay") LocalDateTime beginDay, @Param("endDay") LocalDateTime endDay, @Param("voltageDip") String voltageDip, @Param("voltageRise") String voltageRise, @Param("shortInterruptions") String shortInterruptions);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailDMapper">
|
|
||||||
|
|
||||||
<select id="handleMonth" resultType="com.njcn.event.pojo.po.RMpEventDetailM">
|
|
||||||
SELECT
|
|
||||||
#{dataDate} dataDate,
|
|
||||||
measurement_point_id measurement_point_id,
|
|
||||||
sum(sag_times) AS sagTimes,
|
|
||||||
sum(swell_times) AS swellTimes,
|
|
||||||
sum(interrupt_times) AS interruptTimes
|
|
||||||
FROM
|
|
||||||
r_mp_event_detail_d r_mp_event_detail_d
|
|
||||||
where
|
|
||||||
r_mp_event_detail_d.data_date between #{beginMonth} and #{endMonth}
|
|
||||||
AND
|
|
||||||
r_mp_event_detail_d.measurement_point_id IN
|
|
||||||
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
|
||||||
#{lineId}
|
|
||||||
</foreach>
|
|
||||||
GROUP BY
|
|
||||||
measurement_point_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailMMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.algorithm.event.mapper.RMpEventDetailMapper">
|
|
||||||
|
|
||||||
<select id="handleDay" resultType="com.njcn.event.pojo.po.RMpEventDetailD">
|
|
||||||
SELECT
|
|
||||||
#{dataDate} dataDate,
|
|
||||||
measurement_point_id measurement_point_id,
|
|
||||||
sum( event_type = #{voltageDip} ) AS sagTimes,
|
|
||||||
sum( event_type = #{voltageRise} ) AS swellTimes,
|
|
||||||
sum( event_type = #{shortInterruptions} ) AS interruptTimes
|
|
||||||
FROM
|
|
||||||
r_mp_event_detail r_mp_event_detail
|
|
||||||
where r_mp_event_detail.start_time between #{beginDay} and #{endDay}
|
|
||||||
AND r_mp_event_detail.measurement_point_id
|
|
||||||
IN
|
|
||||||
<foreach collection="lineIds" item="lineId" separator="," open="(" close=")">
|
|
||||||
#{lineId}
|
|
||||||
</foreach>
|
|
||||||
GROUP BY
|
|
||||||
measurement_point_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 15:48
|
|
||||||
*/
|
|
||||||
public interface IRMpEventDetailDService extends IMppService<RMpEventDetailD> {
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 监测点暂态指标明细--月表算法
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/2 11:19
|
|
||||||
* @param calculatedParam 查询条件
|
|
||||||
*/
|
|
||||||
void handleMonth(CalculatedParam calculatedParam);
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 16:03
|
|
||||||
*/
|
|
||||||
public interface IRMpEventDetailMService extends IMppService<RMpEventDetailM> {
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 15:31
|
|
||||||
*/
|
|
||||||
public interface IRMpEventDetailService extends IService<RmpEventDetailPO> {
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 监测点暂态指标明细--日表算法
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/2 11:19
|
|
||||||
* @param calculatedParam 查询条件
|
|
||||||
*/
|
|
||||||
void handleDay(CalculatedParam calculatedParam);
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateTime;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
||||||
import com.njcn.algorithm.event.mapper.RMpEventDetailDMapper;
|
|
||||||
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
|
||||||
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.apache.commons.collections4.ListUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author hongawen
|
|
||||||
* @version 1.0
|
|
||||||
* @data 2024/11/6 15:49
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class RMpEventDetailDServiceImpl extends MppServiceImpl<RMpEventDetailDMapper, RMpEventDetailD> implements IRMpEventDetailDService {
|
|
||||||
|
|
||||||
|
|
||||||
private final IRMpEventDetailMService rMpEventDetailMService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
*监测点暂态指标明细--月表算法
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void handleMonth(CalculatedParam calculatedParam) {
|
|
||||||
List<String> lineIds = calculatedParam.getIdList();
|
|
||||||
//以尺寸1000分片
|
|
||||||
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1000);
|
|
||||||
DateTime beginMonth = DateUtil.beginOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
|
||||||
DateTime endMonth = DateUtil.endOfMonth(DateUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
|
||||||
for (List<String> pendingId : pendingIds) {
|
|
||||||
List<RMpEventDetailM> rMpEventDetailMPOList = this.baseMapper.handleMonth(pendingId, DateUtil.format(beginMonth, DatePattern.NORM_DATE_PATTERN), beginMonth, endMonth);
|
|
||||||
rMpEventDetailMService.saveOrUpdateBatchByMultiId(rMpEventDetailMPOList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service.impl;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
||||||
import com.njcn.algorithm.event.mapper.RMpEventDetailMMapper;
|
|
||||||
import com.njcn.algorithm.event.service.IRMpEventDetailMService;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailM;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
|
||||||
* Date: 2022/12/28 14:58【需求编号】
|
|
||||||
*
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class RMpEventDetailMServiceImpl extends MppServiceImpl<RMpEventDetailMMapper, RMpEventDetailM> implements IRMpEventDetailMService {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
package com.njcn.algorithm.event.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njcn.algorithm.event.mapper.RMpEventDetailMapper;
|
|
||||||
import com.njcn.algorithm.event.service.IRMpEventDetailDService;
|
|
||||||
import com.njcn.algorithm.event.service.IRMpEventDetailService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.event.pojo.po.RMpEventDetailD;
|
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
|
||||||
import com.njcn.system.enums.DicDataEnum;
|
|
||||||
import com.njcn.system.pojo.po.DictData;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.commons.collections4.ListUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description:
|
|
||||||
* Date: 2023/4/23 13:50【需求编号】
|
|
||||||
*
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RMpEventDetailServiceImpl extends ServiceImpl<RMpEventDetailMapper, RmpEventDetailPO> implements IRMpEventDetailService {
|
|
||||||
|
|
||||||
private final IRMpEventDetailDService rMpEventDetailDService;
|
|
||||||
|
|
||||||
private final DicDataFeignClient dicDataFeignClient;
|
|
||||||
|
|
||||||
private final RedisUtil redisUtil;
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 监测点暂态指标明细--日表算法
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void handleDay(CalculatedParam calculatedParam) {
|
|
||||||
List<String> lineIds = calculatedParam.getIdList();
|
|
||||||
//以尺寸1000分片
|
|
||||||
List<List<String>> pendingIds = ListUtils.partition(lineIds,1000);
|
|
||||||
LocalDateTime beginDay = LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
|
||||||
LocalDateTime endDay = LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN));
|
|
||||||
for (List<String> pendingId : pendingIds) {
|
|
||||||
//查询
|
|
||||||
List<RMpEventDetailD> rMpEventDetailDList = this.baseMapper.handleDay(
|
|
||||||
pendingId
|
|
||||||
,LocalDateTimeUtil.format(beginDay,DatePattern.NORM_DATE_PATTERN)
|
|
||||||
,beginDay
|
|
||||||
,endDay
|
|
||||||
,getEventTypeId(DicDataEnum.VOLTAGE_DIP.getCode())
|
|
||||||
,getEventTypeId(DicDataEnum.VOLTAGE_RISE.getCode())
|
|
||||||
,getEventTypeId(DicDataEnum.SHORT_INTERRUPTIONS.getCode()));
|
|
||||||
//入库
|
|
||||||
rMpEventDetailDService.saveOrUpdateBatchByMultiId(rMpEventDetailDList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getEventTypeId(String code) {
|
|
||||||
String eventType = redisUtil.getStringByKey(code);
|
|
||||||
eventType = Optional.ofNullable(eventType).orElseGet(() -> {
|
|
||||||
DictData data = dicDataFeignClient.getDicDataByCode(code).getData();
|
|
||||||
redisUtil.saveByKey(data.getCode(), data.getId());
|
|
||||||
return data.getId();
|
|
||||||
});
|
|
||||||
|
|
||||||
return eventType;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.njcn.algorithm.harmonic.line.mapper;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
|
||||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
public interface RMpMonitorEvaluateDMapper extends MppBaseMapper<RMpMonitorEvaluateD> {
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
package com.njcn.algorithm.harmonic.line.service;
|
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description:
|
|
||||||
* Date: 2023/4/19 15:42【需求编号】
|
|
||||||
*
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
public interface IRMpMonitorEvaluateDService extends IMppService<RMpMonitorEvaluateD> {
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 监测点报表--日统计
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/3 14:48
|
|
||||||
* @param calculatedParam 查询条件
|
|
||||||
*/
|
|
||||||
void handleDay(CalculatedParam calculatedParam);
|
|
||||||
}
|
|
||||||
@@ -1,208 +0,0 @@
|
|||||||
package com.njcn.algorithm.harmonic.line.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.core.date.DatePattern;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
||||||
import com.njcn.algorithm.harmonic.line.mapper.RMpMonitorEvaluateDMapper;
|
|
||||||
import com.njcn.algorithm.harmonic.line.service.IRMpMonitorEvaluateDService;
|
|
||||||
import com.njcn.algorithm.pojo.param.CalculatedParam;
|
|
||||||
import com.njcn.algorithm.support.mapper.PmsAbnormalRulesMapper;
|
|
||||||
import com.njcn.device.biz.commApi.CommLineClient;
|
|
||||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
|
||||||
import com.njcn.device.pq.constant.Param;
|
|
||||||
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
|
||||||
import com.njcn.harmonic.pojo.po.algorithm.line.RMpMonitorEvaluateD;
|
|
||||||
import com.njcn.influx.pojo.po.DataFlicker;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.apache.commons.collections4.ListUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author clam
|
|
||||||
* @version V1.0.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RMpMonitorEvaluateDServiceImpl extends MppServiceImpl<RMpMonitorEvaluateDMapper, RMpMonitorEvaluateD> implements IRMpMonitorEvaluateDService {
|
|
||||||
|
|
||||||
private final CommLineClient commLineClient;
|
|
||||||
// private final DataVInfluxdbService dataVInfluxdbService;
|
|
||||||
// private final PmsAbnormalRulesMapper pmsAbnormalRulesMapper;
|
|
||||||
// private final DataIntegrityRateInfluxService dataIntegrityRateInfluxService;
|
|
||||||
|
|
||||||
/***
|
|
||||||
* 监测点报表--日统计
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/3 14:48
|
|
||||||
* @param calculatedParam 查询条件
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void handleDay(CalculatedParam calculatedParam) {
|
|
||||||
// //1、取出规则
|
|
||||||
// List<PmsAbnormalRules> pmsAbnormalRules = pmsAbnormalRulesMapper.selectList(null);
|
|
||||||
// String beginDay =LocalDateTimeUtil.format(LocalDateTimeUtil.beginOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
|
||||||
// String endDay = LocalDateTimeUtil.format(LocalDateTimeUtil.endOfDay(LocalDateTimeUtil.parse(calculatedParam.getDataDate(), DatePattern.NORM_DATE_PATTERN)),DatePattern.NORM_DATETIME_PATTERN);
|
|
||||||
// //以尺寸1000分片
|
|
||||||
// List<List<String>> pendingIds = ListUtils.partition(calculatedParam.getIdList(), 100);
|
|
||||||
// for (List<String> pendingId : pendingIds) {
|
|
||||||
// List<LineDTO> lineDTOList = commLineClient.getLineDetailBatch(pendingId).getData();
|
|
||||||
// List<RMpMonitorEvaluateD> rMpMonitorEvaluateDS = new ArrayList<>();
|
|
||||||
// for (LineDTO lineDTO : lineDTOList) {
|
|
||||||
// if (ObjectUtil.isNotNull(lineDTO)) {
|
|
||||||
// /*todo 统计间隔,电压等级取值方式后期提供融合版本接口获取不然pms,pqs系统取值方式不一样*/
|
|
||||||
// /*统计间隔*/
|
|
||||||
// Integer statisticalInterval = lineDTO.getTimeInterval();
|
|
||||||
// /*电压等级*/
|
|
||||||
// Double voltage = Double.parseDouble(lineDTO.getVoltageLevel());
|
|
||||||
// List<DataVFiveItemDTO> fiveItems = dataVInfluxdbService.getFiveItems(lineDTO.getL@ineId(), beginDay, endDay, statisticalInterval);
|
|
||||||
// RMpMonitorEvaluateD rMpMonitorEvaluateD = new RMpMonitorEvaluateD();
|
|
||||||
// rMpMonitorEvaluateD = calculateRMpMonitorEvaluateDPO(rMpMonitorEvaluateD, fiveItems, pmsAbnormalRules, voltage, lineDTO);
|
|
||||||
// Date date = DateUtil.parse(beginDay);
|
|
||||||
// DataFlicker twoFlickerData = dataIntegrityRateInfluxService.getTwoFlickerData(lineDTO.getLineId(), date, 5);
|
|
||||||
// LocalDate localDate = LocalDateTimeUtil.parseDate(beginDay, DatePattern.NORM_DATETIME_PATTERN);
|
|
||||||
//
|
|
||||||
// if (Objects.isNull(twoFlickerData)) {
|
|
||||||
// rMpMonitorEvaluateD.setPltCount(0);
|
|
||||||
// rMpMonitorEvaluateD.setPstCount(0);
|
|
||||||
// } else {
|
|
||||||
// rMpMonitorEvaluateD.setPltCount(twoFlickerData.getPltCount());
|
|
||||||
// rMpMonitorEvaluateD.setPstCount(twoFlickerData.getPstCount());
|
|
||||||
// }
|
|
||||||
// rMpMonitorEvaluateD.setAllMinuteCount(fiveItems.size());
|
|
||||||
// rMpMonitorEvaluateD.setDeviceId(lineDTO.getDevId());
|
|
||||||
// rMpMonitorEvaluateD.setDataDate(localDate);
|
|
||||||
// rMpMonitorEvaluateD.setMeasurementPointId(lineDTO.getLineId());
|
|
||||||
// rMpMonitorEvaluateDS.add(rMpMonitorEvaluateD);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (CollUtil.isNotEmpty(rMpMonitorEvaluateDS)) {
|
|
||||||
// this.saveOrUpdateBatchByMultiId(rMpMonitorEvaluateDS, 500);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 3、频率在【45,55】之间;
|
|
||||||
* 4、相电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级/1.732
|
|
||||||
* 5、线电压有效值在【0.85p.u.,1.2p.u.】之间;p.u=电压等级
|
|
||||||
* 6、电压总谐波畸变率在【0.1%,20%】之间;
|
|
||||||
* 7、负序电压不平衡度在【0,20%】。满足以上条件则是一条有效数据
|
|
||||||
* @Param: [fiveItems, pmsAbnormalRules, voltage]
|
|
||||||
* @return: java.lang.Integer
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2023/2/23
|
|
||||||
*/
|
|
||||||
// private RMpMonitorEvaluateD calculateRMpMonitorEvaluateDPO(RMpMonitorEvaluateD rMpMonitorEvaluateD, List<DataVFiveItemDTO> fiveItems, List<PmsAbnormalRules> pmsAbnormalRules, Double voltage, LineDTO data) {
|
|
||||||
//
|
|
||||||
// Integer freqCount = 0;
|
|
||||||
// Integer unbalanceCount = 0;
|
|
||||||
// Integer phaseVoltageCount = 0;
|
|
||||||
// Integer lineVoltageCount = 0;
|
|
||||||
// Integer vThdCount = 0;
|
|
||||||
// Integer effectiveMinuteCount = 0;
|
|
||||||
//
|
|
||||||
// PmsAbnormalRules freqLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_FREQ)).collect(Collectors.toList()).get(0);
|
|
||||||
// PmsAbnormalRules rmsLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS)).collect(Collectors.toList()).get(0);
|
|
||||||
// PmsAbnormalRules rms_lvrLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_RMS_LVR)).collect(Collectors.toList()).get(0);
|
|
||||||
// PmsAbnormalRules v_thdLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_THD)).collect(Collectors.toList()).get(0);
|
|
||||||
// PmsAbnormalRules v_unbalanceLimit = pmsAbnormalRules.stream().filter(temp -> Objects.equals(temp.getTarget(), Param.TARGET_V_UNBALANCE)).collect(Collectors.toList()).get(0);
|
|
||||||
// if (!CollectionUtils.isEmpty(fiveItems)) {
|
|
||||||
// for (DataVFiveItemDTO fiveItem : fiveItems) {
|
|
||||||
// Double freqMax = fiveItem.getFreqMax();
|
|
||||||
// Double freqMin = fiveItem.getFreqMin();
|
|
||||||
//
|
|
||||||
// Double rmsMax = fiveItem.getRmsMax();
|
|
||||||
// Double rmsMin = fiveItem.getRmsMin();
|
|
||||||
// Double vThdMax = fiveItem.getVThdMax();
|
|
||||||
// Double vThdMin = fiveItem.getVThdMin();
|
|
||||||
//
|
|
||||||
// Double vUnbalanceMax = fiveItem.getVUnbalanceMax();
|
|
||||||
// Double vUnbalanceMin = fiveItem.getVUnbalanceMin();
|
|
||||||
// Double rmsLvrMax = fiveItem.getRmsLvrMax();
|
|
||||||
// Double rmsLvrMin = fiveItem.getRmsLvrMin();
|
|
||||||
//
|
|
||||||
// Boolean rmsflag = false;
|
|
||||||
// Boolean rmsLvrflag = false;
|
|
||||||
// Boolean vUnbalanceflag = false;
|
|
||||||
//
|
|
||||||
// freqCount++;
|
|
||||||
// unbalanceCount++;
|
|
||||||
// phaseVoltageCount++;
|
|
||||||
// lineVoltageCount++;
|
|
||||||
// vThdCount++;
|
|
||||||
// effectiveMinuteCount++;
|
|
||||||
// // 先注释掉 校验跑出监测点
|
|
||||||
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit()) {
|
|
||||||
//// freqCount++;
|
|
||||||
//// }
|
|
||||||
//// /*,监测点的接线方式,如果是星形接线这个指标要判断,角形界面则不判断,默认它是正常的*/
|
|
||||||
//// if (Objects.equals("0", data.getPtType())) {
|
|
||||||
//// if (rmsLimit.getLowerLimit() * (voltage / 1.732) <= rmsMin && rmsMax <= rmsLimit.getUpperLimit() * (voltage / 1.732)) {
|
|
||||||
//// phaseVoltageCount++;
|
|
||||||
//// rmsflag = true;
|
|
||||||
//// }
|
|
||||||
//// } else {
|
|
||||||
//// rmsflag = true;
|
|
||||||
//// phaseVoltageCount++;
|
|
||||||
//// }
|
|
||||||
//// if (Objects.equals("1", data.getPtPhaseType())) {
|
|
||||||
//// if (rms_lvrLimit.getLowerLimit() * voltage <= rmsLvrMin && rmsLvrMax <= rms_lvrLimit.getUpperLimit() * voltage) {
|
|
||||||
//// lineVoltageCount++;
|
|
||||||
//// rmsLvrflag = true;
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// } else {
|
|
||||||
//// rmsLvrflag = true;
|
|
||||||
//// lineVoltageCount++;
|
|
||||||
////
|
|
||||||
//// }
|
|
||||||
//// if (Objects.equals("1", data.getPtPhaseType()) && Objects.equals("0", data.getPtType())) {
|
|
||||||
//// if (v_unbalanceLimit.getLowerLimit() <= vUnbalanceMin && vUnbalanceMax <= v_unbalanceLimit.getUpperLimit()
|
|
||||||
//// ) {
|
|
||||||
//// unbalanceCount++;
|
|
||||||
//// vUnbalanceflag = true;
|
|
||||||
//// }
|
|
||||||
//// } else {
|
|
||||||
//// unbalanceCount++;
|
|
||||||
//// vUnbalanceflag = true;
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
////
|
|
||||||
//// if (v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit()) {
|
|
||||||
//// vThdCount++;
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
////
|
|
||||||
//// if (freqLimit.getLowerLimit() <= freqMin && freqMax <= freqLimit.getUpperLimit() &&
|
|
||||||
//// rmsflag &&
|
|
||||||
//// rmsLvrflag &&
|
|
||||||
//// v_thdLimit.getLowerLimit() <= vThdMin && vThdMax <= v_thdLimit.getUpperLimit() &&
|
|
||||||
//// vUnbalanceflag
|
|
||||||
////
|
|
||||||
//// ) {
|
|
||||||
//// effectiveMinuteCount++;
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// rMpMonitorEvaluateD.setEffectiveMinuteCount(effectiveMinuteCount);
|
|
||||||
// rMpMonitorEvaluateD.setFreqCount(freqCount);
|
|
||||||
// rMpMonitorEvaluateD.setPhaseVoltageCount(phaseVoltageCount);
|
|
||||||
// rMpMonitorEvaluateD.setLineVoltageCount(lineVoltageCount);
|
|
||||||
// rMpMonitorEvaluateD.setVThdCount(vThdCount);
|
|
||||||
// rMpMonitorEvaluateD.setUnbalanceCount(unbalanceCount);
|
|
||||||
// return rMpMonitorEvaluateD;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package com.njcn.algorithm.support.mapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njcn.device.pq.pojo.po.PmsAbnormalRules;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PmsAbnormalRulesMapper
|
|
||||||
*
|
|
||||||
* @author qijian
|
|
||||||
* @date 2022/10/26
|
|
||||||
*/
|
|
||||||
public interface PmsAbnormalRulesMapper extends BaseMapper<PmsAbnormalRules> {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.njcn.algorithm.support.mapper.PmsAbnormalRulesMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
#当前服务的基本信息
|
|
||||||
microservice:
|
|
||||||
ename: @artifactId@
|
|
||||||
name: '@name@'
|
|
||||||
version: @version@
|
|
||||||
sentinel:
|
|
||||||
url: @sentinel.url@
|
|
||||||
gateway:
|
|
||||||
url: @gateway.url@
|
|
||||||
server:
|
|
||||||
port: 10223
|
|
||||||
#feign接口开启服务熔断降级处理
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
name: @artifactId@
|
|
||||||
#nacos注册中心以及配置中心的指定
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
ip: @service.server.url@
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
config:
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
file-extension: yaml
|
|
||||||
shared-configs:
|
|
||||||
- data-id: share-config.yaml
|
|
||||||
refresh: true
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
|
|
||||||
liteflow:
|
|
||||||
rule-source: config/liteflow.el.xml
|
|
||||||
# rule-source-ext-data-map:
|
|
||||||
# serverAddr: @nacos.url@
|
|
||||||
# dataId: prepare_liteflow
|
|
||||||
# group: DEFAULT_GROUP
|
|
||||||
# namespace: @nacos.namespace@
|
|
||||||
when-max-wait-time: 600000
|
|
||||||
print-banner: false
|
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
|
||||||
logging:
|
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
|
||||||
level:
|
|
||||||
root: error
|
|
||||||
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
client-id: @artifactId@${random.value}
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<flow>
|
|
||||||
<chain name="measurement_point">
|
|
||||||
THEN(
|
|
||||||
rMpSurplusAbnormalD
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="org_point">
|
|
||||||
THEN(
|
|
||||||
WHEN(rDimBusbarHarmnic.tag("r_dim_busbar_harmnic_d")),
|
|
||||||
rOperatingIndex.tag("r_operating_index_d"),
|
|
||||||
rOperatingIndex.tag("r_operating_index_m"),
|
|
||||||
rOperatingIndex.tag("r_operating_index_q"),
|
|
||||||
rOperatingIndex.tag("r_operating_index_y"),
|
|
||||||
rStatOrg.tag("r_stat_org_d"),
|
|
||||||
rStatOrg.tag("r_stat_org_m"),
|
|
||||||
rStatOrg.tag("r_stat_org_q"),
|
|
||||||
rStatOrg.tag("r_stat_org_y"),
|
|
||||||
rStatPollutionOrg.tag("r_stat_pollution_org_d"),
|
|
||||||
rStatPollutionOrg.tag("r_stat_pollution_org_m"),
|
|
||||||
rStatPollutionOrg.tag("r_stat_pollution_org_q"),
|
|
||||||
rStatPollutionOrg.tag("r_stat_pollution_org_y"),
|
|
||||||
rStatHarmonic.tag("r_stat_harmonic_d"),
|
|
||||||
rStatHarmonic.tag("r_stat_harmonic_m"),
|
|
||||||
rStatHarmonic.tag("r_stat_harmonic_q"),
|
|
||||||
rStatHarmonic.tag("r_stat_harmonic_y"),
|
|
||||||
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_d"),
|
|
||||||
rStatHarmonicVoltage.tag("r_stat_harmonic_voltage_m"),
|
|
||||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_d"),
|
|
||||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_m"),
|
|
||||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_q"),
|
|
||||||
rStatHarmonicOrg.tag("r_stat_harmonic_org_y"),
|
|
||||||
rStatEvent.tag("r_stat_event_d"),
|
|
||||||
rStatEvent.tag("r_stat_event_m"),
|
|
||||||
rStatEvent.tag("r_stat_event_q"),
|
|
||||||
rStatEvent.tag("r_stat_event_y"),
|
|
||||||
rStatEventVoltage.tag("r_stat_event_voltage_d"),
|
|
||||||
rStatEventVoltage.tag("r_stat_event_voltage_m"),
|
|
||||||
rStatEventOrg.tag("r_stat_event_org_d"),
|
|
||||||
rStatEventOrg.tag("r_stat_event_org_m"),
|
|
||||||
rStatEventOrg.tag("r_stat_event_org_q"),
|
|
||||||
rStatEventOrg.tag("r_stat_event_org_y"),
|
|
||||||
rStatEventLoadType.tag("r_stat_load_type_d"),
|
|
||||||
rStatEventLoadType.tag("r_stat_load_type_m"),
|
|
||||||
rStatEventLoadType.tag("r_stat_load_type_q"),
|
|
||||||
rStatEventLoadType.tag("r_stat_load_type_y"),
|
|
||||||
rStatAlarmCount.tag("r_stat_alarm_count_w"),
|
|
||||||
rStatAlarmCount.tag("r_stat_area_alarm_count_m"),
|
|
||||||
rDimBusTarget.tag("r_dim_bus_target_d"),
|
|
||||||
rDimBusTarget.tag("r_dim_bus_target_m"),
|
|
||||||
rDimBusTarget.tag("r_dim_bus_target_y"),
|
|
||||||
rDimObjTarget.tag("r_dim_obj_target_d"),
|
|
||||||
rDimObjTarget.tag("r_dim_obj_target_m"),
|
|
||||||
rDimObjTarget.tag("r_dim_obj_target_y"),
|
|
||||||
rDimObjGlobal.tag("r_dim_obj_global_d"),
|
|
||||||
rDimObjGlobal.tag("r_dim_obj_global_m"),
|
|
||||||
rDimObjGlobal.tag("r_dim_obj_global_y"),
|
|
||||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_d"),
|
|
||||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_m"),
|
|
||||||
rDimObjBusStationEventStartis.tag("r_dim_bus_station_event_startis_y")
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="sub_station">
|
|
||||||
THEN(
|
|
||||||
THEN(
|
|
||||||
rUploadSubStatisticalData
|
|
||||||
),
|
|
||||||
THEN(
|
|
||||||
rStatSubstation.tag("r_stat_substation_d"),
|
|
||||||
rStatSubstation.tag("r_stat_substation_m"),
|
|
||||||
rStatSubstation.tag("r_stat_substation_q"),
|
|
||||||
rStatSubstation.tag("r_stat_substation_y")
|
|
||||||
),
|
|
||||||
THEN(
|
|
||||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_d"),
|
|
||||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_m"),
|
|
||||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_q"),
|
|
||||||
rStatPollutionSubstation.tag("r_stat_pollution_substation_y")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="dim_station_busbar">
|
|
||||||
THEN(
|
|
||||||
THEN(
|
|
||||||
rDimObjEvent.tag("r_dim_obj_event_d"),
|
|
||||||
rDimObjEvent.tag("r_dim_obj_event_m"),
|
|
||||||
rDimObjEvent.tag("r_dim_obj_event_y")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="genera_trix">
|
|
||||||
THEN(
|
|
||||||
THEN(
|
|
||||||
rBusbarVoltage.tag("r_dim_voltage_d"),
|
|
||||||
rBusbarVoltage.tag("r_dim_voltage_m"),
|
|
||||||
rBusbarVoltage.tag("r_dim_voltage_y")
|
|
||||||
),
|
|
||||||
THEN(
|
|
||||||
rStatBusbarHarmonicY
|
|
||||||
),
|
|
||||||
THEN(
|
|
||||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_d"),
|
|
||||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_m"),
|
|
||||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_q"),
|
|
||||||
rStatOrgBusBarVoltage.tag("r_stat_org_busbar_voltage_y")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="upload_org">
|
|
||||||
THEN(
|
|
||||||
rUploadPointStatisticalData,
|
|
||||||
rUploadEvaluationData,
|
|
||||||
pqTypicalSourceCreatePOService
|
|
||||||
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
<chain name="orgSub_station">
|
|
||||||
THEN(
|
|
||||||
THEN(
|
|
||||||
rStatSubstationVoltage.tag("r_stat_substation_voltage_m")
|
|
||||||
)
|
|
||||||
);
|
|
||||||
</chain>
|
|
||||||
</flow>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.njcn</groupId>
|
|
||||||
<artifactId>pqs</artifactId>
|
|
||||||
<version>1.0.0</version>
|
|
||||||
</parent>
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
<modules>
|
|
||||||
<module>algorithm-api</module>
|
|
||||||
<module>algorithm-boot</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<artifactId>pqs-algorithm</artifactId>
|
|
||||||
<description>算法模块</description>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>8</maven.compiler.source>
|
|
||||||
<maven.compiler.target>8</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.njcn.device.pq.constant;
|
package com.njcn.device.pq.constant;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -16,7 +18,53 @@ public interface Param {
|
|||||||
String TARGET_RMS_LVR = "rms_lvr";
|
String TARGET_RMS_LVR = "rms_lvr";
|
||||||
String TARGET_V_THD = "v_thd";
|
String TARGET_V_THD = "v_thd";
|
||||||
String TARGET_V_UNBALANCE = "v_unbalance";
|
String TARGET_V_UNBALANCE = "v_unbalance";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
String freq = "freq$DataV";
|
||||||
|
String freq_dev = "freq_dev$DataV";
|
||||||
|
|
||||||
|
|
||||||
|
String rms_v = "rms$DataV";
|
||||||
|
String rms_lvr ="rms_lvr$DataV";
|
||||||
|
String vu_dev ="vu_dev$DataV";
|
||||||
|
String rms_i ="rms$DataI";
|
||||||
|
|
||||||
|
String v_thd = "v_thd$DataV";
|
||||||
|
//相(线)电压基波有效值
|
||||||
|
String v_1_v = "v_1$DataV";
|
||||||
|
|
||||||
|
//相(线)电压基波相角
|
||||||
|
String phasic_v_1 = "v_1$DataHarmPhasicV";
|
||||||
|
|
||||||
|
//谐波电压相角
|
||||||
|
String phasic_rate_$ = "v_?$DataHarmPhasicV";
|
||||||
|
//谐波电压含有率
|
||||||
|
String v_rate = "v_?$DataHarmRateV";
|
||||||
|
//间谐波电压含有率
|
||||||
|
String in_v_rate = "v_?$DataInHarmV";
|
||||||
|
//正序、负序和零序电压
|
||||||
|
String v_zero = "v_zero$DataV";
|
||||||
|
String v_pos = "v_pos$DataV";
|
||||||
|
String v_neg = "v_neg$DataV";
|
||||||
|
|
||||||
|
//三相电压不平衡度
|
||||||
|
String v_unbalance ="v_unbalance$DataV";
|
||||||
|
|
||||||
|
//电压波动
|
||||||
|
String fluc = "fluc$DataFluc";
|
||||||
|
|
||||||
|
//短时间闪变值
|
||||||
|
String plt = "plt$DataPlt";
|
||||||
|
|
||||||
|
|
||||||
|
//长时间闪变值
|
||||||
|
String pst = "pst$DataPlt";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Integer YEAR = 1;
|
Integer YEAR = 1;
|
||||||
Integer QUARTER = 2;
|
Integer QUARTER = 2;
|
||||||
Integer MONTH = 3;
|
Integer MONTH = 3;
|
||||||
|
|||||||
@@ -41,12 +41,6 @@ public enum LineBaseEnum {
|
|||||||
POWER_FLAG(0,"电网侧"),
|
POWER_FLAG(0,"电网侧"),
|
||||||
POWER_FLAG_NOT(1,"非电网侧"),
|
POWER_FLAG_NOT(1,"非电网侧"),
|
||||||
|
|
||||||
|
|
||||||
RUN(0,"在运"),
|
|
||||||
WAITE_RUN(1,"调试"),
|
|
||||||
STOP_RUN(2,"停运")
|
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Integer code;
|
private final Integer code;
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-03-27
|
||||||
|
* @Description: 指标异常实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PowerQualityIndicatorsVO {
|
||||||
|
|
||||||
|
// 频率,范围 42.5~57.5
|
||||||
|
private double frequency;
|
||||||
|
// 频率偏差,范围 -7.5~7.5
|
||||||
|
private double frequencyDeviation;
|
||||||
|
// 相(线)电压有效值,范围 0~150%U
|
||||||
|
private double phaseOrLineVoltageRms;
|
||||||
|
// 电压偏差,范围 -20%~20%
|
||||||
|
private double voltageDeviation;
|
||||||
|
// 电流有效值,大于 CT 一次变比
|
||||||
|
private double currentRms;
|
||||||
|
// 单相功率因数,范围 -1~1
|
||||||
|
private double singlePhasePowerFactor;
|
||||||
|
// 单相基波功率因数,范围 -1~1
|
||||||
|
private double singlePhaseFundamentalPowerFactor;
|
||||||
|
// 三相功率因数,范围 -1~1
|
||||||
|
private double threePhasePowerFactor;
|
||||||
|
// 基波功率因数,范围 -1~1
|
||||||
|
private double fundamentalPowerFactor;
|
||||||
|
// 电压总谐波畸变率,范围 0~30%
|
||||||
|
private double voltageTotalHarmonicDistortion;
|
||||||
|
// 相(线)电压基波有效值,范围 0~150%U
|
||||||
|
private double phaseOrLineVoltageFundamentalRms;
|
||||||
|
// 相(线)电压基波相角,范围 -180~180
|
||||||
|
private double phaseOrLineVoltageFundamentalPhaseAngle;
|
||||||
|
// 谐波电压含有率,范围 0~30%
|
||||||
|
private double harmonicVoltageContentRate;
|
||||||
|
// 谐波电压相角,范围 -180~180
|
||||||
|
private double harmonicVoltagePhaseAngle;
|
||||||
|
// 间谐波电压含有率,范围 0~30%
|
||||||
|
private double interHarmonicVoltageContentRate;
|
||||||
|
// 正序、负序和零序电压,范围 0~150%U
|
||||||
|
private double positiveNegativeZeroSequenceVoltage;
|
||||||
|
// 负序电压不平衡度,范围 0~40%
|
||||||
|
private double balanceV;
|
||||||
|
// 零序电压不平衡度,范围 0~40%
|
||||||
|
private double zeroSequenceVoltageUnbalanceDegree;
|
||||||
|
// 电压波动,范围 0~40%
|
||||||
|
private double voltageFluctuation;
|
||||||
|
// 短时间闪变值,范围 0~20
|
||||||
|
private double shortTermFlickerValue;
|
||||||
|
// 长时间闪变值,范围 0~20
|
||||||
|
private double longTermFlickerValue;
|
||||||
|
// 电压暂降特征幅值,范围 0~90%
|
||||||
|
private double voltageSagCharacteristicAmplitude;
|
||||||
|
// 电压暂升特征幅值
|
||||||
|
private double voltageSwellCharacteristicAmplitude;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: cdf
|
* @Author: cdf
|
||||||
* @CreateTime: 2025-03-26
|
* @CreateTime: 2025-03-26
|
||||||
@@ -10,8 +14,64 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class VerifyMonitorVO {
|
public class VerifyMonitorVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在运测点数量",name = "runNum")
|
||||||
private Integer runNum;
|
private Integer runNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "异常测点数量",name = "abnormalNum")
|
||||||
private Integer abnormalNum;
|
private Integer abnormalNum;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 频率,范围 42.5~57.5
|
||||||
|
private double frequency;
|
||||||
|
// 频率偏差,范围 -7.5~7.5
|
||||||
|
private double frequencyDeviation;
|
||||||
|
// 相(线)电压有效值,范围 0~150%U
|
||||||
|
private double phaseOrLineVoltageRms;
|
||||||
|
// 电压偏差,范围 -20%~20%
|
||||||
|
private double voltageDeviation;
|
||||||
|
// 电流有效值,大于 CT 一次变比
|
||||||
|
private double currentRms;
|
||||||
|
// 单相功率因数,范围 -1~1
|
||||||
|
private double singlePhasePowerFactor;
|
||||||
|
// 单相基波功率因数,范围 -1~1
|
||||||
|
private double singlePhaseFundamentalPowerFactor;
|
||||||
|
// 三相功率因数,范围 -1~1
|
||||||
|
private double threePhasePowerFactor;
|
||||||
|
// 基波功率因数,范围 -1~1
|
||||||
|
private double fundamentalPowerFactor;
|
||||||
|
// 电压总谐波畸变率,范围 0~30%
|
||||||
|
private double voltageTotalHarmonicDistortion;
|
||||||
|
// 相(线)电压基波有效值,范围 0~150%U
|
||||||
|
private double phaseOrLineVoltageFundamentalRms;
|
||||||
|
// 相(线)电压基波相角,范围 -180~180
|
||||||
|
private double phaseOrLineVoltageFundamentalPhaseAngle;
|
||||||
|
// 谐波电压含有率,范围 0~30%
|
||||||
|
private double harmonicVoltageContentRate;
|
||||||
|
// 谐波电压相角,范围 -180~180
|
||||||
|
private double harmonicVoltagePhaseAngle;
|
||||||
|
// 间谐波电压含有率,范围 0~30%
|
||||||
|
private double interHarmonicVoltageContentRate;
|
||||||
|
// 正序、负序和零序电压,范围 0~150%U
|
||||||
|
private double positiveNegativeZeroSequenceVoltage;
|
||||||
|
// 负序电压不平衡度,范围 0~40%
|
||||||
|
private double BalanceV;
|
||||||
|
// 零序电压不平衡度,范围 0~40%
|
||||||
|
private double zeroSequenceVoltageUnbalanceDegree;
|
||||||
|
// 电压波动,范围 0~40%
|
||||||
|
private double voltageFluctuation;
|
||||||
|
// 短时间闪变值,范围 0~20
|
||||||
|
private double shortTermFlickerValue;
|
||||||
|
// 长时间闪变值,范围 0~20
|
||||||
|
private double longTermFlickerValue;
|
||||||
|
// 电压暂降特征幅值,范围 0~90%
|
||||||
|
private double voltageSagCharacteristicAmplitude;
|
||||||
|
// 电压暂升特征幅值
|
||||||
|
private double voltageSwellCharacteristicAmplitude;
|
||||||
|
|
||||||
|
|
||||||
|
private List<Map<String,Object>> mapList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
package com.njcn.device.pq.controller;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: cdf
|
|
||||||
* @CreateTime: 2025-03-26
|
|
||||||
* @Description: 异常数据清洗
|
|
||||||
*/
|
|
||||||
public class AbnormalDataController {
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||||
import com.njcn.device.pq.service.IDataVerifyService;
|
import com.njcn.device.pq.service.IDataVerifyService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -53,17 +54,18 @@ public class DataVerifyController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/* *//**
|
||||||
* 获取时间范围异常测点数量
|
* 异常指标统计
|
||||||
*/
|
*//*
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getRangeAbnormalMonitor")
|
@PostMapping("/getAbnormalTarget")
|
||||||
@ApiOperation("获取异常监测点相关信息")
|
@ApiOperation("获取异常监测点相关信息")
|
||||||
public HttpResult<List<Map<String,Object>>> getRangeAbnormalMonitor(@RequestBody MonitorBaseParam monitorBaseParam){
|
public HttpResult<PowerQualityIndicatorsVO> getAbnormalTarget(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||||
String methodDescribe = getMethodDescribe("getRangeAbnormalMonitor");
|
String methodDescribe = getMethodDescribe("getAbnormalTarget");
|
||||||
List<Map<String,Object>> verifyMonitorVO = iDataVerifyService.getRangeAbnormalMonitor(monitorBaseParam);
|
PowerQualityIndicatorsVO powerQualityIndicatorsVO = iDataVerifyService.getAbnormalTarget(monitorBaseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, powerQualityIndicatorsVO, methodDescribe);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public interface DeptLineMapper extends BaseMapper<DeptLine> {
|
|||||||
|
|
||||||
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,@Param("powerFlag")Integer powerFlag,@Param("lineRunFlag") Integer lineRunFlag);
|
List<TerminalGetBase.Extend> orgSubStationInfoGet(@Param("list")List<Integer> devType,@Param("powerFlag")Integer powerFlag,@Param("lineRunFlag") Integer lineRunFlag);
|
||||||
|
|
||||||
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType);
|
List<String> getLineIdByDeptIds(@Param("deptIds")List<String> deptIds,@Param("runFlag")List<Integer> runFlag,@Param("dataType")List<Integer> dataType,@Param("objType")String objType);
|
||||||
|
|
||||||
|
|
||||||
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
List<SubGetBase> selectSubStationList(@Param("param") SubstationParam substationParam);
|
||||||
|
|||||||
@@ -145,6 +145,9 @@
|
|||||||
<foreach collection="runFlag" item="item" open="(" close=")" separator=",">
|
<foreach collection="runFlag" item="item" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
<if test="objType!=null and objType!=''">
|
||||||
|
and lineDetail.big_obj_type = #{objType}
|
||||||
|
</if>
|
||||||
and pq_dept_line.id in
|
and pq_dept_line.id in
|
||||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||||
#{item}
|
#{item}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service;
|
|||||||
import com.njcn.device.biz.pojo.dto.*;
|
import com.njcn.device.biz.pojo.dto.*;
|
||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -88,7 +89,7 @@ public interface CommTerminalService {
|
|||||||
List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam);
|
List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过部门id获取在运测点
|
* 通过部门id,对象类型,返回在运,实际装置,双系统测点
|
||||||
*/
|
*/
|
||||||
List<String> getRunMonitorByDept(String deptId);
|
List<String> getRunMonitorByDept(MonitorBaseParam monitorBaseParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public interface DeptLineService extends IService<DeptLine> {
|
|||||||
* @param ids 部门ids
|
* @param ids 部门ids
|
||||||
* @return 查询结果
|
* @return 查询结果
|
||||||
*/
|
*/
|
||||||
List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType);
|
List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType,String objType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门解除绑定监测点
|
* 部门解除绑定监测点
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -22,6 +23,8 @@ public interface IDataVerifyService extends IService<DataVerify> {
|
|||||||
VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam);
|
VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam);
|
||||||
|
|
||||||
|
|
||||||
List<Map<String,Object>> getRangeAbnormalMonitor(MonitorBaseParam monitorBaseParam);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import com.njcn.device.biz.pojo.dto.*;
|
|||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||||
|
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
import com.njcn.device.pq.mapper.OverlimitMapper;
|
import com.njcn.device.pq.mapper.OverlimitMapper;
|
||||||
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.service.CommTerminalService;
|
import com.njcn.device.pq.service.CommTerminalService;
|
||||||
import com.njcn.device.pq.service.DeptLineService;
|
import com.njcn.device.pq.service.DeptLineService;
|
||||||
import com.njcn.redis.utils.RedisUtil;
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
@@ -292,9 +294,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getRunMonitorByDept(String deptId) {
|
public List<String> getRunMonitorByDept(MonitorBaseParam monitorBaseParam) {
|
||||||
List<String> ids = deptFeignClient.getDepSonIdtByDeptId(deptId).getData();
|
List<String> ids = deptFeignClient.getDepSonIdtByDeptId(monitorBaseParam.getDeptId()).getData();
|
||||||
List<String> monitorIds = deptLineService.getLineByDeptIds(ids,Stream.of(LineBaseEnum.RUN.getCode()).collect(Collectors.toList()),Stream.of(0,1,2).collect(Collectors.toList()));
|
List<String> monitorIds = deptLineService.getLineByDeptIds(ids,Stream.of(RunFlagEnum.RUNNING.getStatus()).collect(Collectors.toList()),Stream.of(0,1,2).collect(Collectors.toList()),monitorBaseParam.getObjType());
|
||||||
return monitorIds;
|
return monitorIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.date.*;
|
import cn.hutool.core.date.*;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||||
|
import com.njcn.device.pq.constant.Param;
|
||||||
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
import com.njcn.device.pq.mapper.LineMapper;
|
||||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||||
import com.njcn.device.pq.service.CommTerminalService;
|
import com.njcn.device.pq.service.CommTerminalService;
|
||||||
import com.njcn.device.pq.service.IDataVerifyService;
|
import com.njcn.device.pq.service.IDataVerifyService;
|
||||||
@@ -19,8 +22,11 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.njcn.device.pq.constant.Param.freq;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 服务实现类
|
* 服务实现类
|
||||||
@@ -37,32 +43,31 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam.getDeptId());
|
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||||
LambdaQueryWrapper<DataVerify> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.select(DataVerify::getLineId).between(DataVerify::getTime, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
|
||||||
.in(DataVerify::getLineId,monitorIds).groupBy(DataVerify::getLineId);
|
|
||||||
List<DataVerify> list = this.list(lambdaQueryWrapper);
|
|
||||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
|
||||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
|
||||||
verifyMonitorVO.setAbnormalNum(list.size());
|
|
||||||
return verifyMonitorVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Map<String, Object>> getRangeAbnormalMonitor(MonitorBaseParam monitorBaseParam) {
|
|
||||||
List<Map<String, Object>> result = new ArrayList<>();
|
|
||||||
|
|
||||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam.getDeptId());
|
|
||||||
LambdaQueryWrapper<DataVerify> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<DataVerify> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.between(DataVerify::getTime, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
lambdaQueryWrapper.between(DataVerify::getTime, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())),DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||||
.in(DataVerify::getLineId,monitorIds);
|
.in(DataVerify::getLineId,monitorIds);
|
||||||
List<DataVerify> dataVerifyList = this.list(lambdaQueryWrapper);
|
List<DataVerify> dataVerifyList = this.list(lambdaQueryWrapper);
|
||||||
|
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||||
|
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||||
|
int count = dataVerifyList.stream().collect(Collectors.groupingBy(DataVerify::getLineId)).size();
|
||||||
|
verifyMonitorVO.setAbnormalNum(count);
|
||||||
|
|
||||||
|
List<Map<String, Object>> mapList = getRangeAbnormalMonitor(monitorBaseParam,dataVerifyList);
|
||||||
|
verifyMonitorVO.setMapList(mapList);
|
||||||
|
getAbnormalTarget(dataVerifyList,verifyMonitorVO);
|
||||||
|
return verifyMonitorVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间范围异常测点数量
|
||||||
|
*/
|
||||||
|
private List<Map<String, Object>> getRangeAbnormalMonitor(MonitorBaseParam monitorBaseParam,List<DataVerify> dataVerifyList) {
|
||||||
|
List<Map<String, Object>> result = new ArrayList<>();
|
||||||
DateTime startTime = DateUtil.parse(monitorBaseParam.getSearchBeginTime());
|
DateTime startTime = DateUtil.parse(monitorBaseParam.getSearchBeginTime());
|
||||||
DateTime endTime = DateUtil.parse(monitorBaseParam.getSearchEndTime());
|
DateTime endTime = DateUtil.parse(monitorBaseParam.getSearchEndTime());
|
||||||
if(startTime.year() == endTime.year() && startTime.month() == endTime.month()){
|
if(startTime.year() == endTime.year() && startTime.month() == endTime.month()){
|
||||||
DateRange ranged = DateUtil.range(DateUtil.parse(monitorBaseParam.getSearchBeginTime()),DateUtil.parse(monitorBaseParam.getSearchEndTime()), DateField.DAY_OF_MONTH);
|
DateRange ranged = DateUtil.range(DateUtil.parse(monitorBaseParam.getSearchBeginTime()),DateUtil.parse(monitorBaseParam.getSearchEndTime()), DateField.DAY_OF_MONTH);
|
||||||
|
|
||||||
Map<String,Integer> map = dataVerifyList.stream().collect(Collectors.groupingBy(it->it.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)),
|
Map<String,Integer> map = dataVerifyList.stream().collect(Collectors.groupingBy(it->it.getTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)),
|
||||||
Collectors.mapping(DataVerify::getLineId, Collectors.collectingAndThen(Collectors.toSet(), Set::size))));
|
Collectors.mapping(DataVerify::getLineId, Collectors.collectingAndThen(Collectors.toSet(), Set::size))));
|
||||||
for (DateTime dateTime : ranged) {
|
for (DateTime dateTime : ranged) {
|
||||||
@@ -72,7 +77,6 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
rangeMap.put("val", map.getOrDefault(time, 0));
|
rangeMap.put("val", map.getOrDefault(time, 0));
|
||||||
result.add(rangeMap);
|
result.add(rangeMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
//不在一个月则展示月数据
|
//不在一个月则展示月数据
|
||||||
DateRange ranged = DateUtil.range(DateUtil.parse(monitorBaseParam.getSearchBeginTime()),DateUtil.parse(monitorBaseParam.getSearchEndTime()), DateField.MONTH);
|
DateRange ranged = DateUtil.range(DateUtil.parse(monitorBaseParam.getSearchBeginTime()),DateUtil.parse(monitorBaseParam.getSearchEndTime()), DateField.MONTH);
|
||||||
@@ -88,8 +92,98 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指标异常测点数量
|
||||||
|
*/
|
||||||
|
public void getAbnormalTarget(List<DataVerify> dataVerifyList,VerifyMonitorVO powerQualityIndicatorsVO) {
|
||||||
|
Map<String,Set<String>> map = dataVerifyList.stream().collect(Collectors.groupingBy(it->it.getIndexCode()+"$"+it.getIndexTable(),Collectors.mapping(DataVerify::getLineId, Collectors.toSet())));
|
||||||
|
Pattern patternPhasic = Pattern.compile("v_(2|[3-9]|[1-4][0-9]|50)\\$data_harmphasic_v");
|
||||||
|
Pattern patternRate = Pattern.compile("v_(2|[3-9]|[1-4][0-9]|50)\\$data_harmrate_v");
|
||||||
|
Pattern patternInRate = Pattern.compile("v_(2|[3-9]|[1-4][0-9]|50)\\$data_inharmrate_v");
|
||||||
|
|
||||||
|
Set<String> harmPhasicSet = new HashSet<>();
|
||||||
|
Set<String> harmVSet = new HashSet<>();
|
||||||
|
Set<String> inHarmVSet = new HashSet<>();
|
||||||
|
|
||||||
|
//正序、负序和零序电压
|
||||||
|
Set<String> posVSet = new HashSet<>();
|
||||||
|
map.forEach((key,num)->{
|
||||||
|
if(patternPhasic.matcher(key).matches()){
|
||||||
|
key = Param.phasic_rate_$;
|
||||||
|
}else if(patternRate.matcher(key).matches()){
|
||||||
|
key = Param.v_rate;
|
||||||
|
}else if(patternInRate.matcher(key).matches()){
|
||||||
|
key = Param.in_v_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (key){
|
||||||
|
case freq:
|
||||||
|
powerQualityIndicatorsVO.setFrequency(num.size());
|
||||||
|
break;
|
||||||
|
case Param.freq_dev:
|
||||||
|
powerQualityIndicatorsVO.setFrequencyDeviation(num.size());
|
||||||
|
break;
|
||||||
|
case Param.rms_v:
|
||||||
|
powerQualityIndicatorsVO.setPhaseOrLineVoltageRms(powerQualityIndicatorsVO.getPhaseOrLineVoltageRms()+num.size());
|
||||||
|
break;
|
||||||
|
case Param.rms_lvr:
|
||||||
|
powerQualityIndicatorsVO.setPhaseOrLineVoltageRms(powerQualityIndicatorsVO.getPhaseOrLineVoltageRms()+num.size());
|
||||||
|
break;
|
||||||
|
case Param.vu_dev:
|
||||||
|
powerQualityIndicatorsVO.setVoltageDeviation(num.size());
|
||||||
|
break;
|
||||||
|
case Param.rms_i:
|
||||||
|
powerQualityIndicatorsVO.setCurrentRms(num.size());
|
||||||
|
break;
|
||||||
|
case Param.v_thd:
|
||||||
|
powerQualityIndicatorsVO.setVoltageTotalHarmonicDistortion(num.size());
|
||||||
|
break;
|
||||||
|
case Param.v_1_v:
|
||||||
|
powerQualityIndicatorsVO.setPhaseOrLineVoltageFundamentalRms(num.size());
|
||||||
|
break;
|
||||||
|
case Param.phasic_v_1:
|
||||||
|
powerQualityIndicatorsVO.setPhaseOrLineVoltageFundamentalPhaseAngle(num.size());
|
||||||
|
break;
|
||||||
|
case Param.phasic_rate_$:
|
||||||
|
harmPhasicSet.addAll(num);
|
||||||
|
break;
|
||||||
|
case Param.v_rate:
|
||||||
|
harmVSet.addAll(num);
|
||||||
|
break;
|
||||||
|
case Param.in_v_rate:
|
||||||
|
inHarmVSet.addAll(num);
|
||||||
|
break;
|
||||||
|
case Param.v_zero:
|
||||||
|
case Param.v_neg:
|
||||||
|
case Param.v_pos:
|
||||||
|
posVSet.addAll(num);
|
||||||
|
break;
|
||||||
|
case Param.v_unbalance:
|
||||||
|
powerQualityIndicatorsVO.setBalanceV(num.size());
|
||||||
|
break;
|
||||||
|
case Param.fluc:
|
||||||
|
powerQualityIndicatorsVO.setVoltageFluctuation(num.size());
|
||||||
|
break;
|
||||||
|
case Param.plt:
|
||||||
|
powerQualityIndicatorsVO.setShortTermFlickerValue(num.size());
|
||||||
|
break;
|
||||||
|
case Param.pst:
|
||||||
|
powerQualityIndicatorsVO.setLongTermFlickerValue(num.size());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.out.println("存在未知指标:"+key);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
powerQualityIndicatorsVO.setHarmonicVoltagePhaseAngle(harmPhasicSet.size());
|
||||||
|
powerQualityIndicatorsVO.setHarmonicVoltageContentRate(harmVSet.size());
|
||||||
|
powerQualityIndicatorsVO.setInterHarmonicVoltageContentRate(inHarmVSet.size());
|
||||||
|
powerQualityIndicatorsVO.setPositiveNegativeZeroSequenceVoltage(posVSet.size());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ public class DeptLineServiceImpl extends ServiceImpl<DeptLineMapper, DeptLine> i
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType) {
|
public List<String> getLineByDeptIds(List<String> ids,List<Integer> runFlag,List<Integer> dataType,String objType) {
|
||||||
return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType);
|
return this.baseMapper.getLineIdByDeptIds(ids,runFlag,dataType,objType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -767,8 +767,7 @@ public class GeneralDeviceService {
|
|||||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, Stream.of(0, 1).collect(Collectors.toList())).getData();
|
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||||
if (CollUtil.isNotEmpty(deptDTOList)) {
|
if (CollUtil.isNotEmpty(deptDTOList)) {
|
||||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||||
|
return deptLineService.getLineByDeptIds(deptIds,runFlag,dataType,null);
|
||||||
return deptLineService.getLineByDeptIds(deptIds,runFlag,dataType);
|
|
||||||
}
|
}
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,18 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>cs-device-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>algorithm-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package com.njcn.system.timer.tasks;
|
|||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||||
|
import com.njcn.algorithm.pojo.liteflow.LiteFlowAlgorithmFeignClient;
|
||||||
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
import com.njcn.prepare.harmonic.api.liteflow.LiteFlowFeignClient;
|
||||||
import com.njcn.prepare.harmonic.pojo.bo.BaseParam;
|
|
||||||
import com.njcn.system.timer.TimerTaskRunner;
|
import com.njcn.system.timer.TimerTaskRunner;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -22,6 +23,8 @@ public class MeasurementTaskRunner implements TimerTaskRunner {
|
|||||||
|
|
||||||
private final LiteFlowFeignClient liteFlowFeignClient;
|
private final LiteFlowFeignClient liteFlowFeignClient;
|
||||||
|
|
||||||
|
private final LiteFlowAlgorithmFeignClient liteFlowAlgorithmFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void action(String date) {
|
public void action(String date) {
|
||||||
BaseParam baseParam = new BaseParam();
|
BaseParam baseParam = new BaseParam();
|
||||||
@@ -32,7 +35,7 @@ public class MeasurementTaskRunner implements TimerTaskRunner {
|
|||||||
}else {
|
}else {
|
||||||
baseParam.setDataDate(date);
|
baseParam.setDataDate(date);
|
||||||
}
|
}
|
||||||
liteFlowFeignClient.measurementPointExecutor(baseParam);
|
liteFlowAlgorithmFeignClient.measurementPointExecutor(baseParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user