Merge remote-tracking branch 'origin/master'

This commit is contained in:
huangzj
2023-09-11 09:06:41 +08:00
38 changed files with 374 additions and 305 deletions

78
pom.xml
View File

@@ -50,6 +50,7 @@
<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>1dd11af6-e668-41fd-a663-02a05705304d</nacos.namespace>-->
<nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace> <nacos.namespace>fd74182b-1fce-4dba-afa7-2623b0376205</nacos.namespace>
<!--sentinel:port--> <!--sentinel:port-->
<sentinel.url>${middle.server.url}:8080</sentinel.url> <sentinel.url>${middle.server.url}:8080</sentinel.url>
@@ -90,6 +91,7 @@
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<jjwt.version>0.9.1</jjwt.version> <jjwt.version>0.9.1</jjwt.version>
<feignOkhttp.version>11.2</feignOkhttp.version> <feignOkhttp.version>11.2</feignOkhttp.version>
<okhttp3.version>4.9.0</okhttp3.version>
<antisamy.version>1.6.4</antisamy.version> <antisamy.version>1.6.4</antisamy.version>
<kaptcha.version>2.3.2</kaptcha.version> <kaptcha.version>2.3.2</kaptcha.version>
<bcprov-jdk15on.version>1.68</bcprov-jdk15on.version> <bcprov-jdk15on.version>1.68</bcprov-jdk15on.version>
@@ -105,9 +107,6 @@
<xxl-job.version>2.3.0</xxl-job.version> <xxl-job.version>2.3.0</xxl-job.version>
<mqtt.version>1.2.7</mqtt.version> <mqtt.version>1.2.7</mqtt.version>
<easypoi.version>4.4.0</easypoi.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> <spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@@ -335,35 +334,62 @@
<artifactId>easypoi-spring-boot-starter</artifactId> <artifactId>easypoi-spring-boot-starter</artifactId>
<version>${easypoi.version}</version> <version>${easypoi.version}</version>
</dependency> </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时需要使用 --> <!-- 多数据源切换当数据源为oracle时需要使用 -->
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
<version>${dynamic-datasource.version}</version> <version>${dynamic-datasource.version}</version>
</dependency> </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> </dependencies>
</dependencyManagement> </dependencyManagement>
<build> <build>

View File

@@ -107,6 +107,13 @@
<!-- <groupId>org.springframework.boot</groupId>--> <!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-log4j2</artifactId>--> <!-- <artifactId>spring-boot-starter-log4j2</artifactId>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -38,8 +38,13 @@ public interface ServerInfo {
String CS_HARMONIC_BOOT = "cs-harmonic-boot"; String CS_HARMONIC_BOOT = "cs-harmonic-boot";
String CS_REPORT_BOOT = "cs-report-boot"; String CS_REPORT_BOOT = "cs-report-boot";
String ACCESS_BOOT = "access-boot";
String CS_STAT_BOOT = "stat-boot"; String CS_STAT_BOOT = "stat-boot";
String CS_RT_BOOT = "rt-boot"; String CS_RT_BOOT = "rt-boot";
String CS_ZL_EVENT_BOOT = "zl-event-boot"; String CS_ZL_EVENT_BOOT = "zl-event-boot";

View File

@@ -28,6 +28,9 @@ public interface BusinessTopic {
*/ */
String NJCN_APP_FILE_TOPIC = "njcnAppFileTopic"; String NJCN_APP_FILE_TOPIC = "njcnAppFileTopic";
String NJCN_APP_FILE_STREAM_TOPIC = "njcnAppFileStreamTopic";
/********************************数据中心*********************************/ /********************************数据中心*********************************/

View File

@@ -11,7 +11,7 @@ import lombok.Data;
* @version 1.0.0 * @version 1.0.0
* @createTime 2023/9/5 16:38 * @createTime 2023/9/5 16:38
*/ */
@Data
public class AppFileMessage extends BaseMessage { public class AppFileMessage extends BaseMessage {
@ApiModelProperty("网络设备码") @ApiModelProperty("网络设备码")
@@ -38,11 +38,15 @@ public class AppFileMessage extends BaseMessage {
private AppFileMessage.FileInfo fileInfo; private AppFileMessage.FileInfo fileInfo;
private String data; private String data;
private String name;
} }
@Data @Data
public static class FileInfo{ public static class FileInfo{
private String name;
private Long fileTime; private Long fileTime;
private Integer fileSize; private Integer fileSize;

View File

@@ -22,8 +22,9 @@ public class AppFileMessageTemplate extends RocketMQEnhanceTemplate {
super(template); super(template);
} }
public SendResult sendMember(AppFileMessage appFileMessage, String tag) { public SendResult sendMember(AppFileMessage appFileMessage) {
appFileMessage.setSource(BusinessResource.APP_RESOURCE); 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);
} }
} }

View File

@@ -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);
}
}

View File

@@ -10,6 +10,8 @@ import com.njcn.minioss.config.MinIossProperties;
import com.njcn.minioss.util.MinIoUtils; import com.njcn.minioss.util.MinIoUtils;
import com.njcn.oss.constant.GeneralConstant; import com.njcn.oss.constant.GeneralConstant;
import com.njcn.oss.enums.OssResponseEnum; import com.njcn.oss.enums.OssResponseEnum;
import io.minio.MinioClient;
import io.minio.PutObjectArgs;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.IOUtils; 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.stereotype.Component;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.Optional;
import java.util.UUID; import java.util.UUID;
/** /**
@@ -31,6 +35,9 @@ import java.util.UUID;
@RequiredArgsConstructor @RequiredArgsConstructor
public class FileStorageUtil { public class FileStorageUtil {
@Resource
private MinioClient instance;
private final GeneralInfo generalInfo; private final GeneralInfo generalInfo;
/*** /***
@@ -99,6 +106,31 @@ public class FileStorageUtil {
return filePath; 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 * 根据文件路径获取文件短期的一个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));
}
} }

View File

@@ -46,4 +46,11 @@ public interface AppRedisKey {
*/ */
String RMQ_CONSUME_KEY="rocketMQConsumeKey:"; String RMQ_CONSUME_KEY="rocketMQConsumeKey:";
/**
* rocketMQ消费文件key
*/
String RMQ_FILE_CONSUME_KEY="rocketMQFileConsumeKey:";
String TIME="time-:";
} }

View File

@@ -69,11 +69,6 @@
<groupId>com.nimbusds</groupId> <groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId> <artifactId>nimbus-jose-jwt</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -59,13 +59,6 @@
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>pqs-influx</artifactId> <artifactId>pqs-influx</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<!--排除okhttp3的依赖-->
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -21,16 +21,16 @@
<dependencies> <dependencies>
<!--pq-device-boot和pms-device-boot只能选择一个--> <!--pq-device-boot和pms-device-boot只能选择一个-->
<!-- <dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>pq-device-boot</artifactId> <artifactId>pq-device-boot</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency>--> </dependency>
<dependency> <!-- <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>pms-device-boot</artifactId> <artifactId>pms-device-boot</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>-->
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>

View File

@@ -44,24 +44,6 @@
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>common-oss</artifactId> <artifactId>common-oss</artifactId>
<version>${project.version}</version> <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> </dependency>
</dependencies> </dependencies>

View File

@@ -18,6 +18,8 @@ public class OverLimitLineDTO {
private String lineScale; private String lineScale;
private String manufacturer;
private String loadType; private String loadType;
private String lineObjectName; private String lineObjectName;

View File

@@ -667,7 +667,8 @@
A4.`Name` subName, A4.`Name` subName,
C3.`Name` subScale, C3.`Name` subScale,
A5.`Name` cityCompany, A5.`Name` cityCompany,
F.`Name` provinceCompany F.`Name` provinceCompany,
dev.Manufacturer
FROM FROM
pq_line A1, pq_line A1,
pq_line A2, pq_line A2,
@@ -676,6 +677,7 @@
pq_line A5, pq_line A5,
pq_line A6, pq_line A6,
pq_voltage B, pq_voltage B,
pq_device dev,
sys_dict_data C1, sys_dict_data C1,
sys_dict_data C2, sys_dict_data C2,
sys_dict_data C3, sys_dict_data C3,
@@ -689,7 +691,7 @@
</foreach> </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 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 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>
<select id="getDeviceStatus" resultType="LineStateVO"> <select id="getDeviceStatus" resultType="LineStateVO">

View File

@@ -52,13 +52,6 @@
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>pqs-influx</artifactId> <artifactId>pqs-influx</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<!--排除okhttp3的依赖-->
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
@@ -66,7 +59,6 @@
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.jeffreyning</groupId> <groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId> <artifactId>mybatisplus-plus</artifactId>

View File

@@ -1,4 +1,4 @@
package com.njcn.web.utils; package com.njcn.harmonic.pojo.po;
import lombok.Data; import lombok.Data;

View File

@@ -34,6 +34,9 @@ public class MonitorOverLimitVO {
@ApiModelProperty("监测点电压等级") @ApiModelProperty("监测点电压等级")
private String lineScale; private String lineScale;
@ApiModelProperty("厂家")
private String manufacturer;
@ApiModelProperty("变电站名称") @ApiModelProperty("变电站名称")
private String subName; private String subName;

View File

@@ -57,24 +57,6 @@
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>common-oss</artifactId> <artifactId>common-oss</artifactId>
<version>${project.version}</version> <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> </dependency>
</dependencies> </dependencies>

View File

@@ -5,10 +5,10 @@ import cn.hutool.core.date.DateUtil;
import com.njcn.device.pq.pojo.param.PulicTimeStatisParam; import com.njcn.device.pq.pojo.param.PulicTimeStatisParam;
import com.njcn.harmonic.mapper.RStatComassesDMapper; import com.njcn.harmonic.mapper.RStatComassesDMapper;
import com.njcn.harmonic.pojo.po.PQSComAssesPO; 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.pojo.vo.AssesVO;
import com.njcn.harmonic.service.AssesService; import com.njcn.harmonic.service.AssesService;
import com.njcn.web.utils.ComAssesUtil; import com.njcn.harmonic.util.ComAssesUtil;
import com.njcn.web.utils.PqsComasses;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@@ -483,10 +483,10 @@ public class CustomReportServiceImpl implements CustomReportService {
assSql(data, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam); assSql(data, sql, endList, InfluxDbSqlConstant.MAX, reportSearchParam);
} else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(data.getStatMethod())) { } else if (InfluxDbSqlConstant.MIN.equalsIgnoreCase(data.getStatMethod())) {
assSql(data, sql, endList, InfluxDbSqlConstant.MIN, reportSearchParam); 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); assSql(data, sql, endList, InfluxDbSqlConstant.AVG, reportSearchParam);
} else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(data.getStatMethod())) { } else if (InfluxDbSqlConstant.CP95.equalsIgnoreCase(data.getStatMethod())) {
assSql(data, sql, endList, InfluxDbSqlConstant.CP95, reportSearchParam); assSql(data, sql, endList, InfluxDbSqlConstant.PERCENTILE, reportSearchParam);
} }
}); });
} }
@@ -510,13 +510,16 @@ public class CustomReportServiceImpl implements CustomReportService {
String v = son.getStr("v"); String v = son.getStr("v");
//数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$ //数据格式:$HA[_25]#B#max#classId$ 或 $HA[_25]#max#classId$
if (v.charAt(0) == '$' && v.contains("#")) { 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)) { if (StringUtils.isBlank(str)) {
str = "/"; str = "/";
} }
son.set("v", str); son.set("v", str);
} }
}
//解决数据单位问题 @指标#类型@ //解决数据单位问题 @指标#类型@
if (v.charAt(0) == '@' && v.contains("#")) { if (v.charAt(0) == '@' && v.contains("#")) {
String replace = v.replace("@", ""); String replace = v.replace("@", "");
@@ -553,6 +556,7 @@ public class CustomReportServiceImpl implements CustomReportService {
/** /**
* 数据单位信息 * 数据单位信息
*
* @param lineID * @param lineID
* @return * @return
*/ */
@@ -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') //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) //cp95函数特殊处理 PERCENTILE(field_key, N)
if (InfluxDbSqlConstant.CP95.equals(method)) { if (InfluxDbSqlConstant.PERCENTILE.equals(method)) {
sql.append(method) sql.append(method)
.append(InfluxDbSqlConstant.LBK) .append(InfluxDbSqlConstant.LBK)
.append(data.getTemplateName()) .append(data.getTemplateName())
@@ -664,7 +668,9 @@ public class CustomReportServiceImpl implements CustomReportService {
sql.append(InfluxDbSqlConstant.AND) sql.append(InfluxDbSqlConstant.AND)
.append(InfluxDBTableConstant.PHASIC_TYPE) .append(InfluxDBTableConstant.PHASIC_TYPE)
.append(InfluxDbSqlConstant.EQ) .append(InfluxDbSqlConstant.EQ)
.append(InfluxDBTableConstant.PHASE_TYPE_T); .append(InfluxDbSqlConstant.QM)
.append(InfluxDBTableConstant.PHASE_TYPE_T)
.append(InfluxDbSqlConstant.QM);
} }
//时间范围处理 //时间范围处理
sql sql
@@ -675,12 +681,21 @@ public class CustomReportServiceImpl implements CustomReportService {
sql.append(InfluxDbSqlConstant.TZ); sql.append(InfluxDbSqlConstant.TZ);
if (data.getTemplateName().equals("freq_dev") || data.getTemplateName().equals("freq")) {
System.out.println(sql);
}
//根据不同的库表赋值 //根据不同的库表赋值
StatisticalDataDTO statisticalDataDTO = commonService.selectBySql(sql); StatisticalDataDTO statisticalDataDTO = commonService.selectBySql(sql);
if (Objects.isNull(statisticalDataDTO)) {
data.setValue("/");
} else {
data.setValue(String.format("%.3f", statisticalDataDTO.getValue())); data.setValue(String.format("%.3f", statisticalDataDTO.getValue()));
}
endList.add(data); endList.add(data);
} }
} }

View File

@@ -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())); pollutionVO.setChildren(childrenList.stream().sorted(Comparator.comparing(PollutionVO::getData).reversed().thenComparing(PollutionVO::getName)).collect(Collectors.toList()));
} }
if (!CollectionUtils.isEmpty(dept.getLineIndexes())){ if (!CollectionUtils.isEmpty(dept.getLineIndexes())){
// pollutionVO.setData(handleData(getLimitTarget(lineList, harmonicPublicParam.getSearchBeginTime(),harmonicPublicParam.getSearchEndTime()),harmonicPublicParam.getStatisticalType().getCode(),lineList, harmonicPublicParam.getSearchBeginTime(),harmonicPublicParam.getSearchEndTime()).getRatio()); double tem = childrenList.stream().mapToDouble(PollutionVO::getData).average().orElse(3.14159);
pollutionVO.setData(NumberUtil.round(childrenList.stream().mapToDouble(PollutionVO::getData).average().orElse(3.14159),2).doubleValue()); pollutionVO.setData(tem == 3.14159||tem<0?3.14159:NumberUtil.round(tem,2).doubleValue());
} }
list.add(pollutionVO); list.add(pollutionVO);
} }
@@ -436,12 +436,12 @@ public class HarmonicServiceImpl implements IHarmonicService {
} }
//平均超标天数 //平均超标天数
if (CollectionUtils.isEmpty(list)){ if (CollectionUtils.isEmpty(list)){
avgOverDay = -1.0; avgOverDay = 0;
} else { } else {
avgOverDay = overLineCount == 0?0.0:BigDecimal.valueOf(overCountByDay*1.0/overLineCount).setScale(2, RoundingMode.HALF_UP).doubleValue(); 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.setOnlineCount(onlineCount);
areaDTO.setOverLineCount(overLineCount); areaDTO.setOverLineCount(overLineCount);
//平均超标天数 //平均超标天数

View File

@@ -9,8 +9,10 @@ import com.njcn.common.pojo.constant.BizParamConstant;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.param.StatisticsBizBaseParam; import com.njcn.common.pojo.param.StatisticsBizBaseParam;
import com.njcn.common.utils.PubUtils; import com.njcn.common.utils.PubUtils;
import com.njcn.device.pq.api.DeviceUnitClient;
import com.njcn.device.pq.api.LineFeignClient; import com.njcn.device.pq.api.LineFeignClient;
import com.njcn.device.biz.pojo.po.Overlimit; 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.device.pq.pojo.vo.LineDetailDataVO;
import com.njcn.event.api.EventDetailFeignClient; import com.njcn.event.api.EventDetailFeignClient;
import com.njcn.event.pojo.po.EventDetail; import com.njcn.event.pojo.po.EventDetail;
@@ -83,13 +85,14 @@ public class HistoryResultServiceImpl implements HistoryResultService {
private final DataHarmRateVMapper dataHarmRateVMapper; private final DataHarmRateVMapper dataHarmRateVMapper;
private final DeviceUnitClient deviceUnitClient;
@Override @Override
public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) { public List<HistoryDataResultVO> getHistoryResult(HistoryParam historyParam) {
List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>(); List<HistoryDataResultVO> historyDataResultVOList = new ArrayList<>();
//获取监测点 //获取监测点
String[] points = historyParam.getLineId(); String[] points = historyParam.getLineId();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Integer number = 0; Integer number = 0;
for (int i = 0; i < points.length; i++) { for (int i = 0; i < points.length; i++) {
HistoryDataResultVO historyDataResultVO; 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) { 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(); QueryResultLimitVO queryResultLimitVO = new QueryResultLimitVO();
if (!lineList.isEmpty()) { if (!lineList.isEmpty()) {
Float topLimit = 0f; Float topLimit = 0f;
@@ -282,7 +287,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("A相"); phasicType.add("A相");
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
unit.add("kV"); unit.add(pqsDeviceUnit.getPhaseVoltage());
targetName = "相电压有效值"; targetName = "相电压有效值";
break; break;
case 11: case 11:
@@ -292,7 +297,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("AB相"); phasicType.add("AB相");
phasicType.add("BC相"); phasicType.add("BC相");
phasicType.add("CA相"); phasicType.add("CA相");
unit.add("kV"); unit.add(pqsDeviceUnit.getLineVoltage());
targetName = "线电压有效值"; targetName = "线电压有效值";
break; break;
case 12: case 12:
@@ -329,9 +334,9 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("零序电压"); phasicType.add("零序电压");
phasicType.add("正序电压"); phasicType.add("正序电压");
phasicType.add("负序电压"); phasicType.add("负序电压");
unit.add("V"); unit.add(pqsDeviceUnit.getNoPositiveV());
unit.add("kV"); unit.add(pqsDeviceUnit.getPositiveV());
unit.add("V"); unit.add(pqsDeviceUnit.getNoPositiveV());
targetName = "电压不平衡"; targetName = "电压不平衡";
break; break;
case 15: case 15:
@@ -448,7 +453,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("CA相"); phasicType.add("CA相");
} }
if (number == 1) { if (number == 1) {
unit.add("kV"); unit.add(pqsDeviceUnit.getVfundEffective());
} else { } else {
unit.add("V"); unit.add("V");
} }
@@ -549,7 +554,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("BC相"); phasicType.add("BC相");
phasicType.add("CA相"); phasicType.add("CA相");
} }
unit.add("kV"); unit.add(pqsDeviceUnit.getPhaseVoltage());
break; break;
case 49: case 49:
//间谐波电流幅值 //间谐波电流幅值
@@ -569,7 +574,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
if (number == 1) { if (number == 1) {
unit.add("kW"); unit.add(pqsDeviceUnit.getFundActiveP());
} else { } else {
unit.add("W"); unit.add("W");
} }
@@ -583,7 +588,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
if (number == 1) { if (number == 1) {
unit.add("kVar"); unit.add(pqsDeviceUnit.getTotalNoP());
} else { } else {
unit.add("Var"); unit.add("Var");
} }
@@ -597,7 +602,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
if (number == 1) { if (number == 1) {
unit.add("kVA"); unit.add(pqsDeviceUnit.getTotalViewP());
} else { } else {
unit.add("VA"); unit.add("VA");
} }
@@ -610,7 +615,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("A相"); phasicType.add("A相");
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
unit.add("kW"); unit.add(pqsDeviceUnit.getTotalActiveP());
targetName = "三相有功功率"; targetName = "三相有功功率";
break; break;
case 54: case 54:
@@ -620,7 +625,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("A相"); phasicType.add("A相");
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
unit.add("kVar"); unit.add(pqsDeviceUnit.getTotalNoP());
targetName = "三相无功功率"; targetName = "三相无功功率";
break; break;
case 55: case 55:
@@ -630,7 +635,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
phasicType.add("A相"); phasicType.add("A相");
phasicType.add("B相"); phasicType.add("B相");
phasicType.add("C相"); phasicType.add("C相");
unit.add("kVA"); unit.add(pqsDeviceUnit.getTotalViewP());
targetName = "三相视在功率"; targetName = "三相视在功率";
break; break;
case 56: 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 + 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');"; " and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
phasicType.add("三相总有功功率"); phasicType.add("三相总有功功率");
unit.add("kW"); unit.add(pqsDeviceUnit.getTotalActiveP());
targetName = "三相总有功功率"; targetName = "三相总有功功率";
break; break;
case 57: 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 + 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');"; " and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
phasicType.add("三相总无功功率"); phasicType.add("三相总无功功率");
unit.add("kVar"); unit.add(pqsDeviceUnit.getTotalNoP());
targetName = "三相总无功功率"; targetName = "三相总无功功率";
break; break;
case 58: 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 + 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');"; " and phasic_type ='T' order by time asc tz('Asia/Shanghai');";
phasicType.add("三相总视在功率"); phasicType.add("三相总视在功率");
unit.add("kVA"); unit.add(pqsDeviceUnit.getTotalViewP());
targetName = "三相总视在功率"; targetName = "三相总视在功率";
break; break;
case 59: case 59:

View File

@@ -177,17 +177,17 @@ public class IntegrityServiceImpl implements IntegrityService {
if (CollectionUtils.isEmpty(lineIndexes)) { if (CollectionUtils.isEmpty(lineIndexes)) {
continue; continue;
} }
// type.add(generalDeviceDTO.getName());
outParam.setType(generalDeviceDTO.getName()); outParam.setType(generalDeviceDTO.getName());
//根据监测点查询数据完整性 //根据监测点查询数据完整性
List<PublicDTO> integrityData = getCondition(lineIndexes, integrityIconParam.getSearchBeginTime(), integrityIconParam.getSearchEndTime()); 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())) { if (StrUtil.isNotBlank(integrityIconParam.getPeriodBeginTime()) && StrUtil.isNotBlank(integrityIconParam.getPeriodEndTime())) {
List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), integrityIconParam.getPeriodEndTime()); List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), integrityIconParam.getPeriodEndTime());
// ratio.add(compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159)); double tem = compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
outParam.setRatio(NumberUtil.round(compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159),2).doubleValue()); outParam.setRatio(tem == 3.14159 ? tem : NumberUtil.round(tem, 2).doubleValue());
} }
out.add(outParam); out.add(outParam);
} }

View File

@@ -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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@@ -17,42 +17,21 @@
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>influxdb-springboot-starter</artifactId> <artifactId>influxdb-springboot-starter</artifactId>
<version>1.0.0</version> <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>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>system-api</artifactId> <artifactId>system-api</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>cs-device-api</artifactId> <artifactId>cs-device-api</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -115,15 +115,6 @@
<artifactId>common-oss</artifactId> <artifactId>common-oss</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
</dependency>
<dependency> <dependency>
<groupId>com.njcn</groupId> <groupId>com.njcn</groupId>
<artifactId>prepare-api</artifactId> <artifactId>prepare-api</artifactId>

View File

@@ -25,129 +25,89 @@ public class SupvProblemVO {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Excel(name = "",width = 15)
private String problemId;
@Excel(name = "",width = 15) @Excel(name = "计划名称",width = 40)
private String workPlanName; private String workPlanName;
@Excel(name = "",width = 15) @Excel(name = "责任单位编号",width = 15)
private String provinceId;
@Excel(name = "",width = 15)
private String planId;
@Excel(name = "",width = 15)
private String dutyOrgId; private String dutyOrgId;
@Excel(name = "",width = 15) @Excel(name = "责任单位名称",width = 15)
private String dutyOrgName; private String dutyOrgName;
@Excel(name = "",width = 15) @Excel(name = "监测点类型",width = 15)
private String monitorType; private String monitorType;
@Excel(name = "是否发布预告警",width = 15,replace= {"否_0", "是_1"})
@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)
private Integer ifReleaseWarning; private Integer ifReleaseWarning;
/** @Excel(name = "计划整改时间",width = 15)
* 问题简要描述 private String planRectificationTime;
*/
@Excel(name = "",width = 15)
private String simpleProblemDesc;
/** @Excel(name = "整改情况",width = 15,replace = {"已整改_01","未整改_02"})
* 监督标准序号 private String rectificationStatus;
*/
@Excel(name = "",width = 15) @Excel(name = "整改时间",width = 15)
private String rectificationTime;
@Excel(name = "监督标准",width = 15)
private String supvStandard;
@Excel(name = "监督标准序号",width = 15)
private String supvStandardSort; private String supvStandardSort;
/** @Excel(name = "标准出处",width = 15)
* 问题描述 private String supvResouce;
*/
@Excel(name = "",width = 15) @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 problemDesc;
/** /**
* 监督标准 * 问题发现时间
*/ */
private String supvStandard; @Excel(name = "问题发现时间",width = 15)
private String discoveryTime;
/**
* 标准出处
*/
private String supvResouce;
/**
* 问题等级 01 一般02 较大
*/
private String problemLevel;
/** /**
* 定级依据 * 定级依据
*/ */
@Excel(name = "定级依据",width = 15)
private String problemLevelReason; private String problemLevelReason;
/**
* 问题类型
*/
private String problemType;
/** /**
* 整改方案 * 整改方案
*/ */
@Excel(name = "整改方案",width = 50)
private String rectificationProgramme; private String rectificationProgramme;
/**
* 整改情况01已整改02未整改
*/
private String rectificationStatus;
/** /**
* 整改措施 * 整改措施
*/ */
@Excel(name = "整改措施",width = 40)
private String rectificationMeasure; private String rectificationMeasure;
/**
* 0.以上送 1.未上送 2.取消上送
*/
private Integer isUploadHead;
/** /**
* 备注 * 备注
*/ */
@Excel(name = "备注",width = 40)
private String remark; 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;
} }

View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.db.bo.BaseEntity;
import lombok.Getter; import lombok.Getter;
import java.time.LocalDate; import java.time.LocalDate;
@@ -17,7 +18,7 @@ import java.time.LocalDateTime;
* @date 2023/9/6 9:33 * @date 2023/9/6 9:33
*/ */
@Getter @Getter
public class PlanVO { public class PlanVO extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId @TableId

View File

@@ -113,6 +113,18 @@
<artifactId>http-client</artifactId> <artifactId>http-client</artifactId>
<version>1.1.5.11</version> <version>1.1.5.11</version>
</dependency> </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> </dependencies>
<build> <build>

View File

@@ -8,7 +8,7 @@
<select id="listDerive" resultType="com.njcn.process.pojo.vo.SupvProblemVO"> <select id="listDerive" resultType="com.njcn.process.pojo.vo.SupvProblemVO">
select select
work_plan_name, work_plan_name,
sp.* spm.*
from from
supv_problem spm supv_problem spm
INNER JOIN supv_plan sp on sp.plan_Id=spm.plan_id INNER JOIN supv_plan sp on sp.plan_Id=spm.plan_id

View File

@@ -60,7 +60,7 @@ public class SupvAlarmBackServiceImpl extends ServiceImpl<SupvAlarmBackMapper, S
@Override @Override
public boolean delAlarmBack(List<String> ids) { public boolean delAlarmBack(List<String> ids) {
LambdaQueryWrapper<SupvAlarmBack> lambdaQueryWrapper = new LambdaQueryWrapper<>(); 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); int count = this.count(lambdaQueryWrapper);
if (count > 0) { if (count > 0) {
throw new BusinessException("请选择未上送国网的删除"); throw new BusinessException("请选择未上送国网的删除");

View File

@@ -59,7 +59,7 @@ public class SupvAlarmServiceImpl extends ServiceImpl<SupvAlarmMapper, SupvAlarm
@Override @Override
public boolean delAlarm(List<String> planIds) { public boolean delAlarm(List<String> planIds) {
LambdaQueryWrapper<SupvAlarm> lambdaQueryWrapper = new LambdaQueryWrapper<>(); 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); int count = this.count(lambdaQueryWrapper);
if (count > 0) { if (count > 0) {
throw new BusinessException("请选择未上送国网的删除"); throw new BusinessException("请选择未上送国网的删除");

View File

@@ -59,7 +59,7 @@ public class SupvPlanHisServiceImpl extends ServiceImpl<SupvPlanHisMapper, SupvP
@Override @Override
public boolean delPlanHis(List<String> planIds) { public boolean delPlanHis(List<String> planIds) {
LambdaQueryWrapper<SupvPlanHis> lambdaQueryWrapper = new LambdaQueryWrapper<>(); 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); int count = this.count(lambdaQueryWrapper);
if (count > 0) { if (count > 0) {
throw new BusinessException("请选择未上送国网的删除"); throw new BusinessException("请选择未上送国网的删除");

View File

@@ -211,7 +211,7 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean delPlan(List<String> planIds) { public boolean delPlan(List<String> planIds) {
LambdaQueryWrapper<SupvPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>(); 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); int count = this.count(lambdaQueryWrapper);
if (count > 0) { if (count > 0) {
throw new BusinessException("请选择未上送国网的删除"); throw new BusinessException("请选择未上送国网的删除");

View File

@@ -20,7 +20,10 @@ import com.njcn.process.pojo.po.SupvProblem;
import com.njcn.process.pojo.vo.SupvProblemVO; import com.njcn.process.pojo.vo.SupvProblemVO;
import com.njcn.process.service.ISupvProblemService; import com.njcn.process.service.ISupvProblemService;
import com.njcn.system.api.DicDataFeignClient; 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.api.DeptFeignClient;
import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.web.factory.PageFactory; import com.njcn.web.factory.PageFactory;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -87,7 +90,7 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean delProblem(List<String> problemIds) { public boolean delProblem(List<String> problemIds) {
LambdaQueryWrapper<SupvProblem> lambdaQueryWrapper = new LambdaQueryWrapper<>(); 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); int count = this.count(lambdaQueryWrapper);
if (count > 0) { if (count > 0) {
throw new BusinessException("请选择未上送国网的删除"); throw new BusinessException("请选择未上送国网的删除");
@@ -136,8 +139,26 @@ public class SupvProblemServiceImpl extends ServiceImpl<SupvProblemMapper, SupvP
@Override @Override
public void problemList(SupvProblemParam supvProblemParam) { public void problemList(SupvProblemParam supvProblemParam) {
List<SupvProblemVO> supvProblemVOS = this.baseMapper.listDerive(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);
} }

View File

@@ -24,6 +24,7 @@ public enum SystemResponseEnum {
INTERFERENCE_EMPTY("A00356","查询字典干扰源类型数据为空"), INTERFERENCE_EMPTY("A00356","查询字典干扰源类型数据为空"),
BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"), BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"),
SYSTEM_TYPE_EMPTY("A00356","查询字典系统类型数据为空"),
DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"), DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"),
MANUFACTURER("A00358","查询字典终端厂家数据为空"), MANUFACTURER("A00358","查询字典终端厂家数据为空"),
DEV_VARIETY("A00359","查询字典终端类型数据为空"), DEV_VARIETY("A00359","查询字典终端类型数据为空"),

View File

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.SystemResponseEnum;
import com.njcn.system.pojo.po.DictData; import com.njcn.system.pojo.po.DictData;
import com.njcn.user.enums.UserResponseEnum; import com.njcn.user.enums.UserResponseEnum;
import com.njcn.user.mapper.ComponentMapper; 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<String,List<ComponentVO>> map = list.stream().filter(m->!Objects.isNull(m.getSystemType())).collect(Collectors.groupingBy(ComponentVO::getSystemType));
map.forEach((k,v)->{ map.forEach((k,v)->{
DictData dictData = dicDataFeignClient.getDicDataById(k).getData(); DictData dictData = dicDataFeignClient.getDicDataById(k).getData();
if (Objects.isNull(dictData)){
throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY);
}
ComponentVO componentVO = new ComponentVO(); ComponentVO componentVO = new ComponentVO();
componentVO.setId(dictData.getId()); componentVO.setId(dictData.getId());
componentVO.setName(dictData.getName()); 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<String,List<ComponentVO>> map = componentVOList.stream().collect(Collectors.groupingBy(ComponentVO::getSystemType));
map.forEach((k, v)->{ map.forEach((k, v)->{
DictData dictData = dicDataFeignClient.getDicDataById(k).getData(); DictData dictData = dicDataFeignClient.getDicDataById(k).getData();
if (Objects.isNull(dictData)){
throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY);
}
ComponentVO componentVO = new ComponentVO(); ComponentVO componentVO = new ComponentVO();
componentVO.setName(dictData.getName()); componentVO.setName(dictData.getName());
componentVO.setChildren( componentVO.setChildren(