Merge remote-tracking branch 'origin/master'
This commit is contained in:
86
pom.xml
86
pom.xml
@@ -40,7 +40,7 @@
|
||||
</distributionManagement>
|
||||
<properties>
|
||||
<!--中间件目标地址-->
|
||||
<!-- <middle.server.url>101.132.25.239</middle.server.url>-->
|
||||
<!-- <middle.server.url>101.132.25.239</middle.server.url>-->
|
||||
<middle.server.url>192.168.1.13</middle.server.url>
|
||||
<!--微服务模块发布地址-->
|
||||
<service.server.url>127.0.0.1</service.server.url>
|
||||
@@ -49,7 +49,8 @@
|
||||
<!--nacos的ip:port-->
|
||||
<nacos.url>${middle.server.url}:18848</nacos.url>
|
||||
<!--服务器发布内容为空-->
|
||||
<!-- <nacos.namespace></nacos.namespace>-->
|
||||
<!-- <nacos.namespace></nacos.namespace>-->
|
||||
<!-- <nacos.namespace>1dd11af6-e668-41fd-a663-02a05705304d</nacos.namespace>-->
|
||||
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
|
||||
<!--sentinel:port-->
|
||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||
@@ -63,14 +64,14 @@
|
||||
<docker.registry.name>njcn</docker.registry.name>
|
||||
<!--切换阿里&华为的配置sdk-->
|
||||
<micro.sdk>common-microservice</micro.sdk>
|
||||
<!-- <micro.sdk>common-huawei</micro.sdk>-->
|
||||
<!-- <micro.sdk>common-huawei</micro.sdk>-->
|
||||
<docker.operate>site</docker.operate>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<!--三剑客版本-->
|
||||
<springboot.version>2.3.12.RELEASE</springboot.version>
|
||||
<!-- <springcloud.version>Hoxton.SR12</springcloud.version>-->
|
||||
<!-- <springcloud.version>Hoxton.SR12</springcloud.version>-->
|
||||
<springcloud.version>Hoxton.SR12</springcloud.version>
|
||||
<springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version>
|
||||
<hutool.version>5.7.9</hutool.version>
|
||||
@@ -90,6 +91,7 @@
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<feignOkhttp.version>11.2</feignOkhttp.version>
|
||||
<okhttp3.version>4.9.0</okhttp3.version>
|
||||
<antisamy.version>1.6.4</antisamy.version>
|
||||
<kaptcha.version>2.3.2</kaptcha.version>
|
||||
<bcprov-jdk15on.version>1.68</bcprov-jdk15on.version>
|
||||
@@ -105,9 +107,6 @@
|
||||
<xxl-job.version>2.3.0</xxl-job.version>
|
||||
<mqtt.version>1.2.7</mqtt.version>
|
||||
<easypoi.version>4.4.0</easypoi.version>
|
||||
<progressbar.version>0.5.3</progressbar.version>
|
||||
<okhttp.version>4.8.1</okhttp.version>
|
||||
<minio.version>8.2.1</minio.version>
|
||||
<spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
@@ -335,35 +334,62 @@
|
||||
<artifactId>easypoi-spring-boot-starter</artifactId>
|
||||
<version>${easypoi.version}</version>
|
||||
</dependency>
|
||||
<!--调用minio服务器-->
|
||||
<dependency>
|
||||
<groupId>me.tongfei</groupId>
|
||||
<artifactId>progressbar</artifactId>
|
||||
<version>${progressbar.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>${minio.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 多数据源切换,当数据源为oracle时需要使用 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>${dynamic-datasource.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>mockwebserver</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okcurl</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp-dnsoverhttps</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp-sse</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp-testing-support</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp-tls</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp-urlconnection</artifactId>
|
||||
<version>${okhttp3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.influxdb</groupId>
|
||||
<artifactId>influxdb-java</artifactId>
|
||||
<version>2.22</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<build>
|
||||
|
||||
@@ -107,6 +107,13 @@
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-log4j2</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -38,8 +38,13 @@ public interface ServerInfo {
|
||||
String CS_HARMONIC_BOOT = "cs-harmonic-boot";
|
||||
|
||||
String CS_REPORT_BOOT = "cs-report-boot";
|
||||
|
||||
String ACCESS_BOOT = "access-boot";
|
||||
|
||||
String CS_STAT_BOOT = "stat-boot";
|
||||
|
||||
String CS_RT_BOOT = "rt-boot";
|
||||
|
||||
String CS_ZL_EVENT_BOOT = "zl-event-boot";
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ public interface BusinessTopic {
|
||||
*/
|
||||
String NJCN_APP_FILE_TOPIC = "njcnAppFileTopic";
|
||||
|
||||
String NJCN_APP_FILE_STREAM_TOPIC = "njcnAppFileStreamTopic";
|
||||
|
||||
|
||||
|
||||
/********************************数据中心*********************************/
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import lombok.Data;
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/9/5 16:38
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class AppFileMessage extends BaseMessage {
|
||||
|
||||
@ApiModelProperty("网络设备码")
|
||||
@@ -38,11 +38,15 @@ public class AppFileMessage extends BaseMessage {
|
||||
private AppFileMessage.FileInfo fileInfo;
|
||||
|
||||
private String data;
|
||||
|
||||
private String name;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class FileInfo{
|
||||
|
||||
private String name;
|
||||
|
||||
private Long fileTime;
|
||||
|
||||
private Integer fileSize;
|
||||
|
||||
@@ -22,8 +22,9 @@ public class AppFileMessageTemplate extends RocketMQEnhanceTemplate {
|
||||
super(template);
|
||||
}
|
||||
|
||||
public SendResult sendMember(AppFileMessage appFileMessage, String tag) {
|
||||
public SendResult sendMember(AppFileMessage appFileMessage) {
|
||||
appFileMessage.setSource(BusinessResource.APP_RESOURCE);
|
||||
return send(BusinessTopic.NJCN_APP_FILE_TOPIC, tag, appFileMessage);
|
||||
return send(BusinessTopic.NJCN_APP_FILE_TOPIC, BusinessTopic.FileTag.INFO_TAG, appFileMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.mq.template;
|
||||
|
||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||
import com.njcn.mq.constant.BusinessResource;
|
||||
import com.njcn.mq.constant.BusinessTopic;
|
||||
import com.njcn.mq.message.AppFileMessage;
|
||||
import org.apache.rocketmq.client.producer.SendResult;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2023/8/11 15:28
|
||||
*/
|
||||
@Component
|
||||
public class AppFileStreamMessageTemplate extends RocketMQEnhanceTemplate {
|
||||
|
||||
public AppFileStreamMessageTemplate(RocketMQTemplate template) {
|
||||
super(template);
|
||||
}
|
||||
|
||||
public SendResult sendMember(AppFileMessage appFileMessage) {
|
||||
appFileMessage.setSource(BusinessResource.APP_RESOURCE);
|
||||
return send(BusinessTopic.NJCN_APP_FILE_STREAM_TOPIC, BusinessTopic.FileTag.STREAM_TAG, appFileMessage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import com.njcn.minioss.config.MinIossProperties;
|
||||
import com.njcn.minioss.util.MinIoUtils;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.PutObjectArgs;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
@@ -17,8 +19,10 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@@ -31,6 +35,9 @@ import java.util.UUID;
|
||||
@RequiredArgsConstructor
|
||||
public class FileStorageUtil {
|
||||
|
||||
@Resource
|
||||
private MinioClient instance;
|
||||
|
||||
private final GeneralInfo generalInfo;
|
||||
|
||||
/***
|
||||
@@ -99,6 +106,31 @@ public class FileStorageUtil {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传InputStream流,并指定文件的名称
|
||||
* @author xuyang
|
||||
* @param inputStream
|
||||
* @param dir
|
||||
* @param fileName
|
||||
* @return
|
||||
*/
|
||||
public String uploadStreamSpecifyName(InputStream inputStream, String dir, String fileName) {
|
||||
String filePath;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(fileName);
|
||||
obsUtil.uploadStream(inputStream, filePath);
|
||||
} else {
|
||||
try {
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO minIoUploadResDTO = uploadStreamSpecifyName(inputStream, minIossProperties.getBucket(), dir, fileName);
|
||||
filePath = minIoUploadResDTO.getMinFileName();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||
}
|
||||
}
|
||||
return filePath;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* 根据文件路径获取文件短期的一个url
|
||||
@@ -221,6 +253,15 @@ public class FileStorageUtil {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MinIoUploadResDTO uploadStreamSpecifyName(InputStream inputStream, String bucketName, String directory, String fileName) throws Exception {
|
||||
if (!minIoUtils.bucketExists(bucketName)) {
|
||||
minIoUtils.makeBucket(bucketName);
|
||||
}
|
||||
directory = (String) Optional.ofNullable(directory).orElse("");
|
||||
String minFileName = directory + fileName;
|
||||
this.instance.putObject((PutObjectArgs)((io.minio.PutObjectArgs.Builder)((io.minio.PutObjectArgs.Builder)PutObjectArgs.builder().bucket(bucketName)).object(minFileName)).stream(inputStream, (long)inputStream.available(), -1L).build());
|
||||
inputStream.close();
|
||||
return new MinIoUploadResDTO(minFileName, minIoUtils.getObjectUrl(bucketName, minFileName, 60));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,11 @@ public interface AppRedisKey {
|
||||
*/
|
||||
String RMQ_CONSUME_KEY="rocketMQConsumeKey:";
|
||||
|
||||
/**
|
||||
* rocketMQ消费文件key
|
||||
*/
|
||||
String RMQ_FILE_CONSUME_KEY="rocketMQFileConsumeKey:";
|
||||
|
||||
String TIME="time-:";
|
||||
|
||||
}
|
||||
|
||||
@@ -69,11 +69,6 @@
|
||||
<groupId>com.nimbusds</groupId>
|
||||
<artifactId>nimbus-jose-jwt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.influxdb</groupId>
|
||||
<artifactId>influxdb-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -59,13 +59,6 @@
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<!--排除okhttp3的依赖-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
<dependencies>
|
||||
|
||||
<!--pq-device-boot和pms-device-boot只能选择一个-->
|
||||
<!-- <dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-boot</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pms-device-boot</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
|
||||
@@ -44,24 +44,6 @@
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ public class OverLimitLineDTO {
|
||||
|
||||
private String lineScale;
|
||||
|
||||
private String manufacturer;
|
||||
|
||||
private String loadType;
|
||||
|
||||
private String lineObjectName;
|
||||
|
||||
@@ -667,7 +667,8 @@
|
||||
A4.`Name` subName,
|
||||
C3.`Name` subScale,
|
||||
A5.`Name` cityCompany,
|
||||
F.`Name` provinceCompany
|
||||
F.`Name` provinceCompany,
|
||||
dev.Manufacturer
|
||||
FROM
|
||||
pq_line A1,
|
||||
pq_line A2,
|
||||
@@ -676,6 +677,7 @@
|
||||
pq_line A5,
|
||||
pq_line A6,
|
||||
pq_voltage B,
|
||||
pq_device dev,
|
||||
sys_dict_data C1,
|
||||
sys_dict_data C2,
|
||||
sys_dict_data C3,
|
||||
@@ -689,7 +691,7 @@
|
||||
</foreach>
|
||||
AND A1.Pid = A2.Id AND A2.Id = B.Id AND B.Scale = C1.Id AND A1.Id = D.Id AND D.Load_Type = C2.Id
|
||||
AND A2.Pid = A3.Id AND A3.Pid = A4.Id AND A4.Pid = A5.Id AND A4.Id = E.Id AND E.Scale = C3.Id
|
||||
AND A5.Pid = A6.Id AND A6.`Name` = F.Area_Code
|
||||
AND A5.Pid = A6.Id AND A6.`Name` = F.Area_Code and A3.id = dev.id
|
||||
</select>
|
||||
|
||||
<select id="getDeviceStatus" resultType="LineStateVO">
|
||||
|
||||
@@ -52,13 +52,6 @@
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<!--排除okhttp3的依赖-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>*</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
@@ -66,7 +59,6 @@
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.jeffreyning</groupId>
|
||||
<artifactId>mybatisplus-plus</artifactId>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.web.utils;
|
||||
package com.njcn.harmonic.pojo.po;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
@@ -34,6 +34,9 @@ public class MonitorOverLimitVO {
|
||||
@ApiModelProperty("监测点电压等级")
|
||||
private String lineScale;
|
||||
|
||||
@ApiModelProperty("厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
|
||||
@@ -57,24 +57,6 @@
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.device.pq.pojo.param.PulicTimeStatisParam;
|
||||
import com.njcn.harmonic.mapper.RStatComassesDMapper;
|
||||
import com.njcn.harmonic.pojo.po.PQSComAssesPO;
|
||||
import com.njcn.harmonic.pojo.po.PqsComasses;
|
||||
import com.njcn.harmonic.pojo.vo.AssesVO;
|
||||
import com.njcn.harmonic.service.AssesService;
|
||||
import com.njcn.web.utils.ComAssesUtil;
|
||||
import com.njcn.web.utils.PqsComasses;
|
||||
import com.njcn.harmonic.util.ComAssesUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -191,25 +191,25 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
@Override
|
||||
public List<ReportTreeVO> deviceUnitTree() {
|
||||
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
|
||||
Map<String,String> unit=new HashMap<>();
|
||||
Map<String, String> unit = new HashMap<>();
|
||||
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
List<ReportTreeVO> info=new ArrayList<>();
|
||||
List<ReportTreeVO> treeVOS=new ArrayList<>();
|
||||
List<ReportTreeVO> info = new ArrayList<>();
|
||||
List<ReportTreeVO> treeVOS = new ArrayList<>();
|
||||
ReportTreeVO reportTreeVO;
|
||||
for (String s : list) {
|
||||
treeVOS=new ArrayList<>();
|
||||
treeVOS = new ArrayList<>();
|
||||
//有效值
|
||||
if(s.equals(DicDataEnum.EFFECTIVE.getCode())){
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO.setName("$"+s+"#i$");
|
||||
if (s.equals(DicDataEnum.EFFECTIVE.getCode())) {
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName("$" + s + "#i$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO.setName("$"+s+"#v$");
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName("$" + s + "#v$");
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
treeVOS.add(reportTreeVO);
|
||||
|
||||
reportTreeVO=new ReportTreeVO();
|
||||
reportTreeVO = new ReportTreeVO();
|
||||
reportTreeVO.setName(s);
|
||||
reportTreeVO.setShowName(DicDataEnum.EFFECTIVE.getName());
|
||||
reportTreeVO.setChildren(treeVOS);
|
||||
@@ -429,7 +429,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
//根据content,获取v值并进行处理
|
||||
List<ReportTemplateDTO> reportTemplateDTOList = new ArrayList<>();
|
||||
JSONArray jsonArray;
|
||||
try(InputStream fileStream = fileStorageUtil.getFileStream(excelRptTemp.getContent())) {
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(excelRptTemp.getContent())) {
|
||||
//通过文件服务器获取
|
||||
jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
jsonArray.forEach(item -> {
|
||||
@@ -483,10 +483,10 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.AVG.equalsIgnoreCase(data.getStatMethod())) {
|
||||
} else if (InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam);
|
||||
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(data.getStatMethod())) {
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam);
|
||||
assSql(data, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -510,19 +510,22 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
String v = son.getStr("v");
|
||||
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
|
||||
if (v.charAt(0) == '$' && v.contains("#")) {
|
||||
String str = assMap.get(v.replace("$", "")).get(0).getValue();
|
||||
String str = "";
|
||||
if(Objects.nonNull(assMap.get(v.replace("$", "")))){
|
||||
str = assMap.get(v.replace("$", "")).get(0).getValue();
|
||||
//没有值,赋"/"
|
||||
if (StringUtils.isBlank(str)) {
|
||||
str = "/";
|
||||
}
|
||||
son.set("v", str);
|
||||
}
|
||||
}
|
||||
//解决数据单位问题 @指标#类型@
|
||||
if (v.charAt(0) == '@' && v.contains("#")) {
|
||||
String replace = v.replace("@", "");
|
||||
if(unit.containsKey(replace)){
|
||||
if (unit.containsKey(replace)) {
|
||||
son.set("v", unit.get(replace));
|
||||
}else{
|
||||
} else {
|
||||
son.set("v", "/");
|
||||
}
|
||||
|
||||
@@ -553,54 +556,55 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
/**
|
||||
* 数据单位信息
|
||||
*
|
||||
* @param lineID
|
||||
* @return
|
||||
*/
|
||||
private Map<String,String> unitMap(String lineID){
|
||||
private Map<String, String> unitMap(String lineID) {
|
||||
PqsDeviceUnit deviceUnit = deviceUnitClient.lineUnitDetail(lineID).getData();
|
||||
List<DictData> dictData = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEVICE_UNIT.getCode()).getData();
|
||||
Map<String,String> unit=new HashMap<>();
|
||||
Map<String, String> unit = new HashMap<>();
|
||||
List<String> list = dictData.stream().map(DictData::getCode).collect(Collectors.toList());
|
||||
for (String s : list) {
|
||||
//有效值
|
||||
if(s.equals(DicDataEnum.EFFECTIVE.getCode())){
|
||||
unit.put(s+"#i",deviceUnit.getIeffective());
|
||||
unit.put(s+"#v",deviceUnit.getLineVoltage());
|
||||
if (s.equals(DicDataEnum.EFFECTIVE.getCode())) {
|
||||
unit.put(s + "#i", deviceUnit.getIeffective());
|
||||
unit.put(s + "#v", deviceUnit.getLineVoltage());
|
||||
}
|
||||
//功率
|
||||
if(s.equals(DicDataEnum.POWER.getCode())){
|
||||
unit.put(s+"#p",deviceUnit.getTotalActiveP());
|
||||
unit.put(s+"#q",deviceUnit.getTotalNoP());
|
||||
unit.put(s+"#s",deviceUnit.getTotalViewP());
|
||||
if (s.equals(DicDataEnum.POWER.getCode())) {
|
||||
unit.put(s + "#p", deviceUnit.getTotalActiveP());
|
||||
unit.put(s + "#q", deviceUnit.getTotalNoP());
|
||||
unit.put(s + "#s", deviceUnit.getTotalViewP());
|
||||
}
|
||||
//畸变率
|
||||
if(s.equals(DicDataEnum.DISTORTION.getCode())){
|
||||
unit.put(s+"#v",deviceUnit.getVdistortion());
|
||||
if (s.equals(DicDataEnum.DISTORTION.getCode())) {
|
||||
unit.put(s + "#v", deviceUnit.getVdistortion());
|
||||
}
|
||||
//电压偏差
|
||||
if(s.equals(DicDataEnum.VOLTAGE.getCode())){
|
||||
unit.put(s+"#v",deviceUnit.getVoltageDev());
|
||||
if (s.equals(DicDataEnum.VOLTAGE.getCode())) {
|
||||
unit.put(s + "#v", deviceUnit.getVoltageDev());
|
||||
}
|
||||
//频率
|
||||
if(s.equals(DicDataEnum.UNIT_FREQUENCY.getCode())){
|
||||
unit.put(s+"#freq",deviceUnit.getUnitFrequency());
|
||||
unit.put(s+"#freqDev",deviceUnit.getUnitFrequencyDev());
|
||||
if (s.equals(DicDataEnum.UNIT_FREQUENCY.getCode())) {
|
||||
unit.put(s + "#freq", deviceUnit.getUnitFrequency());
|
||||
unit.put(s + "#freqDev", deviceUnit.getUnitFrequencyDev());
|
||||
}
|
||||
//三项不平衡度
|
||||
if(s.equals(DicDataEnum.UNBALANCE.getCode())){
|
||||
unit.put(s+"#v","%");
|
||||
unit.put(s+"#vPos",deviceUnit.getPositiveV());
|
||||
unit.put(s+"#vNeg",deviceUnit.getNoPositiveV());
|
||||
unit.put(s+"#vZero",deviceUnit.getNoPositiveV());
|
||||
unit.put(s+"#i","%");
|
||||
unit.put(s+"#iPos","A");
|
||||
unit.put(s+"#iNeg","A");
|
||||
unit.put(s+"#iZero","A");
|
||||
if (s.equals(DicDataEnum.UNBALANCE.getCode())) {
|
||||
unit.put(s + "#v", "%");
|
||||
unit.put(s + "#vPos", deviceUnit.getPositiveV());
|
||||
unit.put(s + "#vNeg", deviceUnit.getNoPositiveV());
|
||||
unit.put(s + "#vZero", deviceUnit.getNoPositiveV());
|
||||
unit.put(s + "#i", "%");
|
||||
unit.put(s + "#iPos", "A");
|
||||
unit.put(s + "#iNeg", "A");
|
||||
unit.put(s + "#iZero", "A");
|
||||
}
|
||||
//基波
|
||||
if(s.equals(DicDataEnum.FUND.getCode())){
|
||||
unit.put(s+"#i",deviceUnit.getIfund());
|
||||
unit.put(s+"#v",deviceUnit.getVfundEffective());
|
||||
if (s.equals(DicDataEnum.FUND.getCode())) {
|
||||
unit.put(s + "#i", deviceUnit.getIfund());
|
||||
unit.put(s + "#v", deviceUnit.getVfundEffective());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -616,7 +620,7 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
//sql拼接示例:select MAX(IHA2) as IHA2 from power_quality_data where Phase = 'A' and LineId='1324564568' and Stat_Method='max' tz('Asia/Shanghai')
|
||||
|
||||
//cp95函数特殊处理 PERCENTILE(field_key, N)
|
||||
if (InfluxDbSqlConstant.CP95.equals(method)) {
|
||||
if (InfluxDbSqlConstant.PERCENTILE.equals(method)) {
|
||||
sql.append(method)
|
||||
.append(InfluxDbSqlConstant.LBK)
|
||||
.append(data.getTemplateName())
|
||||
@@ -660,11 +664,13 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
}
|
||||
|
||||
//频率和频率偏差仅统计T相
|
||||
if(data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")){
|
||||
if (data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")) {
|
||||
sql.append(InfluxDbSqlConstant.AND)
|
||||
.append(InfluxDBTableConstant.PHASIC_TYPE)
|
||||
.append(InfluxDbSqlConstant.EQ)
|
||||
.append(InfluxDBTableConstant.PHASE_TYPE_T);
|
||||
.append(InfluxDbSqlConstant.QM)
|
||||
.append(InfluxDBTableConstant.PHASE_TYPE_T)
|
||||
.append(InfluxDbSqlConstant.QM);
|
||||
}
|
||||
//时间范围处理
|
||||
sql
|
||||
@@ -675,12 +681,21 @@ public class CustomReportServiceImpl implements CustomReportService {
|
||||
|
||||
sql.append(InfluxDbSqlConstant.TZ);
|
||||
|
||||
if (data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")) {
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
|
||||
//根据不同的库表赋值
|
||||
StatisticalDataDTO statisticalDataDTO = commonService.selectBySql(sql);
|
||||
data.setValue(String.format("%.3f",statisticalDataDTO.getValue()));
|
||||
if (Objects.isNull(statisticalDataDTO)) {
|
||||
data.setValue("/");
|
||||
} else {
|
||||
|
||||
data.setValue(String.format("%.3f", statisticalDataDTO.getValue()));
|
||||
}
|
||||
endList.add(data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -115,8 +115,8 @@ public class HarmonicServiceImpl implements IHarmonicService {
|
||||
pollutionVO.setChildren(childrenList.stream().sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList()));
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(dept.getLineIndexes())){
|
||||
// pollutionVO.setData(handleData(getLimitTarget(lineList, harmonicPublicParam.getSearchBeginTime(),harmonicPublicParam.getSearchEndTime()),harmonicPublicParam.getStatisticalType().getCode(),lineList, harmonicPublicParam.getSearchBeginTime(),harmonicPublicParam.getSearchEndTime()).getRatio());
|
||||
pollutionVO.setData(NumberUtil.round(childrenList.stream().mapToDouble(PollutionVO::getData).average().orElse(3.14159),2).doubleValue());
|
||||
double tem = childrenList.stream().mapToDouble(PollutionVO::getData).average().orElse(3.14159);
|
||||
pollutionVO.setData(tem == 3.14159||tem<0?3.14159:NumberUtil.round(tem,2).doubleValue());
|
||||
}
|
||||
list.add(pollutionVO);
|
||||
}
|
||||
@@ -436,12 +436,12 @@ public class HarmonicServiceImpl implements IHarmonicService {
|
||||
}
|
||||
//平均超标天数
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
avgOverDay = -1.0;
|
||||
avgOverDay = 0;
|
||||
} else {
|
||||
avgOverDay = overLineCount == 0?0.0:BigDecimal.valueOf(overCountByDay*1.0/overLineCount).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
}
|
||||
//月监测点超标占比
|
||||
ratio = map.size() == 0?-1.0:BigDecimal.valueOf(ratio*100/map.size()).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
ratio = map.size() == 0?0:BigDecimal.valueOf(ratio*100/map.size()).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
areaDTO.setOnlineCount(onlineCount);
|
||||
areaDTO.setOverLineCount(overLineCount);
|
||||
//平均超标天数
|
||||
|
||||
@@ -9,8 +9,10 @@ import com.njcn.common.pojo.constant.BizParamConstant;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.pq.api.DeviceUnitClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
@@ -83,13 +85,14 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
|
||||
private final DataHarmRateVMapper dataHarmRateVMapper;
|
||||
|
||||
private final DeviceUnitClient deviceUnitClient;
|
||||
|
||||
|
||||
@Override
|
||||
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
|
||||
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
|
||||
//获取监测点
|
||||
String[] points = historyParam.getLineId();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
Integer number = 0;
|
||||
for (int i = 0; i < points.length; i++) {
|
||||
HistoryDataResultVO historyDataResultVO;
|
||||
@@ -237,6 +240,8 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
}
|
||||
|
||||
private QueryResultLimitVO getQueryResult(String startTime, String endTime, String lineList, String contion, Integer number, Integer valueType, Integer ptType) {
|
||||
PqsDeviceUnit pqsDeviceUnit = deviceUnitClient.lineUnitDetail(lineList).getData();
|
||||
|
||||
QueryResultLimitVO queryResultLimitVO = new QueryResultLimitVO();
|
||||
if (!lineList.isEmpty()) {
|
||||
Float topLimit = 0f;
|
||||
@@ -282,7 +287,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("kV");
|
||||
unit.add(pqsDeviceUnit.getPhaseVoltage());
|
||||
targetName = "相电压有效值";
|
||||
break;
|
||||
case 11:
|
||||
@@ -292,7 +297,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("AB相");
|
||||
phasicType.add("BC相");
|
||||
phasicType.add("CA相");
|
||||
unit.add("kV");
|
||||
unit.add(pqsDeviceUnit.getLineVoltage());
|
||||
targetName = "线电压有效值";
|
||||
break;
|
||||
case 12:
|
||||
@@ -329,9 +334,9 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("零序电压");
|
||||
phasicType.add("正序电压");
|
||||
phasicType.add("负序电压");
|
||||
unit.add("V");
|
||||
unit.add("kV");
|
||||
unit.add("V");
|
||||
unit.add(pqsDeviceUnit.getNoPositiveV());
|
||||
unit.add(pqsDeviceUnit.getPositiveV());
|
||||
unit.add(pqsDeviceUnit.getNoPositiveV());
|
||||
targetName = "电压不平衡";
|
||||
break;
|
||||
case 15:
|
||||
@@ -448,7 +453,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("CA相");
|
||||
}
|
||||
if (number == 1) {
|
||||
unit.add("kV");
|
||||
unit.add(pqsDeviceUnit.getVfundEffective());
|
||||
} else {
|
||||
unit.add("V");
|
||||
}
|
||||
@@ -549,7 +554,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("BC相");
|
||||
phasicType.add("CA相");
|
||||
}
|
||||
unit.add("kV");
|
||||
unit.add(pqsDeviceUnit.getPhaseVoltage());
|
||||
break;
|
||||
case 49:
|
||||
//间谐波电流幅值
|
||||
@@ -569,7 +574,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
if (number == 1) {
|
||||
unit.add("kW");
|
||||
unit.add(pqsDeviceUnit.getFundActiveP());
|
||||
} else {
|
||||
unit.add("W");
|
||||
}
|
||||
@@ -583,7 +588,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
if (number == 1) {
|
||||
unit.add("kVar");
|
||||
unit.add(pqsDeviceUnit.getTotalNoP());
|
||||
} else {
|
||||
unit.add("Var");
|
||||
}
|
||||
@@ -597,7 +602,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
if (number == 1) {
|
||||
unit.add("kVA");
|
||||
unit.add(pqsDeviceUnit.getTotalViewP());
|
||||
} else {
|
||||
unit.add("VA");
|
||||
}
|
||||
@@ -610,7 +615,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("kW");
|
||||
unit.add(pqsDeviceUnit.getTotalActiveP());
|
||||
targetName = "三相有功功率";
|
||||
break;
|
||||
case 54:
|
||||
@@ -620,7 +625,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("kVar");
|
||||
unit.add(pqsDeviceUnit.getTotalNoP());
|
||||
targetName = "三相无功功率";
|
||||
break;
|
||||
case 55:
|
||||
@@ -630,7 +635,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("kVA");
|
||||
unit.add(pqsDeviceUnit.getTotalViewP());
|
||||
targetName = "三相视在功率";
|
||||
break;
|
||||
case 56:
|
||||
@@ -638,7 +643,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
sql = "SELECT time as time, p as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_p WHERE " + stringBuilder +
|
||||
" and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("三相总有功功率");
|
||||
unit.add("kW");
|
||||
unit.add(pqsDeviceUnit.getTotalActiveP());
|
||||
targetName = "三相总有功功率";
|
||||
break;
|
||||
case 57:
|
||||
@@ -646,7 +651,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
sql = "SELECT time as time, q as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_q WHERE " + stringBuilder +
|
||||
" and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("三相总无功功率");
|
||||
unit.add("kVar");
|
||||
unit.add(pqsDeviceUnit.getTotalNoP());
|
||||
targetName = "三相总无功功率";
|
||||
break;
|
||||
case 58:
|
||||
@@ -654,7 +659,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
sql = "SELECT time as time, s as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmpower_s WHERE " + stringBuilder +
|
||||
" and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
|
||||
phasicType.add("三相总视在功率");
|
||||
unit.add("kVA");
|
||||
unit.add(pqsDeviceUnit.getTotalViewP());
|
||||
targetName = "三相总视在功率";
|
||||
break;
|
||||
case 59:
|
||||
|
||||
@@ -177,17 +177,17 @@ public class IntegrityServiceImpl implements IntegrityService {
|
||||
if (CollectionUtils.isEmpty(lineIndexes)) {
|
||||
continue;
|
||||
}
|
||||
// type.add(generalDeviceDTO.getName());
|
||||
outParam.setType(generalDeviceDTO.getName());
|
||||
//根据监测点查询数据完整性
|
||||
List<PublicDTO> integrityData = getCondition(lineIndexes, integrityIconParam.getSearchBeginTime(), integrityIconParam.getSearchEndTime());
|
||||
// single.add(integrityData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159));
|
||||
outParam.setSingle(NumberUtil.round(integrityData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159),2).doubleValue());
|
||||
|
||||
double temSingle = integrityData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setSingle(temSingle == 3.14159 ? temSingle :NumberUtil.round(temSingle, 2).doubleValue());
|
||||
//如果存在需要比较的时间,再获取对应数据
|
||||
if (StrUtil.isNotBlank(integrityIconParam.getPeriodBeginTime()) && StrUtil.isNotBlank(integrityIconParam.getPeriodEndTime())) {
|
||||
List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), integrityIconParam.getPeriodEndTime());
|
||||
// ratio.add(compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159));
|
||||
outParam.setRatio(NumberUtil.round(compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159),2).doubleValue());
|
||||
double tem = compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setRatio(tem == 3.14159 ? tem : NumberUtil.round(tem, 2).doubleValue());
|
||||
}
|
||||
out.add(outParam);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.web.utils;
|
||||
package com.njcn.harmonic.util;
|
||||
|
||||
|
||||
import com.njcn.harmonic.pojo.po.PqsComasses;
|
||||
import com.njcn.web.utils.FloatUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -17,42 +17,21 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>influxdb-springboot-starter</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-device-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -115,15 +115,6 @@
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.8.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>prepare-api</artifactId>
|
||||
|
||||
@@ -25,129 +25,89 @@ public class SupvProblemVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
private String problemId;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "计划名称",width = 40)
|
||||
private String workPlanName;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
private String provinceId;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
private String planId;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "责任单位编号",width = 15)
|
||||
private String dutyOrgId;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "责任单位名称",width = 15)
|
||||
private String dutyOrgName;
|
||||
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "监测点类型",width = 15)
|
||||
private String monitorType;
|
||||
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
@Excel(name = "",width = 15)
|
||||
private LocalDateTime rectificationTime;
|
||||
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "",width = 15)
|
||||
private LocalDateTime planRectificationTime;
|
||||
|
||||
/**
|
||||
* 是否发布预告警
|
||||
*/
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "是否发布预告警",width = 15,replace= {"否_0", "是_1"})
|
||||
private Integer ifReleaseWarning;
|
||||
|
||||
/**
|
||||
* 问题简要描述
|
||||
*/
|
||||
@Excel(name = "",width = 15)
|
||||
private String simpleProblemDesc;
|
||||
@Excel(name = "计划整改时间",width = 15)
|
||||
private String planRectificationTime;
|
||||
|
||||
/**
|
||||
* 监督标准序号
|
||||
*/
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "整改情况",width = 15,replace = {"已整改_01","未整改_02"})
|
||||
private String rectificationStatus;
|
||||
|
||||
@Excel(name = "整改时间",width = 15)
|
||||
private String rectificationTime;
|
||||
|
||||
|
||||
@Excel(name = "监督标准",width = 15)
|
||||
private String supvStandard;
|
||||
|
||||
|
||||
@Excel(name = "监督标准序号",width = 15)
|
||||
private String supvStandardSort;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@Excel(name = "",width = 15)
|
||||
@Excel(name = "标准出处",width = 15)
|
||||
private String supvResouce;
|
||||
|
||||
@Excel(name = "问题等级",width = 15)
|
||||
private String problemLevel;
|
||||
|
||||
|
||||
@Excel(name = "问题类型",width = 15)
|
||||
private String problemType;
|
||||
|
||||
|
||||
@Excel(name = "问题简要描述",width = 40)
|
||||
private String simpleProblemDesc;
|
||||
|
||||
|
||||
@Excel(name = "问题描述",width = 200)
|
||||
private String problemDesc;
|
||||
|
||||
/**
|
||||
* 监督标准
|
||||
* 问题发现时间
|
||||
*/
|
||||
private String supvStandard;
|
||||
|
||||
/**
|
||||
* 标准出处
|
||||
*/
|
||||
private String supvResouce;
|
||||
|
||||
/**
|
||||
* 问题等级 01 一般,02 较大
|
||||
*/
|
||||
private String problemLevel;
|
||||
@Excel(name = "问题发现时间",width = 15)
|
||||
private String discoveryTime;
|
||||
|
||||
/**
|
||||
* 定级依据
|
||||
*/
|
||||
@Excel(name = "定级依据",width = 15)
|
||||
private String problemLevelReason;
|
||||
|
||||
/**
|
||||
* 问题类型
|
||||
*/
|
||||
private String problemType;
|
||||
|
||||
/**
|
||||
* 整改方案
|
||||
*/
|
||||
@Excel(name = "整改方案",width = 50)
|
||||
private String rectificationProgramme;
|
||||
|
||||
/**
|
||||
* 整改情况01已整改,02未整改
|
||||
*/
|
||||
private String rectificationStatus;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
*/
|
||||
@Excel(name = "整改措施",width = 40)
|
||||
private String rectificationMeasure;
|
||||
|
||||
|
||||
/**
|
||||
* 0.以上送 1.未上送 2.取消上送
|
||||
*/
|
||||
private Integer isUploadHead;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注",width = 40)
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(name = "attachmentName", value = "盖章报告")
|
||||
private String attachmentName;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(name = "attachmentNameTwo", value = "佐证材料")
|
||||
private String attachmentNameTwo;
|
||||
|
||||
/**
|
||||
* 问题发现时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime discoveryTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -17,7 +18,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2023/9/6 9:33
|
||||
*/
|
||||
@Getter
|
||||
public class PlanVO {
|
||||
public class PlanVO extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
|
||||
@@ -113,6 +113,18 @@
|
||||
<artifactId>http-client</artifactId>
|
||||
<version>1.1.5.11</version>
|
||||
</dependency>
|
||||
|
||||
<!--liteFlow相关依赖-->
|
||||
<!-- <dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||
<version>2.10.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yomahub</groupId>
|
||||
<artifactId>liteflow-rule-nacos</artifactId>
|
||||
<version>2.10.7</version>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<select id="listDerive" resultType="com.njcn.process.pojo.vo.SupvProblemVO">
|
||||
select
|
||||
work_plan_name,
|
||||
sp.*
|
||||
spm.*
|
||||
from
|
||||
supv_problem spm
|
||||
INNER JOIN supv_plan sp on sp.plan_Id=spm.plan_id
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SupvAlarmBackServiceImpl extends ServiceImpl<SupvAlarmBackMapper, S
|
||||
@Override
|
||||
public boolean delAlarmBack(List<String> ids) {
|
||||
LambdaQueryWrapper<SupvAlarmBack> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.ne(SupvAlarmBack::getIsUploadHead, 0).eq(SupvAlarmBack::getWorkAlarmId, ids);
|
||||
lambdaQueryWrapper.ne(SupvAlarmBack::getIsUploadHead, 0).in(SupvAlarmBack::getWorkAlarmId, ids);
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SupvAlarmServiceImpl extends ServiceImpl<SupvAlarmMapper, SupvAlarm
|
||||
@Override
|
||||
public boolean delAlarm(List<String> planIds) {
|
||||
LambdaQueryWrapper<SupvAlarm> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.ne(SupvAlarm::getIsUploadHead, 0).eq(SupvAlarm::getAlarmId, planIds);
|
||||
lambdaQueryWrapper.ne(SupvAlarm::getIsUploadHead, 0).in(SupvAlarm::getAlarmId, planIds);
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SupvPlanHisServiceImpl extends ServiceImpl<SupvPlanHisMapper, SupvP
|
||||
@Override
|
||||
public boolean delPlanHis(List<String> planIds) {
|
||||
LambdaQueryWrapper<SupvPlanHis> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupvPlanHis::getIsUploadHead, 1).eq(SupvPlanHis::getId, planIds);
|
||||
lambdaQueryWrapper.ne(SupvPlanHis::getIsUploadHead, 0).in(SupvPlanHis::getId, planIds);
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
|
||||
@@ -211,7 +211,7 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delPlan(List<String> planIds) {
|
||||
LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.ne(SupvPlan::getIsUploadHead, 0).eq(SupvPlan::getPlanId, planIds);
|
||||
lambdaQueryWrapper.ne(SupvPlan::getIsUploadHead, 0).in(SupvPlan::getPlanId, planIds);
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
|
||||
@@ -20,7 +20,10 @@ import com.njcn.process.pojo.po.SupvProblem;
|
||||
import com.njcn.process.pojo.vo.SupvProblemVO;
|
||||
import com.njcn.process.service.ISupvProblemService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.user.pojo.vo.PvTerminalTreeVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -87,7 +90,7 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delProblem(List<String> problemIds) {
|
||||
LambdaQueryWrapper<SupvProblem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.ne(SupvProblem::getIsUploadHead, 0).eq(SupvProblem::getProblemId, problemIds);
|
||||
lambdaQueryWrapper.ne(SupvProblem::getIsUploadHead, 0).in(SupvProblem::getProblemId, problemIds);
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择未上送国网的删除");
|
||||
@@ -136,8 +139,26 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
|
||||
@Override
|
||||
public void problemList(SupvProblemParam supvProblemParam) {
|
||||
List<SupvProblemVO> supvProblemVOS = this.baseMapper.listDerive(supvProblemParam);
|
||||
// List<PqsLineWeightVo.WeightExcel> weightExcels = this.baseMapper.selectWeights(terminalMainQueryParam);
|
||||
// ExcelUtil.exportExcel("监测点权重信息.xlsx",PqsLineWeightVo.WeightExcel.class,weightExcels);
|
||||
//监测点状态
|
||||
List<DictData> monitorTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITOR_TYPE.getCode()).getData();
|
||||
Map<String, DictData> mapMonitorType = monitorTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
//问题类型
|
||||
List<DictData> problemTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_PROBLEM_TYPE.getCode()).getData();
|
||||
Map<String, DictData> mapProblemType = problemTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
|
||||
for (SupvProblemVO supvProblem : supvProblemVOS) {
|
||||
Dept dept = deptFeignClient.getDeptByCode(supvProblem.getDutyOrgId()).getData();
|
||||
supvProblem.setDutyOrgName(dept.getName());
|
||||
|
||||
if (mapMonitorType.containsKey(supvProblem.getMonitorType())) {
|
||||
supvProblem.setMonitorType(mapMonitorType.get(supvProblem.getMonitorType()).getName());
|
||||
}
|
||||
if (mapProblemType.containsKey(supvProblem.getProblemType())) {
|
||||
supvProblem.setProblemType(mapProblemType.get(supvProblem.getProblemType()).getName());
|
||||
}
|
||||
}
|
||||
|
||||
ExcelUtil.exportExcel("实施问题信息.xlsx",SupvProblemVO.class,supvProblemVOS);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ public enum SystemResponseEnum {
|
||||
|
||||
INTERFERENCE_EMPTY("A00356","查询字典干扰源类型数据为空"),
|
||||
BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"),
|
||||
SYSTEM_TYPE_EMPTY("A00356","查询字典系统类型数据为空"),
|
||||
DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"),
|
||||
MANUFACTURER("A00358","查询字典终端厂家数据为空"),
|
||||
DEV_VARIETY("A00359","查询字典终端类型数据为空"),
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.mapper.ComponentMapper;
|
||||
@@ -103,6 +104,9 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
||||
Map<String,List<ComponentVO>> map = list.stream().filter(m->!Objects.isNull(m.getSystemType())).collect(Collectors.groupingBy(ComponentVO::getSystemType));
|
||||
map.forEach((k,v)->{
|
||||
DictData dictData = dicDataFeignClient.getDicDataById(k).getData();
|
||||
if (Objects.isNull(dictData)){
|
||||
throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY);
|
||||
}
|
||||
ComponentVO componentVO = new ComponentVO();
|
||||
componentVO.setId(dictData.getId());
|
||||
componentVO.setName(dictData.getName());
|
||||
@@ -145,6 +149,9 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
||||
Map<String,List<ComponentVO>> map = componentVOList.stream().collect(Collectors.groupingBy(ComponentVO::getSystemType));
|
||||
map.forEach((k, v)->{
|
||||
DictData dictData = dicDataFeignClient.getDicDataById(k).getData();
|
||||
if (Objects.isNull(dictData)){
|
||||
throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY);
|
||||
}
|
||||
ComponentVO componentVO = new ComponentVO();
|
||||
componentVO.setName(dictData.getName());
|
||||
componentVO.setChildren(
|
||||
|
||||
Reference in New Issue
Block a user