Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b49ba0e06f | |||
|
|
84321ff192 | ||
| 89e38abc00 | |||
| 8229653fb0 | |||
| 5d80582e23 | |||
|
|
7bc9cb9792 | ||
| cd4016eb1c | |||
| d7e63ec2d5 | |||
| 35d05dd3ac | |||
|
|
fad0e10203 | ||
|
|
4e8a26b1fb | ||
|
|
7a877045c9 | ||
| 23ee3b1af2 | |||
|
|
a601af9479 | ||
|
|
d3f412e2cb | ||
| b659dd055f | |||
| 66530aa5aa | |||
| 541d2ab3fe | |||
| cac6b4bdbb | |||
| a225b039fe | |||
| 0fcd67bd38 | |||
|
|
8445a08a64 | ||
|
|
3c820b1645 | ||
| 3132b0a134 | |||
| 618f1314f6 | |||
| 474a368670 | |||
|
|
a6326f574d | ||
| 7c19a21d92 | |||
|
|
dfa95fd701 | ||
|
|
09190b164b | ||
|
|
146e0e4408 | ||
| 448f76d646 | |||
| 0eeedf8f35 | |||
|
|
054fa20bab | ||
| c80e2cd825 | |||
| b3f553c450 | |||
| ef35d9bdbe | |||
| b36f4400bf | |||
| ea5bb460b4 | |||
| c84e79b789 | |||
| b62eacdbd6 | |||
| 84f16b822e | |||
| 29c1f2a530 | |||
|
|
59522c66d9 | ||
| bd153dc7b9 | |||
| 5676c736a5 | |||
|
|
e38a653e3c | ||
| 1e5dbbba19 | |||
|
|
db40090b00 | ||
| 99b56bffac | |||
|
|
04ae4f1fc1 | ||
|
|
08c5e44755 | ||
|
|
f291c85e27 | ||
|
|
38b0f20ea9 | ||
| 275a07f790 | |||
| 3bb5f91c1a | |||
| ab0b6e96c6 | |||
| da814e4bdc | |||
| 33a0ddc6f9 | |||
| ae5ca42391 |
@@ -37,7 +37,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.authorizeRequests()
|
||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/oauth/autoLogin").permitAll()
|
||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/judgeToken/heBei","/oauth/autoLogin").permitAll()
|
||||
// @link https://gitee.com/xiaoym/knife4j/issues/I1Q5X6 (接口文档knife4j需要放行的规则)
|
||||
.antMatchers("/webjars/**","/doc.html","/swagger-resources/**","/v2/api-docs").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
|
||||
@@ -76,4 +76,44 @@ public class JudgeThirdToken extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/heBei")
|
||||
@ApiOperation("校验河北token有效性")
|
||||
@ApiImplicitParam(name = "token", required = true)
|
||||
public HttpResult<Object> heBei(String token) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String methodDescribe = getMethodDescribe("heBei");
|
||||
LogUtil.njcnDebug(log, "{},token:{}", methodDescribe, token);
|
||||
|
||||
/* // 请求地址
|
||||
String url = "http://dwzyywzt-test.com/baseCenter/oauth2/user/token";
|
||||
|
||||
// 请求头设置,x-www-form-urlencoded格式的数据
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
//提交参数设置
|
||||
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
||||
map.add("token", token);
|
||||
|
||||
// 组装请求体
|
||||
HttpEntity<MultiValueMap<String, String>> request =
|
||||
new HttpEntity<>(map, headers);
|
||||
|
||||
// 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
|
||||
String result = restTemplate.postForObject(url, request, String.class);
|
||||
JSONObject resultJson = new JSONObject(result);
|
||||
if (Objects.equals(resultJson.getInt("status"), DataStateEnum.ENABLE.getCode())) {
|
||||
//成功
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}*/
|
||||
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "HE_DNZLJCYW", methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -27,4 +27,6 @@ public class SimpleDTO implements Serializable {
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer algoDescribe;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,4 +15,6 @@ public class SimpleTreeDTO extends SimpleDTO implements Serializable {
|
||||
|
||||
private List<SimpleDTO> children;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.common.pojo.enums.common;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 11:37
|
||||
*/
|
||||
@Getter
|
||||
public enum DealStateEnum {
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
RESOLVED(1, "已解决"),
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
UNSOLVED(0, "未解决");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String message;
|
||||
|
||||
DealStateEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.common.pojo.exception;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -83,5 +84,6 @@ public class BusinessException extends RuntimeException {
|
||||
public BusinessException(String message) {
|
||||
super(message);
|
||||
this.message = message;
|
||||
this.code = CommonResponseEnum.FAIL.getCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class LogUtil {
|
||||
public static void logExceptionStackInfo(String exceptionName, Exception exception) {
|
||||
//若开启了debug模式,则输出所有的栈堆信息
|
||||
njcnPatchDebug(log, ExceptionUtil.getAllExceptionStackInfo(exception));
|
||||
log.error("{}{},目标文件:{}",exceptionName, exception.toString(), ExceptionUtil.getExceptionServerStackInfo(exception));
|
||||
log.error("{}{},目标文件:{}",exceptionName, exception, ExceptionUtil.getExceptionServerStackInfo(exception));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.oss.utils;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.huawei.obs.util.OBSUtil;
|
||||
@@ -7,6 +8,7 @@ import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||
import com.njcn.minioss.config.MinIossProperties;
|
||||
import com.njcn.minioss.util.MinIoUtils;
|
||||
import com.njcn.oss.constant.GeneralConstant;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.enums.OssResponseEnum;
|
||||
import io.minio.*;
|
||||
import io.minio.errors.*;
|
||||
@@ -21,9 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -92,7 +92,7 @@ public class FileStorageUtil {
|
||||
* @param dir 服务器文件存放路径
|
||||
* @param flag 是否保留原始文件名
|
||||
*/
|
||||
public String uploadMultipart(MultipartFile multipartFile, String dir,boolean flag) {
|
||||
public String uploadMultipart(MultipartFile multipartFile, String dir, boolean flag) {
|
||||
String filePath;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||
@@ -100,7 +100,7 @@ public class FileStorageUtil {
|
||||
} else {
|
||||
try {
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir,flag);
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir, flag);
|
||||
filePath = minIoUploadResDTO.getMinFileName();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||
@@ -136,6 +136,7 @@ public class FileStorageUtil {
|
||||
|
||||
/**
|
||||
* 上传InputStream流,并指定文件的名称
|
||||
*
|
||||
* @author xuyang
|
||||
*/
|
||||
public String uploadStreamSpecifyName(InputStream inputStream, String dir, String fileName) {
|
||||
@@ -211,7 +212,7 @@ public class FileStorageUtil {
|
||||
} catch (Exception exception) {
|
||||
throw new BusinessException(OssResponseEnum.DOWNLOAD_FILE_STREAM_ERROR);
|
||||
}
|
||||
String fileType = filePath.substring(filePath.lastIndexOf('.')+1).toLowerCase();
|
||||
String fileType = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
|
||||
switch (fileType) {
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
@@ -219,13 +220,14 @@ public class FileStorageUtil {
|
||||
case "gif":
|
||||
response.setContentType(MediaType.IMAGE_PNG_VALUE);
|
||||
break;
|
||||
case "svg":
|
||||
response.setContentType("image/svg+xml");
|
||||
break;
|
||||
case "pdf":
|
||||
response.setContentType("application/pdf");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + filePath);
|
||||
break;
|
||||
default:
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + filePath);
|
||||
break;
|
||||
}
|
||||
try {
|
||||
@@ -263,18 +265,19 @@ public class FileStorageUtil {
|
||||
}
|
||||
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());
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: getAllFile 获取minio指定文件夹下所有文件
|
||||
* @Param:
|
||||
* @return: java.lang.Iterable<io.minio.Result<io.minio.messages.Item>>
|
||||
* @Author: clam
|
||||
* @Date: 2024/9/27
|
||||
*/
|
||||
public List<MultipartFile> getAllFile(String bucketName, String directory) throws Exception{
|
||||
* @Description: getAllFile 获取minio指定文件夹下所有文件
|
||||
* @Param:
|
||||
* @return: java.lang.Iterable<io.minio.Result < io.minio.messages.Item>>
|
||||
* @Author: clam
|
||||
* @Date: 2024/9/27
|
||||
*/
|
||||
public List<MultipartFile> getAllFile(String bucketName, String directory) throws Exception {
|
||||
List<MultipartFile> files = new ArrayList<>();
|
||||
Iterable<Result<Item>> results = this.instance.listObjects(
|
||||
ListObjectsArgs.builder().bucket(bucketName).prefix(directory).recursive(true).build());
|
||||
@@ -283,9 +286,8 @@ public class FileStorageUtil {
|
||||
Item item = null;
|
||||
|
||||
item = result.get();
|
||||
InputStream stream = this.instance.getObject(
|
||||
GetObjectArgs.builder().bucket(bucketName).object(item.objectName()).build());
|
||||
|
||||
InputStream stream = this.instance.getObject(
|
||||
GetObjectArgs.builder().bucket(bucketName).object(item.objectName()).build());
|
||||
|
||||
|
||||
// 假设你有一个方法可以将InputStream转换为MultipartFile
|
||||
@@ -296,4 +298,38 @@ public class FileStorageUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 目前只给审计日志使用
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/10/15
|
||||
*/
|
||||
public File getLastFile(String bucketName, String directory) throws Exception {
|
||||
File file = null;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
Iterable<Result<Item>> results = this.instance.listObjects(
|
||||
ListObjectsArgs.builder().bucket(bucketName).prefix(directory).recursive(true).build());
|
||||
Item lastItem = null;
|
||||
for (Result<Item> result : results) {
|
||||
Item item = result.get();
|
||||
if (lastItem == null) {
|
||||
lastItem = item;
|
||||
} else {
|
||||
if (item.lastModified().isAfter(lastItem.lastModified())) {
|
||||
lastItem = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
InputStream stream = this.instance.getObject(
|
||||
GetObjectArgs.builder().bucket(bucketName).object(lastItem.objectName()).build());
|
||||
|
||||
file = File.createTempFile(lastItem.objectName(), "xlsx");
|
||||
FileUtil.writeFromStream(stream, file);
|
||||
}else if(generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS){
|
||||
file = obsUtil.getLastFile(OssPath.LOGBAK);
|
||||
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,19 @@ public interface AppRedisKey {
|
||||
String DOWNLOAD = "downloadKey:";
|
||||
|
||||
String CONTROL = "control:";
|
||||
|
||||
/**
|
||||
* 设备池
|
||||
*/
|
||||
String DEVICE_LIST = "deviceListKey";
|
||||
|
||||
/**
|
||||
* 字典树
|
||||
*/
|
||||
String DICT_TREE = "dictTreeKey";
|
||||
|
||||
/**
|
||||
* 模板
|
||||
*/
|
||||
String DEV_MODEL = "devModelKey:";
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.redis.utils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
@@ -79,6 +80,17 @@ public class RedisUtil {
|
||||
redisTemplate.delete(Arrays.asList(keys));
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定字符模糊匹配,批量删除keys
|
||||
*/
|
||||
public void deleteKeysByString(String str) {
|
||||
Set<String> keys = redisTemplate.keys(str.concat("*"));
|
||||
// 删除所有匹配的key
|
||||
if (keys != null && !keys.isEmpty()) {
|
||||
redisTemplate.delete(keys);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取key对应的字符数据
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.njcn.web.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||
import com.njcn.web.filter.XssFilter;
|
||||
import com.njcn.web.filter.XssRequestWrapper;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.njcn.web.enums;
|
||||
|
||||
|
||||
import com.njcn.web.utils.GwSendUtil;
|
||||
|
||||
import static com.njcn.web.utils.GwSendUtil.NEWGWURL;
|
||||
|
||||
/**
|
||||
* @Description: 上送枚举
|
||||
* @Author: wr
|
||||
@@ -39,14 +43,18 @@ public enum GWSendEnum {
|
||||
|
||||
|
||||
//调用总部下发工单的反馈单接口
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
|
||||
PARK_AND_STATION("parkAndStation", "/pms-ghq-powerquality-start/powerQuality/park/create"),
|
||||
PARK_AND_STATION("parkAndStation", "/powerQuality/park/create"),
|
||||
|
||||
REPORT_CREATE("reportCreate", "/pms-ghq-powerquality-start/powerQuality/report/create"),
|
||||
|
||||
COMM_POINT("commPoint","/pms-ghq-powerquality-start/powerQuality/publicConnection/pqBusMonitorDataStatisticalCreate")
|
||||
REPORT_CREATE("reportCreate", "/powerQuality/report/create"),
|
||||
|
||||
COMM_POINT("commPoint","/powerQuality/publicConnection/pqBusMonitorDataStatisticalCreate"),
|
||||
MAIN_MONITOR("mainMonitor","/powerQuality/runStatistics/monitorStatisticsCreate"),
|
||||
TEMP_USER_CREATE("tempUserCreate","/powerQuality/process/tempUserCreate"),
|
||||
TEMP_PROCESS_TRACK_CREATE("tempProcessTrackCreate","/powerQuality/process/processFollowCreate"),
|
||||
MONTH_REPORT_CREATE("monthReportCreate","/powerQuality/process/monthReportCreate"),
|
||||
PROCESS_APPROVAL_CREATE("processApprovalCreate","powerQuality/process/processApprovalCreate")
|
||||
;
|
||||
|
||||
|
||||
@@ -66,4 +74,8 @@ public enum GWSendEnum {
|
||||
public String getUrl() {
|
||||
return "http://dwzyywzt-pms3-proxy.com/CSB" + url;
|
||||
}
|
||||
|
||||
public String getNewUrl(){
|
||||
return GwSendUtil.NEWGWURL + url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Stream;
|
||||
@Slf4j
|
||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields"};
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields","definition"};
|
||||
|
||||
|
||||
public XssRequestWrapper(HttpServletRequest request) {
|
||||
|
||||
@@ -95,7 +95,7 @@ public class LogServiceImpl implements ILogService {
|
||||
}
|
||||
//如果存在设备日志注解,则记录设备日志
|
||||
if(Objects.nonNull((returnType.getMethod()))&& (returnType.getMethod()).isAnnotationPresent(DeviceLog.class)){
|
||||
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
|
||||
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
|
||||
DeviceLogDTO deviceLogDTO = new DeviceLogDTO(userName,deviceOperate,result.equalsIgnoreCase("失败") ? 0 : 1,"",loginName,userIndex);
|
||||
publisher.send("/deviceLog", PubUtils.obj2json(deviceLogDTO), 2, false);
|
||||
|
||||
|
||||
@@ -26,8 +26,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@Slf4j
|
||||
public class GwSendUtil {
|
||||
|
||||
private static final String GWURL = "dwzyywzt-pms3-proxy.com";
|
||||
private static final String CODE = "13B9B47F1E483324E05338297A0A0595";
|
||||
public static final String GWURL = "dwzyywzt-pms3-proxy.com";
|
||||
public static final String CODE = "13B9B47F1E483324E05338297A0A0595";
|
||||
|
||||
//最新的上送接口路径
|
||||
public static final String NEWGWURL = "http://pms.pms30.com.cn/pms-tech-seval";
|
||||
public static final String secretKey = "xQcEF+9hnekk2ZAD1+K1y3PS1d7e3wf0dmPXeeMKf/19qRhyP+4c0FTr70bGINpR";
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -59,6 +63,7 @@ public class GwSendUtil {
|
||||
|
||||
builder.contentBody(cb);
|
||||
String token = LoginToken();
|
||||
System.out.println("获取token------->"+token);
|
||||
builder.putHeaderParamsMap("x-token", token);
|
||||
builder.putHeaderParamsMap("serviceName", sendEnum.getServiceName());
|
||||
//进行调用,返回结果
|
||||
@@ -112,6 +117,57 @@ public class GwSendUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新的上送方式
|
||||
* @param param
|
||||
* @param sendEnum
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> newSend(SendParam param, GWSendEnum sendEnum) {
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
try {
|
||||
ContentBody cb;
|
||||
if (ObjectUtil.isNull(param)) {
|
||||
cb = new ContentBody("");
|
||||
} else {
|
||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||
log.info(Thread.currentThread().getName() + "1.信息:" + s);
|
||||
cb = new ContentBody(s);
|
||||
}
|
||||
//ContentBody传递,要求使用post方式进行调用
|
||||
//如果需要传递请求参数 可以拼接到请求URL中,或者设置paramsMap参数由SDK内部进行拼接
|
||||
HttpParameters.Builder builder = HttpParameters.newBuilder();
|
||||
|
||||
builder.requestURL(sendEnum.getNewUrl()) // 设置请求的URL,可以拼接URL请求参数
|
||||
.method("post") // 设置调用方式, 必须为 post
|
||||
.contentType("application/json; charset=UTF-8"); //设置请求content-type
|
||||
|
||||
builder.contentBody(cb);
|
||||
|
||||
//进行调用,返回结果
|
||||
try {
|
||||
HttpReturn ret = HttpCaller.invokeReturn(builder.build());
|
||||
String responseStr = ret.getResponseStr();//获取响应的文本串
|
||||
if (responseStr.indexOf("\\\"") != -1) {
|
||||
responseStr = responseStr.replace("\\\"", "\"");
|
||||
}
|
||||
Map mapData = JSON.parseObject(responseStr, Map.class);
|
||||
if(mapData.containsKey("error_msg")){
|
||||
throw new BusinessException("国网上送接口超时,请重新上送");
|
||||
}
|
||||
map.put("succeed", responseStr);
|
||||
} catch (HttpCallerException e) {
|
||||
// error process
|
||||
log.info(Thread.currentThread().getName() + "错误信息:" + e);
|
||||
map.put("error", e.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
map.put("error", "当前时间段国网上送请求过多,请稍后再试");
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于单次调用的返回
|
||||
* @author cdf
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -109,7 +110,9 @@ public class LineDevGetDTO {
|
||||
|
||||
|
||||
public void setTimeInterval(Integer timeInterval) {
|
||||
this.interval = timeInterval;
|
||||
this.timeInterval = timeInterval;
|
||||
if(Objects.nonNull(timeInterval)) {
|
||||
this.interval = timeInterval;
|
||||
this.timeInterval = timeInterval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.device.biz.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -14,6 +15,7 @@ public class DeviceBak {
|
||||
/**
|
||||
* 终端Id
|
||||
*/
|
||||
@TableId("Id")
|
||||
private String id;
|
||||
|
||||
|
||||
|
||||
@@ -61,3 +61,8 @@ isJb: false
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
|
||||
oracle:
|
||||
isSync: false
|
||||
syncLedgerLineUrl: http://localhost:8082/export/syncLedgerLine
|
||||
syncLedgerUpdateLine: http://localhost:8082/export/syncLedgerUpdateLine
|
||||
syncLedgerDeleteLine: http://localhost:8082/export/syncLedgerDeleteLine
|
||||
|
||||
@@ -68,6 +68,15 @@ public interface MonitorClient {
|
||||
@PostMapping("getMonitorList")
|
||||
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
||||
|
||||
|
||||
/**
|
||||
* 通过同源监测点编码获取监测点信息
|
||||
* @author cdf
|
||||
* @date 2022/11/29
|
||||
*/
|
||||
@PostMapping("getMonitorListByMid")
|
||||
HttpResult<List<Monitor>> getMonitorListByMid(@RequestBody List<String> midIds);
|
||||
|
||||
@PostMapping("getMonitorPage")
|
||||
HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam);
|
||||
|
||||
|
||||
@@ -32,4 +32,8 @@ public interface PmsTerminalClient {
|
||||
*/
|
||||
@PostMapping("/getTerminalSelectList")
|
||||
HttpResult<List<PmsTerminal>> getTerminalSelectList(@RequestBody PmsBaseParam pmsBaseParam);
|
||||
|
||||
@PostMapping("/getTerminalSelectByIds")
|
||||
HttpResult<List<PmsTerminal>> getTerminalSelectByIds(@RequestBody List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Monitor>> getMonitorListByMid(List<String> midIds) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "使用同源监测点编码获取监测点信息 ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Page<Monitor>> getMonitorPage(TerminalQueryParam baseParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "分页获取主网监测点数据 ", throwable.toString());
|
||||
|
||||
@@ -36,6 +36,12 @@ public class PmsTerminalClientFallbackFactory implements FallbackFactory<PmsTerm
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取主网所有终端", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectByIds(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "使用装置id集合查询装置信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,6 @@ public class PwUserMonitorParam extends BaseParam {
|
||||
|
||||
private List<String> ids;
|
||||
|
||||
private String monitorState;
|
||||
|
||||
}
|
||||
|
||||
@@ -131,15 +131,27 @@ public class PmsMonitorController extends BaseController {
|
||||
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
|
||||
@ApiImplicitParam(name = "monitorIds",value = "主网监测点编号",required = true)
|
||||
public HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds) {
|
||||
String methodDescribe = getMethodDescribe("getAllMonitorList");
|
||||
String methodDescribe = getMethodDescribe("getMonitorList");
|
||||
List<Monitor> monitor= monitorService.getMonitorList(monitorIds);
|
||||
if (Objects.isNull(monitor)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用同源监测点编码获取监测点信息
|
||||
* @author cdf
|
||||
* @date 2022/11/29
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorListByMid")
|
||||
@ApiOperation("使用同源监测点编码获取监测点信息")
|
||||
@ApiImplicitParam(name = "midIds",value = "主网监测点编号",required = true)
|
||||
public HttpResult<List<Monitor>> getMonitorListByMid(@RequestBody List<String> midIds) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorListByMid");
|
||||
List<Monitor> monitor= monitorService.getMonitorListByMid(midIds);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorPage")
|
||||
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
|
||||
|
||||
@@ -83,6 +83,16 @@ public class PmsTerminalController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getTerminalSelectByIds")
|
||||
@ApiOperation("根据ID集合查询监测终端台账数据")
|
||||
@ApiImplicitParam(name = "ID集合",value = "ids",required = true)
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectByIds(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("getTerminalSelectByIds");
|
||||
List<PmsTerminal> pmsTerminal = iTerminalService.getTerminalSelectByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pmsTerminal, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增监测终端台账信息
|
||||
* @author hany
|
||||
|
||||
@@ -519,7 +519,8 @@
|
||||
pms_distribution_monitor
|
||||
inner join pms_power_client on pms_distribution_monitor.Monitor_Id = pms_power_client.id
|
||||
left join pms_real_data on pms_power_client.id = pms_real_data.line_id and pms_real_data.value_type = "AVG"
|
||||
WHERE pms_power_client.org_id in
|
||||
WHERE pms_distribution_monitor.Monitor_State = #{param.monitorState}
|
||||
and pms_power_client.org_id in
|
||||
<foreach collection="deptIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
@@ -88,6 +88,8 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
|
||||
List<Monitor> getMonitorList(List<String> monitorIds);
|
||||
|
||||
List<Monitor> getMonitorListByMid(List<String> midIds);
|
||||
|
||||
|
||||
List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds);
|
||||
|
||||
|
||||
@@ -478,6 +478,8 @@ public class DistributionMonitorServiceImpl extends MppServiceImpl<DistributionM
|
||||
@Override
|
||||
public List<PwUserMonitorDataVO> getPwUserIds(PwUserMonitorParam pwUserMonitorParam) {
|
||||
List<String> deptIds = deptFeignClient.getDepSonSelfCodetByDeptId(pwUserMonitorParam.getOrgId()).getData();
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.RUN.getCode(), DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||
pwUserMonitorParam.setMonitorState(dictData.getId());
|
||||
return this.distributionMonitorMapper.getDistributionList(deptIds,pwUserMonitorParam);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,6 +302,16 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return monitorList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Monitor> getMonitorListByMid(List<String> midIds) {
|
||||
List<Monitor> monitorList;
|
||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode()).in(Monitor::getMonitorId,midIds);
|
||||
monitorList = this.list(lambdaQueryWrapper);
|
||||
return monitorList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LineDevGetDTO> getPmsCalMonitorList(List<String> monitorIds) {
|
||||
List<LineDevGetDTO> monitorList = new ArrayList<>();
|
||||
@@ -314,7 +324,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setDevId(monitor.getTerminalId());
|
||||
lineDevGetDTO.setPointId(monitor.getId());
|
||||
|
||||
lineDevGetDTO.setInterval(monitor.getStatisticalInterval());
|
||||
System.out.println("获取主网测点统计间隔"+lineDevGetDTO.getInterval());
|
||||
monitorList.add(lineDevGetDTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.PqsTerminalLogsClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,8 +21,18 @@ import java.util.List;
|
||||
public interface NodeClient {
|
||||
|
||||
|
||||
@ApiOperation("获取全部前置机")
|
||||
/**
|
||||
* 获取全部前置机
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/nodeAllList")
|
||||
HttpResult<List<Node>> nodeAllList();
|
||||
|
||||
/**
|
||||
* 根据id获取前置机
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getNodeById")
|
||||
HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@ public class NodeClientFallbackFactory implements FallbackFactory<NodeClient> {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取全部前置机", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Node> getNodeById(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据id获取前置机", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ public enum PvDeviceResponseEnum {
|
||||
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
|
||||
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
||||
NEWSTATION_REPEAT("A0371","新能源场站名称已存在"),
|
||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
||||
GD_OR_NOT("A00550","供电公司名称为空,请检查信息是否存在!"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.njcn.device.pq.pojo.dto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
@@ -24,6 +26,12 @@ public class PollutionSubstationDTO {
|
||||
@ApiModelProperty("电压等级")
|
||||
private String voltageLevel;
|
||||
|
||||
@ApiModelProperty(name ="lng",value = "变电站经度")
|
||||
private BigDecimal lng;
|
||||
|
||||
@ApiModelProperty(name ="lat",value = "变电站纬度")
|
||||
private BigDecimal lat;
|
||||
|
||||
@ApiModelProperty("数据")
|
||||
private Double data = 3.14159;
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ public class LineParam {
|
||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "监测点名称违规")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "name",value = "原监测点名称",required = true)
|
||||
private String oldName;
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,9 @@ public class SubVoltageParam {
|
||||
@Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(name = "name",value = "原母线名称",required = true)
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 母线号(在同一台设备中的电压通道号)
|
||||
*/
|
||||
|
||||
@@ -56,4 +56,9 @@ public class SyncTerminalParam {
|
||||
@ApiModelProperty(name = "lineParam",value = "监测点信息")
|
||||
private LineParam lineParam;
|
||||
|
||||
@ApiModelProperty(name = "oracleLineId",value = "oracle监测点id")
|
||||
private Integer oracleLineId;
|
||||
|
||||
@ApiModelProperty(name = "oracleDevId",value = "oracle终端id")
|
||||
private Integer oracleDevId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVICE
|
||||
*/
|
||||
@Data
|
||||
public class PqDevice implements Serializable {
|
||||
|
||||
|
||||
private Integer devIndex;
|
||||
/**
|
||||
* 装置名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 装置通讯状态(0:中断;1:正常)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* (关联表PQS_Dicdata)装置型号Guid
|
||||
*/
|
||||
private String devtype;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private String logontime;
|
||||
|
||||
/**
|
||||
* 数据更新时间
|
||||
*/
|
||||
private String updatetime;
|
||||
|
||||
|
||||
/**
|
||||
* (关联表NodeInformation)服务器表序号,表明这台设备运行在哪台服务器上
|
||||
*/
|
||||
private String nodeName;
|
||||
|
||||
|
||||
/**
|
||||
* 端口ID,用于端口映射
|
||||
*/
|
||||
private Integer portid;
|
||||
|
||||
/**
|
||||
* 装置状态(0:投运;1:热备用;2:停运)
|
||||
*/
|
||||
private Integer devflag;
|
||||
|
||||
/**
|
||||
* 装置识别码,采用3ds加密
|
||||
*/
|
||||
private String devSeries;
|
||||
|
||||
/**
|
||||
* 装置秘钥,采用3ds加密
|
||||
*/
|
||||
private String devKey;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 装置模型(0:虚拟设备;1:实际设备;2:离线设备;)默认是实际设备
|
||||
*/
|
||||
private Integer devmodel;
|
||||
|
||||
/**
|
||||
* 已召唤标志
|
||||
*/
|
||||
private Integer callflag;
|
||||
|
||||
/**
|
||||
* 数据类型(0:暂态系统;1:稳态系统;2:两个系统)
|
||||
*/
|
||||
private Integer datatype;
|
||||
|
||||
|
||||
/**
|
||||
* 母线信息表
|
||||
*/
|
||||
private List<PqSubvoltage> pqSubvoltage;
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVICEDETAIL
|
||||
*/
|
||||
@Data
|
||||
public class PqDevicedetail implements Serializable {
|
||||
|
||||
private Integer devIndex;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata)设备制造商Guid
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 定检状态(0:已检 1:未检)
|
||||
*/
|
||||
private Integer checkflag;
|
||||
|
||||
/**
|
||||
* 本次定检时间
|
||||
*/
|
||||
private String thistimecheck;
|
||||
|
||||
/**
|
||||
* 下次定检时间(假如跟当前时间比少于3个月则定检状态界面显示为待检)
|
||||
*/
|
||||
private String nexttimecheck;
|
||||
|
||||
/**
|
||||
* 统计在线率总数
|
||||
*/
|
||||
private Integer onlineratetj;
|
||||
|
||||
/**
|
||||
* 总套餐流量
|
||||
*/
|
||||
private Integer dataplan;
|
||||
|
||||
/**
|
||||
* 新增流量套餐
|
||||
*/
|
||||
private Integer newtraffic;
|
||||
|
||||
/**
|
||||
* 电度功能
|
||||
*/
|
||||
private Integer electroplate;
|
||||
|
||||
/**
|
||||
* 对时功能
|
||||
*/
|
||||
private Integer ontime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
private String contract;
|
||||
|
||||
/**
|
||||
* SIM卡号
|
||||
*/
|
||||
private String sim;
|
||||
|
||||
/**
|
||||
* 装置系列
|
||||
*/
|
||||
private String devCatena;
|
||||
|
||||
/**
|
||||
* 监测装置安装位置
|
||||
*/
|
||||
private String devLocation;
|
||||
|
||||
/**
|
||||
* 监测厂家设备编号
|
||||
*/
|
||||
private String devNo;
|
||||
|
||||
/**
|
||||
* 告警功能
|
||||
*/
|
||||
private Integer isAlarm;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_DEVTYPEICD
|
||||
*/
|
||||
@TableName(value ="PQ_DEVTYPEICD")
|
||||
@Data
|
||||
public class PqDevtypeicd implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "DEVTYPE")
|
||||
private String devtype;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "ICDTEMPLATEBLOB")
|
||||
private byte[] icdtemplateblob;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableField(value = "ICDTEMPLATECLOB")
|
||||
private String icdtemplateclob;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_GDINFORMATION 供电公司信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqGdinformation implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* (关联表PQS_DICDATA外键)省份Guid
|
||||
*/
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_LINE
|
||||
*/
|
||||
@Data
|
||||
public class PqLine implements Serializable {
|
||||
|
||||
private Integer lineIndex;
|
||||
/**
|
||||
* 线路名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* PT一次变比
|
||||
*/
|
||||
private Double pt1;
|
||||
|
||||
/**
|
||||
* PT二次变比
|
||||
*/
|
||||
private Double pt2;
|
||||
|
||||
/**
|
||||
* CT一次变比
|
||||
*/
|
||||
private Double ct1;
|
||||
|
||||
/**
|
||||
* CT二次变比
|
||||
*/
|
||||
private Double ct2;
|
||||
|
||||
/**
|
||||
* 设备容量
|
||||
*/
|
||||
private Double devcmp;
|
||||
|
||||
/**
|
||||
* 短路容量
|
||||
*/
|
||||
private Double dlcmp;
|
||||
|
||||
/**
|
||||
* 基准容量
|
||||
*/
|
||||
private Double jzcmp;
|
||||
|
||||
/**
|
||||
* 协议容量
|
||||
*/
|
||||
private Double xycmp;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 0投运 1.热备用 2.停运
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_LINEDETAIL
|
||||
*/
|
||||
@Data
|
||||
public class PqLinedetail implements Serializable {
|
||||
|
||||
private Integer lineIndex;
|
||||
/**
|
||||
* 线路名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)
|
||||
*/
|
||||
private Integer pttype;
|
||||
|
||||
/**
|
||||
* 上次数据更新时间
|
||||
*/
|
||||
private String lastTime;
|
||||
|
||||
/**
|
||||
* 测量间隔(1~10)
|
||||
*/
|
||||
private Integer tinterval;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata表)负荷类型Guid
|
||||
*/
|
||||
private String loadtype;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dicdata表)行业类型Guid
|
||||
*/
|
||||
private String businesstype;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 国网谐波监测平台监测点号
|
||||
*/
|
||||
private String monitorId;
|
||||
|
||||
/**
|
||||
* 0-电网侧,1-非电网侧
|
||||
*/
|
||||
private Integer powerid;
|
||||
|
||||
/**
|
||||
* 监测点对象名称
|
||||
*/
|
||||
private String objname;
|
||||
|
||||
/**
|
||||
* 统计类型
|
||||
*/
|
||||
private Integer statflag;
|
||||
|
||||
/**
|
||||
* 监测点等级
|
||||
*/
|
||||
private String lineGrade;
|
||||
|
||||
/**
|
||||
* 电网侧变电站名称
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 挂接线路
|
||||
*/
|
||||
private String hangLine;
|
||||
|
||||
/**
|
||||
* 监测点拥有者
|
||||
*/
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 拥有者职务
|
||||
*/
|
||||
private String ownerDuty;
|
||||
|
||||
/**
|
||||
* 拥有者联系方式
|
||||
*/
|
||||
private String ownerTel;
|
||||
|
||||
/**
|
||||
* 接线图
|
||||
*/
|
||||
private String wiringDiagram;
|
||||
|
||||
/**
|
||||
* 上级电站
|
||||
*/
|
||||
private String superiorsSubstation;
|
||||
|
||||
/**
|
||||
* 分类等级 内容为Ⅰ、Ⅱ、Ⅲ、Ⅳ
|
||||
*/
|
||||
private String classificationGrade;
|
||||
|
||||
/**
|
||||
* 是否并网点
|
||||
*/
|
||||
private Integer isGridPoint;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author web2023
|
||||
* @TableName PQ_PROJECT 项目信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqProject implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 项目名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author web2023
|
||||
* @TableName PQ_PROVINCE 省级信息表
|
||||
*/
|
||||
@Data
|
||||
public class PqProvince implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 省级名称(唯一性判断)
|
||||
*/
|
||||
private String name;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_SUBSTATION
|
||||
*/
|
||||
@Data
|
||||
public class PqSubstation implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dictionary表)电压等级Guid
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 旧变电站id
|
||||
*/
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 供电公司
|
||||
*/
|
||||
private String gdName;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQ_SUBVOLTAGE
|
||||
*/
|
||||
@Data
|
||||
public class PqSubvoltage implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 母线名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 原母线名称
|
||||
*/
|
||||
private String oldName;
|
||||
|
||||
/**
|
||||
* 母线号(在同一台设备中的电压通道号)
|
||||
*/
|
||||
private Integer subvNum;
|
||||
|
||||
/**
|
||||
* (关联表PQS_Dicdata)电压等级Guid
|
||||
*/
|
||||
private String scale;
|
||||
|
||||
/**
|
||||
* 母线模型(0:虚拟母线;1:实际母线)
|
||||
* 默认是实际母线
|
||||
*/
|
||||
private Integer subvmodel;
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
*/
|
||||
private List<PqLine> pqLine;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName PQS_MAP 变电站经纬度
|
||||
*/
|
||||
@Data
|
||||
public class PqsMap implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private Double latitude;
|
||||
|
||||
/**
|
||||
* 数据状态(0:删除;1:正常)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedger implements Serializable {
|
||||
|
||||
/**
|
||||
* 线路信息表
|
||||
*/
|
||||
private PqLine pqLine;
|
||||
|
||||
/**
|
||||
* 线路参数附加定义表
|
||||
*/
|
||||
private PqLinedetail pqLinedetail;
|
||||
|
||||
/**
|
||||
* 母线信息表
|
||||
*/
|
||||
private PqSubvoltage pqSubvoltage;
|
||||
|
||||
/**
|
||||
* 装置信息表
|
||||
*/
|
||||
private PqDevice pqDevice;
|
||||
|
||||
/**
|
||||
* 装置详细信息表
|
||||
*/
|
||||
private PqDevicedetail pqDevicedetail;
|
||||
|
||||
/**
|
||||
* 变电站信息表
|
||||
*/
|
||||
private PqSubstation pqSubstation;
|
||||
|
||||
/**
|
||||
* 变电站经纬度
|
||||
*/
|
||||
private PqsMap pqsMap;
|
||||
|
||||
/**
|
||||
* 供电公司信息表
|
||||
*/
|
||||
private PqGdinformation pqGdinformation;
|
||||
|
||||
/**
|
||||
* 省级信息表,层次高于供电公司
|
||||
*/
|
||||
private PqProvince pqProvince;
|
||||
/**
|
||||
* 项目信息表,层次高于省级
|
||||
*/
|
||||
private PqProject pqProject;
|
||||
|
||||
/**
|
||||
* 线路号(在同一台设备中的监测点号)
|
||||
*/
|
||||
private Integer lineNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedgerDelete implements Serializable {
|
||||
|
||||
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Integer superId;
|
||||
|
||||
private String superName;
|
||||
/**
|
||||
* 等级:0-项目名称;1- 工程名称;2-单位;3-部门;4-终端;5-母线;6-监测点
|
||||
*/
|
||||
private Integer level;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pq.pojo.param.oracle;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2024/10/9 16:37
|
||||
*/
|
||||
@Data
|
||||
public class SyncLedgerUpdate implements Serializable {
|
||||
|
||||
/**
|
||||
* 变电站信息表
|
||||
*/
|
||||
private PqSubstation pqSubstation;
|
||||
|
||||
/**
|
||||
* 变电站经纬度
|
||||
*/
|
||||
private PqsMap pqsMap;
|
||||
|
||||
/**
|
||||
* 装置信息表
|
||||
*/
|
||||
private List<PqDevice> pqDevice;
|
||||
|
||||
/**
|
||||
* 装置详细信息表
|
||||
*/
|
||||
private List<PqDevicedetail> pqDevicedetail;
|
||||
|
||||
/**
|
||||
* 线路参数附加定义表
|
||||
*/
|
||||
private List<PqLinedetail> pqLinedetail;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -41,4 +41,11 @@ public class LineDataIntegrity implements Serializable {
|
||||
*/
|
||||
private Double integrityData;
|
||||
|
||||
|
||||
private Double mysqlReal;
|
||||
|
||||
public void setMysqlReal(Double mysqlReal) {
|
||||
this.real = mysqlReal;
|
||||
this.mysqlReal = mysqlReal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class NodeController extends BaseController {
|
||||
*/
|
||||
@ApiOperation("获取全部前置机")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("nodeAllList")
|
||||
@GetMapping("/nodeAllList")
|
||||
public HttpResult<List<Node>> nodeAllList(){
|
||||
String methodDescribe = getMethodDescribe("nodeAllList");
|
||||
List<Node> resList = iNodeService.nodeAllList();
|
||||
@@ -155,15 +155,11 @@ public class NodeController extends BaseController {
|
||||
@ApiOperation("根据id获取前置机")
|
||||
@ApiImplicitParam(value = "前置机id",name = "id",required = true)
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@GetMapping("getNodeById")
|
||||
@GetMapping("/getNodeById")
|
||||
public HttpResult<Node> getNodeById(@Validated @NotNull(message = "id不可为空") @RequestParam("id")String id){
|
||||
String methodDescribe = getMethodDescribe("getNodeById");
|
||||
Node node = iNodeService.getNodeById(id);
|
||||
if(Objects.isNull(node)){
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, node, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -191,8 +191,7 @@ public class TerminalBaseController extends BaseController {
|
||||
@DeleteMapping("delTerminal")
|
||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delTerminal");
|
||||
System.out.println(id);
|
||||
// terminalBaseService.delTerminal(id);
|
||||
terminalBaseService.delTerminal(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,14 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
*/
|
||||
List<String> getVoltageIdByScale(@Param("voltageIds") List<String> voltageIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询变电站id
|
||||
*
|
||||
* @param subIds 变电站索引集合
|
||||
* @param scale 电压等级
|
||||
*/
|
||||
List<String> getSubIdByScale(@Param("subIds") List<String> subIds, @Param("scale") String scale);
|
||||
|
||||
/**
|
||||
* 查询监测点id
|
||||
*
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
line.pid as 'pid',
|
||||
line.Pids as 'pids',
|
||||
line.Name AS 'name',
|
||||
line.Levelas 'Level',
|
||||
line.Level as 'Level',
|
||||
pd.Update_Time AS 'updateTime',
|
||||
line.Sort as 'sort',
|
||||
pd.Com_Flag as 'ComFlag',
|
||||
|
||||
@@ -650,7 +650,9 @@
|
||||
<select id="getSubstationInfo" resultType="PollutionSubstationDTO">
|
||||
SELECT A.id,
|
||||
A.Name name,
|
||||
C.Name voltageLevel
|
||||
C.Name voltageLevel,
|
||||
b.Lng,
|
||||
b.lat
|
||||
FROM pq_line A,
|
||||
pq_substation B,
|
||||
sys_dict_data C
|
||||
@@ -1777,4 +1779,20 @@
|
||||
|
||||
</where>
|
||||
</select>
|
||||
<select id="getSubIdByScale" resultType="java.lang.String">
|
||||
select
|
||||
t1.id
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_substation t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="subIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND
|
||||
t2.scale = #{scale}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<select id="getLineIntegrityRate" resultType="LineDataIntegrity">
|
||||
select line_index lineId,
|
||||
avg(real_time/due_time)*100 integrityData,
|
||||
sum(real_time) real,
|
||||
sum(real_time) mysqlReal,
|
||||
sum(due_time) due
|
||||
from r_stat_integrity_d
|
||||
where line_index in
|
||||
|
||||
@@ -148,6 +148,16 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
List<String> getVoltageIdByScale(List<String> voltageIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据指定电压等级查询母线id
|
||||
* @param subIds
|
||||
* @param scale
|
||||
* @return: java.util.List<java.lang.String>
|
||||
* @Author: wr
|
||||
* @Date: 2024/10/12 15:58
|
||||
*/
|
||||
List<String> getSubIdByScale(List<String> subIds, String scale);
|
||||
|
||||
/**
|
||||
* 根据干扰源获取对应的监测点id
|
||||
*
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
private final DevVersionMapper devVersionMapper;
|
||||
private final ProgramVersionService programVersionService;
|
||||
|
||||
@Value("${socket.port}")
|
||||
@Value("${socket.port:60000}")
|
||||
private Integer socketPort;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -473,9 +473,9 @@ public class GeneralDeviceService {
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByScale(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> scales) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> voltageIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
List<String> subIds = new ArrayList<>(), lineIds = new ArrayList<>();
|
||||
for (GeneralDeviceDTO generalDeviceDTO : deviceInfos) {
|
||||
voltageIds.addAll(generalDeviceDTO.getVoltageIndexes());
|
||||
subIds.addAll(generalDeviceDTO.getSubIndexes());
|
||||
lineIds.addAll(generalDeviceDTO.getLineIndexes());
|
||||
}
|
||||
//如果电压等级集合为空,则查询所有的电压等级
|
||||
@@ -493,8 +493,8 @@ public class GeneralDeviceService {
|
||||
}
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (SimpleDTO simpleDTO : scales) {
|
||||
List<String> voltageScaleIds = terminalBaseService.getVoltageIdByScale(voltageIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_V_LEVEL.getCode()));
|
||||
List<String> voltageScaleIds = terminalBaseService.getSubIdByScale(subIds, simpleDTO.getId());
|
||||
generalDeviceDTOS.add(assembleDataByLine(simpleDTO, lines, voltageScaleIds, LineBaseEnum.SUB_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -30,6 +29,7 @@ import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.*;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
@@ -37,7 +37,9 @@ import com.njcn.device.pq.pojo.bo.excel.NodeExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.OracleTerminalExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.OverLimitExcel;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.param.oracle.*;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.*;
|
||||
@@ -53,17 +55,21 @@ import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@@ -82,37 +88,36 @@ import java.util.stream.Stream;
|
||||
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
|
||||
private final SuperDataMapper superDataMapper;
|
||||
|
||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final DevFuctionMapper devFuctionMapper;
|
||||
|
||||
private final AreaFeignClient areaFeignClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final SubstationMapper substationMapper;
|
||||
|
||||
private final VoltageMapper voltageMapper;
|
||||
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
private final INodeService nodeService;
|
||||
|
||||
private final LineBakService lineBakService;
|
||||
|
||||
private final DeviceBakService deviceBakService;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
|
||||
@Value("${oracle.isSync}")
|
||||
private Boolean isSync;
|
||||
|
||||
@Value("${oracle.syncLedgerLineUrl}")
|
||||
private String url;
|
||||
|
||||
|
||||
@Value("${oracle.syncLedgerUpdateLine}")
|
||||
private String updateUrl;
|
||||
|
||||
@Value("${oracle.syncLedgerDeleteLine}")
|
||||
private String urlDelete;
|
||||
|
||||
/**
|
||||
* 终端新增操作
|
||||
*
|
||||
@@ -498,6 +503,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateTerminal(UpdateTerminalParam updateTerminalParam) {
|
||||
String oldSubName = "";
|
||||
String gbName = "";
|
||||
LambdaQueryWrapper<Line> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//项目
|
||||
if (Objects.nonNull(updateTerminalParam.getProjectUpdateParam())) {
|
||||
@@ -528,6 +535,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//供电公司
|
||||
if (Objects.nonNull(updateTerminalParam.getGdInformationUpdateParam())) {
|
||||
Line gdRes = this.getById(updateTerminalParam.getGdInformationUpdateParam().getGdIndex());
|
||||
gbName = gdRes.getName();
|
||||
if (Objects.isNull(gdRes)) {
|
||||
throw new BusinessException(DeviceResponseEnum.GD_NO);
|
||||
}
|
||||
@@ -545,6 +553,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
if (Objects.isNull(subStationRes)) {
|
||||
throw new BusinessException(DeviceResponseEnum.SUB_NO);
|
||||
}
|
||||
oldSubName = subStationRes.getName();
|
||||
Line subStation = new Line();
|
||||
subStation.setId(updateTerminalParam.getSubStationUpdateParam().getSubIndex());
|
||||
subStation.setName(updateTerminalParam.getSubStationUpdateParam().getName());
|
||||
@@ -659,6 +668,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
for (SubVoltageParam updateSubVoltageParam : subVoltageBOList) {
|
||||
if (updateSubVoltageParam.getUpdateFlag() == 1) {
|
||||
Voltage voltageTem = voltageMapper.selectById(updateSubVoltageParam.getSubvIndex());
|
||||
Line byId = this.getById(updateSubVoltageParam.getSubvIndex());
|
||||
updateSubVoltageParam.setOldName(byId.getName());
|
||||
Line subVoltage = new Line();
|
||||
subVoltage.setId(updateSubVoltageParam.getSubvIndex());
|
||||
subVoltage.setName(updateSubVoltageParam.getName());
|
||||
@@ -783,6 +794,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isSync) {
|
||||
/***
|
||||
* oracle http远程调用接口
|
||||
*/
|
||||
SyncLedgerUpdate syncLedger = oracleSyncLedgerUpdate(updateTerminalParam, oldSubName, gbName);
|
||||
ResponseEntity<String> userEntity = RestTemplateUtil.post(updateUrl, syncLedger, String.class);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1342,6 +1360,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
List<Line> deviceList = this.list(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(deviceList)) {
|
||||
List<String> devIndexList = deviceList.stream().map(Line::getId).collect(Collectors.toList());
|
||||
|
||||
this.removeByIds(devIndexList);
|
||||
deviceMapper.deleteBatchIds(devIndexList);
|
||||
devFuctionMapper.deleteBatchIds(devIndexList);
|
||||
@@ -1437,6 +1456,10 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
}
|
||||
if (isSync) {
|
||||
SyncLedgerDelete delete = oracleSyncLedgerDelete(obj);
|
||||
ResponseEntity<String> userEntity = RestTemplateUtil.post(urlDelete, delete, String.class);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1501,6 +1524,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getVoltageIdByScale(voltageIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubIdByScale(List<String> subIds, String scale) {
|
||||
return this.baseMapper.getSubIdByScale(subIds, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLineIdByLoadType(List<String> lineIds, String loadType) {
|
||||
return this.baseMapper.getLineIdByLoadType(lineIds, loadType);
|
||||
@@ -1696,7 +1724,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
throw new BusinessException(DeviceResponseEnum.LINE_NO);
|
||||
}
|
||||
String[] urls = new String[0];
|
||||
if(StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())){
|
||||
if (StrUtil.isNotBlank(lineDetailValid.getWiringDiagram())) {
|
||||
urls = lineDetailValid.getWiringDiagram().split(StrUtil.COMMA);
|
||||
}
|
||||
|
||||
@@ -1820,6 +1848,21 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String terminalSync(SyncTerminalParam syncTerminalParam) {
|
||||
if (isSync) {
|
||||
/***
|
||||
* oracle http远程调用接口
|
||||
*/
|
||||
SyncLedger syncLedger = oracleSyncLedger(syncTerminalParam);
|
||||
ResponseEntity<Map> userEntity = RestTemplateUtil.post(url, syncLedger, Map.class);
|
||||
if (HttpURLConnection.HTTP_OK == userEntity.getStatusCodeValue()) {
|
||||
//获取返回体
|
||||
Map body = userEntity.getBody();
|
||||
Integer oracleLineId = Integer.valueOf(body.get("oracleLineId").toString());
|
||||
Integer oracleDevId = Integer.valueOf(body.get("oracleDevId").toString());
|
||||
syncTerminalParam.setOracleLineId(oracleLineId);
|
||||
syncTerminalParam.setOracleDevId(oracleDevId);
|
||||
}
|
||||
}
|
||||
String projectIndex = null;
|
||||
String provinceIndex = null;
|
||||
String gdIndex = null;
|
||||
@@ -1850,12 +1893,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
|
||||
|
||||
|
||||
//变电站 todo 可能新建电站
|
||||
if (Objects.nonNull(syncTerminalParam.getSubStationParam())) {
|
||||
if (StrUtil.isBlank(subIndex) && StrUtil.isNotBlank(gdIndex)) {
|
||||
Line substation = this.lambdaQuery().eq(Line::getName, syncTerminalParam.getSubStationParam().getName()).one();
|
||||
if(Objects.isNull(substation)){
|
||||
if (Objects.isNull(substation)) {
|
||||
Line subStation = assembleLine(syncTerminalParam.getSubStationParam().getName(), LineBaseEnum.SUB_LEVEL.getCode(), gdIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex, syncTerminalParam.getSubStationParam().getSort());
|
||||
this.baseMapper.insert(subStation);
|
||||
subIndex = subStation.getId();
|
||||
@@ -1867,7 +1909,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
sub.setLng(syncTerminalParam.getSubStationParam().getLng());
|
||||
sub.setLat(syncTerminalParam.getSubStationParam().getLat());
|
||||
substationMapper.insert(sub);
|
||||
}else {
|
||||
} else {
|
||||
subIndex = substation.getId();
|
||||
|
||||
}
|
||||
@@ -1880,7 +1922,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//查询该设备是否已经同步到表如何存在则之前同步监测点时同步过了,不用同步设备了,反之同步
|
||||
DeviceParam deviceParam = syncTerminalParam.getDeviceParam();
|
||||
Line deviceLine = this.baseMapper.selectById(syncTerminalParam.getDeviceParam().getDevIndex());
|
||||
if(Objects.isNull(deviceLine)){
|
||||
if (Objects.isNull(deviceLine)) {
|
||||
Line device = assembleLine(deviceParam.getName(), LineBaseEnum.DEVICE_LEVEL.getCode(), subIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex, deviceParam.getSort());
|
||||
device.setId(deviceParam.getDevIndex());
|
||||
this.baseMapper.insert(device);
|
||||
@@ -1898,8 +1940,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deviceDetail.setLoginTime(PubUtils.localDateFormat(deviceParam.getLoginTime()));
|
||||
deviceDetail.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
//处理终端oracle关系
|
||||
if (ObjectUtil.isNotNull(syncTerminalParam.getOracleDevId())) {
|
||||
DeviceBak back = new DeviceBak();
|
||||
back.setId(deviceDetail.getId());
|
||||
back.setDevId(syncTerminalParam.getOracleDevId());
|
||||
deviceBakService.saveOrUpdate(back);
|
||||
}
|
||||
//处理装置识别码秘钥
|
||||
|
||||
deviceMapper.insert(deviceDetail);
|
||||
//装置功能 todo确定devFuction
|
||||
// List<DictData> funList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_FUN.getName()).getData();
|
||||
@@ -1928,7 +1976,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//同一变电站下只能有唯一母线名称
|
||||
Line SubVoltage = this.lambdaQuery().eq(Line::getName, subVoltageParam.getName()).like(Line::getPids, syncTerminalParam.getSubIndex()).one();
|
||||
|
||||
if(Objects.isNull(SubVoltage)){
|
||||
if (Objects.isNull(SubVoltage)) {
|
||||
//新建母线
|
||||
Line subVoltage = assembleLine(subVoltageParam.getName(), LineBaseEnum.SUB_V_LEVEL.getCode(), deviceParam.getDevIndex(), projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex + StrUtil.COMMA + subIndex + StrUtil.COMMA + deviceParam.getDevIndex(), subVoltageParam.getSort());
|
||||
this.baseMapper.insert(subVoltage);
|
||||
@@ -1941,8 +1989,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
voltage.setScale(scaleRes.getId());
|
||||
voltage.setModel(subVoltageParam.getModel());
|
||||
voltageMapper.insert(voltage);
|
||||
}else {
|
||||
subvIndex=SubVoltage.getId();
|
||||
} else {
|
||||
subvIndex = SubVoltage.getId();
|
||||
}
|
||||
|
||||
//处理监测点
|
||||
@@ -1963,7 +2011,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
|
||||
lineDetailMapper.insert(lineDetail);
|
||||
|
||||
//处理终端oracle关系
|
||||
if (ObjectUtil.isNotNull(syncTerminalParam.getOracleLineId())) {
|
||||
LineBak back = new LineBak();
|
||||
back.setId(lineDetail.getId());
|
||||
back.setLineId(syncTerminalParam.getOracleLineId());
|
||||
lineBakService.saveOrUpdate(back);
|
||||
}
|
||||
//通过监测点id获取母线电压等级
|
||||
Voltage voltage = lineMapper.getVoltageByLineId(line.getId());
|
||||
//监测点限值
|
||||
@@ -1990,7 +2044,6 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deptLine.setId(syncTerminalParam.getDeptId());
|
||||
deptLine.setLineId(line.getId());
|
||||
deptLineMapper.insert(deptLine);
|
||||
|
||||
return subIndex;
|
||||
}
|
||||
|
||||
@@ -1998,16 +2051,16 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean terminalSyncRunFly(String lineId) {
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||
if(ObjectUtil.isNotNull(lineDTO)){
|
||||
lineDetailMapper.update(null,new LambdaUpdateWrapper<LineDetail>()
|
||||
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||
lineDetailMapper.update(null, new LambdaUpdateWrapper<LineDetail>()
|
||||
.set(LineDetail::getRunFlag, 0)
|
||||
.eq(LineDetail::getId, lineDTO.getLineId())
|
||||
);
|
||||
|
||||
deviceMapper.update(null,new LambdaUpdateWrapper<Device>()
|
||||
deviceMapper.update(null, new LambdaUpdateWrapper<Device>()
|
||||
.set(Device::getRunFlag, 0)
|
||||
.eq(Device::getId, lineDTO.getDevId())
|
||||
);
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2016,7 +2069,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean terminalSyncDeleteFly(String lineId) {
|
||||
LineDTO lineDTO = this.baseMapper.selectLineDetail(lineId);
|
||||
if(ObjectUtil.isNotNull(lineDTO)){
|
||||
if (ObjectUtil.isNotNull(lineDTO)) {
|
||||
//删除监测点详细信息
|
||||
lineDetailMapper.updateLineRunFlag(lineDTO.getLineId(), RunFlagEnum.QUIT.getStatus());
|
||||
//todo 删除监测点信息
|
||||
@@ -2090,7 +2143,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
temp = assembleLine(substationName, LineBaseEnum.SUB_LEVEL.getCode(), pids.get(LineBaseEnum.GD_LEVEL.getCode()), pids);
|
||||
this.baseMapper.insert(temp);
|
||||
//处理电压等级字典表
|
||||
DictData substationScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(),oracleTerminalExcel.getSubStationScale()).getData();
|
||||
DictData substationScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(), oracleTerminalExcel.getSubStationScale()).getData();
|
||||
if (Objects.isNull(substationScale)) {
|
||||
//在电压等级内新增一条记录
|
||||
substationScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubStationScale()).getData();
|
||||
@@ -2128,7 +2181,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
List<String> devIds = deviceBaks.stream().map(DeviceBak::getId).collect(Collectors.toList());
|
||||
List<Line> devList = new ArrayList<>();
|
||||
if(!CollectionUtil.isEmpty(devIds)){
|
||||
if (!CollectionUtil.isEmpty(devIds)) {
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, devIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
@@ -2149,7 +2202,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
//处理终端厂家
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(),oracleTerminalExcel.getManufacturer()).getData();
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
if (Objects.isNull(manufacturer)) {
|
||||
//在终端厂家字典内新增一条记录
|
||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
@@ -2185,7 +2238,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
device.setFrontType(frontTypeDicData.getId());
|
||||
String devType = oracleDevType.replace("_" + frontType, "");
|
||||
//处理终端类型
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(),devType).getData();
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
if (Objects.isNull(devTypeDicData)) {
|
||||
//在终端类型字典内新增一条记录
|
||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
@@ -2211,23 +2264,23 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
||||
deviceBakLambdaQueryWrapper1.in(DeviceBak::getId, ids);
|
||||
deviceBakService.remove(deviceBakLambdaQueryWrapper1);
|
||||
}else if(devList.size()==1){
|
||||
} else if (devList.size() == 1) {
|
||||
temp = lineMapper.selectById(devList.get(0).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
//先查询终端id是否存在,存在则修改,不存在这添加
|
||||
//判断是否因为改了终端名称导致没有查到数据
|
||||
// LambdaQueryWrapper<DeviceBak> deviceBakLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// deviceBakLambdaQueryWrapper.eq(DeviceBak::getDevId, temp.getId());
|
||||
// DeviceBak byId = deviceBakService.getById(deviceBakLambdaQueryWrapper);
|
||||
// if(Objects.isNull(byId)){
|
||||
//插入新旧终端ID中间表
|
||||
DeviceBak deviceBak = new DeviceBak();
|
||||
deviceBak.setId(temp.getId());
|
||||
deviceBak.setDevId(oracleTerminalExcel.getDeviceId());
|
||||
deviceBakService.saveOrUpdate(deviceBak);
|
||||
//插入新旧终端ID中间表
|
||||
DeviceBak deviceBak = new DeviceBak();
|
||||
deviceBak.setId(temp.getId());
|
||||
deviceBak.setDevId(oracleTerminalExcel.getDeviceId());
|
||||
deviceBakService.saveOrUpdate(deviceBak);
|
||||
// }else{
|
||||
// if(!byId.getDevId().equals(oracleTerminalExcel.getDeviceId())){
|
||||
// oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "终端关系,数据存入Oracle和excl不一样:" + oracleTerminalExcel.getLineNum() + "需要排查"));
|
||||
@@ -2246,7 +2299,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
}
|
||||
//处理终端厂家
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(),oracleTerminalExcel.getManufacturer()).getData();
|
||||
DictData manufacturer = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
if (Objects.isNull(manufacturer)) {
|
||||
//在终端厂家字典内新增一条记录
|
||||
manufacturer = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_MANUFACTURER.getName(), oracleTerminalExcel.getManufacturer()).getData();
|
||||
@@ -2282,7 +2335,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
device.setFrontType(frontTypeDicData.getId());
|
||||
String devType = oracleDevType.replace("_" + frontType, "");
|
||||
//处理终端类型
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(),devType).getData();
|
||||
DictData devTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
if (Objects.isNull(devTypeDicData)) {
|
||||
//在终端类型字典内新增一条记录
|
||||
devTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_TYPE.getName(), devType).getData();
|
||||
@@ -2320,7 +2373,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
voltage.setId(temp.getId());
|
||||
voltage.setModel(oracleTerminalExcel.getSubvModel());
|
||||
//处理电压等级字典表
|
||||
DictData subvScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(),oracleTerminalExcel.getSubvScale()).getData();
|
||||
DictData subvScale = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_VOLTAGE_STAND.getName(), oracleTerminalExcel.getSubvScale()).getData();
|
||||
if (Objects.isNull(subvScale)) {
|
||||
//在电压等级内新增一条记录
|
||||
subvScale = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_VOLTAGE.getName(), oracleTerminalExcel.getSubvScale()).getData();
|
||||
@@ -2375,14 +2428,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
// }
|
||||
lineDetail.setNum(oracleTerminalExcel.getLineNum());
|
||||
//干扰源类型
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(),oracleTerminalExcel.getLoadType()).getData();
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
if (Objects.isNull(loadTypeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
}
|
||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
||||
//行业类型
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(),oracleTerminalExcel.getBusinessType()).getData();
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
if (Objects.isNull(businessDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
@@ -2395,7 +2448,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
//终端等级,为空不处理,可以为空
|
||||
if (StringUtils.isNotBlank(oracleTerminalExcel.getLineGrade())) {
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(),oracleTerminalExcel.getLineGrade()).getData();
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
if (Objects.isNull(lineGradeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
@@ -2410,7 +2463,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
List<LineBak> lineBaks = lineBakService.list(lineBakLambdaQueryWrapper);
|
||||
List<String> lineIds = lineBaks.stream().map(LineBak::getId).collect(Collectors.toList());
|
||||
List<Line> lineList = new ArrayList<>();
|
||||
if(CollectionUtil.isNotEmpty(lineIds)){
|
||||
if (CollectionUtil.isNotEmpty(lineIds)) {
|
||||
LambdaQueryWrapper<Line> devLambda = new LambdaQueryWrapper<>();
|
||||
devLambda.in(Line::getId, lineIds)
|
||||
.orderByAsc(Line::getCreateTime)
|
||||
@@ -2446,14 +2499,14 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
// }
|
||||
lineDetail.setNum(oracleTerminalExcel.getLineNum());
|
||||
//干扰源类型
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(),oracleTerminalExcel.getLoadType()).getData();
|
||||
DictData loadTypeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
if (Objects.isNull(loadTypeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
loadTypeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getName(), oracleTerminalExcel.getLoadType()).getData();
|
||||
}
|
||||
lineDetail.setLoadType(loadTypeDicData.getId());
|
||||
//行业类型
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(),oracleTerminalExcel.getBusinessType()).getData();
|
||||
DictData businessDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
if (Objects.isNull(businessDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
businessDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.BUSINESS_TYPE.getName(), oracleTerminalExcel.getBusinessType()).getData();
|
||||
@@ -2466,7 +2519,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
}
|
||||
//终端等级,为空不处理,可以为空
|
||||
if (StringUtils.isNotBlank(oracleTerminalExcel.getLineGrade())) {
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(),oracleTerminalExcel.getLineGrade()).getData();
|
||||
DictData lineGradeDicData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
if (Objects.isNull(lineGradeDicData)) {
|
||||
//在电压等级内新增一条记录
|
||||
lineGradeDicData = dicDataFeignClient.addDicData(DicDataTypeEnum.DEV_LEVEL.getName(), oracleTerminalExcel.getLineGrade()).getData();
|
||||
@@ -3036,4 +3089,368 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
BeanUtils.copyProperties(substation, subStationVO);
|
||||
terminalVO.setSubStationVO(subStationVO);
|
||||
}
|
||||
|
||||
private SyncLedgerDelete oracleSyncLedgerDelete(Line obj) {
|
||||
SyncLedgerDelete delete = new SyncLedgerDelete();
|
||||
delete.setLevel(obj.getLevel());
|
||||
/**
|
||||
* 3-变电站;4-终端;5-母线;6-监测点
|
||||
*/
|
||||
switch (obj.getLevel()) {
|
||||
case 3:
|
||||
Line byId = this.getById(obj.getPid());
|
||||
if (Objects.isNull(byId)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA);
|
||||
}
|
||||
delete.setSuperName(byId.getName());
|
||||
delete.setName(obj.getName());
|
||||
break;
|
||||
case 4:
|
||||
DeviceBak deviceBak = deviceBakService.getById(obj.getId());
|
||||
delete.setId(deviceBak.getDevId());
|
||||
delete.setName(obj.getName());
|
||||
break;
|
||||
case 5:
|
||||
DeviceBak bak = deviceBakService.getById(obj.getPid());
|
||||
delete.setName(obj.getName());
|
||||
delete.setSuperId(bak.getDevId());
|
||||
break;
|
||||
case 6:
|
||||
LineBak lineBak = lineBakService.getById(obj.getId());
|
||||
delete.setId(lineBak.getLineId());
|
||||
delete.setName(obj.getName());
|
||||
break;
|
||||
}
|
||||
return delete;
|
||||
}
|
||||
|
||||
private SyncLedgerUpdate oracleSyncLedgerUpdate(UpdateTerminalParam param, String oldSubName, String gdName) {
|
||||
SyncLedgerUpdate update = new SyncLedgerUpdate();
|
||||
/**
|
||||
* 先更新变电站信息,然后根据变电站信息查询终端信息
|
||||
*/
|
||||
//变电站信息
|
||||
SubStationParam.SubStationUpdateParam sub = param.getSubStationUpdateParam();
|
||||
List<DeviceParam> deviceUpdateParamList = param.getDeviceUpdateParamList();
|
||||
PqSubstation substation = new PqSubstation();
|
||||
if (ObjectUtil.isNull(sub)) {
|
||||
//因为查出来的数据电压等级是转换过的所有不需要替换
|
||||
Line byId = this.getById(deviceUpdateParamList.get(0).getDevIndex());
|
||||
PollutionSubstationDTO substationInfo = lineMapper.getSubstationInfo(byId.getPid());
|
||||
sub = new SubStationParam.SubStationUpdateParam();
|
||||
sub.setName(substationInfo.getName());
|
||||
oldSubName = substationInfo.getName();
|
||||
sub.setLng(substationInfo.getLng());
|
||||
sub.setLat(substationInfo.getLat());
|
||||
sub.setSubIndex(substationInfo.getId());
|
||||
substation.setScale(substationInfo.getVoltageLevel());
|
||||
} else {
|
||||
substation.setScale(dictName(sub.getScale()));
|
||||
}
|
||||
substation.setName(sub.getName());
|
||||
substation.setOldName(oldSubName);
|
||||
if (StrUtil.isNotBlank(gdName)) {
|
||||
substation.setGdName(gdName);
|
||||
} else {
|
||||
Line byId = this.getById(sub.getSubIndex());
|
||||
Line byId1 = this.getById(byId.getPid());
|
||||
if(ObjectUtil.isNull(byId1)){
|
||||
throw new BusinessException(PvDeviceResponseEnum.GD_OR_NOT);
|
||||
}
|
||||
substation.setGdName(byId1.getName());
|
||||
}
|
||||
update.setPqSubstation(substation);
|
||||
PqsMap pqsMap = new PqsMap();
|
||||
pqsMap.setLongitude(sub.getLng().doubleValue());
|
||||
pqsMap.setLatitude(sub.getLat().doubleValue());
|
||||
update.setPqsMap(pqsMap);
|
||||
|
||||
//修改终端信息
|
||||
List<PqDevice> deviceList = new ArrayList<>();
|
||||
List<PqDevicedetail> deviceDetailList = new ArrayList<>();
|
||||
List<PqLinedetail> lineDeatailList = new ArrayList<>();
|
||||
|
||||
List<String> devMysqlIds = deviceUpdateParamList.stream().map(DeviceParam::getDevIndex).collect(Collectors.toList());
|
||||
List<DeviceBak> deviceBaks = deviceBakService.listByIds(devMysqlIds);
|
||||
Map<String, Integer> deviceBakMap = deviceBaks.stream().collect(Collectors.toMap(DeviceBak::getId, DeviceBak::getDevId));
|
||||
|
||||
|
||||
for (DeviceParam device : deviceUpdateParamList) {
|
||||
String devIndex = device.getDevIndex();
|
||||
if (deviceBakMap.containsKey(devIndex)) {
|
||||
Integer devOracleId = deviceBakMap.get(devIndex);
|
||||
//终端
|
||||
PqDevice pqDevice = new PqDevice();
|
||||
pqDevice.setDevIndex(devOracleId);
|
||||
pqDevice.setName(device.getName());
|
||||
pqDevice.setStatus(1);
|
||||
pqDevice.setDevtype(dictName(device.getDevType()));
|
||||
pqDevice.setLogontime(device.getLoginTime());
|
||||
pqDevice.setUpdatetime(device.getLoginTime());
|
||||
Node node = nodeService.getNodeById(device.getNodeId());
|
||||
if (ObjectUtil.isNotNull(node)) {
|
||||
pqDevice.setNodeName(node.getName());
|
||||
}
|
||||
pqDevice.setPortid(device.getPort());
|
||||
pqDevice.setDevflag(0);
|
||||
pqDevice.setDevSeries(device.getSeries());
|
||||
pqDevice.setDevKey(device.getDevKey());
|
||||
pqDevice.setIp(device.getIp());
|
||||
pqDevice.setDevmodel(device.getDevModel());
|
||||
pqDevice.setCallflag(device.getCallFlag());
|
||||
pqDevice.setDatatype(device.getDevDataType());
|
||||
|
||||
//终端详细信息
|
||||
PqDevicedetail pqDevicedetail = new PqDevicedetail();
|
||||
pqDevicedetail.setDevIndex(devOracleId);
|
||||
pqDevicedetail.setManufacturer(dictName(device.getManufacturer()));
|
||||
pqDevicedetail.setThistimecheck(device.getThisTimeCheck());
|
||||
pqDevicedetail.setNexttimecheck(device.getNextTimeCheck());
|
||||
pqDevicedetail.setElectroplate(device.getElectroplate());
|
||||
pqDevicedetail.setContract(device.getContract());
|
||||
pqDevicedetail.setSim(device.getSim());
|
||||
pqDevicedetail.setDevCatena(device.getDevSeries());
|
||||
pqDevicedetail.setDevLocation(device.getDevLocation());
|
||||
pqDevicedetail.setDevNo(device.getDevNo());
|
||||
pqDevicedetail.setIsAlarm(device.getIsAlarm());
|
||||
deviceDetailList.add(pqDevicedetail);
|
||||
|
||||
//处理母线信息
|
||||
List<PqSubvoltage> pqSubVoltages = new ArrayList<>();
|
||||
for (SubVoltageParam subVoltage : device.getSubVoltageParam()) {
|
||||
//母线
|
||||
PqSubvoltage pqSubvoltage = new PqSubvoltage();
|
||||
pqSubvoltage.setName(subVoltage.getName());
|
||||
pqSubvoltage.setOldName(subVoltage.getOldName());
|
||||
pqSubvoltage.setSubvNum(subVoltage.getNum());
|
||||
pqSubvoltage.setScale(dictName(subVoltage.getScale()));
|
||||
pqSubvoltage.setSubvmodel(subVoltage.getModel());
|
||||
pqSubVoltages.add(pqSubvoltage);
|
||||
//监测点
|
||||
List<PqLine> pqLines = new ArrayList<>();
|
||||
for (LineParam line : subVoltage.getLineParam()) {
|
||||
LineBak byId = lineBakService.getById(line.getLineIndex());
|
||||
if (ObjectUtil.isNotNull(byId)) {
|
||||
//监测点
|
||||
PqLine pqLine = new PqLine();
|
||||
pqLine.setLineIndex(byId.getLineId());
|
||||
pqLine.setName(line.getName());
|
||||
pqLine.setPt1(line.getPt1().doubleValue());
|
||||
pqLine.setPt2(line.getPt2().doubleValue());
|
||||
pqLine.setCt1(line.getCt1().doubleValue());
|
||||
pqLine.setCt2(line.getCt2().doubleValue());
|
||||
pqLine.setDevcmp(line.getDevCapacity().doubleValue());
|
||||
pqLine.setDlcmp(line.getShortCapacity().doubleValue());
|
||||
pqLine.setJzcmp(line.getStandardCapacity().doubleValue());
|
||||
pqLine.setXycmp(line.getDealCapacity().doubleValue());
|
||||
pqLine.setScale(dictName(subVoltage.getScale()));
|
||||
pqLine.setStatus(0);
|
||||
pqLines.add(pqLine);
|
||||
|
||||
PqLinedetail pqLinedetail = new PqLinedetail();
|
||||
pqLinedetail.setLineIndex(byId.getLineId());
|
||||
pqLinedetail.setLineName(line.getName());
|
||||
pqLinedetail.setPttype(line.getPtType());
|
||||
pqLinedetail.setLastTime(device.getLoginTime());
|
||||
pqLinedetail.setTinterval(line.getTimeInterval());
|
||||
pqLinedetail.setLoadtype(dictName(line.getLoadType()));
|
||||
pqLinedetail.setBusinesstype(dictName(line.getBusinessType()));
|
||||
pqLinedetail.setRemark(line.getRemark());
|
||||
pqLinedetail.setMonitorId(line.getMonitorId());
|
||||
pqLinedetail.setPowerid(line.getPowerFlag());
|
||||
pqLinedetail.setObjname(line.getObjName());
|
||||
pqLinedetail.setStatflag(line.getStatFlag());
|
||||
pqLinedetail.setPowerSubstationName(line.getPowerSubstationName());
|
||||
pqLinedetail.setHangLine(line.getHangLine());
|
||||
pqLinedetail.setOwner(line.getOwner());
|
||||
pqLinedetail.setOwnerDuty(line.getOwnerDuty());
|
||||
pqLinedetail.setOwnerTel(line.getOwnerTel());
|
||||
pqLinedetail.setSuperiorsSubstation(line.getSuperiorsSubstation());
|
||||
pqLinedetail.setClassificationGrade(line.getCalssificationGrade());
|
||||
pqLinedetail.setIsGridPoint(1);
|
||||
lineDeatailList.add(pqLinedetail);
|
||||
}
|
||||
}
|
||||
pqSubvoltage.setPqLine(pqLines);
|
||||
|
||||
}
|
||||
pqDevice.setPqSubvoltage(pqSubVoltages);
|
||||
deviceList.add(pqDevice);
|
||||
}
|
||||
|
||||
}
|
||||
update.setPqDevice(deviceList);
|
||||
update.setPqDevicedetail(deviceDetailList);
|
||||
update.setPqLinedetail(lineDeatailList);
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* oracle远程台账同步
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
private SyncLedger oracleSyncLedger(SyncTerminalParam param) {
|
||||
SyncLedger ledger = new SyncLedger();
|
||||
List<Line> data = lineMapper.selectList(new LambdaQueryWrapper<Line>()
|
||||
.eq(Line::getState, DataStateEnum.ENABLE.getCode())
|
||||
.in(Line::getId, Arrays.asList(param.getProjectIndex(),
|
||||
param.getProvinceIndex(),
|
||||
param.getGdIndex()))
|
||||
);
|
||||
|
||||
//项目信息表
|
||||
PqProject pqProject = new PqProject();
|
||||
List<Line> project = data.stream().filter(x -> x.getId().equals(param.getProjectIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(project)) {
|
||||
pqProject.setName(project.get(0).getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.PROJECT_OR_NOT);
|
||||
}
|
||||
ledger.setPqProject(pqProject);
|
||||
|
||||
|
||||
//省级项目表
|
||||
PqProvince pqProvince = new PqProvince();
|
||||
List<Line> province = data.stream().filter(x -> x.getId().equals(param.getProvinceIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(province)) {
|
||||
Area area = areaFeignClient.selectIdArea(province.get(0).getName()).getData();
|
||||
pqProvince.setName(area.getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.PROVINCE_OR_NOT);
|
||||
}
|
||||
ledger.setPqProvince(pqProvince);
|
||||
|
||||
//供电公司表
|
||||
PqGdinformation pqGdinformation = new PqGdinformation();
|
||||
List<Line> gd = data.stream().filter(x -> x.getId().equals(param.getGdIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(gd)) {
|
||||
pqGdinformation.setName(gd.get(0).getName());
|
||||
} else {
|
||||
throw new BusinessException(PvDeviceResponseEnum.GD_OR_NOT);
|
||||
}
|
||||
ledger.setPqGdinformation(pqGdinformation);
|
||||
|
||||
//变电站
|
||||
PqSubstation pqSubstation = new PqSubstation();
|
||||
SubStationParam subStation = param.getSubStationParam();
|
||||
if (ObjectUtil.isNull(subStation)) {
|
||||
//因为查出来的数据电压等级是转换过的所有不需要替换
|
||||
PollutionSubstationDTO sub = lineMapper.getSubstationInfo(param.getSubIndex());
|
||||
subStation = new SubStationParam();
|
||||
subStation.setName(sub.getName());
|
||||
subStation.setScale(sub.getVoltageLevel());
|
||||
subStation.setLng(sub.getLng());
|
||||
subStation.setLat(sub.getLat());
|
||||
}
|
||||
pqSubstation.setName(subStation.getName());
|
||||
pqSubstation.setScale(subStation.getScale());
|
||||
ledger.setPqSubstation(pqSubstation);
|
||||
PqsMap pqsMap = new PqsMap();
|
||||
pqsMap.setLongitude(subStation.getLng().doubleValue());
|
||||
pqsMap.setLatitude(subStation.getLat().doubleValue());
|
||||
pqsMap.setState(1);
|
||||
ledger.setPqsMap(pqsMap);
|
||||
|
||||
//终端
|
||||
PqDevice pqDevice = new PqDevice();
|
||||
DeviceParam device = param.getDeviceParam();
|
||||
pqDevice.setName(device.getName());
|
||||
pqDevice.setStatus(1);
|
||||
pqDevice.setDevtype(dictName(device.getDevType()));
|
||||
pqDevice.setLogontime(device.getLoginTime());
|
||||
pqDevice.setUpdatetime(device.getLoginTime());
|
||||
Node node = nodeService.getNodeById(device.getNodeId());
|
||||
if (ObjectUtil.isNotNull(node)) {
|
||||
pqDevice.setNodeName(node.getName());
|
||||
}
|
||||
pqDevice.setPortid(device.getPort());
|
||||
pqDevice.setDevflag(0);
|
||||
pqDevice.setDevSeries(device.getSeries());
|
||||
pqDevice.setDevKey(device.getDevKey());
|
||||
pqDevice.setIp(device.getIp());
|
||||
pqDevice.setDevmodel(device.getDevModel());
|
||||
pqDevice.setCallflag(device.getCallFlag());
|
||||
pqDevice.setDatatype(device.getDevDataType());
|
||||
ledger.setPqDevice(pqDevice);
|
||||
|
||||
PqDevicedetail pqDevicedetail = new PqDevicedetail();
|
||||
pqDevicedetail.setManufacturer(dictName(device.getManufacturer()));
|
||||
pqDevicedetail.setThistimecheck(device.getThisTimeCheck());
|
||||
pqDevicedetail.setNexttimecheck(device.getNextTimeCheck());
|
||||
pqDevicedetail.setElectroplate(device.getElectroplate());
|
||||
pqDevicedetail.setContract(device.getContract());
|
||||
pqDevicedetail.setSim(device.getSim());
|
||||
pqDevicedetail.setDevCatena(device.getDevSeries());
|
||||
pqDevicedetail.setDevLocation(device.getDevLocation());
|
||||
pqDevicedetail.setDevNo(device.getDevNo());
|
||||
pqDevicedetail.setIsAlarm(device.getIsAlarm());
|
||||
// pqDevicedetail.setOnlineratetj();
|
||||
// pqDevicedetail.setDataplan();
|
||||
// pqDevicedetail.setNewtraffic();
|
||||
// pqDevicedetail.setOntime();
|
||||
// pqDevicedetail.setCheckflag();
|
||||
ledger.setPqDevicedetail(pqDevicedetail);
|
||||
|
||||
//母线
|
||||
PqSubvoltage pqSubvoltage = new PqSubvoltage();
|
||||
SubVoltageParam subVoltage = param.getSubVoltageParam();
|
||||
pqSubvoltage.setName(subVoltage.getName());
|
||||
pqSubvoltage.setSubvNum(subVoltage.getNum());
|
||||
pqSubvoltage.setScale(dictName(subVoltage.getScale()));
|
||||
pqSubvoltage.setSubvmodel(subVoltage.getModel());
|
||||
ledger.setPqSubvoltage(pqSubvoltage);
|
||||
|
||||
//监测点
|
||||
PqLine pqLine = new PqLine();
|
||||
LineParam line = param.getLineParam();
|
||||
pqLine.setName(line.getName());
|
||||
pqLine.setPt1(line.getPt1().doubleValue());
|
||||
pqLine.setPt2(line.getPt2().doubleValue());
|
||||
pqLine.setCt1(line.getCt1().doubleValue());
|
||||
pqLine.setCt2(line.getCt2().doubleValue());
|
||||
pqLine.setDevcmp(line.getDevCapacity().doubleValue());
|
||||
pqLine.setDlcmp(line.getShortCapacity().doubleValue());
|
||||
pqLine.setJzcmp(line.getStandardCapacity().doubleValue());
|
||||
pqLine.setXycmp(line.getDealCapacity().doubleValue());
|
||||
pqLine.setScale(dictName(subVoltage.getScale()));
|
||||
pqLine.setStatus(0);
|
||||
ledger.setPqLine(pqLine);
|
||||
PqLinedetail pqLinedetail = new PqLinedetail();
|
||||
pqLinedetail.setLineName(line.getName());
|
||||
pqLinedetail.setPttype(line.getPtType());
|
||||
pqLinedetail.setLastTime(device.getLoginTime());
|
||||
pqLinedetail.setTinterval(line.getTimeInterval());
|
||||
pqLinedetail.setLoadtype(dictName(line.getLoadType()));
|
||||
pqLinedetail.setBusinesstype(dictName(line.getBusinessType()));
|
||||
pqLinedetail.setRemark(line.getRemark());
|
||||
pqLinedetail.setMonitorId(line.getMonitorId());
|
||||
pqLinedetail.setPowerid(line.getPowerFlag());
|
||||
pqLinedetail.setObjname(line.getObjName());
|
||||
pqLinedetail.setStatflag(line.getStatFlag());
|
||||
pqLinedetail.setPowerSubstationName(line.getPowerSubstationName());
|
||||
pqLinedetail.setHangLine(line.getHangLine());
|
||||
pqLinedetail.setOwner(line.getOwner());
|
||||
pqLinedetail.setOwnerDuty(line.getOwnerDuty());
|
||||
pqLinedetail.setOwnerTel(line.getOwnerTel());
|
||||
pqLinedetail.setSuperiorsSubstation(line.getSuperiorsSubstation());
|
||||
pqLinedetail.setClassificationGrade(line.getCalssificationGrade());
|
||||
pqLinedetail.setIsGridPoint(1);
|
||||
// pqLinedetail.setLineGrade();
|
||||
// pqLinedetail.setWiringDiagram();
|
||||
ledger.setPqLinedetail(pqLinedetail);
|
||||
ledger.setLineNum(line.getNum());
|
||||
return ledger;
|
||||
}
|
||||
|
||||
private String dictName(String dicId) {
|
||||
try {
|
||||
DictData data = dicDataFeignClient.getDicDataById(dicId).getData();
|
||||
return data.getName();
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("字典转换异常");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ public class ResourceServerConfig {
|
||||
return (exchange, e) -> Mono.defer(() -> Mono.just(exchange.getResponse()))
|
||||
.flatMap(response -> {
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
JSONObject jsonObject = WebFluxRequestUtil.getJwtPayload(request);
|
||||
/* JSONObject jsonObject = WebFluxRequestUtil.getJwtPayload(request);
|
||||
if(Objects.isNull(jsonObject)){
|
||||
String ip = WebFluxRequestUtil.getRealIp(request);
|
||||
LogInfoDTO logInfoDTO = new LogInfoDTO(
|
||||
@@ -141,7 +141,7 @@ public class ResourceServerConfig {
|
||||
);
|
||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||
}
|
||||
}*/
|
||||
return ResponseUtils.writeErrorInfo(response, GateWayEnum.ACCESS_TOKEN_EXPIRE_JWT);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ public class IpUtils {
|
||||
public static String getRealIpAddress(ServerHttpRequest request) {
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
String ipAddress = headers.getFirst(HEADER_X_FORWARDED_FOR);
|
||||
// log.error("X-Forwarded-For:"+ipAddress);
|
||||
//ipAddress = headers.getFirst("X-Real-IP");
|
||||
// log.error("X-Real-IP:"+ipAddress);
|
||||
//ipAddress = headers.getFirst("Proxy-Client-IP");
|
||||
// log.error("Proxy-Client-IP:"+ipAddress);
|
||||
//ipAddress = headers.getFirst("REMOTE-HOST");
|
||||
// log.error("REMOTE-HOST:"+ipAddress);
|
||||
log.error("X-Forwarded-For:"+ipAddress);
|
||||
ipAddress = headers.getFirst("X-Real-IP");
|
||||
log.error("X-Real-IP:"+ipAddress);
|
||||
ipAddress = headers.getFirst("Proxy-Client-IP");
|
||||
log.error("Proxy-Client-IP:"+ipAddress);
|
||||
ipAddress = headers.getFirst("REMOTE-HOST");
|
||||
log.error("REMOTE-HOST:"+ipAddress);
|
||||
if (StrUtil.isBlankIfStr(ipAddress) || UNKNOWN.equalsIgnoreCase(ipAddress)) {
|
||||
ipAddress = headers.getFirst(HEADER_PROXY_CLIENT_IP);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,9 @@ whitelist:
|
||||
- /pqs-auth/oauth/autoLogin
|
||||
- /pqs-auth/auth/getImgCode
|
||||
- /pqs-auth/oauth/getPublicKey
|
||||
- /pqs-auth/judgeToken/heBei
|
||||
- /pqs-auth/judgeToken/guangZhou
|
||||
|
||||
- /webjars/**
|
||||
- /doc.html
|
||||
- /swagger-resources/**
|
||||
@@ -221,6 +223,7 @@ whitelist:
|
||||
- /favicon.ico
|
||||
- /system-boot/theme/getTheme
|
||||
- /system-boot/image/toStream
|
||||
- /system-boot/file/download
|
||||
- /cs-system-boot/appinfo/queryAppInfoByType
|
||||
- /system-boot/dictType/dictDataCache
|
||||
- /system-boot/file/**
|
||||
@@ -237,8 +240,8 @@ whitelist:
|
||||
# - /harmonic-prepare/**
|
||||
# - /process-boot/**
|
||||
# - /bpm-boot/**
|
||||
- /system-boot/**
|
||||
- /supervision-boot/**
|
||||
# - /system-boot/**
|
||||
# - /supervision-boot/**
|
||||
# - /user-boot/**
|
||||
# - /harmonic-boot/**
|
||||
# - /cs-device-boot/**
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.harmonic.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.api.fallback.PmsTemProcessReportFallbackFactory;
|
||||
import com.njcn.harmonic.api.fallback.UploadGwDataFallbackFactory;
|
||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
*/
|
||||
@FeignClient(
|
||||
value = ServerInfo.HARMONIC,
|
||||
path = "/process/pmsTemProcessReport",
|
||||
fallbackFactory = PmsTemProcessReportFallbackFactory.class,
|
||||
contextId = "pmsTemProcessReport")
|
||||
public interface PmsTemProcessReportFeignClient {
|
||||
|
||||
|
||||
|
||||
@PostMapping("/dayCalReport")
|
||||
HttpResult<Boolean> dayCalReport() ;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.harmonic.api;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.harmonic.api.fallback.UploadGwDataFallbackFactory;
|
||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -28,6 +29,9 @@ public interface UploadGwDataFeignClient {
|
||||
HttpResult<String> uploadEvaluationData(@RequestBody UploadParam param);
|
||||
|
||||
@PostMapping("/upGwCommPoint")
|
||||
HttpResult<String> upGwCommPoint(@RequestBody UploadParam param);
|
||||
HttpResult<String> upGwCommPoint(@RequestBody UploadDataParam param);
|
||||
|
||||
@PostMapping("/upGwMainMonitor")
|
||||
HttpResult<String> upGwMainMonitor(@RequestBody UploadDataParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.harmonic.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.harmonic.api.PmsTemProcessReportFeignClient;
|
||||
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.harmonic.utils.HarmonicEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @date 2023年12月15日 13:50
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PmsTemProcessReportFallbackFactory implements FallbackFactory<PmsTemProcessReportFeignClient> {
|
||||
@Override
|
||||
public PmsTemProcessReportFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = HarmonicEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PmsTemProcessReportFeignClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> dayCalReport() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "电能质量全过程月报", throwable.toString());
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadDataParam;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.harmonic.utils.HarmonicEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -47,10 +48,16 @@ public class UploadGwDataFallbackFactory implements FallbackFactory<UploadGwData
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> upGwCommPoint(UploadParam param) {
|
||||
public HttpResult<String> upGwCommPoint(UploadDataParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-公共连接点数据", throwable.toString());
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> upGwMainMonitor(UploadDataParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-主网测点数据", throwable.toString());
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.njcn.harmonic.pojo.dto.upload;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用于河北上送主网测点信息至国网
|
||||
*/
|
||||
@Data
|
||||
public class RUploadMainMonitorDataDTO {
|
||||
|
||||
|
||||
private String objId;
|
||||
private String provinceOrg;
|
||||
private String provinceOrgName;
|
||||
private String cityOrg;
|
||||
private String cityOrgName;
|
||||
private String maintOrg;
|
||||
private String maintOrgName;
|
||||
private String monitorName;
|
||||
private String monitorVoltageLevel;
|
||||
private String monitorId;
|
||||
private String monitorStatus;
|
||||
private Date monitorOperateDate;
|
||||
private Date monitorStopDate;
|
||||
private String substationId;
|
||||
private String substationName;
|
||||
private String busId;
|
||||
private String busName;
|
||||
private String outLineIntervalId;
|
||||
private String outLineIntervalName;
|
||||
private String monitorObjTypeBig;
|
||||
private String monitorObjTypeSmall;
|
||||
private String monitorTag;
|
||||
private String monitorObjName;
|
||||
private String monitorObjId;
|
||||
private String isLine;
|
||||
private BigDecimal minShortCapacity;
|
||||
private BigDecimal supplyEquipCapacity;
|
||||
private BigDecimal userProtocolCapacity;
|
||||
private String terminalCode;
|
||||
private String terminalManufacturer;
|
||||
private String terminalModel;
|
||||
private String terminalManufactureNum;
|
||||
private String terminalConnect;
|
||||
private String neutralGround;
|
||||
private String evtType;
|
||||
/**
|
||||
* 统计日期
|
||||
*/
|
||||
private String statisticalDate;
|
||||
|
||||
/**
|
||||
* 统计类型(01:年 02:月 03:日)
|
||||
*/
|
||||
private String statisticalType;
|
||||
|
||||
|
||||
/**
|
||||
* 监测点是否在线
|
||||
*/
|
||||
private String isMonitorOnline;
|
||||
|
||||
/**
|
||||
* 监测终端是否在线
|
||||
*/
|
||||
private String isTerminalOnline;
|
||||
|
||||
/**
|
||||
* 在线监测点数量
|
||||
*/
|
||||
private Integer onlineMonitorNum;
|
||||
|
||||
/**
|
||||
* 在运监测点数量
|
||||
*/
|
||||
private Integer runMonitorNum;
|
||||
|
||||
/**
|
||||
* 监测点在线率
|
||||
*/
|
||||
private BigDecimal onlineMonitorRate;
|
||||
|
||||
/**
|
||||
* 应收采集数
|
||||
*/
|
||||
private Long expectCollectNum;
|
||||
|
||||
/**
|
||||
* 实收采集数
|
||||
*/
|
||||
private Long actualCollectNum;
|
||||
|
||||
/**
|
||||
* 监测数据完整率
|
||||
*/
|
||||
private BigDecimal dataFullRate;
|
||||
|
||||
/**
|
||||
* 计算日期(用于记录算法执行日期)
|
||||
*/
|
||||
private LocalDate computeDate;
|
||||
|
||||
/**
|
||||
* 上送状态
|
||||
*/
|
||||
private Integer uploadStatus;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.njcn.harmonic.pojo.param.upload;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量全过程跟踪数据
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2024-10-09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PmsTemProcessApprovalParam {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String objId;
|
||||
|
||||
/**
|
||||
* 关联临时用户档案主键
|
||||
*/
|
||||
@NotBlank(message = "关联临时用户档案不可为空")
|
||||
private String tempUserDossierId;
|
||||
|
||||
private String tempUserDossierName;
|
||||
|
||||
/**
|
||||
* 验收参与人
|
||||
*/
|
||||
@NotBlank(message = "验收参与人不可为空")
|
||||
private String approvalJoinUserId;
|
||||
|
||||
/**
|
||||
* 验收参与人名称
|
||||
*/
|
||||
private String approvalJoinUserName;
|
||||
|
||||
/**
|
||||
* 验收建议
|
||||
*/
|
||||
private String approvalAdvise;
|
||||
|
||||
|
||||
/**
|
||||
* 遗留问题
|
||||
*/
|
||||
@NotBlank(message = "遗留问题不可为空")
|
||||
private String legacyProblem;
|
||||
|
||||
/**
|
||||
* 整改状态(是否整改)
|
||||
*/
|
||||
@NotBlank(message = "整改状态不可为空")
|
||||
private String rectificationStatus;
|
||||
|
||||
/**
|
||||
* 整改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime rectificationTime;
|
||||
|
||||
/**
|
||||
* 整改人
|
||||
*/
|
||||
private String rectificationUserId;
|
||||
|
||||
/**
|
||||
* 整改人名称
|
||||
*/
|
||||
private String rectificationUserName;
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
*/
|
||||
private String rectificationMeasure;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryPmsTemProcessApprovalParam extends BaseParam {
|
||||
|
||||
private String objId;
|
||||
|
||||
private String tempUserDossierId;
|
||||
|
||||
/**
|
||||
* 运维单位
|
||||
*/
|
||||
private String maintOrg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
package com.njcn.harmonic.pojo.param.upload;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量全过程跟踪数据
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2024-10-09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PmsTemProcessTrackParam {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private String objId;
|
||||
|
||||
/**
|
||||
* 关联临时用户档案主键
|
||||
*/
|
||||
private String tempUserDossierId;
|
||||
|
||||
/**
|
||||
* 项目阶段
|
||||
*/
|
||||
private String proStage;
|
||||
|
||||
/**
|
||||
* 规划可研-评估状态
|
||||
*/
|
||||
private String auditStatus;
|
||||
|
||||
/**
|
||||
* 规划可研-评估结论
|
||||
*/
|
||||
private String auditResult;
|
||||
|
||||
/**
|
||||
* 规划可研-审查人
|
||||
*/
|
||||
private String auditUserId;
|
||||
|
||||
/**
|
||||
* 规划可研-审查人名称
|
||||
*/
|
||||
private String auditUserName;
|
||||
|
||||
/**
|
||||
* 规划可研-审查时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
/**
|
||||
* 竣工验收-验收状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 竣工验收-验收结论
|
||||
*/
|
||||
private String approvalResult;
|
||||
|
||||
/**
|
||||
* 竣工验收-验收负责人
|
||||
*/
|
||||
private String approvalDutyUserId;
|
||||
|
||||
/**
|
||||
* 竣工验收-验收负责人名称
|
||||
*/
|
||||
private String approvalDutyUserName;
|
||||
|
||||
/**
|
||||
* 竣工验收-验收时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime approvalTime;
|
||||
|
||||
/**
|
||||
* 营销用户编号
|
||||
*/
|
||||
private String consNo;
|
||||
|
||||
/**
|
||||
* 试运行-是否超标
|
||||
*/
|
||||
private String testIsOv;
|
||||
|
||||
/**
|
||||
* 总超标天数
|
||||
*/
|
||||
private Integer allOvCountDay;
|
||||
|
||||
/**
|
||||
* 监测天数
|
||||
*/
|
||||
private Integer monitorDay;
|
||||
|
||||
/**
|
||||
* 开始监测日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate startMonitorDate;
|
||||
|
||||
/**
|
||||
* 关联监测点
|
||||
*/
|
||||
private String monitorIds;
|
||||
|
||||
/**
|
||||
* 投运日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate operateDate;
|
||||
|
||||
/**
|
||||
* 运行天数
|
||||
*/
|
||||
private Integer testRunDay;
|
||||
|
||||
/**
|
||||
* 审查完成时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime auditFinalTime;
|
||||
|
||||
/**
|
||||
* 审查出具单位名称
|
||||
*/
|
||||
private String auditIssueOrgName;
|
||||
|
||||
/**
|
||||
* 电能质量专业审查意见
|
||||
*/
|
||||
private String professionalAuditOpinion;
|
||||
|
||||
/**
|
||||
* 审查单位
|
||||
*/
|
||||
private String auditOrg;
|
||||
|
||||
/**
|
||||
* 审查单位名称
|
||||
*/
|
||||
private String auditOrgName;
|
||||
|
||||
/**
|
||||
* 验收完成时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime approvalFinalTime;
|
||||
|
||||
/**
|
||||
* 遗留问题
|
||||
*/
|
||||
private String legacyProblem;
|
||||
|
||||
/**
|
||||
* 验收建议
|
||||
*/
|
||||
private String approvalAdvise;
|
||||
|
||||
/**
|
||||
* 验收参与人名称
|
||||
*/
|
||||
private String approvalJoinUserName;
|
||||
|
||||
/**
|
||||
* 关联营销档案时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime relConsTime;
|
||||
|
||||
/**
|
||||
* 操作人名称
|
||||
*/
|
||||
private String operateUserName;
|
||||
|
||||
/**
|
||||
* 测试结论
|
||||
*/
|
||||
private String testResult;
|
||||
|
||||
/**
|
||||
* 试运行出具单位名称
|
||||
*/
|
||||
private String testRunIssueOrgName;
|
||||
|
||||
/**
|
||||
* 越限指标
|
||||
*/
|
||||
private String ovIndexs;
|
||||
|
||||
/**
|
||||
* 监测日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime monitorDate;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String consObjId;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UpdatePmsTemProcessTrackParam extends PmsTemProcessTrackParam {
|
||||
|
||||
private String objId;
|
||||
}
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryPmsTemProcessTrackParam extends BaseParam {
|
||||
|
||||
private String objId;
|
||||
|
||||
private String tempUserDossierId;
|
||||
|
||||
/**
|
||||
* 运维单位
|
||||
*/
|
||||
private String maintOrg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package com.njcn.harmonic.pojo.param.upload;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.device.pms.pojo.param.PmsParkParam;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 电能质量全过程管理用户
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2024-10-09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class PmsTemUserParam {
|
||||
|
||||
|
||||
private String objId;
|
||||
|
||||
/**
|
||||
* 所属网省
|
||||
*/
|
||||
private String provinceOrg;
|
||||
|
||||
/**
|
||||
* 所属网省名称
|
||||
*/
|
||||
private String provinceOrgName;
|
||||
|
||||
/**
|
||||
* 所属地市
|
||||
*/
|
||||
private String cityOrg;
|
||||
|
||||
/**
|
||||
* 所属地市名称
|
||||
*/
|
||||
private String cityOrgName;
|
||||
|
||||
/**
|
||||
* 运维单位
|
||||
*/
|
||||
@NotBlank(message = "单位不可为空")
|
||||
private String maintOrg;
|
||||
|
||||
/**
|
||||
* 运维单位名称
|
||||
*/
|
||||
private String maintOrgName;
|
||||
|
||||
/**
|
||||
* 用户/项目名称
|
||||
*/
|
||||
@NotBlank(message = "用户/项目名称不可为空")
|
||||
private String consName;
|
||||
|
||||
/**
|
||||
* 干扰源类型
|
||||
*/
|
||||
@NotBlank(message = "干扰源类型不可为空")
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 干扰源类别
|
||||
*/
|
||||
@NotBlank(message = "干扰源类别不可为空")
|
||||
private String sourceCategory;
|
||||
|
||||
/**
|
||||
* 场站属性
|
||||
*/
|
||||
@NotBlank(message = "场站属性不可为空")
|
||||
private String sourceAttr;
|
||||
|
||||
/**
|
||||
* 并网/供电电压等级
|
||||
*/
|
||||
@NotBlank(message = "并网/供电电压等级不可为空")
|
||||
private String gcVoltageLevel;
|
||||
|
||||
/**
|
||||
* 并网/供电变电站
|
||||
*/
|
||||
private String gcSubstationId;
|
||||
/**
|
||||
* 并网/供电变电站名称
|
||||
*/
|
||||
@NotBlank(message = "并网/供电变电站不可为空")
|
||||
private String gcSubstationName;
|
||||
|
||||
/**
|
||||
* 并网/供电变电站电压等级
|
||||
*/
|
||||
@NotBlank(message = "并网/供电变电站电压等级不可为空")
|
||||
private String gcSubstationVoltageLevel;
|
||||
|
||||
/**
|
||||
* 并网/供电线路
|
||||
*/
|
||||
private String gcFeederId;
|
||||
|
||||
/**
|
||||
* 并网/供电线路名称
|
||||
*/
|
||||
private String gcFeederName;
|
||||
|
||||
/**
|
||||
* 总装机容量(MVA)
|
||||
*/
|
||||
@NotNull(message = "总装机容量(MVA)不可为空")
|
||||
private Double ratedCapacity;
|
||||
|
||||
/**
|
||||
* 档案状态
|
||||
*/
|
||||
@NotBlank(message = "档案状态不可为空")
|
||||
private String userDossierStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
private String releaseUserName;
|
||||
|
||||
/**
|
||||
* 所属电站类型
|
||||
*/
|
||||
private String gcSubstationType;
|
||||
|
||||
/**
|
||||
* 投运日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate operateTime;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime releaseTime;
|
||||
|
||||
/**
|
||||
* 营销用户编号
|
||||
*/
|
||||
private String consNo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String consObjId;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UpdatePmsTemUserParam extends PmsTemUserParam {
|
||||
@NotBlank(message = "主键索引不可为空")
|
||||
private String objId;
|
||||
}
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryPmsTemUserParam extends BaseParam {
|
||||
|
||||
private String objId;
|
||||
|
||||
/**
|
||||
* 运维单位
|
||||
*/
|
||||
private String maintOrg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_global_d")
|
||||
@Deprecated
|
||||
public class RDimBusGlobalD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_global_m")
|
||||
@Deprecated
|
||||
public class RDimBusGlobalM{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_global_y")
|
||||
@Deprecated
|
||||
public class RDimBusGlobalY {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_station_event_d")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_station_event_m")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventM{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.time.LocalDate;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_station_event_startis_d")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventStartisDPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.time.LocalDate;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_station_event_startis_m")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventStartisMPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -17,6 +17,7 @@ import java.time.LocalDate;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_station_event_startis_y")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventStartisYPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_bus_station_event_y")
|
||||
@Deprecated
|
||||
public class RDimBusStationEventY {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -21,6 +21,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_target_d")
|
||||
@Deprecated
|
||||
public class RDimBusTargetDPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -21,6 +21,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_target_m")
|
||||
@Deprecated
|
||||
public class RDimBusTargetMPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -21,6 +21,7 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "r_dim_bus_target_y")
|
||||
@Deprecated
|
||||
public class RDimBusTargetYPO {
|
||||
@MppMultiId(value = "Org_Id")
|
||||
private String orgId;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_dim_obj_event_d")
|
||||
@Deprecated
|
||||
public class RDimObjEventD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_dim_obj_event_m")
|
||||
@Deprecated
|
||||
public class RDimObjEventM {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_dim_obj_event_y")
|
||||
@Deprecated
|
||||
public class RDimObjEventY {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.time.LocalDate;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_global_d")
|
||||
@Deprecated
|
||||
public class RDimObjGlobalD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.time.LocalDate;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_global_m")
|
||||
@Deprecated
|
||||
public class RDimObjGlobalM {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.time.LocalDate;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_global_y")
|
||||
@Deprecated
|
||||
public class RDimObjGlobalY {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_rate_d")
|
||||
@Deprecated
|
||||
public class RDimObjRateD{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_rate_m")
|
||||
@Deprecated
|
||||
public class RDimObjRateM{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_rate_y")
|
||||
@Deprecated
|
||||
public class RDimObjRateY{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_target_d")
|
||||
@Deprecated
|
||||
public class RDimObjTargetD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.time.LocalDate;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_target_m")
|
||||
@Deprecated
|
||||
public class RDimObjTargetM {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.time.LocalDate;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_obj_target_y")
|
||||
@Deprecated
|
||||
public class RDimObjTargetY {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -20,6 +20,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_station_base_d")
|
||||
@Deprecated
|
||||
public class RDimStationBaseD extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_station_global_d")
|
||||
@Deprecated
|
||||
public class RDimStationGlobalD extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -19,6 +19,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("r_dim_station_global_m")
|
||||
@Deprecated
|
||||
public class RDimStationGlobalM extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user