Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f84e6a4c41 | |||
|
|
8457222f85 | ||
|
|
74808dbd05 | ||
| 5f1f42f8d7 | |||
| 3ac18b896a | |||
| f86e7f0183 | |||
|
|
c99a97fff1 | ||
|
|
0f712c45fd | ||
|
|
d738116968 | ||
|
|
e322eb2413 | ||
|
|
0200607c0c | ||
|
|
a6c536cf45 | ||
|
|
e61269e489 | ||
|
|
01e95e71fb | ||
|
|
b4f4037987 | ||
| a5be610a6a | |||
| f8e88b87d0 | |||
|
|
6ee4da4422 | ||
|
|
20e1b8cce7 | ||
|
|
b3b5e64e07 | ||
| 6df4074c59 | |||
| 2c3f04fc82 | |||
| cc52561395 | |||
|
|
a797381a7d | ||
| 99eff7d3d2 | |||
|
|
37c6e52281 | ||
|
|
533cf97495 | ||
|
|
1f96e18d65 | ||
| 295fddb935 | |||
|
|
7f6aa6f683 | ||
|
|
21035dc71b | ||
|
|
e2bbfb5e08 | ||
|
|
dddce82829 | ||
|
|
fa90fd7aaa | ||
|
|
5f2bb475cb | ||
|
|
64cf03d01c | ||
|
|
9a8742b02c | ||
|
|
f2e50dd100 | ||
| 228a8558ac | |||
|
|
14707fe3e9 | ||
|
|
b5ee0a5182 | ||
|
|
a5a1f58d30 | ||
|
|
400b8cde31 | ||
|
|
7220c526ce | ||
| d14e83c935 | |||
|
|
0b930f1adf | ||
|
|
848bb5f6b0 | ||
|
|
601ae475e0 | ||
|
|
dd2f738c00 | ||
|
|
bc3702b1f1 | ||
|
|
014afd0a2a | ||
|
|
f7c0045cf4 | ||
| 9a65c1b133 | |||
|
|
9da41273e5 | ||
|
|
e2ecf7bb04 | ||
| 4d0490994a | |||
| e94beddcff | |||
|
|
6a1bd88ab8 | ||
|
|
169b701fa9 | ||
| 6a97015cd6 | |||
|
|
b2ab4ee825 | ||
|
|
cc85660043 | ||
|
|
4f7b444737 | ||
| e729485d25 | |||
| f701507fae | |||
| 149d017c49 | |||
| 11116929cc | |||
| e4049de260 | |||
| b4be12e30e | |||
| 1b169830f9 | |||
| 417b36c884 |
@@ -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","/judgeToken/heBei","/oauth/autoLogin").permitAll()
|
||||
.antMatchers("/oauth/getPublicKey","/oauth/logout","/auth/getImgCode","/judgeToken/guangZhou","/judgeToken/heBei","/oauth/autoLogin","/judgeToken/productionManagementCheck").permitAll()
|
||||
// @link https://gitee.com/xiaoym/knife4j/issues/I1Q5X6 (接口文档knife4j需要放行的规则)
|
||||
.antMatchers("/webjars/**","/doc.html","/swagger-resources/**","/v2/api-docs").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
|
||||
@@ -76,6 +76,93 @@ public class JudgeThirdToken extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生产管理系统token校验
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/productionManagementCheck")
|
||||
@ApiOperation("生产管理系统token校验")
|
||||
@ApiImplicitParam(name = "token", required = true)
|
||||
public HttpResult<Object> productionManagementCheck (String token) {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
String methodDescribe = getMethodDescribe("productionManagementCheck");
|
||||
LogUtil.njcnDebug(log, "{},token:{}", methodDescribe, token);
|
||||
|
||||
// 请求地址
|
||||
String url = "http://10.120.192.72:80/head-auth-service/oauth/check_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);
|
||||
|
||||
/**
|
||||
* 成功
|
||||
* {
|
||||
* "sub": "40a21660947c44a6a40030109214f313",
|
||||
* "ver": "JWT1.0",
|
||||
* "user_name": "web",
|
||||
* "pri": [
|
||||
* "MASTER_ADMIN",
|
||||
* "znxs",
|
||||
* "root",
|
||||
* "ADMIN"
|
||||
* ],
|
||||
* "last_login": 1744875032,
|
||||
* "scope": [
|
||||
* "all"
|
||||
* ],
|
||||
* "iss": "nrec",
|
||||
* "active": true,
|
||||
* "exp": 1744961431,
|
||||
* "jti": "32add77a-43f0-4d67-82a2-8376fed6fc3d",
|
||||
* "client_id": "frontend"
|
||||
* }
|
||||
*
|
||||
* 失败
|
||||
*
|
||||
* {
|
||||
* "msg": "Cannot convert access token to JSON",
|
||||
* "path": "/auth-service/oauth/check_token",
|
||||
* "code": "2500",
|
||||
* "succ": false,
|
||||
* "error": "Internal Server Error",
|
||||
* "timestamp": 1744879150627
|
||||
* }
|
||||
*/
|
||||
|
||||
// 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
|
||||
try {
|
||||
String result = restTemplate.postForObject(url, request, String.class);
|
||||
JSONObject resultJson = new JSONObject(result);
|
||||
if (resultJson.containsKey("code")) {
|
||||
//失败
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.info(e.toString());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/heBei")
|
||||
|
||||
@@ -143,13 +143,15 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
|
||||
//流程状态排除不通过的,不通过会放在待办中,一直到该流程通过
|
||||
processInstanceQuery.variableValueNotEquals(BpmConstants.PROCESS_INSTANCE_VARIABLE_STATUS, BpmTaskStatusEnum.REJECT.getStatus());
|
||||
|
||||
|
||||
if (Objects.nonNull(bpmProcessInstancePageParam.getSearchBeginTime()) && Objects.nonNull(bpmProcessInstancePageParam.getSearchEndTime())) {
|
||||
String beginTimeStr = bpmProcessInstancePageParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmProcessInstancePageParam.getSearchEndTime();
|
||||
LocalDateTime beginTime = LocalDateTimeUtil.parse(beginTimeStr, DatePattern.NORM_DATE_PATTERN);
|
||||
LocalDateTime endTime = PubUtils.endTimeToLocalDateTime(endTimeStr);
|
||||
processInstanceQuery.startedBefore(DateUtils.of(endTime));
|
||||
processInstanceQuery.startedAfter(DateUtils.of(beginTime));
|
||||
}
|
||||
|
||||
// 查询数量
|
||||
long processInstanceCount = processInstanceQuery.count();
|
||||
if (processInstanceCount == 0) {
|
||||
|
||||
@@ -142,12 +142,14 @@ public class BpmTaskServiceImpl implements IBpmTaskService {
|
||||
if (StrUtil.isNotBlank(bpmTaskQueryParam.getSearchValue())) {
|
||||
taskQuery.processDefinitionNameLike("%" + bpmTaskQueryParam.getSearchValue() + "%");
|
||||
}
|
||||
if (Objects.nonNull(bpmTaskQueryParam.getSearchBeginTime()) && Objects.nonNull(bpmTaskQueryParam.getSearchEndTime())) {
|
||||
String beginTimeStr = bpmTaskQueryParam.getSearchBeginTime();
|
||||
String endTimeStr = bpmTaskQueryParam.getSearchEndTime();
|
||||
LocalDateTime beginTime = LocalDateTimeUtil.parse(beginTimeStr, DatePattern.NORM_DATE_PATTERN);
|
||||
LocalDateTime endTime = PubUtils.endTimeToLocalDateTime(endTimeStr);
|
||||
taskQuery.taskCreatedBefore(DateUtils.of(endTime));
|
||||
taskQuery.taskCreatedAfter(DateUtils.of(beginTime));
|
||||
}
|
||||
// 执行查询
|
||||
long count = taskQuery.count();
|
||||
if (count == 0) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public class GenerateCode {
|
||||
|
||||
private static final String TARGET_DIR = "D://code";
|
||||
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqsinfo_zl";
|
||||
private static final String DB_URL = "jdbc:mysql://192.168.1.24:13306/pqs9100";
|
||||
// private static final String DB_URL = "jdbc:oracle:thin:@192.168.1.170:1521:pqsbase";
|
||||
|
||||
private static final String USERNAME = "root";
|
||||
@@ -30,9 +30,9 @@ public class GenerateCode {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<Module> modules = Stream.of(
|
||||
new Module("xy", "com.njcn.supervision", "survey", Stream.of(
|
||||
"app_version"
|
||||
).collect(Collectors.toList()), "supervision_")
|
||||
new Module("hongawen", "com.njcn.gather", "", Stream.of(
|
||||
"pq_dev_type"
|
||||
).collect(Collectors.toList()), "pq_")
|
||||
).collect(Collectors.toList());
|
||||
generateJavaFile(modules);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public interface PatternRegex {
|
||||
/**
|
||||
* 描述32
|
||||
*/
|
||||
String DES32_REGEX = "^.{0,10}$";
|
||||
String DES32_REGEX = "^.{0,32}$";
|
||||
|
||||
/**
|
||||
* 描述64
|
||||
|
||||
@@ -51,5 +51,16 @@ public interface ServerInfo {
|
||||
|
||||
String DATA_PLATFORM = "data-platform-boot";
|
||||
|
||||
String PLATFORM_STAT_BOOT = "stat-boot";
|
||||
|
||||
String PLATFORM_RT_BOOT = "rt-boot";
|
||||
String PLATFORM_EVENT_BOOT = "event-boot";
|
||||
|
||||
String PLATFORM_DATA_PROCESSING_BOOT = "data-processing-boot";
|
||||
|
||||
String PLATFORM_MESSAGE_BOOT = "message-boot";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package com.njcn.common.utils;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.echarts.json.LineGenerator;
|
||||
import com.njcn.echarts.json.PieGenerator;
|
||||
import com.njcn.web.utils.RestTemplateUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
@@ -23,7 +24,8 @@ import java.util.*;
|
||||
public class DrawPicUtil {
|
||||
|
||||
//目前写死,后续作为配置
|
||||
private final String URL = "http://192.168.1.24:5174/picture";
|
||||
@Value("${DrawPicUtil.URL:http://192.168.1.24:5174/picture}")
|
||||
private String URL;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
30
pqs-common/common-echarts/src/main/resources/bootstrap.yml
Normal file
30
pqs-common/common-echarts/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
spring:
|
||||
#nacos注册中心以及配置中心的指定
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: @service.server.url@
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -400,6 +400,7 @@ public class ExcelUtil {
|
||||
* @param pullDowns
|
||||
*/
|
||||
private static void setTopLevel(Workbook workbook, List<PullDown> pullDowns) {
|
||||
if(CollUtil.isNotEmpty(pullDowns)){
|
||||
int num = 0;
|
||||
for (PullDown pullDown : pullDowns) {
|
||||
if (!pullDown.getIsText()) {
|
||||
@@ -437,6 +438,8 @@ public class ExcelUtil {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取根据数值获取列字母(1=A,2=B,3=C,.......,27=AA)
|
||||
*
|
||||
|
||||
@@ -78,7 +78,9 @@ public class Knife4jSwaggerConfig {
|
||||
"com.njcn.cloud.controller",
|
||||
"com.njcn.zlevent.controller",
|
||||
"com.njcn.prepare",
|
||||
"com.njcn.supervision.controller"
|
||||
"com.njcn.supervision.controller",
|
||||
"com.njcn.algorithm",
|
||||
"com.njcn.dataProcess"
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
List<GrantType> grantTypes = new ArrayList<>();
|
||||
|
||||
@@ -30,7 +30,7 @@ public enum GWSendEnum {
|
||||
//接收电能质量监测点限值台账数据接口
|
||||
LIMIT_CREATE("pqLimitCreate", "/WMCenter/powerQuality/monitor/limitCreate"),
|
||||
//接收电能质量主配网监测点统计数据接口
|
||||
STATISTICAL_CREATE("pqMonitorStatisticalCreate", "/WMCenter/powerQuality/monitor/statisticalCreate"),
|
||||
STATISTICAL_CREATE("pqMonitorStatisticalCreate", "/powerQuality/monitor/statisticalCreate"),
|
||||
//接收电能质量换流站指标汇总统计数据接口
|
||||
INDEX_CREATE("pqConverterIndexCreate", "/WMCenter/powerQuality/converterMonitor/indexCreate"),
|
||||
//接收电能质量换流站指标统计明细数据接口
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -36,6 +37,14 @@ public interface CommLineClient {
|
||||
@GetMapping("/getLineDetail")
|
||||
HttpResult<LineDTO> getLineDetail(@RequestParam("id") String id);
|
||||
|
||||
/**
|
||||
* 获取污区值监测点相关信息
|
||||
*
|
||||
* @author hongawen
|
||||
*/
|
||||
@GetMapping("/getPollutionLineInfo")
|
||||
HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id);
|
||||
|
||||
/***
|
||||
* 批量获取监测点信息
|
||||
* @author hongawen
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,6 +40,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(List<String> id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取污区值监测点相关信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<LineDTO>> getLineDetailBatch(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "批量获取监测点信息", throwable.toString());
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.device.biz.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PollutionLineInfoDTO {
|
||||
|
||||
/**
|
||||
* 供电公司名称
|
||||
*/
|
||||
private String gdName;
|
||||
|
||||
/**
|
||||
* 所属变电站
|
||||
*/
|
||||
private String subStationName;
|
||||
|
||||
/**
|
||||
* 终端名称
|
||||
*/
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
* 终端厂家
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 通讯状态
|
||||
*/
|
||||
private Integer comFlag;
|
||||
|
||||
/**
|
||||
* 终端投运时间
|
||||
*/
|
||||
private String loginTime;
|
||||
|
||||
/**
|
||||
* 位置,电网侧&非电网侧
|
||||
*/
|
||||
private String powerFlag;
|
||||
|
||||
/**
|
||||
* 行业类型
|
||||
*/
|
||||
private String businessType;
|
||||
|
||||
/**
|
||||
* 干扰源类型
|
||||
*/
|
||||
private String loadType;
|
||||
|
||||
/**
|
||||
* 监测id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测对象
|
||||
*/
|
||||
private String objName;
|
||||
|
||||
/**
|
||||
* 变电站
|
||||
*/
|
||||
private String powerSubstationName;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private String lineVoltage;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 上送国网编号
|
||||
*/
|
||||
private String monitorId;
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pms.pojo.dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -28,7 +29,7 @@ public class PushMonitorDTO {
|
||||
private String customName;
|
||||
private String status;
|
||||
private Date ctime;
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
private String lineId;
|
||||
private String chv;
|
||||
private String chi;
|
||||
|
||||
@@ -32,6 +32,8 @@ public class TerminalQueryParam extends BaseParam {
|
||||
@ApiModelProperty(value = "监测对象类型")
|
||||
private String objType;
|
||||
|
||||
private List<String> objTypeList;
|
||||
|
||||
@ApiModelProperty(value = "是否上送国网监测点")
|
||||
private Integer isUpToGrid;
|
||||
|
||||
|
||||
@@ -3,10 +3,13 @@ package com.njcn.device.pms.pojo.po;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
@@ -72,16 +75,34 @@ public class Monitor extends BaseEntity {
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 监测线路ID
|
||||
* 监测母线
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 监测线路号
|
||||
*/
|
||||
private Integer lineNum;
|
||||
|
||||
/**
|
||||
* 投运日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate putDate;
|
||||
|
||||
/**
|
||||
* 中台母线ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String busId;
|
||||
|
||||
|
||||
/**
|
||||
* 中台母线ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String midStation;
|
||||
|
||||
/**
|
||||
* 电压等级(字典)
|
||||
*/
|
||||
@@ -190,7 +211,6 @@ public class Monitor extends BaseEntity {
|
||||
* 监测终端接线方式(字典)
|
||||
*/
|
||||
private String terminalWiringMethod;
|
||||
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
|
||||
@@ -28,10 +28,19 @@ public class MonitorStatisticsController extends BaseController {
|
||||
|
||||
@PostMapping("/objType")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("国网上送接口")
|
||||
public HttpResult< List<List<String>>> objType(String deptId){
|
||||
@ApiOperation("查询主网用户分类")
|
||||
public HttpResult< List<List<String>>> objType(String deptId,Integer up){
|
||||
String methodDescribe = getMethodDescribe("objType");
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId);
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.getGwMonitorStatistics(deptId,up);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/objTypeStatis")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询主网用户分类")
|
||||
public HttpResult< List<List<String>>> objTypeStatis(String deptId){
|
||||
String methodDescribe = getMethodDescribe("objTypeStatis");
|
||||
List<List<String>> gwMonitorStatistics = monitorStatisticsService.objTypeStatistic(deptId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gwMonitorStatistics, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,22 @@ public class PmsMonitorController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页获取所有主网用户台账
|
||||
* @author cdf
|
||||
* @date 2022/11/25
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllMainUserPageList")
|
||||
@ApiOperation("分页获取所有主网用户台账")
|
||||
@ApiImplicitParam(name = "baseParam",required = true)
|
||||
public HttpResult<Page<Monitor>> getAllMainUserPageList(@RequestBody TerminalQueryParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("getAllMainUserPageList");
|
||||
Page<Monitor> monitor= monitorService.getAllMainUserPageList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有主网监测点
|
||||
* @author cdf
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
||||
import com.njcn.device.pms.service.majornetwork.IPowerDistributionareaService;
|
||||
@@ -58,7 +59,7 @@ public class PmsPowerDistributionareaController extends BaseController {
|
||||
@PostMapping("getPowerDistributionAreaList")
|
||||
@ApiOperation("分页查询台区所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
|
||||
public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody @Validated BaseParam baseParam){
|
||||
public HttpResult<Page<PowerDistributionarea>> getList(@RequestBody TaiZhangParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<PowerDistributionarea> res = iPowerDistributionareaService.getList(baseParam);
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.`Powerr_Id` AS powerId,
|
||||
monitor.`Powerr_Name` AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.`Name` AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
@@ -26,11 +26,11 @@
|
||||
pdm.Update_By AS updateBy,
|
||||
pdm.Update_Time AS updateTime
|
||||
FROM
|
||||
((
|
||||
(
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.`Name`,
|
||||
pm.`Status`,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
@@ -48,57 +48,11 @@
|
||||
</if>
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
/* (
|
||||
SELECT
|
||||
ppd.id,
|
||||
ppd.Name,
|
||||
ppd.Status,
|
||||
ppd.Org_Id,
|
||||
ppd.Org_Name,
|
||||
ppd.Power_Station_Id,
|
||||
ppd.Powerr_Name,
|
||||
ppd.Line_Id,
|
||||
ppd.Line_Name
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
) UNION ALL*/
|
||||
(
|
||||
SELECT
|
||||
ppc.id,
|
||||
ppc.Name,
|
||||
ppc.Status,
|
||||
ppc.Org_Id,
|
||||
ppc.Org_Name,
|
||||
ppc.Power_Station_Id,
|
||||
ps.Power_Name,
|
||||
ppc.Line_Id,
|
||||
0
|
||||
FROM
|
||||
pms_power_client AS ppc
|
||||
INNER JOIN pms_statation_stat ps ON ps.Power_Id = ppc.Power_Station_Id
|
||||
AND ppc.Org_Id = ps.Org_Id
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
ppgu.id,
|
||||
ppgu.Name,
|
||||
ppgu.Status,
|
||||
ppgu.Org_Id,
|
||||
ppgu.Org_Name,
|
||||
ppgu.Power_Station_Id,
|
||||
pss.Power_Name,
|
||||
ppgu.Line_Id,
|
||||
0
|
||||
FROM
|
||||
pms_power_generation_user AS ppgu
|
||||
INNER JOIN pms_statation_stat AS pss ON pss.Power_Id = ppgu.Power_Station_Id
|
||||
AND ppgu.Org_Id = pss.Org_Id
|
||||
)) AS monitor
|
||||
) AS monitor
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
monitor.`Status` = 1
|
||||
AND pdm.`Status` = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
@@ -131,19 +85,20 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
<!--sql直接报错修改不爆错-->
|
||||
<select id="getPwPhotovoltaicMonitorList" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pm.Org_Id AS orgId,
|
||||
pm.Org_Name AS orgName,
|
||||
pm.Powerr_Id AS powerId,
|
||||
pm.Powerr_Name AS powerName,
|
||||
pm.id AS monitorId,
|
||||
pm.Name AS monitorName,
|
||||
pm.Line_Id,
|
||||
pm.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
pdm.Voltage_Level AS voltageLevel,
|
||||
pdm.If_Power_User AS if_powerUser,
|
||||
@@ -155,51 +110,21 @@
|
||||
pdm.Update_By AS updateBy,
|
||||
pdm.Update_Time AS updateTime
|
||||
FROM
|
||||
((
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
pm.Powerr_Name,
|
||||
pm.Line_Id,
|
||||
pm.Line_Name
|
||||
FROM
|
||||
pms_monitor AS pm
|
||||
<where>
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON pm.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
pm.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND pm.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
<if test="pwPmsMonitorParam.monitorTag!=null and pwPmsMonitorParam.monitorTag.size()!=0">
|
||||
AND pm.Monitor_Tag IN
|
||||
<foreach collection="pwPmsMonitorParam.monitorTag" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
) /*UNION ALL
|
||||
(
|
||||
SELECT
|
||||
ppd.id,
|
||||
ppd.Name,
|
||||
ppd.Status,
|
||||
ppd.Org_Id,
|
||||
ppd.Org_Name,
|
||||
ppd.Power_Station_Id,
|
||||
ppd.Powerr_Name,
|
||||
ppd.Line_Id,
|
||||
ppd.Line_Name
|
||||
FROM
|
||||
pms_power_distributionarea AS ppd
|
||||
)
|
||||
) AS monitor*/
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
</foreach>
|
||||
<if test="pwPmsMonitorParam.voltageLevels!=null and pwPmsMonitorParam.voltageLevels.size()!=0">
|
||||
AND pdm.Voltage_Level IN
|
||||
<foreach collection="pwPmsMonitorParam.voltageLevels" item="item" open="(" close=")" separator=",">
|
||||
@@ -228,7 +153,7 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND pm.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.njcn.device.pms.mapper.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.param.PwPmsMonitorParam;
|
||||
import com.njcn.device.pms.pojo.param.*;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -108,4 +106,13 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
||||
|
||||
List<Monitor> selectMonitorAndNewEnergy(@Param("orgIds")List<String> orgIds,
|
||||
@Param("objIds")List<String> objIds);
|
||||
|
||||
|
||||
/**
|
||||
* 分页获取用户对象
|
||||
*/
|
||||
Page<Monitor> getAllObjUser(@Param("page") Page<Monitor> page, @Param("baseParam")TerminalQueryParam baseParam);
|
||||
|
||||
List<Monitor> getAllObjUser(@Param("baseParam")TerminalQueryParam baseParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -387,6 +387,7 @@
|
||||
<select id="pwMonitorAreaDetailInfo" resultType="com.njcn.device.pms.pojo.dto.PwPmsMonitorDTO">
|
||||
SELECT
|
||||
t.org_id orgId,
|
||||
t.orgName orgName,
|
||||
t.id monitorId,
|
||||
t.NAME monitorName,
|
||||
b.Terminal_Id terminalId,
|
||||
@@ -401,6 +402,7 @@
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
3 AS lineType,
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
@@ -408,7 +410,7 @@
|
||||
b.Power_Name powerName
|
||||
FROM
|
||||
pms_power_client a
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
a.STATUS = 1
|
||||
) UNION ALL
|
||||
@@ -417,6 +419,7 @@
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
3 AS lineType,
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
@@ -424,37 +427,39 @@
|
||||
b.Power_Name powerName
|
||||
FROM
|
||||
pms_power_generation_user a
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id
|
||||
LEFT JOIN pms_statation_stat b ON a.Power_Station_Id = b.Power_Id LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
a.STATUS = 1
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
id,
|
||||
NAME,
|
||||
org_id,
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
2 AS lineType,
|
||||
Power_Station_Id AS powerrId,
|
||||
Line_Id,
|
||||
Voltage_Level,
|
||||
Powerr_Name powerName
|
||||
a.Power_Station_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
a.Voltage_Level,
|
||||
a.Powerr_Name powerName
|
||||
FROM
|
||||
pms_power_distributionarea
|
||||
pms_power_distributionarea a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
STATUS = 1
|
||||
) UNION ALL
|
||||
(
|
||||
SELECT
|
||||
id,
|
||||
NAME,
|
||||
org_id,
|
||||
a.id,
|
||||
a.NAME,
|
||||
a.org_id,
|
||||
dept.name orgName,
|
||||
1 AS lineType,
|
||||
Powerr_Id AS powerrId,
|
||||
Line_Id,
|
||||
Voltage_Level,
|
||||
Powerr_Name powerName
|
||||
a.Powerr_Id AS powerrId,
|
||||
a.Line_Id,
|
||||
a.Voltage_Level,
|
||||
a.Powerr_Name powerName
|
||||
FROM
|
||||
pms_monitor
|
||||
pms_monitor a LEFT JOIN sys_dept dept on a.org_id =dept.code
|
||||
WHERE
|
||||
STATUS = 1
|
||||
)
|
||||
|
||||
@@ -259,4 +259,42 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getAllObjUser" resultType="com.njcn.device.pms.pojo.po.Monitor">
|
||||
SELECT
|
||||
monitor.Id,
|
||||
monitor.NAME,
|
||||
monitor.Org_Id,
|
||||
monitor.Org_Name,
|
||||
monitor.Operation_Name,
|
||||
monitor.Powerr_Name,
|
||||
monitor.Line_Name,
|
||||
monitor.Voltage_Level,
|
||||
monitor.Monitor_Tag,
|
||||
monitor.Obj_Type,
|
||||
monitor.Monitor_Object_Name,
|
||||
monitor.trade_Code,
|
||||
monitor.Is_Special_Supply_Electricity
|
||||
|
||||
FROM
|
||||
pms_monitor monitor
|
||||
INNER JOIN
|
||||
(
|
||||
SELECT max( id ) id, Monitor_Object_Name
|
||||
FROM pms_monitor
|
||||
where Monitor_Object_Name is not null
|
||||
and Status = 1
|
||||
<if test="baseParam.monitorTag!=null and baseParam.monitorTag!=''">
|
||||
and monitor.Monitor_Tag = #{baseParam.monitorTag}
|
||||
</if>
|
||||
<if test="baseParam.objTypeList !=null and baseParam.objTypeList.size() != 0">
|
||||
and monitor.Obj_Type in
|
||||
<foreach collection="baseParam.objTypeList" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY Monitor_Object_Name
|
||||
) t ON monitor.id = t.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -19,7 +19,15 @@ public interface MonitorStatisticsService {
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> getGwMonitorStatistics(String deptId);
|
||||
List<List<String>> getGwMonitorStatistics(String deptId,Integer up);
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 国网上送统计类型数量统计
|
||||
* @Author: wr
|
||||
* @Date: 2024/3/22 9:49
|
||||
*/
|
||||
List<List<String>> objTypeStatistic(String deptId);
|
||||
|
||||
/**
|
||||
* @Description: 国网上送新能源场站统计
|
||||
|
||||
@@ -222,12 +222,7 @@ public class GwMonitorPushServiceImpl implements GwMonitorPushService {
|
||||
|
||||
|
||||
|
||||
/* if (tranMap.containsKey(item.getPotentialTransFormerType())) {
|
||||
pushMonitorDTO.setEvtType(tranMap.get(item.getPotentialTransFormerType()).getValue());
|
||||
}
|
||||
if (pointMap.containsKey(item.getNeutralGroundingMode())) {
|
||||
pushMonitorDTO.setNeutralGround(pointMap.get(item.getNeutralGroundingMode()).getValue());
|
||||
}*/
|
||||
pushMonitorDTO.setUpdateTime(item.getUpdateTime());
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(item.getOrgName())) {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.device.pms.mapper.majornetwork.MonitorMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixWireMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper;
|
||||
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||
import com.njcn.device.pms.pojo.param.gw.GwStatisticalParam;
|
||||
import com.njcn.device.pms.pojo.param.gw.GwTerminalParam;
|
||||
import com.njcn.device.pms.pojo.po.*;
|
||||
@@ -67,7 +68,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
private final ITerminalService terminalService;
|
||||
|
||||
@Override
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId) {
|
||||
public List<List<String>> getGwMonitorStatistics(String deptId,Integer up) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
@@ -105,6 +106,7 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
|
||||
//部门信息循环
|
||||
List<String> line;
|
||||
@@ -115,8 +117,12 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
if (CollUtil.isEmpty(lineBaseList)) {
|
||||
continue;
|
||||
}
|
||||
List<LineDevGetDTO> upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
List<LineDevGetDTO> upToGridList;
|
||||
if(Objects.isNull(up) || up == 1){
|
||||
upToGridList = lineBaseList.stream().filter(item -> Objects.equals(item.getIsUpToGrid(), DataStateEnum.ENABLE.getCode())).collect(Collectors.toList());
|
||||
}else {
|
||||
upToGridList = lineBaseList;
|
||||
}
|
||||
addmetWorkList(metWorkMap, upToGridList, line);
|
||||
addSourceLoadList(sourceLoadMap, upToGridList, line);
|
||||
info.add(line);
|
||||
@@ -124,6 +130,54 @@ public class MonitorStatisticsServiceImpl implements MonitorStatisticsService {
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<List<String>> objTypeStatistic(String deptId) {
|
||||
List<List<String>> info = new ArrayList<>();
|
||||
//查询所有一级树字典
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
|
||||
//监测点大类
|
||||
List<SysDicTreePO> broadCategory = sysDicTreePOList.stream()
|
||||
.filter(item -> Objects.equals(item.getPid(), "0"))
|
||||
.filter(item -> !Objects.equals(item.getCode(), DicDataTypeEnum.DEVICE_UNIT.getCode()))
|
||||
.collect(Collectors.toList());
|
||||
broadCategory.sort(Comparator.comparing(SysDicTreePO::getSort));
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("单位");
|
||||
List<String> collect = broadCategory.stream().map(SysDicTreePO::getName).collect(Collectors.toList());
|
||||
list.addAll(collect);
|
||||
list.add("合计");
|
||||
//获取主网监测统计
|
||||
Map<String, List<String>> metWorkMap = mapDicIds(broadCategory, sysDicTreePOList);
|
||||
info.add(list);
|
||||
|
||||
TerminalQueryParam baseParam = new TerminalQueryParam();
|
||||
List<Monitor> monitorList = monitorMapper.getAllObjUser(baseParam);
|
||||
//筛选出国网统计信息
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptId);
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
deptGetLineParam.setSystemType(0);
|
||||
List<DeptGetBase> deptGetChildrenMoreDTOS = commTerminalService.getDeptChildrenByParent(deptGetLineParam);
|
||||
//部门信息循环
|
||||
for (DeptGetBase dept : deptGetChildrenMoreDTOS) {
|
||||
List<String> line = new ArrayList<>();
|
||||
line.add(dept.getUnitName());
|
||||
List<String> deptIds = dept.getUnitChildrenList();
|
||||
if (CollUtil.isEmpty(deptIds)) {
|
||||
continue;
|
||||
}
|
||||
List<Monitor> temList = monitorList.stream().filter(it->deptIds.contains(it.getOrgId())).collect(Collectors.toList());
|
||||
metWorkMap.forEach((k,v)->{
|
||||
long count = temList.stream().filter(i->v.contains(i.getObjType())).count();
|
||||
line.add(String.valueOf(count));
|
||||
});
|
||||
info.add(line);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MonitorEnergy> getGwMonitorEnergy(String deptId) {
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
|
||||
@@ -87,6 +87,9 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
|
||||
Page<Monitor> getAllMonitorPageList(TerminalQueryParam baseParam);
|
||||
|
||||
Page<Monitor> getAllMainUserPageList(TerminalQueryParam baseParam);
|
||||
|
||||
|
||||
List<Monitor> getMonitorList(List<String> monitorIds);
|
||||
|
||||
List<Monitor> getMonitorListByMid(List<String> midIds);
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.vo.PVCapacity;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
@@ -28,7 +29,7 @@ public interface IPowerDistributionareaService extends IService<PowerDistributio
|
||||
* 分页查询所有
|
||||
* @return
|
||||
*/
|
||||
Page<PowerDistributionarea> getList(BaseParam baseParam);
|
||||
Page<PowerDistributionarea> getList(TaiZhangParam baseParam);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
|
||||
@@ -24,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -148,10 +150,8 @@ public class DataQualityStatServiceImpl implements DataQualityStatService {
|
||||
vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName());
|
||||
if(vo.getMeasurementCount()!=0&&vo.getMeasurementCount()!=null){
|
||||
vo.setEffectiveAccessRate(
|
||||
Double.parseDouble(
|
||||
df.format((vo.getEffectiveAccessMeasurementCount() * 1.0)
|
||||
/ (vo.getMeasurementCount() * 1.0))
|
||||
) * 100);
|
||||
BigDecimal.valueOf((vo.getEffectiveAccessMeasurementCount() * 1.0/ (vo.getMeasurementCount() * 1.0))*100).setScale(2, RoundingMode.HALF_UP).doubleValue()
|
||||
);
|
||||
}else{
|
||||
vo.setEffectiveAccessRate(0.0);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
List<GeneratrixWire> generatrixWireList = generatrixWireMapper.selectList(new LambdaQueryWrapper<GeneratrixWire>().in(GeneratrixWire::getId, busIds));
|
||||
Map<String, GeneratrixWire> mapBus = generatrixWireList.stream().collect(Collectors.toMap(GeneratrixWire::getId, Function.identity()));
|
||||
|
||||
|
||||
List<String> powerIds = temList.stream().map(Monitor::getPowerrId).distinct().collect(Collectors.toList());
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().in(StatationStat::getPowerId,powerIds));
|
||||
Map<String,StatationStat> statMap = statationStatList.stream().collect(Collectors.toMap(StatationStat::getPowerId,Function.identity()));
|
||||
|
||||
temList = temList.stream().peek(item -> {
|
||||
if (mapTerminal.containsKey(item.getTerminalId())) {
|
||||
@@ -271,7 +273,9 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
item.setDevIp(mapTerminal.get(item.getTerminalId()).getIp());
|
||||
}
|
||||
|
||||
|
||||
if (statMap.containsKey(item.getPowerrId())) {
|
||||
item.setMidStation(statMap.get(item.getPowerrId()).getMidStationId());
|
||||
}
|
||||
|
||||
if (mapBus.containsKey(item.getLineId())) {
|
||||
item.setBusId(mapBus.get(item.getLineId()).getMidBusId());
|
||||
@@ -287,6 +291,42 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Page<Monitor> getAllMainUserPageList(TerminalQueryParam baseParam) {
|
||||
|
||||
|
||||
List<String> objTypeIds = new ArrayList<>();
|
||||
if(StrUtil.isNotBlank(baseParam.getObjType())){
|
||||
if(baseParam.getObjType().equals("987654321")){
|
||||
//特殊处理
|
||||
List<SysDicTreePO> sysDicTreePOList = dictTreeFeignClient.queryAll().getData();
|
||||
|
||||
List<SysDicTreePO> typicDic =sysDicTreePOList.stream().filter(item->Objects.equals(DicTreeEnum.Power_Station.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Ele_Railways.getCode(),item.getCode())||
|
||||
Objects.equals(DicTreeEnum.Wind_Farms.getCode(),item.getCode())||Objects.equals(DicTreeEnum.Imp_Users.getCode(),item.getCode())).collect(Collectors.toList());
|
||||
|
||||
for(SysDicTreePO sysDicTreePO : typicDic){
|
||||
List<DictTreeVO> temList = dictTreeFeignClient.query(sysDicTreePO.getId()).getData();
|
||||
List<String> ids = temList.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
objTypeIds.addAll(ids);
|
||||
objTypeIds.add(sysDicTreePO.getId());
|
||||
}
|
||||
}else {
|
||||
SysDicTreePO sysDicTreePO = dictTreeFeignClient.queryById(baseParam.getObjType()).getData();
|
||||
if(sysDicTreePO.getPid().equals("0")){
|
||||
List<DictTreeVO> temList = dictTreeFeignClient.query(sysDicTreePO.getId()).getData();
|
||||
List<String> ids = temList.stream().map(DictTreeVO::getId).collect(Collectors.toList());
|
||||
objTypeIds.addAll(ids);
|
||||
}
|
||||
objTypeIds.add(sysDicTreePO.getId());
|
||||
}
|
||||
baseParam.setObjTypeList(objTypeIds);
|
||||
}
|
||||
Page<Monitor> page = this.baseMapper.getAllObjUser(new Page<>(baseParam.getPageNum(), baseParam.getPageSize()),baseParam);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Monitor> getMonitorList(List<String> monitorIds) {
|
||||
List<Monitor> monitorList = new ArrayList<>();
|
||||
@@ -1273,37 +1313,38 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
}
|
||||
|
||||
|
||||
// 初始化字典数据的通用方法
|
||||
private Map<String, DictData> initDictData(DicDataTypeEnum type) {
|
||||
return dicDataFeignClient.getDicDataByTypeCode(type.getCode()).getData()
|
||||
.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
}
|
||||
|
||||
|
||||
private String dealData(List<OracleTerminalExcel> oracleTerminalExcelList) {
|
||||
List<OracleTerminalExcel.OracleTerminalExcelMsg> oracleTerminalExcelMsg = new ArrayList<>();
|
||||
|
||||
List<DeptDTO> allDept = deptFeignClient.getDeptDescendantIndexes(deptFeignClient.getRootDept().getData().getId(), Stream.of(0, 1, 2).collect(Collectors.toList())).getData();
|
||||
Map<String, DeptDTO> mapDept = allDept.stream().collect(Collectors.toMap(DeptDTO::getName, Function.identity()));
|
||||
|
||||
List<DictData> voltageLevelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> voltageLevelMap = voltageLevelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> voltageLevelMap = initDictData(DicDataTypeEnum.DEV_VOLTAGE);
|
||||
|
||||
//装置型号
|
||||
List<DictData> devTypelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
Map<String, DictData> devTypelDicMap = devTypelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
//装置类别
|
||||
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
||||
Map<String, DictData> devTypelDicMap = initDictData(DicDataTypeEnum.DEV_TYPE);
|
||||
|
||||
//装置状态
|
||||
List<DictData> devStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_STATUS.getCode()).getData();
|
||||
Map<String, DictData> devStateDicMap = devStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> devStateDicMap = initDictData(DicDataTypeEnum.DEV_STATUS);
|
||||
|
||||
//监测点状态
|
||||
List<DictData> monitorStatelDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.LINE_STATE.getCode()).getData();
|
||||
Map<String, DictData> monitorStateDicMap = monitorStatelDic.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> monitorStateDicMap = initDictData(DicDataTypeEnum.LINE_STATE);
|
||||
|
||||
//监测点标签
|
||||
List<DictData> objTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITORING_LABELS.getCode()).getData();
|
||||
Map<String, DictData> objTypeDicMap = objTypeList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> objTypeDicMap = initDictData(DicDataTypeEnum.MONITORING_LABELS);
|
||||
|
||||
//装置厂家
|
||||
List<DictData> manList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, DictData> manDicMap = manList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
Map<String, DictData> manDicMap = initDictData(DicDataTypeEnum.DEV_MANUFACTURER);
|
||||
|
||||
//接线方式
|
||||
Map<String, DictData> wireListMap = initDictData(DicDataTypeEnum.DEV_CONNECT);
|
||||
|
||||
//装作等级
|
||||
DictData devGrade = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_GRADE.getName(), DicDataEnum.MOST_IMPORMENT.getName()).getData();
|
||||
@@ -1314,30 +1355,27 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
//监测点类型
|
||||
DictData monitorType = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_TYPE.getName(), DicDataEnum.Power_Supply_Point.getName()).getData();
|
||||
|
||||
//接线方式
|
||||
List<DictData> wireList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_CONNECT.getCode()).getData();
|
||||
Map<String, DictData> wireListMap = wireList.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
DictData potentialDic = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.Cap_V.getCode(),DicDataTypeEnum.VOLTAGE_TRANSFORMER.getCode()).getData();
|
||||
|
||||
DictData neutralDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.Neutral_Point.getName(), DicDataEnum.Ground_Res.getName()).getData();
|
||||
//装置类别
|
||||
DictData devCategoryDic = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.DEV_CATEGORY.getName(), DicDataEnum.Monitor_Terminals.getName()).getData();
|
||||
|
||||
|
||||
List<DictData> businessType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
|
||||
Map<String, DictData> businessDicMap = businessType.stream().collect(Collectors.toMap(DictData::getName, Function.identity()));
|
||||
|
||||
|
||||
//TODO 零时处理
|
||||
//对象类型
|
||||
List<SysDicTreePO> dicTree = dictTreeFeignClient.queryAll().getData();
|
||||
dicTree = dicTree.stream().filter(item->item.getCode()!="Device_Unit" && !item.getCode().contains("@")).collect(Collectors.toList());
|
||||
Map<String,SysDicTreePO> objTypeMap = dicTree.stream().collect(Collectors.toMap(SysDicTreePO::getName,Function.identity()));
|
||||
|
||||
|
||||
|
||||
for (OracleTerminalExcel oracleTerminalExcel : oracleTerminalExcelList) {
|
||||
|
||||
//单位
|
||||
if(oracleTerminalExcel.getGdName().equals("省检修")){
|
||||
if (oracleTerminalExcel.getGdName().equals("省检修")) {
|
||||
oracleTerminalExcel.setGdName("国网河北超高压公司本部");
|
||||
}else {
|
||||
oracleTerminalExcel.setGdName("国网"+oracleTerminalExcel.getGdName()+"本部");
|
||||
} else {
|
||||
oracleTerminalExcel.setGdName("国网" + oracleTerminalExcel.getGdName() + "本部");
|
||||
}
|
||||
|
||||
if (!mapDept.containsKey(oracleTerminalExcel.getGdName())) {
|
||||
@@ -1347,7 +1385,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
//判断是否操作过该条记录
|
||||
LineBak lineBak = lineBakMapper.selectOne(new LambdaQueryWrapper<LineBak>().eq(LineBak::getLineId, oracleTerminalExcel.getId()));
|
||||
|
||||
DeviceBak deviceBak = deviceBakMapper.selectOne(new LambdaQueryWrapper<DeviceBak>().eq(DeviceBak::getDevId, oracleTerminalExcel.getDeviceId()));
|
||||
|
||||
|
||||
@@ -1416,14 +1453,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* if (devTypelDicMap.containsKey(oracleTerminalExcel.getDevType())) {
|
||||
pmsTerminalPO.setTerminalState(devTypelDicMap.get(oracleTerminalExcel.getDevType()).getId());
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典终端状态不存在,请确认后重试"));
|
||||
continue;
|
||||
}*/
|
||||
|
||||
//终端状态
|
||||
String devState = null;
|
||||
switch (oracleTerminalExcel.getRunFlag()) {
|
||||
@@ -1473,16 +1502,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
deviceBakMapper.insert(deviceBakPO);
|
||||
terminalMapper.updateById(pmsTerminalPO);
|
||||
devId = pmsTerminal.getId();
|
||||
} else if (Objects.isNull(pmsTerminal)) {
|
||||
terminalMapper.deleteById(deviceBak.getId());
|
||||
pmsTerminalPO.setId(deviceBak.getId());
|
||||
terminalMapper.insert(pmsTerminalPO);
|
||||
devId = pmsTerminalPO.getId();
|
||||
} else {
|
||||
devId = pmsTerminal.getId();
|
||||
devId = deviceBak.getId();
|
||||
pmsTerminalPO.setId(devId);
|
||||
terminalMapper.updateById(pmsTerminalPO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1494,8 +1517,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
GeneratrixWire generatrixWire = generatrixWireMapper.selectOne(generatrixWireLambdaQueryWrapper);
|
||||
|
||||
String lineId = null, lineName = null, genScale = null;
|
||||
|
||||
|
||||
GeneratrixWire generatrixWirePO = new GeneratrixWire();
|
||||
generatrixWirePO.setGeneratrixName(oracleTerminalExcel.getSubvName());
|
||||
generatrixWirePO.setStatus(DataStateEnum.ENABLE.getCode());
|
||||
@@ -1521,7 +1542,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
} else {
|
||||
generatrixWirePO.setId(generatrixWire.getId());
|
||||
generatrixWireMapper.updateById(generatrixWirePO);
|
||||
lineId = generatrixWire.getId();
|
||||
lineId = generatrixWirePO.getId();
|
||||
lineName = generatrixWirePO.getName();
|
||||
genScale = generatrixWirePO.getScale();
|
||||
}
|
||||
@@ -1530,11 +1551,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getLineId, lineId)
|
||||
.eq(Monitor::getName, oracleTerminalExcel.getLineName());
|
||||
List<Monitor> monitorList = monitorMapper.selectList(monitorLambdaQueryWrapper);
|
||||
Monitor monitor = monitorMapper.selectOne(monitorLambdaQueryWrapper);
|
||||
|
||||
if(CollUtil.isNotEmpty(monitorList)) {
|
||||
|
||||
for (Monitor monitor : monitorList) {
|
||||
|
||||
//当前电站下面没有监测点,可以新增
|
||||
Monitor monitorPO = new Monitor();
|
||||
@@ -1555,6 +1573,8 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
one = "06";
|
||||
} else if (deptDTO.getName().contains("超高压")) {
|
||||
one = "07";
|
||||
} else if (deptDTO.getName().contains("雄安")) {
|
||||
one = "08";
|
||||
} else {
|
||||
one = "3.14159";
|
||||
}
|
||||
@@ -1563,7 +1583,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
monitorPO.setMonitorId(monitorId + one + last);
|
||||
|
||||
|
||||
monitorPO.setLineNum(oracleTerminalExcel.getLineNum());
|
||||
monitorPO.setName(oracleTerminalExcel.getLineName());
|
||||
monitorPO.setPowerrName(stationName);
|
||||
monitorPO.setPowerrId(stationId);
|
||||
@@ -1600,7 +1620,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测点运行状态不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
monitorPO.setPutDate(oracleTerminalExcel.getLoginTime());
|
||||
monitorPO.setMonitorType(monitorType.getId());
|
||||
monitorPO.setStandShortCapacity(oracleTerminalExcel.getStandardCapacity());
|
||||
monitorPO.setMinShortCircuitCapacity(oracleTerminalExcel.getShortCapacity());
|
||||
@@ -1620,7 +1640,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setMonitorObjectName(oracleTerminalExcel.getObjName());
|
||||
|
||||
|
||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") ||oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")) {
|
||||
if (oracleTerminalExcel.getLoadType().equals("电加热负荷") || oracleTerminalExcel.getLoadType().equals("轧机") || oracleTerminalExcel.getLoadType().equals("其他非线性负荷")|| oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||
if (objTypeDicMap.containsKey("冶炼负荷")) {
|
||||
String objTypeId = objTypeDicMap.get("冶炼负荷").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1628,7 +1648,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "冶炼负荷字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")) {
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("商业/市政/民用/电子通讯负荷")|| "电动汽车充电站".equals(oracleTerminalExcel.getLoadType()) ||"轨道交通".equals(oracleTerminalExcel.getLoadType())) {
|
||||
if (objTypeDicMap.containsKey("城市商业")) {
|
||||
String objTypeId = objTypeDicMap.get("城市商业").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1637,7 +1657,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工")) {
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("半导体制造") || oracleTerminalExcel.getLoadType().equals("精密加工") || oracleTerminalExcel.getLoadType().equals("党政机关")||"敏感/重要/高危用户".equals(oracleTerminalExcel.getLoadType())) {
|
||||
if (objTypeDicMap.containsKey("敏感用户")) {
|
||||
String objTypeId = objTypeDicMap.get("敏感用户").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1651,10 +1671,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
String objTypeId = objTypeDicMap.get("主变高压侧").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "主变高压侧字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("跨省计量关口")){
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("跨省计量关口")) {
|
||||
if (objTypeDicMap.containsKey("跨省联络线")) {
|
||||
String objTypeId = objTypeDicMap.get("跨省联络线").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1663,7 +1683,7 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("光伏电站")){
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("光伏电站")) {
|
||||
if (objTypeDicMap.containsKey("光伏电站")) {
|
||||
String objTypeId = objTypeDicMap.get("光伏电站").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
@@ -1672,42 +1692,55 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if (oracleTerminalExcel.getLoadType().equals("风电场")) {
|
||||
if (objTypeDicMap.containsKey("陆上风电")) {
|
||||
String objTypeId = objTypeDicMap.get("陆上风电").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "风电场字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
}else if (oracleTerminalExcel.getLoadType().equals("其他发电厂")) {
|
||||
if (objTypeDicMap.containsKey("其他电源")) {
|
||||
String objTypeId = objTypeDicMap.get("其他电源").getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "其他电源监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (objTypeDicMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeDicMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setMonitorTag(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, "字典监测标签不存在,请确认后重试"));
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType()+"字典监测标签不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//监测点对象类型
|
||||
|
||||
if (objTypeMap.containsKey(oracleTerminalExcel.getLoadType())) {
|
||||
String objTypeId = objTypeMap.get(oracleTerminalExcel.getLoadType()).getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
}else if(oracleTerminalExcel.getLoadType().equals("电加热负荷")){
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("电加热负荷")) {
|
||||
String objTypeId = objTypeMap.get("电加热负荷(含电弧炉、中频炉、电热炉、单/多晶硅生产设备)").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("变频调速负荷")) {
|
||||
String objTypeId = objTypeMap.get("变频调速负荷(变频电机、变频水泵等)").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else if (oracleTerminalExcel.getLoadType().equals("敏感/重要/高危用户")) {
|
||||
String objTypeId = objTypeMap.get("敏感/重要/高危用户").getId();
|
||||
monitorPO.setObjType(objTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getLoadType() + "字典监测点对象类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}
|
||||
|
||||
//行业类型
|
||||
/* if (businessDicMap.containsKey(oracleTerminalExcel.getBusinessType())) {
|
||||
String busTypeId = businessDicMap.get(oracleTerminalExcel.getBusinessType()).getId();
|
||||
monitorPO.setTradeCode(busTypeId);
|
||||
} else {
|
||||
oracleTerminalExcelMsg.add(assembleMsg(oracleTerminalExcel, oracleTerminalExcel.getBusinessType()+"字典行业类型不存在,请确认后重试"));
|
||||
continue;
|
||||
}*/
|
||||
|
||||
//TODO 监测点对象名称
|
||||
|
||||
|
||||
String wireMethod = "";
|
||||
switch (oracleTerminalExcel.getPtType()) {
|
||||
case 0:
|
||||
@@ -1748,7 +1781,6 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
monitorPO.setPowerFlag("102");
|
||||
}
|
||||
|
||||
|
||||
if (Objects.isNull(lineBak) && Objects.isNull(monitor)) {
|
||||
monitorPO.setIsUpToGrid(0);
|
||||
monitorMapper.insert(monitorPO);
|
||||
@@ -1765,23 +1797,23 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
lineBakPO.setId(monitorPO.getId());
|
||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||
lineBakMapper.insert(lineBakPO);
|
||||
|
||||
} else {
|
||||
if (Objects.isNull(lineBak)) {
|
||||
|
||||
lineBakMapper.delete(new LambdaQueryWrapper<LineBak>().eq(LineBak::getId,monitor.getId()));
|
||||
LineBak lineBakPO = new LineBak();
|
||||
lineBakPO.setId(monitor.getId());
|
||||
lineBakPO.setLineId(oracleTerminalExcel.getId());
|
||||
System.out.println(oracleTerminalExcel.getId());
|
||||
lineBakMapper.insert(lineBakPO);
|
||||
monitorMapper.updateById(monitorPO);
|
||||
} else if (Objects.isNull(monitor)) {
|
||||
monitorPO.setIsUpToGrid(0);
|
||||
monitorMapper.deleteById(lineBak.getId());
|
||||
monitorPO.setId(lineBak.getId());
|
||||
monitorMapper.insert(monitorPO);
|
||||
} else {
|
||||
monitorPO.setId(lineBak.getId());
|
||||
monitorMapper.updateById(monitorPO);
|
||||
}
|
||||
|
||||
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(Float.parseFloat(scale.getValue()), oracleTerminalExcel.getDealCapacity(), oracleTerminalExcel.getDevCapacity(), oracleTerminalExcel.getShortCapacity(), 0, 0);
|
||||
overlimit.setId(monitorPO.getId());
|
||||
Overlimit overlimitRes = overlimitMapper.selectById(monitorPO.getId());
|
||||
@@ -1792,13 +1824,10 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(oracleTerminalExcelMsg)) {
|
||||
ExcelUtil.exportExcel("失败列表.xlsx", OracleTerminalExcel.OracleTerminalExcelMsg.class, oracleTerminalExcelMsg);
|
||||
return null;
|
||||
@@ -1809,11 +1838,11 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
private String dealVoltageLevel(String voltage) {
|
||||
float scale = Float.parseFloat(voltage.substring(0, voltage.indexOf("kV")));
|
||||
if (scale < 500) {
|
||||
//if (scale < 500) {
|
||||
return "交流" + voltage;
|
||||
} else {
|
||||
return "直流" + voltage;
|
||||
}
|
||||
//} else {
|
||||
// return "直流" + voltage;
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.njcn.device.pms.mapper.majornetwork.PowerDistributionareaMapper;
|
||||
import com.njcn.device.pms.pojo.excel.PowerDistributionAreaExcel;
|
||||
import com.njcn.device.pms.pojo.excel.PowerGenerationUserExcel;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.GeneratrixWire;
|
||||
import com.njcn.device.pms.pojo.po.PowerDistributionarea;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
@@ -82,16 +83,18 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl<PowerDistribut
|
||||
|
||||
|
||||
@Override
|
||||
public Page<PowerDistributionarea> getList(BaseParam baseParam) {
|
||||
List<Dept> deptInfo = deptFeignClient.getAllDept().getData();
|
||||
List<String> deptIds = deptInfo.stream().map(Dept::getCode).collect(Collectors.toList());
|
||||
public Page<PowerDistributionarea> getList(TaiZhangParam baseParam) {
|
||||
List<String> deptInfo = deptFeignClient.getDepSonSelfCodetByDeptId(baseParam.getOrgId()).getData();
|
||||
LambdaQueryWrapper<PowerDistributionarea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PowerDistributionarea::getStatus,DataStateEnum.ENABLE.getCode())
|
||||
.in(CollUtil.isNotEmpty(deptIds),PowerDistributionarea::getOrgId,deptIds)
|
||||
.in(CollUtil.isNotEmpty(deptInfo),PowerDistributionarea::getOrgId,deptInfo)
|
||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()),
|
||||
i->i.like(PowerDistributionarea::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getPowerrName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(PowerDistributionarea::getLineName,baseParam.getSearchValue())
|
||||
|
||||
.or()
|
||||
.like(PowerDistributionarea::getOrgName,baseParam.getSearchValue())).orderByDesc(PowerDistributionarea::getCreateTime);
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.CvtRelationFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理Feign客户端
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/cvtBind", fallbackFactory = CvtRelationFeignClientFallbackFactory.class, contextId = "cvtBind")
|
||||
public interface CvtRelationFeignClient {
|
||||
|
||||
@PostMapping("queryByLineId")
|
||||
HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(@RequestParam("lineId") String lineId);
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.njcn.device.pq.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.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.DeviceFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
@@ -33,4 +37,8 @@ public interface DeviceFeignClient {
|
||||
@RequestParam("thisTimeCheck") String thisTimeCheck,
|
||||
@RequestParam("nextTimeCheck") String nextTimeCheck);
|
||||
|
||||
@PostMapping("/updateDevComFlag")
|
||||
@ApiOperation("修改装置通讯状态")
|
||||
HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.Map;
|
||||
path = "/line",
|
||||
fallbackFactory = LineFeignClientFallbackFactory.class,
|
||||
contextId = "line")
|
||||
public interface LineFeignClient {
|
||||
public interface LineFeignClient {
|
||||
|
||||
/**
|
||||
* 获取终端状态信息
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.device.pq.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.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.CvtRelationFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理熔断降级
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CvtRelationFeignClientFallbackFactory implements FallbackFactory<CvtRelationFeignClient> {
|
||||
@Override
|
||||
public CvtRelationFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CvtRelationFeignClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(String lineId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "监测点获取Cvt系数", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.DeviceFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.DevComFlagDTO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -31,6 +32,12 @@ public class DeviceFeignClientFallbackFactory implements FallbackFactory<DeviceF
|
||||
log.error("{}异常,降级处理,异常为:{}", "技术监督修改装置定检时间", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> updateDevComFlag(DevComFlagDTO devComFlagDTO) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "修改设备状态", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public enum PvDeviceResponseEnum {
|
||||
PROJECT_OR_NOT("A00550","项目名称为空,请检查信息是否存在!"),
|
||||
PROVINCE_OR_NOT("A00550","省级名称为空,请检查信息是否存在!"),
|
||||
GD_OR_NOT("A00550","供电公司名称为空,请检查信息是否存在!"),
|
||||
OVER_LIMIT("A00550","前置机配置设备过多"),
|
||||
NO_DEVICE("A00550","前置机下无设备"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.njcn.device.pq.pojo.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsDTO {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
private String cvtModel;
|
||||
|
||||
private BigDecimal h2;
|
||||
|
||||
private BigDecimal h3;
|
||||
|
||||
private BigDecimal h4;
|
||||
|
||||
private BigDecimal h5;
|
||||
|
||||
private BigDecimal h6;
|
||||
|
||||
private BigDecimal h7;
|
||||
|
||||
private BigDecimal h8;
|
||||
|
||||
private BigDecimal h9;
|
||||
|
||||
private BigDecimal h10;
|
||||
|
||||
private BigDecimal h11;
|
||||
|
||||
private BigDecimal h12;
|
||||
|
||||
private BigDecimal h13;
|
||||
|
||||
private BigDecimal h14;
|
||||
|
||||
private BigDecimal h15;
|
||||
|
||||
private BigDecimal h16;
|
||||
|
||||
private BigDecimal h17;
|
||||
|
||||
private BigDecimal h18;
|
||||
|
||||
private BigDecimal h19;
|
||||
|
||||
private BigDecimal h20;
|
||||
|
||||
private BigDecimal h21;
|
||||
|
||||
private BigDecimal h22;
|
||||
|
||||
private BigDecimal h23;
|
||||
|
||||
private BigDecimal h24;
|
||||
|
||||
private BigDecimal h25;
|
||||
|
||||
private BigDecimal h26;
|
||||
|
||||
private BigDecimal h27;
|
||||
|
||||
private BigDecimal h28;
|
||||
|
||||
private BigDecimal h29;
|
||||
|
||||
private BigDecimal h30;
|
||||
|
||||
private BigDecimal h31;
|
||||
|
||||
private BigDecimal h32;
|
||||
|
||||
private BigDecimal h33;
|
||||
|
||||
private BigDecimal h34;
|
||||
|
||||
private BigDecimal h35;
|
||||
|
||||
private BigDecimal h36;
|
||||
|
||||
private BigDecimal h37;
|
||||
|
||||
private BigDecimal h38;
|
||||
|
||||
private BigDecimal h39;
|
||||
|
||||
private BigDecimal h40;
|
||||
|
||||
private BigDecimal h41;
|
||||
|
||||
private BigDecimal h42;
|
||||
|
||||
private BigDecimal h43;
|
||||
|
||||
private BigDecimal h44;
|
||||
|
||||
private BigDecimal h45;
|
||||
|
||||
private BigDecimal h46;
|
||||
|
||||
private BigDecimal h47;
|
||||
|
||||
private BigDecimal h48;
|
||||
|
||||
private BigDecimal h49;
|
||||
|
||||
private BigDecimal h50;
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -38,6 +38,8 @@ public class DeviceInfo {
|
||||
private String series;
|
||||
//终端识别码
|
||||
private String devKey;
|
||||
|
||||
private Integer processNo;
|
||||
//
|
||||
private List<MonitorInfo> monitorData;
|
||||
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsParam {
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = "cvt名称过长")
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
@Pattern(regexp = PatternRegex.DES32_REGEX, message = "cvt型号")
|
||||
private String cvtModel;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h2;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h3;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h4;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h5;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h6;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h7;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h8;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h9;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h10;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h11;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h12;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h13;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h14;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h15;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h16;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h17;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h18;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h19;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h20;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h21;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h22;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h23;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h24;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h25;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h26;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h27;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h28;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h29;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h30;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h31;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h32;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h33;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h34;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h35;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h36;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h37;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h38;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h39;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h40;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h41;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h42;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h43;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h44;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h45;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h46;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h47;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h48;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h49;
|
||||
@Digits(integer = 2, fraction = 4, message = "CVT参数格式错误,应为X.XXXX")
|
||||
@NotNull(message = "CVT参数不能不为空")
|
||||
private BigDecimal h50;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtHarmonicCorrectionFactorsParamUpdateParam extends CvtHarmonicCorrectionFactorsParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 前置查询
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtHarmonicCorrectionFactorsParamQueryParam extends BaseParam {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtLineRelationParam {
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* cvt系数表id
|
||||
*/
|
||||
private String cvtId;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CvtLineRelationUpdateParam extends CvtLineRelationParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import java.util.List;
|
||||
@ApiModel
|
||||
public class NodeDeviceParam {
|
||||
|
||||
|
||||
/**
|
||||
* 服务器IP
|
||||
*/
|
||||
@@ -31,4 +30,6 @@ public class NodeDeviceParam {
|
||||
private String ip;
|
||||
|
||||
private List<Integer> runFlag;
|
||||
|
||||
private String devId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@TableName(value = "cvt_harmonic_correction_factors")
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactors extends BaseEntity {
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
@TableField(value = "cvt_name")
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
@TableField(value = "cvt_model")
|
||||
private String cvtModel;
|
||||
|
||||
@TableField(value = "h2")
|
||||
private BigDecimal h2;
|
||||
|
||||
@TableField(value = "h3")
|
||||
private BigDecimal h3;
|
||||
|
||||
@TableField(value = "h4")
|
||||
private BigDecimal h4;
|
||||
|
||||
@TableField(value = "h5")
|
||||
private BigDecimal h5;
|
||||
|
||||
@TableField(value = "h6")
|
||||
private BigDecimal h6;
|
||||
|
||||
@TableField(value = "h7")
|
||||
private BigDecimal h7;
|
||||
|
||||
@TableField(value = "h8")
|
||||
private BigDecimal h8;
|
||||
|
||||
@TableField(value = "h9")
|
||||
private BigDecimal h9;
|
||||
|
||||
@TableField(value = "h10")
|
||||
private BigDecimal h10;
|
||||
|
||||
@TableField(value = "h11")
|
||||
private BigDecimal h11;
|
||||
|
||||
@TableField(value = "h12")
|
||||
private BigDecimal h12;
|
||||
|
||||
@TableField(value = "h13")
|
||||
private BigDecimal h13;
|
||||
|
||||
@TableField(value = "h14")
|
||||
private BigDecimal h14;
|
||||
|
||||
@TableField(value = "h15")
|
||||
private BigDecimal h15;
|
||||
|
||||
@TableField(value = "h16")
|
||||
private BigDecimal h16;
|
||||
|
||||
@TableField(value = "h17")
|
||||
private BigDecimal h17;
|
||||
|
||||
@TableField(value = "h18")
|
||||
private BigDecimal h18;
|
||||
|
||||
@TableField(value = "h19")
|
||||
private BigDecimal h19;
|
||||
|
||||
@TableField(value = "h20")
|
||||
private BigDecimal h20;
|
||||
|
||||
@TableField(value = "h21")
|
||||
private BigDecimal h21;
|
||||
|
||||
@TableField(value = "h22")
|
||||
private BigDecimal h22;
|
||||
|
||||
@TableField(value = "h23")
|
||||
private BigDecimal h23;
|
||||
|
||||
@TableField(value = "h24")
|
||||
private BigDecimal h24;
|
||||
|
||||
@TableField(value = "h25")
|
||||
private BigDecimal h25;
|
||||
|
||||
@TableField(value = "h26")
|
||||
private BigDecimal h26;
|
||||
|
||||
@TableField(value = "h27")
|
||||
private BigDecimal h27;
|
||||
|
||||
@TableField(value = "h28")
|
||||
private BigDecimal h28;
|
||||
|
||||
@TableField(value = "h29")
|
||||
private BigDecimal h29;
|
||||
|
||||
@TableField(value = "h30")
|
||||
private BigDecimal h30;
|
||||
|
||||
@TableField(value = "h31")
|
||||
private BigDecimal h31;
|
||||
|
||||
@TableField(value = "h32")
|
||||
private BigDecimal h32;
|
||||
|
||||
@TableField(value = "h33")
|
||||
private BigDecimal h33;
|
||||
|
||||
@TableField(value = "h34")
|
||||
private BigDecimal h34;
|
||||
|
||||
@TableField(value = "h35")
|
||||
private BigDecimal h35;
|
||||
|
||||
@TableField(value = "h36")
|
||||
private BigDecimal h36;
|
||||
|
||||
@TableField(value = "h37")
|
||||
private BigDecimal h37;
|
||||
|
||||
@TableField(value = "h38")
|
||||
private BigDecimal h38;
|
||||
|
||||
@TableField(value = "h39")
|
||||
private BigDecimal h39;
|
||||
|
||||
@TableField(value = "h40")
|
||||
private BigDecimal h40;
|
||||
|
||||
@TableField(value = "h41")
|
||||
private BigDecimal h41;
|
||||
|
||||
@TableField(value = "h42")
|
||||
private BigDecimal h42;
|
||||
|
||||
@TableField(value = "h43")
|
||||
private BigDecimal h43;
|
||||
|
||||
@TableField(value = "h44")
|
||||
private BigDecimal h44;
|
||||
|
||||
@TableField(value = "h45")
|
||||
private BigDecimal h45;
|
||||
|
||||
@TableField(value = "h46")
|
||||
private BigDecimal h46;
|
||||
|
||||
@TableField(value = "h47")
|
||||
private BigDecimal h47;
|
||||
|
||||
@TableField(value = "h48")
|
||||
private BigDecimal h48;
|
||||
|
||||
@TableField(value = "h49")
|
||||
private BigDecimal h49;
|
||||
|
||||
@TableField(value = "h50")
|
||||
private BigDecimal h50;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cvt_line_relation")
|
||||
public class CvtLineRelation {
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* cvt系数表id
|
||||
*/
|
||||
@TableField(value = "cvt_id")
|
||||
private String cvtId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/01/22 下午 1:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pq_device_process")
|
||||
public class DeviceProcess implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//设备id
|
||||
private String id;
|
||||
//设备设备所在前置机进程号
|
||||
private Integer processNo;
|
||||
|
||||
}
|
||||
@@ -55,6 +55,14 @@ public class Node extends BaseEntity {
|
||||
*/
|
||||
private Integer nodeDevNum;
|
||||
|
||||
|
||||
/**
|
||||
* 前置机支持最大进程数量
|
||||
*/
|
||||
private Integer maxProcessNum;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CvtHarmonicCorrectionFactorsVO {
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* cvt名称
|
||||
*/
|
||||
private String cvtName;
|
||||
|
||||
/**
|
||||
* cvt型号
|
||||
*/
|
||||
private String cvtModel;
|
||||
|
||||
private BigDecimal h2;
|
||||
|
||||
private BigDecimal h3;
|
||||
|
||||
private BigDecimal h4;
|
||||
|
||||
private BigDecimal h5;
|
||||
|
||||
private BigDecimal h6;
|
||||
|
||||
private BigDecimal h7;
|
||||
|
||||
private BigDecimal h8;
|
||||
|
||||
private BigDecimal h9;
|
||||
|
||||
private BigDecimal h10;
|
||||
|
||||
private BigDecimal h11;
|
||||
|
||||
private BigDecimal h12;
|
||||
|
||||
private BigDecimal h13;
|
||||
|
||||
private BigDecimal h14;
|
||||
|
||||
private BigDecimal h15;
|
||||
|
||||
private BigDecimal h16;
|
||||
|
||||
private BigDecimal h17;
|
||||
|
||||
private BigDecimal h18;
|
||||
|
||||
private BigDecimal h19;
|
||||
|
||||
private BigDecimal h20;
|
||||
|
||||
private BigDecimal h21;
|
||||
|
||||
private BigDecimal h22;
|
||||
|
||||
private BigDecimal h23;
|
||||
|
||||
private BigDecimal h24;
|
||||
|
||||
private BigDecimal h25;
|
||||
|
||||
private BigDecimal h26;
|
||||
|
||||
private BigDecimal h27;
|
||||
|
||||
private BigDecimal h28;
|
||||
|
||||
private BigDecimal h29;
|
||||
|
||||
private BigDecimal h30;
|
||||
|
||||
private BigDecimal h31;
|
||||
|
||||
private BigDecimal h32;
|
||||
|
||||
private BigDecimal h33;
|
||||
|
||||
private BigDecimal h34;
|
||||
|
||||
private BigDecimal h35;
|
||||
|
||||
private BigDecimal h36;
|
||||
|
||||
private BigDecimal h37;
|
||||
|
||||
private BigDecimal h38;
|
||||
|
||||
private BigDecimal h39;
|
||||
|
||||
private BigDecimal h40;
|
||||
|
||||
private BigDecimal h41;
|
||||
|
||||
private BigDecimal h42;
|
||||
|
||||
private BigDecimal h43;
|
||||
|
||||
private BigDecimal h44;
|
||||
|
||||
private BigDecimal h45;
|
||||
|
||||
private BigDecimal h46;
|
||||
|
||||
private BigDecimal h47;
|
||||
|
||||
private BigDecimal h48;
|
||||
|
||||
private BigDecimal h49;
|
||||
|
||||
private BigDecimal h50;
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class DeviceUtil {
|
||||
public static String decoderString(Integer cd,String content){
|
||||
String seriesTmp = null;
|
||||
if (cd == 0) {
|
||||
seriesTmp = Base64.decodeBase64(content).toString();
|
||||
seriesTmp = new String(Base64.decodeBase64(content));
|
||||
} else if (cd == 1) {
|
||||
seriesTmp = ThreeDesUtil.decryptThreeDes(content);
|
||||
} else if (cd == 2) {
|
||||
|
||||
@@ -45,6 +45,15 @@
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -41,6 +42,15 @@ public class CommLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getPollutionLineInfo")
|
||||
@ApiOperation("获取污区值监测点相关信息")
|
||||
public HttpResult<List<PollutionLineInfoDTO>> getPollutionLineInfo(@RequestParam("id") List<String> id) {
|
||||
String methodDescribe = getMethodDescribe("getPollutionLineInfo");
|
||||
List<PollutionLineInfoDTO> result = lineService.getPollutionLineInfo(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineAllDetail")
|
||||
@ApiOperation("获取监测点id取超标监测点信息")
|
||||
|
||||
@@ -179,7 +179,7 @@ public class CommTerminalController extends BaseController {
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDevice");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,0);
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,3);
|
||||
log.info("运行时长" + timer.intervalSecond());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.param.NodeParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Api(tags = "cvt系数配置")
|
||||
@RestController
|
||||
@RequestMapping("/cvt")
|
||||
@RequiredArgsConstructor
|
||||
public class CvtHarmonicCorrectionFactorsController extends BaseController {
|
||||
|
||||
private final CvtHarmonicCorrectionFactorsService cvtHarmonicCorrectionFactorsService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增cvt系数")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "cvtHarmonicCorrectionFactorsParam",required = true)
|
||||
@PostMapping("add")
|
||||
public HttpResult<Boolean> add(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.add(cvtHarmonicCorrectionFactorsParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("修改cvt系数")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "updateParam",required = true)
|
||||
@PostMapping("updateCvt")
|
||||
public HttpResult<Boolean> updateCvt(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam updateParam){
|
||||
String methodDescribe = getMethodDescribe("updateCvt");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.updateCvt(updateParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("分页查询")
|
||||
@ApiImplicitParam(value = "cvt系数信息",name = "queryParam",required = true)
|
||||
@PostMapping("queryPage")
|
||||
public HttpResult<Page<CvtHarmonicCorrectionFactorsVO>> queryPage(@Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
Page<CvtHarmonicCorrectionFactorsVO> result = cvtHarmonicCorrectionFactorsService.queryPage(queryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("列表查询")
|
||||
@PostMapping("queryList")
|
||||
public HttpResult<List<CvtHarmonicCorrectionFactorsDTO>> queryList( @Validated @RequestBody CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam){
|
||||
String methodDescribe = getMethodDescribe("queryList");
|
||||
List<CvtHarmonicCorrectionFactorsDTO> result = cvtHarmonicCorrectionFactorsService.queryList(queryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据id查询")
|
||||
@PostMapping("queryById")
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryById( @RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("queryById");
|
||||
CvtHarmonicCorrectionFactorsDTO result = new CvtHarmonicCorrectionFactorsDTO();
|
||||
CvtHarmonicCorrectionFactors cvt = cvtHarmonicCorrectionFactorsService.getById(id);
|
||||
BeanUtils.copyProperties(result,cvt);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据id删除")
|
||||
@PostMapping("deleteById")
|
||||
public HttpResult<Boolean> deleteById( @RequestParam String id){
|
||||
String methodDescribe = getMethodDescribe("deleteById");
|
||||
boolean result = cvtHarmonicCorrectionFactorsService.removeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.param.CvtLineRelationParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import com.njcn.device.pq.service.CvtLineRelationService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:29【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Api(tags = "cvt系数绑定")
|
||||
@RestController
|
||||
@RequestMapping("/cvtBind")
|
||||
@RequiredArgsConstructor
|
||||
public class CvtLineRelationController extends BaseController {
|
||||
private final CvtLineRelationService cvtLineRelationService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("新增cvt系数绑定")
|
||||
@ApiImplicitParam(value = "cvt系数绑定信息",name = "cvtLineRelationParam",required = true)
|
||||
@PostMapping("add")
|
||||
public HttpResult<Boolean> add(@Validated @RequestBody CvtLineRelationParam cvtLineRelationParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = cvtLineRelationService.add(cvtLineRelationParam);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@ApiOperation("根据监测点id查询绑定cvt系数")
|
||||
@PostMapping("queryByLineId")
|
||||
public HttpResult<CvtHarmonicCorrectionFactorsDTO> queryByLineId(@RequestParam String lineId){
|
||||
String methodDescribe = getMethodDescribe("queryByLineId");
|
||||
CvtHarmonicCorrectionFactorsDTO result = cvtLineRelationService.queryByLineId(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
@@ -183,7 +184,7 @@ public class DeviceController extends BaseController {
|
||||
@ApiOperation("修改装置通讯状态")
|
||||
public HttpResult<Boolean> updateDevComFlag(@RequestBody DevComFlagDTO devComFlagDTO) {
|
||||
String methodDescribe = getMethodDescribe("updateDevComFlag");
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Device::getComFlag, devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
boolean update = iDeviceService.lambdaUpdate().set(Objects.nonNull(devComFlagDTO.getStatus()), Device::getComFlag,devComFlagDTO.getStatus()).set(Device::getUpdateTime, devComFlagDTO.getDate()).eq(Device::getId, devComFlagDTO.getId()).update();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, update, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,14 @@ public class NodeDeviceController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("一键分配装置所属进程号")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("oneKeyDistribution")
|
||||
public HttpResult<Boolean> oneKeyDistribution(@RequestParam("nodeId") String nodeId){
|
||||
String methodDescribe = getMethodDescribe("oneKeyDistribution");
|
||||
nodeDeviceService.oneKeyDistribution(nodeId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,11 +17,14 @@ import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalBaseVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalVO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
@@ -56,7 +59,7 @@ public class TerminalBaseController extends BaseController {
|
||||
|
||||
private final TerminalBaseService terminalBaseService;
|
||||
private final GeneralDeviceService generalDeviceService;
|
||||
|
||||
private final LineService lineService;
|
||||
|
||||
/**
|
||||
* 终端新增操作
|
||||
@@ -117,6 +120,15 @@ public class TerminalBaseController extends BaseController {
|
||||
}
|
||||
}
|
||||
terminalBaseService.addTerminal(addTerminalParam);
|
||||
//新增终端后发送消息给前置重启设备
|
||||
// if (Objects.nonNull(addTerminalParam.getDeviceParam())) {
|
||||
// addTerminalParam.getDeviceParam().forEach(temp->{
|
||||
// Line line = terminalBaseService.queryTerminalByName(temp.getName());
|
||||
// terminalBaseService.askRestartDevice(line.getId(), DeviceRebootType.ADD_TERMINAL);
|
||||
// });
|
||||
//
|
||||
// }
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -145,7 +157,14 @@ public class TerminalBaseController extends BaseController {
|
||||
@GetMapping("/terminalSyncDeleteFly")
|
||||
public HttpResult<Boolean> terminalSyncDeleteFly(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("terminalSyncDeleteFly");
|
||||
//获取设备id
|
||||
LineDetailDataVO lineDetailData = lineService.getLineDetailData(lineId);
|
||||
String devId =lineDetailData.getDevId();
|
||||
|
||||
Boolean b = terminalBaseService.terminalSyncDeleteFly(lineId);
|
||||
//删除监测点即修改终端通知前置重启
|
||||
// terminalBaseService.askRestartDevice(devId,DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -192,6 +211,8 @@ public class TerminalBaseController extends BaseController {
|
||||
public HttpResult<Object> delTerminal(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("delTerminal");
|
||||
terminalBaseService.delTerminal(id);
|
||||
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -412,4 +433,31 @@ public class TerminalBaseController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("请求前置重启进程")
|
||||
@PostMapping(value = "askRestartProcess")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "processNo", value = "进程号", required = true),
|
||||
@ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> askRestartProcess(@RequestParam("processNo")Integer processNo,@RequestParam("processType")String processType,@RequestParam("deviceRebootType")String deviceRebootType) {
|
||||
String methodDescribe = getMethodDescribe("askRestartProcess");
|
||||
terminalBaseService.askRestartProcess(processNo,processType,deviceRebootType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
@ApiOperation("请求前置设备进程")
|
||||
@PostMapping(value = "askRestartDevice")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "devId", value = "设备id", required = true),
|
||||
@ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> askRestartDevice(@RequestParam("devId")String devId,@RequestParam("deviceRebootType")String deviceRebootType) {
|
||||
String methodDescribe = getMethodDescribe("askRestartDevice");
|
||||
terminalBaseService.askRestartDevice(devId,deviceRebootType);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtHarmonicCorrectionFactorsMapper extends BaseMapper<CvtHarmonicCorrectionFactors> {
|
||||
Page<CvtHarmonicCorrectionFactorsVO> queryPage(Page<Object> objectPage,@Param("ew") QueryWrapper<CvtHarmonicCorrectionFactorsVO> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.CvtLineRelation;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtLineRelationMapper extends BaseMapper<CvtLineRelation> {
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
@@ -85,4 +86,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||
List<DevDetail> selectDevByIds(@Param("ids") List<String> ids);
|
||||
|
||||
void updateDeviceRunFlag(@Param("id")String deviceId, @Param("runFlag")Integer status);
|
||||
|
||||
List<PollutionLineInfoDTO> getPollutionDeviceInfo(@Param("id")List<String> devId);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceProcessMapper extends BaseMapper<DeviceProcess> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.CvtHarmonicCorrectionFactorsMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cvt_harmonic_correction_factors-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="cvt_name" jdbcType="VARCHAR" property="cvtName" />
|
||||
<result column="cvt_model" jdbcType="VARCHAR" property="cvtModel" />
|
||||
<result column="h2" jdbcType="DECIMAL" property="h2" />
|
||||
<result column="h3" jdbcType="DECIMAL" property="h3" />
|
||||
<result column="h4" jdbcType="DECIMAL" property="h4" />
|
||||
<result column="h5" jdbcType="DECIMAL" property="h5" />
|
||||
<result column="h6" jdbcType="DECIMAL" property="h6" />
|
||||
<result column="h7" jdbcType="DECIMAL" property="h7" />
|
||||
<result column="h8" jdbcType="DECIMAL" property="h8" />
|
||||
<result column="h9" jdbcType="DECIMAL" property="h9" />
|
||||
<result column="h10" jdbcType="DECIMAL" property="h10" />
|
||||
<result column="h11" jdbcType="DECIMAL" property="h11" />
|
||||
<result column="h12" jdbcType="DECIMAL" property="h12" />
|
||||
<result column="h13" jdbcType="DECIMAL" property="h13" />
|
||||
<result column="h14" jdbcType="DECIMAL" property="h14" />
|
||||
<result column="h15" jdbcType="DECIMAL" property="h15" />
|
||||
<result column="h16" jdbcType="DECIMAL" property="h16" />
|
||||
<result column="h17" jdbcType="DECIMAL" property="h17" />
|
||||
<result column="h18" jdbcType="DECIMAL" property="h18" />
|
||||
<result column="h19" jdbcType="DECIMAL" property="h19" />
|
||||
<result column="h20" jdbcType="DECIMAL" property="h20" />
|
||||
<result column="h21" jdbcType="DECIMAL" property="h21" />
|
||||
<result column="h22" jdbcType="DECIMAL" property="h22" />
|
||||
<result column="h23" jdbcType="DECIMAL" property="h23" />
|
||||
<result column="h24" jdbcType="DECIMAL" property="h24" />
|
||||
<result column="h25" jdbcType="DECIMAL" property="h25" />
|
||||
<result column="h26" jdbcType="DECIMAL" property="h26" />
|
||||
<result column="h27" jdbcType="DECIMAL" property="h27" />
|
||||
<result column="h28" jdbcType="DECIMAL" property="h28" />
|
||||
<result column="h29" jdbcType="DECIMAL" property="h29" />
|
||||
<result column="h30" jdbcType="DECIMAL" property="h30" />
|
||||
<result column="h31" jdbcType="DECIMAL" property="h31" />
|
||||
<result column="h32" jdbcType="DECIMAL" property="h32" />
|
||||
<result column="h33" jdbcType="DECIMAL" property="h33" />
|
||||
<result column="h34" jdbcType="DECIMAL" property="h34" />
|
||||
<result column="h35" jdbcType="DECIMAL" property="h35" />
|
||||
<result column="h36" jdbcType="DECIMAL" property="h36" />
|
||||
<result column="h37" jdbcType="DECIMAL" property="h37" />
|
||||
<result column="h38" jdbcType="DECIMAL" property="h38" />
|
||||
<result column="h39" jdbcType="DECIMAL" property="h39" />
|
||||
<result column="h40" jdbcType="DECIMAL" property="h40" />
|
||||
<result column="h41" jdbcType="DECIMAL" property="h41" />
|
||||
<result column="h42" jdbcType="DECIMAL" property="h42" />
|
||||
<result column="h43" jdbcType="DECIMAL" property="h43" />
|
||||
<result column="h44" jdbcType="DECIMAL" property="h44" />
|
||||
<result column="h45" jdbcType="DECIMAL" property="h45" />
|
||||
<result column="h46" jdbcType="DECIMAL" property="h46" />
|
||||
<result column="h47" jdbcType="DECIMAL" property="h47" />
|
||||
<result column="h48" jdbcType="DECIMAL" property="h48" />
|
||||
<result column="h49" jdbcType="DECIMAL" property="h49" />
|
||||
<result column="h50" jdbcType="DECIMAL" property="h50" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, cvt_name, cvt_model, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12, h13, h14,
|
||||
h15, h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, h26, h27, h28, h29, h30, h31,
|
||||
h32, h33, h34, h35, h36, h37, h38, h39, h40, h41, h42, h43, h44, h45, h46, h47, h48,
|
||||
h49, h50, Create_By, Create_Time, Update_By, Update_Time
|
||||
</sql>
|
||||
|
||||
<select id="queryPage" resultType="com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO">
|
||||
SELECT cvt_harmonic_correction_factors.*
|
||||
FROM cvt_harmonic_correction_factors cvt_harmonic_correction_factors
|
||||
WHERE ${ew.sqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.CvtLineRelationMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.device.pq.pojo.po.CvtLineRelation">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cvt_line_relation-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="line_id" jdbcType="VARCHAR" property="lineId" />
|
||||
<result column="cvt_id" jdbcType="VARCHAR" property="cvtId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, line_id, cvt_id
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -340,4 +340,45 @@
|
||||
bdName,
|
||||
devName
|
||||
</select>
|
||||
|
||||
<select id="getPollutionDeviceInfo" resultType="com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO">
|
||||
SELECT
|
||||
line.id lineId,
|
||||
gdinfo.NAME AS gdName,
|
||||
substation.NAME AS subStationName,
|
||||
device.NAME AS devName,
|
||||
deviceDetail.Com_Flag AS comFlag,
|
||||
lineDetail.power_Flag AS powerFlag,
|
||||
lineDetail.business_type AS businessType,
|
||||
lineDetail.load_type AS loadtype,
|
||||
lineDetail.obj_name AS objName,
|
||||
lineDetail.power_substation_name AS powerSubstationName,
|
||||
deviceDetail.manufacturer AS manufacturer,
|
||||
deviceDetail.dev_Type AS devType,
|
||||
deviceDetail.login_Time AS loginTime,
|
||||
deviceDetail.id deviceId,
|
||||
pv.scale lineVoltage,
|
||||
lineDetail.monitor_id monitorId
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail lineDetail,
|
||||
pq_line subv,
|
||||
pq_line device,
|
||||
pq_device deviceDetail,
|
||||
pq_line substation,
|
||||
pq_line gdinfo,
|
||||
pq_voltage pv
|
||||
WHERE line.id in
|
||||
<foreach collection="id" close=")" item="item" open="(" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND line.id = lineDetail.id
|
||||
AND line.pid = subv.id
|
||||
AND subv.pid = device.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gdinfo.id
|
||||
AND subv.id = pv.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DeviceProcessMapper">
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1802,7 +1802,7 @@
|
||||
line.Name name,
|
||||
pq_line_detail.Num lineNo,
|
||||
s1.Name voltageLevel,
|
||||
pq_line_detail.PT_Phase_Type ptType,
|
||||
pq_line_detail.PT_Type ptType,
|
||||
pq_line_detail.Run_Flag status
|
||||
FROM
|
||||
pq_line_detail
|
||||
|
||||
@@ -14,17 +14,22 @@
|
||||
s2.Name manufacturer,
|
||||
pq_device.Com_Flag status,
|
||||
pq_device.Series series,
|
||||
pq_device_process.process_no processNo,
|
||||
pq_device.Dev_Key devKey
|
||||
FROM
|
||||
pq_node
|
||||
LEFT JOIN pq_device ON pq_node.Id = pq_device.Node_Id
|
||||
pq_device
|
||||
LEFT JOIN pq_node ON pq_node.Id = pq_device.Node_Id
|
||||
LEFT JOIN pq_line on pq_device.id = pq_line.id
|
||||
LEFT JOIN pq_device_process on pq_device_process.id = pq_device.id
|
||||
LEFT JOIN sys_dict_data s1 ON pq_device.Dev_Type = s1.id
|
||||
LEFT JOIN sys_dict_data s2 ON pq_device.Manufacturer = s2.id
|
||||
<where>
|
||||
<if test="nodeDeviceParam.ip!=null and nodeDeviceParam.ip != ''">
|
||||
pq_node.ip=#{nodeDeviceParam.ip}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.devId!=null and nodeDeviceParam.devId != ''">
|
||||
pq_device.id=#{nodeDeviceParam.devId}
|
||||
</if>
|
||||
<if test="nodeDeviceParam.runFlag!=null and nodeDeviceParam.runFlag.size()!=0">
|
||||
AND pq_device.Run_Flag in
|
||||
<foreach collection="nodeDeviceParam.runFlag" open="(" close=")" item="item" separator=",">
|
||||
|
||||
@@ -158,8 +158,10 @@
|
||||
gd.name electricPowerCompany,
|
||||
b.IP DeviceIP,
|
||||
b.id deviceId,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
-- ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
-- ifnull(convert(m.Actual_Value/1024/1024,decimal(7,2)),0) statisValue
|
||||
COALESCE(d.flow, (SELECT flow FROM cld_flow_meal WHERE type = 0 AND flag = 1)) + COALESCE(d1.flow, 0) AS flowMeal,
|
||||
COALESCE(CAST(m.Actual_Value / 1024 / 1024 AS DECIMAL(7, 2)), 0) AS statisValue
|
||||
FROM pq_line a
|
||||
INNER JOIN pq_line sub ON sub.id = a.pid
|
||||
INNER JOIN pq_line gd ON gd.id = sub.pid
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtHarmonicCorrectionFactorsService extends IService<CvtHarmonicCorrectionFactors>{
|
||||
|
||||
|
||||
boolean add(CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam);
|
||||
|
||||
boolean updateCvt(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam updateParam);
|
||||
|
||||
Page<CvtHarmonicCorrectionFactorsVO> queryPage(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam);
|
||||
|
||||
List<CvtHarmonicCorrectionFactorsDTO> queryList(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtLineRelationParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtLineRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CvtLineRelationService extends IService<CvtLineRelation>{
|
||||
|
||||
|
||||
boolean add(CvtLineRelationParam cvtLineRelationParam);
|
||||
|
||||
CvtHarmonicCorrectionFactorsDTO queryByLineId(String lineId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
|
||||
/**
|
||||
* 监测点类
|
||||
* @author denghuajun
|
||||
* @date 2022/2/23
|
||||
*
|
||||
*/
|
||||
public interface DeviceProcessService extends IService<DeviceProcess> {
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
@@ -234,4 +235,10 @@ public interface LineService extends IService<Line> {
|
||||
|
||||
List<String> getLevelMonitorByDept(@RequestParam("level") String level, @RequestParam("deptId")String deptId);
|
||||
|
||||
/**
|
||||
* 获取污区值监测点相关信息
|
||||
* @author hongawen
|
||||
*/
|
||||
List<PollutionLineInfoDTO> getPollutionLineInfo(List<String> id);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,4 +16,6 @@ import java.util.List;
|
||||
|
||||
public interface NodeDeviceService {
|
||||
List<DeviceInfo> nodeDeviceList(NodeDeviceParam nodeDeviceParam);
|
||||
|
||||
void oneKeyDistribution(String nodeId);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,14 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
TerminalVO queryTerminal(String id);
|
||||
|
||||
/**
|
||||
* 终端查询操作
|
||||
* @param devName 设备名称
|
||||
* @author cdf
|
||||
* @date 2021/7/19
|
||||
*/
|
||||
Line queryTerminalByName(String devName);
|
||||
|
||||
/**
|
||||
* 终端删除操作
|
||||
* @param id 设备id
|
||||
@@ -275,4 +283,9 @@ public interface TerminalBaseService {
|
||||
* @return
|
||||
*/
|
||||
Boolean terminalSyncDeleteFly(String lineId);
|
||||
|
||||
//通知前置重启设备
|
||||
void askRestartProcess(Integer processNo,String processType,String deviceRebootType);
|
||||
|
||||
void askRestartDevice(String devId, String deviceRebootType);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type) {
|
||||
List<DeptGetDeviceDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),3,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),type,deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetDeviceDTO deptGetDeviceDTO = new DeptGetDeviceDTO();
|
||||
deptGetDeviceDTO.setUnitId(item.getUnitId());
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtHarmonicCorrectionFactorsParam;
|
||||
import com.njcn.device.pq.pojo.vo.CvtHarmonicCorrectionFactorsVO;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.CvtHarmonicCorrectionFactorsMapper;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/10 下午 1:45【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class CvtHarmonicCorrectionFactorsServiceImpl extends ServiceImpl<CvtHarmonicCorrectionFactorsMapper, CvtHarmonicCorrectionFactors> implements CvtHarmonicCorrectionFactorsService{
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam) {
|
||||
//校验
|
||||
checkParam(cvtHarmonicCorrectionFactorsParam, false);
|
||||
CvtHarmonicCorrectionFactors cvtHarmonicCorrectionFactors = new CvtHarmonicCorrectionFactors();
|
||||
BeanUtils.copyProperties(cvtHarmonicCorrectionFactorsParam,cvtHarmonicCorrectionFactors);
|
||||
boolean save = this.save(cvtHarmonicCorrectionFactors);
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCvt(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam updateParam) {
|
||||
//校验
|
||||
checkParam(updateParam, true);
|
||||
CvtHarmonicCorrectionFactors cvtHarmonicCorrectionFactors = new CvtHarmonicCorrectionFactors();
|
||||
BeanUtils.copyProperties(updateParam,cvtHarmonicCorrectionFactors);
|
||||
boolean update = this.updateById(cvtHarmonicCorrectionFactors);
|
||||
return update;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<CvtHarmonicCorrectionFactorsVO> queryPage(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam) {
|
||||
|
||||
QueryWrapper<CvtHarmonicCorrectionFactorsVO> queryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(queryParam)) {
|
||||
if (StringUtils.isNotEmpty(queryParam.getSearchBeginTime()) && StringUtils.isNotEmpty(queryParam.getSearchEndTime())) {
|
||||
queryWrapper.between("cvt_harmonic_correction_factors.create_time",
|
||||
DateUtil.beginOfDay(DateUtil.parse(queryParam.getSearchBeginTime())),
|
||||
DateUtil.endOfDay(DateUtil.parse(queryParam.getSearchEndTime())));
|
||||
}
|
||||
|
||||
queryWrapper.and(temp->temp.like("cvt_harmonic_correction_factors.cvt_name", queryParam.getSearchValue())
|
||||
.or()
|
||||
.like("cvt_harmonic_correction_factors.cvt_model", queryParam.getSearchValue()));
|
||||
|
||||
|
||||
}
|
||||
queryWrapper
|
||||
.orderByDesc("cvt_harmonic_correction_factors.Update_Time");
|
||||
Page<CvtHarmonicCorrectionFactorsVO> page = this.baseMapper.queryPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CvtHarmonicCorrectionFactorsDTO> queryList(CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamQueryParam queryParam) {
|
||||
List<CvtHarmonicCorrectionFactorsDTO> result = new ArrayList<>();
|
||||
List<CvtHarmonicCorrectionFactors> list = this.lambdaQuery().and(item -> item.like(CvtHarmonicCorrectionFactors::getCvtName, queryParam.getSearchValue()).or()
|
||||
.like(CvtHarmonicCorrectionFactors::getCvtModel, queryParam.getSearchValue())).list();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
result = list.stream().map(temp->{
|
||||
CvtHarmonicCorrectionFactorsDTO cvtHarmonicCorrectionFactorsDTO = new CvtHarmonicCorrectionFactorsDTO();
|
||||
BeanUtils.copyProperties(temp,cvtHarmonicCorrectionFactorsDTO);
|
||||
return cvtHarmonicCorrectionFactorsDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void checkParam(CvtHarmonicCorrectionFactorsParam cvtHarmonicCorrectionFactorsParam, Boolean updateFlag) {
|
||||
|
||||
// Pattern pattern = Pattern.compile(PatternRegex.SPECIALCHARACTER);
|
||||
// if(pattern.matcher(cvtHarmonicCorrectionFactorsParam.getCvtName()).find()){
|
||||
// throw new BusinessException(ValidMessage.NAME_SPECIAL_REGEX);
|
||||
// }
|
||||
// if(pattern.matcher(cvtHarmonicCorrectionFactorsParam.getCvtModel()).find()){
|
||||
// throw new BusinessException(ValidMessage.NAME_SPECIAL_REGEX);
|
||||
// }
|
||||
|
||||
LambdaQueryWrapper<CvtHarmonicCorrectionFactors> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.and(item->item.eq(CvtHarmonicCorrectionFactors::getCvtName,cvtHarmonicCorrectionFactorsParam.getCvtName()).or()
|
||||
.eq(CvtHarmonicCorrectionFactors::getCvtModel,cvtHarmonicCorrectionFactorsParam.getCvtModel()));
|
||||
|
||||
if (updateFlag) {
|
||||
if (cvtHarmonicCorrectionFactorsParam instanceof CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam) {
|
||||
//修改
|
||||
lambdaQueryWrapper.ne(CvtHarmonicCorrectionFactors::getId, ((CvtHarmonicCorrectionFactorsParam.CvtHarmonicCorrectionFactorsParamUpdateParam) cvtHarmonicCorrectionFactorsParam).getId());
|
||||
}
|
||||
}
|
||||
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException("存在同名cvt名称或cvt型号");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
|
||||
import com.njcn.device.pq.pojo.param.CvtLineRelationParam;
|
||||
import com.njcn.device.pq.pojo.po.CvtHarmonicCorrectionFactors;
|
||||
import com.njcn.device.pq.service.CvtHarmonicCorrectionFactorsService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.pojo.po.CvtLineRelation;
|
||||
import com.njcn.device.pq.mapper.CvtLineRelationMapper;
|
||||
import com.njcn.device.pq.service.CvtLineRelationService;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/02/11 上午 9:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class CvtLineRelationServiceImpl extends ServiceImpl<CvtLineRelationMapper, CvtLineRelation> implements CvtLineRelationService{
|
||||
|
||||
private final CvtHarmonicCorrectionFactorsService cvtHarmonicCorrectionFactorsService;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean add(CvtLineRelationParam cvtLineRelationParam) {
|
||||
CvtLineRelation one = this.lambdaQuery().eq(CvtLineRelation::getLineId, cvtLineRelationParam.getLineId()).one();
|
||||
if(Objects.isNull(one)){
|
||||
CvtLineRelation cvtLineRelation = new CvtLineRelation();
|
||||
BeanUtils.copyProperties(cvtLineRelationParam,cvtLineRelation);
|
||||
|
||||
this.save(cvtLineRelation);
|
||||
}else {
|
||||
one.setCvtId(cvtLineRelationParam.getCvtId());
|
||||
this.updateById(one);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CvtHarmonicCorrectionFactorsDTO queryByLineId(String lineId) {
|
||||
CvtHarmonicCorrectionFactorsDTO cvtHarmonicCorrectionFactorsDTO = new CvtHarmonicCorrectionFactorsDTO();
|
||||
CvtLineRelation one = this.lambdaQuery().eq(CvtLineRelation::getLineId, lineId).one();
|
||||
if(Objects.nonNull(one)&& StringUtils.isNotEmpty(one.getCvtId())){
|
||||
CvtHarmonicCorrectionFactors byId = cvtHarmonicCorrectionFactorsService.getById(one.getCvtId());
|
||||
BeanUtils.copyProperties(byId,cvtHarmonicCorrectionFactorsDTO);
|
||||
}
|
||||
return cvtHarmonicCorrectionFactorsDTO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
import com.njcn.device.pq.mapper.DeviceBakMapper;
|
||||
import com.njcn.device.pq.mapper.DeviceProcessMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.service.DeviceProcessService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/01/22 下午 1:59【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceProcessServiceImpl extends ServiceImpl<DeviceProcessMapper, DeviceProcess> implements DeviceProcessService {
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.mapper.*;
|
||||
@@ -738,6 +739,39 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PollutionLineInfoDTO> getPollutionLineInfo(List<String> lineId) {
|
||||
List<PollutionLineInfoDTO> pollutionLineInfoDTOList;
|
||||
// 获取终端信息
|
||||
pollutionLineInfoDTOList = deviceMapper.getPollutionDeviceInfo(lineId);
|
||||
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
List<DictData> devTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_TYPE.getCode()).getData();
|
||||
List<DictData> businessTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.BUSINESS_TYPE.getCode()).getData();
|
||||
List<DictData> loadTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.INTERFERENCE_SOURCE_TYPE.getCode()).getData();
|
||||
List<DictData> voltageList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
for (PollutionLineInfoDTO pollutionLineInfoDTO : pollutionLineInfoDTOList) {
|
||||
// 制造厂商
|
||||
Optional<DictData> temp = manufacturerList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getManufacturer())).findAny();
|
||||
pollutionLineInfoDTO.setManufacturer(temp.map(DictData::getName).orElse(null));
|
||||
// 终端类型
|
||||
Optional<DictData> temp1 = devTypeList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getDevType())).findAny();
|
||||
pollutionLineInfoDTO.setDevType(temp1.map(DictData::getName).orElse(null));
|
||||
// 行业类型
|
||||
Optional<DictData> temp2 = businessTypeList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getBusinessType())).findAny();
|
||||
pollutionLineInfoDTO.setBusinessType(temp2.map(DictData::getName).orElse(null));
|
||||
// 干扰源类型
|
||||
Optional<DictData> temp3 = loadTypeList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getLoadType())).findAny();
|
||||
pollutionLineInfoDTO.setLoadType(temp3.map(DictData::getName).orElse(null));
|
||||
// 电压等级
|
||||
Optional<DictData> temp4 = voltageList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getLineVoltage())).findAny();
|
||||
pollutionLineInfoDTO.setLineVoltage(temp4.map(DictData::getName).orElse(null));
|
||||
|
||||
// 电网侧
|
||||
pollutionLineInfoDTO.setPowerFlag(pollutionLineInfoDTO.getPowerFlag().equals("0") ? "电网侧" : "非电网侧");
|
||||
}
|
||||
return pollutionLineInfoDTOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
@@ -1,15 +1,28 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.DeviceMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfo;
|
||||
import com.njcn.device.pq.pojo.param.NodeDeviceParam;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.device.pq.service.DeviceProcessService;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.device.pq.service.NodeDeviceService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -23,6 +36,8 @@ import java.util.List;
|
||||
public class NodeDeviceServiceImpl implements NodeDeviceService {
|
||||
private final NodeMapper nodeMapper;
|
||||
private final LineMapper lineMapper;
|
||||
private final IDeviceService iDeviceService;
|
||||
private final DeviceProcessService deviceProcessService;
|
||||
@Override
|
||||
public List<DeviceInfo> nodeDeviceList(NodeDeviceParam nodeDeviceParam) {
|
||||
|
||||
@@ -34,4 +49,37 @@ public class NodeDeviceServiceImpl implements NodeDeviceService {
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oneKeyDistribution(String nodeId) {
|
||||
Node node = nodeMapper.selectById(nodeId);
|
||||
Integer nodeDevNum = node.getNodeDevNum();
|
||||
Integer maxProcessNum = node.getMaxProcessNum();
|
||||
List<Device> list = iDeviceService.lambdaQuery().eq(Device::getNodeId, nodeId).list();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
throw new BusinessException(PvDeviceResponseEnum.NO_DEVICE);
|
||||
|
||||
}
|
||||
List<String> deviceIdList = list.stream().map(Device::getId).collect(Collectors.toList());
|
||||
List<DeviceProcess> deviceProcessList = deviceProcessService.lambdaQuery().in(DeviceProcess::getId, deviceIdList).list();
|
||||
Integer devNum = list.size();
|
||||
if(nodeDevNum<devNum){
|
||||
throw new BusinessException(PvDeviceResponseEnum.OVER_LIMIT);
|
||||
}
|
||||
//单个进程支持最大装置数
|
||||
int maxDevNum = nodeDevNum / maxProcessNum;
|
||||
|
||||
List<List<DeviceProcess>> partition = ListUtils.partition(deviceProcessList, maxProcessNum);
|
||||
for (int i = 0; i < partition.size(); i++) {
|
||||
int processNo = i+1;
|
||||
partition.get(i).forEach(temp->{
|
||||
temp.setProcessNo(processNo);
|
||||
});
|
||||
}
|
||||
List<DeviceProcess> collect = partition.stream().flatMap(List::stream).collect(Collectors.toList());
|
||||
|
||||
//更新进程号
|
||||
deviceProcessService.updateBatchById(collect);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ 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.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.param.oracle.*;
|
||||
@@ -45,6 +46,10 @@ import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.*;
|
||||
import com.njcn.device.pq.utils.DeviceUtil;
|
||||
import com.njcn.device.pq.utils.ExcelStyleUtil;
|
||||
import com.njcn.message.api.ProduceFeignClient;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.message.message.DeviceRebootMessage;
|
||||
import com.njcn.message.message.ProcessRebootMessage;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
@@ -88,7 +93,6 @@ import java.util.stream.Stream;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> implements TerminalBaseService {
|
||||
|
||||
private final DeviceMapper deviceMapper;
|
||||
private final SuperDataMapper superDataMapper;
|
||||
private final IPqsTerminalLogsService iPqsTerminalLogsService;
|
||||
@@ -107,7 +111,9 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
|
||||
private final NodeDeviceService nodeDeviceService;
|
||||
private final DeviceProcessService deviceProcessService;
|
||||
private final ProduceFeignClient produceFeignClient;
|
||||
@Value("${oracle.isSync}")
|
||||
private Boolean isSync;
|
||||
|
||||
@@ -274,8 +280,41 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deviceDetail.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
//处理装置识别码秘钥
|
||||
coderM3d(deviceDetail);
|
||||
coderM3d(deviceDetail, false);
|
||||
deviceMapper.insert(deviceDetail);
|
||||
//添加装置进程号
|
||||
Node nodeById = nodeService.getNodeById(deviceDetail.getNodeId());
|
||||
List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>().lambda().eq(Device::getNodeId, deviceDetail.getNodeId()));
|
||||
Integer maxNodeDevNum = nodeById.getNodeDevNum();
|
||||
Integer maxProcessNum = nodeById.getMaxProcessNum();
|
||||
if (devices.size() >= maxNodeDevNum) {
|
||||
throw new BusinessException(PvDeviceResponseEnum.OVER_LIMIT);
|
||||
}
|
||||
List<String> deviceIdList = devices.stream().map(Device::getId).collect(Collectors.toList());
|
||||
List<DeviceProcess> deviceProcessList = deviceProcessService.lambdaQuery().in(DeviceProcess::getId, deviceIdList).list();
|
||||
Map<Integer, Integer> processCountMap = null;
|
||||
if (Objects.nonNull(maxProcessNum)) {
|
||||
processCountMap = new HashMap<>();
|
||||
for (int i = 0; i < maxProcessNum; i++) {
|
||||
Integer processNum = i + 1;
|
||||
long count = deviceProcessList.stream().filter(temp -> Objects.equals(temp.getProcessNo(), processNum)).count();
|
||||
Integer processCount = Math.toIntExact(count);
|
||||
processCountMap.put(processNum, processCount);
|
||||
}
|
||||
|
||||
}else{
|
||||
processCountMap = new HashMap<>();
|
||||
}
|
||||
|
||||
//获取数量最少的线程号
|
||||
Optional<Integer> minKey = processCountMap.entrySet()
|
||||
.stream()
|
||||
.min(Comparator.comparingInt(e -> e.getValue()))
|
||||
.map(Map.Entry::getKey);
|
||||
DeviceProcess deviceProcess = new DeviceProcess();
|
||||
deviceProcess.setId(device.getId());
|
||||
deviceProcess.setProcessNo(minKey.orElse(1));
|
||||
deviceProcessService.saveOrUpdate(deviceProcess);
|
||||
//装置功能
|
||||
List<DictData> funList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.DEV_FUN.getName()).getData();
|
||||
if (CollectionUtil.isEmpty(funList)) {
|
||||
@@ -633,7 +672,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
Device deviceDetail = new Device();
|
||||
BeanUtils.copyProperties(updateDeviceParam, deviceDetail);
|
||||
deviceDetail.setId(updateDeviceParam.getDevIndex());
|
||||
coderM3d(deviceDetail);
|
||||
coderM3d(deviceDetail,true);
|
||||
this.updateById(device);
|
||||
deviceMapper.updateById(deviceDetail);
|
||||
}
|
||||
@@ -813,7 +852,17 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return true;
|
||||
}
|
||||
|
||||
private void coderM3d(Device deviceDetail){
|
||||
private void coderM3d(Device deviceDetail,Boolean updateFlag){
|
||||
if(updateFlag){
|
||||
Device deviceRes = deviceMapper.selectById(deviceDetail.getId());
|
||||
if(StrUtil.isNotBlank(deviceDetail.getDevKey()) && !deviceRes.getDevKey().equals(deviceDetail.getDevKey())){
|
||||
deviceDetail.setDevKey(DeviceUtil.encodeString(devCD,deviceDetail.getDevKey()));
|
||||
}
|
||||
|
||||
if(StrUtil.isNotBlank(deviceDetail.getSeries()) && !deviceRes.getSeries().equals(deviceDetail.getSeries())){
|
||||
deviceDetail.setSeries(DeviceUtil.encodeString(devCD,deviceDetail.getSeries()));
|
||||
}
|
||||
}else {
|
||||
if(StrUtil.isNotBlank(deviceDetail.getDevKey())){
|
||||
deviceDetail.setDevKey(DeviceUtil.encodeString(devCD,deviceDetail.getDevKey()));
|
||||
}
|
||||
@@ -821,6 +870,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deviceDetail.setSeries(DeviceUtil.encodeString(devCD,deviceDetail.getSeries()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private void decoderM3d(Device deviceDetail){
|
||||
if(StrUtil.isNotBlank(deviceDetail.getDevKey())){
|
||||
deviceDetail.setDevKey(DeviceUtil.decoderString(devCD,deviceDetail.getDevKey()));
|
||||
@@ -951,7 +1002,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
Device deviceDetail = deviceMapper.selectById(device.getId());
|
||||
//解密
|
||||
decoderM3d(deviceDetail);
|
||||
//decoderM3d(deviceDetail);
|
||||
BeanUtils.copyProperties(deviceDetail, deviceVO);
|
||||
deviceVO.setDevIndex(device.getId());
|
||||
//母线
|
||||
@@ -1011,7 +1062,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
Device deviceDetail = deviceMapper.selectById(obj.getId());
|
||||
//解密
|
||||
decoderM3d(deviceDetail);
|
||||
//decoderM3d(deviceDetail);
|
||||
BeanUtils.copyProperties(deviceDetail, deviceVO);
|
||||
deviceVO.setDevIndex(obj.getId());
|
||||
|
||||
@@ -1107,7 +1158,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deviceVO.setSort(device.getSort());
|
||||
Device deviceDetail = deviceMapper.selectById(device.getId());
|
||||
//解密
|
||||
decoderM3d(deviceDetail);
|
||||
//decoderM3d(deviceDetail);
|
||||
BeanUtils.copyProperties(deviceDetail, deviceVO);
|
||||
deviceVO.setDevIndex(device.getId());
|
||||
|
||||
@@ -1158,7 +1209,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
Device deviceDetail = deviceMapper.selectById(device.getId());
|
||||
//解密
|
||||
decoderM3d(deviceDetail);
|
||||
//decoderM3d(deviceDetail);
|
||||
BeanUtils.copyProperties(deviceDetail, deviceVO);
|
||||
deviceVO.setDevIndex(device.getId());
|
||||
|
||||
@@ -1180,6 +1231,12 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Line queryTerminalByName(String devName) {
|
||||
Line one = this.lambdaQuery().eq(Line::getName, devName).one();
|
||||
return one;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean delTerminal(String id) {
|
||||
@@ -1455,7 +1512,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||
|
||||
// 删除终端通知前置重启
|
||||
// this.askRestartDevice(id,DeviceRebootType.DELETE_TERMINAL);
|
||||
|
||||
}
|
||||
|
||||
@@ -1476,7 +1534,9 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
LambdaQueryWrapper<DeptLine> lineLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lineLambdaQueryWrapper.in(DeptLine::getLineId, lineIndexList);
|
||||
deptLineMapper.delete(lineLambdaQueryWrapper);
|
||||
|
||||
//通知前置删除监测点
|
||||
// String[] split = obj.getPids().split(",");
|
||||
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
}
|
||||
|
||||
@@ -1486,6 +1546,9 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
lineDetailMapper.deleteById(obj.getId());
|
||||
overlimitMapper.deleteById(obj.getId());
|
||||
deptLineMapper.deleteById(obj.getId());
|
||||
//通知前置删除监测点
|
||||
// String[] split = obj.getPids().split(",");
|
||||
// this.askRestartDevice(split[4],DeviceRebootType.LEDGER_MODIFY);
|
||||
|
||||
} else {
|
||||
throw new BusinessException(CommonResponseEnum.FAIL);
|
||||
@@ -3503,5 +3566,69 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
throw new BusinessException("字典转换异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void askRestartProcess(Integer processNum,String processType, String processRebootType) {
|
||||
|
||||
ProcessRebootMessage procesRebootMessage = new ProcessRebootMessage();
|
||||
// procesRebootMessage.setIndex(processNum);
|
||||
// List<ProcessRebootMessage.RebootData> list = new ArrayList<>();
|
||||
// ProcessRebootMessage.RebootData rebootData = new ProcessRebootMessage.RebootData();
|
||||
//
|
||||
// rebootData.setFun(processType);
|
||||
// rebootData.setProcessNum(processNum);
|
||||
// rebootData.setFrontType(processRebootType);
|
||||
// list.add(rebootData);
|
||||
// procesRebootMessage.setData(list);
|
||||
produceFeignClient.askRestartProcess(procesRebootMessage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Async
|
||||
public void askRestartDevice(String devId, String deviceRebootType) {
|
||||
DeviceProcess one = deviceProcessService.lambdaQuery().eq(DeviceProcess::getId, devId).one();
|
||||
|
||||
DeviceRebootMessage deviceRebootMessage = new DeviceRebootMessage();
|
||||
deviceRebootMessage.setCode(deviceRebootType);
|
||||
if(Objects.equals(deviceRebootType, DeviceRebootType.DELETE_TERMINAL)){
|
||||
DeviceRebootMessage.DeviceInfo deviceInfo = new DeviceRebootMessage.DeviceInfo();
|
||||
deviceInfo.setId(devId);
|
||||
List<DeviceRebootMessage.DeviceInfo> list = new ArrayList<>();
|
||||
list.add(deviceInfo);
|
||||
deviceRebootMessage.setData(list);
|
||||
deviceRebootMessage.setIndex(one.getProcessNo());
|
||||
produceFeignClient.askRestartDevice(deviceRebootMessage);
|
||||
//删除设备进程关系
|
||||
deviceProcessService.removeById(devId);
|
||||
|
||||
}else {
|
||||
NodeDeviceParam nodeDeviceParam = new NodeDeviceParam();
|
||||
nodeDeviceParam.setDevId(devId);
|
||||
List<DeviceInfo> deviceInfos = nodeDeviceService.nodeDeviceList(nodeDeviceParam);
|
||||
if (CollectionUtil.isNotEmpty(deviceInfos)){
|
||||
deviceRebootMessage.setIndex(one.getProcessNo());
|
||||
DeviceInfo deviceInfo = deviceInfos.get(0);
|
||||
DeviceRebootMessage.DeviceInfo deviceInfo1 = new DeviceRebootMessage.DeviceInfo();
|
||||
BeanUtils.copyProperties(deviceInfo,deviceInfo1);
|
||||
List<DeviceRebootMessage.DeviceInfo.MonitorInfo> monitorInfoList=deviceInfo.getMonitorData().stream().map(tempMonitorInfo->{
|
||||
DeviceRebootMessage.DeviceInfo.MonitorInfo m = new DeviceRebootMessage.DeviceInfo.MonitorInfo();
|
||||
BeanUtils.copyProperties(tempMonitorInfo,m);
|
||||
return m;
|
||||
}).collect(Collectors.toList());
|
||||
deviceInfo1.setMonitorData(monitorInfoList);
|
||||
List<DeviceRebootMessage.DeviceInfo> list = new ArrayList<>();
|
||||
list.add(deviceInfo1);
|
||||
deviceRebootMessage.setData(list);
|
||||
produceFeignClient.askRestartDevice(deviceRebootMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.event.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EventCount implements Serializable {
|
||||
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 暂升次数 1.1~1.8
|
||||
* 10ms ~ 1min
|
||||
*/
|
||||
private int upCounts;
|
||||
|
||||
/**
|
||||
* 暂降次数 0.1~0.9
|
||||
* 10ms ~ 1min
|
||||
*/
|
||||
private int downCounts;
|
||||
|
||||
/**
|
||||
* 短时中断 0~0.1
|
||||
* 10ms ~ 1min
|
||||
*/
|
||||
private int breakCounts;
|
||||
|
||||
public EventCount(String lineId) {
|
||||
this.lineId = lineId;
|
||||
}
|
||||
}
|
||||
@@ -17,84 +17,84 @@ public class EventDipShortDistributionVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int featureAmp90with100ms;
|
||||
private int featureAmp90with250ms;
|
||||
private int featureAmp90with500ms;
|
||||
private int featureAmp90with1000ms;
|
||||
private int featureAmp90with3000ms;
|
||||
private int featureAmp90with10000ms;
|
||||
private int featureAmp90with20000ms;
|
||||
private int featureAmp90with60000ms;
|
||||
private int featureAmp90with100ms=0;
|
||||
private int featureAmp90with250ms=0;
|
||||
private int featureAmp90with500ms=0;
|
||||
private int featureAmp90with1000ms=0;
|
||||
private int featureAmp90with3000ms=0;
|
||||
private int featureAmp90with10000ms=0;
|
||||
private int featureAmp90with20000ms=0;
|
||||
private int featureAmp90with60000ms=0;
|
||||
|
||||
private int featureAmp80with100ms;
|
||||
private int featureAmp80with250ms;
|
||||
private int featureAmp80with500ms;
|
||||
private int featureAmp80with1000ms;
|
||||
private int featureAmp80with3000ms;
|
||||
private int featureAmp80with10000ms;
|
||||
private int featureAmp80with20000ms;
|
||||
private int featureAmp80with60000ms;
|
||||
private int featureAmp80with100ms=0;
|
||||
private int featureAmp80with250ms=0;
|
||||
private int featureAmp80with500ms=0;
|
||||
private int featureAmp80with1000ms=0;
|
||||
private int featureAmp80with3000ms=0;
|
||||
private int featureAmp80with10000ms=0;
|
||||
private int featureAmp80with20000ms=0;
|
||||
private int featureAmp80with60000ms=0;
|
||||
|
||||
private int featureAmp70with100ms;
|
||||
private int featureAmp70with250ms;
|
||||
private int featureAmp70with500ms;
|
||||
private int featureAmp70with1000ms;
|
||||
private int featureAmp70with3000ms;
|
||||
private int featureAmp70with10000ms;
|
||||
private int featureAmp70with20000ms;
|
||||
private int featureAmp70with60000ms;
|
||||
private int featureAmp70with100ms=0;
|
||||
private int featureAmp70with250ms=0;
|
||||
private int featureAmp70with500ms=0;
|
||||
private int featureAmp70with1000ms=0;
|
||||
private int featureAmp70with3000ms=0;
|
||||
private int featureAmp70with10000ms=0;
|
||||
private int featureAmp70with20000ms=0;
|
||||
private int featureAmp70with60000ms=0;
|
||||
|
||||
private int featureAmp60with100ms;
|
||||
private int featureAmp60with250ms;
|
||||
private int featureAmp60with500ms;
|
||||
private int featureAmp60with1000ms;
|
||||
private int featureAmp60with3000ms;
|
||||
private int featureAmp60with10000ms;
|
||||
private int featureAmp60with20000ms;
|
||||
private int featureAmp60with60000ms;
|
||||
private int featureAmp60with100ms=0;
|
||||
private int featureAmp60with250ms=0;
|
||||
private int featureAmp60with500ms=0;
|
||||
private int featureAmp60with1000ms=0;
|
||||
private int featureAmp60with3000ms=0;
|
||||
private int featureAmp60with10000ms=0;
|
||||
private int featureAmp60with20000ms=0;
|
||||
private int featureAmp60with60000ms=0;
|
||||
|
||||
private int featureAmp50with100ms;
|
||||
private int featureAmp50with250ms;
|
||||
private int featureAmp50with500ms;
|
||||
private int featureAmp50with1000ms;
|
||||
private int featureAmp50with3000ms;
|
||||
private int featureAmp50with10000ms;
|
||||
private int featureAmp50with20000ms;
|
||||
private int featureAmp50with60000ms;
|
||||
private int featureAmp50with100ms=0;
|
||||
private int featureAmp50with250ms=0;
|
||||
private int featureAmp50with500ms=0;
|
||||
private int featureAmp50with1000ms=0;
|
||||
private int featureAmp50with3000ms=0;
|
||||
private int featureAmp50with10000ms=0;
|
||||
private int featureAmp50with20000ms=0;
|
||||
private int featureAmp50with60000ms=0;
|
||||
|
||||
private int featureAmp40with100ms;
|
||||
private int featureAmp40with250ms;
|
||||
private int featureAmp40with500ms;
|
||||
private int featureAmp40with1000ms;
|
||||
private int featureAmp40with3000ms;
|
||||
private int featureAmp40with10000ms;
|
||||
private int featureAmp40with20000ms;
|
||||
private int featureAmp40with60000ms;
|
||||
private int featureAmp40with100ms=0;
|
||||
private int featureAmp40with250ms=0;
|
||||
private int featureAmp40with500ms=0;
|
||||
private int featureAmp40with1000ms=0;
|
||||
private int featureAmp40with3000ms=0;
|
||||
private int featureAmp40with10000ms=0;
|
||||
private int featureAmp40with20000ms=0;
|
||||
private int featureAmp40with60000ms=0;
|
||||
|
||||
private int featureAmp30with100ms;
|
||||
private int featureAmp30with250ms;
|
||||
private int featureAmp30with500ms;
|
||||
private int featureAmp30with1000ms;
|
||||
private int featureAmp30with3000ms;
|
||||
private int featureAmp30with10000ms;
|
||||
private int featureAmp30with20000ms;
|
||||
private int featureAmp30with60000ms;
|
||||
private int featureAmp30with100ms=0;
|
||||
private int featureAmp30with250ms=0;
|
||||
private int featureAmp30with500ms=0;
|
||||
private int featureAmp30with1000ms=0;
|
||||
private int featureAmp30with3000ms=0;
|
||||
private int featureAmp30with10000ms=0;
|
||||
private int featureAmp30with20000ms=0;
|
||||
private int featureAmp30with60000ms=0;
|
||||
|
||||
private int featureAmp20with100ms;
|
||||
private int featureAmp20with250ms;
|
||||
private int featureAmp20with500ms;
|
||||
private int featureAmp20with1000ms;
|
||||
private int featureAmp20with3000ms;
|
||||
private int featureAmp20with10000ms;
|
||||
private int featureAmp20with20000ms;
|
||||
private int featureAmp20with60000ms;
|
||||
private int featureAmp20with100ms=0;
|
||||
private int featureAmp20with250ms=0;
|
||||
private int featureAmp20with500ms=0;
|
||||
private int featureAmp20with1000ms=0;
|
||||
private int featureAmp20with3000ms=0;
|
||||
private int featureAmp20with10000ms=0;
|
||||
private int featureAmp20with20000ms=0;
|
||||
private int featureAmp20with60000ms=0;
|
||||
|
||||
private int featureAmp10with100ms;
|
||||
private int featureAmp10with250ms;
|
||||
private int featureAmp10with500ms;
|
||||
private int featureAmp10with1000ms;
|
||||
private int featureAmp10with3000ms;
|
||||
private int featureAmp10with10000ms;
|
||||
private int featureAmp10with20000ms;
|
||||
private int featureAmp10with60000ms;
|
||||
private int featureAmp10with100ms=0;
|
||||
private int featureAmp10with250ms=0;
|
||||
private int featureAmp10with500ms=0;
|
||||
private int featureAmp10with1000ms=0;
|
||||
private int featureAmp10with3000ms=0;
|
||||
private int featureAmp10with10000ms=0;
|
||||
private int featureAmp10with20000ms=0;
|
||||
private int featureAmp10with60000ms=0;
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@ public class EventRiseDistributionTableVO implements Serializable {
|
||||
* 持续时间100ms-500ms
|
||||
*/
|
||||
@ApiModelProperty(name = "duration500",value = "持续时间100ms-500ms")
|
||||
private Integer duration500;
|
||||
private Integer duration500=0;
|
||||
|
||||
/**
|
||||
* 持续时间500ms-5000ms
|
||||
*/
|
||||
@ApiModelProperty(name = "duration5000",value = "持续时间500ms-5000ms")
|
||||
private Integer duration5000;
|
||||
private Integer duration5000=0;
|
||||
|
||||
/**
|
||||
* 持续时间5000ms-60000ms
|
||||
*/
|
||||
@ApiModelProperty(name = "duration60000",value = "持续时间5000ms-60000ms")
|
||||
private Integer duration60000;
|
||||
private Integer duration60000=0;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.event.utils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
/**
|
||||
* Description:暂态事件工具类
|
||||
* Date: 2025/03/12 上午 9:26【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public class EventUtil {
|
||||
/**
|
||||
* @Description: 暂态严重度计算
|
||||
* @Param: persisttime持续时间毫秒,eventvaule暂减深度
|
||||
* @return: java.lang.String
|
||||
* @Author: clam
|
||||
* @Date: 2025/03/12
|
||||
*/
|
||||
public static String getYzd(Float persisttime, Float eventvaule) {
|
||||
float yzd;
|
||||
DecimalFormat df = new DecimalFormat("0.000");// 格式化小数
|
||||
if (persisttime <= 20) {
|
||||
yzd = 1 - eventvaule;
|
||||
} else if (persisttime > 20 && persisttime <= 200) {
|
||||
yzd = 2 * (1 - eventvaule);
|
||||
} else if (persisttime > 200 && persisttime <= 500) {
|
||||
yzd = 3.3f * (1 - eventvaule);
|
||||
} else if (persisttime > 500 && persisttime <= 10000) {
|
||||
yzd = 5 * (1 - eventvaule);
|
||||
} else {
|
||||
yzd = 10 * (1 - eventvaule);
|
||||
}
|
||||
return df.format(yzd);
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,7 @@ public interface PwEventDistributionStatisticsMapper {
|
||||
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO
|
||||
*/
|
||||
EventRiseDistributionVO getEventRiseDistributionByCond(Map<String, Object> map);
|
||||
|
||||
List<RmpEventDetailPO> getEventDipShortDistributionByCondition(Map<String, Object> condMap);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,13 +34,13 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
||||
/**
|
||||
* 获取暂态事件明细
|
||||
*
|
||||
* @param monitorIds 监测点id
|
||||
* @param eventType 暂态指标类型
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 暂态事件明细
|
||||
*/
|
||||
List<RmpEventDetailPO> getDetailsOfTransientEvents(@Param("monitorIds") List<String> monitorIds,
|
||||
List<RmpEventDetailPO> getDetailsOfTransientEvents(
|
||||
// @Param("monitorIds") List<String> monitorIds,
|
||||
@Param("eventType") List<String> eventType,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
@@ -55,7 +55,8 @@ public interface PwRmpEventDetailMapper extends BaseMapper<RmpEventDetailPO> {
|
||||
* @param endTime
|
||||
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
|
||||
*/
|
||||
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds,
|
||||
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(
|
||||
// @Param("monitorIds") List<String> monitorIds,
|
||||
@Param("eventType") List<String> eventType,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
@@ -262,4 +262,39 @@
|
||||
)
|
||||
r
|
||||
</select>
|
||||
|
||||
<select id="getEventDipShortDistributionByCondition" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
|
||||
SELECT
|
||||
measurement_point_id as measurementPointId,
|
||||
start_time AS startTime,
|
||||
duration AS duration,
|
||||
feature_amplitude AS featureAmplitude
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE 1 = 1
|
||||
|
||||
AND event_type IN
|
||||
<foreach collection="eventTypeList" item="type" open="(" close=")" separator=",">
|
||||
#{type}
|
||||
</foreach>
|
||||
|
||||
<choose>
|
||||
<when test="dateType != null and dateType == 3">
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime}
|
||||
</if>
|
||||
</when>
|
||||
<when test="dateType != null and dateType == 5">
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m-%d') >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m-%d') <= #{endTime}
|
||||
</if>
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -36,11 +36,11 @@
|
||||
Event_Type as eventType
|
||||
FROM
|
||||
r_mp_event_detail
|
||||
WHERE
|
||||
measurement_point_id IN
|
||||
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
WHERE 1=1
|
||||
<!-- measurement_point_id IN-->
|
||||
<!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<if test="eventType != null and eventType.size() >0">
|
||||
AND Event_Type IN
|
||||
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
||||
@@ -71,12 +71,12 @@
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND DATE_FORMAT(start_time, '%Y-%m') <= #{endTime}
|
||||
</if>
|
||||
<if test="monitorIds != null and monitorIds.size() != 0 ">
|
||||
and measurement_point_id IN
|
||||
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- <if test="monitorIds != null and monitorIds.size() != 0 ">-->
|
||||
<!-- and measurement_point_id IN-->
|
||||
<!-- <foreach collection="monitorIds" item="item" open="(" close=")" separator=",">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<if test="eventType != null and eventType.size() >0">
|
||||
AND Event_Type IN
|
||||
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -80,14 +81,20 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
||||
|
||||
//查询暂态事件明细
|
||||
List<RmpEventDetailPO> detailList = new ArrayList<>();
|
||||
List<List<String>> partition = ListUtils.partition(monitorIdList, 20000);
|
||||
for (List<String> list : partition) {
|
||||
// List<List<String>> partition = ListUtils.partition(monitorIdList, 20000);
|
||||
// for (List<String> list : partition) {
|
||||
// if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
|
||||
// detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime));
|
||||
// } else { //按日查
|
||||
// detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime));
|
||||
// }
|
||||
// }
|
||||
if (BizParamConstant.STAT_BIZ_MONTH.equals(type + "")) { //按月查
|
||||
detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth(list, null, startTime, endTime));
|
||||
detailList.addAll(rmpEventDetailMapper.getDetailsOfTransientEventsByMonth( null, startTime, endTime));
|
||||
} else { //按日查
|
||||
detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(list, null, startTime, endTime));
|
||||
}
|
||||
detailList.addAll( rmpEventDetailMapper.getDetailsOfTransientEvents(null, startTime, endTime));
|
||||
}
|
||||
detailList = detailList.stream().filter(temp->monitorIdList.contains(temp.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(detailList)) {
|
||||
//todo 获取监测点信息接口
|
||||
pwPmsMonitorParam.setMonitorName(eventMonitorReportParam.getMonitorName());
|
||||
@@ -173,8 +180,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
||||
condMap.put("endTime", endTime);
|
||||
condMap.put("eventTypeList", Arrays.asList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_DIP.getCode()).getId(), eventStatisMapByCode.get(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getId()));
|
||||
condMap.put("dateType", type);
|
||||
EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap);
|
||||
|
||||
// EventDipShortDistributionVO eventDipShortDistribution = eventDistributionStatisticsMapper.getEventDipShortDistributionByCond(condMap);
|
||||
List<RmpEventDetailPO> eventDipShortDistributionByCondition = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(condMap);
|
||||
eventDipShortDistributionByCondition = eventDipShortDistributionByCondition.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
|
||||
EventDipShortDistributionVO eventDipShortDistribution = change(eventDipShortDistributionByCondition);
|
||||
//设置返回数据
|
||||
List<EventDipShortDistributionTableVO> list = new ArrayList<>();
|
||||
//特征幅值[80,90]
|
||||
@@ -296,12 +305,100 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
||||
return list;
|
||||
}
|
||||
|
||||
/***
|
||||
private EventDipShortDistributionVO change(List<RmpEventDetailPO> list) {
|
||||
EventDipShortDistributionVO eventDipShortDistributionVO = new EventDipShortDistributionVO();
|
||||
if(!CollectionUtils.isEmpty(list)) {
|
||||
eventDipShortDistributionVO.setFeatureAmp90with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp90with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 80 && temp.getFeatureAmplitude() <= 90 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp80with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp80with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 70 && temp.getFeatureAmplitude() <= 80 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp70with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp70with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 60 && temp.getFeatureAmplitude() <= 70 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp60with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp60with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 50 && temp.getFeatureAmplitude() <= 60 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp50with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp50with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 40 && temp.getFeatureAmplitude() <= 50 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp40with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp40with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 30 && temp.getFeatureAmplitude() <= 40 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp30with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp30with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 20 && temp.getFeatureAmplitude() <= 30 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp20with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp20with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 10 && temp.getFeatureAmplitude() <= 20 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
eventDipShortDistributionVO.setFeatureAmp10with100ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10 && temp.getDuration() <= 100).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with250ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 100 && temp.getDuration() <= 250).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 250 && temp.getDuration() <= 500).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with1000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 500 && temp.getDuration() <= 1000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with3000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 1000 && temp.getDuration() <= 3000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with10000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 3000 && temp.getDuration() <= 10000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with20000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 10000 && temp.getDuration() <= 20000).count());
|
||||
eventDipShortDistributionVO.setFeatureAmp10with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 0 && temp.getFeatureAmplitude() <= 10 && temp.getDuration() > 20000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
}
|
||||
|
||||
return eventDipShortDistributionVO;
|
||||
}
|
||||
/**
|
||||
* 暂态指标监测点电压暂升分布情况
|
||||
* @author jianghaifei
|
||||
* @date 2022-10-29 14:08
|
||||
* @date 2022-10-29 14:03
|
||||
* @param eventMonitorReportParam
|
||||
* @return com.njcn.event.pojo.vo.EventRiseDistributionVO
|
||||
* @retu4n com.njcn.event4pojo.vo.EventRiseDistributionVO
|
||||
*/
|
||||
@Override
|
||||
public List<EventRiseDistributionTableVO> getEventRiseDistributionByCond(EventMonitorReportParam eventMonitorReportParam) {
|
||||
@@ -325,7 +422,10 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
||||
riseCondMap.put("endTime", endTime);
|
||||
riseCondMap.put("eventTypeList", Collections.singletonList(eventStatisMapByCode.get(DicDataEnum.VOLTAGE_RISE.getCode()).getId()));
|
||||
riseCondMap.put("dateType", type);
|
||||
EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap);
|
||||
// EventRiseDistributionVO eventRiseDistribution = eventDistributionStatisticsMapper.getEventRiseDistributionByCond(riseCondMap);
|
||||
List<RmpEventDetailPO> rmpEventDetailPOS = eventDistributionStatisticsMapper.getEventDipShortDistributionByCondition(riseCondMap);
|
||||
rmpEventDetailPOS = rmpEventDetailPOS.stream().filter(temp->monitorIds.contains(temp.getMeasurementPointId())).collect(Collectors.toList());
|
||||
EventRiseDistributionVO eventRiseDistribution = changeEventRise(rmpEventDetailPOS);
|
||||
//设置返回数据
|
||||
List<EventRiseDistributionTableVO> list = new ArrayList<>();
|
||||
//特征幅值U1≥120
|
||||
@@ -345,4 +445,19 @@ public class PwEventMonitorReportServiceImpl implements PwEventMonitorReportServ
|
||||
list.add(entity110);
|
||||
return list;
|
||||
}
|
||||
|
||||
private EventRiseDistributionVO changeEventRise(List<RmpEventDetailPO> list) {
|
||||
EventRiseDistributionVO eventRiseDistributionVO = new EventRiseDistributionVO();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
eventRiseDistributionVO.setFeatureAmp120with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 10 && temp.getDuration() <= 500).count());
|
||||
eventRiseDistributionVO.setFeatureAmp120with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 500 && temp.getDuration() <= 5000).count());
|
||||
eventRiseDistributionVO.setFeatureAmp120with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= 120 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
|
||||
eventRiseDistributionVO.setFeatureAmp110with500ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 500 && temp.getDuration() <= 60000).count());
|
||||
eventRiseDistributionVO.setFeatureAmp110with5000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 5000 && temp.getDuration() <= 60000).count());
|
||||
eventRiseDistributionVO.setFeatureAmp110with60000ms((int) list.stream().filter(temp -> temp.getFeatureAmplitude() >= -120 && temp.getFeatureAmplitude() <= 110 && temp.getDuration() > 60000 && temp.getDuration() <= 60000).count());
|
||||
|
||||
|
||||
}
|
||||
return eventRiseDistributionVO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.event.utils.EventUtil;
|
||||
import com.njcn.event.mapper.majornetwork.EventDetailMapper;
|
||||
import com.njcn.event.pojo.dto.EventDeatilDTO;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
@@ -133,10 +134,12 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
rmpEventDetailPO.setEventType(data.getId());
|
||||
rmpEventDetailPO.setStartTime(deatilDTO.getStartTime());
|
||||
rmpEventDetailPO.setDuration(deatilDTO.getDuration()/1000);
|
||||
rmpEventDetailPO.setFeatureAmplitude(deatilDTO.getAmplitude());
|
||||
rmpEventDetailPO.setFeatureAmplitude(deatilDTO.getAmplitude()/100);
|
||||
rmpEventDetailPO.setPhase(deatilDTO.getPhase());
|
||||
rmpEventDetailPO.setWavePath(deatilDTO.getWavePath());
|
||||
rmpEventDetailPO.setEventDescribe(" ");
|
||||
String severity = EventUtil.getYzd(deatilDTO.getDuration().floatValue(),(deatilDTO.getAmplitude().floatValue()/100));
|
||||
rmpEventDetailPO.setSeverity(Double.valueOf(severity));
|
||||
rmpEventDetailPO.setCreateTime(LocalDateTime.now());
|
||||
|
||||
RmpEventDetailPO one = this.lambdaQuery().eq(RmpEventDetailPO::getLineId, rmpEventDetailPO.getLineId()).eq(RmpEventDetailPO::getStartTime, rmpEventDetailPO.getStartTime()).one();
|
||||
|
||||
@@ -196,7 +196,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
ip = monitorVO.getIp();
|
||||
}
|
||||
String waveName = eventDetail.getWavePath();
|
||||
String cfgPath, datPath;
|
||||
String cfgPath, datPath,cfgPath2,datPath2;
|
||||
if (generalInfo.getBusinessWaveFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||
cfgPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.CFG;
|
||||
datPath = generalInfo.getBusinessWavePath() + File.separator + ip + File.separator + waveName + GeneralConstant.DAT;
|
||||
@@ -210,6 +210,9 @@ public class TransientServiceImpl implements TransientService {
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
datPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT;
|
||||
//适配文件后缀小写
|
||||
cfgPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG.toLowerCase();
|
||||
datPath2 = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.DAT.toLowerCase();
|
||||
log.info("文件服务器波形文件路径----"+cfgPath);
|
||||
try (
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath);
|
||||
@@ -220,8 +223,18 @@ public class TransientServiceImpl implements TransientService {
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
InputStream cfgStream = fileStorageUtil.getFileStream(cfgPath2);
|
||||
InputStream datStream = fileStorageUtil.getFileStream(datPath2);
|
||||
if (Objects.isNull(cfgStream) || Objects.isNull(datStream)) {
|
||||
throw new BusinessException(WaveFileResponseEnum.ANALYSE_WAVE_NOT_FOUND);
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getComtrade(cfgStream, datStream, 1);
|
||||
}catch (Exception e1){
|
||||
throw new BusinessException(WaveFileResponseEnum.WAVE_DATA_INVALID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
waveDataDTO = waveFileComponent.getValidData(waveDataDTO);
|
||||
if (param.getSystemType() == 0) {
|
||||
@@ -382,7 +395,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
List<DictData> typeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
|
||||
for (EventDetailNew eventDetail : eventDetailData) {
|
||||
DecimalFormat df = new DecimalFormat("#0.000");
|
||||
eventDetail.setSeverity(Double.parseDouble(df.format(eventDetail.getSeverity())));
|
||||
eventDetail.setSeverity(Double.parseDouble(df.format(Objects.isNull(eventDetail.getSeverity())?0.00:eventDetail.getSeverity())));
|
||||
for (AreaLineInfoVO areaLineInfoVO : r) {
|
||||
if (eventDetail.getLineId().equals(areaLineInfoVO.getLineId())) {
|
||||
eventDetail.setLineId(areaLineInfoVO.getLineId());
|
||||
|
||||
@@ -215,7 +215,8 @@ whitelist:
|
||||
- /pqs-auth/oauth/getPublicKey
|
||||
- /pqs-auth/judgeToken/heBei
|
||||
- /pqs-auth/judgeToken/guangZhou
|
||||
|
||||
- /pqs-auth/judgeToken/productionManagementCheck
|
||||
-
|
||||
- /webjars/**
|
||||
- /doc.html
|
||||
- /swagger-resources/**
|
||||
|
||||
@@ -16,6 +16,10 @@ import com.njcn.harmonic.pojo.param.RMpBenchmarkLevelParam;
|
||||
import com.njcn.harmonic.pojo.po.RMpBenchmarkLevelM;
|
||||
import com.njcn.harmonic.pojo.vo.PwRMpBenchmarkLevelVO;
|
||||
import com.njcn.harmonic.service.distribution.PwRMpBenchmarkLevelMService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -26,6 +30,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author jianghf
|
||||
@@ -43,6 +48,8 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
||||
|
||||
private final DistributionMonitorClient distributionMonitorClient;
|
||||
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
|
||||
/***
|
||||
* 配网-全网基准水平
|
||||
@@ -71,6 +78,10 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
pwPmsMonitorParam.setVoltageLevels(voltageLevelParamList); //电压等级
|
||||
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.THREE_LINE.getCode(), DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
pwPmsMonitorParam.setMonitorSort(Stream.of(dictData.getId()).collect(Collectors.toList()));
|
||||
|
||||
//临时调整为查询三类测点
|
||||
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(monitorIds)) {
|
||||
return new Page<>();
|
||||
@@ -96,10 +107,11 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
||||
//监测点map key:监测点id value:监测点实体
|
||||
Map<String, PwPmsMonitorDTO> monitorMap = pwMonitorList.stream().collect(Collectors.toMap(PwPmsMonitorDTO::getMonitorId, Function.identity(), (key1, key2) -> key1));
|
||||
|
||||
List<PwRMpBenchmarkLevelVO> resultList = temList.stream().map(item -> {
|
||||
List<PwRMpBenchmarkLevelVO> resultList = temList.stream().filter(temp->monitorMap.containsKey(temp.getMeasurementPointId())).map(item -> {
|
||||
//封装前端需要的对象
|
||||
PwRMpBenchmarkLevelVO rMpBenchmarkLevelVO = new PwRMpBenchmarkLevelVO();
|
||||
BeanUtils.copyProperties(item, rMpBenchmarkLevelVO);
|
||||
if(monitorMap.containsKey(item.getMeasurementPointId())){
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo(monitorMap.get(item.getMeasurementPointId()).getOrgId()); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName(monitorMap.get(item.getMeasurementPointId()).getOrgName()); //单位名称
|
||||
@@ -107,6 +119,16 @@ public class PwRMpBenchmarkLevelMServiceImpl extends ServiceImpl<PwRMpBenchmarkL
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName(monitorMap.get(item.getMeasurementPointId()).getMonitorName()); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel(monitorMap.get(item.getMeasurementPointId()).getVoltageLevel());
|
||||
}else {
|
||||
//单位信息
|
||||
rMpBenchmarkLevelVO.setOrgNo("/"); //单位id
|
||||
rMpBenchmarkLevelVO.setOrgName("/"); //单位名称
|
||||
//监测点信息
|
||||
rMpBenchmarkLevelVO.setMeasurementPointName("/"); //监测点名称
|
||||
//电压等级
|
||||
rMpBenchmarkLevelVO.setVoltageLevel("/");
|
||||
}
|
||||
|
||||
return rMpBenchmarkLevelVO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.harmonic.pojo.po.RStatPwPermeabilityM;
|
||||
import com.njcn.harmonic.pojo.vo.RStatPwPermeabilityMVO;
|
||||
import com.njcn.harmonic.service.distribution.RStatPwPermeabilityMService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -24,6 +25,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 各渗透率光伏台区基准水平
|
||||
@@ -68,6 +70,8 @@ public class RStatPwPermeabilityMServiceImpl extends ServiceImpl<RStatPwPermeabi
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PwPmsMonitorParam pwPmsMonitorParam = new PwPmsMonitorParam();
|
||||
pwPmsMonitorParam.setOrgId(id); //单位id
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCodeAndType(DicDataEnum.THREE_LINE.getCode(), DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
pwPmsMonitorParam.setMonitorSort(Stream.of(dictData.getId()).collect(Collectors.toList()));
|
||||
List<String> monitorIds = pmsGeneralDeviceInfoClient.getPwPmsMonitorIds(pwPmsMonitorParam).getData();
|
||||
if (CollUtil.isEmpty(monitorIds)) {
|
||||
return new Page<>();
|
||||
|
||||
@@ -237,91 +237,7 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
objectListData.add(list);
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
//下面代码稳定后可删除
|
||||
/* List<HarmonicHistoryData> aList = harmonicHistoryDataList.stream()
|
||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_A))
|
||||
.collect(Collectors.toList());
|
||||
List<HarmonicHistoryData> bList = harmonicHistoryDataList.stream()
|
||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_B))
|
||||
.collect(Collectors.toList());
|
||||
List<HarmonicHistoryData> cList = harmonicHistoryDataList.stream()
|
||||
.filter(temp -> temp.getPhasicType().equalsIgnoreCase(InfluxDBTableConstant.PHASE_TYPE_C))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int maxSize = Math.max(aList.size(), Math.max(bList.size(), cList.size()));
|
||||
if (maxSize == aList.size()) {
|
||||
time = aList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
} else if (maxSize == bList.size()) {
|
||||
time = bList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
time = cList.stream()
|
||||
.map(temp -> PubUtils.instantToDate(temp.getTime()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
aValue = aList.stream()
|
||||
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
||||
.collect(Collectors.toList());
|
||||
bValue = bList.stream()
|
||||
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
||||
.collect(Collectors.toList());
|
||||
cValue = cList.stream()
|
||||
.map(temp -> BigDecimal.valueOf(temp.getAValue()).setScale(4, RoundingMode.HALF_UP).floatValue())
|
||||
.collect(Collectors.toList());
|
||||
//组装二维数组
|
||||
|
||||
boolean flagA = true,flagB = true,flagC =true;
|
||||
if(CollectionUtil.isEmpty(aValue)){
|
||||
flagA = false;
|
||||
}
|
||||
if(CollectionUtil.isEmpty(bValue)){
|
||||
flagB = false;
|
||||
}
|
||||
if(CollectionUtil.isEmpty(cValue)){
|
||||
flagC = false;
|
||||
}
|
||||
for (int i = 0; i < time.size(); i++) {
|
||||
List<Object> objects = new ArrayList<>();
|
||||
//指定
|
||||
objects.add(time.get(i));
|
||||
if(flagA){
|
||||
objects.add(aValue.get(i));
|
||||
}
|
||||
if(flagB) {
|
||||
objects.add(bValue.get(i));
|
||||
}
|
||||
if(flagC) {
|
||||
objects.add(cValue.get(i));
|
||||
}
|
||||
objectListData.add(objects);
|
||||
}
|
||||
Float aValueMin = CollectionUtil.isEmpty(aValue) ? null : Collections.min(aValue);
|
||||
Float bValueMin = CollectionUtil.isEmpty(bValue) ? null : Collections.min(bValue);
|
||||
Float cValueMin = CollectionUtil.isEmpty(cValue) ? null : Collections.min(cValue);
|
||||
Float aValueMax = CollectionUtil.isEmpty(aValue) ? null : Collections.max(aValue);
|
||||
Float bValueMax = CollectionUtil.isEmpty(bValue) ? null : Collections.max(bValue);
|
||||
Float cValueMax = CollectionUtil.isEmpty(cValue) ? null : Collections.max(cValue);
|
||||
List<Float> list = Arrays.asList(aValueMin, bValueMin, cValueMin, aValueMax, bValueMax, cValueMax);
|
||||
Optional<Float> min = list.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null值
|
||||
.min(Float::compareTo);
|
||||
if (min.isPresent()) {
|
||||
historyDataResultVO.setMinValue(min.get());
|
||||
}
|
||||
|
||||
Optional<Float> max = list.stream()
|
||||
.filter(Objects::nonNull) // 过滤掉null值
|
||||
.max(Float::compareTo);
|
||||
if (min.isPresent()) {
|
||||
historyDataResultVO.setMaxValue(max.get());
|
||||
}*/
|
||||
historyDataResultVO.setMaxValue(maxI);
|
||||
historyDataResultVO.setMinValue(minI);
|
||||
historyDataResultVO.setTopLimit(queryResultLimitVO.getTopLimit());
|
||||
@@ -526,14 +442,19 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
case 40:
|
||||
//谐波电压含有率
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, v_1 as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_v WHERE " + stringBuilder +
|
||||
targetName = "基波电压幅值";
|
||||
//修改幅值表
|
||||
sql = "SELECT time as time, v_1 as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
unit.add(pqsDeviceUnit.getPhaseVoltage());
|
||||
} else {
|
||||
targetName = "谐波电压含有率";
|
||||
sql = "SELECT time as time, v_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_v WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (number < 26) {
|
||||
topLimit = PubUtils.getValueByMethod(overlimit, "getUharm", number);
|
||||
}
|
||||
unit.add("%");
|
||||
}
|
||||
if (ptType == 0) {
|
||||
phasicType.add("A相");
|
||||
@@ -544,23 +465,28 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
phasicType.add("BC相");
|
||||
phasicType.add("CA相");
|
||||
}
|
||||
unit.add("%");
|
||||
targetName = "谐波电压含有率";
|
||||
|
||||
|
||||
break;
|
||||
case 41:
|
||||
//谐波电流含有率
|
||||
if (number == 1) {
|
||||
targetName = "谐波电流幅值";
|
||||
sql = "SELECT time as time, i_1 as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
|
||||
unit.add("A");
|
||||
} else {
|
||||
targetName = "谐波电流含有率";
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmrate_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
unit.add("%");
|
||||
}
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("%");
|
||||
targetName = "谐波电流含有率";
|
||||
|
||||
|
||||
break;
|
||||
case 42:
|
||||
//谐波电压幅值
|
||||
@@ -582,28 +508,34 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
}
|
||||
if (number == 1) {
|
||||
unit.add(pqsDeviceUnit.getVfundEffective());
|
||||
targetName = "基波电压幅值";
|
||||
|
||||
} else {
|
||||
unit.add("V");
|
||||
}
|
||||
targetName = "谐波电压幅值";
|
||||
|
||||
}
|
||||
break;
|
||||
case 43:
|
||||
//谐波电流幅值
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, i_1 as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
targetName = "基波电流幅值";
|
||||
|
||||
} else {
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
if (number < 26) {
|
||||
topLimit = PubUtils.getValueByMethod(overlimit, "getIharm", number);
|
||||
}
|
||||
targetName = "谐波电流幅值";
|
||||
|
||||
}
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("A");
|
||||
targetName = "谐波电流幅值";
|
||||
break;
|
||||
case 44:
|
||||
//谐波电压相角
|
||||
@@ -615,31 +547,37 @@ public class HistoryResultServiceImpl implements HistoryResultService {
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
}
|
||||
if (ptType == 0) {
|
||||
targetName = "基波电压相角";
|
||||
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
} else {
|
||||
targetName = "谐波电压相角";
|
||||
|
||||
phasicType.add("AB相");
|
||||
phasicType.add("BC相");
|
||||
phasicType.add("CA相");
|
||||
}
|
||||
unit.add("°");
|
||||
targetName = "谐波电压相角";
|
||||
break;
|
||||
case 45:
|
||||
//谐波电流相角
|
||||
if (number == 1) {
|
||||
sql = "SELECT time as time, i_1 as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
targetName = "基波电流相角";
|
||||
|
||||
} else {
|
||||
sql = "SELECT time as time, i_" + number + " as aValue ," + InfluxDBTableConstant.PHASIC_TYPE + " FROM data_harmphasic_i WHERE " + stringBuilder +
|
||||
" and (phasic_type ='A' or phasic_type ='B' or phasic_type ='C') order by time asc tz('Asia/Shanghai');";
|
||||
targetName = "谐波电流相角";
|
||||
|
||||
}
|
||||
phasicType.add("A相");
|
||||
phasicType.add("B相");
|
||||
phasicType.add("C相");
|
||||
unit.add("°");
|
||||
targetName = "谐波电流相角";
|
||||
break;
|
||||
case 46:
|
||||
//间谐波电压含有率
|
||||
|
||||
@@ -93,7 +93,7 @@ public class RStatOrgMServiceImpl extends ServiceImpl<RStatOrgMMapper, RStatOrgM
|
||||
if(rStatOrgM.getHarmonicMeasurementAverage()!=null&&rStatOrgM.getEffectiveMeasurementAverage()!=null&&
|
||||
rStatOrgM.getHarmonicMeasurementAverage()!=0&&rStatOrgM.getEffectiveMeasurementAverage()!=0){
|
||||
Float harmonicMeasurementRatioAverage = Float.parseFloat(
|
||||
df.format(rStatOrgM.getHarmonicMeasurementAverage()*100.0 / rStatOrgM.getEffectiveMeasurementAverage()));
|
||||
df.format(rStatOrgM.getHarmonicMeasurementAverage() / rStatOrgM.getEffectiveMeasurementAverage()));
|
||||
rStatOrgVO.setHarmonicMeasurementRatioAverage(harmonicMeasurementRatioAverage);
|
||||
}else{
|
||||
rStatOrgVO.setHarmonicMeasurementRatioAverage(0.0f);
|
||||
@@ -101,7 +101,7 @@ public class RStatOrgMServiceImpl extends ServiceImpl<RStatOrgMMapper, RStatOrgM
|
||||
if(rStatOrgM.getHarmonicMeasurementAccrued()!=null&&rStatOrgM.getEffectiveMeasurementAccrued()!=null&&
|
||||
rStatOrgM.getHarmonicMeasurementAccrued()!=0&&rStatOrgM.getEffectiveMeasurementAccrued()!=0){
|
||||
Float harmonicMeasurementRatioAccrued = Float.parseFloat(
|
||||
df.format(rStatOrgM.getHarmonicMeasurementAccrued()*100.0 / rStatOrgM.getEffectiveMeasurementAccrued() ));
|
||||
df.format(rStatOrgM.getHarmonicMeasurementAccrued() / rStatOrgM.getEffectiveMeasurementAccrued() ));
|
||||
rStatOrgVO.setHarmonicMeasurementRatioAccrued(harmonicMeasurementRatioAccrued);
|
||||
}else{
|
||||
rStatOrgVO.setHarmonicMeasurementRatioAccrued(0.0f);
|
||||
|
||||
@@ -56,13 +56,12 @@ public class RMpWpPowerDetailMServiceImpl extends ServiceImpl<RMpWpPowerDetailMM
|
||||
@Override
|
||||
public Page<RMpWpPowerDetailVO> getWindFarmDetailInfo(PowerQualityParam.PowerQualityInfoParam param) {
|
||||
//获取部门id集合
|
||||
List<DeptDTO> deptDTOS = deptFeignClient.getDepSonDetailByDeptId(param.getId()).getData();
|
||||
List<String> deptIds = deptDTOS.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
List<String> codeIds = deptFeignClient.getDepSonSelfCodetByDeptId(param.getId()).getData();
|
||||
|
||||
//根据条件查询单位下面的所有配网监测点
|
||||
PmsMonitorParam pmsMonitorParam = new PmsMonitorParam();
|
||||
//单位id
|
||||
pmsMonitorParam.setOrgIds(deptIds);
|
||||
pmsMonitorParam.setOrgIds(codeIds);
|
||||
pmsMonitorParam.setMonitorTag(param.getMonitorTag());
|
||||
pmsMonitorParam.setIsSpecialMonitor(1);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user