Merge remote-tracking branch 'origin/master'

This commit is contained in:
Lee
2023-03-30 16:22:31 +08:00
79 changed files with 656 additions and 312 deletions

14
pom.xml
View File

@@ -19,7 +19,6 @@
<module>pqs-event</module> <module>pqs-event</module>
<module>pqs-job</module> <module>pqs-job</module>
<module>pqs-job/job-api</module> <module>pqs-job/job-api</module>
<module>pqs-advance</module>
<module>pqs-prepare</module> <module>pqs-prepare</module>
<module>pqs-process</module> <module>pqs-process</module>
<module>pqs-algorithm</module> <module>pqs-algorithm</module>
@@ -42,17 +41,22 @@
</distributionManagement> </distributionManagement>
<properties> <properties>
<!--中间件目标地址--> <!--中间件目标地址-->
<middle.server.url>192.168.1.13</middle.server.url> <!-- <middle.server.url>198.120.100.195</middle.server.url>-->
<middle.server.url>192.168.1.18</middle.server.url>
<!--微服务模块发布地址--> <!--微服务模块发布地址-->
<service.server.url>192.168.1.139</service.server.url> <!-- <service.server.url>198.120.100.195</service.server.url>-->
<service.server.url>192.168.1.114</service.server.url>
<!--docker仓库地址--> <!--docker仓库地址-->
<docker.server.url>192.168.1.31</docker.server.url> <docker.server.url>192.168.1.13</docker.server.url>
<!--nacos的ip:port--> <!--nacos的ip:port-->
<nacos.url>${middle.server.url}:18848</nacos.url> <nacos.url>${middle.server.url}:18848</nacos.url>
<!--服务器发布内容为空--> <!--服务器发布内容为空-->
<!-- <nacos.namespace></nacos.namespace>--> <!-- <nacos.namespace></nacos.namespace>-->
<nacos.namespace>415a1c87-33aa-47bd-8e25-13cc456c87ed</nacos.namespace> <!-- <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>-->
<!-- <nacos.namespace>ba3ba5d1-3480-4755-8b87-6b1fce16201c</nacos.namespace>-->
<nacos.namespace>fe40a052-d787-48f4-940f-688cabdff26a</nacos.namespace>
<!--sentinel:port--> <!--sentinel:port-->
<!-- <sentinel.url>192.168.1.14:8080</sentinel.url>-->
<sentinel.url>${middle.server.url}:8080</sentinel.url> <sentinel.url>${middle.server.url}:8080</sentinel.url>
<!--网关地址主要用于配置swagger中认证token--> <!--网关地址主要用于配置swagger中认证token-->
<gateway.url>${service.server.url}:10215</gateway.url> <gateway.url>${service.server.url}:10215</gateway.url>

View File

@@ -1,24 +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">
<parent>
<artifactId>pqs</artifactId>
<groupId>com.njcn</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pqs-advance</artifactId>
<packaging>pom</packaging>
<modules>
<module>advance-api</module>
<module>advance-boot</module>
</modules>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.enums; package com.njcn.algorithm.enums;
import lombok.Getter; import lombok.Getter;
@@ -9,7 +9,7 @@ import lombok.Getter;
* @date 2021/6/21 * @date 2021/6/21
*/ */
@Getter @Getter
public enum AdvanceResponseEnum { public enum AlgorithmResponseEnum {
/** /**
* A00500 ~ A01550 用于终端模块的枚举 * A00500 ~ A01550 用于终端模块的枚举
@@ -22,7 +22,7 @@ public enum AdvanceResponseEnum {
private final String message; private final String message;
AdvanceResponseEnum(String code, String message) { AlgorithmResponseEnum(String code, String message) {
this.code = code; this.code = code;
this.message = message; this.message = message;
} }

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -35,7 +35,7 @@ public class AppTopologyDiagramAddParm {
* 项目Id * 项目Id
*/ */
@ApiModelProperty(value = "项目Id") @ApiModelProperty(value = "项目Id")
@NotBlank(message="项目Id不能为空") // @NotBlank(message="项目Id不能为空")
private String projectId; private String projectId;
/** /**

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@@ -0,0 +1,37 @@
package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2022/11/11 15:20【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class AppTopologyDiagramQueryPageParm {
@NotNull(message="当前页不能为空!")
@Min(value = 1, message = "当前页不能为0")
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
private Integer currentPage;
/**显示条数*/
@NotNull(message="显示条数不能为空!")
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
private Integer pageSize;
@ApiModelProperty(value="拓扑图名称")
private String searchValue;
@ApiModelProperty(value="项目Id")
private String projectId;
}

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.param; package com.njcn.algorithm.pojo.param;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.po; package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.po; package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.po; package com.njcn.algorithm.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.vo; package com.njcn.algorithm.pojo.vo;
import lombok.Data; import lombok.Data;

View File

@@ -1,4 +1,4 @@
package com.njcn.advance.pojo.vo; package com.njcn.algorithm.pojo.vo;
import com.njcn.db.bo.BaseEntity; import com.njcn.db.bo.BaseEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;

View File

@@ -3,13 +3,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>pqs-advance</artifactId> <artifactId>pqs-algorithm</artifactId>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>algorithm-api</artifactId>
<artifactId>advance-api</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>pqs-advance</artifactId> <artifactId>pqs-algorithm</artifactId>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
@@ -48,7 +48,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>advance-api</artifactId> <artifactId>algorithm-api</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
@@ -60,7 +60,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
<artifactId>advance-boot</artifactId> <artifactId>algorithm-boot</artifactId>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
@@ -68,7 +68,7 @@
</properties> </properties>
<build> <build>
<finalName>advanceboot</finalName> <finalName>algorithmboot</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@@ -1,4 +1,4 @@
package com.njcn.advance; package com.njcn.algorithm;
/** /**
* @author denghuajun * @author denghuajun
* @version 1.0.0 * @version 1.0.0
@@ -15,8 +15,8 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@EnableFeignClients(basePackages = "com.njcn") @EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn") @SpringBootApplication(scanBasePackages = "com.njcn")
public class public class
AdvanceBootApplication { AlgorithmBootApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(AdvanceBootApplication.class, args); SpringApplication.run(AlgorithmBootApplication.class, args);
} }
} }

View File

@@ -1,11 +1,11 @@
package com.njcn.advance.controller.project; package com.njcn.algorithm.controller.project;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.advance.pojo.param.AppProjectAddParm; import com.njcn.algorithm.pojo.param.AppProjectAddParm;
import com.njcn.advance.pojo.param.AppProjectAuditParm; import com.njcn.algorithm.pojo.param.AppProjectAuditParm;
import com.njcn.advance.pojo.param.AppProjectQueryParm; import com.njcn.algorithm.pojo.param.AppProjectQueryParm;
import com.njcn.advance.pojo.vo.AppProjectVO; import com.njcn.algorithm.pojo.vo.AppProjectVO;
import com.njcn.advance.service.AppProjectService; import com.njcn.algorithm.service.AppProjectService;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum;

View File

@@ -1,10 +1,12 @@
package com.njcn.advance.controller.project; package com.njcn.algorithm.controller.project;
import com.njcn.advance.pojo.param.AppTopologyDiagramAddParm; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.advance.pojo.param.AppTopologyDiagramAuditParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAddParm;
import com.njcn.advance.pojo.param.AppTopologyDiagramQueryParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAuditParm;
import com.njcn.advance.pojo.vo.AppTopologyDiagramVO; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryPageParm;
import com.njcn.advance.service.AppTopologyDiagramService; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryParm;
import com.njcn.algorithm.pojo.vo.AppTopologyDiagramVO;
import com.njcn.algorithm.service.AppTopologyDiagramService;
import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum; import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.enums.response.CommonResponseEnum;
@@ -12,6 +14,7 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil; import com.njcn.common.utils.HttpResultUtil;
import com.njcn.web.controller.BaseController; import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -65,10 +68,22 @@ public class AppTopologyController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryAppTopologyDiagram") @PostMapping("/queryAppTopologyDiagram")
@ApiOperation("查询拓扑图") @ApiOperation("查询拓扑图")
public HttpResult<List<AppTopologyDiagramVO>> queryAppTopologyDiagram(@Validated @RequestBody AppTopologyDiagramQueryParm appTopologyDiagramAuditParm){ @ApiImplicitParam(name = "appTopologyDiagramQueryParm", value = "拓扑图查询参数", required = true)
public HttpResult<List<AppTopologyDiagramVO>> queryAppTopologyDiagram(@Validated @RequestBody AppTopologyDiagramQueryParm appTopologyDiagramQueryParm){
String methodDescribe = getMethodDescribe("queryAppTopologyDiagram"); String methodDescribe = getMethodDescribe("queryAppTopologyDiagram");
List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram(appTopologyDiagramAuditParm); List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram(appTopologyDiagramQueryParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appTopologyDiagramVOList, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryTopologyDiagramPage")
@ApiOperation("查询拓扑图分页")
@ApiImplicitParam(name = "appTopologyDiagramQueryPageParm", value = "拓扑图查询参数", required = true)
public HttpResult<IPage<AppTopologyDiagramVO>> queryTopologyDiagramPage(@Validated @RequestBody AppTopologyDiagramQueryPageParm appTopologyDiagramQueryPageParm){
String methodDescribe = getMethodDescribe("queryTopologyDiagramPage");
IPage<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryTopologyDiagramPage(appTopologyDiagramQueryPageParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appTopologyDiagramVOList, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appTopologyDiagramVOList, methodDescribe);
} }

View File

@@ -0,0 +1,26 @@
package com.njcn.algorithm.controller.project;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/30 9:02【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/lineTopologyDiagram")
@Api(tags = " 拓扑图-监测点")
@AllArgsConstructor
public class LineTopologyDiagramController extends BaseController {
}

View File

@@ -1,7 +1,7 @@
package com.njcn.advance.mapper; package com.njcn.algorithm.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.advance.pojo.po.AppLineTopologyDiagramPO; import com.njcn.algorithm.pojo.po.AppLineTopologyDiagramPO;
/** /**
* *

View File

@@ -1,10 +1,10 @@
package com.njcn.advance.mapper; package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.advance.pojo.param.AppProjectQueryParm; import com.njcn.algorithm.pojo.param.AppProjectQueryParm;
import com.njcn.advance.pojo.po.AppProjectPO; import com.njcn.algorithm.pojo.po.AppProjectPO;
import com.njcn.advance.pojo.vo.AppProjectVO; import com.njcn.algorithm.pojo.vo.AppProjectVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;

View File

@@ -1,7 +1,7 @@
package com.njcn.advance.mapper; package com.njcn.algorithm.mapper;
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper; import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
import com.njcn.advance.pojo.po.AppTopologyDiagramPO; import com.njcn.algorithm.pojo.po.AppTopologyDiagramPO;
/** /**
* *

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.AppLineTopologyDiagramMapper"> <mapper namespace="com.njcn.algorithm.mapper.AppLineTopologyDiagramMapper">
<resultMap id="BaseResultMap" type="com.njcn.advance.pojo.po.AppLineTopologyDiagramPO"> <resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.AppLineTopologyDiagramPO">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table app_line_topology_diagram--> <!--@Table app_line_topology_diagram-->
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.AppProjectMapper"> <mapper namespace="com.njcn.algorithm.mapper.AppProjectMapper">
<resultMap id="BaseResultMap" type="com.njcn.advance.pojo.po.AppProjectPO"> <resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.AppProjectPO">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table app_project--> <!--@Table app_project-->
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njcn.advance.mapper.AppTopologyDiagramMapper"> <mapper namespace="com.njcn.algorithm.mapper.AppTopologyDiagramMapper">
<resultMap id="BaseResultMap" type="com.njcn.advance.pojo.po.AppTopologyDiagramPO"> <resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.AppTopologyDiagramPO">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table app_topology_diagram--> <!--@Table app_topology_diagram-->
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />

View File

@@ -1,7 +1,7 @@
package com.njcn.advance.service; package com.njcn.algorithm.service;
import com.github.jeffreyning.mybatisplus.service.IMppService; import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.advance.pojo.po.AppLineTopologyDiagramPO; import com.njcn.algorithm.pojo.po.AppLineTopologyDiagramPO;
/** /**
* *
* Description: * Description:

View File

@@ -1,12 +1,12 @@
package com.njcn.advance.service; package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.jeffreyning.mybatisplus.service.IMppService; import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.advance.pojo.param.AppProjectAddParm; import com.njcn.algorithm.pojo.param.AppProjectAddParm;
import com.njcn.advance.pojo.param.AppProjectAuditParm; import com.njcn.algorithm.pojo.param.AppProjectAuditParm;
import com.njcn.advance.pojo.param.AppProjectQueryParm; import com.njcn.algorithm.pojo.param.AppProjectQueryParm;
import com.njcn.advance.pojo.po.AppProjectPO; import com.njcn.algorithm.pojo.po.AppProjectPO;
import com.njcn.advance.pojo.vo.AppProjectVO; import com.njcn.algorithm.pojo.vo.AppProjectVO;
/** /**
* *

View File

@@ -1,11 +1,13 @@
package com.njcn.advance.service; package com.njcn.algorithm.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.jeffreyning.mybatisplus.service.IMppService; import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.advance.pojo.param.AppTopologyDiagramAddParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAddParm;
import com.njcn.advance.pojo.param.AppTopologyDiagramAuditParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAuditParm;
import com.njcn.advance.pojo.param.AppTopologyDiagramQueryParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryPageParm;
import com.njcn.advance.pojo.po.AppTopologyDiagramPO; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryParm;
import com.njcn.advance.pojo.vo.AppTopologyDiagramVO; import com.njcn.algorithm.pojo.po.AppTopologyDiagramPO;
import com.njcn.algorithm.pojo.vo.AppTopologyDiagramVO;
import java.util.List; import java.util.List;
@@ -44,4 +46,12 @@ public interface AppTopologyDiagramService extends IMppService<AppTopologyDiagra
* @Date: 2023/3/29 * @Date: 2023/3/29
*/ */
List<AppTopologyDiagramVO> queryAppTopologyDiagram(AppTopologyDiagramQueryParm appTopologyDiagramAuditParm); List<AppTopologyDiagramVO> queryAppTopologyDiagram(AppTopologyDiagramQueryParm appTopologyDiagramAuditParm);
/**
* @Description: queryTopologyDiagramPage
* @Param: [appTopologyDiagramQueryPageParm]
* @return: com.baomidou.mybatisplus.core.metadata.IPage<com.njcn.advance.pojo.vo.AppTopologyDiagramVO>
* @Author: clam
* @Date: 2023/3/29
*/
IPage<AppTopologyDiagramVO> queryTopologyDiagramPage(AppTopologyDiagramQueryPageParm appTopologyDiagramQueryPageParm);
} }

View File

@@ -1,9 +1,9 @@
package com.njcn.advance.service.impl; package com.njcn.algorithm.service.impl;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.advance.mapper.AppLineTopologyDiagramMapper; import com.njcn.algorithm.mapper.AppLineTopologyDiagramMapper;
import com.njcn.advance.pojo.po.AppLineTopologyDiagramPO; import com.njcn.algorithm.pojo.po.AppLineTopologyDiagramPO;
import com.njcn.advance.service.AppLineTopologyDiagramService; import com.njcn.algorithm.service.AppLineTopologyDiagramService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**

View File

@@ -1,18 +1,18 @@
package com.njcn.advance.service.impl; package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.advance.enums.AdvanceResponseEnum; import com.njcn.algorithm.enums.AlgorithmResponseEnum;
import com.njcn.advance.mapper.AppProjectMapper; import com.njcn.algorithm.mapper.AppProjectMapper;
import com.njcn.advance.pojo.param.*; import com.njcn.algorithm.pojo.param.*;
import com.njcn.advance.pojo.po.AppProjectPO; import com.njcn.algorithm.pojo.po.AppProjectPO;
import com.njcn.advance.pojo.vo.AppProjectVO; import com.njcn.algorithm.pojo.vo.AppProjectVO;
import com.njcn.advance.pojo.vo.AppTopologyDiagramVO; import com.njcn.algorithm.pojo.vo.AppTopologyDiagramVO;
import com.njcn.advance.service.AppProjectService; import com.njcn.algorithm.service.AppProjectService;
import com.njcn.advance.service.AppTopologyDiagramService; import com.njcn.algorithm.service.AppTopologyDiagramService;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.oss.utils.FileStorageUtil; import com.njcn.oss.utils.FileStorageUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -47,7 +47,7 @@ public class AppProjectServiceImpl extends MppServiceImpl<AppProjectMapper, AppP
AppProjectPO appProjectPO = new AppProjectPO ( ); AppProjectPO appProjectPO = new AppProjectPO ( );
Boolean result = checkName (appProjectAddOrAuditParm.getUserId ( ), appProjectAddOrAuditParm.getName ( )); Boolean result = checkName (appProjectAddOrAuditParm.getUserId ( ), appProjectAddOrAuditParm.getName ( ));
if (result) { if (result) {
throw new BusinessException (AdvanceResponseEnum.PROJECT_COMMON_ERROR); throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
} }
BeanUtils.copyProperties (appProjectAddOrAuditParm, appProjectPO); BeanUtils.copyProperties (appProjectAddOrAuditParm, appProjectPO);
appProjectPO.setStatus ("1"); appProjectPO.setStatus ("1");
@@ -85,7 +85,7 @@ public class AppProjectServiceImpl extends MppServiceImpl<AppProjectMapper, AppP
Boolean result = checkName (appProjectAuditParm.getUserId ( ) != null ? appProjectAuditParm.getUserId ( ) : appProjectPO1.getUserId ( ), Boolean result = checkName (appProjectAuditParm.getUserId ( ) != null ? appProjectAuditParm.getUserId ( ) : appProjectPO1.getUserId ( ),
appProjectAuditParm.getName ( ) != null ? appProjectAuditParm.getName ( ) : appProjectPO1.getName ( )); appProjectAuditParm.getName ( ) != null ? appProjectAuditParm.getName ( ) : appProjectPO1.getName ( ));
if (result) { if (result) {
throw new BusinessException (AdvanceResponseEnum.PROJECT_COMMON_ERROR); throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
} }
} }
@@ -96,7 +96,7 @@ public class AppProjectServiceImpl extends MppServiceImpl<AppProjectMapper, AppP
int i = appProjectMapper.update (appProjectPO, updateWrapper); int i = appProjectMapper.update (appProjectPO, updateWrapper);
Boolean result = checkName (appProjectPO.getUserId ( ), appProjectPO.getName ( )); Boolean result = checkName (appProjectPO.getUserId ( ), appProjectPO.getName ( ));
if (result) { if (result) {
throw new BusinessException (AdvanceResponseEnum.PROJECT_COMMON_ERROR); throw new BusinessException (AlgorithmResponseEnum.PROJECT_COMMON_ERROR);
} }
return i == 1 ? true : false; return i == 1 ? true : false;
} }

View File

@@ -1,16 +1,19 @@
package com.njcn.advance.service.impl; package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl; import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.njcn.advance.mapper.AppTopologyDiagramMapper; import com.njcn.algorithm.mapper.AppTopologyDiagramMapper;
import com.njcn.advance.pojo.param.AppTopologyDiagramAddParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAddParm;
import com.njcn.advance.pojo.param.AppTopologyDiagramAuditParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramAuditParm;
import com.njcn.advance.pojo.param.AppTopologyDiagramQueryParm; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryPageParm;
import com.njcn.advance.pojo.po.AppTopologyDiagramPO; import com.njcn.algorithm.pojo.param.AppTopologyDiagramQueryParm;
import com.njcn.advance.pojo.vo.AppTopologyDiagramVO; import com.njcn.algorithm.pojo.po.AppTopologyDiagramPO;
import com.njcn.advance.service.AppTopologyDiagramService; import com.njcn.algorithm.pojo.vo.AppTopologyDiagramVO;
import com.njcn.algorithm.service.AppTopologyDiagramService;
import com.njcn.oss.constant.OssPath; import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil; import com.njcn.oss.utils.FileStorageUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -38,6 +41,8 @@ public class AppTopologyDiagramServiceImpl extends MppServiceImpl<AppTopologyDia
private final FileStorageUtil fileStorageUtil; private final FileStorageUtil fileStorageUtil;
private final AppTopologyDiagramMapper appTopologyDiagramMapper;
@Override @Override
@Transactional(rollbackFor = {Exception.class}) @Transactional(rollbackFor = {Exception.class})
public Boolean addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) { public Boolean addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) {
@@ -47,7 +52,7 @@ public class AppTopologyDiagramServiceImpl extends MppServiceImpl<AppTopologyDia
long size = file.getSize ( ); long size = file.getSize ( );
String filePath = fileStorageUtil.uploadMultipart (file, OssPath.TOPOLOGY); String filePath = fileStorageUtil.uploadMultipart (file, OssPath.TOPOLOGY);
appTopologyDiagramPO.setFilePath (filePath); appTopologyDiagramPO.setFilePath (filePath);
appTopologyDiagramPO.setProjectId (appTopologyDiagramAddParm.getProjectId ()); appTopologyDiagramPO.setProjectId (appTopologyDiagramAddParm.getProjectId ()==null?"":appTopologyDiagramAddParm.getProjectId ());
appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ()); appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ());
appTopologyDiagramPO.setFileSize (Integer.valueOf (size+"")); appTopologyDiagramPO.setFileSize (Integer.valueOf (size+""));
appTopologyDiagramPO.setStatus ("1"); appTopologyDiagramPO.setStatus ("1");
@@ -74,7 +79,7 @@ public class AppTopologyDiagramServiceImpl extends MppServiceImpl<AppTopologyDia
if(appTopologyDiagramAuditParm.getStatus ()!=null&&appTopologyDiagramAuditParm.getTopologyDiagramName ()!=""){ if(appTopologyDiagramAuditParm.getStatus ()!=null&&appTopologyDiagramAuditParm.getTopologyDiagramName ()!=""){
appTopologyDiagramPO.setStatus (appTopologyDiagramAuditParm.getStatus ()); appTopologyDiagramPO.setStatus (appTopologyDiagramAuditParm.getStatus ());
} }
UpdateWrapper<AppTopologyDiagramPO> updateWrapper = new UpdateWrapper (); UpdateWrapper<AppTopologyDiagramPO> updateWrapper = new UpdateWrapper<> ();
updateWrapper.eq ("id",appTopologyDiagramAuditParm.getId ()); updateWrapper.eq ("id",appTopologyDiagramAuditParm.getId ());
boolean update = this.update (appTopologyDiagramPO, updateWrapper); boolean update = this.update (appTopologyDiagramPO, updateWrapper);
return update; return update;
@@ -82,7 +87,7 @@ public class AppTopologyDiagramServiceImpl extends MppServiceImpl<AppTopologyDia
@Override @Override
public List<AppTopologyDiagramVO> queryAppTopologyDiagram(AppTopologyDiagramQueryParm appTopologyDiagramAuditParm) { public List<AppTopologyDiagramVO> queryAppTopologyDiagram(AppTopologyDiagramQueryParm appTopologyDiagramAuditParm) {
QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper (); QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper<> ();
queryWrapper.eq ("status","1"). queryWrapper.eq ("status","1").
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getId ()),"id",appTopologyDiagramAuditParm.getId ()). eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getId ()),"id",appTopologyDiagramAuditParm.getId ()).
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getProjectId ()),"project_id",appTopologyDiagramAuditParm.getProjectId ()). eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getProjectId ()),"project_id",appTopologyDiagramAuditParm.getProjectId ()).
@@ -96,4 +101,25 @@ public class AppTopologyDiagramServiceImpl extends MppServiceImpl<AppTopologyDia
}).collect (Collectors.toList ( )); }).collect (Collectors.toList ( ));
return collect; return collect;
} }
@Override
public IPage<AppTopologyDiagramVO> queryTopologyDiagramPage(AppTopologyDiagramQueryPageParm appTopologyDiagramQueryPageParm) {
Page<AppTopologyDiagramVO> returnpage = new Page<> (appTopologyDiagramQueryPageParm.getCurrentPage ( ), appTopologyDiagramQueryPageParm.getPageSize ( ));
Page<AppTopologyDiagramPO> tempPage = new Page<> (appTopologyDiagramQueryPageParm.getCurrentPage ( ), appTopologyDiagramQueryPageParm.getPageSize ( ));
QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper<> ();
queryWrapper.eq ("status","1").
eq (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getProjectId ()),"project_id",appTopologyDiagramQueryPageParm.getProjectId ()).
like (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getSearchValue ()),"name", appTopologyDiagramQueryPageParm.getSearchValue ());
tempPage = appTopologyDiagramMapper.selectPage (tempPage, queryWrapper);
List<AppTopologyDiagramVO> collect = tempPage.getRecords ( ).stream ( ).map (temp -> {
AppTopologyDiagramVO vo = new AppTopologyDiagramVO ( );
BeanUtils.copyProperties (temp, vo);
vo.setFilePath (fileStorageUtil.getFileUrl (temp.getFilePath ( )));
return vo;
}).collect (Collectors.toList ( ));
returnpage.setRecords (collect);
return returnpage;
}
} }

View File

@@ -47,7 +47,7 @@ logging:
#mybatis配置信息 #mybatis配置信息
mybatis-plus: mybatis-plus:
#别名扫描 #别名扫描
type-aliases-package: com.njcn.advance.pojo type-aliases-package: com.njcn.algorithm.pojo
mqtt: mqtt:
client-id: @artifactId@${random.value} client-id: @artifactId@${random.value}

View File

@@ -0,0 +1,46 @@
DROP TABLE IF EXISTS `app_project`;
CREATE TABLE `app_project` (
`id` varchar(36) NOT NULL COMMENT '项目Id',
`name` varchar(200) NOT NULL COMMENT '项目名称',
`user_id` varchar(100) NOT NULL COMMENT '关联用户Id',
`area_id` varchar(100) NOT NULL COMMENT '地市Id',
`lng` decimal(10,6) NULL COMMENT '中心点经度',
`lat` decimal(10,6) NULL COMMENT '中心点纬度',
`status` tinyint(1) NOT NULL COMMENT '0删除 1正常',
`create_by` char(32) NULL COMMENT '创建用户',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_by` char(32) NULL COMMENT '更新用户',
`update_time` datetime NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目表';
DROP TABLE IF EXISTS `app_topology_diagram`;
CREATE TABLE `app_topology_diagram` (
`id` varchar(36) Not NULL COMMENT '拓扑图Id' ,
`name` varchar(200) Not NULL COMMENT '拓扑图名称' ,
`file_size` int Not NULL COMMENT '文件大小(kb)' ,
`project_id` varchar(36) NULL COMMENT '项目Id' ,
`file_path` varchar(200) Not NULL COMMENT '拓扑图文件路径' ,
`status` tinyint(1) NOT NULL COMMENT '0删除 1正常',
`create_by` char(32) NULL COMMENT '创建用户',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_by` char(32) NULL COMMENT '更新用户',
`update_time` datetime NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目拓扑图关系表';
DROP TABLE IF EXISTS `app_line_topology_diagram`;
CREATE TABLE `app_line_topology_diagram` (
`id` varchar(36) Not NULL COMMENT '拓扑图Id' ,
`line_id` varchar(200) Not NULL COMMENT '拓扑图名称' ,
`status` tinyint(1) NOT NULL COMMENT '0删除 1正常',
`create_by` char(32) NULL COMMENT '创建用户',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_by` char(32) NULL COMMENT '更新用户',
`update_time` datetime NULL COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='项目拓扑图关系表';

View File

@@ -10,11 +10,15 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>pqs-algorithm</artifactId> <artifactId>pqs-algorithm</artifactId>
<packaging>pom</packaging>
<modules>
<module>algorithm-api</module>
<module>algorithm-boot</module>
</modules>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
</project> </project>

View File

@@ -50,16 +50,16 @@ public class PqsComasses implements Serializable {
@Column(name = "data_plt1") @Column(name = "data_plt1")
private Double dataPlt1; private Double dataPlt1;
//电压闪变等级2
@Column(name = "data_plt2") @Column(name = "data_plt2")
private Double dataPlt2; private Double dataPlt2;
//电压闪变等级3
@Column(name = "data_plt3") @Column(name = "data_plt3")
private Double dataPlt3; private Double dataPlt3;
//电压闪变等级4
@Column(name = "data_plt4") @Column(name = "data_plt4")
private Double dataPlt4; private Double dataPlt4;
//电压闪变等级5
@Column(name = "data_plt5") @Column(name = "data_plt5")
private Double dataPlt5; private Double dataPlt5;

View File

@@ -146,6 +146,7 @@ public class DeviceInfoParam implements Serializable {
private String searchEndTime; private String searchEndTime;
@ApiModelProperty("时间范围标志 0.查询展示天 1.查询展示月") @ApiModelProperty("时间范围标志 0.查询展示天 1.查询展示月")
@Deprecated
private Integer timeFlag; private Integer timeFlag;
@ApiModelProperty("统计类型 1.年 2.季 3.月 4.周 5.天") @ApiModelProperty("统计类型 1.年 2.季 3.月 4.周 5.天")

View File

@@ -146,7 +146,7 @@ public class OperationContrController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getDailyDeviceAbnormalStatistics") @PostMapping("/getDailyDeviceAbnormalStatistics")
@ApiOperation("获取终端异常统计") @ApiOperation("获取终端异常统计")
@ApiImplicitParam(name = "conditionBusinessParam", value = "实体", required = true) @ApiImplicitParam(name = "param", value = "实体", required = true)
public HttpResult<Page<TopMsgPO>> dailyDeviceAbnormalStatistics(@RequestBody PqsParam param) { public HttpResult<Page<TopMsgPO>> dailyDeviceAbnormalStatistics(@RequestBody PqsParam param) {
String methodDescribe = getMethodDescribe("dailyDeviceAbnormalStatistics"); String methodDescribe = getMethodDescribe("dailyDeviceAbnormalStatistics");
Page<TopMsgPO> result = lineService.dailyDeviceAbnormalStatistics(param); Page<TopMsgPO> result = lineService.dailyDeviceAbnormalStatistics(param);

View File

@@ -10,9 +10,9 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface TopMsgMapper { public interface TopMsgMapper {
Page<TopMsgPO> getTopMsg(Page<TopMsgPO> page,@Param("lineGrade") String lineGrade, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime); Page<TopMsgPO> getTopMsg(Page<TopMsgPO> page,@Param("lineGrade") String lineGrade, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
List<TopMsgPO> getTopMsgDetail(@Param("lineGrade") String lineGrade,@Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);
List<TopMsgPO> getTopMsgDetail(@Param("lineGrade") String lineGrade,@Param("startTime") DateTime startTime);

View File

@@ -865,6 +865,8 @@
</foreach> </foreach>
and and
a.Create_Time between #{startTime} and #{endTime} a.Create_Time between #{startTime} and #{endTime}
and
b.Run_Flag != 2
) t ORDER BY flowProportion DESC ) t ORDER BY flowProportion DESC
</select> </select>

View File

@@ -5,12 +5,12 @@
<select id="getTopMsg" resultType="com.njcn.device.pq.pojo.po.TopMsgPO"> <select id="getTopMsg" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
SELECT SELECT
ptm.Time_Id AS time, ptm.Time_Id AS time,
COUNT(ptm.Dev_Id) AS deviceAbnormalNum, IFNULL(COUNT(ptm.Dev_Id),3.14159)AS deviceAbnormalNum,
GROUP_CONCAT(sdd.Name) AS lineGrade GROUP_CONCAT(sdd.Name) AS lineGrade
FROM pq_line line FROM pq_line line
INNER JOIN pq_line vol ON line.pid=vol.id INNER JOIN pq_line vol ON line.pid=vol.id
INNER JOIN pq_line device ON vol.pid=device.id INNER JOIN pq_line device ON vol.pid=device.id
INNER JOIN pqs_top_msg ptm ON ptm.Dev_Id = device.Id LEFT JOIN pqs_top_msg ptm ON ptm.Dev_Id = device.Id
LEFT JOIN pq_line_detail pld ON pld.Id=line.Id LEFT JOIN pq_line_detail pld ON pld.Id=line.Id
LEFT JOIN sys_dict_data sdd ON sdd.Id=pld.Line_Grade LEFT JOIN sys_dict_data sdd ON sdd.Id=pld.Line_Grade
WHERE WHERE
@@ -46,7 +46,7 @@
WHERE WHERE
ptm.State=1 ptm.State=1
AND AND
ptm.Time_Id between #{startTime} and #{endTime} ptm.Time_Id = #{startTime}
<if test="lineGrade!=null and lineGrade!=''"> <if test="lineGrade!=null and lineGrade!=''">
AND pld.Line_Grade=#{lineGrade} AND pld.Line_Grade=#{lineGrade}
</if> </if>

View File

@@ -399,8 +399,7 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
@Override @Override
public List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam param) { public List<TopMsgPO> dailyDeviceAbnormal(DeviceInfoParam.BusinessParam param) {
List<TopMsgPO> topMsgDetails = topMsgMapper.getTopMsgDetail(param.getLineGrade(), DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())), List<TopMsgPO> topMsgDetails = topMsgMapper.getTopMsgDetail(param.getLineGrade(), DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())));
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
return topMsgDetails; return topMsgDetails;
} }

View File

@@ -30,15 +30,15 @@ public class ComAssessDTO {
//频率偏差等级5 //频率偏差等级5
private Float freqDev5; private Float freqDev5;
//电压闪变等级1 //电压闪变等级1
private Float dataPST1; private Float dataPlT1;
//电压闪变等级2 //电压闪变等级2
private Float dataPST2; private Float dataPlT2;
//电压闪变等级3 //电压闪变等级3
private Float dataPST3; private Float dataPlT3;
//电压闪变等级4 //电压闪变等级4
private Float dataPST4; private Float dataPlT4;
//电压闪变等级5 //电压闪变等级5
private Float dataPST5; private Float dataPlT5;
//电压不平衡度等级1 //电压不平衡度等级1
private Float vUnbalance1; private Float vUnbalance1;
//电压不平衡度等级2 //电压不平衡度等级2

View File

@@ -50,21 +50,21 @@ public class PQSComAssesPO {
//频率偏差等级5 //频率偏差等级5
@Column(name = "freq_dev5") @Column(name = "freq_dev5")
private Double freqDev5; private Double freqDev5;
//电压闪变等级1
@Column(name = "data_plt1") @Column(name = "data_plt1")
private Double dataPST1; private Double dataPlt1;
//电压闪变等级2 //电压闪变等级2
@Column(name = "data_plt2") @Column(name = "data_plt2")
private Double dataPST2; private Double dataPlt2;
//电压闪变等级3 //电压闪变等级3
@Column(name = "data_plt3") @Column(name = "data_plt3")
private Double dataPST3; private Double dataPlt3;
//电压闪变等级4 //电压闪变等级4
@Column(name = "data_plt4") @Column(name = "data_plt4")
private Double dataPST4; private Double dataPlt4;
//电压闪变等级5 //电压闪变等级5
@Column(name = "data_plt5") @Column(name = "data_plt5")
private Double dataPST5; private Double dataPlt5;
//电压不平衡度等级1 //电压不平衡度等级1
@Column(name = "v_unbalance1") @Column(name = "v_unbalance1")
private Double vUnbalance1; private Double vUnbalance1;

View File

@@ -88,7 +88,7 @@ public class HarmonicComAssesUtil {
if (getBysxf()) { if (getBysxf()) {
//G和F得出综合权重A //G和F得出综合权重A
if (getZhqzf()) { if (getZhqzf()) {
//A[0] = 0.28;A[1] = 0.23;A[2] = 0.13;A[3] = 0.16;A[4] = 0.08;A[5] = 0.12; A[0] = 0.28f;A[1] = 0.23f;A[2] = 0.13f;A[3] = 0.16f;A[4] = 0.08f;A[5] = 0.12f;
for (i = 0; i < GRADE_NUM; i++) { for (i = 0; i < GRADE_NUM; i++) {
B[i] = 0; B[i] = 0;
for (j = 0; j < ST_QT_NUM; j++) { for (j = 0; j < ST_QT_NUM; j++) {
@@ -123,7 +123,7 @@ public class HarmonicComAssesUtil {
//组合二维数组 //组合二维数组
float f1[][]={{tempPqs.getFreqDev1(),tempPqs.getFreqDev2(),tempPqs.getFreqDev3(),tempPqs.getFreqDev4(),tempPqs.getFreqDev5()} float f1[][]={{tempPqs.getFreqDev1(),tempPqs.getFreqDev2(),tempPqs.getFreqDev3(),tempPqs.getFreqDev4(),tempPqs.getFreqDev5()}
,{tempPqs.getVTHD1(),tempPqs.getVTHD2(),tempPqs.getVTHD3(),tempPqs.getVTHD4(),tempPqs.getVTHD5(),} ,{tempPqs.getVTHD1(),tempPqs.getVTHD2(),tempPqs.getVTHD3(),tempPqs.getVTHD4(),tempPqs.getVTHD5(),}
,{tempPqs.getDataPST1(),tempPqs.getDataPST2(),tempPqs.getDataPST3(),tempPqs.getDataPST4(),tempPqs.getDataPST5()} ,{tempPqs.getDataPlT1(),tempPqs.getDataPlT2(),tempPqs.getDataPlT3(),tempPqs.getDataPlT4(),tempPqs.getDataPlT5()}
,{tempPqs.getVuDev1(),tempPqs.getVuDev2(),tempPqs.getVuDev3(),tempPqs.getVuDev4(),tempPqs.getVuDev5(),} ,{tempPqs.getVuDev1(),tempPqs.getVuDev2(),tempPqs.getVuDev3(),tempPqs.getVuDev4(),tempPqs.getVuDev5(),}
,{tempPqs.getVUnbalance1(),tempPqs.getVUnbalance2(),tempPqs.getVUnbalance3(),tempPqs.getVUnbalance4(),tempPqs.getVUnbalance5(),} ,{tempPqs.getVUnbalance1(),tempPqs.getVUnbalance2(),tempPqs.getVUnbalance3(),tempPqs.getVUnbalance4(),tempPqs.getVUnbalance5(),}
,{tempPqs.getEvent1(),tempPqs.getEvent2(),tempPqs.getEvent3(),tempPqs.getEvent4(),tempPqs.getEvent5(),}}; ,{tempPqs.getEvent1(),tempPqs.getEvent2(),tempPqs.getEvent3(),tempPqs.getEvent4(),tempPqs.getEvent5(),}};

View File

@@ -49,39 +49,7 @@ public class AnalyzeController extends BaseController {
private final IHarmonicService harmonicService; private final IHarmonicService harmonicService;
/* @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/deptSubstationRelations")
@ApiOperation("污区图-部门变电站关系")
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
public HttpResult<List<PollutionVO>> deptSubstationRelations(@RequestBody HarmonicPublicParam param) {
String methodDescribe = getMethodDescribe("deptSubstationRelations");
LogUtil.njcnDebug(log, "{},实体参数:{}", methodDescribe, param);
List<PollutionVO> list = pollutionService.getDeptSubstationRelations(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getSubstationInfoById")
@ApiOperation("污区图-根据部门获取变电站详情")
@ApiImplicitParam(name = "param", value = "部门参数", required = true)
public HttpResult<List<PollutionSubstationDTO>> getSubstationInfoById(@RequestBody HarmonicPublicParam param) {
String methodDescribe = getMethodDescribe("getSubstationInfoById");
LogUtil.njcnDebug(log, "{},部门参数:{}", methodDescribe, param);
List<PollutionSubstationDTO> list = pollutionService.getSubstationInfoById(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getLineInfoById")
@ApiOperation("污区图-根据变电站获取监测点详情")
@ApiImplicitParam(name = "param", value = "变电站参数", required = true)
public HttpResult<List<PollutionLineDTO>> getLineInfoById(@RequestBody HarmonicPublicParam param) {
String methodDescribe = getMethodDescribe("getLineInfoById");
LogUtil.njcnDebug(log, "{},变电站参数:{}", methodDescribe, param);
List<PollutionLineDTO> list = pollutionService.getLineInfoById(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getLineRank") @PostMapping("/getLineRank")
@ApiOperation("污区图-获取前十监测点排名") @ApiOperation("污区图-获取前十监测点排名")

View File

@@ -26,6 +26,7 @@ import java.util.List;
* @version 1.0.0 * @version 1.0.0
* @author: chenchao * @author: chenchao
* @date: 2022/04/21 09:05 * @date: 2022/04/21 09:05
* 对应菜单 谐波系统-区域-电能质量评估
*/ */
@Validated @Validated
@Slf4j @Slf4j

View File

@@ -119,16 +119,16 @@ public class ComAssessServiceImpl implements ComAssessService {
comAssessDTO.setFreqDev4(f4); comAssessDTO.setFreqDev4(f4);
float f5 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float f5 = new BigDecimal(pqsComAssesPOS.get(i).getFreqDev5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setFreqDev5(f5); comAssessDTO.setFreqDev5(f5);
float d1 = new BigDecimal(pqsComAssesPOS.get(i).getDataPST1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float d1 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setDataPST1(d1); comAssessDTO.setDataPlT1(d1);
float d2 = new BigDecimal(pqsComAssesPOS.get(i).getDataPST2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float d2 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setDataPST2(d2); comAssessDTO.setDataPlT2(d2);
float d3 = new BigDecimal(pqsComAssesPOS.get(i).getDataPST3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float d3 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt3()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setDataPST3(d3); comAssessDTO.setDataPlT3(d3);
float d4 = new BigDecimal(pqsComAssesPOS.get(i).getDataPST4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float d4 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt4()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setDataPST4(d4); comAssessDTO.setDataPlT4(d4);
float d5 = new BigDecimal(pqsComAssesPOS.get(i).getDataPST5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float d5 = new BigDecimal(pqsComAssesPOS.get(i).getDataPlt5()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setDataPST5(d5); comAssessDTO.setDataPlT5(d5);
float vu1 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float vu1 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance1()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();
comAssessDTO.setVUnbalance1(vu1); comAssessDTO.setVUnbalance1(vu1);
float vu2 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue(); float vu2 = new BigDecimal(pqsComAssesPOS.get(i).getVUnbalance2()).setScale(4, BigDecimal.ROUND_HALF_UP).floatValue();

View File

@@ -22,22 +22,27 @@ import com.njcn.device.pq.api.SubstationFeignClient;
import com.njcn.device.pq.pojo.dto.*; import com.njcn.device.pq.pojo.dto.*;
import com.njcn.harmonic.constant.Param; import com.njcn.harmonic.constant.Param;
import com.njcn.harmonic.mapper.*; import com.njcn.harmonic.mapper.*;
import com.njcn.harmonic.pojo.dto.PublicDTO;
import com.njcn.harmonic.pojo.param.HarmonicPublicParam; import com.njcn.harmonic.pojo.param.HarmonicPublicParam;
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam; import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
import com.njcn.harmonic.pojo.po.*; import com.njcn.harmonic.pojo.po.*;
import com.njcn.harmonic.pojo.vo.PollutionSubstationVO; import com.njcn.harmonic.pojo.vo.PollutionSubstationVO;
import com.njcn.harmonic.pojo.vo.PollutionVO; import com.njcn.harmonic.pojo.vo.PollutionVO;
import com.njcn.harmonic.service.PollutionSubstationService; import com.njcn.harmonic.service.PollutionSubstationService;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.user.api.DeptFeignClient; import com.njcn.user.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.po.Dept;
import com.njcn.web.utils.RequestUtil; import com.njcn.web.utils.RequestUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.influxdb.dto.QueryResult;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -83,6 +88,8 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
private final RStatPollutionOrgDPOMapper rStatPollutionOrgDPOMapper; private final RStatPollutionOrgDPOMapper rStatPollutionOrgDPOMapper;
private final RMpPollutionDPOMapper rMpPollutionDPOMapper; private final RMpPollutionDPOMapper rMpPollutionDPOMapper;
private final InfluxDbUtils influxDbUtils = new InfluxDbUtils("admin", "njcnpqs", "http://192.168.1.18:8086", "pqsbase", ""); ;
/** /**
* @param pollutionSubstationQuryParam * @param pollutionSubstationQuryParam
* @Description: getPollutionSubstationData * @Description: getPollutionSubstationData
@@ -576,6 +583,36 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
searchBeginTime = param.getSearchBeginTime ( ).substring (0, 10)+"%"; searchBeginTime = param.getSearchBeginTime ( ).substring (0, 10)+"%";
} }
if(param.getType()==0){
param.setServerName(generalInfo.getMicroServiceName());
List<String> lineList = new ArrayList<>();
PollutionParamDTO paramDTO = new PollutionParamDTO();
if (StringUtils.isBlank(RequestUtil.getDeptIndex())) {
return list;
}
List<GeneralDeviceDTO> deviceList = generalDeviceInfoClient.getPracticalRunDeviceInfo(param).getData();
deviceList.forEach(item -> {
if (!CollectionUtils.isEmpty(item.getLineIndexes())) {
lineList.addAll(item.getLineIndexes());
}
});
if (!CollectionUtils.isEmpty(lineList)) {
paramDTO.setLineList(lineList);
list = lineFeignClient.getLineInfo(paramDTO).getData();
List<PublicDTO> result = getLineDate(lineList, param.getSearchBeginTime(), param.getSearchEndTime(), param.getStatisticalType().getCode());
if (!CollectionUtils.isEmpty(result)) {
list.stream().map(list1 -> result.stream().filter(list2 -> Objects.equals(list1.getId(), list2.getId())).findAny().map(m -> {
list1.setData(m.getData());
return list1;
})).collect(Collectors.toList());
}
}
list.sort((item1, item2) -> item2.getData().compareTo(item1.getData()));
if (list.size() > Param.UP_LIMIT) {
return list.subList(Param.DOWN_LIMIT, Param.UP_LIMIT);
}
return list;
}
PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam(); PmsDeviceInfoParam pmsDeviceInfoParam = new PmsDeviceInfoParam();
pmsDeviceInfoParam.setDeptIndex(param.getDeptIndex()); pmsDeviceInfoParam.setDeptIndex(param.getDeptIndex());
//获取统计类型 //获取统计类型
@@ -622,5 +659,53 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
return list; return list;
} }
/**
* 功能描述:根据监测点id查询influxDB污染指数
*
* @param line 监测点集合
* startTime 开始时间
* endTime 结束时间
* type 指标参数
* @return
* @author xy
* @date 2022/2/21 20:08
*/
private List<PublicDTO> getLineDate(List<String> line, String startTime, String endTime, String type) {
List<PublicDTO> result = new ArrayList<>();
String quota = "";
if (Objects.equals(type, DicDataEnum.XBDY_ENUM.getCode())) {
quota = "harmonic_v";
} else if (Objects.equals(type, DicDataEnum.XBDL_ENUM.getCode())) {
quota = "harmonic_i";
}
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(Param.TIME).append(" >= '").append(startTime).append(Param.START_TIME).append("' and ").append(Param.TIME).append(" <= '").append(endTime).append(Param.END_TIME).append("' and (");
for (int i = 0; i < line.size(); i++) {
if (line.size() - i != 1) {
stringBuilder.append(Param.LINE_ID).append("='").append(line.get(i)).append("' or ");
} else {
stringBuilder.append(Param.LINE_ID).append("='").append(line.get(i)).append("')");
}
}
stringBuilder.append(" group by line_id order by time desc limit 1 tz('Asia/Shanghai')");
String sql = "SELECT line_id," + quota + " FROM harmonic_pollution where " + stringBuilder;
QueryResult sqlResult = influxDbUtils.query(sql);
List<QueryResult.Series> list = sqlResult.getResults().get(0).getSeries();
if (!CollectionUtils.isEmpty(list)) {
list.forEach(po -> {
String index = po.getTags().get(Param.LINE_ID);
List<List<Object>> valueList = po.getValues();
if (!CollectionUtils.isEmpty(valueList)) {
for (List<Object> value : valueList) {
PublicDTO publicDTO = new PublicDTO();
Double data = value.get(2) == null ? 0.0 : BigDecimal.valueOf(Double.parseDouble(value.get(2).toString())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
publicDTO.setId(index);
publicDTO.setData(data);
result.add(publicDTO);
}
}
});
}
return result;
}
} }

View File

@@ -67,8 +67,7 @@ public class THDistortionServiceImpl implements THDistortionService {
thDistortionVO.setName(generalDeviceDTO.getName()); thDistortionVO.setName(generalDeviceDTO.getName());
if (!CollectionUtils.isEmpty(generalDeviceDTO.getLineIndexes())){ if (!CollectionUtils.isEmpty(generalDeviceDTO.getLineIndexes())){
List<String> lineIndexes = generalDeviceDTO.getLineIndexes(); List<String> lineIndexes = generalDeviceDTO.getLineIndexes();
List<THDistortionVO> monitorList = thDistortionMapper.getLineData(lineIndexes);
// setLineData(monitorList,thDistortionVO);
//查找畸变率 //查找畸变率
List<PublicDTO> condition = getCondition(lineIndexes, thDistortionParam.getSearchBeginTime(), thDistortionParam.getSearchEndTime()); List<PublicDTO> condition = getCondition(lineIndexes, thDistortionParam.getSearchBeginTime(), thDistortionParam.getSearchEndTime());
thDistortionVO.setDistortion(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159)); thDistortionVO.setDistortion(condition.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159));

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
/** /**
* pqs * pqs
* 畸变率 * 畸变率(mysql)
* @author cdf * @author cdf
* @date 2022/10/24 * @date 2022/10/24
*/ */

View File

@@ -22,6 +22,7 @@ public class HarmComprehensiveAssessJob {
private final HarmonicGeneralFeignClient harmonicGeneralFeignClient; private final HarmonicGeneralFeignClient harmonicGeneralFeignClient;
@Deprecated
@XxlJob("comprehensiveAssessHandler") @XxlJob("comprehensiveAssessHandler")
public void comprehensiveAssessHandler(){ public void comprehensiveAssessHandler(){

View File

@@ -31,6 +31,7 @@ public class HarmDateToDayJob {
private final DayDataFeignClient dayDataFeignClient; private final DayDataFeignClient dayDataFeignClient;
@Deprecated
@XxlJob("harmDateToDayJob") @XxlJob("harmDateToDayJob")
public void harmDateToDayJob(){ public void harmDateToDayJob(){

View File

@@ -26,6 +26,7 @@ public class HarmIntegrityJob {
private final IntegrityFeignClient integrityFeignClient; private final IntegrityFeignClient integrityFeignClient;
@Deprecated
@XxlJob("harmIntegrityJob") @XxlJob("harmIntegrityJob")
public void harmIntegrityJob(){ public void harmIntegrityJob(){
LineParam lineParam = new LineParam(); LineParam lineParam = new LineParam();

View File

@@ -23,6 +23,7 @@ public class HarmKpiAssessJob {
private final HarmonicMetricFeignClient harmonicMetricFeignClient; private final HarmonicMetricFeignClient harmonicMetricFeignClient;
@Deprecated
@XxlJob("kpiAssessHandler") @XxlJob("kpiAssessHandler")
public void kpiAssessHandler(){ public void kpiAssessHandler(){

View File

@@ -27,6 +27,7 @@ public class HarmLimitRateJob {
private final LimitrateFeignClient limitrateFeignClient; private final LimitrateFeignClient limitrateFeignClient;
@Deprecated
@XxlJob("harmLimitRateJob") @XxlJob("harmLimitRateJob")
public void harmLimitRateJob(){ public void harmLimitRateJob(){

View File

@@ -25,6 +25,7 @@ public class HarmLimitTargetJob {
private final LimitTargetFeignClient limitTargetFeignClient; private final LimitTargetFeignClient limitTargetFeignClient;
@Deprecated
@XxlJob("harmLimitTargetJob") @XxlJob("harmLimitTargetJob")
public void harmLimitTargetJob(){ public void harmLimitTargetJob(){
LineParam lineParam = new LineParam(); LineParam lineParam = new LineParam();

View File

@@ -22,6 +22,7 @@ public class HarmOnlineRateJob {
private final OnlineRateFeignClient onlineRateFeignClient; private final OnlineRateFeignClient onlineRateFeignClient;
@Deprecated
@XxlJob("harmOnlineRateJob") @XxlJob("harmOnlineRateJob")
public void harmOnlineRateJob(){ public void harmOnlineRateJob(){
LineParam lineParam = new LineParam(); LineParam lineParam = new LineParam();

View File

@@ -50,5 +50,10 @@ public class PollutionDTO {
*/ */
private Double vInharm = 0.0; private Double vInharm = 0.0;
/**
* 谐波电压含有率污染值
*/
private Double vHarmonic = 0.0;
} }

View File

@@ -0,0 +1,49 @@
package com.njcn.prepare.harmonic.pojo.influxdb.po;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import java.time.Instant;
/**
* <p>
*
* </p>
*
* @author cdf
* @since 2022-01-07
*/
@Data
@Measurement(name = "pqs_communicate")
public class Communicate {
private static final long serialVersionUID = 1L;
/**
* 终端Id
*/
/**
* 更新时间
*/
@Column(name = "time")
private Instant updateTime;
@Column(name = "dev_id")
private String devId;
/**
* 事件类型(0中断1正常2退出)
*/
@Column(name = "type")
private Integer type;
/**
* 备注
*/
@Column(name = "description")
private String remark;
}

View File

@@ -22,6 +22,7 @@ public class AlarmPO extends BaseEntity {
private String deviceId; private String deviceId;
private LocalDateTime updateTime;
/** /**
* 告警描述 * 告警描述
@@ -69,9 +70,9 @@ public class AlarmPO extends BaseEntity {
private Float flowProportion; private Float flowProportion;
/** /**
* 通讯终端次数 * 通讯中断次数
*/ */
private Integer comOutNum = 0; private Integer comOutNum;
/** /**
* 中断时间段描述 * 中断时间段描述

View File

@@ -4,6 +4,8 @@ import com.njcn.db.bo.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class TopMsgPO extends BaseEntity { public class TopMsgPO extends BaseEntity {
@@ -26,7 +28,7 @@ public class TopMsgPO extends BaseEntity {
/** /**
* 通信中断时间段描述 * 通信中断时间段描述
*/ */
private String comOutDesc; private List<String> comOutDesc;
/** /**
* 数据完整性标识 0.不达标 1.达标 * 数据完整性标识 0.不达标 1.达标

View File

@@ -57,19 +57,19 @@ public class RStatComassesDPO implements Serializable {
@TableField(value = "vu_dev5") @TableField(value = "vu_dev5")
private Double vuDev5; private Double vuDev5;
@TableField(value = "data_pst1") @TableField(value = "data_plt1")
private Double dataPst1; private Double dataPst1;
@TableField(value = "data_pst2") @TableField(value = "data_plt2")
private Double dataPst2; private Double dataPst2;
@TableField(value = "data_pst3") @TableField(value = "data_plt3")
private Double dataPst3; private Double dataPst3;
@TableField(value = "data_pst4") @TableField(value = "data_plt4")
private Double dataPst4; private Double dataPst4;
@TableField(value = "data_pst5") @TableField(value = "data_plt5")
private Double dataPst5; private Double dataPst5;
@TableField(value = "v_unbalance1") @TableField(value = "v_unbalance1")

View File

@@ -45,6 +45,7 @@ public class DayDataController extends BaseController {
private final DayDataService dayDataService; private final DayDataService dayDataService;
@Deprecated
@ApiOperation("day表定时任务") @ApiOperation("day表定时任务")
@ApiImplicitParam(value = "jobParam",name = "jobParam",required = true) @ApiImplicitParam(value = "jobParam",name = "jobParam",required = true)
@PostMapping("dayDataHanlder") @PostMapping("dayDataHanlder")

View File

@@ -37,6 +37,7 @@ public class HarmonicGeneralController extends BaseController {
private final HarmonicGeneralService harmonicGeneralService; private final HarmonicGeneralService harmonicGeneralService;
@Deprecated
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/generalData") @PostMapping("/generalData")
@ApiOperation("稳态综合评估日数据计算") @ApiOperation("稳态综合评估日数据计算")

View File

@@ -38,6 +38,7 @@ public class HarmonicMetricController extends BaseController {
private final HarmonicMetricService harmonicMetricService; private final HarmonicMetricService harmonicMetricService;
@Deprecated
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/metricData") @PostMapping("/metricData")
@ApiOperation("稳态指标评估日数据计算") @ApiOperation("稳态指标评估日数据计算")

View File

@@ -38,6 +38,7 @@ public class IntegrityController extends BaseController {
private final IntegrityService integrityService; private final IntegrityService integrityService;
@Deprecated
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/computeDataIntegrity") @PostMapping("/computeDataIntegrity")
@ApiOperation("数据完整性统计") @ApiOperation("数据完整性统计")

View File

@@ -38,6 +38,7 @@ public class LimitTargetController extends BaseController {
private final LimitTargetService limitTargetService; private final LimitTargetService limitTargetService;
@Deprecated
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getLimitTargetData") @PostMapping("/getLimitTargetData")
@ApiOperation("生成limit_target表") @ApiOperation("生成limit_target表")

View File

@@ -34,7 +34,7 @@ import java.util.List;
* @version V1.0.0 * @version V1.0.0
*/ */
@Slf4j @Slf4j
@Api(tags = "监测点数据超限处理") @Api(tags = "监测点数据超限处理limitRate")
@RestController @RestController
@RequestMapping("limitrate") @RequestMapping("limitrate")
@RequiredArgsConstructor @RequiredArgsConstructor
@@ -45,7 +45,7 @@ public class LimitrateController extends BaseController {
private final LineFeignClient lineFeignClient; private final LineFeignClient lineFeignClient;
@Deprecated
@ApiOperation("limitrate表定时任务") @ApiOperation("limitrate表定时任务")
@ApiImplicitParam(value = "limitRateHanlderParam",name = "limitRateHanlderParam",required = true) @ApiImplicitParam(value = "limitRateHanlderParam",name = "limitRateHanlderParam",required = true)
@PostMapping("LimitRateHanlder") @PostMapping("LimitRateHanlder")

View File

@@ -40,6 +40,7 @@ public class OnlineRateController extends BaseController {
private final OnlineRateService onlineRateService; private final OnlineRateService onlineRateService;
@Deprecated
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getOnlineRateData") @PostMapping("/getOnlineRateData")
@ApiOperation("生成在线率数据") @ApiOperation("生成在线率数据")

View File

@@ -80,7 +80,8 @@
COUNT(ca.Id) AS alarmCount, COUNT(ca.Id) AS alarmCount,
GROUP_CONCAT(ca.Remark) AS alarmDesc, GROUP_CONCAT(ca.Remark) AS alarmDesc,
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal, IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
IFNULL(pmf.Actual_Value,0) statisValue IFNULL(ANY_VALUE(pmf.Actual_Value),0) statisValue,
ANY_VALUE(device.Update_Time) AS updateTime
FROM pq_line line FROM pq_line line
INNER JOIN pq_line vol ON line.pid=vol.id INNER JOIN pq_line vol ON line.pid=vol.id
INNER JOIN pq_line device ON vol.pid=device.id INNER JOIN pq_line device ON vol.pid=device.id

View File

@@ -2,23 +2,20 @@ package com.njcn.prepare.harmonic.service.mysql.Impl.device;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.njcn.device.pq.pojo.po.Communicate;
import com.njcn.influxdb.param.InfluxDBPublicParam; import com.njcn.influxdb.param.InfluxDBPublicParam;
import com.njcn.influxdb.utils.InfluxDbUtils; import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.prepare.harmonic.mapper.mysql.device.DeviceAbnormaStatisticsMapper; import com.njcn.prepare.harmonic.mapper.mysql.device.DeviceAbnormaStatisticsMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.Communicate;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO; import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmPO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO; import com.njcn.prepare.harmonic.pojo.mysql.po.line.AlarmStrategyVO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.LinePO;
import com.njcn.prepare.harmonic.pojo.mysql.po.line.TopMsgPO; import com.njcn.prepare.harmonic.pojo.mysql.po.line.TopMsgPO;
import com.njcn.prepare.harmonic.pojo.param.DeviceAbnormaStatisticsParam; import com.njcn.prepare.harmonic.pojo.param.DeviceAbnormaStatisticsParam;
import com.njcn.prepare.harmonic.service.mysql.device.DeviceAbnormalStatisticsService; import com.njcn.prepare.harmonic.service.mysql.device.DeviceAbnormalStatisticsService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper; import org.influxdb.impl.InfluxDBResultMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
@@ -37,33 +34,31 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
private final InfluxDbUtils influxDbUtils; private final InfluxDbUtils influxDbUtils;
@Override @Override
public boolean dailyDeviceAbnormaStatistics(DeviceAbnormaStatisticsParam param) { public boolean dailyDeviceAbnormaStatistics(DeviceAbnormaStatisticsParam param) {
Map<String, List<TopMsgPO>> comMap = new HashMap<>();Map<String, List<AlarmPO>> devLineMap = new HashMap<>();
// 获取监测点告警 // 获取监测点告警
List<AlarmPO> lineAlarms = deviceAbnormaStatisticsMapper.getAlarmByLines( List<AlarmPO> lineAlarms = deviceAbnormaStatisticsMapper.getAlarmByLines(
DateUtil.beginOfDay(DateUtil.parse(param.getBeginTime())), DateUtil.beginOfDay(DateUtil.parse(param.getBeginTime())),
DateUtil.beginOfDay(DateUtil.parse(param.getEndTime()))); DateUtil.endOfDay(DateUtil.parse(param.getEndTime())));
Map<String, List<AlarmPO>> lineMap = new HashMap<>();
if (CollectionUtil.isNotEmpty(lineAlarms)){ if (CollectionUtil.isNotEmpty(lineAlarms)){
// 根据装置分组 // 根据装置分组
lineMap = lineAlarms.stream().collect(Collectors.groupingBy(AlarmPO::getDeviceId)); devLineMap = lineAlarms.stream().collect(Collectors.groupingBy(AlarmPO::getDeviceId));
} }
// 获取设备流量 // 获取设备流量
List<AlarmPO> deviceAlarms = deviceAbnormaStatisticsMapper.getAlarmByDevice( List<AlarmPO> deviceAlarms = deviceAbnormaStatisticsMapper.getAlarmByDevice(
DateUtil.beginOfDay(DateUtil.parse(param.getBeginTime())), DateUtil.beginOfDay(DateUtil.parse(param.getBeginTime())),
DateUtil.beginOfDay(DateUtil.parse(param.getEndTime()))); DateUtil.endOfDay(DateUtil.parse(param.getEndTime())));
List<String> devs = deviceAlarms.stream().map(AlarmPO::getId).collect(Collectors.toList()); List<String> devs = deviceAlarms.stream().map(AlarmPO::getId).collect(Collectors.toList());
devs.add("6469e77fda42db12c7ca6620a092f03c");
Map<String, List<Communicate>> comMap = new HashMap<>();
// 获取通信中断信息 // 获取通信中断信息
List<Communicate> communicate = getCommunicate(devs, param.getBeginTime(), param.getEndTime()); List<TopMsgPO> comMsgs = getCommunicate(devs, param.getBeginTime(), param.getEndTime());
if (CollectionUtil.isNotEmpty(communicate)){ if (CollectionUtil.isNotEmpty(comMsgs)){
comMap = communicate.stream().collect(Collectors.groupingBy(Communicate::getId)); comMap = comMsgs.stream().collect(Collectors.groupingBy(TopMsgPO::getDevId));
} }
// 整合监测点告警信息、数据完整性以及监测点等级为设备信息
for (AlarmPO deviceAlarm : deviceAlarms) { for (AlarmPO deviceAlarm : deviceAlarms) {
if (!lineMap.containsKey(deviceAlarm.getId())) { if (!devLineMap.containsKey(deviceAlarm.getId())) {
continue; continue;
} }
AlarmPO lineAlarm = lineMap.get(deviceAlarm.getId()).get(0); AlarmPO lineAlarm = devLineMap.get(deviceAlarm.getId()).get(0);
deviceAlarm.setAlarmCount(deviceAlarm.getAlarmCount() + lineAlarm.getAlarmCount()); deviceAlarm.setAlarmCount(deviceAlarm.getAlarmCount() + lineAlarm.getAlarmCount());
if (lineAlarm.getDue().compareTo(BigDecimal.ZERO) == 0) { if (lineAlarm.getDue().compareTo(BigDecimal.ZERO) == 0) {
deviceAlarm.setIntegrity(BigDecimal.ZERO); deviceAlarm.setIntegrity(BigDecimal.ZERO);
@@ -73,15 +68,14 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
if (lineAlarm.getLevel() != null) { if (lineAlarm.getLevel() != null) {
deviceAlarm.setLevel(lineAlarm.getLevel()); deviceAlarm.setLevel(lineAlarm.getLevel());
} }
if (CollectionUtil.isNotEmpty(comMap)) { TopMsgPO topMsgPO = comMap.get(deviceAlarm.getId()).get(0);
List<Communicate> communicates = comMap.get(deviceAlarm.getId()); deviceAlarm.setComOutNum(topMsgPO.getComOutCount());
int comOut = communicates.stream().filter(t -> t.getType() == 0).collect(Collectors.toList()).size(); deviceAlarm.setComOutDesc(String.join(",",topMsgPO.getComOutDesc()));
deviceAlarm.setComOutNum(comOut);
} }
} // 比对告警策略并落表
Map<Integer, List<AlarmPO>> levelMap = deviceAlarms.stream().collect(Collectors.groupingBy(AlarmPO::getLevel));
List<AlarmStrategyVO> alarmStrategyVOS = deviceAbnormaStatisticsMapper.selectAlarmStrategy(); List<AlarmStrategyVO> alarmStrategyVOS = deviceAbnormaStatisticsMapper.selectAlarmStrategy();
List<TopMsgPO> alarmExceptions = new ArrayList<>(); List<TopMsgPO> alarmExceptions = new ArrayList<>();
Map<Integer, List<AlarmPO>> levelMap = deviceAlarms.stream().collect(Collectors.groupingBy(AlarmPO::getLevel));
for (AlarmStrategyVO strategyVO : alarmStrategyVOS) { for (AlarmStrategyVO strategyVO : alarmStrategyVOS) {
if (!levelMap.containsKey(strategyVO.getAlgoDesc())){ if (!levelMap.containsKey(strategyVO.getAlgoDesc())){
continue; continue;
@@ -91,7 +85,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
TopMsgPO topMsg = new TopMsgPO(); TopMsgPO topMsg = new TopMsgPO();
topMsg.setDevId(alarmPO.getId()); topMsg.setDevId(alarmPO.getId());
topMsg.setFlowFlag(1); topMsg.setFlowFlag(1);
topMsg.setComOutCount(alarmPO.getComOutNum() == 0 ? 0 : alarmPO.getComOutNum()); topMsg.setComOutCount(alarmPO.getComOutNum() == null ? 0 : alarmPO.getComOutNum());
if (alarmPO.getIntegrity().intValue()<strategyVO.getIntegrityValue()) { if (alarmPO.getIntegrity().intValue()<strategyVO.getIntegrityValue()) {
topMsg.setIntegrityFlag("0"); topMsg.setIntegrityFlag("0");
topMsg.setIntegrityValue(alarmPO.getIntegrity().intValue()); topMsg.setIntegrityValue(alarmPO.getIntegrity().intValue());
@@ -111,7 +105,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
} }
public List<Communicate> getCommunicate(List<String> devs, String startTime, String endTime) { public List<TopMsgPO> getCommunicate(List<String> devs, String startTime, String endTime) {
//组装sql语句 //组装sql语句
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(startTime))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(endTime))).append("' and "); stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(startTime))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(endTime))).append("' and ");
@@ -126,7 +120,55 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
//获取暂降事件 //获取暂降事件
QueryResult result = influxDbUtils.query(sql); QueryResult result = influxDbUtils.query(sql);
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper(); InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
List<Communicate> communicateList = influxDBResultMapper.toPOJO(result, Communicate.class); List<Communicate> communicates = influxDBResultMapper.toPOJO(result, Communicate.class);
return communicateList; List<TopMsgPO> comMsgs = new ArrayList<>();
if (CollectionUtil.isEmpty(communicates)) {
return comMsgs;
}
Map<String, List<Communicate>> comMap = communicates.stream().collect(Collectors.groupingBy(Communicate::getDevId));
for (Map.Entry<String, List<Communicate>> comEntry : comMap.entrySet()) {
TopMsgPO topMsgPO = new TopMsgPO(); List<String> comOutDesc = new ArrayList<>();
topMsgPO.setDevId(comEntry.getKey());
// 根据日期排序
List<Communicate> sortedList = comEntry.getValue().stream().sorted(Comparator.comparing(Communicate::getUpdateTime)).collect(Collectors.toList());
if (sortedList.size() == 1) {
if (sortedList.get(0).getType() == 0) {
comOutDesc.add(sortedList.get(0).getUpdateTime()+""+DateUtil.endOfDay(DateUtil.parse(endTime)));
} else {
comOutDesc.add((DateUtil.beginOfDay(DateUtil.parse(startTime)))+""+sortedList.get(0).getUpdateTime());
}
} else {
switch (sortedList.get(0).getType()) {
case 0:
for (int i = 0; i <sortedList.size() ; i++) {
if (sortedList.get(i).getType()==1) {
String comOutTime = sortedList.get(i-1).getUpdateTime() +""+ sortedList.get(i).getUpdateTime();
comOutDesc.add(comOutTime);
}
}
break;
case 1:
comOutDesc.add((DateUtil.beginOfDay(DateUtil.parse(startTime)))+""+sortedList.get(0).getUpdateTime());
for (int i = 0; i <sortedList.size();i++) {
if (sortedList.get(i).getType()==0) {
StringBuilder sb = new StringBuilder();
sb.append(sortedList.get(i).getUpdateTime());
sb.append("");
sb.append(i==sortedList.size()-1?DateUtil.endOfDay(DateUtil.parse(endTime)):sortedList.get(i+1).getUpdateTime());
comOutDesc.add(sb.toString());
}
}
break;
default:
break;
}
}
topMsgPO.setComOutDesc(comOutDesc);
// 通信中断次数
topMsgPO.setComOutCount(sortedList.stream().filter(a -> a.getType() == 0).collect(Collectors.toList()).size());
comMsgs.add(topMsgPO);
}
return comMsgs;
} }
} }

View File

@@ -30,6 +30,7 @@ import org.springframework.util.CollectionUtils;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -532,6 +533,7 @@ public class DayDataServiceImpl implements DayDataService {
} }
log.info(LocalDateTime.now()+"dayDataJobHandler执行完成!");
} }
@Override @Override

View File

@@ -152,6 +152,12 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
outMap.put("vu_dev3",vuDev3.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP)); outMap.put("vu_dev3",vuDev3.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP));
outMap.put("vu_dev4",vuDev4.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP)); outMap.put("vu_dev4",vuDev4.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP));
outMap.put("vu_dev5",vuDev5.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP)); outMap.put("vu_dev5",vuDev5.multiply(hundred).divide(vuDevAll,3, RoundingMode.HALF_UP));
}else {
outMap.put("vu_dev1",0.0);
outMap.put("vu_dev2",0.0);
outMap.put("vu_dev3",0.0);
outMap.put("vu_dev4",0.0);
outMap.put("vu_dev5",0.0);
} }
String freqDevSql = "select count(freq_dev) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'AVG' and "; String freqDevSql = "select count(freq_dev) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'AVG' and ";
@@ -172,6 +178,12 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
outMap.put("freq_dev3",freqDev3.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP)); outMap.put("freq_dev3",freqDev3.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP));
outMap.put("freq_dev4",freqDev4.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP)); outMap.put("freq_dev4",freqDev4.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP));
outMap.put("freq_dev5",freqDev5.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP)); outMap.put("freq_dev5",freqDev5.multiply(hundred).divide(freqDevAll,3, RoundingMode.HALF_UP));
}else {
outMap.put("freq_dev1",0.0);
outMap.put("freq_dev2",0.0);
outMap.put("freq_dev3",0.0);
outMap.put("freq_dev4",0.0);
outMap.put("freq_dev5",0.0);
} }
String vThdSql = "select count(v_thd) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'CP95' and "; String vThdSql = "select count(v_thd) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'CP95' and ";
@@ -192,6 +204,12 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
outMap.put("v_thd3",vThd3.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP)); outMap.put("v_thd3",vThd3.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP));
outMap.put("v_thd4",vThd4.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP)); outMap.put("v_thd4",vThd4.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP));
outMap.put("v_thd5",vThd5.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP)); outMap.put("v_thd5",vThd5.multiply(hundred).divide(vThdAll,3, RoundingMode.HALF_UP));
}else {
outMap.put("v_thd1",0.0);
outMap.put("v_thd2",0.0);
outMap.put("v_thd3",0.0);
outMap.put("v_thd4",0.0);
outMap.put("v_thd5",0.0);
} }
String vUnbalanceSql="select count(v_unbalance) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'CP95' and "; String vUnbalanceSql="select count(v_unbalance) from data_v where phasic_type != 'T' and quality_flag = '0' and value_type = 'CP95' and ";
@@ -212,6 +230,12 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
outMap.put("v_unbalance3",vUnbalance3.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP)); outMap.put("v_unbalance3",vUnbalance3.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP));
outMap.put("v_unbalance4",vUnbalance4.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP)); outMap.put("v_unbalance4",vUnbalance4.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP));
outMap.put("v_unbalance5",vUnbalance5.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP)); outMap.put("v_unbalance5",vUnbalance5.multiply(hundred).divide(vUnbalanceAll,3, RoundingMode.HALF_UP));
}else {
outMap.put("v_unbalance1",0.0);
outMap.put("v_unbalance2",0.0);
outMap.put("v_unbalance3",0.0);
outMap.put("v_unbalance4",0.0);
outMap.put("v_unbalance5",0.0);
} }
String pstSql="select count(pst) from data_flicker where phasic_type != 'T' and quality_flag = '0' and "; String pstSql="select count(pst) from data_flicker where phasic_type != 'T' and quality_flag = '0' and ";
@@ -227,11 +251,17 @@ public class HarmonicGeneralServiceImpl extends MppServiceImpl<RStatComassesDMap
BigDecimal pst5 = BigDecimal.valueOf(mapper.toPOJO(pstResult5, DataFlickerPO.class).size()); BigDecimal pst5 = BigDecimal.valueOf(mapper.toPOJO(pstResult5, DataFlickerPO.class).size());
BigDecimal pstAll = pst1.add(pst2).add(pst3).add(pst4).add(pst5); BigDecimal pstAll = pst1.add(pst2).add(pst3).add(pst4).add(pst5);
if (pstAll.compareTo(BigDecimal.ZERO)!=0){ if (pstAll.compareTo(BigDecimal.ZERO)!=0){
outMap.put("data_pst1",pst1.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP)); outMap.put("data_plt1",pst1.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));
outMap.put("data_pst2",pst2.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP)); outMap.put("data_plt2",pst2.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));
outMap.put("data_pst3",pst3.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP)); outMap.put("data_plt3",pst3.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));
outMap.put("data_pst4",pst4.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP)); outMap.put("data_plt4",pst4.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));
outMap.put("data_pst5",pst5.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP)); outMap.put("data_plt5",pst5.multiply(hundred).divide(pstAll,3, RoundingMode.HALF_UP));
}else {
outMap.put("data_plt1",0.0);
outMap.put("data_plt2",0.0);
outMap.put("data_plt3",0.0);
outMap.put("data_plt4",0.0);
outMap.put("data_plt5",0.0);
} }
if (!CollUtil.isEmpty(outMap)){ if (!CollUtil.isEmpty(outMap)){

View File

@@ -117,16 +117,12 @@ public class PollutionServiceImpl implements PollutionService {
lineIdList.add(pollutionDTO); lineIdList.add(pollutionDTO);
}); });
pollutionList = processPollutionList(lineIdList,harmonicVoltageList,harmonicCurrentList,frequencyDeviationList,voltageDeviationList,threePhaseVoltageList,negativeSequenceList,interHarmonicVoltageList,voltageFlickerList); pollutionList = processPollutionList(lineIdList,harmonicVoltageList,harmonicCurrentList,frequencyDeviationList,voltageDeviationList,threePhaseVoltageList,negativeSequenceList,interHarmonicVoltageList,voltageFlickerList);
//原逻辑修改influxDb不再进行存储日数据改为Mysql直存
/*insertPolluction(pollutionList,dateOut.getTime());*/
//MySql入表 r_mp_pollution_d //MySql入表 r_mp_pollution_d
insertPollutionDayMySql(pollutionList, dictData, local); insertPollutionDayMySql(pollutionList, dictData, local);
LogUtil.njcnDebug(log, "监测点污染指标数据MySql插入耗时{}", timer.intervalRestart()); LogUtil.njcnDebug(log, "监测点污染指标数据MySql插入耗时{}", timer.intervalRestart());
} }
//原逻辑修改influxDb不再进行存储日数据改为Mysql直存
/*if (Integer.valueOf(BizParamConstant.STAT_BIZ_DAY).equals(lineParam.getType())){
insertLinePollution(pollutionList,local);
}*/
Date dateOut = DateUtil.parse(lineParam.getDataDate()); Date dateOut = DateUtil.parse(lineParam.getDataDate());
LocalDateTime localEnd = LocalDateTimeUtil.now(); LocalDateTime localEnd = LocalDateTimeUtil.now();
LambdaQueryWrapper<RMpPollutionDPO> lambdaQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RMpPollutionDPO> lambdaQuery = new LambdaQueryWrapper<>();
@@ -279,6 +275,10 @@ public class PollutionServiceImpl implements PollutionService {
map.put("pollutionType",dictData.getId()); map.put("pollutionType",dictData.getId());
map.put("value",pollution.getVInharm()); map.put("value",pollution.getVInharm());
} }
if ("V_Harmonic".equals(dictData.getCode())){
map.put("pollutionType",dictData.getId());
map.put("value",pollution.getVHarmonic());
}
} }
private void processData(DictData dictData, List<RMpPollutionDPO> processList, Map<String, Object> map){ private void processData(DictData dictData, List<RMpPollutionDPO> processList, Map<String, Object> map){